aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--epan/dissectors/packet-nas_eps.c32
-rw-r--r--epan/dissectors/packet-pdcp-lte.c25
-rw-r--r--epan/dissectors/packet-pop.c9
-rw-r--r--epan/dissectors/packet-rlc.c73
-rw-r--r--epan/dissectors/packet-sndcp.c9
-rw-r--r--epan/dissectors/packet-ssh.c10
-rw-r--r--epan/dissectors/packet-tcp.c11
-rw-r--r--epan/dissectors/packet-tftp.c9
-rw-r--r--epan/dissectors/packet-tn3270.c11
-rw-r--r--epan/dissectors/packet-tn5250.c13
-rw-r--r--epan/dissectors/packet-uasip.c9
-rw-r--r--epan/dissectors/packet-uaudp.c13
-rw-r--r--epan/dissectors/packet-umts_fp.c17
-rw-r--r--epan/dissectors/packet-umts_mac.c45
-rw-r--r--epan/dissectors/packet-user_encap.c9
-rw-r--r--epan/dissectors/packet-v120.c58
-rw-r--r--epan/dissectors/packet-zep.c14
-rw-r--r--plugins/mate/packet-mate.c11
-rw-r--r--plugins/wimax/mac_hd_generic_decoder.c9
-rw-r--r--plugins/wimax/mac_hd_type1_decoder.c9
-rw-r--r--plugins/wimax/mac_hd_type2_decoder.c10
-rw-r--r--plugins/wimax/mac_mgmt_msg_decoder.c9
-rw-r--r--plugins/wimax/wimax_harq_map_decoder.c9
23 files changed, 226 insertions, 198 deletions
diff --git a/epan/dissectors/packet-nas_eps.c b/epan/dissectors/packet-nas_eps.c
index 21730d8fed..ee1999b31e 100644
--- a/epan/dissectors/packet-nas_eps.c
+++ b/epan/dissectors/packet-nas_eps.c
@@ -4849,8 +4849,8 @@ dissect_nas_eps_emm_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
}
-static void
-dissect_nas_eps_plain(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_nas_eps_plain(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *item;
proto_tree *nas_eps_tree;
@@ -4873,7 +4873,7 @@ dissect_nas_eps_plain(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(nas_eps_tree, hf_gsm_a_L3_protocol_discriminator, tvb, 0, 1, ENC_BIG_ENDIAN);
offset++;
nas_emm_service_req(tvb, nas_eps_tree, pinfo, offset, tvb_reported_length(tvb)-offset);
- return;
+ return tvb_captured_length(tvb);
}
pd &= 0x0f;
@@ -4905,6 +4905,7 @@ dissect_nas_eps_plain(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
break;
}
+ return tvb_captured_length(tvb);
}
/* TS 24.301 8.2.1
@@ -4938,8 +4939,8 @@ dissect_nas_eps_plain(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* 4.4.4.2 All ESM messages are integrity protected.
*/
-static void
-dissect_nas_eps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_nas_eps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *item;
proto_tree *nas_eps_tree;
@@ -4952,13 +4953,13 @@ dissect_nas_eps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* The protected NAS message header is 6 octets long, and the NAS message header is at least 2 octets long. */
/* If the length of the tvbuffer is less than 8 octets, we can safely conclude the message is not protected. */
if (len < 8) {
- dissect_nas_eps_plain(tvb, pinfo, tree);
- return;
+ dissect_nas_eps_plain(tvb, pinfo, tree, data);
+ return tvb_captured_length(tvb);
}
if (g_nas_eps_dissect_plain) {
- dissect_nas_eps_plain(tvb, pinfo, tree);
- return;
+ dissect_nas_eps_plain(tvb, pinfo, tree, data);
+ return tvb_captured_length(tvb);
}
/* make entry in the Protocol column on summary display */
@@ -4979,17 +4980,17 @@ dissect_nas_eps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (pd == 7) {
/* Plain EPS mobility management messages. */
dissect_nas_eps_emm_msg(tvb, pinfo, nas_eps_tree, offset, FALSE);
- return;
+ return tvb_captured_length(tvb);
} else {
proto_tree_add_expert(nas_eps_tree, pinfo, &ei_nas_eps_esm_tp_not_integ_prot, tvb, offset, len);
- return;
+ return tvb_captured_length(tvb);
}
} else {
/* SERVICE REQUEST (12 or greater) is not a plain NAS message treat separately */
if (security_header_type >= 12) {
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Service request");
nas_emm_service_req(tvb, nas_eps_tree, pinfo, offset, len-offset);
- return;
+ return tvb_captured_length(tvb);
}
/* Message authentication code */
proto_tree_add_item(nas_eps_tree, hf_nas_eps_msg_auth_code, tvb, offset, 4, ENC_BIG_ENDIAN);
@@ -5008,7 +5009,7 @@ dissect_nas_eps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if ((pd != 7) && (pd != 15) &&
(((pd&0x0f) != 2) || (((pd&0x0f) == 2) && ((pd&0xf0) > 0) && ((pd&0xf0) < 0x50)))) {
proto_tree_add_item(nas_eps_tree, hf_nas_eps_ciphered_msg, tvb, offset, len-6, ENC_NA);
- return;
+ return tvb_captured_length(tvb);
}
} else {
/* msg_auth_code == 0, probably not ciphered */
@@ -5053,6 +5054,7 @@ dissect_nas_eps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
break;
}
+ return tvb_captured_length(tvb);
}
void
@@ -5917,10 +5919,10 @@ proto_register_nas_eps(void)
expert_register_field_array(expert_nas_eps, ei, array_length(ei));
/* Register dissector */
- register_dissector(PFNAME, dissect_nas_eps, proto_nas_eps);
+ new_register_dissector(PFNAME, dissect_nas_eps, proto_nas_eps);
/* Register dissector */
- register_dissector("nas-eps_plain", dissect_nas_eps_plain, proto_nas_eps);
+ new_register_dissector("nas-eps_plain", dissect_nas_eps_plain, proto_nas_eps);
/* Register configuration options to always dissect as plain messages */
nas_eps_module = prefs_register_protocol(proto_nas_eps, NULL);
diff --git a/epan/dissectors/packet-pdcp-lte.c b/epan/dissectors/packet-pdcp-lte.c
index a6314dde5f..158b3481d9 100644
--- a/epan/dissectors/packet-pdcp-lte.c
+++ b/epan/dissectors/packet-pdcp-lte.c
@@ -1227,7 +1227,7 @@ static dissector_handle_t lookup_rrc_dissector_handle(struct pdcp_lte_info *p_p
/* Forwad declarations */
-static void dissect_pdcp_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
+static int dissect_pdcp_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data);
/* Heuristic dissector looks for supported framing protocol (see wiki page) */
static gboolean dissect_pdcp_lte_heur(tvbuff_t *tvb, packet_info *pinfo,
@@ -1362,7 +1362,7 @@ static gboolean dissect_pdcp_lte_heur(tvbuff_t *tvb, packet_info *pinfo,
/* Create tvb that starts at actual PDCP PDU */
pdcp_tvb = tvb_new_subset_remaining(tvb, offset);
- dissect_pdcp_lte(pdcp_tvb, pinfo, tree);
+ dissect_pdcp_lte(pdcp_tvb, pinfo, tree, data);
return TRUE;
}
@@ -1684,7 +1684,7 @@ static guint32 calculate_digest(pdu_security_settings_t *pdu_security_settings,
/******************************/
/* Main dissection function. */
-static void dissect_pdcp_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int dissect_pdcp_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
const char *mode;
proto_tree *pdcp_tree = NULL;
@@ -1711,7 +1711,7 @@ static void dissect_pdcp_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
p_pdcp_info = (struct pdcp_lte_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_pdcp_lte, 0);
/* Can't dissect anything without it... */
if (p_pdcp_info == NULL) {
- return;
+ return 0;
}
/* Don't want to overwrite the RLC Info column if configured not to */
@@ -1845,7 +1845,7 @@ static void dissect_pdcp_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
if (tvb_captured_length_remaining(tvb, offset) == 0) {
/* Only PDCP header was captured, stop dissection here */
- return;
+ return offset;
}
}
else if (p_pdcp_info->plane == USER_PLANE) {
@@ -1900,7 +1900,7 @@ static void dissect_pdcp_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
break;
default:
/* Not a recognised data format!!!!! */
- return;
+ return 1;
}
write_pdu_label_and_info(root_ti, pinfo, " (SN=%u)", seqnum);
@@ -1989,14 +1989,14 @@ static void dissect_pdcp_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
write_pdu_label_and_info(root_ti, pinfo, " Status Report (fms=%u) not-received=%u",
fms, not_received);
}
- return;
+ return 1;
case 1: /* ROHC Feedback */
offset++;
break; /* Drop-through to dissect feedback */
default: /* Reserved */
- return;
+ return 1;
}
}
}
@@ -2004,7 +2004,7 @@ static void dissect_pdcp_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
/* Invalid plane setting...! */
write_pdu_label_and_info(root_ti, pinfo, " - INVALID PLANE (%u)",
p_pdcp_info->plane);
- return;
+ return 1;
}
/* Do sequence analysis if configured to. */
@@ -2185,7 +2185,7 @@ static void dissect_pdcp_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
col_set_writable(pinfo->cinfo, global_pdcp_lte_layer_to_show == ShowRLCLayer);
/* DROPPING OUT HERE IF NOT DOING ROHC! */
- return;
+ return tvb_captured_length(tvb);
}
else {
/***************************/
@@ -2196,7 +2196,7 @@ static void dissect_pdcp_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
if (!global_pdcp_dissect_rohc) {
col_append_fstr(pinfo->cinfo, COL_PROTOCOL, "|ROHC(%s)",
val_to_str_const(p_pdcp_info->rohc.profile, rohc_profile_vals, "Unknown"));
- return;
+ return 1;
}
rohc_tvb = tvb_new_subset_remaining(payload_tvb, offset);
@@ -2216,6 +2216,7 @@ static void dissect_pdcp_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
col_set_writable(pinfo->cinfo, global_pdcp_lte_layer_to_show == ShowRLCLayer);
}
}
+ return tvb_captured_length(tvb);
}
/* Initializes the hash tables each time a new
@@ -2601,7 +2602,7 @@ void proto_register_pdcp(void)
expert_register_field_array(expert_pdcp_lte, ei, array_length(ei));
/* Allow other dissectors to find this one by name. */
- register_dissector("pdcp-lte", dissect_pdcp_lte, proto_pdcp_lte);
+ new_register_dissector("pdcp-lte", dissect_pdcp_lte, proto_pdcp_lte);
pdcp_lte_module = prefs_register_protocol(proto_pdcp_lte, NULL);
diff --git a/epan/dissectors/packet-pop.c b/epan/dissectors/packet-pop.c
index 2d7bbbd028..f8a7948894 100644
--- a/epan/dissectors/packet-pop.c
+++ b/epan/dissectors/packet-pop.c
@@ -121,8 +121,8 @@ struct pop_data_val {
static gboolean response_is_continuation(const guchar *data);
-static void
-dissect_pop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_pop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
struct pop_proto_data *frame_data_p;
gboolean is_request;
@@ -245,7 +245,7 @@ dissect_pop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
call_dissector(data_handle,tvb, pinfo, pop_tree);
}
- return;
+ return tvb_captured_length(tvb);
}
/*
@@ -349,6 +349,7 @@ dissect_pop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset = next_offset;
}
}
+ return tvb_captured_length(tvb);
}
static gboolean response_is_continuation(const guchar *data)
@@ -447,7 +448,7 @@ proto_register_pop(void)
proto_pop = proto_register_protocol("Post Office Protocol", "POP", "pop");
- register_dissector("pop", dissect_pop, proto_pop);
+ new_register_dissector("pop", dissect_pop, proto_pop);
proto_register_field_array(proto_pop, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
register_init_routine (&pop_data_reassemble_init);
diff --git a/epan/dissectors/packet-rlc.c b/epan/dissectors/packet-rlc.c
index 0e71fb2cce..e00d2cd741 100644
--- a/epan/dissectors/packet-rlc.c
+++ b/epan/dissectors/packet-rlc.c
@@ -2337,8 +2337,8 @@ dissect_rlc_am(enum rlc_channel_type channel, tvbuff_t *tvb, packet_info *pinfo,
}
/* dissect entry functions */
-static void
-dissect_rlc_pcch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_rlc_pcch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *subtree = NULL;
@@ -2353,10 +2353,11 @@ dissect_rlc_pcch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_item_append_text(ti, " TM (PCCH)");
}
dissect_rlc_tm(RLC_PCCH, tvb, pinfo, tree, subtree);
+ return tvb_captured_length(tvb);
}
-static void
-dissect_rlc_bcch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_rlc_bcch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
fp_info *fpi;
proto_item *ti = NULL;
@@ -2366,7 +2367,7 @@ dissect_rlc_bcch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_clear(pinfo->cinfo, COL_INFO);
fpi = (fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0);
- if (!fpi) return; /* dissection failure */
+ if (!fpi) return 0; /* dissection failure */
if (tree) {
ti = proto_tree_add_item(tree, proto_rlc, tvb, 0, -1, ENC_NA);
@@ -2374,10 +2375,11 @@ dissect_rlc_bcch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
proto_item_append_text(ti, " TM (BCCH)");
dissect_rlc_tm(RLC_BCCH, tvb, pinfo, tree, subtree);
+ return tvb_captured_length(tvb);
}
-static void
-dissect_rlc_ccch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_rlc_ccch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
fp_info *fpi;
proto_item *ti = NULL;
@@ -2387,7 +2389,7 @@ dissect_rlc_ccch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_clear(pinfo->cinfo, COL_INFO);
fpi = (fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0);
- if (!fpi) return; /* dissection failure */
+ if (!fpi) return 0; /* dissection failure */
if (tree) {
ti = proto_tree_add_item(tree, proto_rlc, tvb, 0, -1, ENC_NA);
@@ -2403,10 +2405,11 @@ dissect_rlc_ccch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_item_append_text(ti, " UM (CCCH)");
dissect_rlc_um(RLC_DL_CCCH, tvb, pinfo, tree, subtree);
}
+ return tvb_captured_length(tvb);
}
-static void
-dissect_rlc_ctch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_rlc_ctch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void * data _U_)
{
fp_info *fpi;
proto_item *ti = NULL;
@@ -2417,7 +2420,7 @@ dissect_rlc_ctch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_clear(pinfo->cinfo, COL_INFO);
fpi = (fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0);
- if (!fpi) return; /* dissection failure */
+ if (!fpi) return 0; /* dissection failure */
if (tree) {
ti = proto_tree_add_item(tree, proto_rlc, tvb, 0, -1, ENC_NA);
@@ -2427,10 +2430,11 @@ dissect_rlc_ctch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* CTCH is always UM */
proto_item_append_text(ti, " UM (CTCH)");
dissect_rlc_um(RLC_DL_CTCH, tvb, pinfo, tree, subtree);
+ return tvb_captured_length(tvb);
}
-static void
-dissect_rlc_dcch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_rlc_dcch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *ti = NULL;
proto_tree *subtree = NULL;
@@ -2446,7 +2450,7 @@ dissect_rlc_dcch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (!fpi || !rlci){
proto_tree_add_expert(tree, pinfo, &ei_rlc_no_per_frame_data, tvb, 0, -1);
- return;
+ return 1;
}
if (tree) {
@@ -2466,10 +2470,11 @@ dissect_rlc_dcch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dissect_rlc_am(channel, tvb, pinfo, tree, subtree);
break;
}
+ return tvb_captured_length(tvb);
}
-static void
-dissect_rlc_ps_dtch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_rlc_ps_dtch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *ti = NULL;
proto_tree *subtree = NULL;
@@ -2484,7 +2489,7 @@ dissect_rlc_ps_dtch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (!fpi || !rlci) {
proto_tree_add_expert(tree, pinfo, &ei_rlc_no_per_frame_data, tvb, 0, -1);
- return;
+ return 1;
}
if (tree) {
@@ -2506,10 +2511,11 @@ dissect_rlc_ps_dtch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dissect_rlc_tm(RLC_PS_DTCH, tvb, pinfo, tree, subtree);
break;
}
+ return tvb_captured_length(tvb);
}
-static void
-dissect_rlc_dch_unknown(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_rlc_dch_unknown(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *ti = NULL;
proto_tree *subtree = NULL;
@@ -2522,7 +2528,7 @@ dissect_rlc_dch_unknown(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
fpi = (fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0);
rlci = (rlc_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_rlc, 0);
- if (!fpi || !rlci) return;
+ if (!fpi || !rlci) return 0;
if (tree) {
ti = proto_tree_add_item(tree, proto_rlc, tvb, 0, -1, ENC_NA);
@@ -2543,6 +2549,7 @@ dissect_rlc_dch_unknown(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dissect_rlc_tm(RLC_UNKNOWN_CH, tvb, pinfo, tree, subtree);
break;
}
+ return tvb_captured_length(tvb);
}
@@ -2683,22 +2690,22 @@ dissect_rlc_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
}
break;
case UMTS_CHANNEL_TYPE_PCCH:
- dissect_rlc_pcch(rlc_tvb, pinfo, tree);
+ dissect_rlc_pcch(rlc_tvb, pinfo, tree, data);
break;
case UMTS_CHANNEL_TYPE_CCCH:
- dissect_rlc_ccch(rlc_tvb, pinfo, tree);
+ dissect_rlc_ccch(rlc_tvb, pinfo, tree, data);
break;
case UMTS_CHANNEL_TYPE_DCCH:
- dissect_rlc_dcch(rlc_tvb, pinfo, tree);
+ dissect_rlc_dcch(rlc_tvb, pinfo, tree, data);
break;
case UMTS_CHANNEL_TYPE_PS_DTCH:
- dissect_rlc_ps_dtch(rlc_tvb, pinfo, tree);
+ dissect_rlc_ps_dtch(rlc_tvb, pinfo, tree, data);
break;
case UMTS_CHANNEL_TYPE_CTCH:
- dissect_rlc_ctch(rlc_tvb, pinfo, tree);
+ dissect_rlc_ctch(rlc_tvb, pinfo, tree, data);
break;
case UMTS_CHANNEL_TYPE_BCCH:
- dissect_rlc_bcch(rlc_tvb, pinfo, tree);
+ dissect_rlc_bcch(rlc_tvb, pinfo, tree, data);
break;
default:
/* Unknown channel type */
@@ -2932,13 +2939,13 @@ proto_register_rlc(void)
};
proto_rlc = proto_register_protocol("Radio Link Control", "RLC", "rlc");
- register_dissector("rlc.bcch", dissect_rlc_bcch, proto_rlc);
- register_dissector("rlc.pcch", dissect_rlc_pcch, proto_rlc);
- register_dissector("rlc.ccch", dissect_rlc_ccch, proto_rlc);
- register_dissector("rlc.ctch", dissect_rlc_ctch, proto_rlc);
- register_dissector("rlc.dcch", dissect_rlc_dcch, proto_rlc);
- register_dissector("rlc.ps_dtch", dissect_rlc_ps_dtch, proto_rlc);
- register_dissector("rlc.dch_unknown", dissect_rlc_dch_unknown, proto_rlc);
+ new_register_dissector("rlc.bcch", dissect_rlc_bcch, proto_rlc);
+ new_register_dissector("rlc.pcch", dissect_rlc_pcch, proto_rlc);
+ new_register_dissector("rlc.ccch", dissect_rlc_ccch, proto_rlc);
+ new_register_dissector("rlc.ctch", dissect_rlc_ctch, proto_rlc);
+ new_register_dissector("rlc.dcch", dissect_rlc_dcch, proto_rlc);
+ new_register_dissector("rlc.ps_dtch", dissect_rlc_ps_dtch, proto_rlc);
+ new_register_dissector("rlc.dch_unknown", dissect_rlc_dch_unknown, proto_rlc);
proto_register_field_array(proto_rlc, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
diff --git a/epan/dissectors/packet-sndcp.c b/epan/dissectors/packet-sndcp.c
index a3fb567098..657cae264d 100644
--- a/epan/dissectors/packet-sndcp.c
+++ b/epan/dissectors/packet-sndcp.c
@@ -196,8 +196,8 @@ static const true_false_string m_bit = {
/* Code to actually dissect the packets
*/
-static void
-dissect_sndcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_sndcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint8 addr_field, comp_field, npdu_field1, dcomp=0, pcomp=0;
guint16 offset=0, npdu=0, segment=0, npdu_field2;
@@ -322,7 +322,7 @@ dissect_sndcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
len = tvb_captured_length_remaining(tvb, offset);
if(len<=0){
- return;
+ return offset;
}
pinfo->fragmented = TRUE;
@@ -369,6 +369,7 @@ dissect_sndcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
*/
pinfo->fragmented = save_fragmented;
}
+ return tvb_captured_length(tvb);
}
@@ -559,7 +560,7 @@ proto_register_sndcp(void)
/* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_sndcp, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
- register_dissector("sndcp", dissect_sndcp, proto_sndcp);
+ new_register_dissector("sndcp", dissect_sndcp, proto_sndcp);
register_init_routine(sndcp_defragment_init);
register_cleanup_routine(sndcp_defragment_cleanup);
}
diff --git a/epan/dissectors/packet-ssh.c b/epan/dissectors/packet-ssh.c
index 6922f2c109..b5041f750e 100644
--- a/epan/dissectors/packet-ssh.c
+++ b/epan/dissectors/packet-ssh.c
@@ -319,10 +319,9 @@ static void ssh_set_mac_length(struct ssh_peer_data *peer_data);
static void ssh_set_kex_specific_dissector(struct ssh_flow_data *global_data);
-static void
-dissect_ssh(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_ssh(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
-
proto_tree *ssh_tree;
proto_item *ti;
conversation_t *conversation;
@@ -418,7 +417,7 @@ dissect_ssh(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (need_desegmentation)
- return;
+ return tvb_captured_length(tvb);
if (offset <= last_offset) {
/* XXX - add an expert info in the function
that decrements offset */
@@ -427,6 +426,7 @@ dissect_ssh(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
col_prepend_fstr(pinfo->cinfo, COL_INFO, "%s: ", is_response ? "Server" : "Client");
+ return tvb_captured_length(tvb);
}
static int
@@ -1391,7 +1391,7 @@ proto_register_ssh(void)
"To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
&ssh_desegment);
- ssh_handle = register_dissector("ssh", dissect_ssh, proto_ssh);
+ ssh_handle = new_register_dissector("ssh", dissect_ssh, proto_ssh);
}
void
diff --git a/epan/dissectors/packet-tcp.c b/epan/dissectors/packet-tcp.c
index 7cc37e294b..fec885b3b2 100644
--- a/epan/dissectors/packet-tcp.c
+++ b/epan/dissectors/packet-tcp.c
@@ -4797,8 +4797,8 @@ tcp_flags_to_str_first_letter(const struct tcpheader *tcph)
return buf;
}
-static void
-dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint8 th_off_x2; /* combines th_off and th_x2 */
guint16 th_sum;
@@ -5040,7 +5040,7 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
"%u bytes (bogus, must be at least %u)", tcph->th_hlen,
TCPH_MIN_LEN);
}
- return;
+ return offset+12;
}
if (tree) {
@@ -5509,7 +5509,7 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
process_tcp_payload(next_tvb, 0, pinfo, tree, tcp_tree, tcph->th_sport, tcph->th_dport, tcph->th_seq,
nxtseq, FALSE, tcpd, &tcpinfo);
- return;
+ return tvb_captured_length(tvb);
}
}
} else {
@@ -5576,6 +5576,7 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tcph->th_sport, tcph->th_dport, tree, tcp_tree, tcpd, &tcpinfo);
}
}
+ return tvb_captured_length(tvb);
}
static void
@@ -6514,7 +6515,7 @@ proto_register_tcp(void)
expert_module_t* expert_mptcp;
proto_tcp = proto_register_protocol("Transmission Control Protocol", "TCP", "tcp");
- register_dissector("tcp", dissect_tcp, proto_tcp);
+ new_register_dissector("tcp", dissect_tcp, proto_tcp);
proto_register_field_array(proto_tcp, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
expert_tcp = expert_register_protocol(proto_tcp);
diff --git a/epan/dissectors/packet-tftp.c b/epan/dissectors/packet-tftp.c
index cd91bbdecf..96f39bd758 100644
--- a/epan/dissectors/packet-tftp.c
+++ b/epan/dissectors/packet-tftp.c
@@ -539,8 +539,8 @@ dissect_embeddedtftp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v
return TRUE;
}
-static void
-dissect_tftp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_tftp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
conversation_t *conversation = NULL;
tftp_conv_info_t *tftp_info;
@@ -584,7 +584,7 @@ dissect_tftp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (pinfo->destport == conversation->key_ptr->port1)
conversation_set_port2(conversation, pinfo->srcport);
else
- return;
+ return 0;
}
}
tftp_info = (tftp_conv_info_t *)conversation_get_proto_data(conversation, proto_tftp);
@@ -602,6 +602,7 @@ dissect_tftp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
dissect_tftp_message(tftp_info, tvb, pinfo, tree);
+ return tvb_captured_length(tvb);
}
@@ -678,7 +679,7 @@ proto_register_tftp(void)
expert_tftp = expert_register_protocol(proto_tftp);
expert_register_field_array(expert_tftp, ei, array_length(ei));
- register_dissector("tftp", dissect_tftp, proto_tftp);
+ new_register_dissector("tftp", dissect_tftp, proto_tftp);
/* Set default UDP ports */
range_convert_str(&global_tftp_port_range, UDP_PORT_TFTP_RANGE, MAX_UDP_PORT);
diff --git a/epan/dissectors/packet-tn3270.c b/epan/dissectors/packet-tn3270.c
index e7c879c9a5..b7fbabc150 100644
--- a/epan/dissectors/packet-tn3270.c
+++ b/epan/dissectors/packet-tn3270.c
@@ -5234,8 +5234,8 @@ dissect_inbound_stream(proto_tree *tn3270_tree, packet_info *pinfo, tvbuff_t *tv
}
-static void
-dissect_tn3270(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_tn3270(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *tn3270_tree;
proto_item *pi;
@@ -5257,7 +5257,7 @@ dissect_tn3270(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (tn3270_info == NULL)
- return;
+ return 0;
pi = proto_tree_add_item(tree, proto_tn3270, tvb, offset, -1, ENC_NA);
tn3270_tree = proto_item_add_subtree(pi, ett_tn3270);
@@ -5268,7 +5268,7 @@ dissect_tn3270(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (tvb_reported_length_remaining(tvb, offset) <= 0)
- return;
+ return offset;
if (pinfo->srcport == tn3270_info->outbound_port) {
col_set_str(pinfo->cinfo, COL_INFO, "TN3270 Data from Mainframe");
@@ -5288,6 +5288,7 @@ dissect_tn3270(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
+ return tvb_captured_length(tvb);
}
void
@@ -7665,7 +7666,7 @@ proto_register_tn3270(void)
expert_module_t* expert_tn3270;
proto_tn3270 = proto_register_protocol("TN3270 Protocol", "TN3270", "tn3270");
- register_dissector("tn3270", dissect_tn3270, proto_tn3270);
+ new_register_dissector("tn3270", dissect_tn3270, proto_tn3270);
proto_register_field_array(proto_tn3270, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
expert_tn3270 = expert_register_protocol(proto_tn3270);
diff --git a/epan/dissectors/packet-tn5250.c b/epan/dissectors/packet-tn5250.c
index db2e9db84b..fd06a13c64 100644
--- a/epan/dissectors/packet-tn5250.c
+++ b/epan/dissectors/packet-tn5250.c
@@ -5114,8 +5114,8 @@ dissect_inbound_stream(proto_tree *tn5250_tree, packet_info *pinfo, tvbuff_t *tv
return (offset - start);
}
-static void
-dissect_tn5250(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_tn5250(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *tn5250_tree;
proto_item *ti;
@@ -5124,8 +5124,6 @@ dissect_tn5250(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tn5250_conv_info_t *tn5250_info = NULL;
int sna_flag;
- pinfo->fd->flags.encoding = PACKET_CHAR_ENC_CHAR_EBCDIC;
-
/* Do we have a conversation for this connection? */
conversation = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst,
pinfo->ptype, pinfo->srcport,
@@ -5136,7 +5134,9 @@ dissect_tn5250(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (!tn5250_info)
- return;
+ return 0;
+
+ pinfo->fd->flags.encoding = PACKET_CHAR_ENC_CHAR_EBCDIC;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "TN5250");
@@ -5161,6 +5161,7 @@ dissect_tn5250(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
+ return tvb_captured_length(tvb);
}
void
@@ -7545,7 +7546,7 @@ proto_register_tn5250(void)
expert_module_t* expert_tn5250;
proto_tn5250 = proto_register_protocol("TN5250 Protocol", "TN5250", "tn5250");
- register_dissector("tn5250", dissect_tn5250, proto_tn5250);
+ new_register_dissector("tn5250", dissect_tn5250, proto_tn5250);
proto_register_field_array(proto_tn5250, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
expert_tn5250 = expert_register_protocol(proto_tn5250);
diff --git a/epan/dissectors/packet-uasip.c b/epan/dissectors/packet-uasip.c
index 514f282be9..44439757c0 100644
--- a/epan/dissectors/packet-uasip.c
+++ b/epan/dissectors/packet-uasip.c
@@ -257,22 +257,23 @@ static void _dissect_uasip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
#endif
}
-static void dissect_uasip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int dissect_uasip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
if (use_proxy_ipaddr)
{
if (memcmp((pinfo->src).data, proxy_ipaddr, sizeof(proxy_ipaddr)) == 0)
{
_dissect_uasip(tvb, pinfo, tree, SYS_TO_TERM);
- return;
+ return tvb_captured_length(tvb);
}
else if (memcmp((pinfo->dst).data, proxy_ipaddr, sizeof(proxy_ipaddr)) == 0)
{
_dissect_uasip(tvb, pinfo, tree, TERM_TO_SYS);
- return;
+ return tvb_captured_length(tvb);
}
}
_dissect_uasip(tvb, pinfo, tree, DIR_UNKNOWN);
+ return tvb_captured_length(tvb);
}
void proto_register_uasip(void)
@@ -444,7 +445,7 @@ void proto_register_uasip(void)
};
proto_uasip = proto_register_protocol("UA/SIP Protocol", "UASIP", "uasip");
- uasip_handle = register_dissector("uasip", dissect_uasip, proto_uasip);
+ uasip_handle = new_register_dissector("uasip", dissect_uasip, proto_uasip);
proto_register_field_array(proto_uasip, hf_uasip, array_length(hf_uasip));
proto_register_subtree_array(ett, array_length(ett));
diff --git a/epan/dissectors/packet-uaudp.c b/epan/dissectors/packet-uaudp.c
index f8475d6f77..fea7a9235d 100644
--- a/epan/dissectors/packet-uaudp.c
+++ b/epan/dissectors/packet-uaudp.c
@@ -352,7 +352,7 @@ static void dissect_uaudp_serv_to_term(tvbuff_t *tvb, packet_info *pinfo, proto_
* UA/UDP DISSECTOR
Wireshark packet dissector entry point
*/
-static void dissect_uaudp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int dissect_uaudp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
/* server address, if present, has precedence on ports */
if (use_sys_ip) {
@@ -360,12 +360,12 @@ static void dissect_uaudp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (memcmp((pinfo->src).data, sys_ip, 4*sizeof(guint8)) == 0)
{
_dissect_uaudp(tvb, pinfo, tree, SYS_TO_TERM);
- return;
+ return tvb_captured_length(tvb);
}
else if (memcmp((pinfo->dst).data, sys_ip, 4*sizeof(guint8)) == 0)
{
_dissect_uaudp(tvb, pinfo, tree, TERM_TO_SYS);
- return;
+ return tvb_captured_length(tvb);
}
}
@@ -373,15 +373,16 @@ static void dissect_uaudp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (find_terminal_port(pinfo->srcport))
{
_dissect_uaudp(tvb, pinfo, tree, TERM_TO_SYS);
- return;
+ return tvb_captured_length(tvb);
}
else if (find_terminal_port(pinfo->destport))
{
_dissect_uaudp(tvb, pinfo, tree, SYS_TO_TERM);
- return;
+ return tvb_captured_length(tvb);
}
_dissect_uaudp(tvb, pinfo, tree, DIR_UNKNOWN);
+ return tvb_captured_length(tvb);
}
/* XXX: Presumably there's a util fcn for this ... */
@@ -591,7 +592,7 @@ void proto_register_uaudp(void)
"UAUDP",
"uaudp");
- uaudp_handle = register_dissector("uaudp", dissect_uaudp, proto_uaudp);
+ uaudp_handle = new_register_dissector("uaudp", dissect_uaudp, proto_uaudp);
#if 0 /* XXX: Not used ?? */
new_register_dissector("uaudp_dir_unknown", dissect_uaudp_dir_unknown, proto_uaudp);
new_register_dissector("uaudp_term_to_serv", dissect_uaudp_term_to_serv, proto_uaudp);
diff --git a/epan/dissectors/packet-umts_fp.c b/epan/dissectors/packet-umts_fp.c
index 3386c9c437..123e0925ce 100644
--- a/epan/dissectors/packet-umts_fp.c
+++ b/epan/dissectors/packet-umts_fp.c
@@ -586,7 +586,7 @@ static void dissect_e_dch_t2_or_common_channel_info(tvbuff_t *tvb, packet_info *
gboolean is_common, guint16 header_crc, proto_item * header_crc_pi);
/* Main dissection function */
-static void dissect_fp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
+static int dissect_fp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data);
/*
* CRNC sends data downlink on uplink parameters.
@@ -3785,7 +3785,7 @@ heur_dissect_fp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
if (calc_crc == crc) {
/* assume this is FP, set conversatio dissector to catch the data frames too */
conversation_set_dissector(find_or_create_conversation(pinfo), fp_handle);
- dissect_fp(tvb, pinfo, tree);
+ dissect_fp(tvb, pinfo, tree, data);
return TRUE;
}
}
@@ -3804,7 +3804,7 @@ heur_dissect_fp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
return FALSE;
/* assume this is FP */
- dissect_fp(tvb, pinfo, tree);
+ dissect_fp(tvb, pinfo, tree, data);
return TRUE;
}
static guint8 fakes =5; /*[] ={1,5,8};*/
@@ -4181,8 +4181,8 @@ fp_set_per_packet_inf_from_conv(umts_fp_conversation_info_t *p_conv_data,
/*****************************/
/* Main dissection function. */
-static void
-dissect_fp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_fp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *fp_tree;
proto_item *ti;
@@ -4260,7 +4260,7 @@ dissect_fp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Can't dissect anything without it... */
if (p_fp_info == NULL) {
proto_tree_add_expert(fp_tree, pinfo, &ei_fp_no_per_frame_info, tvb, offset, -1);
- return;
+ return 1;
}
rlcinf = (rlc_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_rlc, 0);
@@ -4322,7 +4322,7 @@ dissect_fp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Don't currently handle IuR-specific formats, but it's useful to even see
the channel type and direction */
if (p_fp_info->iface_type == IuR_Interface) {
- return;
+ return 1;
}
/* Show DDI config info */
@@ -4439,6 +4439,7 @@ dissect_fp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
expert_add_info(pinfo, NULL, &ei_fp_channel_type_unknown);
break;
}
+ return tvb_captured_length(tvb);
}
#ifdef UMTS_FP_USE_UAT
@@ -5577,7 +5578,7 @@ void proto_register_fp(void)
expert_register_field_array(expert_fp, ei, array_length(ei));
/* Allow other dissectors to find this one by name. */
- register_dissector("fp", dissect_fp, proto_fp);
+ new_register_dissector("fp", dissect_fp, proto_fp);
/* Preferences */
fp_module = prefs_register_protocol(proto_fp, NULL);
diff --git a/epan/dissectors/packet-umts_mac.c b/epan/dissectors/packet-umts_mac.c
index 8fe830c451..99844bfdce 100644
--- a/epan/dissectors/packet-umts_mac.c
+++ b/epan/dissectors/packet-umts_mac.c
@@ -259,7 +259,7 @@ static guint16 tree_add_common_dcch_dtch_fields(tvbuff_t *tvb, packet_info *pinf
return bitoffs;
}
-static void dissect_mac_fdd_pch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int dissect_mac_fdd_pch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *pch_tree = NULL;
proto_item *channel_type;
@@ -276,9 +276,10 @@ static void dissect_mac_fdd_pch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
PROTO_ITEM_SET_GENERATED(channel_type);
}
call_dissector(rlc_pcch_handle, tvb, pinfo, tree);
+ return tvb_captured_length(tvb);
}
-static void dissect_mac_fdd_rach(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int dissect_mac_fdd_rach(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint8 tctf;
guint8 chan;
@@ -308,7 +309,7 @@ static void dissect_mac_fdd_rach(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
rlcinf = (rlc_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_rlc, 0);
if (!macinf || !fpinf) {
proto_tree_add_expert(rach_tree, pinfo, &ei_mac_per_frame_info_missing, tvb, 0, -1);
- return;
+ return 1;
}
proto_tree_add_bits_item(rach_tree, hf_mac_rach_fdd_tctf, tvb, 0, 2, ENC_BIG_ENDIAN);
@@ -364,9 +365,10 @@ static void dissect_mac_fdd_rach(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
proto_item_append_text(ti, " (Unknown RACH TCTF)");
expert_add_info_format(pinfo, NULL, &ei_mac_rach_tctf_unknown, "Unknown RACH TCTF");
}
+ return tvb_captured_length(tvb);
}
-static void dissect_mac_fdd_fach(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int dissect_mac_fdd_fach(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint8 hdr, tctf;
guint16 bitoffs = 0;
@@ -400,7 +402,7 @@ static void dissect_mac_fdd_fach(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
if (!macinf || !fpinf) {
proto_tree_add_expert(fach_tree, pinfo, &ei_mac_per_frame_info_missing, tvb, 0, -1);
- return;
+ return 1;
}
proto_tree_add_bits_item(fach_tree, hf_mac_fach_fdd_tctf, tvb, 0, tctf_len, ENC_BIG_ENDIAN);
@@ -492,9 +494,10 @@ static void dissect_mac_fdd_fach(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
expert_add_info_format(pinfo, NULL, &ei_mac_unknown_content, " Unknown FACH Content");
break;
}
+ return tvb_captured_length(tvb);
}
-static void dissect_mac_fdd_dch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int dissect_mac_fdd_dch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint16 pos;
guint8 bitoffs = 0;
@@ -517,7 +520,7 @@ static void dissect_mac_fdd_dch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
if (!macinf || !fpinf) {
proto_tree_add_expert(dch_tree, pinfo, &ei_mac_per_frame_info_missing, tvb, 0, -1);
- return;
+ return 1;
}
pos = fpinf->cur_tb;
@@ -598,6 +601,7 @@ static void dissect_mac_fdd_dch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
proto_item_append_text(ti, " (Unknown DCH Content)");
expert_add_info_format(pinfo, NULL, &ei_mac_unknown_content, "Unknown DCH Content");
}
+ return tvb_captured_length(tvb);
}
static void init_frag(tvbuff_t * tvb, body_parts * bp, guint length, guint offset, guint32 frame_num, guint16 tsn, guint8 type)
@@ -942,7 +946,7 @@ static void call_rlc(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, pro
/*
* Dissect a MAC-is PDU.
*/
-static void dissect_mac_fdd_edch_type2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int dissect_mac_fdd_edch_type2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint sdu_no, subframe_bytes = 0, offset = 0;
guint8 ss;
@@ -1004,9 +1008,10 @@ static void dissect_mac_fdd_edch_type2(tvbuff_t *tvb, packet_info *pinfo, proto_
proto_item_set_len(pi, 1+subframe_bytes);
/*total_bytes += subframe_bytes;*/
+ return tvb_captured_length(tvb);
}
-static void dissect_mac_fdd_edch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int dissect_mac_fdd_edch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *edch_tree = NULL;
proto_item *channel_type;
@@ -1025,7 +1030,7 @@ static void dissect_mac_fdd_edch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
macinf = (umts_mac_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_umts_mac, 0);
if (!macinf|| !fpinf) {
proto_tree_add_expert(edch_tree, pinfo, &ei_mac_per_frame_info_missing, tvb, 0, -1);
- return;
+ return 1;
}
pos = fpinf->cur_tb;
@@ -1065,6 +1070,7 @@ static void dissect_mac_fdd_edch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
expert_add_info_format(pinfo, ti, &ei_mac_unknown_content, "Unknown EDCH Content");
break;
}
+ return tvb_captured_length(tvb);
}
/**
* Dissect hsdsch_common channel.
@@ -1135,7 +1141,7 @@ static void dissect_mac_fdd_hsdsch_common(tvbuff_t *tvb, packet_info *pinfo, pro
* no re-alignment is necessary
* If no C/T is present, the whole payload will be left-shifted by 4 bit
*/
-static void dissect_mac_fdd_hsdsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int dissect_mac_fdd_hsdsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *hsdsch_tree = NULL;
proto_item *channel_type;
@@ -1162,7 +1168,7 @@ static void dissect_mac_fdd_hsdsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree
if (!macinf) {
proto_tree_add_expert(hsdsch_tree, pinfo, &ei_mac_per_frame_info_missing, tvb, 0, -1);
- return;
+ return 1;
}
if (macinf->ctmux[pos]) { /*The 4'st bits are padding*/
proto_tree_add_bits_item(hsdsch_tree, hf_mac_ct, tvb, bitoffs, 4, ENC_BIG_ENDIAN);
@@ -1264,6 +1270,7 @@ static void dissect_mac_fdd_hsdsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree
proto_item_append_text(ti, " (Unknown HSDSCH Content)");
expert_add_info_format(pinfo, NULL, &ei_mac_unknown_content, "Unknown HSDSCH Content");
}
+ return tvb_captured_length(tvb);
}
static void mac_is_sdus_hash_destroy(gpointer data)
@@ -1461,13 +1468,13 @@ proto_register_umts_mac(void)
expert_umts_mac = expert_register_protocol(proto_umts_mac);
expert_register_field_array(expert_umts_mac, ei, array_length(ei));
- register_dissector("mac.fdd.rach", dissect_mac_fdd_rach, proto_umts_mac);
- register_dissector("mac.fdd.fach", dissect_mac_fdd_fach, proto_umts_mac);
- register_dissector("mac.fdd.pch", dissect_mac_fdd_pch, proto_umts_mac);
- register_dissector("mac.fdd.dch", dissect_mac_fdd_dch, proto_umts_mac);
- register_dissector("mac.fdd.edch", dissect_mac_fdd_edch, proto_umts_mac);
- register_dissector("mac.fdd.edch.type2", dissect_mac_fdd_edch_type2, proto_umts_mac);
- register_dissector("mac.fdd.hsdsch", dissect_mac_fdd_hsdsch, proto_umts_mac);
+ new_register_dissector("mac.fdd.rach", dissect_mac_fdd_rach, proto_umts_mac);
+ new_register_dissector("mac.fdd.fach", dissect_mac_fdd_fach, proto_umts_mac);
+ new_register_dissector("mac.fdd.pch", dissect_mac_fdd_pch, proto_umts_mac);
+ new_register_dissector("mac.fdd.dch", dissect_mac_fdd_dch, proto_umts_mac);
+ new_register_dissector("mac.fdd.edch", dissect_mac_fdd_edch, proto_umts_mac);
+ new_register_dissector("mac.fdd.edch.type2", dissect_mac_fdd_edch_type2, proto_umts_mac);
+ new_register_dissector("mac.fdd.hsdsch", dissect_mac_fdd_hsdsch, proto_umts_mac);
register_init_routine(mac_init);
register_cleanup_routine(mac_cleanup);
diff --git a/epan/dissectors/packet-user_encap.c b/epan/dissectors/packet-user_encap.c
index 52ce26c068..3d008c678a 100644
--- a/epan/dissectors/packet-user_encap.c
+++ b/epan/dissectors/packet-user_encap.c
@@ -103,7 +103,7 @@ static void export_pdu(tvbuff_t *tvb, packet_info* pinfo, char *proto_name)
}
}
-static void dissect_user(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree) {
+static int dissect_user(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, void* data _U_) {
user_encap_t* encap = NULL;
tvbuff_t* payload_tvb;
proto_item* item;
@@ -135,7 +135,7 @@ static void dissect_user(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree) {
expert_add_info_format(pinfo, item, &ei_user_encap_not_handled, "%s", msg);
call_dissector(data_handle, tvb, pinfo, tree);
- return;
+ return tvb_captured_length(tvb);
}
if (encap->payload_proto == NULL) {
char* msg = wmem_strdup_printf(wmem_packet_scope(),
@@ -147,7 +147,7 @@ static void dissect_user(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree) {
expert_add_info_format(pinfo, item, &ei_user_encap_not_handled, "%s", msg);
call_dissector(data_handle, tvb, pinfo, tree);
- return;
+ return tvb_captured_length(tvb);
}
proto_item_set_text(item,"DLT: %d",pinfo->match_uint + 147 - WTAP_ENCAP_USER0);
@@ -188,6 +188,7 @@ static void dissect_user(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree) {
}
}
}
+ return tvb_captured_length(tvb);
}
static void* user_copy_cb(void* dest, const void* orig, size_t len _U_)
@@ -293,7 +294,7 @@ void proto_register_user_encap(void)
encaps_uat);
- register_dissector("user_dlt",dissect_user,proto_user_encap);
+ new_register_dissector("user_dlt",dissect_user,proto_user_encap);
/*
prefs_register_protocol_obsolete(proto_register_protocol("DLT User A","DLT_USER_A","user_dlt_a"));
diff --git a/epan/dissectors/packet-v120.c b/epan/dissectors/packet-v120.c
index dad4625fb3..9cf30f9dfb 100644
--- a/epan/dissectors/packet-v120.c
+++ b/epan/dissectors/packet-v120.c
@@ -103,8 +103,8 @@ static const xdlc_cf_items v120_cf_items_ext = {
&hf_v120_ftype_s_u_ext
};
-static void
-dissect_v120(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_v120(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *v120_tree, *address_tree;
proto_item *ti, *tc;
@@ -129,7 +129,7 @@ dissect_v120(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree)
proto_tree_add_protocol_format(tree, proto_v120, tvb, 0, -1,
"Invalid V.120 frame");
- return;
+ return 2;
}
if (pinfo->p2p_dir == P2P_DIR_SENT) {
@@ -143,36 +143,32 @@ dissect_v120(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_RES_DL_SRC, "DCE");
}
- if (tree) {
- ti = proto_tree_add_protocol_format(tree, proto_v120, tvb, 0, -1, "V.120");
- v120_tree = proto_item_add_subtree(ti, ett_v120);
- tc = proto_tree_add_item(v120_tree, hf_v120_address, tvb, 0, 2, ENC_BIG_ENDIAN);
- proto_item_append_text(tc, "LLI: %d C/R: %s",
- ((byte0 & 0xfc) << 5) | ((byte1 & 0xfe) >> 1),
- byte0 & 0x02 ? "R" : "C");
- address_tree = proto_item_add_subtree(tc, ett_v120_address);
-
- proto_tree_add_item(address_tree, hf_v120_rc, tvb, 0, 2, ENC_BIG_ENDIAN);
- proto_tree_add_item(address_tree, hf_v120_lli, tvb, 0, 2, ENC_BIG_ENDIAN);
- proto_tree_add_item(address_tree, hf_v120_ea0, tvb, 0, 2, ENC_BIG_ENDIAN);
- proto_tree_add_item(address_tree, hf_v120_ea1, tvb, 0, 2, ENC_BIG_ENDIAN);
- }
- else {
- v120_tree = NULL;
- ti = NULL;
- }
+ ti = proto_tree_add_protocol_format(tree, proto_v120, tvb, 0, -1, "V.120");
+ v120_tree = proto_item_add_subtree(ti, ett_v120);
+ tc = proto_tree_add_item(v120_tree, hf_v120_address, tvb, 0, 2, ENC_BIG_ENDIAN);
+ proto_item_append_text(tc, "LLI: %d C/R: %s",
+ ((byte0 & 0xfc) << 5) | ((byte1 & 0xfe) >> 1),
+ byte0 & 0x02 ? "R" : "C");
+ address_tree = proto_item_add_subtree(tc, ett_v120_address);
+
+ proto_tree_add_item(address_tree, hf_v120_rc, tvb, 0, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(address_tree, hf_v120_lli, tvb, 0, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(address_tree, hf_v120_ea0, tvb, 0, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(address_tree, hf_v120_ea1, tvb, 0, 2, ENC_BIG_ENDIAN);
+
control = dissect_xdlc_control(tvb, 2, pinfo, v120_tree, hf_v120_control,
ett_v120_control, &v120_cf_items, &v120_cf_items_ext,
NULL, NULL, is_response, TRUE, FALSE);
- if (tree) {
- v120len = 2 + XDLC_CONTROL_LEN(control, TRUE);
-
- if (tvb_bytes_exist(tvb, v120len, 1))
- v120len += dissect_v120_header(tvb, v120len, v120_tree);
- proto_item_set_len(ti, v120len);
- next_tvb = tvb_new_subset_remaining(tvb, v120len);
- call_dissector(data_handle,next_tvb, pinfo, v120_tree);
- }
+
+ v120len = 2 + XDLC_CONTROL_LEN(control, TRUE);
+
+ if (tvb_bytes_exist(tvb, v120len, 1))
+ v120len += dissect_v120_header(tvb, v120len, v120_tree);
+ proto_item_set_len(ti, v120len);
+ next_tvb = tvb_new_subset_remaining(tvb, v120len);
+ call_dissector(data_handle,next_tvb, pinfo, v120_tree);
+
+ return tvb_captured_length(tvb);
}
static int
@@ -334,7 +330,7 @@ proto_register_v120(void)
proto_register_field_array (proto_v120, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
- register_dissector("v120", dissect_v120, proto_v120);
+ new_register_dissector("v120", dissect_v120, proto_v120);
}
void
diff --git a/epan/dissectors/packet-zep.c b/epan/dissectors/packet-zep.c
index 3422eb7876..6072760e9f 100644
--- a/epan/dissectors/packet-zep.c
+++ b/epan/dissectors/packet-zep.c
@@ -95,7 +95,7 @@ static dissector_handle_t ieee802154_ccfcs_handle;
* void
*---------------------------------------------------------------
*/
-static void dissect_zep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int dissect_zep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
tvbuff_t *next_tvb;
proto_item *proto_root, *pi;
@@ -109,8 +109,7 @@ static void dissect_zep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Determine whether this is a Q51/IEEE 802.15.4 sniffer packet or not */
if(strcmp(tvb_get_string_enc(wmem_packet_scope(), tvb, 0, 2, ENC_ASCII), ZEP_PREAMBLE)){
/* This is not a Q51/ZigBee sniffer packet */
- call_dissector(data_handle, tvb, pinfo, tree);
- return;
+ return 0;
}
memset(&zep_data, 0, sizeof(zep_data)); /* Zero all zep_data fields. */
@@ -161,8 +160,7 @@ static void dissect_zep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if(ieee_packet_len < tvb_reported_length(tvb)-zep_header_len){
/* Packet's length is mis-reported, abort dissection */
- call_dissector(data_handle, tvb, pinfo, tree);
- return;
+ return 0;
}
/* Enter name info protocol field */
@@ -215,7 +213,8 @@ static void dissect_zep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_uint(zep_tree, hf_zep_seqno, tvb, 17, 4, zep_data.seqno);
}
}
- if (!((zep_data.version==2) && (zep_data.type==ZEP_V2_TYPE_ACK))) proto_tree_add_uint_format_value(zep_tree, hf_zep_ieee_length, tvb, zep_header_len - 1, 1, ieee_packet_len, "%i %s", ieee_packet_len, (ieee_packet_len==1)?"Byte":"Bytes");
+ if (!((zep_data.version==2) && (zep_data.type==ZEP_V2_TYPE_ACK)))
+ proto_tree_add_uint_format_value(zep_tree, hf_zep_ieee_length, tvb, zep_header_len - 1, 1, ieee_packet_len, "%i %s", ieee_packet_len, (ieee_packet_len==1)?"Byte":"Bytes");
}
/* Determine which dissector to call next. */
@@ -237,6 +236,7 @@ static void dissect_zep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
next_tvb = tvb_new_subset_length(tvb, zep_header_len, ieee_packet_len);
call_dissector(next_dissector, next_tvb, pinfo, tree);
}
+ return tvb_captured_length(tvb);
} /* dissect_ieee802_15_4 */
/*FUNCTION:------------------------------------------------------
@@ -321,7 +321,7 @@ void proto_register_zep(void)
10, &gPREF_zep_udp_port);
/* Register dissector with Wireshark. */
- zep_handle = register_dissector("zep", dissect_zep, proto_zep);
+ zep_handle = new_register_dissector("zep", dissect_zep, proto_zep);
} /* proto_register_zep */
/*FUNCTION:------------------------------------------------------
diff --git a/plugins/mate/packet-mate.c b/plugins/mate/packet-mate.c
index 35f8c333c8..0583984812 100644
--- a/plugins/mate/packet-mate.c
+++ b/plugins/mate/packet-mate.c
@@ -295,13 +295,14 @@ mate_pdu_tree(mate_pdu *pdu, packet_info *pinfo, tvbuff_t *tvb, proto_tree* tree
}
}
-static void
-mate_tree(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+mate_tree(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
mate_pdu* pdus;
proto_tree *mate_t;
- if ( ! mc || ! tree ) return;
+ if ( ! mc || ! tree )
+ return tvb_captured_length(tvb);
mate_analyze_frame(pinfo,tree);
@@ -312,6 +313,7 @@ mate_tree(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
mate_pdu_tree(pdus,pinfo,tvb,mate_t);
}
}
+ return tvb_captured_length(tvb);
}
static int
@@ -392,14 +394,13 @@ proto_register_mate(void)
expert_mate = expert_register_protocol(proto_mate);
expert_register_field_array(expert_mate, ei, array_length(ei));
- register_dissector("mate",mate_tree,proto_mate);
+ mate_handle = new_register_dissector("mate",mate_tree,proto_mate);
mate_module = prefs_register_protocol(proto_mate, proto_reg_handoff_mate);
prefs_register_filename_preference(mate_module, "config",
"Configuration Filename",
"The name of the file containing the mate module's configuration",
&pref_mate_config_filename);
- mate_handle = find_dissector("mate");
register_postdissector(mate_handle);
}
diff --git a/plugins/wimax/mac_hd_generic_decoder.c b/plugins/wimax/mac_hd_generic_decoder.c
index ae0cdbba77..102c6481af 100644
--- a/plugins/wimax/mac_hd_generic_decoder.c
+++ b/plugins/wimax/mac_hd_generic_decoder.c
@@ -696,7 +696,7 @@ static guint decode_packing_subheader(tvbuff_t *payload_tvb, packet_info *pinfo,
}
-static void dissect_mac_header_generic_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int dissect_mac_header_generic_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint offset = 0;
guint payload_offset;
@@ -743,7 +743,7 @@ static void dissect_mac_header_generic_decoder(tvbuff_t *tvb, packet_info *pinfo
generic_tree = proto_item_add_subtree(generic_item, ett_mac_header_generic_decoder);
/* display the Generic MAC Header in Hex */
proto_tree_add_item(generic_tree, hf_mac_header_generic_value_bytes, tvb, offset, tvb_len, ENC_NA);
- return;
+ return tvb_captured_length(tvb);
}
/* get the parent */
parent_item = proto_tree_get_parent(tree);
@@ -985,7 +985,7 @@ static void dissect_mac_header_generic_decoder(tvbuff_t *tvb, packet_info *pinfo
if (length < (gint)sizeof(mac_crc))
{ /* display error message */
proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, offset, length, "Error - the frame is too short (%u bytes)", length);
- return;
+ return tvb_captured_length(tvb);
}
length -= (int)sizeof(mac_crc);
}
@@ -1240,6 +1240,7 @@ check_crc:
/* display message */
expert_add_info(pinfo, tree, &ei_mac_crc_missing);
}
+ return tvb_captured_length(tvb);
}
static gint extended_subheader_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
@@ -2266,7 +2267,7 @@ void proto_register_mac_header_generic(void)
expert_register_field_array(expert_mac_header_generic, ei, array_length(ei));
/* register the generic mac header dissector */
- register_dissector("mac_header_generic_handler", dissect_mac_header_generic_decoder, proto_mac_header_generic_decoder);
+ new_register_dissector("mac_header_generic_handler", dissect_mac_header_generic_decoder, proto_mac_header_generic_decoder);
/* Register the payload fragment table init routine */
register_init_routine(wimax_defragment_init);
diff --git a/plugins/wimax/mac_hd_type1_decoder.c b/plugins/wimax/mac_hd_type1_decoder.c
index 48f6fb3e51..540363cd72 100644
--- a/plugins/wimax/mac_hd_type1_decoder.c
+++ b/plugins/wimax/mac_hd_type1_decoder.c
@@ -206,7 +206,7 @@ static const value_string last_msgs[] =
{ 0, NULL}
};
-static void dissect_mac_header_type_1_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int dissect_mac_header_type_1_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
gint tvb_len, offset = 0;
guint first_byte, sub_type;
@@ -226,7 +226,7 @@ static void dissect_mac_header_type_1_decoder(tvbuff_t *tvb, packet_info *pinfo,
{
/* display the MAC Type I Header in Hex */
proto_tree_add_item(ti_tree, hf_mac_header_type_1_value_bytes, tvb, offset, tvb_len, ENC_NA);
- return;
+ return tvb_captured_length(tvb);
}
#ifdef DEBUG
/* update the info column */
@@ -255,7 +255,7 @@ static void dissect_mac_header_type_1_decoder(tvbuff_t *tvb, packet_info *pinfo,
proto_tree_add_protocol_format(ti_tree, proto_mac_header_type_1_decoder, tvb, offset, tvb_len, "Unknown type 1 subtype: %u", sub_type);
/* display the MAC Type I Header in Hex */
proto_tree_add_item(ti_tree, hf_mac_header_type_1_value_bytes, tvb, offset, tvb_len, ENC_NA);
- return;
+ return tvb_captured_length(tvb);
}
/* add the MAC header info */
proto_item_append_text(parent_item, "%s", type1_subtype_abbrv[sub_type]);
@@ -326,6 +326,7 @@ static void dissect_mac_header_type_1_decoder(tvbuff_t *tvb, packet_info *pinfo,
/* Decode and display the HCS */
proto_tree_add_item(ti_tree, hf_mac_header_type_1_hcs, tvb, (offset+5), 1, ENC_BIG_ENDIAN);
}
+ return tvb_captured_length(tvb);
}
/* Register Wimax Mac Header Type II Protocol and Dissector */
@@ -555,7 +556,7 @@ void proto_register_mac_header_type_1(void)
proto_register_field_array(proto_mac_header_type_1_decoder, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
- register_dissector("mac_header_type_1_handler", dissect_mac_header_type_1_decoder, -1);
+ new_register_dissector("mac_header_type_1_handler", dissect_mac_header_type_1_decoder, proto_mac_header_type_1_decoder);
}
/*
diff --git a/plugins/wimax/mac_hd_type2_decoder.c b/plugins/wimax/mac_hd_type2_decoder.c
index f606a70b05..6e53c172c1 100644
--- a/plugins/wimax/mac_hd_type2_decoder.c
+++ b/plugins/wimax/mac_hd_type2_decoder.c
@@ -379,7 +379,7 @@ static const value_string ai_msgs[] =
};
-static void dissect_mac_header_type_2_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int dissect_mac_header_type_2_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
gint tvb_len, offset = 0;
guint cii_bit, first_byte, fb_type, mimo_type;
@@ -387,7 +387,6 @@ static void dissect_mac_header_type_2_decoder(tvbuff_t *tvb, packet_info *pinfo,
proto_item *ti = NULL;
proto_tree *ti_tree = NULL;
- if (tree)
{ /* we are being asked for details */
/* Get the tvb reported length */
tvb_len = tvb_reported_length(tvb);
@@ -401,7 +400,7 @@ static void dissect_mac_header_type_2_decoder(tvbuff_t *tvb, packet_info *pinfo,
proto_tree_add_protocol_format(ti_tree, proto_mac_header_type_2_decoder, tvb, offset, tvb_len, "Error: the size of Mac Header Type II tvb is too small! (%u bytes)", tvb_len);
/* display the MAC Type II Header in Hex */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_value_bytes, tvb, offset, tvb_len, ENC_NA);
- return;
+ return tvb_captured_length(tvb);
}
#ifdef DEBUG
/* update the info column */
@@ -440,7 +439,7 @@ static void dissect_mac_header_type_2_decoder(tvbuff_t *tvb, packet_info *pinfo,
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Unknown type 2 fb type");
/* display the MAC Type I Header in Hex */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_value_bytes, tvb, offset, tvb_len, ENC_NA);
- return;
+ return tvb_captured_length(tvb);
}
/* move to the second byte */
offset++;
@@ -786,6 +785,7 @@ static void dissect_mac_header_type_2_decoder(tvbuff_t *tvb, packet_info *pinfo,
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Error - Undefined Type");
}
}
+ return tvb_captured_length(tvb);
}
/* Register Wimax Mac Header Type II Protocol and Dissector */
@@ -1366,7 +1366,7 @@ void proto_register_mac_header_type_2(void)
proto_register_field_array(proto_mac_header_type_2_decoder, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
- register_dissector("mac_header_type_2_handler", dissect_mac_header_type_2_decoder, -1);
+ new_register_dissector("mac_header_type_2_handler", dissect_mac_header_type_2_decoder, proto_mac_header_type_2_decoder);
}
/*
diff --git a/plugins/wimax/mac_mgmt_msg_decoder.c b/plugins/wimax/mac_mgmt_msg_decoder.c
index 937614b5bc..0a7386dd8a 100644
--- a/plugins/wimax/mac_mgmt_msg_decoder.c
+++ b/plugins/wimax/mac_mgmt_msg_decoder.c
@@ -120,7 +120,7 @@ static const value_string mgt_msg_abbrv_vals[] = {
static value_string_ext mgt_msg_abbrv_vals_ext = VALUE_STRING_EXT_INIT(mgt_msg_abbrv_vals);
-static void dissect_mac_mgmt_msg_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int dissect_mac_mgmt_msg_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint offset = 0;
guint message_type;
@@ -135,7 +135,7 @@ static void dissect_mac_mgmt_msg_decoder(tvbuff_t *tvb, packet_info *pinfo, prot
if (tvb_reported_length(tvb) == 0)
{
expert_add_info(pinfo, message_item, &ei_empty_payload);
- return;
+ return tvb_captured_length(tvb);
}
/* Get the payload type */
@@ -151,7 +151,7 @@ static void dissect_mac_mgmt_msg_decoder(tvbuff_t *tvb, packet_info *pinfo, prot
{
/* display the MAC payload in Hex */
proto_tree_add_item(message_tree, hf_mac_mgmt_msg_values, tvb, offset, -1, ENC_NA);
- return;
+ return 1;
}
/* add the MAC header info to parent*/
@@ -163,6 +163,7 @@ static void dissect_mac_mgmt_msg_decoder(tvbuff_t *tvb, packet_info *pinfo, prot
{
proto_tree_add_item(message_tree, hf_mac_mgmt_msg_values, tvb, offset, -1, ENC_NA);
}
+ return tvb_captured_length(tvb);
}
/* Register Wimax Mac Payload Protocol and Dissector */
@@ -216,7 +217,7 @@ void proto_register_mac_mgmt_msg(void)
"WiMax MAC Management Message", FT_UINT8, BASE_DEC, DISSECTOR_TABLE_ALLOW_DUPLICATE);
/* Register dissector by name */
- register_dissector("wmx_mac_mgmt_msg_decoder", dissect_mac_mgmt_msg_decoder,
+ new_register_dissector("wmx_mac_mgmt_msg_decoder", dissect_mac_mgmt_msg_decoder,
proto_mac_mgmt_msg_decoder);
}
diff --git a/plugins/wimax/wimax_harq_map_decoder.c b/plugins/wimax/wimax_harq_map_decoder.c
index a745d1424b..b154be548a 100644
--- a/plugins/wimax/wimax_harq_map_decoder.c
+++ b/plugins/wimax/wimax_harq_map_decoder.c
@@ -62,7 +62,7 @@ static gint hf_harq_map_msg_crc = -1;
/* HARQ MAP message decoder */
-static void dissector_wimax_harq_map_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int dissector_wimax_harq_map_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint i, offset = 0;
guint tvb_len, length, dl_ie_count;
@@ -80,13 +80,13 @@ static void dissector_wimax_harq_map_decoder(tvbuff_t *tvb, packet_info *pinfo,
tvb_len = tvb_reported_length(tvb);
if(!tvb_len)
{ /* do nothing if tvb is empty */
- return;
+ return 0;
}
/* Ensure the right payload type */
first_24bits = tvb_get_ntoh24(tvb, offset);
if((first_24bits & WIMAX_HARQ_MAP_INDICATOR_MASK) != WIMAX_HARQ_MAP_INDICATOR_MASK)
{ /* do nothing if tvb is not a HARQ MAP message */
- return;
+ return 0;
}
/* update the info column */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "HARQ-MAP Message: ");
@@ -162,6 +162,7 @@ static void dissector_wimax_harq_map_decoder(tvbuff_t *tvb, packet_info *pinfo,
proto_item_append_text(it, " - incorrect! (should be: 0x%x)", calculated_crc);
}
}
+ return tvb_captured_length(tvb);
}
/* Register Wimax HARQ MAP Protocol */
@@ -207,7 +208,7 @@ void proto_register_wimax_harq_map(void)
proto_register_subtree_array(ett, array_length(ett));
proto_register_field_array(proto_wimax_harq_map_decoder, hf_harq_map, array_length(hf_harq_map));
- register_dissector("wimax_harq_map_handler", dissector_wimax_harq_map_decoder, -1);
+ new_register_dissector("wimax_harq_map_handler", dissector_wimax_harq_map_decoder, proto_wimax_harq_map_decoder);
}
/*