From 8589c2f11bb81dddd09d8bd2adcfb5e8a5b33dff Mon Sep 17 00:00:00 2001 From: Bill Meier Date: Tue, 4 Aug 2009 19:01:34 +0000 Subject: Minor changes: - Move proto_register...() to the end of the file as per convention; - Move ett[] to be local to proto_register...(); - "if (...==-1)" not req'd in proto_register...(); - #include not req'd; - Remove unneeded forward declarations. svn path=/trunk/; revision=29296 --- plugins/wimax/wimax_pdu_decoder.c | 72 ++++++++++++++++++--------------------- 1 file changed, 33 insertions(+), 39 deletions(-) (limited to 'plugins/wimax/wimax_pdu_decoder.c') diff --git a/plugins/wimax/wimax_pdu_decoder.c b/plugins/wimax/wimax_pdu_decoder.c index 1f98d0b028..f04e0fc9af 100644 --- a/plugins/wimax/wimax_pdu_decoder.c +++ b/plugins/wimax/wimax_pdu_decoder.c @@ -69,50 +69,11 @@ extern gint wimax_decode_dlmapc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *p /* Global Variables. */ gboolean first_gmh; -/* forward reference */ -static void dissect_wimax_pdu_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); - static gint proto_wimax_pdu_decoder = -1; static gint ett_wimax_pdu_decoder = -1; static int hf_wimax_value_bytes = -1; -/* Setup protocol subtree array */ -static gint *ett[] = -{ - &ett_wimax_pdu_decoder, -}; - -/* Register Wimax PDU Burst Protocol */ -void proto_register_wimax_pdu(void) -{ - /* PDU display */ - static hf_register_info hf[] = - { - { - &hf_wimax_value_bytes, - { - "Values", "wmx.pdu.value", - FT_BYTES, BASE_NONE, NULL, 0x0, - NULL, HFILL - } - }, - }; - - if (proto_wimax_pdu_decoder == -1) - { - proto_wimax_pdu_decoder = proto_wimax; - - register_dissector("wimax_pdu_burst_handler", dissect_wimax_pdu_decoder, -1); - proto_register_field_array(proto_wimax_pdu_decoder, hf, array_length(hf)); - proto_register_subtree_array(ett, array_length(ett)); - - proto_register_mac_header_generic(); - proto_register_mac_header_type_1(); - proto_register_mac_header_type_2(); - } -} - static void dissect_wimax_pdu_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { guint offset; @@ -268,3 +229,36 @@ static void dissect_wimax_pdu_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_t offset += length; } } + +/* Register Wimax PDU Burst Protocol */ +void proto_register_wimax_pdu(void) +{ + /* PDU display */ + static hf_register_info hf[] = + { + { + &hf_wimax_value_bytes, + { + "Values", "wmx.pdu.value", + FT_BYTES, BASE_NONE, NULL, 0x0, + NULL, HFILL + } + }, + }; + + /* Setup protocol subtree array */ + static gint *ett[] = + { + &ett_wimax_pdu_decoder, + }; + + proto_wimax_pdu_decoder = proto_wimax; + + register_dissector("wimax_pdu_burst_handler", dissect_wimax_pdu_decoder, -1); + proto_register_field_array(proto_wimax_pdu_decoder, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); + + proto_register_mac_header_generic(); + proto_register_mac_header_type_1(); + proto_register_mac_header_type_2(); +} -- cgit v1.2.3