aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ax25-nol3.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2015-11-15 08:00:10 -0500
committerMichael Mann <mmann78@netscape.net>2015-11-16 03:50:05 +0000
commitbbdd89b973353a0df1d98d884c38f3832670bfea (patch)
tree9b992f923f565af2fcab30902508a191de85ca53 /epan/dissectors/packet-ax25-nol3.c
parent6012ba8f008bfba24fd44ce7a2a3055572453dce (diff)
create_dissector_handle -> new_create_dissector_handle
Picking off "easy" dissectors that only have one or two exit points at most. Change-Id: Ie514f126352e7598acc4f7c38db9c61d105d5e48 Reviewed-on: https://code.wireshark.org/review/11850 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-ax25-nol3.c')
-rw-r--r--epan/dissectors/packet-ax25-nol3.c58
1 files changed, 28 insertions, 30 deletions
diff --git a/epan/dissectors/packet-ax25-nol3.c b/epan/dissectors/packet-ax25-nol3.c
index 21b6f8310e..1304c368e9 100644
--- a/epan/dissectors/packet-ax25-nol3.c
+++ b/epan/dissectors/packet-ax25-nol3.c
@@ -147,8 +147,8 @@ isaprs( guint8 dti )
return b;
}
-static void
-dissect_ax25_nol3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree )
+static int
+dissect_ax25_nol3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data _U_ )
{
proto_item *ti;
proto_tree *ax25_nol3_tree;
@@ -184,39 +184,37 @@ dissect_ax25_nol3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree )
/* Call sub-dissectors here */
- if ( parent_tree )
+ /* create display subtree for the protocol */
+ ti = proto_tree_add_protocol_format( parent_tree,
+ proto_ax25_nol3,
+ tvb,
+ 0,
+ -1,
+ "AX.25 No Layer 3 - (%s)", info_buffer );
+ ax25_nol3_tree = proto_item_add_subtree( ti, ett_ax25_nol3 );
+
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
+ dissected = FALSE;
+ if ( gPREF_APRS )
{
- /* create display subtree for the protocol */
- ti = proto_tree_add_protocol_format( parent_tree,
- proto_ax25_nol3,
- tvb,
- 0,
- -1,
- "AX.25 No Layer 3 - (%s)", info_buffer );
- ax25_nol3_tree = proto_item_add_subtree( ti, ett_ax25_nol3 );
-
- next_tvb = tvb_new_subset_remaining(tvb, offset);
- dissected = FALSE;
- if ( gPREF_APRS )
+ if ( isaprs( dti ) )
{
- if ( isaprs( dti ) )
- {
- dissected = TRUE;
- call_dissector( aprs_handle , next_tvb, pinfo, ax25_nol3_tree );
- }
+ dissected = TRUE;
+ call_dissector( aprs_handle , next_tvb, pinfo, ax25_nol3_tree );
}
- if ( gPREF_DX )
+ }
+ if ( gPREF_DX )
+ {
+ if ( tvb_get_guint8( tvb, offset ) == 'D' && tvb_get_guint8( tvb, offset + 1 ) == 'X' )
{
- if ( tvb_get_guint8( tvb, offset ) == 'D' && tvb_get_guint8( tvb, offset + 1 ) == 'X' )
- {
- dissected = TRUE;
- dissect_dx( next_tvb, pinfo, ax25_nol3_tree, NULL );
- }
+ dissected = TRUE;
+ dissect_dx( next_tvb, pinfo, ax25_nol3_tree, NULL );
}
- if ( ! dissected )
- call_dissector( default_handle , next_tvb, pinfo, ax25_nol3_tree );
-
}
+ if ( ! dissected )
+ call_dissector( default_handle , next_tvb, pinfo, ax25_nol3_tree );
+
+ return tvb_captured_length(tvb);
}
void
@@ -286,7 +284,7 @@ proto_register_ax25_nol3(void)
void
proto_reg_handoff_ax25_nol3(void)
{
- dissector_add_uint( "ax25.pid", AX25_P_NO_L3, create_dissector_handle( dissect_ax25_nol3, proto_ax25_nol3 ) );
+ dissector_add_uint( "ax25.pid", AX25_P_NO_L3, new_create_dissector_handle( dissect_ax25_nol3, proto_ax25_nol3 ) );
/*
*/