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

Wireshark-bugs: [Wireshark-bugs] [Bug 2840] New dissector IEC 60870-5-104

Date: Wed, 17 Sep 2008 12:15:58 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2840





--- Comment #7 from Bill Meier <wmeier@xxxxxxxxxxx>  2008-09-17 12:15:57 PDT ---
A few additional comments:

1.  The proto_register_iec104 function is redundant and should be removed.
    (With this function included, the script which builds the
proto_registration
     function ends up finding both this function as well 
     proto_register_iec104apci() and proto_register_iec104asdu() and thus the
     individual registration functions are each called twice. 

     If proto_register_iec104 is removed then the if (... == -1) in each of the
     proto_registration_xxx functions is not needed.

2. packet-tcp.h seems to be included twice.

3. It appears that a prefs module is never registered and thus there will be no 
   preference gui page for this protocol to allow changing the tcp port.
   (See README.developer). 

   Also: the reg_handoff needs to save the port added for any following delete.
   (See below).

void
proto_reg_handoff_iec104(void)
{
        static int iec104_prefs_initialized = FALSE;
        static dissector_handle_t iec104apci_handle;
        static guint saved_iec104port;

        if(!iec104_prefs_initialized) {
                iec104apci_handle = create_dissector_handle(dissect_iec104reas,
proto_iec104apci); 
                iec104asdu_handle = create_dissector_handle(dissect_iec104asdu,
proto_iec104asdu); 
                iec104_prefs_initialized = TRUE;
        }
        else {
                dissector_delete("tcp.port",saved_iec104port,
iec104apci_handle);

        }

        dissector_add("tcp.port", iec104port, iec104apci_handle);
        saved_iec104port = iec104port;
}


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