aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2015-11-17 20:16:06 -0500
committerAnders Broman <a.broman58@gmail.com>2015-11-18 07:33:08 +0000
commit4adeb424f5cdb74ca1f98cd4b87bd72e4d811f03 (patch)
tree6c73d6e0795cc5181ad53242581e4c7f2282081f
parent13297438d98e3388d650fc55c2a77d5b52367e1f (diff)
create_dissector_handle -> new_create_dissector_handle
Picking off "easy" dissectors that only have one or two exit points at most. Change-Id: I9c7d1c092bbae896ec0c2832617891346927f2e1 Reviewed-on: https://code.wireshark.org/review/11932 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r--epan/dissectors/packet-oampdu.c7
-rw-r--r--epan/dissectors/packet-osi.c23
-rw-r--r--epan/dissectors/packet-ossp.c7
-rw-r--r--epan/dissectors/packet-pcapng_block.c7
-rw-r--r--epan/dissectors/packet-pcli.c28
-rw-r--r--epan/dissectors/packet-pdc.c5
-rw-r--r--epan/dissectors/packet-pflog.c7
-rw-r--r--epan/dissectors/packet-pim.c9
-rw-r--r--epan/dissectors/packet-pktc.c14
-rw-r--r--epan/dissectors/packet-ppp.c159
-rw-r--r--epan/dissectors/packet-pppoe.c10
-rw-r--r--epan/dissectors/packet-pptp.c7
-rw-r--r--epan/dissectors/packet-ptp.c18
-rw-r--r--epan/dissectors/packet-pw-cesopsn.c6
-rw-r--r--epan/dissectors/packet-pw-eth.c12
-rw-r--r--epan/dissectors/packet-pw-hdlc.c6
-rw-r--r--epan/dissectors/packet-pw-oam.c10
-rw-r--r--epan/dissectors/packet-pw-satop.c6
-rw-r--r--epan/dissectors/packet-q931.c7
-rw-r--r--epan/dissectors/packet-quake.c14
-rw-r--r--epan/dissectors/packet-quake2.c7
-rw-r--r--epan/dissectors/packet-quake3.c7
-rw-r--r--epan/dissectors/packet-quakeworld.c7
-rw-r--r--epan/dissectors/packet-raw.c7
-rw-r--r--epan/dissectors/packet-redback.c8
-rw-r--r--epan/dissectors/packet-rip.c89
-rw-r--r--epan/dissectors/packet-ripng.c7
-rw-r--r--epan/dissectors/packet-rmi.c7
-rw-r--r--epan/dissectors/packet-rsh.c7
-rw-r--r--epan/dissectors/packet-rsip.c7
-rw-r--r--epan/dissectors/packet-rtmpt.c16
-rw-r--r--epan/dissectors/packet-rtnet.c15
-rw-r--r--epan/dissectors/packet-rudp.c8
-rw-r--r--epan/dissectors/packet-sccpmg.c7
-rw-r--r--epan/dissectors/packet-sdlc.c26
-rw-r--r--epan/dissectors/packet-sll.c7
-rw-r--r--epan/dissectors/packet-slowprotocols.c8
-rw-r--r--epan/dissectors/packet-sml.c11
-rw-r--r--epan/dissectors/packet-snaeth.c7
-rw-r--r--epan/dissectors/packet-socketcan.c7
-rw-r--r--epan/dissectors/packet-socks.c7
-rw-r--r--epan/dissectors/packet-spp.c13
-rw-r--r--epan/dissectors/packet-tdmop.c5
-rw-r--r--epan/dissectors/packet-teamspeak2.c5
-rw-r--r--epan/dissectors/packet-teimanagement.c7
-rw-r--r--epan/dissectors/packet-telkonet.c8
-rw-r--r--epan/dissectors/packet-teredo.c17
-rw-r--r--epan/dissectors/packet-tfp.c7
-rw-r--r--epan/dissectors/packet-time.c7
-rw-r--r--epan/dissectors/packet-tnef.c5
-rw-r--r--epan/dissectors/packet-tpkt.c7
-rw-r--r--epan/dissectors/packet-tsp.c7
-rw-r--r--epan/dissectors/packet-tuxedo.c9
-rw-r--r--epan/dissectors/packet-udld.c9
-rw-r--r--epan/dissectors/packet-udp.c7
-rw-r--r--epan/dissectors/packet-uhd.c9
-rw-r--r--epan/dissectors/packet-usb.c14
-rw-r--r--epan/dissectors/packet-v5ua.c20
-rw-r--r--epan/dissectors/packet-vicp.c7
-rw-r--r--epan/dissectors/packet-vines.c69
-rw-r--r--epan/dissectors/packet-vlan.c7
-rw-r--r--epan/dissectors/packet-vmlab.c7
-rw-r--r--epan/dissectors/packet-vntag.c7
-rw-r--r--epan/dissectors/packet-vrt.c5
-rw-r--r--epan/dissectors/packet-vtp.c7
-rw-r--r--epan/dissectors/packet-vxlan.c7
-rw-r--r--epan/dissectors/packet-who.c38
-rw-r--r--epan/dissectors/packet-wlccp.c9
-rw-r--r--epan/dissectors/packet-wsmp.c7
-rw-r--r--epan/dissectors/packet-wsp.c16
-rw-r--r--epan/dissectors/packet-wtls.c7
-rw-r--r--epan/dissectors/packet-x11.c8
-rw-r--r--epan/dissectors/packet-zebra.c8
73 files changed, 539 insertions, 460 deletions
diff --git a/epan/dissectors/packet-oampdu.c b/epan/dissectors/packet-oampdu.c
index 921856010e..9b1fc12338 100644
--- a/epan/dissectors/packet-oampdu.c
+++ b/epan/dissectors/packet-oampdu.c
@@ -1014,8 +1014,8 @@ dissect_oampdu_vendor_specific(tvbuff_t *tvb, proto_tree *tree);
* Dominique Bastien (dbastien@accedian.com)
* + add support for 802.3ah-2004.
*/
-static void
-dissect_oampdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_oampdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
int offset = 0;
guint8 oampdu_code;
@@ -1159,6 +1159,7 @@ dissect_oampdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
default:
break;
}
+ return tvb_captured_length(tvb);
}
/*
@@ -2634,7 +2635,7 @@ proto_reg_handoff_oampdu(void)
{
dissector_handle_t oampdu_handle;
- oampdu_handle = create_dissector_handle(dissect_oampdu, proto_oampdu);
+ oampdu_handle = new_create_dissector_handle(dissect_oampdu, proto_oampdu);
dissector_add_uint("slow.subtype", OAM_SUBTYPE, oampdu_handle);
}
diff --git a/epan/dissectors/packet-osi.c b/epan/dissectors/packet-osi.c
index 4105a106b0..808014876f 100644
--- a/epan/dissectors/packet-osi.c
+++ b/epan/dissectors/packet-osi.c
@@ -452,26 +452,28 @@ static dissector_table_t osinl_excl_subdissector_table;
static dissector_handle_t data_handle, ppp_handle;
/* Dissect OSI over TCP over TPKT */
-static void
-dissect_osi_tpkt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_osi_tpkt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
dissect_tpkt_encap(tvb, pinfo, tree, tpkt_desegment, osi_handle);
+ return tvb_captured_length(tvb);
}
-static void dissect_osi_juniper(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int dissect_osi_juniper(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint8 nlpid;
tvbuff_t *next_tvb;
nlpid = tvb_get_guint8(tvb, 0);
if(dissector_try_uint(osinl_incl_subdissector_table, nlpid, tvb, pinfo, tree))
- return;
+ return tvb_captured_length(tvb);
next_tvb = tvb_new_subset_remaining(tvb, 1);
dissector_try_uint(osinl_excl_subdissector_table, nlpid, next_tvb, pinfo, tree);
+ return tvb_captured_length(tvb);
}
-static void dissect_osi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int dissect_osi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint8 nlpid;
tvbuff_t *new_tvb;
@@ -487,7 +489,7 @@ static void dissect_osi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* tree itself.
*/
if (dissector_try_uint(osinl_incl_subdissector_table, nlpid, tvb, pinfo, tree))
- return;
+ return tvb_captured_length(tvb);
/*
* Try the subdissector table for protocols in which the NLPID is
@@ -498,7 +500,7 @@ static void dissect_osi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_uint(tree, hf_osi_nlpid, tvb, 0, 1, nlpid);
new_tvb = tvb_new_subset_remaining(tvb, 1);
if (dissector_try_uint(osinl_excl_subdissector_table, nlpid, new_tvb, pinfo, tree))
- return;
+ return tvb_captured_length(tvb);
switch (nlpid) {
@@ -519,6 +521,7 @@ static void dissect_osi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
call_dissector(data_handle,tvb, pinfo, tree);
break;
}
+ return tvb_captured_length(tvb);
} /* dissect_osi */
void
@@ -529,7 +532,7 @@ proto_reg_handoff_osi(void)
static guint tcp_port_osi_over_tpkt;
if (!osi_prefs_initialized) {
- osi_handle = create_dissector_handle(dissect_osi, proto_osi);
+ osi_handle = new_create_dissector_handle(dissect_osi, proto_osi);
dissector_add_uint("llc.dsap", SAP_OSINL1, osi_handle);
dissector_add_uint("llc.dsap", SAP_OSINL2, osi_handle);
dissector_add_uint("llc.dsap", SAP_OSINL3, osi_handle);
@@ -541,7 +544,7 @@ proto_reg_handoff_osi(void)
dissector_add_uint("gre.proto", SAP_OSINL5, osi_handle);
dissector_add_uint("ip.proto", IP_PROTO_ISOIP, osi_handle); /* ISO network layer PDUs [RFC 1070] */
- osi_juniper_handle = create_dissector_handle(dissect_osi_juniper, proto_osi);
+ osi_juniper_handle = new_create_dissector_handle(dissect_osi_juniper, proto_osi);
dissector_add_uint("juniper.proto", JUNIPER_PROTO_ISO, osi_juniper_handle);
dissector_add_uint("juniper.proto", JUNIPER_PROTO_CLNP, osi_juniper_handle);
dissector_add_uint("juniper.proto", JUNIPER_PROTO_MPLS_CLNP, osi_juniper_handle);
@@ -550,7 +553,7 @@ proto_reg_handoff_osi(void)
ppp_handle = find_dissector("ppp");
- osi_tpkt_handle = create_dissector_handle(dissect_osi_tpkt, proto_osi);
+ osi_tpkt_handle = new_create_dissector_handle(dissect_osi_tpkt, proto_osi);
dissector_add_for_decode_as("tcp.port", osi_tpkt_handle);
osi_prefs_initialized = TRUE;
} else {
diff --git a/epan/dissectors/packet-ossp.c b/epan/dissectors/packet-ossp.c
index b87846cd22..3e56dac146 100644
--- a/epan/dissectors/packet-ossp.c
+++ b/epan/dissectors/packet-ossp.c
@@ -223,8 +223,8 @@ dissect_itu_ossp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
* Notes:
* Roberto Morro (roberto.morro[AT]tilab.com)
*/
-static void
-dissect_ossp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_ossp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
gint offset = 0;
const gchar *str;
@@ -272,6 +272,7 @@ dissect_ossp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_item_append_text(oui_item, " (Unknown OSSP organization)");
}
+ return tvb_captured_length(tvb);
}
/*
@@ -691,7 +692,7 @@ proto_reg_handoff_ossp(void)
{
dissector_handle_t ossp_handle;
- ossp_handle = create_dissector_handle(dissect_ossp_pdu, proto_ossp);
+ ossp_handle = new_create_dissector_handle(dissect_ossp_pdu, proto_ossp);
dissector_add_uint("slow.subtype", OSSP_SUBTYPE, ossp_handle);
dh_data = find_dissector("data");
diff --git a/epan/dissectors/packet-pcapng_block.c b/epan/dissectors/packet-pcapng_block.c
index 831c55bd0b..c1bd9d8016 100644
--- a/epan/dissectors/packet-pcapng_block.c
+++ b/epan/dissectors/packet-pcapng_block.c
@@ -33,8 +33,8 @@ static int proto_pcapng_block = -1;
static dissector_table_t pcapng_block_type_dissector_table;
-static void
-dissect_pcapng_block(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_pcapng_block(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
/*
* Call the dissector for the block type of this block, if there
@@ -51,6 +51,7 @@ dissect_pcapng_block(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(tree, proto_pcapng_block, tvb, 0, -1, ENC_NA);
}
+ return tvb_captured_length(tvb);
}
void proto_register_pcapng_block(void)
@@ -66,7 +67,7 @@ proto_reg_handoff_pcapng_block(void)
{
dissector_handle_t pcapng_block_handle;
- pcapng_block_handle = create_dissector_handle(dissect_pcapng_block,
+ pcapng_block_handle = new_create_dissector_handle(dissect_pcapng_block,
proto_pcapng_block);
dissector_add_uint("wtap_fts_rec", WTAP_FILE_TYPE_SUBTYPE_PCAPNG,
pcapng_block_handle);
diff --git a/epan/dissectors/packet-pcli.c b/epan/dissectors/packet-pcli.c
index f0704bbdbe..8b212bd862 100644
--- a/epan/dissectors/packet-pcli.c
+++ b/epan/dissectors/packet-pcli.c
@@ -146,18 +146,19 @@ dissect_pcli_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int of
}
}
-static void
-dissect_pcli(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_pcli(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
int offset = 0;
dissect_pcli_common(tvb, pinfo, tree, &offset);
dissect_pcli_payload(tvb, pinfo, tree, offset);
+ return tvb_captured_length(tvb);
}
-static void
-dissect_pcli8(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_pcli8(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *pcli_tree;
int offset = 0;
@@ -168,10 +169,11 @@ dissect_pcli8(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += 4;
dissect_pcli_payload(tvb, pinfo, tree, offset);
+ return tvb_captured_length(tvb);
}
-static void
-dissect_pcli12(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_pcli12(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *pcli_tree;
int offset = 0;
@@ -182,10 +184,11 @@ dissect_pcli12(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += 8;
dissect_pcli_payload(tvb, pinfo, tree, offset);
+ return tvb_captured_length(tvb);
}
-static void
-dissect_pcli20(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_pcli20(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *pcli_tree;
int offset = 0;
@@ -198,6 +201,7 @@ dissect_pcli20(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += 8;
dissect_pcli_payload(tvb, pinfo, tree, offset);
+ return tvb_captured_length(tvb);
}
static void
@@ -281,10 +285,10 @@ proto_reg_handoff_pcli(void)
static dissector_handle_t pcli_handle, pcli_handle8, pcli_handle12, pcli_handle20;
if(!pcli_initialized) {
- pcli_handle = create_dissector_handle(dissect_pcli, proto_pcli);
- pcli_handle8 = create_dissector_handle(dissect_pcli8, proto_pcli8);
- pcli_handle12 = create_dissector_handle(dissect_pcli12, proto_pcli12);
- pcli_handle20 = create_dissector_handle(dissect_pcli20, proto_pcli20);
+ pcli_handle = new_create_dissector_handle(dissect_pcli, proto_pcli);
+ pcli_handle8 = new_create_dissector_handle(dissect_pcli8, proto_pcli8);
+ pcli_handle12 = new_create_dissector_handle(dissect_pcli12, proto_pcli12);
+ pcli_handle20 = new_create_dissector_handle(dissect_pcli20, proto_pcli20);
data_handle = find_dissector("data");
pcli_initialized = TRUE;
}
diff --git a/epan/dissectors/packet-pdc.c b/epan/dissectors/packet-pdc.c
index 3b8df6db84..f8b1911720 100644
--- a/epan/dissectors/packet-pdc.c
+++ b/epan/dissectors/packet-pdc.c
@@ -436,7 +436,7 @@ static guint get_pdc_message_len(packet_info *pinfo _U_, tvbuff_t *tvb,
/* top level call to recombine split tcp packets */
-static void tcp_dissect_pdc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int tcp_dissect_pdc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint8 mpdu_type;
guint8 minimum_bytes;
@@ -470,6 +470,7 @@ static void tcp_dissect_pdc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
break;
}
tcp_dissect_pdus(tvb, pinfo, tree, TRUE, minimum_bytes, get_pdc_message_len, dissect_pdc, NULL);
+ return tvb_captured_length(tvb);
}
void proto_register_pdc(void)
@@ -596,7 +597,7 @@ void proto_reg_handoff_pdc(void)
if (! initialized)
{
asterix_handle = find_dissector("asterix");
- pdc_tcp_handle = create_dissector_handle(tcp_dissect_pdc, proto_pdc);
+ pdc_tcp_handle = new_create_dissector_handle(tcp_dissect_pdc, proto_pdc);
dissector_add_for_decode_as("tcp.port", pdc_tcp_handle);
initialized = TRUE;
}
diff --git a/epan/dissectors/packet-pflog.c b/epan/dissectors/packet-pflog.c
index 2e699a0bce..242ec3e2f8 100644
--- a/epan/dissectors/packet-pflog.c
+++ b/epan/dissectors/packet-pflog.c
@@ -158,8 +158,8 @@ static const value_string pflog_dir_vals[] = {
{ 0, NULL }
};
-static void
-dissect_pflog(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_pflog(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
tvbuff_t *next_tvb;
proto_tree *pflog_tree;
@@ -307,6 +307,7 @@ dissect_pflog(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
val_to_str(action, pflog_action_vals, "unknown (%u)"),
ifname,
rulenr);
+ return tvb_captured_length(tvb);
}
void
@@ -417,7 +418,7 @@ proto_reg_handoff_pflog(void)
ipv6_handle = find_dissector("ipv6");
data_handle = find_dissector("data");
- pflog_handle = create_dissector_handle(dissect_pflog, proto_pflog);
+ pflog_handle = new_create_dissector_handle(dissect_pflog, proto_pflog);
dissector_add_uint("wtap_encap", WTAP_ENCAP_PFLOG, pflog_handle);
}
diff --git a/epan/dissectors/packet-pim.c b/epan/dissectors/packet-pim.c
index bf5617e012..1c8152cb09 100644
--- a/epan/dissectors/packet-pim.c
+++ b/epan/dissectors/packet-pim.c
@@ -799,8 +799,8 @@ dissect_pim_addr(proto_tree* tree, tvbuff_t *tvb, int offset, enum pimv2_addrtyp
* (when PIM is run over IPv6, the rules for computing the PIM checksum
* from the draft in question, not from RFC 2362, should be used).
*/
-static void
-dissect_pim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
+static int
+dissect_pim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) {
int offset = 0;
guint8 pim_typever;
guint8 pim_bidir_subtype = 0;
@@ -1411,7 +1411,8 @@ dissect_pim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
default:
break;
}
-done:;
+done:
+ return tvb_captured_length(tvb);
}
void
@@ -1861,7 +1862,7 @@ proto_reg_handoff_pim(void)
{
dissector_handle_t pim_handle, pimv1_handle;
- pim_handle = create_dissector_handle(dissect_pim, proto_pim);
+ pim_handle = new_create_dissector_handle(dissect_pim, proto_pim);
dissector_add_uint("ip.proto", IP_PROTO_PIM, pim_handle);
pimv1_handle = new_create_dissector_handle(dissect_pimv1, proto_pim);
diff --git a/epan/dissectors/packet-pktc.c b/epan/dissectors/packet-pktc.c
index 93a7d8905b..e6ed4064b4 100644
--- a/epan/dissectors/packet-pktc.c
+++ b/epan/dissectors/packet-pktc.c
@@ -547,8 +547,8 @@ static kerberos_callbacks cb[] = {
{ 0, NULL }
};
-static void
-dissect_pktc_mtafqdn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_pktc_mtafqdn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
int offset=0;
proto_tree *pktc_mtafqdn_tree;
@@ -572,11 +572,12 @@ dissect_pktc_mtafqdn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += dissect_kerberos_main(pktc_mtafqdn_tvb, pinfo, pktc_mtafqdn_tree, FALSE, cb);
proto_item_set_len(item, offset);
+ return tvb_captured_length(tvb);
}
-static void
-dissect_pktc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_pktc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint8 kmmid, doi, version;
int offset=0;
@@ -634,6 +635,7 @@ dissect_pktc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
};
proto_item_set_len(item, offset);
+ return tvb_captured_length(tvb);
}
void
@@ -737,7 +739,7 @@ proto_reg_handoff_pktc(void)
{
dissector_handle_t pktc_handle;
- pktc_handle = create_dissector_handle(dissect_pktc, proto_pktc);
+ pktc_handle = new_create_dissector_handle(dissect_pktc, proto_pktc);
dissector_add_uint("udp.port", PKTC_PORT, pktc_handle);
}
@@ -797,7 +799,7 @@ proto_reg_handoff_pktc_mtafqdn(void)
{
dissector_handle_t pktc_mtafqdn_handle;
- pktc_mtafqdn_handle = create_dissector_handle(dissect_pktc_mtafqdn, proto_pktc_mtafqdn);
+ pktc_mtafqdn_handle = new_create_dissector_handle(dissect_pktc_mtafqdn, proto_pktc_mtafqdn);
dissector_add_uint("udp.port", PKTC_MTAFQDN_PORT, pktc_mtafqdn_handle);
}
diff --git a/epan/dissectors/packet-ppp.c b/epan/dissectors/packet-ppp.c
index dccaff23d1..882e31ebb0 100644
--- a/epan/dissectors/packet-ppp.c
+++ b/epan/dissectors/packet-ppp.c
@@ -1069,7 +1069,6 @@ static void dissect_lcp_multilink_hdr_fmt_opt(const ip_tcp_opt *optp,
static void dissect_lcp_internationalization_opt(const ip_tcp_opt *optp,
tvbuff_t *tvb, int offset, guint length, packet_info *pinfo _U_,
proto_tree *tree, void *data _U_);
-static void dissect_mp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
static const ip_tcp_opt lcp_opts[] = {
{CI_VENDORSPECIFIC, "Vendor Specific", &ett_lcp_vendor_opt,
@@ -1614,8 +1613,6 @@ static const value_string pap_vals[] = {
{0, NULL}
};
-static void dissect_pap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
-
#define CHAP_CHAL 1 /* CHAP Challenge */
#define CHAP_RESP 2 /* CHAP Response */
#define CHAP_SUCC 3 /* CHAP Success */
@@ -1629,8 +1626,6 @@ static const value_string chap_vals[] = {
{0, NULL}
};
-static void dissect_chap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
-
static const value_string pppmuxcp_vals[] = {
{CONFREQ, "Configuration Request"},
{CONFACK, "Configuration Ack"},
@@ -3994,15 +3989,16 @@ dissect_lcp_options(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d
/*
* RFC's 1661, 2153 and 1570.
*/
-static void
-dissect_lcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_lcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
dissect_cp(tvb, proto_lcp, ett_lcp, lcp_vals, ett_lcp_options, lcp_opts,
N_LCP_OPTS, pinfo, tree);
+ return tvb_captured_length(tvb);
}
-static void
-dissect_vsncp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_vsncp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *ti;
proto_tree *fh_tree = NULL;
@@ -4049,10 +4045,11 @@ dissect_vsncp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* TODO? */
break;
}
+ return tvb_captured_length(tvb);
}
-static void
-dissect_vsnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_vsnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *vsnp_item = NULL;
proto_tree *vsnp_tree = NULL;
@@ -4076,16 +4073,18 @@ dissect_vsnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
val_to_str_ext_const(PPP_IP, &ppp_vals_ext, "Unknown"), PPP_IP);
call_dissector(data_handle, next_tvb, pinfo, tree);
}
+ return tvb_captured_length(tvb);
}
/*
* RFC 1332.
*/
-static void
-dissect_ipcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_ipcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
dissect_cp(tvb, proto_ipcp, ett_ipcp, cp_vals, ett_ipcp_options, ipcp_opts,
N_IPCP_OPTS, pinfo, tree);
+ return tvb_captured_length(tvb);
}
/*
@@ -4113,8 +4112,8 @@ static const value_string bcp_mac_type_vals[] = {
{0, NULL}
};
-static void
-dissect_bcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_bcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *ti;
proto_tree *bcp_tree;
@@ -4204,26 +4203,29 @@ dissect_bcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
}
+ return tvb_captured_length(tvb);
}
/*
* RFC 1377.
*/
-static void
-dissect_osinlcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_osinlcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
dissect_cp(tvb, proto_osinlcp, ett_osinlcp, cp_vals, ett_osinlcp_options,
osinlcp_opts, N_OSINLCP_OPTS, pinfo, tree);
+ return tvb_captured_length(tvb);
}
/*
* RFC 1962.
*/
-static void
-dissect_ccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_ccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
dissect_cp(tvb, proto_ccp, ett_ccp, ccp_vals, ett_ccp_options, ccp_opts,
N_CCP_OPTS, pinfo, tree);
+ return tvb_captured_length(tvb);
}
/*
@@ -4231,25 +4233,27 @@ dissect_ccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
*
* http://www.linet.gr.jp/~manabe/PPxP/doc/Standards/draft-gidwani-ppp-callback-cp-00.txt
*/
-static void
-dissect_cbcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_cbcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
dissect_cp(tvb, proto_cbcp, ett_cbcp, cbcp_vals, ett_cbcp_options,
cbcp_opts, N_CBCP_OPTS, pinfo, tree);
+ return tvb_captured_length(tvb);
}
/*
* RFC 2125 (BACP and BAP).
*/
-static void
-dissect_bacp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_bacp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
dissect_cp(tvb, proto_bacp, ett_bacp, cp_vals, ett_bacp_options, bacp_opts,
N_BACP_OPTS, pinfo, tree);
+ return tvb_captured_length(tvb);
}
-static void
-dissect_bap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_bap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *ti;
proto_tree *fh_tree = NULL;
@@ -4287,11 +4291,12 @@ dissect_bap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dissect_ip_tcp_options(tvb, offset, length, bap_opts, N_BAP_OPTS, -1, &PPP_OPT_TYPES,
&ei_ppp_opt_len_invalid, pinfo, field_tree, NULL, NULL);
}
+ return tvb_captured_length(tvb);
}
#if 0 /* TODO? */
-static void
-dissect_comp_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_comp_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *ti;
proto_tree *comp_data_tree;
@@ -4303,34 +4308,37 @@ dissect_comp_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ti = proto_tree_add_item(tree, proto_comp_data, tvb, 0, -1, ENC_NA);
comp_data_tree = proto_item_add_subtree(ti, ett_comp_data);
}
+ return tvb_captured_length(tvb);
}
#else
-static void
-dissect_comp_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_comp_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
col_set_str(pinfo->cinfo, COL_PROTOCOL, "PPP Comp");
col_set_str(pinfo->cinfo, COL_INFO, "Compressed data");
proto_tree_add_item(tree, proto_comp_data, tvb, 0, -1, ENC_NA);
+ return tvb_captured_length(tvb);
}
#endif
/*
* RFC 3153 (both PPPMuxCP and PPPMux).
*/
-static void
-dissect_pppmuxcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_pppmuxcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
dissect_cp(tvb, proto_pppmuxcp, ett_pppmuxcp, pppmuxcp_vals,
ett_pppmuxcp_options, pppmuxcp_opts, N_PPPMUXCP_OPTS,pinfo, tree);
+ return tvb_captured_length(tvb);
}
#define PPPMUX_FLAGS_MASK 0xc0
#define PPPMUX_PFF_BIT_SET 0x80
#define PPPMUX_LXT_BIT_SET 0x40
-static void
-dissect_pppmux(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_pppmux(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *mux_tree, *hdr_tree, *sub_tree;
proto_tree *info_tree;
@@ -4418,6 +4426,7 @@ dissect_pppmux(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += length;
length_remaining -= length;
}
+ return tvb_captured_length(tvb);
}
/*
@@ -4558,8 +4567,8 @@ dissect_iphc_crtp_fh(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/*
* 0x2067 Packets: Compressed UDP with 16-bit Context Identifier
*/
-static void
-dissect_iphc_crtp_cudp16(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_iphc_crtp_cudp16(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *cudp_tree;
proto_item *ti = NULL;
@@ -4590,13 +4599,14 @@ dissect_iphc_crtp_cudp16(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(cudp_tree, hf_iphc_crtp_data, tvb, offset, length, ENC_NA);
}
+ return tvb_captured_length(tvb);
}
/*
* 0x67 Packets: Compressed UDP with 8-bit Context Identifier
*/
-static void
-dissect_iphc_crtp_cudp8(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_iphc_crtp_cudp8(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *cudp_tree;
proto_item *ti = NULL;
@@ -4627,14 +4637,15 @@ dissect_iphc_crtp_cudp8(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(cudp_tree, hf_iphc_crtp_data, tvb, offset, length, ENC_NA);
}
+ return tvb_captured_length(tvb);
}
/*
* 0x2065 Packets: Context State
*/
-static void
-dissect_iphc_crtp_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_iphc_crtp_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *cs_tree;
proto_item *ti = NULL;
@@ -4670,8 +4681,6 @@ dissect_iphc_crtp_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
length = 4 * cnt;
}
- tvb_ensure_bytes_exist(tvb, offset, length);
-
while (offset < length) {
proto_tree_add_item(cs_tree, hf, tvb, offset, cid_size,
ENC_BIG_ENDIAN);
@@ -4686,28 +4695,31 @@ dissect_iphc_crtp_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
++offset;
}
}
+ return tvb_captured_length(tvb);
}
/*
* RFC 3032.
*/
-static void
-dissect_mplscp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_mplscp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
dissect_cp(tvb, proto_mplscp, ett_mplscp, cp_vals, ett_mplscp_options,
NULL, 0, pinfo, tree);
+ return tvb_captured_length(tvb);
}
/*
* Cisco Discovery Protocol Control Protocol.
* XXX - where is this documented?
*/
-static void
-dissect_cdpcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_cdpcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
dissect_cp(tvb, proto_cdpcp, ett_cdpcp, cp_vals, ett_cdpcp_options, NULL,
0, pinfo, tree);
+ return tvb_captured_length(tvb);
}
static gboolean mp_short_seqno = FALSE; /* Default to long sequence numbers */
@@ -4730,8 +4742,8 @@ static const value_string mp_frag_vals[] = {
negotiated down to two using LCP. We currently have a preference
to select short headers. - gcc & gh
*/
-static void
-dissect_mp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_mp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *mp_tree;
proto_item *ti;
@@ -4771,6 +4783,7 @@ dissect_mp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
next_tvb = tvb_new_subset_remaining(tvb, hdrlen);
dissect_ppp(next_tvb, pinfo, tree, NULL);
}
+ return tvb_captured_length(tvb);
}
/*
@@ -5120,8 +5133,8 @@ proto_reg_handoff_ppp_raw_hdlc(void)
/*
* Handles PAP just as a protocol field
*/
-static void
-dissect_pap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_pap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *ti, *data_ti;
proto_tree *fh_tree, *data_tree = NULL;
@@ -5200,6 +5213,7 @@ dissect_pap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ENC_NA);
break;
}
+ return tvb_captured_length(tvb);
}
/*
@@ -5330,11 +5344,12 @@ dissect_chap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/*
* RFC 2472.
*/
-static void
-dissect_ipv6cp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_ipv6cp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
dissect_cp(tvb, proto_ipv6cp, ett_ipv6cp, cp_vals, ett_ipv6cp_options,
ipv6cp_opts, N_IPV6CP_OPTS, pinfo, tree);
+ return tvb_captured_length(tvb);
}
static void
@@ -5518,7 +5533,7 @@ proto_reg_handoff_mp(void)
{
dissector_handle_t mp_handle;
- mp_handle = create_dissector_handle(dissect_mp, proto_mp);
+ mp_handle = new_create_dissector_handle(dissect_mp, proto_mp);
dissector_add_uint("ppp.protocol", PPP_MP, mp_handle);
}
@@ -5812,7 +5827,7 @@ proto_reg_handoff_lcp(void)
{
dissector_handle_t lcp_handle;
- lcp_handle = create_dissector_handle(dissect_lcp, proto_lcp);
+ lcp_handle = new_create_dissector_handle(dissect_lcp, proto_lcp);
dissector_add_uint("ppp.protocol", PPP_LCP, lcp_handle);
/*
@@ -5879,7 +5894,7 @@ proto_reg_handoff_vsncp(void)
{
dissector_handle_t vsncp_handle;
- vsncp_handle = create_dissector_handle(dissect_vsncp, proto_vsncp);
+ vsncp_handle = new_create_dissector_handle(dissect_vsncp, proto_vsncp);
dissector_add_uint("ppp.protocol", PPP_VSNCP, vsncp_handle);
}
@@ -5907,7 +5922,7 @@ proto_reg_handoff_vsnp(void)
{
dissector_handle_t vsnp_handle;
- vsnp_handle = create_dissector_handle(dissect_vsnp, proto_vsnp);
+ vsnp_handle = new_create_dissector_handle(dissect_vsnp, proto_vsnp);
dissector_add_uint("ppp.protocol", PPP_VSNP, vsnp_handle);
}
@@ -6028,7 +6043,7 @@ proto_reg_handoff_ipcp(void)
{
dissector_handle_t ipcp_handle;
- ipcp_handle = create_dissector_handle(dissect_ipcp, proto_ipcp);
+ ipcp_handle = new_create_dissector_handle(dissect_ipcp, proto_ipcp);
dissector_add_uint("ppp.protocol", PPP_IPCP, ipcp_handle);
/*
@@ -6116,7 +6131,7 @@ proto_reg_handoff_bcp(void)
eth_withfcs_handle = find_dissector("eth_withfcs");
eth_withoutfcs_handle = find_dissector("eth_withoutfcs");
- bcp_handle = create_dissector_handle(dissect_bcp, proto_bcp);
+ bcp_handle = new_create_dissector_handle(dissect_bcp, proto_bcp);
dissector_add_uint("ppp.protocol", PPP_BCP, bcp_handle);
}
@@ -6125,7 +6140,7 @@ proto_reg_handoff_osinlcp(void)
{
dissector_handle_t osinlcp_handle;
- osinlcp_handle = create_dissector_handle(dissect_osinlcp, proto_osinlcp);
+ osinlcp_handle = new_create_dissector_handle(dissect_osinlcp, proto_osinlcp);
dissector_add_uint("ppp.protocol", PPP_OSINLCP, osinlcp_handle);
/*
@@ -6281,7 +6296,7 @@ proto_reg_handoff_ccp(void)
{
dissector_handle_t ccp_handle;
- ccp_handle = create_dissector_handle(dissect_ccp, proto_ccp);
+ ccp_handle = new_create_dissector_handle(dissect_ccp, proto_ccp);
dissector_add_uint("ppp.protocol", PPP_CCP, ccp_handle);
/*
@@ -6328,7 +6343,7 @@ proto_reg_handoff_cbcp(void)
{
dissector_handle_t cbcp_handle;
- cbcp_handle = create_dissector_handle(dissect_cbcp, proto_cbcp);
+ cbcp_handle = new_create_dissector_handle(dissect_cbcp, proto_cbcp);
dissector_add_uint("ppp.protocol", PPP_CBCP, cbcp_handle);
/*
@@ -6365,7 +6380,7 @@ proto_reg_handoff_bacp(void)
{
dissector_handle_t bacp_handle;
- bacp_handle = create_dissector_handle(dissect_bacp, proto_bacp);
+ bacp_handle = new_create_dissector_handle(dissect_bacp, proto_bacp);
dissector_add_uint("ppp.protocol", PPP_BACP, bacp_handle);
/*
@@ -6423,7 +6438,7 @@ proto_reg_handoff_bap(void)
{
dissector_handle_t bap_handle;
- bap_handle = create_dissector_handle(dissect_bap, proto_bap);
+ bap_handle = new_create_dissector_handle(dissect_bap, proto_bap);
dissector_add_uint("ppp.protocol", PPP_BAP, bap_handle);
/*
@@ -6454,7 +6469,7 @@ proto_reg_handoff_comp_data(void)
{
dissector_handle_t comp_data_handle;
- comp_data_handle = create_dissector_handle(dissect_comp_data,
+ comp_data_handle = new_create_dissector_handle(dissect_comp_data,
proto_comp_data);
dissector_add_uint("ppp.protocol", PPP_COMP, comp_data_handle);
@@ -6533,7 +6548,7 @@ proto_reg_handoff_pap(void)
{
dissector_handle_t pap_handle;
- pap_handle = create_dissector_handle(dissect_pap, proto_pap);
+ pap_handle = new_create_dissector_handle(dissect_pap, proto_pap);
dissector_add_uint("ppp.protocol", PPP_PAP, pap_handle);
/*
@@ -6644,7 +6659,7 @@ proto_reg_handoff_pppmuxcp(void)
{
dissector_handle_t muxcp_handle;
- muxcp_handle = create_dissector_handle(dissect_pppmuxcp, proto_pppmuxcp);
+ muxcp_handle = new_create_dissector_handle(dissect_pppmuxcp, proto_pppmuxcp);
dissector_add_uint("ppp.protocol", PPP_MUXCP, muxcp_handle);
/*
@@ -6684,7 +6699,7 @@ proto_reg_handoff_pppmux(void)
{
dissector_handle_t pppmux_handle;
- pppmux_handle = create_dissector_handle(dissect_pppmux, proto_pppmux);
+ pppmux_handle = new_create_dissector_handle(dissect_pppmux, proto_pppmux);
dissector_add_uint("ppp.protocol", PPP_MUX, pppmux_handle);
/*
@@ -6712,7 +6727,7 @@ proto_reg_handoff_mplscp(void)
{
dissector_handle_t mplscp_handle;
- mplscp_handle = create_dissector_handle(dissect_mplscp, proto_mplscp);
+ mplscp_handle = new_create_dissector_handle(dissect_mplscp, proto_mplscp);
dissector_add_uint("ppp.protocol", PPP_MPLSCP, mplscp_handle);
/*
@@ -6740,7 +6755,7 @@ proto_reg_handoff_cdpcp(void)
{
dissector_handle_t cdpcp_handle;
- cdpcp_handle = create_dissector_handle(dissect_cdpcp, proto_cdpcp);
+ cdpcp_handle = new_create_dissector_handle(dissect_cdpcp, proto_cdpcp);
dissector_add_uint("ppp.protocol", PPP_CDPCP, cdpcp_handle);
/*
@@ -6775,7 +6790,7 @@ proto_reg_handoff_ipv6cp(void)
{
dissector_handle_t ipv6cp_handle;
- ipv6cp_handle = create_dissector_handle(dissect_ipv6cp, proto_ipv6cp);
+ ipv6cp_handle = new_create_dissector_handle(dissect_ipv6cp, proto_ipv6cp);
dissector_add_uint("ppp.protocol", PPP_IPV6CP, ipv6cp_handle);
/*
@@ -6859,13 +6874,13 @@ proto_reg_handoff_iphc_crtp(void)
fh_handle = create_dissector_handle(dissect_iphc_crtp_fh, proto_iphc_crtp);
dissector_add_uint("ppp.protocol", PPP_RTP_FH, fh_handle);
- cudp16_handle = create_dissector_handle(dissect_iphc_crtp_cudp16, proto_iphc_crtp_cudp16);
+ cudp16_handle = new_create_dissector_handle(dissect_iphc_crtp_cudp16, proto_iphc_crtp_cudp16);
dissector_add_uint("ppp.protocol", PPP_RTP_CUDP16, cudp16_handle);
- cudp8_handle = create_dissector_handle(dissect_iphc_crtp_cudp8, proto_iphc_crtp_cudp8);
+ cudp8_handle = new_create_dissector_handle(dissect_iphc_crtp_cudp8, proto_iphc_crtp_cudp8);
dissector_add_uint("ppp.protocol", PPP_RTP_CUDP8, cudp8_handle);
- cs_handle = create_dissector_handle(dissect_iphc_crtp_cs, proto_iphc_crtp_cs);
+ cs_handle = new_create_dissector_handle(dissect_iphc_crtp_cs, proto_iphc_crtp_cs);
dissector_add_uint("ppp.protocol", PPP_RTP_CS, cs_handle);
/*
diff --git a/epan/dissectors/packet-pppoe.c b/epan/dissectors/packet-pppoe.c
index fb5956a6fb..fd50297171 100644
--- a/epan/dissectors/packet-pppoe.c
+++ b/epan/dissectors/packet-pppoe.c
@@ -681,7 +681,7 @@ dissect_pppoe_tags(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *tr
/* Discovery protocol, i.e. PPP session not yet established */
-static void dissect_pppoed(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int dissect_pppoed(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint8 pppoe_code;
guint16 reported_payload_length;
@@ -719,6 +719,7 @@ static void dissect_pppoed(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dissect_pppoe_tags(tvb, pinfo, 6, pppoe_tree, 6+reported_payload_length);
}
+ return tvb_captured_length(tvb);
}
void proto_register_pppoed(void)
@@ -1029,13 +1030,13 @@ void proto_reg_handoff_pppoed(void)
{
dissector_handle_t pppoed_handle;
- pppoed_handle = create_dissector_handle(dissect_pppoed, proto_pppoed);
+ pppoed_handle = new_create_dissector_handle(dissect_pppoed, proto_pppoed);
dissector_add_uint("ethertype", ETHERTYPE_PPPOED, pppoed_handle);
}
/* Session protocol, i.e. PPP session established */
-static void dissect_pppoes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int dissect_pppoes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint8 pppoe_code;
guint16 reported_payload_length;
@@ -1183,6 +1184,7 @@ static void dissect_pppoes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
(length - credit_offset),
(reported_length - credit_offset));
call_dissector(ppp_handle,next_tvb,pinfo,tree);
+ return tvb_captured_length(tvb);
}
void proto_register_pppoes(void)
@@ -1289,7 +1291,7 @@ void proto_register_pppoe(void)
void proto_reg_handoff_pppoes(void)
{
dissector_handle_t pppoes_handle =
- create_dissector_handle(dissect_pppoes, proto_pppoes);
+ new_create_dissector_handle(dissect_pppoes, proto_pppoes);
dissector_add_uint("ethertype", ETHERTYPE_PPPOES, pppoes_handle);
dissector_add_uint("wtap_encap", WTAP_ENCAP_PPP_ETHER, pppoes_handle);
diff --git a/epan/dissectors/packet-pptp.c b/epan/dissectors/packet-pptp.c
index 1761627117..dd2c3291fa 100644
--- a/epan/dissectors/packet-pptp.c
+++ b/epan/dissectors/packet-pptp.c
@@ -587,8 +587,8 @@ dissect_set_link(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *
proto_tree_add_item(tree, hf_pptp_receive_accm, tvb, offset, 4, ENC_BIG_ENDIAN);
}
-static void
-dissect_pptp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_pptp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *pptp_tree = NULL;
proto_item *item = NULL;
@@ -684,6 +684,7 @@ dissect_pptp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dissect_unknown(tvb, offset, pinfo, pptp_tree);
break;
}
+ return tvb_captured_length(tvb);
}
void
@@ -961,7 +962,7 @@ proto_reg_handoff_pptp(void)
{
dissector_handle_t pptp_handle;
- pptp_handle = create_dissector_handle(dissect_pptp, proto_pptp);
+ pptp_handle = new_create_dissector_handle(dissect_pptp, proto_pptp);
dissector_add_uint("tcp.port", TCP_PORT_PPTP, pptp_handle);
data_handle = find_dissector("data");
}
diff --git a/epan/dissectors/packet-ptp.c b/epan/dissectors/packet-ptp.c
index e9ced18d7a..0b416f747e 100644
--- a/epan/dissectors/packet-ptp.c
+++ b/epan/dissectors/packet-ptp.c
@@ -1566,9 +1566,6 @@ static expert_field ei_ptp_v2_msg_len_too_small = EI_INIT;
/* forward declaration of local functions for v1 and v2 */
-static void
-dissect_ptp_oE(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
-
static int
is_ptp_v1(tvbuff_t *tvb);
@@ -1588,20 +1585,23 @@ dissect_ptp_v2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean ptp
/* Code to dissect the packet */
-static void
-dissect_ptp_oE(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_ptp_oE(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
/* PTP over Ethernet only available with PTPv2 */
dissect_ptp_v2(tvb, pinfo, tree, TRUE);
+ return tvb_captured_length(tvb);
}
-static void
-dissect_ptp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_ptp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
if(is_ptp_v1(tvb))
dissect_ptp_v1(tvb, pinfo, tree);
else if(is_ptp_v2(tvb))
dissect_ptp_v2(tvb, pinfo, tree, FALSE);
+
+ return tvb_captured_length(tvb);
}
@@ -5983,8 +5983,8 @@ proto_reg_handoff_ptp(void)
dissector_handle_t ptp_handle;
dissector_handle_t ethertype_ptp_handle;
- ptp_handle = create_dissector_handle(dissect_ptp, proto_ptp);
- ethertype_ptp_handle = create_dissector_handle(dissect_ptp_oE, proto_ptp);
+ ptp_handle = new_create_dissector_handle(dissect_ptp, proto_ptp);
+ ethertype_ptp_handle = new_create_dissector_handle(dissect_ptp_oE, proto_ptp);
dissector_add_uint("udp.port", EVENT_PORT_PTP, ptp_handle);
dissector_add_uint("udp.port", GENERAL_PORT_PTP, ptp_handle);
diff --git a/epan/dissectors/packet-pw-cesopsn.c b/epan/dissectors/packet-pw-cesopsn.c
index 346b2c2a0e..f32a3fa6f9 100644
--- a/epan/dissectors/packet-pw-cesopsn.c
+++ b/epan/dissectors/packet-pw-cesopsn.c
@@ -370,10 +370,10 @@ void dissect_pw_cesopsn( tvbuff_t * tvb_original
static
-void dissect_pw_cesopsn_mpls( tvbuff_t * tvb_original, packet_info * pinfo, proto_tree * tree)
+int dissect_pw_cesopsn_mpls( tvbuff_t * tvb_original, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
dissect_pw_cesopsn(tvb_original,pinfo,tree,PWC_DEMUX_MPLS);
- return;
+ return tvb_captured_length(tvb_original);
}
@@ -456,7 +456,7 @@ void proto_reg_handoff_pw_cesopsn(void)
pw_padding_handle = find_dissector("pw_padding");
/* For Decode As */
- pw_cesopsn_mpls_handle = create_dissector_handle( dissect_pw_cesopsn_mpls, proto );
+ pw_cesopsn_mpls_handle = new_create_dissector_handle( dissect_pw_cesopsn_mpls, proto );
dissector_add_for_decode_as("mpls.label", pw_cesopsn_mpls_handle);
dissector_add_for_decode_as("udp.port", find_dissector("pw_cesopsn_udp"));
diff --git a/epan/dissectors/packet-pw-eth.c b/epan/dissectors/packet-pw-eth.c
index ec812c1495..82b7a06667 100644
--- a/epan/dissectors/packet-pw-eth.c
+++ b/epan/dissectors/packet-pw-eth.c
@@ -89,8 +89,8 @@ dissect_pw_eth_cw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat
return tvb_captured_length(tvb);
}
-static void
-dissect_pw_eth_nocw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_pw_eth_nocw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
tvbuff_t *next_tvb;
@@ -101,9 +101,9 @@ dissect_pw_eth_nocw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
next_tvb = tvb_new_subset_remaining(tvb, 0);
- {
- call_dissector(eth_withoutfcs_handle, next_tvb, pinfo, tree);
- }
+ call_dissector(eth_withoutfcs_handle, next_tvb, pinfo, tree);
+
+ return tvb_captured_length(tvb);
}
/*
@@ -206,7 +206,7 @@ proto_reg_handoff_pw_eth(void)
pw_eth_handle_cw = new_create_dissector_handle( dissect_pw_eth_cw, proto_pw_eth_cw );
dissector_add_for_decode_as("mpls.label", pw_eth_handle_cw);
- pw_eth_handle_nocw = create_dissector_handle( dissect_pw_eth_nocw, proto_pw_eth_nocw );
+ pw_eth_handle_nocw = new_create_dissector_handle( dissect_pw_eth_nocw, proto_pw_eth_nocw );
dissector_add_for_decode_as("mpls.label", pw_eth_handle_nocw);
pw_eth_handle_heuristic = find_dissector("pw_eth_heuristic");
diff --git a/epan/dissectors/packet-pw-hdlc.c b/epan/dissectors/packet-pw-hdlc.c
index 20c9d9e723..d4a347ca91 100644
--- a/epan/dissectors/packet-pw-hdlc.c
+++ b/epan/dissectors/packet-pw-hdlc.c
@@ -76,9 +76,9 @@ static const value_string pw_hdlc_modifier_vals[] = {
{0, NULL }
};
-static void dissect_pw_hdlc_nocw_fr( tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree )
+static int dissect_pw_hdlc_nocw_fr( tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_ )
{
- call_dissector( fr_handle, tvb, pinfo, tree );
+ return call_dissector( fr_handle, tvb, pinfo, tree );
}
@@ -224,7 +224,7 @@ void proto_reg_handoff_pw_hdlc(void)
{
dissector_handle_t pw_fr_handle, pw_ppp_handle;
- pw_fr_handle = create_dissector_handle( dissect_pw_hdlc_nocw_fr, proto_pw_hdlc_nocw_fr );
+ pw_fr_handle = new_create_dissector_handle( dissect_pw_hdlc_nocw_fr, proto_pw_hdlc_nocw_fr );
dissector_add_for_decode_as( "mpls.label", pw_fr_handle );
pw_ppp_handle = new_create_dissector_handle( dissect_pw_hdlc_nocw_hdlc_ppp, proto_pw_hdlc_nocw_hdlc_ppp );
diff --git a/epan/dissectors/packet-pw-oam.c b/epan/dissectors/packet-pw-oam.c
index a6c21f8dcb..a7810e6966 100644
--- a/epan/dissectors/packet-pw-oam.c
+++ b/epan/dissectors/packet-pw-oam.c
@@ -87,8 +87,8 @@ dissect_pw_status_tlv (tvbuff_t *tvb, proto_tree *tree, gint offset)
}
/* Dissector for PW OAM protocol: RFC 6478 */
-static void
-dissect_pw_oam(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_pw_oam(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *ti = NULL, *ti_flags = NULL;
proto_tree *pw_oam_tree = NULL, *pw_oam_flags = NULL;
@@ -100,7 +100,7 @@ dissect_pw_oam(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_clear(pinfo->cinfo, COL_INFO);
if (!tree)
- return;
+ return tvb_captured_length(tvb);
ti = proto_tree_add_item(tree, proto_pw_oam, tvb, 0, -1, ENC_NA);
@@ -139,7 +139,7 @@ dissect_pw_oam(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
break;
}
- return;
+ return tvb_captured_length(tvb);
}
void
@@ -206,7 +206,7 @@ proto_reg_handoff_pw_oam(void)
{
dissector_handle_t pw_oam_handle;
- pw_oam_handle = create_dissector_handle( dissect_pw_oam, proto_pw_oam );
+ pw_oam_handle = new_create_dissector_handle( dissect_pw_oam, proto_pw_oam );
dissector_add_uint("pwach.channel_type", 0x0027, pw_oam_handle); /* KM: MPLSTP PW-OAM, RFC 6478 */
}
diff --git a/epan/dissectors/packet-pw-satop.c b/epan/dissectors/packet-pw-satop.c
index 9c88cc1ef2..726367df5d 100644
--- a/epan/dissectors/packet-pw-satop.c
+++ b/epan/dissectors/packet-pw-satop.c
@@ -383,10 +383,10 @@ void dissect_pw_satop(tvbuff_t * tvb_original
static
-void dissect_pw_satop_mpls( tvbuff_t * tvb_original, packet_info * pinfo, proto_tree * tree)
+int dissect_pw_satop_mpls( tvbuff_t * tvb_original, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
dissect_pw_satop(tvb_original,pinfo,tree,PWC_DEMUX_MPLS);
- return;
+ return tvb_captured_length(tvb_original);
}
@@ -472,7 +472,7 @@ void proto_reg_handoff_pw_satop(void)
pw_padding_handle = find_dissector("pw_padding");
/* For Decode As */
- pw_satop_mpls_handle = create_dissector_handle( dissect_pw_satop_mpls, proto );
+ pw_satop_mpls_handle = new_create_dissector_handle( dissect_pw_satop_mpls, proto );
dissector_add_for_decode_as("mpls.label", pw_satop_mpls_handle);
dissector_add_for_decode_as("udp.port", find_dissector("pw_satop_udp"));
diff --git a/epan/dissectors/packet-q931.c b/epan/dissectors/packet-q931.c
index 9d8e751649..fd5e40842b 100644
--- a/epan/dissectors/packet-q931.c
+++ b/epan/dissectors/packet-q931.c
@@ -3153,10 +3153,11 @@ dissect_q931_tpkt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat
return tvb_captured_length(tvb);
}
-static void
-dissect_q931_tpkt_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_q931_tpkt_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
dissect_q931_pdu(tvb, pinfo, tree, TRUE);
+ return tvb_captured_length(tvb);
}
static int
@@ -3967,7 +3968,7 @@ proto_register_q931(void)
q931_handle = new_register_dissector("q931", dissect_q931, proto_q931);
q931_tpkt_handle = new_register_dissector("q931.tpkt", dissect_q931_tpkt, proto_q931);
- q931_tpkt_pdu_handle = create_dissector_handle(dissect_q931_tpkt_pdu,
+ q931_tpkt_pdu_handle = new_create_dissector_handle(dissect_q931_tpkt_pdu,
proto_q931);
q931_over_ip_handle = new_register_dissector("q931.over_ip", dissect_q931_over_ip, proto_q931);
new_register_dissector("q931.ie", dissect_q931_ie_cs0, proto_q931);
diff --git a/epan/dissectors/packet-quake.c b/epan/dissectors/packet-quake.c
index cb06a87f66..4784675ab8 100644
--- a/epan/dissectors/packet-quake.c
+++ b/epan/dissectors/packet-quake.c
@@ -147,11 +147,6 @@ static const value_string names_colors[] = {
{ 0, NULL }
};
-
-static void dissect_quake(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
-
-
-
static void
dissect_quake_CCREQ_CONNECT
(tvbuff_t *tvb, proto_tree *tree)
@@ -421,8 +416,8 @@ dissect_quake_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
-static void
-dissect_quake(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_quake(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *quake_tree = NULL;
guint16 flags;
@@ -462,7 +457,7 @@ dissect_quake(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (flags == NETFLAG_CTL) {
next_tvb = tvb_new_subset_remaining(tvb, 4);
dissect_quake_control(next_tvb, pinfo, quake_tree);
- return;
+ return tvb_captured_length(tvb);
}
sequence = tvb_get_ntohl(tvb, 4);
@@ -472,6 +467,7 @@ dissect_quake(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
next_tvb = tvb_new_subset_remaining(tvb, 8);
call_dissector(data_handle,next_tvb, pinfo, quake_tree);
+ return tvb_captured_length(tvb);
}
@@ -640,7 +636,7 @@ proto_reg_handoff_quake(void)
static guint ServerPort;
if (!Initialized) {
- quake_handle = create_dissector_handle(dissect_quake, proto_quake);
+ quake_handle = new_create_dissector_handle(dissect_quake, proto_quake);
data_handle = find_dissector("data");
Initialized=TRUE;
} else {
diff --git a/epan/dissectors/packet-quake2.c b/epan/dissectors/packet-quake2.c
index e6f02c2083..028054b478 100644
--- a/epan/dissectors/packet-quake2.c
+++ b/epan/dissectors/packet-quake2.c
@@ -641,8 +641,8 @@ dissect_quake2_GamePacket(tvbuff_t *tvb, packet_info *pinfo,
}
-static void
-dissect_quake2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_quake2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *quake2_tree = NULL;
int direction;
@@ -685,6 +685,7 @@ dissect_quake2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dissect_quake2_GamePacket(
tvb, pinfo, quake2_tree, direction);
}
+ return tvb_captured_length(tvb);
}
@@ -853,7 +854,7 @@ proto_reg_handoff_quake2(void)
static guint ServerPort;
if (!Initialized) {
- quake2_handle = create_dissector_handle(dissect_quake2,
+ quake2_handle = new_create_dissector_handle(dissect_quake2,
proto_quake2);
data_handle = find_dissector("data");
Initialized=TRUE;
diff --git a/epan/dissectors/packet-quake3.c b/epan/dissectors/packet-quake3.c
index f1c7838bdb..115f718827 100644
--- a/epan/dissectors/packet-quake3.c
+++ b/epan/dissectors/packet-quake3.c
@@ -432,8 +432,8 @@ dissect_quake3_GamePacket(tvbuff_t *tvb, packet_info *pinfo,
}
-static void
-dissect_quake3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_quake3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *quake3_tree = NULL;
proto_item *dir_item = NULL;
@@ -483,6 +483,7 @@ dissect_quake3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_append_str(pinfo->cinfo, COL_INFO, val_to_str(direction,
names_direction, "%u"));
+ return tvb_captured_length(tvb);
}
@@ -587,7 +588,7 @@ proto_reg_handoff_quake3(void)
int i;
if (!initialized) {
- quake3_handle = create_dissector_handle(dissect_quake3,
+ quake3_handle = new_create_dissector_handle(dissect_quake3,
proto_quake3);
data_handle = find_dissector("data");
initialized=TRUE;
diff --git a/epan/dissectors/packet-quakeworld.c b/epan/dissectors/packet-quakeworld.c
index b3f158e1b0..c7335aac1d 100644
--- a/epan/dissectors/packet-quakeworld.c
+++ b/epan/dissectors/packet-quakeworld.c
@@ -640,8 +640,8 @@ dissect_quakeworld_GamePacket(tvbuff_t *tvb, packet_info *pinfo,
}
-static void
-dissect_quakeworld(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_quakeworld(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *quakeworld_tree = NULL;
int direction;
@@ -684,6 +684,7 @@ dissect_quakeworld(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dissect_quakeworld_GamePacket(
tvb, pinfo, quakeworld_tree, direction);
}
+ return tvb_captured_length(tvb);
}
@@ -820,7 +821,7 @@ proto_reg_handoff_quakeworld(void)
static guint ServerPort;
if (!Initialized) {
- quakeworld_handle = create_dissector_handle(dissect_quakeworld,
+ quakeworld_handle = new_create_dissector_handle(dissect_quakeworld,
proto_quakeworld);
data_handle = find_dissector("data");
Initialized=TRUE;
diff --git a/epan/dissectors/packet-raw.c b/epan/dissectors/packet-raw.c
index e907363ddc..7ba983c76e 100644
--- a/epan/dissectors/packet-raw.c
+++ b/epan/dissectors/packet-raw.c
@@ -94,8 +94,8 @@ capture_raw(const guchar *pd, int len, packet_counts *ld)
}
}
-static void
-dissect_raw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_raw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
tvbuff_t *next_tvb;
@@ -160,6 +160,7 @@ dissect_raw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
break;
}
}
+ return tvb_captured_length(tvb);
}
void
@@ -186,7 +187,7 @@ proto_reg_handoff_raw(void)
ipv6_handle = find_dissector("ipv6");
data_handle = find_dissector("data");
ppp_hdlc_handle = find_dissector("ppp_hdlc");
- raw_handle = create_dissector_handle(dissect_raw, proto_raw);
+ raw_handle = new_create_dissector_handle(dissect_raw, proto_raw);
dissector_add_uint("wtap_encap", WTAP_ENCAP_RAW_IP, raw_handle);
}
diff --git a/epan/dissectors/packet-redback.c b/epan/dissectors/packet-redback.c
index 904fb7865c..2e3ced3179 100644
--- a/epan/dissectors/packet-redback.c
+++ b/epan/dissectors/packet-redback.c
@@ -82,8 +82,8 @@ static header_field_info hfi_redback_unknown REDBACK_HFI_INIT =
static expert_field ei_redback_protocol = EI_INIT;
-static void
-dissect_redback(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_redback(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint16 l3off, dataoff, proto;
proto_item *ti, *protocol_item;
@@ -189,7 +189,7 @@ dissect_redback(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
expert_add_info(pinfo, protocol_item, &ei_redback_protocol);
break;
}
- return;
+ return tvb_captured_length(tvb);
}
void
@@ -228,7 +228,7 @@ proto_register_redback(void)
expert_redback = expert_register_protocol(proto_redback);
expert_register_field_array(expert_redback, ei, array_length(ei));
- redback_handle = create_dissector_handle(dissect_redback, proto_redback);
+ redback_handle = new_create_dissector_handle(dissect_redback, proto_redback);
}
void
diff --git a/epan/dissectors/packet-rip.c b/epan/dissectors/packet-rip.c
index e5919689f3..ddebafe185 100644
--- a/epan/dissectors/packet-rip.c
+++ b/epan/dissectors/packet-rip.c
@@ -172,8 +172,8 @@ static void dissect_ip_rip_vektor(tvbuff_t *tvb, int offset, guint8 version,
static gint dissect_rip_authentication(tvbuff_t *tvb, int offset,
proto_tree *tree);
-static void
-dissect_rip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_rip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
int offset = 0;
proto_tree *rip_tree = NULL;
@@ -195,51 +195,50 @@ dissect_rip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_add_str(pinfo->cinfo, COL_INFO,
val_to_str(command, command_vals, "Unknown command (%u)"));
- if (tree) {
- ti = proto_tree_add_item(tree, hfi_rip, tvb, 0, -1, ENC_NA);
- rip_tree = proto_item_add_subtree(ti, ett_rip);
-
- proto_tree_add_uint(rip_tree, &hfi_rip_command, tvb, 0, 1, command);
- proto_tree_add_uint(rip_tree, &hfi_rip_version, tvb, 1, 1, version);
- if (version == RIPv2 && pref_display_routing_domain == TRUE)
- proto_tree_add_uint(rip_tree, &hfi_rip_routing_domain, tvb, 2, 2,
- tvb_get_ntohs(tvb, 2));
-
- /* skip header */
- offset = RIP_HEADER_LENGTH;
-
- /* zero or more entries */
- while (tvb_reported_length_remaining(tvb, offset) > trailer_len ) {
- family = tvb_get_ntohs(tvb, offset);
- switch (family) {
- case AFVAL_UNSPEC: /* Unspecified */
- /*
- * There should be one entry in the request, and a metric
- * of infinity, meaning "show the entire routing table".
- */
- dissect_unspec_rip_vektor(tvb, offset, version, rip_tree);
- break;
- case AFVAL_IP: /* IP */
- dissect_ip_rip_vektor(tvb, offset, version, rip_tree);
- break;
- case 0xFFFF:
- if( offset == RIP_HEADER_LENGTH ) {
- trailer_len=dissect_rip_authentication(tvb, offset, rip_tree);
- is_md5_auth = TRUE;
- break;
- }
- if(is_md5_auth && tvb_reported_length_remaining(tvb, offset) == 20)
- break;
- /* Intentional fall through: auth Entry MUST be the first! */
- default:
- proto_tree_add_expert_format(rip_tree, pinfo, &ei_rip_unknown_address_family, tvb, offset,
- RIP_ENTRY_LENGTH, "Unknown address family %u", family);
- break;
+ ti = proto_tree_add_item(tree, hfi_rip, tvb, 0, -1, ENC_NA);
+ rip_tree = proto_item_add_subtree(ti, ett_rip);
+
+ proto_tree_add_uint(rip_tree, &hfi_rip_command, tvb, 0, 1, command);
+ proto_tree_add_uint(rip_tree, &hfi_rip_version, tvb, 1, 1, version);
+ if (version == RIPv2 && pref_display_routing_domain == TRUE)
+ proto_tree_add_uint(rip_tree, &hfi_rip_routing_domain, tvb, 2, 2,
+ tvb_get_ntohs(tvb, 2));
+
+ /* skip header */
+ offset = RIP_HEADER_LENGTH;
+
+ /* zero or more entries */
+ while (tvb_reported_length_remaining(tvb, offset) > trailer_len ) {
+ family = tvb_get_ntohs(tvb, offset);
+ switch (family) {
+ case AFVAL_UNSPEC: /* Unspecified */
+ /*
+ * There should be one entry in the request, and a metric
+ * of infinity, meaning "show the entire routing table".
+ */
+ dissect_unspec_rip_vektor(tvb, offset, version, rip_tree);
+ break;
+ case AFVAL_IP: /* IP */
+ dissect_ip_rip_vektor(tvb, offset, version, rip_tree);
+ break;
+ case 0xFFFF:
+ if( offset == RIP_HEADER_LENGTH ) {
+ trailer_len=dissect_rip_authentication(tvb, offset, rip_tree);
+ is_md5_auth = TRUE;
+ break;
}
-
- offset += RIP_ENTRY_LENGTH;
+ if(is_md5_auth && tvb_reported_length_remaining(tvb, offset) == 20)
+ break;
+ /* Intentional fall through: auth Entry MUST be the first! */
+ default:
+ proto_tree_add_expert_format(rip_tree, pinfo, &ei_rip_unknown_address_family, tvb, offset,
+ RIP_ENTRY_LENGTH, "Unknown address family %u", family);
+ break;
}
+
+ offset += RIP_ENTRY_LENGTH;
}
+ return tvb_captured_length(tvb);
}
static void
@@ -388,7 +387,7 @@ proto_register_rip(void)
prefs_register_bool_preference(rip_module, "display_routing_domain", "Display Routing Domain field", "Display the third and forth bytes of the RIPv2 header as the Routing Domain field (introduced in RFC 1388 [January 1993] and obsolete as of RFC 1723 [November 1994])", &pref_display_routing_domain);
- rip_handle = create_dissector_handle(dissect_rip, proto_rip);
+ rip_handle = new_create_dissector_handle(dissect_rip, proto_rip);
}
void
diff --git a/epan/dissectors/packet-ripng.c b/epan/dissectors/packet-ripng.c
index 80708c1662..f5e0c82baa 100644
--- a/epan/dissectors/packet-ripng.c
+++ b/epan/dissectors/packet-ripng.c
@@ -60,8 +60,8 @@ static const value_string cmdvals[] = {
{ 0, NULL },
};
-static void
-dissect_ripng(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
+static int
+dissect_ripng(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) {
int offset = 0;
proto_tree *ripng_tree = NULL, *rte_tree = NULL;
proto_item *ti, *rte_ti;
@@ -113,6 +113,7 @@ dissect_ripng(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
offset += 1;
}
}
+ return tvb_captured_length(tvb);
}
void
@@ -170,7 +171,7 @@ proto_reg_handoff_ripng(void)
{
dissector_handle_t ripng_handle;
- ripng_handle = create_dissector_handle(dissect_ripng, proto_ripng);
+ ripng_handle = new_create_dissector_handle(dissect_ripng, proto_ripng);
dissector_add_uint("udp.port", UDP_PORT_RIPNG, ripng_handle);
}
diff --git a/epan/dissectors/packet-rmi.c b/epan/dissectors/packet-rmi.c
index 5e1240060e..9b24601554 100644
--- a/epan/dissectors/packet-rmi.c
+++ b/epan/dissectors/packet-rmi.c
@@ -103,8 +103,8 @@ static const value_string rmi_input_message_str[] = {
{0, NULL}
};
-static void
-dissect_rmi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_rmi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *ti;
proto_tree *rmi_tree;
@@ -229,6 +229,7 @@ dissect_rmi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
break;
}
}
+ return tvb_captured_length(tvb);
}
static void
@@ -371,7 +372,7 @@ proto_reg_handoff_rmi(void)
{
dissector_handle_t rmi_handle;
- rmi_handle = create_dissector_handle(dissect_rmi, proto_rmi);
+ rmi_handle = new_create_dissector_handle(dissect_rmi, proto_rmi);
dissector_add_uint("tcp.port", TCP_PORT_RMI, rmi_handle);
}
diff --git a/epan/dissectors/packet-rsh.c b/epan/dissectors/packet-rsh.c
index 1653c77e2a..de9d08a11c 100644
--- a/epan/dissectors/packet-rsh.c
+++ b/epan/dissectors/packet-rsh.c
@@ -99,8 +99,8 @@ typedef struct {
} rsh_hash_entry_t;
-static void
-dissect_rsh(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_rsh(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
/* Set up structures needed to add the protocol subtree and manage it */
proto_item *ti;
@@ -357,6 +357,7 @@ dissect_rsh(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if(hash_info->state < WAIT_FOR_DATA){
col_set_str(pinfo->cinfo, COL_INFO, "Session Establishment");
}
+ return tvb_captured_length(tvb);
}
void
@@ -430,7 +431,7 @@ proto_reg_handoff_rsh(void)
{
dissector_handle_t rsh_handle;
- rsh_handle = create_dissector_handle(dissect_rsh, proto_rsh);
+ rsh_handle = new_create_dissector_handle(dissect_rsh, proto_rsh);
dissector_add_uint("tcp.port", RSH_PORT, rsh_handle);
}
diff --git a/epan/dissectors/packet-rsip.c b/epan/dissectors/packet-rsip.c
index 273f864eb9..7de820fa72 100644
--- a/epan/dissectors/packet-rsip.c
+++ b/epan/dissectors/packet-rsip.c
@@ -967,8 +967,8 @@ rsip_message_assign_response_rsipsec(tvbuff_t *tvb, proto_tree *rsip_tree,
return consumed;
}
-static void
-dissect_rsip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_rsip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *ti;
proto_tree *rsip_tree;
@@ -1060,6 +1060,7 @@ dissect_rsip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
break;
}
}
+ return tvb_captured_length(tvb);
}
@@ -1246,7 +1247,7 @@ proto_reg_handoff_rsip(void)
if (!initialized) {
- rsip_handle = create_dissector_handle(dissect_rsip,
+ rsip_handle = new_create_dissector_handle(dissect_rsip,
proto_rsip);
dissector_add_uint("udp.port", UDP_PORT_RSIP, rsip_handle);
dissector_add_uint("tcp.port", TCP_PORT_RSIP, rsip_handle);
diff --git a/epan/dissectors/packet-rtmpt.c b/epan/dissectors/packet-rtmpt.c
index 124f5fb403..af20f77edd 100644
--- a/epan/dissectors/packet-rtmpt.c
+++ b/epan/dissectors/packet-rtmpt.c
@@ -2314,8 +2314,8 @@ dissect_rtmpt_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat
return tvb_reported_length(tvb);
}
-static void
-dissect_rtmpt_http(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_rtmpt_http(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
conversation_t *conv;
rtmpt_conv_t *rconv;
@@ -2421,7 +2421,7 @@ dissect_rtmpt_http(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
RTMPT_DEBUG("RTMPT f=%d cdir=%d seq=%d lastackseq=%d len=%d\n", pinfo->fd->num, cdir, seq, lastackseq, remain);
if (remain < 1)
- return;
+ return offset;
if (offset > 0) {
tvbuff_t *tvbrtmp = tvb_new_subset_length(tvb, offset, remain);
@@ -2429,6 +2429,7 @@ dissect_rtmpt_http(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
} else {
dissect_rtmpt_common(tvb, pinfo, tree, rconv, cdir, seq, lastackseq);
}
+ return tvb_captured_length(tvb);
}
static gboolean
@@ -2462,8 +2463,8 @@ dissect_rtmpt_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
return FALSE;
}
-static void
-dissect_amf(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
+static int
+dissect_amf(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
{
proto_item *ti;
proto_tree *amf_tree, *headers_tree, *messages_tree;
@@ -2525,6 +2526,7 @@ dissect_amf(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
offset = dissect_rtmpt_body_command(tvb, offset, messages_tree, FALSE);
}
}
+ return tvb_captured_length(tvb);
}
void
@@ -2936,10 +2938,10 @@ proto_reg_handoff_rtmpt(void)
/* dissector_add_for_decode_as("tcp.port", rtmpt_tcp_handle); */
dissector_add_uint("tcp.port", RTMP_PORT, rtmpt_tcp_handle);
- rtmpt_http_handle = create_dissector_handle(dissect_rtmpt_http, proto_rtmpt);
+ rtmpt_http_handle = new_create_dissector_handle(dissect_rtmpt_http, proto_rtmpt);
dissector_add_string("media_type", "application/x-fcs", rtmpt_http_handle);
- amf_handle = create_dissector_handle(dissect_amf, proto_amf);
+ amf_handle = new_create_dissector_handle(dissect_amf, proto_amf);
dissector_add_string("media_type", "application/x-amf", amf_handle);
}
diff --git a/epan/dissectors/packet-rtnet.c b/epan/dissectors/packet-rtnet.c
index 86117ba63a..24bd5a84c4 100644
--- a/epan/dissectors/packet-rtnet.c
+++ b/epan/dissectors/packet-rtnet.c
@@ -548,8 +548,8 @@ dissect_rtnet_tdma(tvbuff_t *tvb, packet_info *pinfo, proto_tree *root) {
}
}
-static void
-dissect_rtmac(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
+static int
+dissect_rtmac(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) {
gint offset = 0;
guint8 ver,flags;
guint16 type;
@@ -652,10 +652,12 @@ dissect_rtmac(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
call_dissector(data_handle, next_tvb, pinfo, tree);
break;
}
+
+ return tvb_captured_length(tvb);
}
-static void
-dissect_rtcfg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
+static int
+dissect_rtcfg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) {
gint offset = 0;
proto_tree *vers_id_tree, *vers_id_item, *flags_tree, *flags_item;
guint8 vers_id;
@@ -875,6 +877,7 @@ dissect_rtcfg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
}
}
+ return tvb_captured_length(tvb);
}
void
@@ -1323,7 +1326,7 @@ void
proto_reg_handoff_rtmac(void) {
dissector_handle_t rtmac_handle;
- rtmac_handle = create_dissector_handle(dissect_rtmac, proto_rtmac);
+ rtmac_handle = new_create_dissector_handle(dissect_rtmac, proto_rtmac);
dissector_add_uint("ethertype", ETHERTYPE_RTMAC, rtmac_handle);
ethertype_table = find_dissector_table("ethertype");
}
@@ -1333,7 +1336,7 @@ proto_reg_handoff_rtcfg(void) {
dissector_handle_t rtcfg_handle;
data_handle = find_dissector("data");
- rtcfg_handle = create_dissector_handle(dissect_rtcfg, proto_rtcfg);
+ rtcfg_handle = new_create_dissector_handle(dissect_rtcfg, proto_rtcfg);
dissector_add_uint("ethertype", ETHERTYPE_RTCFG, rtcfg_handle);
}
diff --git a/epan/dissectors/packet-rudp.c b/epan/dissectors/packet-rudp.c
index 817b157d05..fadf614e43 100644
--- a/epan/dissectors/packet-rudp.c
+++ b/epan/dissectors/packet-rudp.c
@@ -83,8 +83,8 @@ static dissector_handle_t sm_handle = NULL;
static dissector_handle_t data_handle = NULL;
-static void
-dissect_rudp(tvbuff_t *tvb, packet_info *pinfo _U_ , proto_tree *tree)
+static int
+dissect_rudp(tvbuff_t *tvb, packet_info *pinfo _U_ , proto_tree *tree, void* data _U_)
{
tvbuff_t * next_tvb = NULL;
proto_tree *rudp_tree = NULL, *flags_tree;
@@ -137,6 +137,8 @@ dissect_rudp(tvbuff_t *tvb, packet_info *pinfo _U_ , proto_tree *tree)
next_tvb = tvb_new_subset_remaining(tvb, hlen);
if (tvb_captured_length(next_tvb) && sm_handle)
call_dissector(sm_handle, next_tvb, pinfo, tree);
+
+ return tvb_captured_length(tvb);
}
void
@@ -249,7 +251,7 @@ proto_reg_handoff_rudp(void) {
static guint saved_udp_port;
if (!initialized) {
- rudp_handle = create_dissector_handle(dissect_rudp, proto_rudp);
+ rudp_handle = new_create_dissector_handle(dissect_rudp, proto_rudp);
dissector_add_for_decode_as("udp.port", rudp_handle);
sm_handle = find_dissector("sm");
data_handle = find_dissector("data");
diff --git a/epan/dissectors/packet-sccpmg.c b/epan/dissectors/packet-sccpmg.c
index d888a5355a..5d2943d71c 100644
--- a/epan/dissectors/packet-sccpmg.c
+++ b/epan/dissectors/packet-sccpmg.c
@@ -242,8 +242,8 @@ dissect_sccpmg_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccpmg_tre
}
}
-static void
-dissect_sccpmg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_sccpmg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *sccpmg_item;
proto_tree *sccpmg_tree = NULL;
@@ -272,6 +272,7 @@ dissect_sccpmg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* dissect the message */
dissect_sccpmg_message(tvb, pinfo, sccpmg_tree);
+ return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
@@ -355,7 +356,7 @@ proto_reg_handoff_sccpmg(void)
{
dissector_handle_t sccpmg_handle;
- sccpmg_handle = create_dissector_handle(dissect_sccpmg, proto_sccpmg);
+ sccpmg_handle = new_create_dissector_handle(dissect_sccpmg, proto_sccpmg);
/* Register for SCCP SSN=1 messages */
dissector_add_uint("sccp.ssn", SCCPMG_SSN, sccpmg_handle);
diff --git a/epan/dissectors/packet-sdlc.c b/epan/dissectors/packet-sdlc.c
index 798ca492c4..b3ab0b3d98 100644
--- a/epan/dissectors/packet-sdlc.c
+++ b/epan/dissectors/packet-sdlc.c
@@ -65,8 +65,8 @@ static const xdlc_cf_items sdlc_cf_items = {
&hf_sdlc_ftype_s_u
};
-static void
-dissect_sdlc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_sdlc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *sdlc_tree;
proto_item *sdlc_ti;
@@ -99,17 +99,12 @@ dissect_sdlc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_RES_DL_SRC, "DCE");
}
- if (tree) {
- sdlc_ti = proto_tree_add_item(tree, proto_sdlc, tvb, 0, -1,
- ENC_NA);
- sdlc_tree = proto_item_add_subtree(sdlc_ti, ett_sdlc);
+ sdlc_ti = proto_tree_add_item(tree, proto_sdlc, tvb, 0, -1,
+ ENC_NA);
+ sdlc_tree = proto_item_add_subtree(sdlc_ti, ett_sdlc);
- proto_tree_add_uint(sdlc_tree, hf_sdlc_address, tvb, 0, 1,
- addr);
- } else {
- sdlc_ti = NULL;
- sdlc_tree = NULL;
- }
+ proto_tree_add_uint(sdlc_tree, hf_sdlc_address, tvb, 0, 1,
+ addr);
/*
* XXX - SDLC has a mod-128 mode as well as a mod-7 mode.
@@ -122,8 +117,7 @@ dissect_sdlc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
is_response, FALSE, FALSE);
sdlc_header_len += XDLC_CONTROL_LEN(control, FALSE);
- if (tree)
- proto_item_set_len(sdlc_ti, sdlc_header_len);
+ proto_item_set_len(sdlc_ti, sdlc_header_len);
/*
* XXX - is there an FCS at the end, at least in Sniffer
@@ -135,6 +129,8 @@ dissect_sdlc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
call_dissector(sna_handle, next_tvb, pinfo, tree);
} else
call_dissector(data_handle, next_tvb, pinfo, tree);
+
+ return tvb_captured_length(tvb);
}
void
@@ -207,7 +203,7 @@ proto_reg_handoff_sdlc(void)
sna_handle = find_dissector("sna");
data_handle = find_dissector("data");
- sdlc_handle = create_dissector_handle(dissect_sdlc, proto_sdlc);
+ sdlc_handle = new_create_dissector_handle(dissect_sdlc, proto_sdlc);
dissector_add_uint("wtap_encap", WTAP_ENCAP_SDLC, sdlc_handle);
}
diff --git a/epan/dissectors/packet-sll.c b/epan/dissectors/packet-sll.c
index a27d655563..dbb24bf590 100644
--- a/epan/dissectors/packet-sll.c
+++ b/epan/dissectors/packet-sll.c
@@ -190,8 +190,8 @@ capture_sll(const guchar *pd, int len, packet_counts *ld)
capture_ethertype(protocol, pd, SLL_HEADER_SIZE, len, ld);
}
-static void
-dissect_sll(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_sll(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint16 pkttype;
guint16 protocol;
@@ -299,6 +299,7 @@ dissect_sll(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
break;
}
}
+ return tvb_captured_length(tvb);
}
void
@@ -334,7 +335,7 @@ proto_register_sll(void)
proto_register_fields(proto_sll, hfi, array_length(hfi));
proto_register_subtree_array(ett, array_length(ett));
- sll_handle = create_dissector_handle(dissect_sll, proto_sll);
+ sll_handle = new_create_dissector_handle(dissect_sll, proto_sll);
sll_linux_dissector_table = register_dissector_table (
"sll.ltype",
diff --git a/epan/dissectors/packet-slowprotocols.c b/epan/dissectors/packet-slowprotocols.c
index ee8be727db..8c411efeae 100644
--- a/epan/dissectors/packet-slowprotocols.c
+++ b/epan/dissectors/packet-slowprotocols.c
@@ -75,8 +75,8 @@ static dissector_handle_t dh_data;
* Return Values:
* None
*/
-static void
-dissect_slow_protocols(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_slow_protocols(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint8 subtype;
proto_tree *pdu_tree;
@@ -100,6 +100,8 @@ dissect_slow_protocols(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (!dissector_try_uint_new(slow_protocols_dissector_table, subtype,
next_tvb, pinfo, tree, TRUE, NULL))
call_dissector(dh_data, next_tvb, pinfo, tree);
+
+ return tvb_captured_length(tvb);
}
@@ -143,7 +145,7 @@ proto_reg_handoff_slow_protocols(void)
{
dissector_handle_t slow_protocols_handle;
- slow_protocols_handle = create_dissector_handle(dissect_slow_protocols, proto_slow);
+ slow_protocols_handle = new_create_dissector_handle(dissect_slow_protocols, proto_slow);
dissector_add_uint("ethertype", ETHERTYPE_SLOW_PROTOCOLS, slow_protocols_handle);
dh_data = find_dissector("data");
diff --git a/epan/dissectors/packet-sml.c b/epan/dissectors/packet-sml.c
index 5d072e05a5..5ff618815c 100644
--- a/epan/dissectors/packet-sml.c
+++ b/epan/dissectors/packet-sml.c
@@ -2516,15 +2516,15 @@ static void dissect_sml_file(tvbuff_t *tvb, packet_info *pinfo, gint *offset, pr
}
/* main */
-static void dissect_sml (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
- proto_item *sml_item = NULL;
- proto_tree *sml_tree = NULL;
+static int dissect_sml (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) {
+ proto_item *sml_item;
+ proto_tree *sml_tree;
guint offset = 0;
/*Check if not SML*/
if (tvb_get_ntohl(tvb, offset) != ESC_SEQ && tvb_get_guint8(tvb, offset) != LIST_6_ELEMENTS){
- return;
+ return 0;
}
col_set_str(pinfo->cinfo, COL_PROTOCOL, "SML");
@@ -2534,6 +2534,7 @@ static void dissect_sml (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
sml_item = proto_tree_add_item(tree, proto_sml, tvb, 0, -1, ENC_NA);
sml_tree = proto_item_add_subtree(sml_item, ett_sml);
dissect_sml_file(tvb, pinfo, &offset, sml_tree);
+ return tvb_captured_length(tvb);
}
static void
@@ -2825,7 +2826,7 @@ void proto_reg_handoff_sml(void) {
static dissector_handle_t sml_handle;
if (!initialized) {
- sml_handle = create_dissector_handle(dissect_sml, proto_sml);
+ sml_handle = new_create_dissector_handle(dissect_sml, proto_sml);
initialized = TRUE;
} else {
dissector_delete_uint("tcp.port", old_tcp_port, sml_handle);
diff --git a/epan/dissectors/packet-snaeth.c b/epan/dissectors/packet-snaeth.c
index e64ef1bf6b..13da4efee4 100644
--- a/epan/dissectors/packet-snaeth.c
+++ b/epan/dissectors/packet-snaeth.c
@@ -41,8 +41,8 @@ static gint ett_snaeth = -1;
static dissector_handle_t llc_handle;
-static void
-dissect_snaeth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_snaeth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *snaeth_tree;
proto_item *snaeth_ti;
@@ -74,6 +74,7 @@ dissect_snaeth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
*/
next_tvb = tvb_new_subset_remaining(tvb, 3);
call_dissector(llc_handle, next_tvb, pinfo, tree);
+ return tvb_captured_length(tvb);
}
void
@@ -107,7 +108,7 @@ proto_reg_handoff_snaeth(void)
*/
llc_handle = find_dissector("llc");
- snaeth_handle = create_dissector_handle(dissect_snaeth, proto_snaeth);
+ snaeth_handle = new_create_dissector_handle(dissect_snaeth, proto_snaeth);
dissector_add_uint("ethertype", ETHERTYPE_SNA, snaeth_handle);
}
diff --git a/epan/dissectors/packet-socketcan.c b/epan/dissectors/packet-socketcan.c
index 8385b10551..9cb1d6b54e 100644
--- a/epan/dissectors/packet-socketcan.c
+++ b/epan/dissectors/packet-socketcan.c
@@ -98,8 +98,8 @@ static gpointer can_value(packet_info *pinfo _U_)
return 0;
}
-static void
-dissect_socketcan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_socketcan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *can_tree;
proto_item *ti;
@@ -156,6 +156,7 @@ dissect_socketcan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
call_dissector(data_handle, next_tvb, pinfo, tree);
}
+ return tvb_captured_length(tvb);
}
void
@@ -247,7 +248,7 @@ proto_reg_handoff_socketcan(void)
{
dissector_handle_t can_handle;
- can_handle = create_dissector_handle(dissect_socketcan, proto_can);
+ can_handle = new_create_dissector_handle(dissect_socketcan, proto_can);
dissector_add_uint("wtap_encap", WTAP_ENCAP_SOCKETCAN, can_handle);
dissector_add_uint("sll.ltype", LINUX_SLL_P_CAN, can_handle);
diff --git a/epan/dissectors/packet-socks.c b/epan/dissectors/packet-socks.c
index f69d69f5d5..bb4b77d995 100644
--- a/epan/dissectors/packet-socks.c
+++ b/epan/dissectors/packet-socks.c
@@ -320,8 +320,8 @@ static int get_address_v5(tvbuff_t *tvb, int offset,
/********************* V5 UDP Associate handlers ***********************/
-static void
-socks_udp_dissector(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
+static int
+socks_udp_dissector(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) {
/* Conversation dissector called from UDP dissector. Decode and display */
/* the socks header, the pass the rest of the data to the udp port */
@@ -380,6 +380,7 @@ socks_udp_dissector(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
decode_udp_ports( tvb, offset, pinfo, tree, pinfo->srcport, pinfo->destport, -1);
*ptr = hash_info->udp_port;
+ return tvb_captured_length(tvb);
}
@@ -1306,7 +1307,7 @@ void
proto_reg_handoff_socks(void) {
/* dissector install routine */
- socks_udp_handle = create_dissector_handle(socks_udp_dissector, proto_socks);
+ socks_udp_handle = new_create_dissector_handle(socks_udp_dissector, proto_socks);
socks_handle = new_create_dissector_handle(dissect_socks, proto_socks);
dissector_add_uint("tcp.port", TCP_PORT_SOCKS, socks_handle);
diff --git a/epan/dissectors/packet-spp.c b/epan/dissectors/packet-spp.c
index 530a066d9f..3e3d9adb0c 100644
--- a/epan/dissectors/packet-spp.c
+++ b/epan/dissectors/packet-spp.c
@@ -102,8 +102,8 @@ spp_datastream(guint8 type)
*
* XXX - hand off to subdissectors based on the socket number.
*/
-static void
-dissect_spp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_spp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *spp_tree;
proto_item *ti;
@@ -173,12 +173,15 @@ dissect_spp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
next_tvb = tvb_new_subset_remaining(tvb, SPP_HEADER_LEN);
if (dissector_try_uint(spp_socket_dissector_table, low_socket,
next_tvb, pinfo, tree))
- return;
+ return tvb_captured_length(tvb);
+
if (dissector_try_uint(spp_socket_dissector_table, high_socket,
next_tvb, pinfo, tree))
- return;
+ return tvb_captured_length(tvb);
+
call_dissector(data_handle, next_tvb, pinfo, tree);
}
+ return tvb_captured_length(tvb);
}
@@ -268,7 +271,7 @@ proto_reg_handoff_spp(void)
{
dissector_handle_t spp_handle;
- spp_handle = create_dissector_handle(dissect_spp, proto_spp);
+ spp_handle = new_create_dissector_handle(dissect_spp, proto_spp);
dissector_add_uint("idp.packet_type", IDP_PACKET_TYPE_SPP, spp_handle);
data_handle = find_dissector("data");
diff --git a/epan/dissectors/packet-tdmop.c b/epan/dissectors/packet-tdmop.c
index b51a4c02af..196586f0da 100644
--- a/epan/dissectors/packet-tdmop.c
+++ b/epan/dissectors/packet-tdmop.c
@@ -89,7 +89,7 @@ static guint8 reverse_map[256]=
0x0F,0x8F,0x4F,0xCF,0x2F,0xAF,0x6F,0xEF,0x1F,0x9F,0x5F,0xDF,0x3F,0xBF,0x7F,0xFF
};
-static void dissect_tdmop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int dissect_tdmop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint8 dchannel_data[MAX_DCHANNEL_LEN];
guint dchannel_len;
@@ -199,6 +199,7 @@ static void dissect_tdmop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
call_dissector(lapd_handle, new_tvb, pinfo, tree);
}
}
+ return tvb_captured_length(tvb);
}
void proto_register_tdmop(void)
@@ -350,7 +351,7 @@ void proto_reg_handoff_tdmop(void)
static guint32 current_tdmop_udpport;
if (!init)
{
- tdmop_handle = create_dissector_handle(dissect_tdmop, proto_tdmop);
+ tdmop_handle = new_create_dissector_handle(dissect_tdmop, proto_tdmop);
dissector_add_uint("udp.port", pref_tdmop_udpport, tdmop_handle);
dissector_add_uint("ethertype", pref_tdmop_ethertype, tdmop_handle);
lapd_handle = find_dissector("lapd-bitstream");
diff --git a/epan/dissectors/packet-teamspeak2.c b/epan/dissectors/packet-teamspeak2.c
index 4116ce906e..3778351ccc 100644
--- a/epan/dissectors/packet-teamspeak2.c
+++ b/epan/dissectors/packet-teamspeak2.c
@@ -710,7 +710,7 @@ static ts2_conversation* ts2_get_conversation(packet_info *pinfo)
/* Dissect a TS2 packet */
-static void dissect_ts2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int dissect_ts2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
ts2_conversation *conversation_data;
guint16 type = tvb_get_letohs(tvb, 2);
@@ -807,6 +807,7 @@ static void dissect_ts2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
break;
}
} /* if (tree) */
+ return tvb_captured_length(tvb);
}
@@ -1230,7 +1231,7 @@ void proto_register_ts2(void)
void proto_reg_handoff_ts2(void)
{
dissector_handle_t ts2_handle;
- ts2_handle = create_dissector_handle(dissect_ts2, proto_ts2);
+ ts2_handle = new_create_dissector_handle(dissect_ts2, proto_ts2);
dissector_add_uint("udp.port", TS2_PORT, ts2_handle);
}
diff --git a/epan/dissectors/packet-teimanagement.c b/epan/dissectors/packet-teimanagement.c
index 76173f4178..1883a8545d 100644
--- a/epan/dissectors/packet-teimanagement.c
+++ b/epan/dissectors/packet-teimanagement.c
@@ -65,8 +65,8 @@ static const value_string tei_msg_vals[]={
{ 0, NULL}
};
-static void
-dissect_teimanagement(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_teimanagement(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *tei_tree = NULL;
proto_item *tei_ti;
@@ -91,6 +91,7 @@ dissect_teimanagement(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(tei_tree, lm_action, tvb, 4, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tei_tree, lm_extend, tvb, 4, 1, ENC_BIG_ENDIAN);
}
+ return tvb_captured_length(tvb);
}
void
@@ -133,7 +134,7 @@ proto_reg_handoff_teimanagement(void)
{
dissector_handle_t teimanagement_handle;
- teimanagement_handle = create_dissector_handle(dissect_teimanagement,
+ teimanagement_handle = new_create_dissector_handle(dissect_teimanagement,
proto_tei);
dissector_add_uint("lapd.sapi", LAPD_SAPI_L2, teimanagement_handle);
}
diff --git a/epan/dissectors/packet-telkonet.c b/epan/dissectors/packet-telkonet.c
index c96fc5f234..ddaa3f648f 100644
--- a/epan/dissectors/packet-telkonet.c
+++ b/epan/dissectors/packet-telkonet.c
@@ -54,8 +54,8 @@ static const value_string telkonet_type_vals[] = {
{ 0x00, NULL }
};
-static void
-dissect_telkonet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_telkonet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *ti, *telkonet_tree;
int offset = 0;
@@ -77,6 +77,8 @@ dissect_telkonet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (type == TELKONET_TYPE_TUNNEL)
call_dissector(eth_withoutfcs_handle, tvb_new_subset_remaining(tvb, offset),
pinfo, tree);
+
+ return tvb_captured_length(tvb);
}
void
@@ -103,7 +105,7 @@ proto_reg_handoff_telkonet(void)
eth_withoutfcs_handle = find_dissector("eth_withoutfcs");
- telkonet_handle = create_dissector_handle(dissect_telkonet, proto_telkonet);
+ telkonet_handle = new_create_dissector_handle(dissect_telkonet, proto_telkonet);
dissector_add_uint("ethertype", ETHERTYPE_TELKONET, telkonet_handle);
}
diff --git a/epan/dissectors/packet-teredo.c b/epan/dissectors/packet-teredo.c
index a07117804b..9d4ef1837c 100644
--- a/epan/dissectors/packet-teredo.c
+++ b/epan/dissectors/packet-teredo.c
@@ -201,8 +201,8 @@ decode_teredo_ports(tvbuff_t *tvb, int offset, packet_info *pinfo,proto_tree *tr
call_dissector(data_handle,next_tvb, pinfo, tree);
}
-static void
-dissect_teredo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_teredo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *teredo_tree;
proto_item *ti;
@@ -219,12 +219,8 @@ dissect_teredo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_PROTOCOL, "Teredo");
col_clear(pinfo->cinfo, COL_INFO);
- if (tree) {
- ti = proto_tree_add_item(tree, proto_teredo, tvb, 0, -1, ENC_NA);
- teredo_tree = proto_item_add_subtree(ti, ett_teredo);
- }
- else
- teredo_tree = NULL;
+ ti = proto_tree_add_item(tree, proto_teredo, tvb, 0, -1, ENC_NA);
+ teredo_tree = proto_item_add_subtree(ti, ett_teredo);
teredoh->th_header = tvb_get_ntohs(tvb, offset);
@@ -245,6 +241,7 @@ dissect_teredo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
decode_teredo_ports(tvb, offset, pinfo, tree, teredoh->th_header /* , teredoh->th_orgport*/);
tap_queue_packet(teredo_tap, pinfo, teredoh);
+ return tvb_captured_length(tvb);
}
@@ -308,7 +305,7 @@ dissect_teredo_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d
if (tvb_reported_length_remaining(tvb, offset) != val)
return FALSE; /* length mismatch */
- dissect_teredo (tvb, pinfo, tree);
+ dissect_teredo (tvb, pinfo, tree, data);
return TRUE;
}
@@ -400,7 +397,7 @@ proto_reg_handoff_teredo(void)
{
dissector_handle_t teredo_handle;
- teredo_handle = create_dissector_handle(dissect_teredo, proto_teredo);
+ teredo_handle = new_create_dissector_handle(dissect_teredo, proto_teredo);
data_handle = find_dissector("ipv6");
teredo_tap = register_tap("teredo");
diff --git a/epan/dissectors/packet-tfp.c b/epan/dissectors/packet-tfp.c
index 66c5b0ce65..043a3833a9 100644
--- a/epan/dissectors/packet-tfp.c
+++ b/epan/dissectors/packet-tfp.c
@@ -232,13 +232,14 @@ dissect_tfp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
}
/* dissector function for dissecting TCP payloads */
-static void
-dissect_tfp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_tfp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
col_set_str(pinfo->cinfo, COL_PROTOCOL, "TFP over TCP");
col_clear(pinfo->cinfo, COL_INFO);
dissect_tfp_common(tvb, pinfo, tree);
+ return tvb_captured_length(tvb);
}
/* dissector function for dissecting USB payloads */
@@ -410,7 +411,7 @@ proto_reg_handoff_tfp(void) {
dissector_handle_t tfp_handle_tcp;
- tfp_handle_tcp = create_dissector_handle(dissect_tfp_tcp, proto_tfp);
+ tfp_handle_tcp = new_create_dissector_handle(dissect_tfp_tcp, proto_tfp);
dissector_add_uint("tcp.port", tfp_PORT, tfp_handle_tcp);
heur_dissector_add("usb.bulk", dissect_tfp_bulk_heur, "Tinkerforge USB bulk endpoint", "tfp_usb_bulk", proto_tfp, HEURISTIC_ENABLE);
diff --git a/epan/dissectors/packet-time.c b/epan/dissectors/packet-time.c
index a7f4cdff61..ae03e2a15b 100644
--- a/epan/dissectors/packet-time.c
+++ b/epan/dissectors/packet-time.c
@@ -55,8 +55,8 @@ static gint time_display_type = ABSOLUTE_TIME_LOCAL;
/* This dissector works for TCP and UDP time packets */
#define TIME_PORT 37
-static void
-dissect_time(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_time(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *time_tree;
proto_item *ti;
@@ -78,6 +78,7 @@ dissect_time(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
abs_time_secs_to_str(wmem_packet_scope(), delta_seconds-2208988800U,
(absolute_time_display_e)time_display_type, TRUE));
}
+ return tvb_captured_length(tvb);
}
void
@@ -119,7 +120,7 @@ proto_reg_handoff_time(void)
{
dissector_handle_t time_handle;
- time_handle = create_dissector_handle(dissect_time, proto_time);
+ time_handle = new_create_dissector_handle(dissect_time, proto_time);
dissector_add_uint("udp.port", TIME_PORT, time_handle);
dissector_add_uint("tcp.port", TIME_PORT, time_handle);
}
diff --git a/epan/dissectors/packet-tnef.c b/epan/dissectors/packet-tnef.c
index 27b65b4866..f703b89f95 100644
--- a/epan/dissectors/packet-tnef.c
+++ b/epan/dissectors/packet-tnef.c
@@ -622,7 +622,7 @@ static int dissect_tnef(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
return tvb_captured_length(tvb);
}
-static void dissect_tnef_file(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int dissect_tnef_file(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
col_set_str(pinfo->cinfo, COL_PROTOCOL, PSNAME);
@@ -631,6 +631,7 @@ static void dissect_tnef_file(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
col_append_str(pinfo->cinfo, COL_INFO, PNAME);
dissect_tnef(tvb, pinfo, tree, NULL);
+ return tvb_captured_length(tvb);
}
/* Register all the bits needed by the filtering engine */
@@ -829,7 +830,7 @@ proto_reg_handoff_tnef(void)
{
dissector_handle_t tnef_file_handle;
- tnef_file_handle = create_dissector_handle(dissect_tnef_file, proto_tnef);
+ tnef_file_handle = new_create_dissector_handle(dissect_tnef_file, proto_tnef);
dissector_add_string("media_type", "application/ms-tnef", tnef_handle);
diff --git a/epan/dissectors/packet-tpkt.c b/epan/dissectors/packet-tpkt.c
index eb9d261391..28adcd2410 100644
--- a/epan/dissectors/packet-tpkt.c
+++ b/epan/dissectors/packet-tpkt.c
@@ -568,10 +568,11 @@ dissect_tpkt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
* PDU.
*/
#if 0
-static void
-dissect_ascii_tpkt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_ascii_tpkt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
dissect_asciitpkt(tvb, pinfo, tree, osi_tp_handle);
+ return tvb_captured_length(tvb);
}
#endif
@@ -659,7 +660,7 @@ proto_reg_handoff_tpkt(void)
dissector_add_uint("tcp.port", TCP_PORT_TPKT, tpkt_handle);
/*
- tpkt_ascii_handle = create_dissector_handle(dissect_ascii_tpkt, proto_tpkt);
+ tpkt_ascii_handle = new_create_dissector_handle(dissect_ascii_tpkt, proto_tpkt);
dissector_add_uint("tcp.port", TCP_PORT_TPKT, tpkt_ascii_handle);
*/
diff --git a/epan/dissectors/packet-tsp.c b/epan/dissectors/packet-tsp.c
index bd4f2ba745..99f980ce09 100644
--- a/epan/dissectors/packet-tsp.c
+++ b/epan/dissectors/packet-tsp.c
@@ -105,8 +105,8 @@ static const value_string names_tsp_type[] = {
};
-static void
-dissect_tsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_tsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *tsp_tree;
proto_item *tsp_item;
@@ -158,6 +158,7 @@ dissect_tsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(tsp_tree, hf_tsp_name, tvb, 12,
-1, ENC_ASCII|ENC_NA);
}
+ return tvb_captured_length(tvb);
}
@@ -166,7 +167,7 @@ proto_reg_handoff_tsp(void)
{
dissector_handle_t tsp_handle;
- tsp_handle = create_dissector_handle(dissect_tsp, proto_tsp);
+ tsp_handle = new_create_dissector_handle(dissect_tsp, proto_tsp);
dissector_add_uint("udp.port", UDP_PORT_TIMED, tsp_handle);
}
diff --git a/epan/dissectors/packet-tuxedo.c b/epan/dissectors/packet-tuxedo.c
index 641f469231..4e6a7f52d4 100644
--- a/epan/dissectors/packet-tuxedo.c
+++ b/epan/dissectors/packet-tuxedo.c
@@ -98,8 +98,8 @@ static const value_string tuxedo_opcode_vals[] = {
};
-static void
-dissect_tuxedo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_tuxedo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *tuxedoroot_tree = NULL;
proto_item *ti;
@@ -136,6 +136,7 @@ dissect_tuxedo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
}
+ return tvb_captured_length(tvb);
}
static gboolean
@@ -152,7 +153,7 @@ dissect_tuxedo_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d
conversation = find_or_create_conversation(pinfo);
conversation_set_dissector(conversation, tuxedo_handle);
- dissect_tuxedo(tvb, pinfo, tree);
+ dissect_tuxedo(tvb, pinfo, tree, data);
return TRUE;
}
}
@@ -184,7 +185,7 @@ proto_register_tuxedo(void)
void
proto_reg_handoff_tuxedo(void)
{
- tuxedo_handle = create_dissector_handle(dissect_tuxedo, proto_tuxedo);
+ tuxedo_handle = new_create_dissector_handle(dissect_tuxedo, proto_tuxedo);
dissector_add_for_decode_as("tcp.port", tuxedo_handle);
heur_dissector_add("tcp", dissect_tuxedo_heur, "Tuxedo over TCP", "tuxedo_tcp", proto_tuxedo, HEURISTIC_ENABLE);
}
diff --git a/epan/dissectors/packet-udld.c b/epan/dissectors/packet-udld.c
index 7e6f2ea569..866c3b99e6 100644
--- a/epan/dissectors/packet-udld.c
+++ b/epan/dissectors/packet-udld.c
@@ -97,8 +97,8 @@ static const value_string opcode_vals[] = {
{ 0, NULL }
};
-static void
-dissect_udld(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_udld(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *ti;
proto_tree *udld_tree = NULL;
@@ -220,13 +220,14 @@ dissect_udld(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(tlv_tree, hf_udld_data, tvb, offset + 4,
length - 4, ENC_NA);
} else {
- return;
+ return offset;
}
offset += length;
}
}
call_dissector(data_handle, tvb_new_subset_remaining(tvb, offset), pinfo, udld_tree);
+ return tvb_captured_length(tvb);
}
void
@@ -304,7 +305,7 @@ proto_reg_handoff_udld(void)
dissector_handle_t udld_handle;
data_handle = find_dissector("data");
- udld_handle = create_dissector_handle(dissect_udld, proto_udld);
+ udld_handle = new_create_dissector_handle(dissect_udld, proto_udld);
dissector_add_uint("llc.cisco_pid", 0x0111, udld_handle);
dissector_add_uint("chdlc.protocol", 0x0111, udld_handle);
}
diff --git a/epan/dissectors/packet-udp.c b/epan/dissectors/packet-udp.c
index 6d8885424c..7d18fece9e 100644
--- a/epan/dissectors/packet-udp.c
+++ b/epan/dissectors/packet-udp.c
@@ -1003,10 +1003,11 @@ dissect_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
return tvb_captured_length(tvb);
}
-static void
-dissect_udplite(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_udplite(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
dissect(tvb, pinfo, tree, IP_PROTO_UDPLITE);
+ return tvb_captured_length(tvb);
}
static void
@@ -1082,7 +1083,7 @@ proto_register_udp(void)
proto_udplite = proto_register_protocol("Lightweight User Datagram Protocol",
"UDP-Lite", "udplite");
- udplite_handle = create_dissector_handle(dissect_udplite, proto_udplite);
+ udplite_handle = new_create_dissector_handle(dissect_udplite, proto_udplite);
hfi_udplite = proto_registrar_get_nth(proto_udplite);
proto_register_fields(proto_udplite, hfi_lite, array_length(hfi_lite));
diff --git a/epan/dissectors/packet-uhd.c b/epan/dissectors/packet-uhd.c
index 07627ce81e..92ae6c60c4 100644
--- a/epan/dissectors/packet-uhd.c
+++ b/epan/dissectors/packet-uhd.c
@@ -155,8 +155,8 @@ static const value_string uhd_reg_actions[] = {
void proto_reg_handoff_uhd(void);
/* dissect a UHD header and hand payload off to respective dissector */
-static void
-dissect_uhd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_uhd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
int ind;
proto_item *ti;
@@ -172,7 +172,7 @@ dissect_uhd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_add_str(pinfo->cinfo, COL_INFO, val_to_str(id, uhd_ids, "Unknown UHD message type '%c'"));
if (tree == NULL)
- return;
+ return tvb_captured_length(tvb);
ti = proto_tree_add_protocol_format(tree, proto_uhd, tvb, 0, 34, "UHD id = %c ", id);
uhd_tree = proto_item_add_subtree(ti, ett_uhd);
@@ -221,6 +221,7 @@ dissect_uhd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(uhd_tree, hf_uhd_echo_len, tvb, 12, 4, ENC_BIG_ENDIAN);
break;
}
+ return tvb_captured_length(tvb);
}
void
@@ -289,7 +290,7 @@ proto_reg_handoff_uhd(void)
static gint dissector_port;
if (!uhd_prefs_initialized) {
- uhd_handle = create_dissector_handle(dissect_uhd, proto_uhd);
+ uhd_handle = new_create_dissector_handle(dissect_uhd, proto_uhd);
uhd_prefs_initialized = TRUE;
} else {
dissector_delete_uint("udp.port", dissector_port, uhd_handle);
diff --git a/epan/dissectors/packet-usb.c b/epan/dissectors/packet-usb.c
index 50ccf631b3..4ba7bfdd92 100644
--- a/epan/dissectors/packet-usb.c
+++ b/epan/dissectors/packet-usb.c
@@ -3814,17 +3814,19 @@ dissect_linux_usb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent, void* d
return tvb_captured_length(tvb);
}
-static void
-dissect_linux_usb_mmapped(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent)
+static int
+dissect_linux_usb_mmapped(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent, void* data _U_)
{
dissect_usb_common(tvb, pinfo, parent, USB_HEADER_LINUX_64_BYTES);
+ return tvb_captured_length(tvb);
}
-static void
-dissect_win32_usb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent)
+static int
+dissect_win32_usb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent, void* data _U_)
{
dissect_usb_common(tvb, pinfo, parent, USB_HEADER_USBPCAP);
+ return tvb_captured_length(tvb);
}
void
@@ -4556,9 +4558,9 @@ proto_reg_handoff_usb(void)
data_handle = find_dissector("data");
- linux_usb_mmapped_handle = create_dissector_handle(dissect_linux_usb_mmapped,
+ linux_usb_mmapped_handle = new_create_dissector_handle(dissect_linux_usb_mmapped,
proto_usb);
- win32_usb_handle = create_dissector_handle(dissect_win32_usb, proto_usb);
+ win32_usb_handle = new_create_dissector_handle(dissect_win32_usb, proto_usb);
dissector_add_uint("wtap_encap", WTAP_ENCAP_USB_LINUX, linux_usb_handle);
dissector_add_uint("wtap_encap", WTAP_ENCAP_USB_LINUX_MMAPPED, linux_usb_mmapped_handle);
diff --git a/epan/dissectors/packet-v5ua.c b/epan/dissectors/packet-v5ua.c
index 053cb16cf1..2bf110abd4 100644
--- a/epan/dissectors/packet-v5ua.c
+++ b/epan/dissectors/packet-v5ua.c
@@ -1380,10 +1380,9 @@ dissect_v5ua_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_
}
-static void
-dissect_v5ua(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_v5ua(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
-
gint offset, remaining_length, length, tag, one_bit;
@@ -1395,14 +1394,10 @@ dissect_v5ua(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_PROTOCOL, "V5UA");
/* end */
col_clear(pinfo->cinfo, COL_INFO);
- if (tree) {
- /* create display subtree for the protocol */
- ti = proto_tree_add_item(tree, proto_v5ua, tvb, 0, -1, ENC_NA);
- v5ua_tree = proto_item_add_subtree(ti, ett_v5ua);
- }
- else {
- v5ua_tree=NULL;
- };
+
+ /* create display subtree for the protocol */
+ ti = proto_tree_add_item(tree, proto_v5ua, tvb, 0, -1, ENC_NA);
+ v5ua_tree = proto_item_add_subtree(ti, ett_v5ua);
/* detect version of IUA */
iua_version = RFC;
@@ -1467,6 +1462,7 @@ dissect_v5ua(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* dissect the message */
dissect_v5ua_message(tvb, pinfo, tree, v5ua_tree);
+ return tvb_captured_length(tvb);
}
@@ -1682,7 +1678,7 @@ proto_reg_handoff_v5ua(void)
{
dissector_handle_t v5ua_handle;
- v5ua_handle = create_dissector_handle(dissect_v5ua, proto_v5ua);
+ v5ua_handle = new_create_dissector_handle(dissect_v5ua, proto_v5ua);
q931_handle = find_dissector("q931");
v52_handle = find_dissector("v52");
diff --git a/epan/dissectors/packet-vicp.c b/epan/dissectors/packet-vicp.c
index b2bae91d48..d46db0c3ce 100644
--- a/epan/dissectors/packet-vicp.c
+++ b/epan/dissectors/packet-vicp.c
@@ -43,7 +43,7 @@ static gint ett_vicp = -1;
void proto_register_vicp(void);
void proto_reg_handoff_vicp(void);
-static void dissect_vicp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int dissect_vicp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *ti;
proto_tree *vicp_tree;
@@ -54,7 +54,7 @@ static void dissect_vicp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tvb_reported_length_remaining(tvb, 0) < 8)
{
/* Payload too small for VICP */
- return;
+ return 0;
}
col_set_str(pinfo->cinfo, COL_PROTOCOL, "VICP");
@@ -76,6 +76,7 @@ static void dissect_vicp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ptvcursor_add(cursor, hf_vicp_data, len, ENC_NA);
ptvcursor_free(cursor);
+ return tvb_captured_length(tvb);
}
void proto_register_vicp(void)
@@ -114,7 +115,7 @@ void proto_register_vicp(void)
void proto_reg_handoff_vicp(void)
{ dissector_handle_t vicp_handle;
- vicp_handle = create_dissector_handle(dissect_vicp, proto_vicp);
+ vicp_handle = new_create_dissector_handle(dissect_vicp, proto_vicp);
dissector_add_uint("tcp.port", VICP_PORT, vicp_handle);
}
diff --git a/epan/dissectors/packet-vines.c b/epan/dissectors/packet-vines.c
index 702fcf50ec..1cdd3abe15 100644
--- a/epan/dissectors/packet-vines.c
+++ b/epan/dissectors/packet-vines.c
@@ -326,8 +326,8 @@ static dissector_handle_t data_handle;
* is not possible
* FIXME: Do we need to use this header with PPP too?
*/
-static void
-dissect_vines_frp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_vines_frp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *vines_frp_tree;
proto_item *ti;
@@ -352,6 +352,7 @@ dissect_vines_frp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Decode the "real" Vines now */
next_tvb = tvb_new_subset_remaining(tvb, 2);
call_dissector(vines_ip_handle, next_tvb, pinfo, tree);
+ return tvb_captured_length(tvb);
}
static int
@@ -373,7 +374,7 @@ dissect_vines_frp_new(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
* is presumably not Vines FRP. */
return 0;
}
- dissect_vines_frp(tvb, pinfo, tree);
+ dissect_vines_frp(tvb, pinfo, tree, params);
return tvb_captured_length(tvb);
}
@@ -417,7 +418,7 @@ proto_reg_handoff_vines_frp(void)
{
dissector_handle_t vines_frp_handle, vines_frp_new_handle;
- vines_frp_handle = create_dissector_handle(dissect_vines_frp,
+ vines_frp_handle = new_create_dissector_handle(dissect_vines_frp,
proto_vines_frp);
dissector_add_uint("ip.proto", IP_PROTO_VINES, vines_frp_handle);
@@ -437,8 +438,8 @@ static const value_string vines_llc_ptype_vals[] = {
{ 0, NULL }
};
-static void
-dissect_vines_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_vines_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint8 ptype;
proto_tree *vines_llc_tree;
@@ -463,6 +464,8 @@ dissect_vines_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (!dissector_try_uint(vines_llc_dissector_table, ptype,
next_tvb, pinfo, tree))
call_dissector(data_handle, next_tvb, pinfo, tree);
+
+ return tvb_captured_length(tvb);
}
void
@@ -494,7 +497,7 @@ proto_reg_handoff_vines_llc(void)
{
dissector_handle_t vines_llc_handle;
- vines_llc_handle = create_dissector_handle(dissect_vines_llc,
+ vines_llc_handle = new_create_dissector_handle(dissect_vines_llc,
proto_vines_llc);
dissector_add_uint("llc.dsap", SAP_VINES2, vines_llc_handle);
}
@@ -526,8 +529,8 @@ static const true_false_string tfs_vine_tctl_router_all = { "Router nodes", "All
static const true_false_string tfs_vine_tctl_forward_router = { "Can handle redirect packets", "Cannot handle redirect packets" };
static const true_false_string tfs_vine_tctl_return_not_return = { "Return", "Do not return" };
-static void
-dissect_vines_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_vines_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
int offset = 0;
guint16 vip_pktlen;
@@ -609,6 +612,8 @@ dissect_vines_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (!dissector_try_uint(vines_ip_dissector_table, vip_proto,
next_tvb, pinfo, tree))
call_dissector(data_handle, next_tvb, pinfo, tree);
+
+ return tvb_captured_length(tvb);
}
void
@@ -690,7 +695,7 @@ proto_register_vines_ip(void)
vines_ip_dissector_table = register_dissector_table("vines_ip.protocol",
"Vines protocol", FT_UINT8, BASE_HEX, DISSECTOR_TABLE_NOT_ALLOW_DUPLICATE);
- vines_ip_handle = create_dissector_handle(dissect_vines_ip,
+ vines_ip_handle = new_create_dissector_handle(dissect_vines_ip,
proto_vines_ip);
}
@@ -705,8 +710,8 @@ proto_reg_handoff_vines_ip(void)
data_handle = find_dissector("data");
}
-static void
-dissect_vines_echo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_vines_echo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *vines_echo_tree = NULL;
proto_item *ti;
@@ -719,6 +724,7 @@ dissect_vines_echo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
vines_echo_tree = proto_item_add_subtree(ti, ett_vines_echo);
proto_tree_add_item(vines_echo_tree, hf_vines_echo_data, tvb, 0, -1, ENC_NA);
}
+ return tvb_captured_length(tvb);
}
void
@@ -746,7 +752,7 @@ proto_reg_handoff_vines_echo(void)
{
dissector_handle_t vines_echo_handle;
- vines_echo_handle = create_dissector_handle(dissect_vines_echo,
+ vines_echo_handle = new_create_dissector_handle(dissect_vines_echo,
proto_vines_echo);
dissector_add_uint("vines_llc.ptype", VINES_LLC_ECHO, vines_echo_handle);
dissector_add_uint("ethertype", ETHERTYPE_VINES_ECHO, vines_echo_handle);
@@ -788,8 +794,8 @@ static const value_string vipc_err_vals[] = {
static const true_false_string tfs_vine_ipc_send_not_send = { "Send", "Do not Send" };
static const true_false_string tfs_vine_ipc_abort_not_abort = { "Abort", "Do not abort" };
-static void
-dissect_vines_ipc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_vines_ipc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
int offset = 0;
e_vipc viph;
@@ -898,6 +904,8 @@ dissect_vines_ipc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
!dissector_try_heuristic(vines_ipc_heur_subdissector_list,
next_tvb, pinfo, tree, &hdtbl_entry, NULL))
call_dissector(data_handle, next_tvb, pinfo, tree);
+
+ return tvb_captured_length(tvb);
}
void
@@ -993,15 +1001,15 @@ proto_reg_handoff_vines_ipc(void)
{
dissector_handle_t vines_ipc_handle;
- vines_ipc_handle = create_dissector_handle(dissect_vines_ipc,
+ vines_ipc_handle = new_create_dissector_handle(dissect_vines_ipc,
proto_vines_ipc);
dissector_add_uint("vines_ip.protocol", VIP_PROTO_IPC, vines_ipc_handle);
}
static heur_dissector_list_t vines_spp_heur_subdissector_list;
-static void
-dissect_vines_spp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_vines_spp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
int offset = 0;
e_vspp viph;
@@ -1069,6 +1077,8 @@ dissect_vines_spp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
!dissector_try_heuristic(vines_spp_heur_subdissector_list,
next_tvb, pinfo, tree, &hdtbl_entry, NULL))
call_dissector(data_handle, next_tvb, pinfo, tree);
+
+ return tvb_captured_length(tvb);
}
void
@@ -1159,7 +1169,7 @@ proto_reg_handoff_vines_spp(void)
{
dissector_handle_t vines_spp_handle;
- vines_spp_handle = create_dissector_handle(dissect_vines_spp,
+ vines_spp_handle = new_create_dissector_handle(dissect_vines_spp,
proto_vines_spp);
dissector_add_uint("vines_ip.protocol", VIP_PROTO_SPP, vines_spp_handle);
}
@@ -1186,8 +1196,8 @@ static const value_string vines_arp_packet_type_vals[] = {
{ 0, NULL }
};
-static void
-dissect_vines_arp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_vines_arp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *vines_arp_tree;
proto_item *ti;
@@ -1246,6 +1256,7 @@ dissect_vines_arp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(vines_arp_tree, hf_vines_arp_address, tvb, 2, VINES_ADDR_LEN, ENC_NA);
}
}
+ return tvb_captured_length(tvb);
}
void
@@ -1293,7 +1304,7 @@ proto_reg_handoff_vines_arp(void)
{
dissector_handle_t vines_arp_handle;
- vines_arp_handle = create_dissector_handle(dissect_vines_arp,
+ vines_arp_handle = new_create_dissector_handle(dissect_vines_arp,
proto_vines_arp);
dissector_add_uint("vines_ip.protocol", VIP_PROTO_ARP, vines_arp_handle);
}
@@ -1414,8 +1425,8 @@ rtp_show_gateway_info(proto_tree *tree, tvbuff_t *tvb, int offset,
return offset;
}
-static void
-dissect_vines_rtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_vines_rtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
int offset = 0;
proto_tree *vines_rtp_tree = NULL;
@@ -1607,6 +1618,7 @@ dissect_vines_rtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
+ return tvb_captured_length(tvb);
}
void
@@ -1889,7 +1901,7 @@ proto_reg_handoff_vines_rtp(void)
{
dissector_handle_t vines_rtp_handle;
- vines_rtp_handle = create_dissector_handle(dissect_vines_rtp,
+ vines_rtp_handle = new_create_dissector_handle(dissect_vines_rtp,
proto_vines_rtp);
dissector_add_uint("vines_ip.protocol", VIP_PROTO_RTP, vines_rtp_handle);
}
@@ -1903,8 +1915,8 @@ static const value_string vines_icp_packet_type_vals[] = {
{ 0, NULL }
};
-static void
-dissect_vines_icp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_vines_icp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
int offset = 0;
proto_tree *vines_icp_tree;
@@ -1962,6 +1974,7 @@ dissect_vines_icp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Restore the "we're inside an error packet" flag. */
pinfo->flags.in_error_pkt = save_in_error_pkt;
+ return tvb_captured_length(tvb);
}
void
@@ -1999,7 +2012,7 @@ proto_reg_handoff_vines_icp(void)
{
dissector_handle_t vines_icp_handle;
- vines_icp_handle = create_dissector_handle(dissect_vines_icp,
+ vines_icp_handle = new_create_dissector_handle(dissect_vines_icp,
proto_vines_icp);
dissector_add_uint("vines_ip.protocol", VIP_PROTO_ICP, vines_icp_handle);
}
diff --git a/epan/dissectors/packet-vlan.c b/epan/dissectors/packet-vlan.c
index e87c559f70..fbbb5d32c4 100644
--- a/epan/dissectors/packet-vlan.c
+++ b/epan/dissectors/packet-vlan.c
@@ -134,8 +134,8 @@ columns_set_vlan(column_info *cinfo, guint16 tci)
col_add_str(cinfo, COL_8021Q_VLAN_ID, id_str);
}
-static void
-dissect_vlan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_vlan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *ti;
guint16 tci;
@@ -199,6 +199,7 @@ dissect_vlan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
call_dissector_with_data(ethertype_handle, tvb, pinfo, tree, &ethertype_data);
}
+ return tvb_captured_length(tvb);
}
void
@@ -245,7 +246,7 @@ proto_register_vlan(void)
"The (hexadecimal) Ethertype used to indicate 802.1QinQ VLAN in VLAN tunneling.",
16, &q_in_q_ethertype);
- vlan_handle = create_dissector_handle(dissect_vlan, proto_vlan);
+ vlan_handle = new_create_dissector_handle(dissect_vlan, proto_vlan);
}
void
diff --git a/epan/dissectors/packet-vmlab.c b/epan/dissectors/packet-vmlab.c
index 26332b5ce2..b9f3b35f44 100644
--- a/epan/dissectors/packet-vmlab.c
+++ b/epan/dissectors/packet-vmlab.c
@@ -71,8 +71,8 @@ static const value_string fragment_vals[] = {
{ 0, NULL }
};
-static void
-dissect_vmlab(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_vmlab(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree* vmlab_tree;
proto_item* ti;
@@ -139,6 +139,7 @@ dissect_vmlab(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ethertype_data.fcs_len = 0;
call_dissector_with_data(ethertype_handle, tvb, pinfo, tree, &ethertype_data);
+ return tvb_captured_length(tvb);
}
void
@@ -180,7 +181,7 @@ proto_reg_handoff_vmlab(void)
{
dissector_handle_t vmlab_handle;
- vmlab_handle = create_dissector_handle(dissect_vmlab, proto_vmlab);
+ vmlab_handle = new_create_dissector_handle(dissect_vmlab, proto_vmlab);
dissector_add_uint("ethertype", ETHERTYPE_VMLAB, vmlab_handle);
diff --git a/epan/dissectors/packet-vntag.c b/epan/dissectors/packet-vntag.c
index 5aa2666d6d..968d8e5df9 100644
--- a/epan/dissectors/packet-vntag.c
+++ b/epan/dissectors/packet-vntag.c
@@ -45,8 +45,8 @@ static int hf_vntag_trailer = -1;
static gint ett_vntag = -1;
-static void
-dissect_vntag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_vntag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint16 encap_proto;
proto_tree *vntag_tree = NULL;
@@ -112,6 +112,7 @@ dissect_vntag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
#if 0
}
#endif
+ return tvb_captured_length(tvb);
}
void
@@ -172,7 +173,7 @@ proto_reg_handoff_vntag(void)
/* XXX, add 0x8926 define to epan/etypes.h && etype_vals */
- vntag_handle = create_dissector_handle(dissect_vntag, proto_vntag);
+ vntag_handle = new_create_dissector_handle(dissect_vntag, proto_vntag);
dissector_add_uint("ethertype", ETHERTYPE_VNTAG, vntag_handle);
ethertype_handle = find_dissector("ethertype");
diff --git a/epan/dissectors/packet-vrt.c b/epan/dissectors/packet-vrt.c
index ee8a681cb9..43076adb4d 100644
--- a/epan/dissectors/packet-vrt.c
+++ b/epan/dissectors/packet-vrt.c
@@ -160,7 +160,7 @@ void dissect_trailer(tvbuff_t *tvb, proto_tree *tree, int offset);
void dissect_cid(tvbuff_t *tvb, proto_tree *tree, int offset);
void proto_reg_handoff_vrt(void);
-static void dissect_vrt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int dissect_vrt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
int offset = 0;
guint8 type;
@@ -258,6 +258,7 @@ static void dissect_vrt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dissect_trailer(tvb, vrt_tree, offset);
}
}
+ return tvb_captured_length(tvb);
}
void dissect_header(tvbuff_t *tvb, proto_tree *tree, int type, int offset)
@@ -660,7 +661,7 @@ proto_reg_handoff_vrt(void)
static gint dissector_port;
if (!vrt_prefs_initialized) {
- vrt_handle = create_dissector_handle(dissect_vrt, proto_vrt);
+ vrt_handle = new_create_dissector_handle(dissect_vrt, proto_vrt);
vrt_prefs_initialized = TRUE;
} else {
dissector_delete_uint("udp.port", dissector_port, vrt_handle);
diff --git a/epan/dissectors/packet-vtp.c b/epan/dissectors/packet-vtp.c
index 10f5a835b8..d7fffa8719 100644
--- a/epan/dissectors/packet-vtp.c
+++ b/epan/dissectors/packet-vtp.c
@@ -136,8 +136,8 @@ set_vtp_info_col(tvbuff_t *tvb, packet_info *pinfo)
}
}
-static void
-dissect_vtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_vtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *ti;
proto_tree *vtp_tree = NULL, *vtp_pruning_tree = NULL;
@@ -264,6 +264,7 @@ dissect_vtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
break;
}
+ return tvb_captured_length(tvb);
}
#define VLAN_SUSPENDED 0x01
@@ -678,7 +679,7 @@ proto_reg_handoff_vtp(void)
{
dissector_handle_t vtp_handle;
- vtp_handle = create_dissector_handle(dissect_vtp, proto_vtp);
+ vtp_handle = new_create_dissector_handle(dissect_vtp, proto_vtp);
dissector_add_uint("llc.cisco_pid", 0x2003, vtp_handle);
}
diff --git a/epan/dissectors/packet-vxlan.c b/epan/dissectors/packet-vxlan.c
index 38e89dd84d..92fe9f5b35 100644
--- a/epan/dissectors/packet-vxlan.c
+++ b/epan/dissectors/packet-vxlan.c
@@ -62,8 +62,8 @@ static const int *flags_fields[] = {
static dissector_handle_t eth_handle;
-static void
-dissect_vxlan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_vxlan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *vxlan_tree;
proto_item *ti;
@@ -109,6 +109,7 @@ dissect_vxlan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(eth_handle, next_tvb, pinfo, tree);
+ return tvb_captured_length(tvb);
}
@@ -197,7 +198,7 @@ proto_reg_handoff_vxlan(void)
eth_handle = find_dissector("eth");
- vxlan_handle = create_dissector_handle(dissect_vxlan, proto_vxlan);
+ vxlan_handle = new_create_dissector_handle(dissect_vxlan, proto_vxlan);
dissector_add_uint("udp.port", UDP_PORT_VXLAN, vxlan_handle);
dissector_add_for_decode_as("udp.port", vxlan_handle);
diff --git a/epan/dissectors/packet-who.c b/epan/dissectors/packet-who.c
index 99334bd0e5..45c170bc83 100644
--- a/epan/dissectors/packet-who.c
+++ b/epan/dissectors/packet-who.c
@@ -83,12 +83,12 @@ static gint ett_whoent = -1;
static void dissect_whoent(tvbuff_t *tvb, int offset, proto_tree *tree);
-static void
-dissect_who(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_who(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
int offset = 0;
- proto_tree *who_tree = NULL;
- proto_item *who_ti = NULL;
+ proto_tree *who_tree;
+ proto_item *who_ti;
guint8 *server_name;
double loadav_5 = 0.0, loadav_10 = 0.0, loadav_15 = 0.0;
nstime_t ts;
@@ -99,18 +99,13 @@ dissect_who(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ts.nsecs = 0;
- if (tree) {
- who_ti = proto_tree_add_item(tree, proto_who, tvb, offset, -1,
- ENC_NA);
- who_tree = proto_item_add_subtree(who_ti, ett_who);
- }
+ who_ti = proto_tree_add_item(tree, proto_who, tvb, offset, -1, ENC_NA);
+ who_tree = proto_item_add_subtree(who_ti, ett_who);
- if (tree)
- proto_tree_add_item(who_tree, hf_who_vers, tvb, offset, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(who_tree, hf_who_vers, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
- if (tree)
- proto_tree_add_item(who_tree, hf_who_type, tvb, offset, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(who_tree, hf_who_type, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
/* 2 filler bytes */
@@ -131,26 +126,21 @@ dissect_who(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += 4;
server_name = tvb_get_stringzpad(wmem_packet_scope(), tvb, offset, 32, ENC_ASCII|ENC_NA);
- if (tree)
- proto_tree_add_string(who_tree, hf_who_hostname, tvb, offset,
- 32, server_name);
+ proto_tree_add_string(who_tree, hf_who_hostname, tvb, offset, 32, server_name);
offset += 32;
loadav_5 = (double) tvb_get_ntohl(tvb, offset) / 100.0;
- if (tree)
- proto_tree_add_double(who_tree, hf_who_loadav_5, tvb, offset,
+ proto_tree_add_double(who_tree, hf_who_loadav_5, tvb, offset,
4, loadav_5);
offset += 4;
loadav_10 = (double) tvb_get_ntohl(tvb, offset) / 100.0;
- if (tree)
- proto_tree_add_double(who_tree, hf_who_loadav_10, tvb, offset,
+ proto_tree_add_double(who_tree, hf_who_loadav_10, tvb, offset,
4, loadav_10);
offset += 4;
loadav_15 = (double) tvb_get_ntohl(tvb, offset) / 100.0;
- if (tree)
- proto_tree_add_double(who_tree, hf_who_loadav_15, tvb, offset,
+ proto_tree_add_double(who_tree, hf_who_loadav_15, tvb, offset,
4, loadav_15);
offset += 4;
@@ -166,6 +156,8 @@ dissect_who(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dissect_whoent(tvb, offset, who_tree);
}
+
+ return tvb_captured_length(tvb);
}
/* The man page says that (1024 / sizeof(struct whoent)) is the maximum number
@@ -294,7 +286,7 @@ proto_reg_handoff_who(void)
{
dissector_handle_t who_handle;
- who_handle = create_dissector_handle(dissect_who, proto_who);
+ who_handle = new_create_dissector_handle(dissect_who, proto_who);
dissector_add_uint("udp.port", UDP_PORT_WHO, who_handle);
}
diff --git a/epan/dissectors/packet-wlccp.c b/epan/dissectors/packet-wlccp.c
index b0bef0bcea..4297172c4b 100644
--- a/epan/dissectors/packet-wlccp.c
+++ b/epan/dissectors/packet-wlccp.c
@@ -689,8 +689,8 @@ static gint ett_framereport_elements_tree = -1;
/* Code to actually dissect the packets */
-static void
-dissect_wlccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_wlccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
/* Set up structures needed to add the protocol subtree and manage it */
proto_item *ti;
@@ -708,12 +708,10 @@ dissect_wlccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if(tvb_get_guint8(tvb, 0) == 0xC1) /* Get the version number */
{
-
sap_id = tvb_get_guint8(tvb,1) & SAP_VALUE_MASK;
base_message_type=(tvb_get_guint8(tvb,6)) & MT_BASE_MSG_TYPE;
message_sub_type=(tvb_get_guint8(tvb, 6) & MT_SUBTYPE ) >> 6;
-
switch (sap_id)
{
@@ -1033,6 +1031,7 @@ dissect_wlccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
} /* if tree */
+ return tvb_captured_length(tvb);
} /* dissect_wlccp */
@@ -4104,7 +4103,7 @@ proto_reg_handoff_wlccp(void)
{
dissector_handle_t wlccp_handle;
- wlccp_handle = create_dissector_handle(dissect_wlccp, proto_wlccp);
+ wlccp_handle = new_create_dissector_handle(dissect_wlccp, proto_wlccp);
dissector_add_uint("ethertype", ETHERTYPE_WLCCP, wlccp_handle);
dissector_add_uint("udp.port", WLCCP_UDP_PORT, wlccp_handle);
diff --git a/epan/dissectors/packet-wsmp.c b/epan/dissectors/packet-wsmp.c
index 53e1231459..f159bee39a 100644
--- a/epan/dissectors/packet-wsmp.c
+++ b/epan/dissectors/packet-wsmp.c
@@ -85,8 +85,8 @@ static int wme_getpsidlen (guint8 *psid)
static gint ett_wsmp = -1;
static gint ett_wsmdata = -1;
-static void
-dissect_wsmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_wsmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
/* Set up structures needed to add the protocol subtree and manage it */
proto_item *ti;
@@ -196,6 +196,7 @@ dissect_wsmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
call_dissector(data_handle, wsmdata_tvb, pinfo, wsmdata_tree);
}
+ return tvb_captured_length(tvb);
}
void
@@ -255,7 +256,7 @@ proto_reg_handoff_wsmp(void)
{
dissector_handle_t wsmp_handle;
- wsmp_handle = create_dissector_handle(dissect_wsmp, proto_wsmp);
+ wsmp_handle = new_create_dissector_handle(dissect_wsmp, proto_wsmp);
dissector_add_uint("ethertype", ETHERTYPE_WSMP, wsmp_handle);
data_handle = find_dissector("data");
return;
diff --git a/epan/dissectors/packet-wsp.c b/epan/dissectors/packet-wsp.c
index d7f9f626a3..4f8de47932 100644
--- a/epan/dissectors/packet-wsp.c
+++ b/epan/dissectors/packet-wsp.c
@@ -4483,8 +4483,8 @@ static const value_string vals_sir_protocol_options[] = {
* Arguably this should be a separate dissector, but SIR does not make sense
* outside of WSP anyway.
*/
-static void
-dissect_sir(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_sir(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint8 version;
guint32 val_len;
@@ -4529,7 +4529,7 @@ dissect_sir(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* End of version 0 SIR content */
if (version == 0)
- return;
+ return offset;
offset += val_len;
@@ -4585,6 +4585,7 @@ dissect_sir(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tvb, offset, 4, ENC_NA);
offset += 4;
}
+ return tvb_captured_length(tvb);
}
static void
@@ -5025,13 +5026,14 @@ dissect_wsp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
* Called directly from UDP.
* Put "WSP" into the "Protocol" column.
*/
-static void
-dissect_wsp_fromudp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_wsp_fromudp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
col_set_str(pinfo->cinfo, COL_PROTOCOL, "WSP");
col_clear(pinfo->cinfo, COL_INFO);
dissect_wsp_common(tvb, pinfo, tree, wsp_fromudp_handle, TRUE);
+ return tvb_captured_length(tvb);
}
@@ -7163,7 +7165,7 @@ proto_register_wsp(void)
new_register_dissector("wsp-cl", dissect_wsp_fromwap_cl, proto_wsp);
heur_subdissector_list = register_heur_dissector_list("wsp");
- wsp_fromudp_handle = create_dissector_handle(dissect_wsp_fromudp,
+ wsp_fromudp_handle = new_create_dissector_handle(dissect_wsp_fromudp,
proto_wsp);
}
@@ -7354,7 +7356,7 @@ proto_reg_handoff_sir(void)
{
dissector_handle_t sir_handle;
- sir_handle = create_dissector_handle(dissect_sir, proto_sir);
+ sir_handle = new_create_dissector_handle(dissect_sir, proto_sir);
/* Add dissector bindings for SIR dissection */
dissector_add_string("media_type", "application/vnd.wap.sia", sir_handle);
diff --git a/epan/dissectors/packet-wtls.c b/epan/dissectors/packet-wtls.c
index 5bb33b5f6f..44786dd7fa 100644
--- a/epan/dissectors/packet-wtls.c
+++ b/epan/dissectors/packet-wtls.c
@@ -315,8 +315,8 @@ static value_string_ext wtls_vals_alert_description_ext = VALUE_STRING_EXT_INIT(
static void dissect_wtls_handshake (proto_tree *, tvbuff_t *, guint, guint);
/* Code to actually dissect the packets */
-static void
-dissect_wtls(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_wtls(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
int offset = 0;
@@ -422,6 +422,7 @@ dissect_wtls(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
}
+ return tvb_captured_length(tvb);
}
static int
@@ -1585,7 +1586,7 @@ proto_reg_handoff_wtls(void)
{
dissector_handle_t wtls_handle;
- wtls_handle = create_dissector_handle(dissect_wtls, proto_wtls);
+ wtls_handle = new_create_dissector_handle(dissect_wtls, proto_wtls);
dissector_add_uint("udp.port", UDP_PORT_WTLS_WSP, wtls_handle);
dissector_add_uint("udp.port", UDP_PORT_WTLS_WTP_WSP, wtls_handle);
dissector_add_uint("udp.port", UDP_PORT_WTLS_WSP_PUSH,wtls_handle);
diff --git a/epan/dissectors/packet-x11.c b/epan/dissectors/packet-x11.c
index dd6afe25f9..68180202d6 100644
--- a/epan/dissectors/packet-x11.c
+++ b/epan/dissectors/packet-x11.c
@@ -5757,8 +5757,8 @@ dissect_x11_error(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
*** ***
************************************************************************/
-static void
-dissect_x11(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_x11(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
col_set_str(pinfo->cinfo, COL_PROTOCOL, "X11");
@@ -5766,6 +5766,8 @@ dissect_x11(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dissect_x11_replies(tvb, pinfo, tree);
else
dissect_x11_requests(tvb, pinfo, tree);
+
+ return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
@@ -5861,7 +5863,7 @@ proto_reg_handoff_x11(void)
{
dissector_handle_t x11_handle;
- x11_handle = create_dissector_handle(dissect_x11, proto_x11);
+ x11_handle = new_create_dissector_handle(dissect_x11, proto_x11);
dissector_add_uint("tcp.port", TCP_PORT_X11, x11_handle);
dissector_add_uint("tcp.port", TCP_PORT_X11_2, x11_handle);
dissector_add_uint("tcp.port", TCP_PORT_X11_3, x11_handle);
diff --git a/epan/dissectors/packet-zebra.c b/epan/dissectors/packet-zebra.c
index 68bc820aff..9f76262f85 100644
--- a/epan/dissectors/packet-zebra.c
+++ b/epan/dissectors/packet-zebra.c
@@ -642,8 +642,8 @@ return offset;
+-------------------------------+
The Marker is 0xFF to distinguish it from a version 0 header.
*/
-static void
-dissect_zebra(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_zebra(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *ti;
proto_tree *zebra_tree;
@@ -699,6 +699,8 @@ dissect_zebra(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
left -= len;
}
}
+
+ return tvb_captured_length(tvb);
}
void
@@ -876,7 +878,7 @@ proto_reg_handoff_zebra(void)
{
dissector_handle_t zebra_handle;
- zebra_handle = create_dissector_handle(dissect_zebra, proto_zebra);
+ zebra_handle = new_create_dissector_handle(dissect_zebra, proto_zebra);
dissector_add_uint("tcp.port", TCP_PORT_ZEBRA, zebra_handle);
}