diff options
author | wmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7> | 2008-09-02 21:40:46 +0000 |
---|---|---|
committer | wmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7> | 2008-09-02 21:40:46 +0000 |
commit | d0ff8c4e56234e0906bba7e6954ebf8f44ecb962 (patch) | |
tree | cb44013088b9a0a506145cf3eec1872a405ef71f /epan/dissectors/packet-cops.c | |
parent | 9764aab569c662fb3f01d75e4863a662148091f8 (diff) |
Cleanup related to prefs & proto_reg_handoff
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@26124 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-cops.c')
-rw-r--r-- | epan/dissectors/packet-cops.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/epan/dissectors/packet-cops.c b/epan/dissectors/packet-cops.c index 2f0abd697b..31e53337fc 100644 --- a/epan/dissectors/packet-cops.c +++ b/epan/dissectors/packet-cops.c @@ -88,12 +88,6 @@ static guint global_cops_tcp_port = TCP_PORT_COPS; /* Preference: desegmentation of COPS */ static gboolean cops_desegment = TRUE; -/* Variable to allow for proper deletion of dissector registration - * when the user changes port from the gui - */ - -static guint cops_tcp_port = 0; - #define COPS_OBJECT_HDR_SIZE 4 /* Null string of type "guchar[]". */ @@ -2431,21 +2425,21 @@ void proto_register_cops(void) void proto_reg_handoff_cops(void) { - static int cops_prefs_initialized = FALSE; + static gboolean cops_prefs_initialized = FALSE; static dissector_handle_t cops_handle; + static guint cops_tcp_port; if (!cops_prefs_initialized) { - cops_handle = create_dissector_handle(dissect_cops, proto_cops); + cops_handle = find_dissector("cops"); + dissector_add("tcp.port", TCP_PORT_PKTCABLE_COPS, cops_handle); + dissector_add("tcp.port", TCP_PORT_PKTCABLE_MM_COPS, cops_handle); cops_prefs_initialized = TRUE; - } else + } else { dissector_delete("tcp.port",cops_tcp_port,cops_handle); - - /* Set our port numbers for future use */ + } cops_tcp_port = global_cops_tcp_port; dissector_add("tcp.port", cops_tcp_port, cops_handle); - dissector_add("tcp.port", TCP_PORT_PKTCABLE_COPS, cops_handle); - dissector_add("tcp.port", TCP_PORT_PKTCABLE_MM_COPS, cops_handle); } |