aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2015-11-13 20:18:34 -0500
committerMichael Mann <mmann78@netscape.net>2015-11-14 18:00:00 +0000
commit8faf5c80b3302247c32e1f5c492cb31a082ee0ad (patch)
treee9bac5673fc9a480fe1fa06fcc6d5d7d45b37389 /epan
parent76dec3ba681da2c315efba4433d3b1f995defd91 (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')
-rw-r--r--epan/dissectors/packet-gmr1_bcch.c8
-rw-r--r--epan/dissectors/packet-gmr1_dtap.c10
-rw-r--r--epan/dissectors/packet-gmr1_rr.c10
-rw-r--r--epan/dissectors/packet-gsm_abis_om2000.c12
-rw-r--r--epan/dissectors/packet-gsm_bsslap.c8
-rw-r--r--epan/dissectors/packet-gsm_cbch.c7
-rw-r--r--epan/dissectors/packet-gsm_sim.c32
-rw-r--r--epan/dissectors/packet-gsm_sms_ud.c9
-rw-r--r--epan/dissectors/packet-gtpv2.c10
-rw-r--r--epan/dissectors/packet-h223.c7
-rw-r--r--epan/dissectors/packet-h263p.c9
-rw-r--r--epan/dissectors/packet-h264.c23
-rw-r--r--epan/dissectors/packet-hpext.c7
-rw-r--r--epan/dissectors/packet-hpsw.c7
-rw-r--r--epan/dissectors/packet-hpteam.c7
-rw-r--r--epan/dissectors/packet-iax2.c7
-rw-r--r--epan/dissectors/packet-ieee80211-radiotap.c12
-rw-r--r--epan/dissectors/packet-ieee80211-wlancap.c9
-rw-r--r--epan/dissectors/packet-ieee80211.c21
-rw-r--r--epan/dissectors/packet-ieee802154.c38
-rw-r--r--epan/dissectors/packet-imf.c11
-rw-r--r--epan/dissectors/packet-infiniband.c16
-rw-r--r--epan/dissectors/packet-ipsec.c14
-rw-r--r--epan/dissectors/packet-ipx.c23
-rw-r--r--epan/dissectors/packet-isup.c16
-rw-r--r--epan/dissectors/packet-iua.c7
-rw-r--r--epan/dissectors/packet-iwarp-ddp-rdmap.c7
-rw-r--r--epan/dissectors/packet-ixveriwave.c76
-rw-r--r--epan/dissectors/packet-k12.c9
-rw-r--r--epan/dissectors/packet-lapd.c18
-rw-r--r--epan/dissectors/packet-llc.c41
-rw-r--r--epan/dissectors/packet-m2pa.c7
-rw-r--r--epan/dissectors/packet-m3ua.c7
-rw-r--r--epan/dissectors/packet-mime-encap.c7
-rw-r--r--epan/dissectors/packet-mip.c17
-rw-r--r--epan/dissectors/packet-mip6.c2
-rw-r--r--epan/dissectors/packet-mp2t.c10
-rw-r--r--epan/dissectors/packet-mstp.c7
-rw-r--r--epan/dissectors/packet-mtp2.c14
-rw-r--r--epan/dissectors/packet-mtp3.c7
-rw-r--r--epan/dissectors/packet-mtp3mg.c7
-rw-r--r--epan/dissectors/packet-mux27010.c7
-rw-r--r--epan/dissectors/packet-nasdaq-itch.c13
-rw-r--r--epan/dissectors/packet-ndp.c8
-rw-r--r--epan/dissectors/packet-negoex.c7
-rw-r--r--epan/dissectors/packet-nflog.c9
-rw-r--r--epan/dissectors/packet-noe.c9
-rw-r--r--epan/dissectors/packet-nsip.c7
-rw-r--r--epan/dissectors/packet-ntlmssp.c11
49 files changed, 330 insertions, 317 deletions
diff --git a/epan/dissectors/packet-gmr1_bcch.c b/epan/dissectors/packet-gmr1_bcch.c
index 25d8bcdabc..a7462cdac8 100644
--- a/epan/dissectors/packet-gmr1_bcch.c
+++ b/epan/dissectors/packet-gmr1_bcch.c
@@ -1060,8 +1060,8 @@ static const value_string si1_randomization_period_vals[] = {
/* Dissector code */
/* ------------------------------------------------------------------------ */
-static void
-dissect_gmr1_bcch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_gmr1_bcch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dissector_data _U_)
{
proto_item *bcch_item = NULL;
proto_tree *bcch_tree = NULL;
@@ -1108,6 +1108,8 @@ dissect_gmr1_bcch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
SI2_SegmentChoice[data->SegmentType].descr.sz
);
}
+
+ return tvb_captured_length(tvb);
}
void
@@ -1647,7 +1649,7 @@ proto_register_gmr1_bcch(void)
expert_gmr1_bcch = expert_register_protocol(proto_gmr1_bcch);
expert_register_field_array(expert_gmr1_bcch, ei, array_length(ei));
- register_dissector("gmr1_bcch", dissect_gmr1_bcch, proto_gmr1_bcch);
+ new_register_dissector("gmr1_bcch", dissect_gmr1_bcch, proto_gmr1_bcch);
}
/*
diff --git a/epan/dissectors/packet-gmr1_dtap.c b/epan/dissectors/packet-gmr1_dtap.c
index 0c0063f7c1..95529d9c43 100644
--- a/epan/dissectors/packet-gmr1_dtap.c
+++ b/epan/dissectors/packet-gmr1_dtap.c
@@ -50,8 +50,8 @@ static gint ett_gmr1_pd = -1;
static dissector_handle_t gsm_dtap_handle;
-static void
-dissect_gmr1_dtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_gmr1_dtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint32 len, offset;
gmr1_msg_func_t msg_func;
@@ -78,7 +78,7 @@ dissect_gmr1_dtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* HACK: Quick delegation hack to GSM */
if (pd != GMR1_PD_RR) {
call_dissector(gsm_dtap_handle, tvb, pinfo, tree);
- return;
+ return tvb_captured_length(tvb);
}
/* Fill up some info */
@@ -140,7 +140,7 @@ dissect_gmr1_dtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
/* Done ! */
- return;
+ return tvb_captured_length(tvb);
}
@@ -173,7 +173,7 @@ proto_register_gmr1_dtap(void)
proto_register_field_array(proto_gmr1_dtap, hf, array_length(hf));
/* Register dissector */
- register_dissector("gmr1_dtap", dissect_gmr1_dtap, proto_gmr1_dtap);
+ new_register_dissector("gmr1_dtap", dissect_gmr1_dtap, proto_gmr1_dtap);
}
void
diff --git a/epan/dissectors/packet-gmr1_rr.c b/epan/dissectors/packet-gmr1_rr.c
index 7bf290cf06..bc07eb95d4 100644
--- a/epan/dissectors/packet-gmr1_rr.c
+++ b/epan/dissectors/packet-gmr1_rr.c
@@ -1786,8 +1786,8 @@ gmr1_get_msg_rr_params(guint8 oct, int dcch, const gchar **msg_str,
/* Dissector code */
/* ------------------------------------------------------------------------ */
-static void
-dissect_gmr1_ccch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_gmr1_ccch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint32 len, offset;
gmr1_msg_func_t msg_func;
@@ -1895,12 +1895,10 @@ dissect_gmr1_ccch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(ccch_tree, hf_rr_message_elements, tvb, offset, len - offset, ENC_NA);
}
- /* Done ! */
- return;
-
/* Error handling */
err:
call_dissector(data_handle, tvb, pinfo, tree);
+ return tvb_captured_length(tvb);
}
void
@@ -2458,7 +2456,7 @@ proto_register_gmr1_rr(void)
proto_gmr1_ccch = proto_register_protocol("GEO-Mobile Radio (1) CCCH", "GMR-1 CCCH", "gmr1.ccch");
/* Register dissector */
- register_dissector("gmr1_ccch", dissect_gmr1_ccch, proto_gmr1_ccch);
+ new_register_dissector("gmr1_ccch", dissect_gmr1_ccch, proto_gmr1_ccch);
}
void
diff --git a/epan/dissectors/packet-gsm_abis_om2000.c b/epan/dissectors/packet-gsm_abis_om2000.c
index 3cb1fd03cd..10c3e62d72 100644
--- a/epan/dissectors/packet-gsm_abis_om2000.c
+++ b/epan/dissectors/packet-gsm_abis_om2000.c
@@ -970,8 +970,8 @@ dissect_om2k_mo(tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree
return 4;
}
-static void
-dissect_abis_om2000(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_abis_om2000(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *ti;
proto_tree *om2k_tree;
@@ -980,9 +980,6 @@ dissect_abis_om2000(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
int offset;
- if ((tree == NULL) && (pinfo->cinfo == NULL))
- return; /* no dissection required */
-
col_set_str(pinfo->cinfo, COL_PROTOCOL, "OM2000");
/* Don't do col_clear() so this dissector can append to COL_INFO*/
@@ -1004,7 +1001,7 @@ dissect_abis_om2000(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
"unknown 0x%04x"));
if (tree == NULL)
- return; /* No refs to COL_... beyond this point */
+ return tvb_captured_length(tvb); /* No refs to COL_... beyond this point */
proto_item_append_text(ti, " %s ",
val_to_str_ext(msg_code, &om2k_msgcode_vals_ext,
@@ -1034,6 +1031,7 @@ dissect_abis_om2000(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
break;
}
dissect_om2k_attrs(tvb, offset, om2k_tree);
+ return tvb_captured_length(tvb);
}
void
@@ -1418,7 +1416,7 @@ proto_register_abis_om2000(void)
proto_register_subtree_array(ett, array_length(ett));
- register_dissector("gsm_abis_om2000", dissect_abis_om2000,
+ new_register_dissector("gsm_abis_om2000", dissect_abis_om2000,
proto_abis_om2000);
}
diff --git a/epan/dissectors/packet-gsm_bsslap.c b/epan/dissectors/packet-gsm_bsslap.c
index a16c7d74e1..fb54643851 100644
--- a/epan/dissectors/packet-gsm_bsslap.c
+++ b/epan/dissectors/packet-gsm_bsslap.c
@@ -792,8 +792,8 @@ dissect_gsm_bsslap_u_tdoa_res(tvbuff_t *tvb, proto_tree *tree, packet_info *pinf
}
-static void
-dissect_gsm_bsslap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_gsm_bsslap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *item;
proto_tree *sub_tree;
@@ -847,7 +847,7 @@ dissect_gsm_bsslap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
-
+ return tvb_captured_length(tvb);
}
void
@@ -969,7 +969,7 @@ proto_register_gsm_bsslap(void)
expert_gsm_bsslap = expert_register_protocol(proto_gsm_bsslap);
expert_register_field_array(expert_gsm_bsslap, ei, array_length(ei));
- register_dissector("gsm_bsslap", dissect_gsm_bsslap, proto_gsm_bsslap);
+ new_register_dissector("gsm_bsslap", dissect_gsm_bsslap, proto_gsm_bsslap);
}
/*
diff --git a/epan/dissectors/packet-gsm_cbch.c b/epan/dissectors/packet-gsm_cbch.c
index 82a0c1d853..f3f346797d 100644
--- a/epan/dissectors/packet-gsm_cbch.c
+++ b/epan/dissectors/packet-gsm_cbch.c
@@ -369,8 +369,8 @@ dissect_schedule_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *top_tree
}
}
-static void
-dissect_cbch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_cbch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
fragment_head *frag_data = NULL;
guint8 octet, lb, lpd, seq_num;
@@ -473,6 +473,7 @@ dissect_cbch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
expert_add_info(pinfo, lpd_item, &ei_gsm_cbch_lpd);
call_dissector(data_handle, tvb, pinfo, cbch_tree);
}
+ return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
@@ -644,7 +645,7 @@ proto_register_gsm_cbch(void)
expert_register_field_array(expert_cbch, ei, array_length(ei));
/* subdissector code */
- register_dissector("gsm_cbch", dissect_cbch, proto_cbch);
+ new_register_dissector("gsm_cbch", dissect_cbch, proto_cbch);
register_init_routine(cbch_defragment_init);
register_cleanup_routine(cbch_defragment_cleanup);
diff --git a/epan/dissectors/packet-gsm_sim.c b/epan/dissectors/packet-gsm_sim.c
index 177c049728..5c1003a5cc 100644
--- a/epan/dissectors/packet-gsm_sim.c
+++ b/epan/dissectors/packet-gsm_sim.c
@@ -1139,8 +1139,8 @@ static const gchar *get_sw_string(guint16 sw)
return val_to_str(sw, sw_vals, "%04x");
}
-static void
-dissect_bertlv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_bertlv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
unsigned int pos = 0;
@@ -1184,6 +1184,7 @@ dissect_bertlv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
pos += len;
}
+ return tvb_captured_length(tvb);
}
@@ -1348,7 +1349,7 @@ dissect_gsm_apdu(guint8 ins, guint8 p1, guint8 p2, guint8 p3, tvbuff_t *tvb,
proto_tree_add_item(tree, hf_le, tvb, offset+P3_OFFS, 1, ENC_BIG_ENDIAN);
if (isSIMtrace) {
subtvb = tvb_new_subset_length(tvb, offset+DATA_OFFS, (p3 == 0) ? 256 : p3);
- dissect_bertlv(subtvb, pinfo, tree);
+ dissect_bertlv(subtvb, pinfo, tree, NULL);
}
break;
case 0x14: /* TERMINAL RESPONSE */
@@ -1382,7 +1383,7 @@ dissect_gsm_apdu(guint8 ins, guint8 p1, guint8 p2, guint8 p3, tvbuff_t *tvb,
case 0xC2: /* ENVELOPE */
proto_tree_add_item(tree, hf_le, tvb, offset+P3_OFFS, 1, ENC_BIG_ENDIAN);
subtvb = tvb_new_subset_length(tvb, offset+DATA_OFFS, p3);
- dissect_bertlv(subtvb, pinfo, tree);
+ dissect_bertlv(subtvb, pinfo, tree, NULL);
break;
/* FIXME: Missing SLEEP */
case 0x04: /* INVALIDATE */
@@ -1494,25 +1495,28 @@ dissect_cmd_apdu_tvb(tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree
return offset;
}
-static void
-dissect_gsm_sim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_gsm_sim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
col_set_str(pinfo->cinfo, COL_PROTOCOL, "GSM SIM");
dissect_cmd_apdu_tvb(tvb, 0, pinfo, tree, TRUE);
+ return tvb_captured_length(tvb);
}
-static void
-dissect_gsm_sim_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_gsm_sim_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
col_set_str(pinfo->cinfo, COL_PROTOCOL, "GSM SIM");
dissect_cmd_apdu_tvb(tvb, 0, pinfo, tree, FALSE);
+ return tvb_captured_length(tvb);
}
-static void
-dissect_gsm_sim_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_gsm_sim_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
col_set_str(pinfo->cinfo, COL_PROTOCOL, "GSM SIM");
dissect_rsp_apdu_tvb(tvb, 0, pinfo, tree, NULL);
+ return tvb_captured_length(tvb);
}
void
@@ -2920,10 +2924,10 @@ proto_register_gsm_sim(void)
proto_register_subtree_array(ett, array_length(ett));
- register_dissector("gsm_sim", dissect_gsm_sim, proto_gsm_sim);
- register_dissector("gsm_sim.command", dissect_gsm_sim_command, proto_gsm_sim);
- register_dissector("gsm_sim.response", dissect_gsm_sim_response, proto_gsm_sim);
- register_dissector("gsm_sim.bertlv", dissect_bertlv, proto_gsm_sim);
+ new_register_dissector("gsm_sim", dissect_gsm_sim, proto_gsm_sim);
+ new_register_dissector("gsm_sim.command", dissect_gsm_sim_command, proto_gsm_sim);
+ new_register_dissector("gsm_sim.response", dissect_gsm_sim_response, proto_gsm_sim);
+ new_register_dissector("gsm_sim.bertlv", dissect_bertlv, proto_gsm_sim);
}
void
diff --git a/epan/dissectors/packet-gsm_sms_ud.c b/epan/dissectors/packet-gsm_sms_ud.c
index d313b7180b..151e63d516 100644
--- a/epan/dissectors/packet-gsm_sms_ud.c
+++ b/epan/dissectors/packet-gsm_sms_ud.c
@@ -64,8 +64,6 @@
void proto_register_gsm_sms_ud(void);
void proto_reg_handoff_gsm_sms_ud(void);
-static void dissect_gsm_sms_ud(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
-
static int proto_gsm_sms_ud = -1;
/*
@@ -436,8 +434,8 @@ parse_gsm_sms_ud_message(proto_tree *sm_tree, tvbuff_t *tvb, packet_info *pinfo,
return;
}
-static void
-dissect_gsm_sms_ud(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_gsm_sms_ud(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *ti;
proto_tree *subtree;
@@ -445,6 +443,7 @@ dissect_gsm_sms_ud(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ti = proto_tree_add_item(tree, proto_gsm_sms_ud, tvb, 0, -1, ENC_NA);
subtree = proto_item_add_subtree(ti, ett_gsm_sms);
parse_gsm_sms_ud_message(subtree, tvb, pinfo, tree);
+ return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
@@ -654,7 +653,7 @@ proto_register_gsm_sms_ud(void)
"own. Eg. Prevent WSP dissector overwriting SMPP information.",
&prevent_subdissectors_changing_columns);
- register_dissector("gsm_sms_ud", dissect_gsm_sms_ud, proto_gsm_sms_ud);
+ new_register_dissector("gsm_sms_ud", dissect_gsm_sms_ud, proto_gsm_sms_ud);
/* GSM SMS UD dissector initialization routines */
register_init_routine(gsm_sms_ud_defragment_init);
diff --git a/epan/dissectors/packet-gtpv2.c b/epan/dissectors/packet-gtpv2.c
index 88b5dd296b..c508b70aa7 100644
--- a/epan/dissectors/packet-gtpv2.c
+++ b/epan/dissectors/packet-gtpv2.c
@@ -6046,8 +6046,8 @@ dissect_gtpv2_ie_common(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree,
}
}
-static void
-dissect_gtpv2(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
+static int
+dissect_gtpv2(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
proto_tree *gtpv2_tree, *flags_tree;
proto_item *tf;
@@ -6139,10 +6139,10 @@ dissect_gtpv2(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
new_p_tvb = tvb_new_subset_remaining(tvb, msg_length + 4);
col_append_str(pinfo->cinfo, COL_INFO, " / ");
col_set_fence(pinfo->cinfo, COL_INFO);
- dissect_gtpv2(new_p_tvb, pinfo, tree);
+ dissect_gtpv2(new_p_tvb, pinfo, tree, NULL);
}
-
+ return tvb_captured_length(tvb);
}
void proto_register_gtpv2(void)
@@ -8132,7 +8132,7 @@ void proto_register_gtpv2(void)
/* AVP Code: 2820 Presence-Reporting-Area-Elements-List */
dissector_add_uint("diameter.3gpp", 2820, new_create_dissector_handle(dissect_diameter_3gpp_presence_reporting_area_elements_list, proto_gtpv2));
- register_dissector("gtpv2", dissect_gtpv2, proto_gtpv2);
+ new_register_dissector("gtpv2", dissect_gtpv2, proto_gtpv2);
/* Dissector table for private extensions */
gtpv2_priv_ext_dissector_table = register_dissector_table("gtpv2.priv_ext", "GTPv2 PRIVATE EXT", FT_UINT16, BASE_DEC, DISSECTOR_TABLE_NOT_ALLOW_DUPLICATE);
}
diff --git a/epan/dissectors/packet-h223.c b/epan/dissectors/packet-h223.c
index 8aa25a161e..0587c815ff 100644
--- a/epan/dissectors/packet-h223.c
+++ b/epan/dissectors/packet-h223.c
@@ -1427,10 +1427,11 @@ dissect_h223_bitswapped_circuit_data(tvbuff_t *tvb, packet_info *pinfo, proto_tr
return tvb_captured_length(tvb);
}
-static void
-dissect_h223_bitswapped(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_h223_bitswapped(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
dissect_h223_bitswapped_common(tvb, pinfo, tree, CT_NONE, 0);
+ return tvb_captured_length(tvb);
}
/******************************************************************************/
@@ -1645,7 +1646,7 @@ void proto_register_h223 (void)
proto_register_field_array (proto_h223, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
new_register_dissector("h223", dissect_h223_circuit_data, proto_h223);
- register_dissector("h223_bitswapped", dissect_h223_bitswapped, proto_h223_bitswapped);
+ new_register_dissector("h223_bitswapped", dissect_h223_bitswapped, proto_h223_bitswapped);
/* register our init routine to be called at the start of a capture,
to clear out our hash tables etc */
diff --git a/epan/dissectors/packet-h263p.c b/epan/dissectors/packet-h263p.c
index a517689e1f..2b4461e479 100644
--- a/epan/dissectors/packet-h263p.c
+++ b/epan/dissectors/packet-h263p.c
@@ -66,8 +66,8 @@ static gint ett_h263P_data = -1;
static guint temp_dynamic_payload_type = 0;
/* RFC 4629 */
-static void
-dissect_h263P( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
+static int
+dissect_h263P( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ )
{
proto_item *ti = NULL;
proto_item *data_item = NULL;
@@ -192,10 +192,11 @@ dissect_h263P( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
}else{
/* Error */
}
- return;
+ return tvb_captured_length(tvb);
}
proto_tree_add_item( h263P_tree, hf_h263P_payload, tvb, offset, -1, ENC_NA );
}
+ return tvb_captured_length(tvb);
}
void
@@ -408,7 +409,7 @@ proto_register_h263P(void)
10,
&temp_dynamic_payload_type);
- register_dissector("h263P", dissect_h263P, proto_h263P);
+ new_register_dissector("h263P", dissect_h263P, proto_h263P);
}
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);
}
diff --git a/epan/dissectors/packet-hpext.c b/epan/dissectors/packet-hpext.c
index f2ae620531..e6c917158f 100644
--- a/epan/dissectors/packet-hpext.c
+++ b/epan/dissectors/packet-hpext.c
@@ -66,8 +66,8 @@ static gint ett_hpext = -1;
static dissector_handle_t data_handle;
-static void
-dissect_hpext(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_hpext(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *hpext_tree = NULL;
proto_item *ti = NULL;
@@ -101,6 +101,7 @@ dissect_hpext(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
call_dissector(data_handle, next_tvb, pinfo, tree);
}
}
+ return tvb_captured_length(tvb);
}
void
@@ -131,7 +132,7 @@ proto_register_hpext(void)
subdissector_table = register_dissector_table("hpext.dxsap",
"HPEXT XSAP", FT_UINT16, BASE_HEX, DISSECTOR_TABLE_NOT_ALLOW_DUPLICATE);
- hpext_handle = register_dissector("hpext", dissect_hpext, proto_hpext);
+ hpext_handle = new_register_dissector("hpext", dissect_hpext, proto_hpext);
}
void
diff --git a/epan/dissectors/packet-hpsw.c b/epan/dissectors/packet-hpsw.c
index f7fd0e37bc..6411be91cc 100644
--- a/epan/dissectors/packet-hpsw.c
+++ b/epan/dissectors/packet-hpsw.c
@@ -224,8 +224,8 @@ dissect_hpsw_tlv(tvbuff_t *tvb, packet_info *pinfo, int offset, int length,
}
}
-static void
-dissect_hpsw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_hpsw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *hp_tree;
proto_tree *tlv_tree;
@@ -273,6 +273,7 @@ dissect_hpsw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += length;
}
+ return tvb_captured_length(tvb);
}
void
@@ -358,7 +359,7 @@ proto_register_hpsw(void)
expert_hpsw = expert_register_protocol(proto_hpsw);
expert_register_field_array(expert_hpsw, ei, array_length(ei));
- register_dissector("hpsw", dissect_hpsw, proto_hpsw);
+ new_register_dissector("hpsw", dissect_hpsw, proto_hpsw);
}
void
diff --git a/epan/dissectors/packet-hpteam.c b/epan/dissectors/packet-hpteam.c
index 7537b50724..0294779693 100644
--- a/epan/dissectors/packet-hpteam.c
+++ b/epan/dissectors/packet-hpteam.c
@@ -83,8 +83,8 @@ static gint ett_hpteam = -1;
* packets received by the machine.
*/
-static void
-dissect_hpteam(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_hpteam(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
col_set_str(pinfo->cinfo, COL_PROTOCOL, "HP NIC Team");
@@ -98,6 +98,7 @@ dissect_hpteam(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
hpteam_tree = proto_item_add_subtree(hpteam_item, ett_hpteam);
proto_tree_add_item(hpteam_tree, hf_hpteam, tvb, 0, -1, ENC_NA);
}
+ return tvb_captured_length(tvb);
}
void proto_register_hpteam(void)
@@ -127,7 +128,7 @@ void proto_register_hpteam(void)
llc_add_oui(OUI_HP_2, "llc.hpteam_pid", "LLC Hewlett Packard OUI PID", &hf_pid);
proto_register_field_array(proto_hpteam, hf_data, array_length(hf_data));
proto_register_subtree_array(ett, array_length(ett));
- register_dissector("hpteam", dissect_hpteam, proto_hpteam);
+ new_register_dissector("hpteam", dissect_hpteam, proto_hpteam);
}
void proto_reg_handoff_hpteam(void)
diff --git a/epan/dissectors/packet-iax2.c b/epan/dissectors/packet-iax2.c
index b3de3e3a5b..5b9a368d22 100644
--- a/epan/dissectors/packet-iax2.c
+++ b/epan/dissectors/packet-iax2.c
@@ -1120,8 +1120,8 @@ static void dissect_payload(tvbuff_t *tvb, guint32 offset,
-static void
-dissect_iax2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_iax2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *iax2_item;
proto_tree *iax2_tree;
@@ -1210,6 +1210,7 @@ dissect_iax2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
not the audio data. */
proto_item_set_len(iax2_item, len);
tap_queue_packet(iax2_tap, pinfo, iax2_info);
+ return tvb_captured_length(tvb);
}
static proto_item *dissect_datetime_ie(tvbuff_t *tvb, guint32 offset, proto_tree *ies_tree)
@@ -3198,7 +3199,7 @@ proto_register_iax2(void)
expert_iax = expert_register_protocol(proto_iax2);
expert_register_field_array(expert_iax, ei, array_length(ei));
- register_dissector("iax2", dissect_iax2, proto_iax2);
+ new_register_dissector("iax2", dissect_iax2, proto_iax2);
iax2_codec_dissector_table = register_dissector_table(
"iax2.codec", "IAX codec number", FT_UINT32, BASE_HEX, DISSECTOR_TABLE_NOT_ALLOW_DUPLICATE);
diff --git a/epan/dissectors/packet-ieee80211-radiotap.c b/epan/dissectors/packet-ieee80211-radiotap.c
index 74c64cbab5..205b26427a 100644
--- a/epan/dissectors/packet-ieee80211-radiotap.c
+++ b/epan/dissectors/packet-ieee80211-radiotap.c
@@ -222,9 +222,6 @@ static int radiotap_tap = -1;
/* Settings */
static gboolean radiotap_bit14_fcs = FALSE;
-static void
-dissect_radiotap(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree);
-
#define BITNO_32(x) (((x) >> 16) ? 16 + BITNO_16((x) >> 16) : BITNO_16((x)))
#define BITNO_16(x) (((x) >> 8) ? 8 + BITNO_8((x) >> 8) : BITNO_8((x)))
#define BITNO_8(x) (((x) >> 4) ? 4 + BITNO_4((x) >> 4) : BITNO_4((x)))
@@ -542,8 +539,8 @@ capture_radiotap(const guchar * pd, int offset, int len, packet_counts * ld)
capture_ieee80211(pd, offset + it_len, len, ld);
}
-static void
-dissect_radiotap(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
+static int
+dissect_radiotap(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* unused_data _U_)
{
proto_tree *radiotap_tree = NULL;
proto_tree *pt = NULL, *present_tree = NULL;
@@ -621,8 +618,6 @@ dissect_radiotap(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
}
data = tvb_memdup(wmem_packet_scope(), tvb, 0, length);
- if (!data)
- return;
if (ieee80211_radiotap_iterator_init(&iter, (struct ieee80211_radiotap_header *)data, length, NULL)) {
if (tree)
@@ -1802,6 +1797,7 @@ dissect_radiotap(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
tree, &phdr);
tap_queue_packet(radiotap_tap, pinfo, radiotap_info);
+ return tvb_captured_length(tvb);
}
void proto_register_radiotap(void)
@@ -2653,7 +2649,7 @@ void proto_register_radiotap(void)
proto_register_subtree_array(ett, array_length(ett));
expert_radiotap = expert_register_protocol(proto_radiotap);
expert_register_field_array(expert_radiotap, ei, array_length(ei));
- register_dissector("radiotap", dissect_radiotap, proto_radiotap);
+ new_register_dissector("radiotap", dissect_radiotap, proto_radiotap);
radiotap_tap = register_tap("radiotap");
diff --git a/epan/dissectors/packet-ieee80211-wlancap.c b/epan/dissectors/packet-ieee80211-wlancap.c
index 524b9839ef..0f12f7c8aa 100644
--- a/epan/dissectors/packet-ieee80211-wlancap.c
+++ b/epan/dissectors/packet-ieee80211-wlancap.c
@@ -348,8 +348,8 @@ Changes: v2.1->v2.1.1
#define SSI_DBM 2 /* dBm */
#define SSI_RAW_RSSI 3 /* raw RSSI from the hardware */
-static void
-dissect_wlancap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_wlancap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *wlan_tree = NULL;
proto_item *ti;
@@ -683,6 +683,7 @@ dissect_wlancap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* dissect the 802.11 header next */
next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector_with_data(ieee80211_radio_handle, next_tvb, pinfo, tree, (void *)&phdr);
+ return tvb_captured_length(tvb);
}
static const value_string phy_type[] = {
@@ -846,9 +847,9 @@ void proto_register_ieee80211_wlancap(void)
"AVS WLANCAP", "wlancap");
proto_register_field_array(proto_wlancap, hf_wlancap,
array_length(hf_wlancap));
- register_dissector("wlancap", dissect_wlancap, proto_wlancap);
+ new_register_dissector("wlancap", dissect_wlancap, proto_wlancap);
- wlancap_handle = create_dissector_handle(dissect_wlancap, proto_wlancap);
+ wlancap_handle = new_create_dissector_handle(dissect_wlancap, proto_wlancap);
dissector_add_uint("wtap_encap", WTAP_ENCAP_IEEE_802_11_AVS,
wlancap_handle);
proto_register_subtree_array(tree_array, array_length(tree_array));
diff --git a/epan/dissectors/packet-ieee80211.c b/epan/dissectors/packet-ieee80211.c
index ea4ceaf968..917f227f5a 100644
--- a/epan/dissectors/packet-ieee80211.c
+++ b/epan/dissectors/packet-ieee80211.c
@@ -18364,8 +18364,8 @@ dissect_ieee80211 (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
* Dissect 802.11 with a variable-length link-layer header and with an
* FCS, but no pseudo-header.
*/
-static void
-dissect_ieee80211_withfcs (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_ieee80211_withfcs (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
struct ieee_802_11_phdr phdr;
@@ -18376,14 +18376,15 @@ dissect_ieee80211_withfcs (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
phdr.phy = PHDR_802_11_PHY_UNKNOWN;
phdr.presence_flags = 0;
dissect_ieee80211_common (tvb, pinfo, tree, FALSE, FALSE, &phdr);
+ return tvb_captured_length(tvb);
}
/*
* Dissect 802.11 with a variable-length link-layer header and without an
* FCS, but no pseudo-header.
*/
-static void
-dissect_ieee80211_withoutfcs (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_ieee80211_withoutfcs (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
struct ieee_802_11_phdr phdr;
@@ -18394,6 +18395,7 @@ dissect_ieee80211_withoutfcs (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
phdr.phy = PHDR_802_11_PHY_UNKNOWN;
phdr.presence_flags = 0;
dissect_ieee80211_common (tvb, pinfo, tree, FALSE, FALSE, &phdr);
+ return tvb_captured_length(tvb);
}
/*
@@ -18446,8 +18448,8 @@ dissect_ieee80211_centrino(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* control field and with no FCS (some hardware sends out LWAPP-encapsulated
* 802.11 packets with the control field byte swapped).
*/
-static void
-dissect_ieee80211_bsfc (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_ieee80211_bsfc (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
struct ieee_802_11_phdr phdr;
@@ -18458,6 +18460,7 @@ dissect_ieee80211_bsfc (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
phdr.phy = PHDR_802_11_PHY_UNKNOWN;
phdr.presence_flags = 0;
dissect_ieee80211_common (tvb, pinfo, tree, TRUE, FALSE, &phdr);
+ return tvb_captured_length(tvb);
}
static void
@@ -27037,9 +27040,9 @@ proto_register_ieee80211 (void)
expert_register_field_array(expert_ieee80211, ei, array_length(ei));
new_register_dissector("wlan", dissect_ieee80211, proto_wlan);
- register_dissector("wlan_withfcs", dissect_ieee80211_withfcs, proto_wlan);
- register_dissector("wlan_withoutfcs", dissect_ieee80211_withoutfcs, proto_wlan);
- register_dissector("wlan_bsfc", dissect_ieee80211_bsfc, proto_wlan);
+ new_register_dissector("wlan_withfcs", dissect_ieee80211_withfcs, proto_wlan);
+ new_register_dissector("wlan_withoutfcs", dissect_ieee80211_withoutfcs, proto_wlan);
+ new_register_dissector("wlan_bsfc", dissect_ieee80211_bsfc, proto_wlan);
register_init_routine(wlan_defragment_init);
register_cleanup_routine(wlan_defragment_cleanup);
diff --git a/epan/dissectors/packet-ieee802154.c b/epan/dissectors/packet-ieee802154.c
index 88a6a2e0b5..429c230a22 100644
--- a/epan/dissectors/packet-ieee802154.c
+++ b/epan/dissectors/packet-ieee802154.c
@@ -159,10 +159,10 @@ UAT_BUFFER_CB_DEF(addr_uat, eui64, static_addr_t, eui64, eui64_len)
*/
/* Dissection Routines. */
-static void dissect_ieee802154_nonask_phy (tvbuff_t *, packet_info *, proto_tree *);
-static void dissect_ieee802154 (tvbuff_t *, packet_info *, proto_tree *);
-static void dissect_ieee802154_nofcs (tvbuff_t *, packet_info *, proto_tree *);
-static void dissect_ieee802154_cc24xx (tvbuff_t *, packet_info *, proto_tree *);
+static int dissect_ieee802154_nonask_phy (tvbuff_t *, packet_info *, proto_tree *, void *);
+static int dissect_ieee802154 (tvbuff_t *, packet_info *, proto_tree *, void *);
+static int dissect_ieee802154_nofcs (tvbuff_t *, packet_info *, proto_tree *, void *);
+static int dissect_ieee802154_cc24xx (tvbuff_t *, packet_info *, proto_tree *, void *);
/*static void dissect_ieee802154_linux (tvbuff_t *, packet_info *, proto_tree *); TODO: Implement Me. */
static void dissect_ieee802154_common (tvbuff_t *, packet_info *, proto_tree *, guint);
@@ -492,8 +492,8 @@ dissect_ieee802154_fcf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, ieee
* void
*---------------------------------------------------------------
*/
-static void
-dissect_ieee802154_nonask_phy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_ieee802154_nonask_phy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *ieee802154_tree = NULL;
proto_item *proto_root = NULL;
@@ -535,7 +535,8 @@ dissect_ieee802154_nonask_phy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
mac=tvb_new_subset(tvb,offset,-1, phr & IEEE802154_PHY_LENGTH_MASK);
/* Call the common dissector. */
- dissect_ieee802154(mac, pinfo, ieee802154_tree);
+ dissect_ieee802154(mac, pinfo, ieee802154_tree, NULL);
+ return tvb_captured_length(tvb);
} /* dissect_ieee802154_nonask_phy */
/*FUNCTION:------------------------------------------------------
@@ -553,11 +554,12 @@ dissect_ieee802154_nonask_phy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
* void
*---------------------------------------------------------------
*/
-static void
-dissect_ieee802154(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_ieee802154(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
/* Call the common dissector. */
dissect_ieee802154_common(tvb, pinfo, tree, (ieee802154_cc24xx ? DISSECT_IEEE802154_OPTION_CC24xx : 0));
+ return tvb_captured_length(tvb);
} /* dissect_ieee802154 */
/*FUNCTION:------------------------------------------------------
@@ -574,8 +576,8 @@ dissect_ieee802154(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* void
*---------------------------------------------------------------
*/
-static void
-dissect_ieee802154_nofcs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_ieee802154_nofcs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void * data _U_)
{
tvbuff_t *new_tvb;
/* If there is no FCS present in the reported packet, then the length of
@@ -590,6 +592,7 @@ dissect_ieee802154_nofcs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
new_tvb = tvb_new_subset(tvb, 0, -1, tvb_reported_length(tvb)+IEEE802154_FCS_LEN);
/* Call the common dissector. */
dissect_ieee802154_common(new_tvb, pinfo, tree, 0);
+ return tvb_captured_length(tvb);
} /* dissect_ieee802154_nofcs */
/*FUNCTION:------------------------------------------------------
@@ -608,11 +611,12 @@ dissect_ieee802154_nofcs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* void
*---------------------------------------------------------------
*/
-static void
-dissect_ieee802154_cc24xx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_ieee802154_cc24xx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void * data _U_)
{
/* Call the common dissector. */
dissect_ieee802154_common(tvb, pinfo, tree, DISSECT_IEEE802154_OPTION_CC24xx);
+ return tvb_captured_length(tvb);
} /* dissect_ieee802154_cc24xx */
/*FUNCTION:------------------------------------------------------
@@ -2842,10 +2846,10 @@ void proto_register_ieee802154(void)
ieee802154_beacon_subdissector_list = register_heur_dissector_list(IEEE802154_PROTOABBREV_WPAN_BEACON);
/* Register dissectors with Wireshark. */
- register_dissector(IEEE802154_PROTOABBREV_WPAN, dissect_ieee802154, proto_ieee802154);
- register_dissector("wpan_nofcs", dissect_ieee802154_nofcs, proto_ieee802154);
- register_dissector("wpan_cc24xx", dissect_ieee802154_cc24xx, proto_ieee802154);
- register_dissector("wpan-nonask-phy", dissect_ieee802154_nonask_phy, proto_ieee802154_nonask_phy);
+ new_register_dissector(IEEE802154_PROTOABBREV_WPAN, dissect_ieee802154, proto_ieee802154);
+ new_register_dissector("wpan_nofcs", dissect_ieee802154_nofcs, proto_ieee802154);
+ new_register_dissector("wpan_cc24xx", dissect_ieee802154_cc24xx, proto_ieee802154);
+ new_register_dissector("wpan-nonask-phy", dissect_ieee802154_nonask_phy, proto_ieee802154_nonask_phy);
/* Register a Decode-As handler. */
register_decode_as(&ieee802154_da);
diff --git a/epan/dissectors/packet-imf.c b/epan/dissectors/packet-imf.c
index 25997bea97..a3d1a0c34f 100644
--- a/epan/dissectors/packet-imf.c
+++ b/epan/dissectors/packet-imf.c
@@ -680,8 +680,8 @@ imf_find_field_end(tvbuff_t *tvb, int offset, gint max_length, gboolean *last_fi
}
-static void
-dissect_imf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_imf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *item;
proto_tree *unknown_tree, *text_tree;
@@ -823,8 +823,8 @@ dissect_imf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_fence(pinfo->cinfo, COL_INFO);
if(content_encoding_str && !g_ascii_strncasecmp(content_encoding_str, "base64", 6)) {
- char *data = tvb_get_string_enc(wmem_packet_scope(), tvb, end_offset, tvb_reported_length(tvb) - end_offset, ENC_ASCII);
- next_tvb = base64_to_tvb(tvb, data);
+ char *string_data = tvb_get_string_enc(wmem_packet_scope(), tvb, end_offset, tvb_reported_length(tvb) - end_offset, ENC_ASCII);
+ next_tvb = base64_to_tvb(tvb, string_data);
add_new_data_source(pinfo, next_tvb, content_encoding_str);
} else {
next_tvb = tvb_new_subset_remaining(tvb, end_offset);
@@ -859,6 +859,7 @@ dissect_imf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
start_offset = end_offset;
}
}
+ return tvb_captured_length(tvb);
}
static void
@@ -1258,7 +1259,7 @@ proto_register_imf(void)
expert_register_field_array(expert_imf, ei, array_length(ei));
/* Allow dissector to find be found by name. */
- imf_handle = register_dissector(PFNAME, dissect_imf, proto_imf);
+ imf_handle = new_register_dissector(PFNAME, dissect_imf, proto_imf);
imf_module = prefs_register_protocol(proto_imf, NULL);
prefs_register_uat_preference(imf_module, "custom_header_fields", "Custom IMF headers",
diff --git a/epan/dissectors/packet-infiniband.c b/epan/dissectors/packet-infiniband.c
index 26dbe5f670..8048ce2d51 100644
--- a/epan/dissectors/packet-infiniband.c
+++ b/epan/dissectors/packet-infiniband.c
@@ -136,9 +136,7 @@ typedef enum {
static void dissect_roce(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
static void dissect_rroce(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
-static void dissect_infiniband(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
static void dissect_infiniband_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, ib_packet_start_header starts_with);
-static void dissect_infiniband_link(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
static gint32 find_next_header_sequence(struct infinibandinfo* ibInfo);
static gboolean contains(guint32 value, guint32* arr, int length);
static void dissect_general_info(tvbuff_t *tvb, gint offset, packet_info *pinfo, ib_packet_start_header starts_with);
@@ -1514,10 +1512,11 @@ dissect_roce(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dissect_infiniband_common(tvb, pinfo, tree, IB_PACKET_STARTS_WITH_GRH);
}
-static void
-dissect_infiniband(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_infiniband(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
dissect_infiniband_common(tvb, pinfo, tree, IB_PACKET_STARTS_WITH_LRH);
+ return tvb_captured_length(tvb);
}
/* Common Dissector for both InfiniBand and RoCE packets
@@ -1996,8 +1995,8 @@ skip_lrh:
}
-static void
-dissect_infiniband_link(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_infiniband_link(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
/* Top Level Item */
proto_item *infiniband_link_packet;
@@ -2043,6 +2042,7 @@ dissect_infiniband_link(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(link_tree, hf_infiniband_link_lpcrc, tvb, offset, 2, ENC_BIG_ENDIAN);
}
+ return tvb_captured_length(tvb);
}
@@ -7410,7 +7410,7 @@ void proto_register_infiniband(void)
};
proto_infiniband = proto_register_protocol("InfiniBand", "IB", "infiniband");
- ib_handle = register_dissector("infiniband", dissect_infiniband, proto_infiniband);
+ ib_handle = new_register_dissector("infiniband", dissect_infiniband, proto_infiniband);
proto_register_field_array(proto_infiniband, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
@@ -7437,7 +7437,7 @@ void proto_register_infiniband(void)
10, &pref_rroce_udp_port);
proto_infiniband_link = proto_register_protocol("InfiniBand Link", "InfiniBand Link", "infiniband_link");
- ib_link_handle = register_dissector("infiniband_link", dissect_infiniband_link, proto_infiniband_link);
+ ib_link_handle = new_register_dissector("infiniband_link", dissect_infiniband_link, proto_infiniband_link);
proto_register_field_array(proto_infiniband_link, hf_link, array_length(hf_link));
proto_register_subtree_array(ett_link_array, array_length(ett_link_array));
diff --git a/epan/dissectors/packet-ipsec.c b/epan/dissectors/packet-ipsec.c
index 61ff6366a2..ff0063f355 100644
--- a/epan/dissectors/packet-ipsec.c
+++ b/epan/dissectors/packet-ipsec.c
@@ -1183,8 +1183,8 @@ dissect_ah_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat
return advance;
}
-static void
-dissect_ah(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_ah(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
struct ah_header_data header_data = {NULL, 0};
tvbuff_t *next_tvb;
@@ -1217,6 +1217,7 @@ dissect_ah(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
export_ipsec_pdu(dissector_handle, pinfo, next_tvb);
call_dissector(dissector_handle, next_tvb, pinfo, header_data.next_tree);
pinfo->match_uint = saved_match_uint;
+ return tvb_captured_length(tvb);
}
/*
@@ -1291,8 +1292,8 @@ dissect_esp_authentication(proto_tree *tree, tvbuff_t *tvb, gint len, gint esp_a
}
#endif
-static void
-dissect_esp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_esp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *esp_tree = NULL;
proto_item *ti;
@@ -2228,6 +2229,7 @@ dissect_esp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
#ifdef HAVE_LIBGCRYPT
}
#endif
+ return tvb_captured_length(tvb);
}
@@ -2538,8 +2540,8 @@ proto_register_ipsec(void)
register_init_routine(&ipsec_init_protocol);
register_cleanup_routine(&ipsec_cleanup_protocol);
- register_dissector("esp", dissect_esp, proto_esp);
- register_dissector("ah", dissect_ah, proto_ah);
+ new_register_dissector("esp", dissect_esp, proto_esp);
+ new_register_dissector("ah", dissect_ah, proto_ah);
}
void
diff --git a/epan/dissectors/packet-ipx.c b/epan/dissectors/packet-ipx.c
index d7a2cde5a6..0058655f40 100644
--- a/epan/dissectors/packet-ipx.c
+++ b/epan/dissectors/packet-ipx.c
@@ -147,9 +147,6 @@ static void
dissect_serialization(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
static void
-dissect_ipxsap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
-
-static void
dissect_ipxmsg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
#define UDP_PORT_IPX 213 /* RFC 1234 */
@@ -293,8 +290,8 @@ capture_ipx(packet_counts *ld)
ld->ipx++;
}
-static void
-dissect_ipx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_ipx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
tvbuff_t *next_tvb;
@@ -441,11 +438,11 @@ dissect_ipx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (second_socket != IPX_SOCKET_NWLINK_SMB_NAMEQUERY) {
if (dissector_try_uint_new(ipx_socket_dissector_table, first_socket,
next_tvb, pinfo, tree, FALSE, ipxh))
- return;
+ return tvb_captured_length(tvb);
}
if (dissector_try_uint_new(ipx_socket_dissector_table, second_socket,
next_tvb, pinfo, tree, FALSE, ipxh))
- return;
+ return tvb_captured_length(tvb);
/*
* Neither of them are known; try the packet type, which will
@@ -453,9 +450,10 @@ dissect_ipx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
*/
if (dissector_try_uint_new(ipx_type_dissector_table, ipxh->ipx_type, next_tvb,
pinfo, tree, FALSE, ipxh))
- return;
+ return tvb_captured_length(tvb);
call_dissector(data_handle,next_tvb, pinfo, tree);
+ return tvb_captured_length(tvb);
}
/* ================================================================= */
/* SPX Hash Functions */
@@ -1239,8 +1237,8 @@ static const value_string ipxsap_packet_vals[] = {
{ 0, NULL}
};
-static void
-dissect_ipxsap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_ipxsap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *sap_tree, *s_tree;
proto_item *ti, *hidden_item;
@@ -1299,6 +1297,7 @@ dissect_ipxsap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(sap_tree, hf_sap_server_type, tvb, 2, 2, ENC_BIG_ENDIAN);
}
}
+ return tvb_captured_length(tvb);
}
void
@@ -1553,7 +1552,7 @@ proto_register_ipx(void)
"IPX", "ipx");
proto_register_field_array(proto_ipx, hf_ipx, array_length(hf_ipx));
- register_dissector("ipx", dissect_ipx, proto_ipx);
+ new_register_dissector("ipx", dissect_ipx, proto_ipx);
proto_spx = proto_register_protocol("Sequenced Packet eXchange",
"SPX", "spx");
@@ -1573,7 +1572,7 @@ proto_register_ipx(void)
proto_sap = proto_register_protocol("Service Advertisement Protocol",
"IPX SAP", "ipxsap");
- register_dissector("ipxsap", dissect_ipxsap, proto_sap);
+ new_register_dissector("ipxsap", dissect_ipxsap, proto_sap);
proto_register_field_array(proto_sap, hf_sap, array_length(hf_sap));
diff --git a/epan/dissectors/packet-isup.c b/epan/dissectors/packet-isup.c
index 8fbd7d6051..2d5f3abbb6 100644
--- a/epan/dissectors/packet-isup.c
+++ b/epan/dissectors/packet-isup.c
@@ -10646,8 +10646,8 @@ dissect_isup_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *isup
}
/* ------------------------------------------------------------------ */
-static void
-dissect_isup(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_isup(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
/* Set up structures needed to add the protocol subtree and manage it */
@@ -10738,11 +10738,12 @@ dissect_isup(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
message_tvb = tvb_new_subset_remaining(tvb, CIC_LENGTH);
dissect_isup_message(message_tvb, pinfo, isup_tree, itu_isup_variant, cic);
}
+ return tvb_captured_length(tvb);
}
/* ------------------------------------------------------------------ */
-static void
-dissect_bicc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_bicc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
/* Set up structures needed to add the protocol subtree and manage it */
@@ -10815,6 +10816,7 @@ dissect_bicc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
message_tvb = tvb_new_subset_remaining(tvb, BICC_CIC_LENGTH);
dissect_isup_message(message_tvb, pinfo, bicc_tree, itu_isup_variant, bicc_cic);
col_set_fence(pinfo->cinfo, COL_INFO);
+ return tvb_captured_length(tvb);
}
static int
@@ -12389,7 +12391,7 @@ proto_register_isup(void)
proto_isup = proto_register_protocol("ISDN User Part",
"ISUP", "isup");
- register_dissector("isup", dissect_isup, proto_isup);
+ new_register_dissector("isup", dissect_isup, proto_isup);
/* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_isup, hf, array_length(hf));
@@ -12431,7 +12433,7 @@ proto_reg_handoff_isup(void)
dissector_handle_t isup_handle;
dissector_handle_t application_isup_handle;
- isup_handle = create_dissector_handle(dissect_isup, proto_isup);
+ isup_handle = new_create_dissector_handle(dissect_isup, proto_isup);
application_isup_handle = new_create_dissector_handle(dissect_application_isup, proto_isup);
dissector_add_uint("mtp3.service_indicator", MTP_SI_ISUP, isup_handle);
dissector_add_string("media_type", "application/isup", application_isup_handle);
@@ -12458,7 +12460,7 @@ proto_register_bicc(void)
proto_bicc = proto_register_protocol("Bearer Independent Call Control",
"BICC", "bicc");
- bicc_handle = register_dissector("bicc", dissect_bicc, proto_bicc);
+ bicc_handle = new_register_dissector("bicc", dissect_bicc, proto_bicc);
/* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_bicc, hf, array_length(hf));
diff --git a/epan/dissectors/packet-iua.c b/epan/dissectors/packet-iua.c
index 5a4ef32b4f..0787de019c 100644
--- a/epan/dissectors/packet-iua.c
+++ b/epan/dissectors/packet-iua.c
@@ -895,8 +895,8 @@ dissect_iua_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree,
dissect_parameters(parameters_tvb, pinfo, tree, iua_tree);
}
-static void
-dissect_iua(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_iua(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *iua_item;
proto_tree *iua_tree;
@@ -911,6 +911,7 @@ dissect_iua(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree)
/* dissect the message */
dissect_iua_message(message_tvb, pinfo, tree, iua_tree);
+ return tvb_captured_length(message_tvb);
}
/* Register the protocol with Wireshark */
@@ -975,7 +976,7 @@ proto_register_iua(void)
&global_iua_gsm_sapis);
/* Allow other dissectors to find this one by name. */
- register_dissector("iua", dissect_iua, proto_iua);
+ new_register_dissector("iua", dissect_iua, proto_iua);
}
#define SCTP_PORT_IUA 9900
diff --git a/epan/dissectors/packet-iwarp-ddp-rdmap.c b/epan/dissectors/packet-iwarp-ddp-rdmap.c
index a18ef4044f..793c625540 100644
--- a/epan/dissectors/packet-iwarp-ddp-rdmap.c
+++ b/epan/dissectors/packet-iwarp-ddp-rdmap.c
@@ -466,8 +466,8 @@ dissect_iwarp_rdmap(tvbuff_t *tvb, proto_tree *rdma_tree, guint32 offset,
* Main dissection routine which dissects a DDP segment and interprets the
* header field rsvdULP according to RDMAP.
*/
-static void
-dissect_iwarp_ddp_rdmap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_iwarp_ddp_rdmap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *ddp_rdma_tree = NULL;
proto_tree *ddp_tree = NULL;
@@ -652,6 +652,7 @@ dissect_iwarp_ddp_rdmap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|| info.opcode == RDMA_TERMINATE) {
dissect_iwarp_rdmap(tvb, rdma_tree, offset, info.opcode);
}
+ return tvb_captured_length(tvb);
}
/* register the protocol with Wireshark */
@@ -892,7 +893,7 @@ proto_register_iwarp_ddp_rdmap(void)
rdmap_heur_subdissector_list = register_heur_dissector_list("iwarp_ddp_rdmap");
- register_dissector("iwarp_ddp_rdmap", dissect_iwarp_ddp_rdmap,
+ new_register_dissector("iwarp_ddp_rdmap", dissect_iwarp_ddp_rdmap,
proto_iwarp_ddp_rdmap);
}
diff --git a/epan/dissectors/packet-ixveriwave.c b/epan/dissectors/packet-ixveriwave.c
index 9357a5378f..c563892ab6 100644
--- a/epan/dissectors/packet-ixveriwave.c
+++ b/epan/dissectors/packet-ixveriwave.c
@@ -30,7 +30,6 @@
void proto_register_ixveriwave(void);
void proto_reg_handoff_ixveriwave(void);
-static void dissect_ixveriwave(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
static void ethernettap_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree *tap_tree);
static void wlantap_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree *tap_tree, guint16 vw_msdu_length);
@@ -253,8 +252,8 @@ static dissector_handle_t ixveriwave_handle;
#define ALIGN_OFFSET(offset, width) \
( (((offset) + ((width) - 1)) & (~((width) - 1))) - offset )
-static void
-dissect_ixveriwave(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_ixveriwave(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *common_tree = NULL;
proto_item *ti = NULL;
@@ -389,13 +388,9 @@ dissect_ixveriwave(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/*extract signature timestamp, 4 bytes (32 LSBs only, nsec)*/
if (length_remaining >= 4) {
- if (tree) {
- if (vw_times_tree != NULL) {
- /* TODO: what should this fieldname be? */
- proto_tree_add_item(vw_times_tree, hf_ixveriwave,
+ /* TODO: what should this fieldname be? */
+ proto_tree_add_item(vw_times_tree, hf_ixveriwave,
tvb, offset, 4, ENC_BIG_ENDIAN);
- }
- }
time_tree_offset = offset;
offset +=4;
length_remaining -=4;
@@ -405,13 +400,9 @@ dissect_ixveriwave(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (length_remaining >= 8) {
vw_startt = tvb_get_letoh64(tvb, offset);
- if (tree) {
- if (vw_times_tree != NULL) {
- proto_tree_add_uint64_format_value(vw_times_tree, hf_ixveriwave_vw_startt,
+ proto_tree_add_uint64_format_value(vw_times_tree, hf_ixveriwave_vw_startt,
tvb, offset, 8, vw_startt,
"%" G_GINT64_MODIFIER "u usec", vw_startt);
- }
- }
offset +=8;
length_remaining -=8;
@@ -421,13 +412,9 @@ dissect_ixveriwave(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (length_remaining >= 8) {
vw_endt = tvb_get_letoh64(tvb, offset);
- if (tree) {
- if (vw_times_tree != NULL) {
- proto_tree_add_uint64_format_value(vw_times_tree, hf_ixveriwave_vw_endt,
+ proto_tree_add_uint64_format_value(vw_times_tree, hf_ixveriwave_vw_endt,
tvb, offset, 8, vw_endt,
"%" G_GINT64_MODIFIER "u usec", vw_endt);
- }
- }
offset +=8;
length_remaining -=8;
@@ -436,32 +423,28 @@ dissect_ixveriwave(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (length_remaining >= 4) {
vw_pktdur = tvb_get_letohl(tvb, offset);
- if (tree) {
- if (vw_times_tree != NULL) {
- if (vw_endt >= vw_startt) {
- /* Add to root summary */
- if (version == ETHERNET_PORT) {
- proto_item_append_text(vw_times_ti, " (Frame duration=%u nsecs)", vw_pktdur);
- proto_tree_add_uint_format(vw_times_tree, hf_ixveriwave_vw_pktdur,
- tvb, offset-16, 16, vw_pktdur,
- "Frame duration: %u nsec", vw_pktdur);
- }
- else {
- proto_item_append_text(vw_times_ti, " (Frame duration=%u usecs)", vw_pktdur);
- proto_tree_add_uint_format(vw_times_tree, hf_ixveriwave_vw_pktdur,
- tvb, offset-16, 16, vw_pktdur,
- "Frame duration: %u usec", vw_pktdur);
- }
- }
- else {
- proto_tree_add_uint_format(vw_times_tree, hf_ixveriwave_vw_pktdur,
- tvb, offset, 0, vw_pktdur,
- "Frame duration: N/A");
-
- /* Add to root summary */
- proto_item_append_text(vw_times_ti, " (Frame duration=N/A)");
- }
+ if (vw_endt >= vw_startt) {
+ /* Add to root summary */
+ if (version == ETHERNET_PORT) {
+ proto_item_append_text(vw_times_ti, " (Frame duration=%u nsecs)", vw_pktdur);
+ proto_tree_add_uint_format(vw_times_tree, hf_ixveriwave_vw_pktdur,
+ tvb, offset-16, 16, vw_pktdur,
+ "Frame duration: %u nsec", vw_pktdur);
}
+ else {
+ proto_item_append_text(vw_times_ti, " (Frame duration=%u usecs)", vw_pktdur);
+ proto_tree_add_uint_format(vw_times_tree, hf_ixveriwave_vw_pktdur,
+ tvb, offset-16, 16, vw_pktdur,
+ "Frame duration: %u usec", vw_pktdur);
+ }
+ }
+ else {
+ proto_tree_add_uint_format(vw_times_tree, hf_ixveriwave_vw_pktdur,
+ tvb, offset, 0, vw_pktdur,
+ "Frame duration: N/A");
+
+ /* Add to root summary */
+ proto_item_append_text(vw_times_ti, " (Frame duration=N/A)");
}
offset +=4;
@@ -511,6 +494,7 @@ dissect_ixveriwave(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ethernettap_dissect(next_tvb, pinfo, tree, common_tree);
else
wlantap_dissect(next_tvb, pinfo, tree, common_tree, vw_msdu_length);
+ return tvb_captured_length(tvb);
}
/*
@@ -1688,7 +1672,7 @@ framing signal deasserted. this is caused by software setting the drain all reg
proto_register_field_array(proto_ixveriwave, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
- ixveriwave_handle = register_dissector("ixveriwave", dissect_ixveriwave, proto_ixveriwave);
+ ixveriwave_handle = new_register_dissector("ixveriwave", dissect_ixveriwave, proto_ixveriwave);
}
void proto_reg_handoff_ixveriwave(void)
@@ -1698,7 +1682,7 @@ void proto_reg_handoff_ixveriwave(void)
/* handle for 802.11+radio information dissector */
ieee80211_radio_handle = find_dissector("wlan_radio");
- ixveriwave_handle = create_dissector_handle(dissect_ixveriwave, proto_ixveriwave);
+ ixveriwave_handle = new_create_dissector_handle(dissect_ixveriwave, proto_ixveriwave);
dissector_add_uint("wtap_encap", WTAP_ENCAP_IXVERIWAVE, ixveriwave_handle);
}
diff --git a/epan/dissectors/packet-k12.c b/epan/dissectors/packet-k12.c
index 792c1e7b38..2c1a8ee7f4 100644
--- a/epan/dissectors/packet-k12.c
+++ b/epan/dissectors/packet-k12.c
@@ -179,8 +179,8 @@ fill_fp_info(fp_info* p_fp_info, guchar* extra_info, guint32 length)
}
}
-static void
-dissect_k12(tvbuff_t* tvb,packet_info* pinfo,proto_tree* tree)
+static int
+dissect_k12(tvbuff_t* tvb,packet_info* pinfo,proto_tree* tree, void* data _U_)
{
static dissector_handle_t data_handles[] = {NULL, NULL};
proto_item* k12_item;
@@ -261,7 +261,7 @@ dissect_k12(tvbuff_t* tvb,packet_info* pinfo,proto_tree* tree)
expert_add_info(pinfo, stack_item, &ei_k12_unmatched_info);
call_dissector(data_handle, tvb, pinfo, tree);
- return;
+ return tvb_captured_length(tvb);
}
/* Setup subdissector information */
@@ -294,6 +294,7 @@ dissect_k12(tvbuff_t* tvb,packet_info* pinfo,proto_tree* tree)
}
call_dissector(sub_handle, tvb, pinfo, tree);
+ return tvb_captured_length(tvb);
}
static gboolean
@@ -475,7 +476,7 @@ proto_register_k12(void)
proto_register_subtree_array(ett, array_length(ett));
expert_k12 = expert_register_protocol(proto_k12);
expert_register_field_array(expert_k12, ei, array_length(ei));
- register_dissector("k12", dissect_k12, proto_k12);
+ new_register_dissector("k12", dissect_k12, proto_k12);
k12_uat = uat_new("K12 Protocols",
sizeof(k12_handles_t),
diff --git a/epan/dissectors/packet-lapd.c b/epan/dissectors/packet-lapd.c
index e5d4e0a676..b3bcd4cf05 100644
--- a/epan/dissectors/packet-lapd.c
+++ b/epan/dissectors/packet-lapd.c
@@ -196,8 +196,6 @@ typedef struct lapd_convo_data {
static void
-dissect_lapd(tvbuff_t*, packet_info*, proto_tree*);
-static void
dissect_lapd_full(tvbuff_t*, packet_info*, proto_tree*, gboolean);
/* got new LAPD frame byte */
@@ -219,8 +217,8 @@ lapd_log_abort(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset
expert_add_info_format(pinfo, ti, &ei_lapd_abort, "%s", msg);
}
-static void
-dissect_lapd_bitstream(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_lapd_bitstream(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dissector_data _U_)
{
guint8 byte, full_byte = 0x00, bit_offset = 0;
gboolean bit;
@@ -402,12 +400,14 @@ dissect_lapd_bitstream(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
}
+ return tvb_captured_length(tvb);
}
-static void
-dissect_lapd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_lapd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
dissect_lapd_full(tvb, pinfo, tree, FALSE);
+ return tvb_captured_length(tvb);
}
static void
@@ -601,7 +601,7 @@ dissect_udp_lapd(tvbuff_t *tvb, packet_info *pinfo _U_ , proto_tree *tree, void
if (!check_xdlc_control(tvb, 2, NULL, NULL, FALSE, FALSE))
return FALSE;
- dissect_lapd(tvb, pinfo, tree);
+ dissect_lapd(tvb, pinfo, tree, data);
return TRUE;
}
@@ -728,7 +728,7 @@ proto_register_lapd(void)
expert_lapd = expert_register_protocol(proto_lapd);
expert_register_field_array(expert_lapd, ei, array_length(ei));
- register_dissector("lapd", dissect_lapd, proto_lapd);
+ new_register_dissector("lapd", dissect_lapd, proto_lapd);
lapd_sapi_dissector_table = register_dissector_table("lapd.sapi",
"LAPD SAPI", FT_UINT16, BASE_DEC, DISSECTOR_TABLE_NOT_ALLOW_DUPLICATE);
@@ -765,7 +765,7 @@ proto_reg_handoff_lapd(void)
dissector_add_uint("l2tp.pw_type", L2TPv3_PROTOCOL_LAPD, lapd_handle);
heur_dissector_add("udp", dissect_udp_lapd, "LAPD over UDP", "lapd_udp", proto_lapd, HEURISTIC_ENABLE);
- register_dissector("lapd-bitstream", dissect_lapd_bitstream, proto_lapd);
+ new_register_dissector("lapd-bitstream", dissect_lapd_bitstream, proto_lapd);
lapd_bitstream_handle = find_dissector("lapd-bitstream");
data_handle = find_dissector("data");
diff --git a/epan/dissectors/packet-llc.c b/epan/dissectors/packet-llc.c
index 4e0402657c..b9a0c951b0 100644
--- a/epan/dissectors/packet-llc.c
+++ b/epan/dissectors/packet-llc.c
@@ -386,8 +386,8 @@ static const xdlc_cf_items llc_cf_items_ext = {
&hf_llc_ftype_s_u_ext
};
-static void
-dissect_basicxid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_basicxid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *xid_tree = NULL;
proto_item *ti = NULL;
@@ -397,36 +397,32 @@ dissect_basicxid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_clear(pinfo->cinfo, COL_INFO);
format = tvb_get_guint8(tvb, 0);
- if (tree) {
- ti = proto_tree_add_item(tree, proto_basicxid, tvb, 0, -1, ENC_NA);
- xid_tree = proto_item_add_subtree(ti, ett_llc_basicxid);
- proto_tree_add_uint(xid_tree, hf_llc_xid_format, tvb, 0,
- 1, format);
- } else
- xid_tree = NULL;
- col_append_str(pinfo->cinfo, COL_INFO,
- "Basic Format");
+
+ ti = proto_tree_add_item(tree, proto_basicxid, tvb, 0, -1, ENC_NA);
+ xid_tree = proto_item_add_subtree(ti, ett_llc_basicxid);
+ proto_tree_add_uint(xid_tree, hf_llc_xid_format, tvb, 0, 1, format);
+
+ col_append_str(pinfo->cinfo, COL_INFO, "Basic Format");
types = tvb_get_guint8(tvb, 1);
- if (tree) {
- proto_tree_add_uint(xid_tree, hf_llc_xid_types, tvb, 1,
+ proto_tree_add_uint(xid_tree, hf_llc_xid_types, tvb, 1,
1, types & TYPES_MASK);
- }
+
col_append_fstr(pinfo->cinfo, COL_INFO,
"; %s", val_to_str(types & TYPES_MASK, type_vals, "0x%02x")
);
wsize = tvb_get_guint8(tvb, 2);
- if (tree) {
- proto_tree_add_uint(xid_tree, hf_llc_xid_wsize, tvb, 2,
+ proto_tree_add_uint(xid_tree, hf_llc_xid_wsize, tvb, 2,
1, (wsize & 0xFE) >> 1);
- }
+
col_append_fstr(pinfo->cinfo, COL_INFO,
"; Window Size %d", (wsize & 0xFE) >> 1);
+ return tvb_captured_length(tvb);
}
-static void
-dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *llc_tree;
proto_tree *field_tree;
@@ -511,7 +507,7 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
*/
format = tvb_get_guint8(next_tvb, 0);
if (format == 0x81) {
- dissect_basicxid(next_tvb, pinfo, tree);
+ dissect_basicxid(next_tvb, pinfo, tree, data);
} else {
/*
* Try the XID LLC subdissector table
@@ -530,6 +526,7 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
}
+ return tvb_captured_length(tvb);
}
/*
@@ -860,7 +857,7 @@ proto_register_llc(void)
xid_subdissector_table = register_dissector_table("llc.xid_dsap",
"LLC XID SAP", FT_UINT8, BASE_HEX, DISSECTOR_TABLE_NOT_ALLOW_DUPLICATE);
- register_dissector("llc", dissect_llc, proto_llc);
+ new_register_dissector("llc", dissect_llc, proto_llc);
}
void
@@ -887,7 +884,7 @@ proto_register_basicxid(void)
proto_register_field_array(proto_basicxid, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
- register_dissector("basicxid", dissect_basicxid, proto_basicxid);
+ new_register_dissector("basicxid", dissect_basicxid, proto_basicxid);
}
static void
diff --git a/epan/dissectors/packet-m2pa.c b/epan/dissectors/packet-m2pa.c
index 2ca540f4b8..93de068fa3 100644
--- a/epan/dissectors/packet-m2pa.c
+++ b/epan/dissectors/packet-m2pa.c
@@ -486,8 +486,8 @@ dissect_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_item *m2pa_item
dissect_message_data(message_tvb, pinfo, m2pa_item, m2pa_tree, tree);
}
-static void
-dissect_m2pa(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_m2pa(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *m2pa_item;
proto_tree *m2pa_tree;
@@ -518,6 +518,7 @@ dissect_m2pa(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dissect_message(tvb, pinfo, m2pa_item, m2pa_tree, tree);
break;
};
+ return tvb_captured_length(tvb);
}
void
@@ -575,7 +576,7 @@ proto_register_m2pa(void)
expert_register_field_array(expert_m2pa, ei, array_length(ei));
/* Allow other dissectors to find this one by name. */
- register_dissector("m2pa", dissect_m2pa, proto_m2pa);
+ new_register_dissector("m2pa", dissect_m2pa, proto_m2pa);
m2pa_module = prefs_register_protocol(proto_m2pa, proto_reg_handoff_m2pa);
diff --git a/epan/dissectors/packet-m3ua.c b/epan/dissectors/packet-m3ua.c
index 2c92ce0bd2..81b36bb546 100644
--- a/epan/dissectors/packet-m3ua.c
+++ b/epan/dissectors/packet-m3ua.c
@@ -1999,8 +1999,8 @@ dissect_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree, pro
dissect_parameters(parameters_tvb, pinfo, tree, m3ua_tree);
}
-static void
-dissect_m3ua(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_m3ua(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *m3ua_item;
proto_tree *m3ua_tree;
@@ -2028,6 +2028,7 @@ dissect_m3ua(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree)
/* dissect the message */
dissect_message(message_tvb, pinfo, tree, m3ua_tree);
+ return tvb_captured_length(message_tvb);
}
/* Register the protocol with Wireshark */
@@ -2131,7 +2132,7 @@ proto_register_m3ua(void)
/* Register the protocol name and description */
proto_m3ua = proto_register_protocol("MTP 3 User Adaptation Layer", "M3UA", "m3ua");
- register_dissector("m3ua", dissect_m3ua, proto_m3ua);
+ new_register_dissector("m3ua", dissect_m3ua, proto_m3ua);
m3ua_module = prefs_register_protocol(proto_m3ua, NULL);
prefs_register_enum_preference(m3ua_module, "version", "M3UA Version", "Version used by Wireshark", &version, options, FALSE);
diff --git a/epan/dissectors/packet-mime-encap.c b/epan/dissectors/packet-mime-encap.c
index 9005c7582d..5ee17abd3c 100644
--- a/epan/dissectors/packet-mime-encap.c
+++ b/epan/dissectors/packet-mime-encap.c
@@ -33,8 +33,8 @@ static int proto_mime_encap = -1;
static heur_dissector_list_t heur_subdissector_list;
static dissector_handle_t data_handle;
-static void
-dissect_mime_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_mime_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item* item;
heur_dtbl_entry_t *hdtbl_entry;
@@ -48,6 +48,7 @@ dissect_mime_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_item_append_text(item, " (Unhandled)");
call_dissector(data_handle, tvb, pinfo, tree);
}
+ return tvb_captured_length(tvb);
}
void
@@ -55,7 +56,7 @@ proto_register_mime_encap(void)
{
proto_mime_encap = proto_register_protocol("MIME file", "MIME_FILE", "mime_dlt");
- register_dissector("mime_dlt", dissect_mime_encap, proto_mime_encap);
+ new_register_dissector("mime_dlt", dissect_mime_encap, proto_mime_encap);
heur_subdissector_list = register_heur_dissector_list("wtap_file");
}
diff --git a/epan/dissectors/packet-mip.c b/epan/dissectors/packet-mip.c
index 72f437a365..f6a0a79674 100644
--- a/epan/dissectors/packet-mip.c
+++ b/epan/dissectors/packet-mip.c
@@ -513,9 +513,6 @@ dissect_mip_extensions( tvbuff_t *tvb, int offset, proto_tree *tree, packet_info
int cvse_local_offset= 0;
int nvse_local_offset= 0;
- /* None of this really matters if we don't have a tree */
- if (!tree) return;
-
/* Add our tree, if we have extensions */
exts_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_mip_exts, NULL, "Extensions");
@@ -780,8 +777,8 @@ dissect_mip_extensions( tvbuff_t *tvb, int offset, proto_tree *tree, packet_info
} /* dissect_mip_extensions */
/* Code to actually dissect the packets */
-static void
-dissect_mip( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_mip( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
/* Set up structures we will need to add the protocol subtree and manage it */
proto_item *ti;
@@ -1000,10 +997,10 @@ dissect_mip( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
break;
} /* End switch */
- if (tree) {
- if (tvb_reported_length_remaining(tvb, offset) > 0)
- dissect_mip_extensions(tvb, offset, mip_tree, pinfo);
- }
+ if (tvb_reported_length_remaining(tvb, offset) > 0)
+ dissect_mip_extensions(tvb, offset, mip_tree, pinfo);
+
+ return tvb_captured_length(tvb);
} /* dissect_mip */
/* Register the protocol with Wireshark */
@@ -1465,7 +1462,7 @@ void proto_register_mip(void)
proto_mip = proto_register_protocol("Mobile IP", "Mobile IP", "mip");
/* Register the dissector by name */
- register_dissector("mip", dissect_mip, proto_mip);
+ new_register_dissector("mip", dissect_mip, proto_mip);
/* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_mip, hf, array_length(hf));
diff --git a/epan/dissectors/packet-mip6.c b/epan/dissectors/packet-mip6.c
index 0d5f1a4e15..9c339ed200 100644
--- a/epan/dissectors/packet-mip6.c
+++ b/epan/dissectors/packet-mip6.c
@@ -5347,7 +5347,7 @@ proto_register_mip6(void)
proto_mip6 = proto_register_protocol("Mobile IPv6 / Network Mobility", "MIPv6", "mipv6");
/* Register the dissector by name */
- /* register_dissector("mipv6", dissect_nemo, proto_nemo); */
+ /* new_register_dissector("mipv6", dissect_nemo, proto_nemo); */
/* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_mip6, hf, array_length(hf));
diff --git a/epan/dissectors/packet-mp2t.c b/epan/dissectors/packet-mp2t.c
index c457e9e5e2..599ef0ed57 100644
--- a/epan/dissectors/packet-mp2t.c
+++ b/epan/dissectors/packet-mp2t.c
@@ -1199,8 +1199,8 @@ dissect_tsp(tvbuff_t *tvb, gint offset, packet_info *pinfo,
}
-static void
-dissect_mp2t( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
+static int
+dissect_mp2t( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ )
{
guint offset = 0;
conversation_t *conv;
@@ -1210,7 +1210,7 @@ dissect_mp2t( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
for (; tvb_reported_length_remaining(tvb, offset) >= MP2T_PACKET_SIZE; offset += MP2T_PACKET_SIZE) {
dissect_tsp(tvb, offset, pinfo, tree, conv);
}
-
+ return tvb_captured_length(tvb);
}
static gboolean
@@ -1237,7 +1237,7 @@ heur_dissect_mp2t( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
}
}
- dissect_mp2t(tvb, pinfo, tree);
+ dissect_mp2t(tvb, pinfo, tree, data);
return TRUE;
}
@@ -1524,7 +1524,7 @@ proto_register_mp2t(void)
proto_mp2t = proto_register_protocol("ISO/IEC 13818-1", "MP2T", "mp2t");
- mp2t_handle = register_dissector("mp2t", dissect_mp2t, proto_mp2t);
+ mp2t_handle = new_register_dissector("mp2t", dissect_mp2t, proto_mp2t);
proto_register_field_array(proto_mp2t, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
diff --git a/epan/dissectors/packet-mstp.c b/epan/dissectors/packet-mstp.c
index 897358d6fe..c0c65cd8f1 100644
--- a/epan/dissectors/packet-mstp.c
+++ b/epan/dissectors/packet-mstp.c
@@ -341,8 +341,8 @@ dissect_mstp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
}
-static void
-dissect_mstp_wtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_mstp_wtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *ti;
proto_tree *subtree;
@@ -376,6 +376,7 @@ dissect_mstp_wtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(subtree, hf_mstp_preamble_FF, tvb,
offset+1, 1, ENC_LITTLE_ENDIAN);
dissect_mstp(tvb, pinfo, tree, subtree, offset+2);
+ return tvb_captured_length(tvb);
}
void
@@ -459,7 +460,7 @@ proto_register_mstp(void)
expert_mstp = expert_register_protocol(proto_mstp);
expert_register_field_array(expert_mstp, ei, array_length(ei));
- register_dissector("mstp", dissect_mstp_wtap, proto_mstp);
+ new_register_dissector("mstp", dissect_mstp_wtap, proto_mstp);
subdissector_table = register_dissector_table("mstp.vendor_frame_type",
"MSTP Vendor specific Frametypes", FT_UINT24, BASE_DEC, DISSECTOR_TABLE_NOT_ALLOW_DUPLICATE);
diff --git a/epan/dissectors/packet-mtp2.c b/epan/dissectors/packet-mtp2.c
index c884ac5ab6..d7175ce026 100644
--- a/epan/dissectors/packet-mtp2.c
+++ b/epan/dissectors/packet-mtp2.c
@@ -361,17 +361,19 @@ dissect_mtp2_with_phdr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
/* Dissect MTP2 frame with CRC16 included at end of payload */
-static void
-dissect_mtp2_with_crc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_mtp2_with_crc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
dissect_mtp2_common(tvb, pinfo, tree, TRUE, use_extended_sequence_numbers_default);
+ return tvb_captured_length(tvb);
}
/* Dissect MTP2 frame without CRC16 included at end of payload */
-static void
-dissect_mtp2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_mtp2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
dissect_mtp2_common(tvb, pinfo, tree, FALSE, use_extended_sequence_numbers_default);
+ return tvb_captured_length(tvb);
}
void
@@ -409,8 +411,8 @@ proto_register_mtp2(void)
expert_module_t* expert_mtp2;
proto_mtp2 = proto_register_protocol("Message Transfer Part Level 2", "MTP2", "mtp2");
- mtp2_handle = register_dissector("mtp2", dissect_mtp2, proto_mtp2);
- register_dissector("mtp2_with_crc", dissect_mtp2_with_crc, proto_mtp2);
+ mtp2_handle = new_register_dissector("mtp2", dissect_mtp2, proto_mtp2);
+ new_register_dissector("mtp2_with_crc", dissect_mtp2_with_crc, proto_mtp2);
proto_register_field_array(proto_mtp2, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
diff --git a/epan/dissectors/packet-mtp3.c b/epan/dissectors/packet-mtp3.c
index 0219eee957..5a620a9121 100644
--- a/epan/dissectors/packet-mtp3.c
+++ b/epan/dissectors/packet-mtp3.c
@@ -689,8 +689,8 @@ reset_mtp3_standard(void)
}
/* Code to actually dissect the packets */
-static void
-dissect_mtp3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_mtp3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
mtp3_tap_rec_t* tap_rec = wmem_new0(wmem_packet_scope(), mtp3_tap_rec_t);
gint heuristic_standard;
@@ -767,6 +767,7 @@ dissect_mtp3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dissect_mtp3_payload(tvb, pinfo, tree);
mtp3_standard = pref_mtp3_standard;
+ return tvb_captured_length(tvb);
}
/* TAP STAT INFO */
@@ -1048,7 +1049,7 @@ proto_register_mtp3(void)
/* Register the protocol name and description */
proto_mtp3 = proto_register_protocol("Message Transfer Part Level 3",
"MTP3", "mtp3");
- mtp3_handle = register_dissector("mtp3", dissect_mtp3, proto_mtp3);
+ mtp3_handle = new_register_dissector("mtp3", dissect_mtp3, proto_mtp3);
/* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_mtp3, hf, array_length(hf));
diff --git a/epan/dissectors/packet-mtp3mg.c b/epan/dissectors/packet-mtp3mg.c
index 9eac6f46dd..14d77348ab 100644
--- a/epan/dissectors/packet-mtp3mg.c
+++ b/epan/dissectors/packet-mtp3mg.c
@@ -966,8 +966,8 @@ dissect_mtp3mg_test(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
}
-static void
-dissect_mtp3mg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_mtp3mg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint8 h0, h1;
@@ -1162,6 +1162,7 @@ dissect_mtp3mg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
} /* switch */
} /* else */
+ return tvb_captured_length(tvb);
}
void
@@ -1398,7 +1399,7 @@ proto_register_mtp3mg(void)
/* Register the protocol name and description */
proto_mtp3mg = proto_register_protocol("Message Transfer Part Level 3 Management",
"MTP3MG", "mtp3mg");
- register_dissector("mtp3mg", dissect_mtp3mg, proto_mtp3mg);
+ new_register_dissector("mtp3mg", dissect_mtp3mg, proto_mtp3mg);
/* Required calls to register the header fields and subtrees used */
proto_register_field_array(proto_mtp3mg, hf, array_length(hf));
diff --git a/epan/dissectors/packet-mux27010.c b/epan/dissectors/packet-mux27010.c
index dc4850e5e4..47d3afe642 100644
--- a/epan/dissectors/packet-mux27010.c
+++ b/epan/dissectors/packet-mux27010.c
@@ -758,8 +758,8 @@ getFrameInformation(tvbuff_t *tvb, packet_info *pinfo, proto_tree *field_tree,
-static void
-dissect_mux27010(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_mux27010(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *ti, *tf, *tf_extended_header, *tf_addr, *tf_ctr;
proto_tree *mux27010_tree, *field_tree, *field_tree_extended_header, *field_tree_addr, *field_tree_ctr;
@@ -997,6 +997,7 @@ dissect_mux27010(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
expert_add_info(pinfo, tf, &ei_mux27010_checksum_incorrect);
}
/*~~~~~~~~/Checksum~~~~~~~~*/
+ return tvb_captured_length(tvb);
}
static void
@@ -1423,7 +1424,7 @@ proto_register_mux27010 (void)
proto_register_field_array (proto_mux27010, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
- mux27010_handle = register_dissector("mux27010", dissect_mux27010, proto_mux27010);
+ mux27010_handle = new_register_dissector("mux27010", dissect_mux27010, proto_mux27010);
expert_mux27010 = expert_register_protocol(proto_mux27010);
expert_register_field_array(expert_mux27010, ei, array_length(ei));
diff --git a/epan/dissectors/packet-nasdaq-itch.c b/epan/dissectors/packet-nasdaq-itch.c
index 99374e7e98..c8686f7c8c 100644
--- a/epan/dissectors/packet-nasdaq-itch.c
+++ b/epan/dissectors/packet-nasdaq-itch.c
@@ -264,8 +264,8 @@ executed(tvbuff_t *tvb, packet_info *pinfo, proto_tree *nasdaq_itch_tree, int of
}
/* ---------------------------- */
-static void
-dissect_nasdaq_itch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_nasdaq_itch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *ti;
proto_tree *nasdaq_itch_tree = NULL;
@@ -313,11 +313,11 @@ dissect_nasdaq_itch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
switch (nasdaq_itch_type) {
case 'T': /* seconds */
/*offset =*/ time_stamp (tvb, nasdaq_itch_tree, hf_nasdaq_itch_second, offset, 5);
- return;
+ return tvb_captured_length(tvb);
case 'M': /* milliseconds */
/*offset =*/ time_stamp (tvb, nasdaq_itch_tree, hf_nasdaq_itch_millisecond, offset, 3);
- return;
+ return tvb_captured_length(tvb);
}
}
@@ -432,6 +432,7 @@ dissect_nasdaq_itch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/*offset += 5-1;*/
break;
}
+ return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
@@ -586,7 +587,7 @@ proto_register_nasdaq_itch(void)
"Whether the Nasdaq ITCH dissector should decode Chi X extensions.",
&nasdaq_itch_chi_x);
- register_dissector("nasdaq-itch", dissect_nasdaq_itch, proto_nasdaq_itch);
+ new_register_dissector("nasdaq-itch", dissect_nasdaq_itch, proto_nasdaq_itch);
}
void
@@ -594,7 +595,7 @@ proto_reg_handoff_nasdaq_itch(void)
{
dissector_handle_t nasdaq_itch_handle;
- nasdaq_itch_handle = create_dissector_handle( dissect_nasdaq_itch, proto_nasdaq_itch );
+ nasdaq_itch_handle = new_create_dissector_handle( dissect_nasdaq_itch, proto_nasdaq_itch );
dissector_add_for_decode_as("moldudp64.payload", nasdaq_itch_handle );
}
diff --git a/epan/dissectors/packet-ndp.c b/epan/dissectors/packet-ndp.c
index 32dbd1af4a..27bb512a72 100644
--- a/epan/dissectors/packet-ndp.c
+++ b/epan/dissectors/packet-ndp.c
@@ -265,8 +265,8 @@ static int hf_ndp_number_of_links = -1;
static gint ett_ndp = -1;
-static void
-dissect_ndp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_ndp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
const char *hello_type;
proto_tree *ndp_tree = NULL;
@@ -319,7 +319,7 @@ dissect_ndp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
NDP_NUMBER_OF_LINKS, 1, ENC_BIG_ENDIAN);
}
-
+ return tvb_captured_length(tvb);
}
@@ -363,7 +363,7 @@ proto_register_ndp(void)
proto_register_field_array(proto_ndp, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
- register_dissector("ndp", dissect_ndp, proto_ndp);
+ new_register_dissector("ndp", dissect_ndp, proto_ndp);
}
void
diff --git a/epan/dissectors/packet-negoex.c b/epan/dissectors/packet-negoex.c
index 330f59781e..eb8d63cdf7 100644
--- a/epan/dissectors/packet-negoex.c
+++ b/epan/dissectors/packet-negoex.c
@@ -342,8 +342,8 @@ dissect_negoex_nego_message(tvbuff_t *tvb,
}
-static void
-dissect_negoex(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_negoex(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
volatile guint32 offset;
proto_tree * volatile negoex_tree;
@@ -501,6 +501,7 @@ dissect_negoex(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
} ENDTRY;
}
+ return tvb_captured_length(tvb);
}
void
@@ -617,7 +618,7 @@ proto_register_negoex(void)
/* negoex_module = prefs_register_protocol(proto_negoex, NULL);*/
- register_dissector("negoex", dissect_negoex, proto_negoex);
+ new_register_dissector("negoex", dissect_negoex, proto_negoex);
}
void
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));
diff --git a/epan/dissectors/packet-noe.c b/epan/dissectors/packet-noe.c
index 353db005ef..7c8a913cc8 100644
--- a/epan/dissectors/packet-noe.c
+++ b/epan/dissectors/packet-noe.c
@@ -1249,9 +1249,9 @@ static void decode_mtd(proto_tree *tree,
/*-----------------------------------------------------------------------------
NOE DISSECTOR
---------------------------------------------------------------------------*/
-static void dissect_noe(tvbuff_t *tvb,
+static int dissect_noe(tvbuff_t *tvb,
packet_info *pinfo,
- proto_tree *tree)
+ proto_tree *tree, void* data _U_)
{
proto_item *noe_item;
proto_tree *noe_tree;
@@ -1308,7 +1308,7 @@ static void dissect_noe(tvbuff_t *tvb,
method);
if (method >= METHOD_INVALID)
- return;
+ return offset;
/* add text to the frame "INFO" column */
col_append_fstr(pinfo->cinfo, COL_INFO, ": %s",
@@ -1337,6 +1337,7 @@ static void dissect_noe(tvbuff_t *tvb,
length -= 1;
decode_mtd(noe_tree, tvb, pinfo, method, offset, length);
}
+ return tvb_captured_length(tvb);
}
@@ -1651,7 +1652,7 @@ void proto_register_noe(void)
proto_register_field_array(proto_noe, hf_noe, array_length(hf_noe));
- register_dissector("noe", dissect_noe, proto_noe);
+ new_register_dissector("noe", dissect_noe, proto_noe);
/* Common subtree array registration */
proto_register_subtree_array(ett, array_length(ett));
diff --git a/epan/dissectors/packet-nsip.c b/epan/dissectors/packet-nsip.c
index acce333471..d85ad77a91 100644
--- a/epan/dissectors/packet-nsip.c
+++ b/epan/dissectors/packet-nsip.c
@@ -919,8 +919,8 @@ decode_pdu(guint8 pdu_type, build_info_t *bi) {
}
}
-static void
-dissect_nsip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
+static int
+dissect_nsip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) {
guint8 pdu_type;
build_info_t bi = { NULL, 0, NULL, NULL, NULL, NULL };
proto_tree *nsip_tree;
@@ -957,6 +957,7 @@ dissect_nsip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
val_to_str_const(pdu_type, tab_nsip_pdu_types, "Unknown PDU type"));
}
decode_pdu(pdu_type, &bi);
+ return tvb_captured_length(tvb);
}
void
@@ -1149,7 +1150,7 @@ proto_register_nsip(void)
proto_register_field_array(proto_nsip, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
- register_dissector("gprs_ns", dissect_nsip, proto_nsip);
+ new_register_dissector("gprs_ns", dissect_nsip, proto_nsip);
/* Set default UDP ports */
range_convert_str(&global_nsip_udp_port_range, DEFAULT_NSIP_PORT_RANGE, MAX_UDP_PORT);
diff --git a/epan/dissectors/packet-ntlmssp.c b/epan/dissectors/packet-ntlmssp.c
index 29d4c74027..9199d9274c 100644
--- a/epan/dissectors/packet-ntlmssp.c
+++ b/epan/dissectors/packet-ntlmssp.c
@@ -2083,8 +2083,8 @@ decrypt_data_payload(tvbuff_t *tvb, int offset, guint32 encrypted_block_length,
pinfo->gssapi_decrypted_tvb = decr_tvb;
}
-static void
-dissect_ntlmssp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_ntlmssp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
volatile int offset = 0;
proto_tree *volatile ntlmssp_tree = NULL;
@@ -2160,13 +2160,14 @@ dissect_ntlmssp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
} ENDTRY;
tap_queue_packet(ntlmssp_tap, pinfo, ntlmssph);
+ return tvb_captured_length(tvb);
}
static gboolean
dissect_ntlmssp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *data _U_)
{
if (tvb_memeql(tvb, 0, "NTLMSSP", 8) == 0) {
- dissect_ntlmssp(tvb, pinfo, parent_tree);
+ dissect_ntlmssp(tvb, pinfo, parent_tree, data);
return TRUE;
}
@@ -2612,7 +2613,7 @@ wrap_dissect_ntlmssp(tvbuff_t *tvb, int offset, packet_info *pinfo,
auth_tvb = tvb_new_subset_remaining(tvb, offset);
- dissect_ntlmssp(auth_tvb, pinfo, tree);
+ dissect_ntlmssp(auth_tvb, pinfo, tree, NULL);
return tvb_captured_length_remaining(tvb, offset);
}
@@ -3274,7 +3275,7 @@ proto_register_ntlmssp(void)
"NT Password (used to decrypt payloads)",
&gbl_nt_password);
- register_dissector("ntlmssp", dissect_ntlmssp, proto_ntlmssp);
+ new_register_dissector("ntlmssp", dissect_ntlmssp, proto_ntlmssp);
new_register_dissector("ntlmssp_payload", dissect_ntlmssp_payload, proto_ntlmssp);
new_register_dissector("ntlmssp_data_only", dissect_ntlmssp_payload_only, proto_ntlmssp);
new_register_dissector("ntlmssp_verf", dissect_ntlmssp_verf, proto_ntlmssp);