Wireshark-bugs: [Wireshark-bugs] [Bug 2831] Add support the KDP (Kontiki Delivery Protocol)
Date: Thu, 28 Aug 2008 09:20:20 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2831





--- Comment #7 from Bill Meier <wmeier@xxxxxxxxxxx>  2008-08-28 09:20:20 PDT ---
Two additional comments:

1. proto_register_protocol should be called before calling
   proto_register_field_array. Also the 'if ...' statement is not required.

    Therefore:

    proto_kdp = proto_register_protocol("Kontiki Delivery Protocol", /* name */
                                        "KDP",          /* short name */
                                        "kdp");         /* abbrev */
    proto_register_field_array(proto_kdp, hf, array_length(hf));
    proto_register_subtree_array(ett, array_length(ett));

          I'm kind of surprised that proto_register_kdp as originally written
          worked at all. I'll take a look at the Wireshark code to see what 
          it was actually doing. I suspect
          there may be some additional checking required in the Wireshark code.

2. The following is sufficient for the proto_reg_handoff... function:

    void
    proto_reg_handoff_kdp(void) {
      dissector_handle_t kdp_handle;
      kdp_handle = create_dissector_handle(dissect_kdp, proto_kdp);
      dissector_add("udp.port", KDP_PORT, kdp_handle);
    }

    (The kdp_handle can be defined locally rather than globally).


-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.