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-nflog.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-nflog.c')
-rw-r--r-- | epan/dissectors/packet-nflog.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/epan/dissectors/packet-nflog.c b/epan/dissectors/packet-nflog.c index c417d0510f..8feecd6440 100644 --- a/epan/dissectors/packet-nflog.c +++ b/epan/dissectors/packet-nflog.c @@ -122,8 +122,8 @@ static dissector_handle_t ip_handle; static dissector_handle_t ip6_handle; static dissector_handle_t data_handle; -static void -dissect_nflog(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_nflog(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { const int start_tlv_offset = 4; @@ -166,7 +166,7 @@ dissect_nflog(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* malformed */ if (tlv_len < 4) - return; + return offset; value_len = tlv_len - 4; tlv_type = (tvb_get_h_guint16(tvb, offset + 2) & 0x7fff); @@ -250,6 +250,7 @@ dissect_nflog(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) break; } } + return tvb_captured_length(tvb); } void @@ -284,7 +285,7 @@ proto_register_nflog(void) proto_nflog = proto_register_protocol("Linux Netfilter NFLOG", "NFLOG", "nflog"); hfi_nflog = proto_registrar_get_nth(proto_nflog); - register_dissector("nflog", dissect_nflog, proto_nflog); + new_register_dissector("nflog", dissect_nflog, proto_nflog); proto_register_fields(proto_nflog, hfi, array_length(hfi)); proto_register_subtree_array(ett, array_length(ett)); |