diff options
author | Michael Mann <mmann78@netscape.net> | 2015-11-08 20:15:22 -0500 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2015-11-09 15:59:42 +0000 |
commit | 0aa9e9864721d5f425ffeba85bbb642ebd12e771 (patch) | |
tree | 98918da5fd1c719a3ca17b6df2369a663ed66550 /epan/dissectors/packet-bootp.c | |
parent | 8f529628338f20948e80835076b7b18f6d48c6cf (diff) |
Convert some UDP subdissectors to "new" style.
Change-Id: I3c1ee97f68af4539b97d50b75c03ff82147dbc5e
Reviewed-on: https://code.wireshark.org/review/11649
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-bootp.c')
-rw-r--r-- | epan/dissectors/packet-bootp.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/epan/dissectors/packet-bootp.c b/epan/dissectors/packet-bootp.c index 39635c41d1..734f53245f 100644 --- a/epan/dissectors/packet-bootp.c +++ b/epan/dissectors/packet-bootp.c @@ -5344,8 +5344,8 @@ static const value_string op_vals[] = { { 0, NULL } }; -static void -dissect_bootp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_bootp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { proto_tree *bp_tree; proto_item *bp_ti, *ti; @@ -5432,7 +5432,7 @@ dissect_bootp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (offset_delta <= 0) { proto_tree_add_expert(bp_tree, pinfo, &ei_bootp_option_parse_err, tvb, tmpvoff, eoff); - return; + return tmpvoff; } tmpvoff += offset_delta; } @@ -5573,7 +5573,7 @@ dissect_bootp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (offset_delta <= 0) { proto_tree_add_expert(bp_tree, pinfo, &ei_bootp_option_parse_err, tvb, voff, eoff); - return; + return voff; } voff += offset_delta; } @@ -5587,6 +5587,8 @@ dissect_bootp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) */ proto_tree_add_item(bp_tree, hf_bootp_option_padding, tvb, voff, eoff - voff, ENC_NA); } + + return tvb_captured_length(tvb); } static void @@ -7857,7 +7859,7 @@ proto_register_bootp(void) register_init_routine(&bootp_init_protocol); /* Allow dissector to find be found by name. */ - bootp_handle = register_dissector("bootp", dissect_bootp, proto_bootp); + bootp_handle = new_register_dissector("bootp", dissect_bootp, proto_bootp); bootp_module = prefs_register_protocol(proto_bootp, NULL); |