This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

Problems dissecting FT_ETHER

0

Hello, I need to dissect a MAC address, but the format FT_ETHER gives me a hard time. I looked into packet_eth.c and used this code:

static int hf_mac = -1;
static void dissect_xxx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
    if (tree) {
        const guint8 *address;
        address = tvb_get_ptr(tvb, 0, 6);
    proto_tree_add_ether(tree, hf_mac, tvb, 0, 6, address);
}

}

void proto_register_xxx(void) { static hf_register_info hf[] = { {&hf_mac, {"MAC", "xxx.mac", FT_ETHER, BASE_NONE, NULL, 0x00, NULL, HFILL}}, };

[...]

}

When dissecting the packet, wireshark gives me this error:

Expert Info (Error/Malformed): proto.c:2672: failed assertion “hfinfo->type == FT_ETHER”

Why is that? I declared it as FT_ETHER…

Wireshark 1.6.4, dissector as a plugin.

asked 05 Jan ‘12, 01:19

nniico's gravatar image

nniico
1112
accept rate: 100%


One Answer:

0

My mistake : I was compiling a plug-in with sources from 1.7 and using it with a downloaded stable 1.6.4. Works like a charm on a compiled 1.7.

answered 05 Jan '12, 07:12

nniico's gravatar image

nniico
1112
accept rate: 100%