ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] what parameters for dissector_add() for a non-nested protoco

Date: Wed, 18 Jul 2007 11:52:35 -0400
fulko.hew@xxxxxxxxx wrote on 07/18/2007 11:29:00 AM:

> Well thats what (I think) I'm now doing, and yet, the value
> isn't registered, because the 'default' dissector gets called,
> not my ipars dissector.
>
> Obviously I'm not getting something right.

... snip ...

I'm following up on my own post... again...
I figured out what was wrong, and have ammended the code snippets
below (for posterity sake... for all others that may follow.)


--------- packet-sita.c ----------

disect_sita() {
...
   if (!dissector_try_port(sita_dissector_table,
       pinfo->pseudo_header->sita.proto, tvb, pinfo, tree)) {
     call_dissector(data_handle, tvb, pinfo, tree); /* default decoder */
   }
}

proto_register_sita() {
   proto_sita = proto_register_protocol("SITA", "sita", "sita");
   sita_dissector_table = register_disector_table("sita.proto",
      "ACN protocol number", FT_UINT8, BASE_HEX);
   register_dissector("sita", dissect_sita, proto_sita);

}

proto_reg_handoff_sita() {
   sita_handle = create_dissector_handle(dissect_sita, proto_sita);
   dissector_add("wtap_encap", WTAP_ENCAP_SITA, sita_handle);
}

--------- packet_ipars.c ---------

proto_register_handoff_ipars() {
   register_dissector("ipars", dissect_ipars, proto_ipars);
}

proto_reg_handoff_ipars() {
   ipars_handle = find_dissector("ipars");
   dissector_add("sita.proto", ACN_PROTO_IPARS, ipars_handle);
}



This document is strictly confidential and intended only for use by the addressee unless otherwise stated.  If you are not the intended recipient, please notify the sender immediately and delete it from your system.