diff options
author | wmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7> | 2008-09-30 14:46:48 +0000 |
---|---|---|
committer | wmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7> | 2008-09-30 14:46:48 +0000 |
commit | 6261a38072cc24ed414e552af9abad125d2a4d67 (patch) | |
tree | f95e58b4cc141ad010b91cae889d19f9b04ed295 /epan/dissectors/packet-dlm3.c | |
parent | 9bf75f5ca3da8e6a32e9c5025da371997724364a (diff) |
Minor cleanup related to proto_register, proto_reg_handoff
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@26307 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-dlm3.c')
-rw-r--r-- | epan/dissectors/packet-dlm3.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/epan/dissectors/packet-dlm3.c b/epan/dissectors/packet-dlm3.c index 9ed911c340..2fa2eac5d7 100644 --- a/epan/dissectors/packet-dlm3.c +++ b/epan/dissectors/packet-dlm3.c @@ -1236,27 +1236,24 @@ proto_register_dlm3(void) } -/* Some code copyed from packet-distcc.c and packet-diameter.c. */ void proto_reg_handoff_dlm3(void) { static gboolean dissector_registered = FALSE; - static int tcp_port = 0; - static int sctp_port = 0; + static guint tcp_port; + static guint sctp_port; static dissector_handle_t dlm3_tcp_handle; static dissector_handle_t dlm3_sctp_handle; - if (dissector_registered) { + if (!dissector_registered) { + dlm3_sctp_handle = new_create_dissector_handle(dissect_dlm3, proto_dlm3); + dlm3_tcp_handle = new_create_dissector_handle(dissect_dlm3, proto_dlm3); + dissector_registered = TRUE; + } else { dissector_delete("tcp.port", tcp_port, dlm3_tcp_handle); dissector_delete("sctp.port", sctp_port, dlm3_sctp_handle); - } else { - dlm3_sctp_handle = new_create_dissector_handle(dissect_dlm3, - proto_dlm3); - dlm3_tcp_handle = new_create_dissector_handle(dissect_dlm3, - proto_dlm3); - dissector_registered = TRUE; } tcp_port = dlm3_tcp_port; |