Hi folks,
During the implementation of BACnet (Building Automatition and Control
Network) I ran across this problem by invoking ethereal (while make'ing):
** ERROR **: file packet.c: line 1216 (dissector_add): assertion failed:
(sub_dissectors)
It is my first contact with the ethereal sourcecode and I was a little bit
confused by old/new dissectors. Looking at sources packet-*.c, I recognised
several different "flavours" of calling the next dissector. Calling the
BLVC-dissector was easy (udp.port == 47808), but the BACnet-dissector isn't
(bvlc.function == 0x0b).
A good pointer to documentation addressing this problem would be fine (I've
read README.developer and README.tvbuff).
In packet-bvlc.c:
next_tvb = tvb_new_subset(tvb,offset+4,-1,npdu_length);
dissect_bacnet(next_tvb, pinfo, tree);
void
proto_register_bvlc(void)
{
static hf_register_info hf[] = {
{ ... },
{ &hf_bvlc_function,
{ "Function", "bvlc.function",
FT_UINT8, BASE_HEX, NULL, 0xff,
"BLVC Function" }
},
{ ... },
};
static gint *ett[] = {
&ett_bvlc,
};
proto_bvlc = proto_register_protocol("BACnet Virtual Link Control",
"BVLC", "bvlc");
proto_register_field_array(proto_bvlc, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
register_dissector("bvlc", dissect_bvlc, proto_bvlc);
}
... and in packet-bacnet.c:
void
proto_reg_handoff_bacnet(void)
{
dissector_add("bvlc.function", 0x0b, dissect_bacnet, proto_bacnet);
}
It would be better to include the source in the CVS-tree to have everything
handy for you. Who is in charge of that? I will supply a patch if BACnet is
wanted in Ethereal and
mail ethereal-dev < "Generate a patch file using "cvs diff [file] >
my.patch"" upon request.
Details: ethereal-0.8.15 (NOT from CVS), Linux Debian Woody,
gcc version 2.95.3 20010125 (prerelease), libpcap.0.6.1, libglib-1.2.0.0.8
Cheers, Hartmut