diff options
author | Bill Meier <wmeier@newsguy.com> | 2014-04-22 10:48:41 -0400 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2014-04-22 15:00:57 +0000 |
commit | 2d774c6f84c690ee342b3baa0070c3d480df811d (patch) | |
tree | 2afc04567e7153128190ec3219f928d633af37d6 /epan/dissectors/packet-lbmc.c | |
parent | 085b37d9b60da7428d97bf75c225eb8eaffaa652 (diff) |
Minor cleanup
- Remove unneeded #includes;
- Move proto_reg_handoff...(() to the end of the file as per convention;
- Use dissector_add_handle() instead of using dissector_add_uint(..., 0, ...);
- #if 0 an unused global function (which caused a [-Wmissing-prototypes] warning);
- Remove an empty proto_reg-handoff...();
- 'if (already_registered)' not required in one case.
Change-Id: I74f267c2721df13eb4d52d7f19a6ded423218a39
Reviewed-on: https://code.wireshark.org/review/1277
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Diffstat (limited to 'epan/dissectors/packet-lbmc.c')
-rw-r--r-- | epan/dissectors/packet-lbmc.c | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/epan/dissectors/packet-lbmc.c b/epan/dissectors/packet-lbmc.c index 1209372c8d..c9eb41a3bd 100644 --- a/epan/dissectors/packet-lbmc.c +++ b/epan/dissectors/packet-lbmc.c @@ -26,11 +26,8 @@ #include <glib.h> #include <epan/packet.h> #include <epan/prefs.h> -#include <epan/proto.h> #include <epan/expert.h> #include <epan/tap.h> -#include <epan/tfs.h> -#include <epan/value_string.h> #include <epan/wmem/wmem.h> #include <epan/to_str.h> #include "packet-lbm.h" @@ -11629,19 +11626,14 @@ int lbmc_dissect_lbmc_packet(tvbuff_t * tvb, int offset, packet_info * pinfo, pr return (len_dissected); } -/* The registration hand-off routine */ -void proto_reg_handoff_lbmc(void) +int lbmc_get_minimum_length(void) { - static gboolean already_registered = FALSE; - - if (!already_registered) - { - lbmc_data_dissector_handle = find_dissector("data"); - lbmc_uim_tap_handle = register_tap("lbm_uim"); - lbmc_stream_tap_handle = register_tap("lbm_stream"); - } + return (O_LBMC_HDR_T_MSGLEN + L_LBMC_HDR_T_MSGLEN); +} - already_registered = TRUE; +guint16 lbmc_get_message_length(tvbuff_t * tvb, int offset) +{ + return (tvb_get_ntohs(tvb, offset + O_LBMC_HDR_T_MSGLEN)); } /* Register all the bits needed with the filtering engine */ @@ -14331,14 +14323,12 @@ void proto_register_lbmc(void) lbmc_message_table = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); } -int lbmc_get_minimum_length(void) -{ - return (O_LBMC_HDR_T_MSGLEN + L_LBMC_HDR_T_MSGLEN); -} - -guint16 lbmc_get_message_length(tvbuff_t * tvb, int offset) +/* The registration hand-off routine */ +void proto_reg_handoff_lbmc(void) { - return (tvb_get_ntohs(tvb, offset + O_LBMC_HDR_T_MSGLEN)); + lbmc_data_dissector_handle = find_dissector("data"); + lbmc_uim_tap_handle = register_tap("lbm_uim"); + lbmc_stream_tap_handle = register_tap("lbm_stream"); } /* |