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 | |
parent | 8f529628338f20948e80835076b7b18f6d48c6cf (diff) | |
download | wireshark-0aa9e9864721d5f425ffeba85bbb642ebd12e771.tar.gz wireshark-0aa9e9864721d5f425ffeba85bbb642ebd12e771.tar.bz2 wireshark-0aa9e9864721d5f425ffeba85bbb642ebd12e771.zip |
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>
-rw-r--r-- | epan/dissectors/packet-asterix.c | 7 | ||||
-rw-r--r-- | epan/dissectors/packet-ayiya.c | 8 | ||||
-rw-r--r-- | epan/dissectors/packet-bootp.c | 12 | ||||
-rw-r--r-- | epan/dissectors/packet-ccsds.c | 7 | ||||
-rw-r--r-- | epan/dissectors/packet-dhcpv6.c | 9 | ||||
-rw-r--r-- | epan/dissectors/packet-ehs.c | 7 | ||||
-rw-r--r-- | epan/dissectors/packet-interlink.c | 10 | ||||
-rw-r--r-- | epan/dissectors/packet-miop.c | 38 | ||||
-rw-r--r-- | epan/dissectors/packet-newmail.c | 8 | ||||
-rw-r--r-- | epan/dissectors/packet-nwmtp.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-rdt.c | 9 | ||||
-rw-r--r-- | epan/dissectors/packet-redbackli.c | 10 | ||||
-rw-r--r-- | epan/dissectors/packet-sscop.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-tzsp.c | 8 | ||||
-rw-r--r-- | epan/dissectors/packet-vcdu.c | 8 | ||||
-rw-r--r-- | epan/dissectors/packet-zrtp.c | 7 |
16 files changed, 93 insertions, 67 deletions
diff --git a/epan/dissectors/packet-asterix.c b/epan/dissectors/packet-asterix.c index c8ebc17f9f..4f0e5fb59a 100644 --- a/epan/dissectors/packet-asterix.c +++ b/epan/dissectors/packet-asterix.c @@ -2703,7 +2703,6 @@ struct AsterixField_s { }; DIAG_ON(pedantic) -static void dissect_asterix (tvbuff_t *, packet_info *, proto_tree *); static void dissect_asterix_packet (tvbuff_t *, proto_tree *); static void dissect_asterix_data_block (tvbuff_t *tvb, guint, proto_tree *, guint8, gint); static gint dissect_asterix_fields (tvbuff_t *, guint, proto_tree *, guint8, const AsterixField *[]); @@ -8226,7 +8225,7 @@ static const AsterixField ****categories[] = { }; -static void dissect_asterix (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int dissect_asterix (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { col_set_str (pinfo->cinfo, COL_PROTOCOL, "ASTERIX"); col_clear (pinfo->cinfo, COL_INFO); @@ -8234,6 +8233,8 @@ static void dissect_asterix (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree if (tree) { /* we are being asked for details */ dissect_asterix_packet (tvb, tree); } + + return tvb_captured_length(tvb); } static void dissect_asterix_packet (tvbuff_t *tvb, proto_tree *tree) @@ -11171,7 +11172,7 @@ void proto_register_asterix (void) proto_register_field_array (proto_asterix, hf, array_length (hf)); proto_register_subtree_array (ett, array_length (ett)); - asterix_handle = register_dissector ("asterix", dissect_asterix, proto_asterix); + asterix_handle = new_register_dissector ("asterix", dissect_asterix, proto_asterix); asterix_prefs_module = prefs_register_protocol (proto_asterix, proto_reg_handoff_asterix); diff --git a/epan/dissectors/packet-ayiya.c b/epan/dissectors/packet-ayiya.c index 9630f06a76..a855ff8ff5 100644 --- a/epan/dissectors/packet-ayiya.c +++ b/epan/dissectors/packet-ayiya.c @@ -84,8 +84,8 @@ static const value_string opcodes[] = { #define UDP_PORT_AYIYA 5072 -static void -dissect_ayiya(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_ayiya(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { proto_tree *ayiya_tree; int offset = 0; @@ -132,6 +132,8 @@ dissect_ayiya(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) dissector_try_uint(ip_dissector_table, next_header, payload, pinfo, tree); break; } + + return tvb_captured_length(tvb); } void @@ -195,7 +197,7 @@ proto_register_ayiya(void) proto_ayiya = proto_register_protocol("Anything in Anything Protocol", "AYIYA", "ayiya"); - register_dissector("ayiya", dissect_ayiya, proto_ayiya); + new_register_dissector("ayiya", dissect_ayiya, proto_ayiya); proto_register_field_array(proto_ayiya, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } 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); diff --git a/epan/dissectors/packet-ccsds.c b/epan/dissectors/packet-ccsds.c index 9c79849be3..750fb7b57f 100644 --- a/epan/dissectors/packet-ccsds.c +++ b/epan/dissectors/packet-ccsds.c @@ -298,8 +298,8 @@ static const char* embedded_time_to_string ( int coarse_time, int fine_time ) /* Code to actually dissect the packets */ -static void -dissect_ccsds(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_ccsds(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { int offset = 0; proto_item *ccsds_packet; @@ -503,6 +503,7 @@ dissect_ccsds(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* Give the data dissector any bytes past the CCSDS packet length */ call_dissector(data_handle, tvb_new_subset_remaining(tvb, offset), pinfo, tree); + return tvb_captured_length(tvb); } @@ -706,7 +707,7 @@ proto_register_ccsds(void) expert_ccsds = expert_register_protocol(proto_ccsds); expert_register_field_array(expert_ccsds, ei, array_length(ei)); - register_dissector ( "ccsds", dissect_ccsds, proto_ccsds ); + new_register_dissector ( "ccsds", dissect_ccsds, proto_ccsds ); /* Register preferences module */ ccsds_module = prefs_register_protocol(proto_ccsds, NULL); diff --git a/epan/dissectors/packet-dhcpv6.c b/epan/dissectors/packet-dhcpv6.c index fa947fb671..5a5a688d18 100644 --- a/epan/dissectors/packet-dhcpv6.c +++ b/epan/dissectors/packet-dhcpv6.c @@ -2001,14 +2001,15 @@ dissect_dhcpv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, off += dhcpv6_option(tvb, pinfo, bp_tree, off, eoff, &at_end, proto_dhcpv6, hpi); } -static void -dissect_dhcpv6_stream(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_dhcpv6_stream(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { hopcount_info hpi; initialize_hopount_info(&hpi); col_set_str(pinfo->cinfo, COL_PROTOCOL, "DHCPv6"); col_clear(pinfo->cinfo, COL_INFO); dissect_dhcpv6(tvb, pinfo, tree, 0, tvb_reported_length(tvb), hpi); + return tvb_captured_length(tvb); } static guint @@ -2397,7 +2398,7 @@ proto_register_dhcpv6(void) expert_register_field_array(expert_dhcpv6_bulk_leasequery, ei_bulk_leasequery, array_length(ei_bulk_leasequery)); /* Allow other dissectors to find this one by name. */ - register_dissector("dhcpv6", dissect_dhcpv6_stream, proto_dhcpv6); + new_register_dissector("dhcpv6", dissect_dhcpv6_stream, proto_dhcpv6); dhcpv6_module = prefs_register_protocol(proto_dhcpv6, NULL); prefs_register_bool_preference(dhcpv6_module, "cablelabs_interface_id", @@ -2417,7 +2418,7 @@ proto_reg_handoff_dhcpv6(void) { dissector_handle_t dhcpv6_handle, dhcpv6_bulkquery_handle; - dhcpv6_handle = create_dissector_handle(dissect_dhcpv6_stream, proto_dhcpv6); + dhcpv6_handle = new_create_dissector_handle(dissect_dhcpv6_stream, proto_dhcpv6); dissector_add_uint("udp.port", UDP_PORT_DHCPV6_DOWNSTREAM, dhcpv6_handle); dissector_add_uint("udp.port", UDP_PORT_DHCPV6_UPSTREAM, dhcpv6_handle); diff --git a/epan/dissectors/packet-ehs.c b/epan/dissectors/packet-ehs.c index c7d8b4b363..6c660206a9 100644 --- a/epan/dissectors/packet-ehs.c +++ b/epan/dissectors/packet-ehs.c @@ -1068,8 +1068,8 @@ ehs_data_zone_dissector ( int protocol, proto_tree* ehs_tree, tvbuff_t* tvb, int /* Code to actually dissect the packets */ -static void -dissect_ehs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_ehs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { int offset = 0; guint16 first_word; @@ -1193,6 +1193,7 @@ dissect_ehs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* build the ehs data zone tree for well known protocols such as AOS/LOS and UDSM */ ehs_data_zone_dissector ( protocol, ehs_tree, tvb, &offset, pinfo ); + return tvb_captured_length(tvb); } @@ -1951,7 +1952,7 @@ proto_register_ehs(void) proto_register_subtree_array(ett, array_length(ett)); /* XX: Does this dissector need to be publicly registered ?? */ - register_dissector ( "ehs", dissect_ehs, proto_ehs ); + new_register_dissector ( "ehs", dissect_ehs, proto_ehs ); } diff --git a/epan/dissectors/packet-interlink.c b/epan/dissectors/packet-interlink.c index e459424630..6fb463ae6c 100644 --- a/epan/dissectors/packet-interlink.c +++ b/epan/dissectors/packet-interlink.c @@ -65,8 +65,8 @@ static const value_string names_cmd[] = { }; -static void -dissect_interlink(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_interlink(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { int offset = 0; proto_tree *il_tree; @@ -143,6 +143,8 @@ dissect_interlink(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* Call the sub-dissector. */ call_dissector(handle, next_tvb, pinfo, tree); + + return tvb_captured_length(tvb); } @@ -160,7 +162,7 @@ dissect_interlink_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void ) return FALSE; - dissect_interlink(tvb, pinfo, tree); + dissect_interlink(tvb, pinfo, tree, data); return TRUE; } @@ -213,7 +215,7 @@ proto_register_interlink(void) "interlink"); proto_register_field_array(proto_interlink, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); - register_dissector("interlink", dissect_interlink, proto_interlink); + new_register_dissector("interlink", dissect_interlink, proto_interlink); /* Probably someone will write sub-dissectors. You can never know. */ subdissector_table = register_dissector_table("interlink.type_version", diff --git a/epan/dissectors/packet-miop.c b/epan/dissectors/packet-miop.c index e5c8e9d949..aed4a37917 100644 --- a/epan/dissectors/packet-miop.c +++ b/epan/dissectors/packet-miop.c @@ -83,10 +83,8 @@ static expert_field ei_miop_unique_id_len_exceed_max_value = EI_INIT; #define MIOP_MAGIC 0x4d494f50 /* "MIOP" */ -static void dissect_miop (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree); - static gboolean -dissect_miop_heur (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void * data _U_) { +dissect_miop_heur_check (tvbuff_t * tvb, packet_info * pinfo _U_, proto_tree * tree _U_, void * data _U_) { guint tot_len; guint32 magic; @@ -109,20 +107,11 @@ dissect_miop_heur (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void return FALSE; } - if (pinfo->ptype != PT_UDP) - return FALSE; - - dissect_miop (tvb, pinfo, tree); - - /* TODO: make reasembly */ - return TRUE; - } - /* Main entry point */ -static void dissect_miop (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) { +static int dissect_miop (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_) { guint offset = 0; proto_tree *miop_tree = NULL; @@ -144,6 +133,9 @@ static void dissect_miop (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree wmem_strbuf_t *flags_strbuf = wmem_strbuf_new_label(wmem_packet_scope()); wmem_strbuf_append(flags_strbuf, "none"); + if (!dissect_miop_heur_check(tvb, pinfo, tree, data)) + return 0; + col_set_str (pinfo->cinfo, COL_PROTOCOL, "MIOP"); /* Clear out stuff in the info column */ col_clear(pinfo->cinfo, COL_INFO); @@ -164,7 +156,7 @@ static void dissect_miop (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree tvb, 0, -1, "MIOP version %u.%u not supported", version_major, version_minor); - return; + return 5; } flags = tvb_get_guint8(tvb, 5); @@ -224,7 +216,7 @@ static void dissect_miop (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree expert_add_info_format(pinfo, ti, &ei_miop_unique_id_len_exceed_max_value, "Unique Id length (%u) exceeds max value (%u)", unique_id_len, MIOP_MAX_UNIQUE_ID_LENGTH); - return; + return offset; } offset += 4; @@ -244,9 +236,21 @@ static void dissect_miop (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree } } - + return tvb_captured_length(tvb); } +static gboolean +dissect_miop_heur (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void * data _U_) { + + if (!dissect_miop_heur_check(tvb, pinfo, tree, data)) + return FALSE; + + dissect_miop (tvb, pinfo, tree, data); + + /* TODO: make reasembly */ + return TRUE; + +} void proto_register_miop (void) { @@ -302,7 +306,7 @@ void proto_register_miop (void) { expert_miop = expert_register_protocol(proto_miop); expert_register_field_array(expert_miop, ei, array_length(ei)); - register_dissector("miop", dissect_miop, proto_miop); + new_register_dissector("miop", dissect_miop, proto_miop); } diff --git a/epan/dissectors/packet-newmail.c b/epan/dissectors/packet-newmail.c index 62228d81ad..6882c86c04 100644 --- a/epan/dissectors/packet-newmail.c +++ b/epan/dissectors/packet-newmail.c @@ -40,8 +40,8 @@ static int hf_newmail_payload = -1; static gint ett_newmail = -1; /* Code to actually dissect the packets */ -static void -dissect_newmail(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_newmail(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { /* Set up structures needed to add the protocol subtree and manage it */ proto_item *ti; @@ -59,6 +59,8 @@ dissect_newmail(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree_add_item(newmail_tree, hf_newmail_payload, tvb, 0, 8, ENC_NA); } + + return tvb_captured_length(tvb); } @@ -89,7 +91,7 @@ proto_register_newmail(void) proto_register_field_array(proto_newmail, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); - register_dissector("newmail", dissect_newmail, proto_newmail); + new_register_dissector("newmail", dissect_newmail, proto_newmail); newmail_module = prefs_register_protocol(proto_newmail, proto_reg_handoff_newmail); diff --git a/epan/dissectors/packet-nwmtp.c b/epan/dissectors/packet-nwmtp.c index 9b4402bb08..8a75f8601d 100644 --- a/epan/dissectors/packet-nwmtp.c +++ b/epan/dissectors/packet-nwmtp.c @@ -64,7 +64,7 @@ static const value_string nwmtp_data_type_vals[] = { { 0, NULL }, }; -static void dissect_nwmtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int dissect_nwmtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { gint offset = 0; @@ -114,6 +114,8 @@ static void dissect_nwmtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) DISSECTOR_ASSERT((guint64)offset + len + 12 < G_MAXINT); offset += len + 12; } + + return tvb_captured_length(tvb); } void proto_register_mwmtp(void) @@ -156,7 +158,7 @@ void proto_register_mwmtp(void) proto_register_field_array(proto_nwmtp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); - nwmtp_handle = register_dissector("nw_mtp", dissect_nwmtp, proto_nwmtp); + nwmtp_handle = new_register_dissector("nw_mtp", dissect_nwmtp, proto_nwmtp); } void proto_reg_handoff_nwmtp(void) diff --git a/epan/dissectors/packet-rdt.c b/epan/dissectors/packet-rdt.c index d01628fbb2..9bc4511d4a 100644 --- a/epan/dissectors/packet-rdt.c +++ b/epan/dissectors/packet-rdt.c @@ -169,9 +169,6 @@ static guint global_rdt_udp_port = 6970; void proto_register_rdt(void); void proto_reg_handoff_rdt(void); -/* Main dissection function */ -static void dissect_rdt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); - /* Parse individual packet types */ static guint dissect_rdt_data_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); static guint dissect_rdt_asm_action_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); @@ -284,7 +281,7 @@ void rdt_add_address(packet_info *pinfo, /****************************************************************************/ /* Main dissection function */ /****************************************************************************/ -static void dissect_rdt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int dissect_rdt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { guint previous_offset = 0; gint offset = 0; @@ -387,6 +384,8 @@ static void dissect_rdt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } previous_offset = offset; } + + return tvb_captured_length(tvb); } @@ -2162,7 +2161,7 @@ void proto_register_rdt(void) proto_register_subtree_array(ett, array_length(ett)); expert_rdt = expert_register_protocol(proto_rdt); expert_register_field_array(expert_rdt, ei, array_length(ei)); - register_dissector("rdt", dissect_rdt, proto_rdt); + new_register_dissector("rdt", dissect_rdt, proto_rdt); /* Preference settings */ rdt_module = prefs_register_protocol(proto_rdt, proto_reg_handoff_rdt); diff --git a/epan/dissectors/packet-redbackli.c b/epan/dissectors/packet-redbackli.c index 936088751a..9e8b107016 100644 --- a/epan/dissectors/packet-redbackli.c +++ b/epan/dissectors/packet-redbackli.c @@ -126,8 +126,8 @@ redbackli_dissect_avp(guint8 avptype, guint8 avplen, tvbuff_t *tvb, gint offset, return; } -static void -redbackli_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +redbackli_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { guint8 avptype, avplen; gint len, offset = 0; @@ -164,6 +164,8 @@ redbackli_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) next_tvb = tvb_new_subset_remaining(tvb, offset); call_dissector(ip_handle, next_tvb, pinfo, tree); + + return tvb_captured_length(tvb); } @@ -224,7 +226,7 @@ redbackli_dissect_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void if (!(avpfound & (1<<RB_AVP_LIID))) return FALSE; - redbackli_dissect(tvb, pinfo, tree); + redbackli_dissect(tvb, pinfo, tree, data); return TRUE; } @@ -280,7 +282,7 @@ void proto_register_redbackli(void) { proto_register_field_array(proto_redbackli, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); - register_dissector("redbackli", redbackli_dissect, proto_redbackli); + new_register_dissector("redbackli", redbackli_dissect, proto_redbackli); } void proto_reg_handoff_redbackli(void) { diff --git a/epan/dissectors/packet-sscop.c b/epan/dissectors/packet-sscop.c index 0058c8282d..eb2a12be04 100644 --- a/epan/dissectors/packet-sscop.c +++ b/epan/dissectors/packet-sscop.c @@ -335,7 +335,7 @@ dissect_sscop_and_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, d } } -static void dissect_sscop(tvbuff_t* tvb, packet_info* pinfo,proto_tree* tree) +static int dissect_sscop(tvbuff_t* tvb, packet_info* pinfo,proto_tree* tree, void* data _U_) { struct _sscop_payload_info *p_sscop_info; dissector_handle_t subdissector; @@ -353,6 +353,8 @@ static void dissect_sscop(tvbuff_t* tvb, packet_info* pinfo,proto_tree* tree) dissect_sscop_and_payload(tvb,pinfo,tree,subdissector); else dissect_sscop_and_payload(tvb,pinfo,tree,default_handle); + + return tvb_captured_length(tvb); } /* Make sure handles for various protocols are initialized */ @@ -438,7 +440,7 @@ proto_register_sscop(void) proto_register_field_array(proto_sscop, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); - sscop_handle = register_dissector("sscop", dissect_sscop, proto_sscop); + sscop_handle = new_register_dissector("sscop", dissect_sscop, proto_sscop); sscop_module = prefs_register_protocol(proto_sscop, proto_reg_handoff_sscop); diff --git a/epan/dissectors/packet-tzsp.c b/epan/dissectors/packet-tzsp.c index f4dc908d7e..fa001a74ac 100644 --- a/epan/dissectors/packet-tzsp.c +++ b/epan/dissectors/packet-tzsp.c @@ -284,8 +284,8 @@ tzsp_encap_to_wtap_encap(guint16 encap) /* Dissect a TZSP packet */ /* ************************************************************************* */ -static void -dissect_tzsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_tzsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { proto_tree *tzsp_tree = NULL; proto_item *ti = NULL; @@ -371,6 +371,8 @@ dissect_tzsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) call_dissector(data_handle, next_tvb, pinfo, tree); } } + + return tvb_captured_length(tvb); } /* ************************************************************************* */ @@ -532,7 +534,7 @@ proto_register_tzsp(void) proto_register_field_array(proto_tzsp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); - tzsp_handle = register_dissector("tzsp", dissect_tzsp, proto_tzsp); + tzsp_handle = new_register_dissector("tzsp", dissect_tzsp, proto_tzsp); } void diff --git a/epan/dissectors/packet-vcdu.c b/epan/dissectors/packet-vcdu.c index f93394be8e..94fb321878 100644 --- a/epan/dissectors/packet-vcdu.c +++ b/epan/dissectors/packet-vcdu.c @@ -259,8 +259,8 @@ smex_time_to_string (int pb5_days_since_midnight_9_10_oct_1995, int pb5_seconds, } -static void -dissect_vcdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_vcdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { int offset = 0; gboolean ccsds_tree_added = FALSE; @@ -451,6 +451,8 @@ dissect_vcdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* add "Data" section if ccsds parsing did not do so already */ proto_tree_add_item(vcdu_tree, hf_vcdu_data, tvb, offset, -1, ENC_NA); } + + return tvb_captured_length(tvb); } @@ -637,7 +639,7 @@ proto_register_vcdu(void) expert_register_field_array(expert_vcdu, ei, array_length(ei)); /* XX: Does this dissector need to be publicly registered ?? */ - vcdu_handle = register_dissector("vcdu", dissect_vcdu, proto_vcdu); + vcdu_handle = new_register_dissector("vcdu", dissect_vcdu, proto_vcdu); vcdu_module = prefs_register_protocol(proto_vcdu, vcdu_prefs_apply_cb); diff --git a/epan/dissectors/packet-zrtp.c b/epan/dissectors/packet-zrtp.c index 4cfe30f2e9..023efe189b 100644 --- a/epan/dissectors/packet-zrtp.c +++ b/epan/dissectors/packet-zrtp.c @@ -312,8 +312,8 @@ check_valid_version(const gchar *version) { } -static void -dissect_zrtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_zrtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { proto_tree *zrtp_tree; proto_tree *zrtp_msg_tree; @@ -437,6 +437,7 @@ dissect_zrtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) PROTO_ITEM_SET_GENERATED(ti); } + return tvb_captured_length(tvb); } static void @@ -1158,7 +1159,7 @@ proto_register_zrtp(void) proto_zrtp = proto_register_protocol("ZRTP", "ZRTP", "zrtp"); proto_register_field_array(proto_zrtp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); - register_dissector("zrtp", dissect_zrtp, proto_zrtp); + new_register_dissector("zrtp", dissect_zrtp, proto_zrtp); } void |