diff options
author | Michael Mann <mmann78@netscape.net> | 2015-11-13 20:18:34 -0500 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2015-11-14 18:00:00 +0000 |
commit | 8faf5c80b3302247c32e1f5c492cb31a082ee0ad (patch) | |
tree | e9bac5673fc9a480fe1fa06fcc6d5d7d45b37389 /epan/dissectors/packet-h264.c | |
parent | 76dec3ba681da2c315efba4433d3b1f995defd91 (diff) |
register_dissector -> new_register_dissector
Picking off "easy" dissectors that only have one or two exit points at most.
Change-Id: I25fe6a0aac93980333217d007702799d16946563
Reviewed-on: https://code.wireshark.org/review/11816
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-h264.c')
-rw-r--r-- | epan/dissectors/packet-h264.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/epan/dissectors/packet-h264.c b/epan/dissectors/packet-h264.c index 3714a6a721..2031c62cb8 100644 --- a/epan/dissectors/packet-h264.c +++ b/epan/dissectors/packet-h264.c @@ -518,8 +518,8 @@ static const e_guid_t ms_guids[3] = { { 0x05FBC6B9, 0x5A80, 0x40E5, {0xA2, 0x2A, 0xAB, 0x40, 0x20, 0x26, 0x7E, 0x26}} /* Bitstream Information */ }; -static void -dissect_h264(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); +static int +dissect_h264(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_); /* byte_aligned( ) is specified as follows. * - If the current position in the bitstream is on a byte boundary, i.e., @@ -2116,7 +2116,7 @@ dissect_h264_pacsi(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint off /* Make a new subset of the existing buffer for the NAL unit */ nalu_tvb = tvb_new_subset(tvb, offset, tvb_captured_length_remaining(tvb,offset), nal_unit_size); /* Decode the NAL unit */ - dissect_h264(nalu_tvb, pinfo, tree); + dissect_h264(nalu_tvb, pinfo, tree, NULL); offset += nal_unit_size; } } @@ -2165,7 +2165,7 @@ dissect_h264_stap(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint /* Make a new subset of the existing buffer for the NAL unit */ nalu_tvb = tvb_new_subset(tvb, offset, tvb_captured_length_remaining(tvb, offset), nal_unit_size); /* Decode the NAL unit */ - dissect_h264(nalu_tvb, pinfo, tree); + dissect_h264(nalu_tvb, pinfo, tree, NULL); offset += nal_unit_size; } } @@ -2222,7 +2222,7 @@ dissect_h264_mtap(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint /* Make a new subset of the existing buffer for the NAL unit */ nalu_tvb = tvb_new_subset(tvb, offset, tvb_captured_length_remaining(tvb, offset), nal_unit_size); /* Decode the NAL unit */ - dissect_h264(nalu_tvb, pinfo, tree); + dissect_h264(nalu_tvb, pinfo, tree, NULL); offset += nal_unit_size; } } @@ -2288,7 +2288,7 @@ dissect_h264_nalu_extension (proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo /* Make a new subset of the existing buffer for the NAL unit */ nalu_tvb = tvb_new_subset(tvb, offset, tvb_captured_length_remaining(tvb, offset), nal_unit_size); /* Decode the NAL unit */ - dissect_h264(nalu_tvb, pinfo, nimtap_tree); + dissect_h264(nalu_tvb, pinfo, nimtap_tree, NULL); offset += nal_unit_size; } } @@ -2404,8 +2404,8 @@ startover: } /* Code to actually dissect the packets */ -static void -dissect_h264(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_h264(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { int offset = 0; proto_item *item; @@ -2467,8 +2467,8 @@ dissect_h264(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if ((tvb_get_guint8(tvb, offset)&0x40) == 0x40) { col_append_fstr(pinfo->cinfo, COL_INFO, " End"); } - return; - } + return offset; + } } /* Unescape NAL unit */ @@ -2521,6 +2521,7 @@ dissect_h264(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) break; } } /* if (tree) */ + return tvb_captured_length(tvb); } @@ -3699,7 +3700,7 @@ proto_register_h264(void) "; Values must be in the range 96 - 127", &temp_dynamic_payload_type_range, 127); - register_dissector("h264", dissect_h264, proto_h264); + new_register_dissector("h264", dissect_h264, proto_h264); } |