aboutsummaryrefslogtreecommitdiffstats
path: root/asn1
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2015-11-21 22:03:26 -0500
committerAnders Broman <a.broman58@gmail.com>2015-11-22 08:38:50 +0000
commitbcabd8df0f3d527d81ed7bc2ee4717ae225733bd (patch)
treec845dfe3c3ad2186910971f3fe27bda627ba10be /asn1
parentf9f88ff226835367972a1ceaf97b3c6d8844e330 (diff)
register_dissector -> new_register_dissector for ASN.1 dissectors.
Change-Id: I0476519c02ffdd426b4fdfe8a206d61b728c327a Reviewed-on: https://code.wireshark.org/review/12026 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'asn1')
-rw-r--r--asn1/ansi_tcap/packet-ansi_tcap-template.c9
-rw-r--r--asn1/ftam/packet-ftam-template.c13
-rw-r--r--asn1/goose/packet-goose-template.c46
-rw-r--r--asn1/h245/packet-h245-template.c14
-rw-r--r--asn1/h248/packet-h248-template.c16
-rw-r--r--asn1/lcsap/packet-lcsap-template.c7
-rw-r--r--asn1/lte-rrc/packet-lte-rrc-template.c70
-rw-r--r--asn1/mms/packet-mms-template.c15
-rw-r--r--asn1/mpeg-pes/packet-mpeg-pes-template.c19
-rw-r--r--asn1/p22/packet-p22-template.c11
-rw-r--r--asn1/p772/packet-p772-template.c11
-rw-r--r--asn1/pcap/packet-pcap-template.c7
-rw-r--r--asn1/q932/packet-q932-template.c8
-rw-r--r--asn1/rrc/packet-rrc-template.c7
-rw-r--r--asn1/s1ap/packet-s1ap-template.c7
-rw-r--r--asn1/spnego/packet-spnego-template.c8
-rw-r--r--asn1/sv/packet-sv-template.c10
-rw-r--r--asn1/t38/packet-t38-template.c12
-rw-r--r--asn1/tcap/packet-tcap-template.c19
-rw-r--r--asn1/tetra/packet-tetra-template.c11
20 files changed, 169 insertions, 151 deletions
diff --git a/asn1/ansi_tcap/packet-ansi_tcap-template.c b/asn1/ansi_tcap/packet-ansi_tcap-template.c
index f3020dfafa..77158b5dba 100644
--- a/asn1/ansi_tcap/packet-ansi_tcap-template.c
+++ b/asn1/ansi_tcap/packet-ansi_tcap-template.c
@@ -131,8 +131,6 @@ static const value_string ansi_tcap_national_op_code_family_vals[] = {
{ 0, NULL }
};
-static void dissect_ansi_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree);
-
/*
static dissector_handle_t tcap_handle = NULL;
static dissector_table_t sccp_ssn_table;
@@ -351,8 +349,8 @@ find_tcap_subdissector(tvbuff_t *tvb, asn1_ctx_t *actx, proto_tree *tree){
-static void
-dissect_ansi_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
+static int
+dissect_ansi_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data _U_)
{
proto_item *item=NULL;
proto_tree *tree=NULL;
@@ -412,6 +410,7 @@ dissect_ansi_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
}
}
#endif
+ return tvb_captured_length(tvb);
}
@@ -510,7 +509,7 @@ proto_register_ansi_tcap(void)
/* Register the protocol name and description */
proto_ansi_tcap = proto_register_protocol(PNAME, PSNAME, PFNAME);
- register_dissector("ansi_tcap", dissect_ansi_tcap, proto_ansi_tcap);
+ new_register_dissector("ansi_tcap", dissect_ansi_tcap, proto_ansi_tcap);
/* Note the high bit should be masked off when registering in this table (0x7fff)*/
ansi_tcap_national_opcode_table = register_dissector_table("ansi_tcap.nat.opcode", "ANSI TCAP National Opcodes", FT_UINT16, BASE_DEC, DISSECTOR_TABLE_ALLOW_DUPLICATE);
diff --git a/asn1/ftam/packet-ftam-template.c b/asn1/ftam/packet-ftam-template.c
index db96aa3ba4..0016c5bc0e 100644
--- a/asn1/ftam/packet-ftam-template.c
+++ b/asn1/ftam/packet-ftam-template.c
@@ -83,8 +83,8 @@ dissect_ftam_unstructured_binary(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tr
/*
* Dissect FTAM PDUs inside a PPDU.
*/
-static void
-dissect_ftam(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
+static int
+dissect_ftam(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data _U_)
{
int offset = 0;
int old_offset;
@@ -109,6 +109,7 @@ dissect_ftam(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
break;
}
}
+ return tvb_captured_length(tvb);
}
@@ -140,7 +141,7 @@ void proto_register_ftam(void) {
/* Register protocol */
proto_ftam = proto_register_protocol(PNAME, PSNAME, PFNAME);
- register_dissector("ftam", dissect_ftam, proto_ftam);
+ new_register_dissector("ftam", dissect_ftam, proto_ftam);
/* Register fields and subtrees */
proto_register_field_array(proto_ftam, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
@@ -152,9 +153,9 @@ void proto_register_ftam(void) {
/*--- proto_reg_handoff_ftam --- */
void proto_reg_handoff_ftam(void) {
- register_ber_oid_dissector("1.0.8571.1.1", dissect_ftam, proto_ftam,"iso-ftam(1)");
- register_ber_oid_dissector("1.0.8571.2.1", dissect_ftam, proto_ftam,"ftam-pci(1)");
- register_ber_oid_dissector("1.3.14.5.2.2", dissect_ftam, proto_ftam,"NIST file directory entry abstract syntax");
+ new_register_ber_oid_dissector("1.0.8571.1.1", dissect_ftam, proto_ftam,"iso-ftam(1)");
+ new_register_ber_oid_dissector("1.0.8571.2.1", dissect_ftam, proto_ftam,"ftam-pci(1)");
+ new_register_ber_oid_dissector("1.3.14.5.2.2", dissect_ftam, proto_ftam,"NIST file directory entry abstract syntax");
/* Unstructured text file document type FTAM-1 */
register_ber_oid_dissector("1.0.8571.5.1", dissect_ftam_unstructured_text, proto_ftam,"ISO FTAM unstructured text");
diff --git a/asn1/goose/packet-goose-template.c b/asn1/goose/packet-goose-template.c
index 69d597e0b9..d277aae719 100644
--- a/asn1/goose/packet-goose-template.c
+++ b/asn1/goose/packet-goose-template.c
@@ -60,8 +60,8 @@ static int ett_goose = -1;
/*
* Dissect GOOSE PDUs inside a PPDU.
*/
-static void
-dissect_goose(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
+static int
+dissect_goose(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data _U_)
{
int offset = 0;
int old_offset;
@@ -74,34 +74,34 @@ dissect_goose(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
col_set_str(pinfo->cinfo, COL_PROTOCOL, PNAME);
col_clear(pinfo->cinfo, COL_INFO);
- if (parent_tree){
- item = proto_tree_add_item(parent_tree, proto_goose, tvb, 0, -1, ENC_NA);
- tree = proto_item_add_subtree(item, ett_goose);
+ item = proto_tree_add_item(parent_tree, proto_goose, tvb, 0, -1, ENC_NA);
+ tree = proto_item_add_subtree(item, ett_goose);
- /* APPID */
- proto_tree_add_item(tree, hf_goose_appid, tvb, offset, 2, ENC_BIG_ENDIAN);
+ /* APPID */
+ proto_tree_add_item(tree, hf_goose_appid, tvb, offset, 2, ENC_BIG_ENDIAN);
- /* Length */
- length = tvb_get_ntohs(tvb, offset + 2);
- proto_tree_add_item(tree, hf_goose_length, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
+ /* Length */
+ length = tvb_get_ntohs(tvb, offset + 2);
+ proto_tree_add_item(tree, hf_goose_length, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
- /* Reserved 1 */
- proto_tree_add_item(tree, hf_goose_reserve1, tvb, offset + 4, 2, ENC_BIG_ENDIAN);
+ /* Reserved 1 */
+ proto_tree_add_item(tree, hf_goose_reserve1, tvb, offset + 4, 2, ENC_BIG_ENDIAN);
- /* Reserved 2 */
- proto_tree_add_item(tree, hf_goose_reserve2, tvb, offset + 6, 2, ENC_BIG_ENDIAN);
+ /* Reserved 2 */
+ proto_tree_add_item(tree, hf_goose_reserve2, tvb, offset + 6, 2, ENC_BIG_ENDIAN);
- offset = 8;
- while (offset < length){
- old_offset = offset;
- offset = dissect_goose_GOOSEpdu(FALSE, tvb, offset, &asn1_ctx , tree, -1);
- if (offset == old_offset) {
- proto_tree_add_expert(tree, pinfo, &ei_goose_zero_pdu, tvb, offset, -1);
- return;
- }
+ offset = 8;
+ while (offset < length){
+ old_offset = offset;
+ offset = dissect_goose_GOOSEpdu(FALSE, tvb, offset, &asn1_ctx , tree, -1);
+ if (offset == old_offset) {
+ proto_tree_add_expert(tree, pinfo, &ei_goose_zero_pdu, tvb, offset, -1);
+ break;
}
}
+
+ return tvb_captured_length(tvb);
}
@@ -141,7 +141,7 @@ void proto_register_goose(void) {
/* Register protocol */
proto_goose = proto_register_protocol(PNAME, PSNAME, PFNAME);
- register_dissector("goose", dissect_goose, proto_goose);
+ new_register_dissector("goose", dissect_goose, proto_goose);
/* Register fields and subtrees */
proto_register_field_array(proto_goose, hf, array_length(hf));
diff --git a/asn1/h245/packet-h245-template.c b/asn1/h245/packet-h245-template.c
index 02b23bac95..8d82c17db0 100644
--- a/asn1/h245/packet-h245-template.c
+++ b/asn1/h245/packet-h245-template.c
@@ -419,19 +419,20 @@ static void reset_h245_pi(void *dummy _U_)
#include "packet-h245-fn.c"
-static void
-dissect_h245(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
+static int
+dissect_h245(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data _U_)
{
/*
* MultimediaSystemControlMessage_handle is the handle for
* dissect_h245_h245, so we don't want to do any h245_pi or tap stuff here.
*/
dissect_tpkt_encap(tvb, pinfo, parent_tree, h245_reassembly, MultimediaSystemControlMessage_handle);
+ return tvb_captured_length(tvb);
}
-static void
-dissect_h245_h245(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
+static int
+dissect_h245_h245(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data _U_)
{
proto_item *it;
proto_tree *tr;
@@ -460,6 +461,7 @@ dissect_h245_h245(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
offset = (offset+0x07) & 0xfffffff8;
CLEANUP_CALL_AND_POP;
}
+ return tvb_captured_length(tvb);
}
void
@@ -536,8 +538,8 @@ void proto_register_h245(void) {
"Show h245 info in reversed order",
"Whether the dissector should print items of h245 Info column in reversed order",
&info_col_fmt_prepend);
- register_dissector("h245dg", dissect_h245_h245, proto_h245);
- register_dissector("h245", dissect_h245, proto_h245);
+ new_register_dissector("h245dg", dissect_h245_h245, proto_h245);
+ new_register_dissector("h245", dissect_h245, proto_h245);
nsp_object_dissector_table = register_dissector_table("h245.nsp.object", "H.245 NonStandardParameter (object)", FT_STRING, BASE_NONE, DISSECTOR_TABLE_ALLOW_DUPLICATE);
nsp_h221_dissector_table = register_dissector_table("h245.nsp.h221", "H.245 NonStandardParameter (h221)", FT_UINT32, BASE_HEX, DISSECTOR_TABLE_ALLOW_DUPLICATE);
diff --git a/asn1/h248/packet-h248-template.c b/asn1/h248/packet-h248-template.c
index 5161137601..e91dd307f3 100644
--- a/asn1/h248/packet-h248-template.c
+++ b/asn1/h248/packet-h248-template.c
@@ -1416,12 +1416,13 @@ static int dissect_h248_MtpAddress(gboolean implicit_tag, tvbuff_t *tvb, int off
#include "packet-h248-fn.c"
-static void dissect_h248_tpkt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
+static int dissect_h248_tpkt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) {
dissect_tpkt_encap(tvb, pinfo, tree, h248_desegment, h248_handle);
+ return tvb_captured_length(tvb);
}
-static void
-dissect_h248(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_h248(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *h248_item;
asn1_ctx_t asn1_ctx;
@@ -1453,7 +1454,7 @@ dissect_h248(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if(megaco_handle){
call_dissector(megaco_handle, tvb, pinfo, tree);
- return;
+ return tvb_captured_length(tvb);
}
}
{
@@ -1463,7 +1464,7 @@ dissect_h248(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
hidden_item = proto_tree_add_uint(tree, hf_248_magic_num, tvb, offset, 4, magic_num);
PROTO_ITEM_SET_HIDDEN(hidden_item);
if( dissector_try_uint(subdissector_table, magic_num, tvb, pinfo, tree) ) {
- return;
+ return tvb_captured_length(tvb);
}
}
}
@@ -1478,6 +1479,7 @@ dissect_h248(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dissect_h248_MegacoMessage(FALSE, tvb, 0, &asn1_ctx, h248_tree, -1);
+ return tvb_captured_length(tvb);
}
/*--- proto_register_h248 ----------------------------------------------*/
@@ -1612,8 +1614,8 @@ void proto_register_h248(void) {
/* Register protocol */
proto_h248 = proto_register_protocol(PNAME, PSNAME, PFNAME);
- register_dissector("h248", dissect_h248, proto_h248);
- register_dissector("h248.tpkt", dissect_h248_tpkt, proto_h248);
+ new_register_dissector("h248", dissect_h248, proto_h248);
+ new_register_dissector("h248.tpkt", dissect_h248_tpkt, proto_h248);
/* Register fields and subtrees */
proto_register_field_array(proto_h248, hf, array_length(hf));
diff --git a/asn1/lcsap/packet-lcsap-template.c b/asn1/lcsap/packet-lcsap-template.c
index 378306f9a2..5108f58c73 100644
--- a/asn1/lcsap/packet-lcsap-template.c
+++ b/asn1/lcsap/packet-lcsap-template.c
@@ -213,8 +213,8 @@ static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, p
}
-static void
-dissect_lcsap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_lcsap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *lcsap_item = NULL;
proto_tree *lcsap_tree = NULL;
@@ -227,6 +227,7 @@ dissect_lcsap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
lcsap_tree = proto_item_add_subtree(lcsap_item, ett_lcsap);
dissect_LCS_AP_PDU_PDU(tvb, pinfo, lcsap_tree, NULL);
+ return tvb_captured_length(tvb);
}
/*--- proto_reg_handoff_lcsap ---------------------------------------*/
@@ -306,7 +307,7 @@ void proto_register_lcsap(void) {
/* Register fields and subtrees */
proto_register_field_array(proto_lcsap, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
- register_dissector("lcsap", dissect_lcsap, proto_lcsap);
+ new_register_dissector("lcsap", dissect_lcsap, proto_lcsap);
/* Register dissector tables */
lcsap_ies_dissector_table = register_dissector_table("lcsap.ies", "LCS-AP-PROTOCOL-IES", FT_UINT32, BASE_DEC, DISSECTOR_TABLE_ALLOW_DUPLICATE);
diff --git a/asn1/lte-rrc/packet-lte-rrc-template.c b/asn1/lte-rrc/packet-lte-rrc-template.c
index 731eb52bc5..b44a5d2901 100644
--- a/asn1/lte-rrc/packet-lte-rrc-template.c
+++ b/asn1/lte-rrc/packet-lte-rrc-template.c
@@ -2668,8 +2668,8 @@ static void sr_lookup_configindex(guint32 config_index, guint16 *periodicity, gu
#include "packet-lte-rrc-fn.c"
-static void
-dissect_lte_rrc_DL_CCCH(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_lte_rrc_DL_CCCH(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *ti;
proto_tree *lte_rrc_tree;
@@ -2680,10 +2680,11 @@ dissect_lte_rrc_DL_CCCH(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ti = proto_tree_add_item(tree, proto_lte_rrc, tvb, 0, -1, ENC_NA);
lte_rrc_tree = proto_item_add_subtree(ti, ett_lte_rrc);
dissect_DL_CCCH_Message_PDU(tvb, pinfo, lte_rrc_tree, NULL);
+ return tvb_captured_length(tvb);
}
-static void
-dissect_lte_rrc_DL_DCCH(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_lte_rrc_DL_DCCH(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *ti;
proto_tree *lte_rrc_tree;
@@ -2694,11 +2695,12 @@ dissect_lte_rrc_DL_DCCH(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ti = proto_tree_add_item(tree, proto_lte_rrc, tvb, 0, -1, ENC_NA);
lte_rrc_tree = proto_item_add_subtree(ti, ett_lte_rrc);
dissect_DL_DCCH_Message_PDU(tvb, pinfo, lte_rrc_tree, NULL);
+ return tvb_captured_length(tvb);
}
-static void
-dissect_lte_rrc_UL_CCCH(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_lte_rrc_UL_CCCH(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *ti;
proto_tree *lte_rrc_tree;
@@ -2709,10 +2711,11 @@ dissect_lte_rrc_UL_CCCH(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ti = proto_tree_add_item(tree, proto_lte_rrc, tvb, 0, -1, ENC_NA);
lte_rrc_tree = proto_item_add_subtree(ti, ett_lte_rrc);
dissect_UL_CCCH_Message_PDU(tvb, pinfo, lte_rrc_tree, NULL);
+ return tvb_captured_length(tvb);
}
-static void
-dissect_lte_rrc_UL_DCCH(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_lte_rrc_UL_DCCH(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *ti;
proto_tree *lte_rrc_tree;
@@ -2723,10 +2726,11 @@ dissect_lte_rrc_UL_DCCH(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ti = proto_tree_add_item(tree, proto_lte_rrc, tvb, 0, -1, ENC_NA);
lte_rrc_tree = proto_item_add_subtree(ti, ett_lte_rrc);
dissect_UL_DCCH_Message_PDU(tvb, pinfo, lte_rrc_tree, NULL);
+ return tvb_captured_length(tvb);
}
-static void
-dissect_lte_rrc_BCCH_BCH(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_lte_rrc_BCCH_BCH(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *ti;
proto_tree *lte_rrc_tree;
@@ -2737,10 +2741,11 @@ dissect_lte_rrc_BCCH_BCH(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ti = proto_tree_add_item(tree, proto_lte_rrc, tvb, 0, -1, ENC_NA);
lte_rrc_tree = proto_item_add_subtree(ti, ett_lte_rrc);
dissect_BCCH_BCH_Message_PDU(tvb, pinfo, lte_rrc_tree, NULL);
+ return tvb_captured_length(tvb);
}
-static void
-dissect_lte_rrc_BCCH_DL_SCH(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_lte_rrc_BCCH_DL_SCH(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *ti;
proto_tree *lte_rrc_tree;
@@ -2751,10 +2756,11 @@ dissect_lte_rrc_BCCH_DL_SCH(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ti = proto_tree_add_item(tree, proto_lte_rrc, tvb, 0, -1, ENC_NA);
lte_rrc_tree = proto_item_add_subtree(ti, ett_lte_rrc);
dissect_BCCH_DL_SCH_Message_PDU(tvb, pinfo, lte_rrc_tree, NULL);
+ return tvb_captured_length(tvb);
}
-static void
-dissect_lte_rrc_PCCH(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_lte_rrc_PCCH(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *ti;
proto_tree *lte_rrc_tree;
@@ -2765,10 +2771,11 @@ dissect_lte_rrc_PCCH(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ti = proto_tree_add_item(tree, proto_lte_rrc, tvb, 0, -1, ENC_NA);
lte_rrc_tree = proto_item_add_subtree(ti, ett_lte_rrc);
dissect_PCCH_Message_PDU(tvb, pinfo, lte_rrc_tree, NULL);
+ return tvb_captured_length(tvb);
}
-static void
-dissect_lte_rrc_MCCH(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_lte_rrc_MCCH(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *ti;
proto_tree *lte_rrc_tree;
@@ -2779,10 +2786,11 @@ dissect_lte_rrc_MCCH(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ti = proto_tree_add_item(tree, proto_lte_rrc, tvb, 0, -1, ENC_NA);
lte_rrc_tree = proto_item_add_subtree(ti, ett_lte_rrc);
dissect_MCCH_Message_PDU(tvb, pinfo, lte_rrc_tree, NULL);
+ return tvb_captured_length(tvb);
}
-static void
-dissect_lte_rrc_Handover_Preparation_Info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_lte_rrc_Handover_Preparation_Info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *ti;
proto_tree *lte_rrc_tree;
@@ -2800,10 +2808,11 @@ dissect_lte_rrc_Handover_Preparation_Info(tvbuff_t *tvb, packet_info *pinfo, pro
dissect_lte_rrc_HandoverPreparationInformation_PDU(tvb, pinfo, lte_rrc_tree, NULL);
col_set_writable(pinfo->cinfo, TRUE);
+ return tvb_captured_length(tvb);
}
-static void
-dissect_lte_rrc_SBCCH_SL_BCH(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_lte_rrc_SBCCH_SL_BCH(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *ti;
proto_tree *lte_rrc_tree;
@@ -2814,6 +2823,7 @@ dissect_lte_rrc_SBCCH_SL_BCH(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
ti = proto_tree_add_item(tree, proto_lte_rrc, tvb, 0, -1, ENC_NA);
lte_rrc_tree = proto_item_add_subtree(ti, ett_lte_rrc);
dissect_SBCCH_SL_BCH_Message_PDU(tvb, pinfo, lte_rrc_tree, NULL);
+ return tvb_captured_length(tvb);
}
static void
@@ -3597,16 +3607,16 @@ void proto_register_lte_rrc(void) {
proto_lte_rrc = proto_register_protocol(PNAME, PSNAME, PFNAME);
/* These entry points will first create an lte_rrc root node */
- register_dissector("lte_rrc.dl_ccch", dissect_lte_rrc_DL_CCCH, proto_lte_rrc);
- register_dissector("lte_rrc.dl_dcch", dissect_lte_rrc_DL_DCCH, proto_lte_rrc);
- register_dissector("lte_rrc.ul_ccch", dissect_lte_rrc_UL_CCCH, proto_lte_rrc);
- register_dissector("lte_rrc.ul_dcch", dissect_lte_rrc_UL_DCCH, proto_lte_rrc);
- register_dissector("lte_rrc.bcch_bch", dissect_lte_rrc_BCCH_BCH, proto_lte_rrc);
- register_dissector("lte_rrc.bcch_dl_sch", dissect_lte_rrc_BCCH_DL_SCH, proto_lte_rrc);
- register_dissector("lte_rrc.pcch", dissect_lte_rrc_PCCH, proto_lte_rrc);
- register_dissector("lte_rrc.mcch", dissect_lte_rrc_MCCH, proto_lte_rrc);
- register_dissector("lte_rrc.handover_prep_info", dissect_lte_rrc_Handover_Preparation_Info, proto_lte_rrc);
- register_dissector("lte_rrc.sbcch_sl_bch", dissect_lte_rrc_SBCCH_SL_BCH, proto_lte_rrc);
+ new_register_dissector("lte_rrc.dl_ccch", dissect_lte_rrc_DL_CCCH, proto_lte_rrc);
+ new_register_dissector("lte_rrc.dl_dcch", dissect_lte_rrc_DL_DCCH, proto_lte_rrc);
+ new_register_dissector("lte_rrc.ul_ccch", dissect_lte_rrc_UL_CCCH, proto_lte_rrc);
+ new_register_dissector("lte_rrc.ul_dcch", dissect_lte_rrc_UL_DCCH, proto_lte_rrc);
+ new_register_dissector("lte_rrc.bcch_bch", dissect_lte_rrc_BCCH_BCH, proto_lte_rrc);
+ new_register_dissector("lte_rrc.bcch_dl_sch", dissect_lte_rrc_BCCH_DL_SCH, proto_lte_rrc);
+ new_register_dissector("lte_rrc.pcch", dissect_lte_rrc_PCCH, proto_lte_rrc);
+ new_register_dissector("lte_rrc.mcch", dissect_lte_rrc_MCCH, proto_lte_rrc);
+ new_register_dissector("lte_rrc.handover_prep_info", dissect_lte_rrc_Handover_Preparation_Info, proto_lte_rrc);
+ new_register_dissector("lte_rrc.sbcch_sl_bch", dissect_lte_rrc_SBCCH_SL_BCH, proto_lte_rrc);
/* Register fields and subtrees */
proto_register_field_array(proto_lte_rrc, hf, array_length(hf));
diff --git a/asn1/mms/packet-mms-template.c b/asn1/mms/packet-mms-template.c
index 53350f50e0..6a9b4f4529 100644
--- a/asn1/mms/packet-mms-template.c
+++ b/asn1/mms/packet-mms-template.c
@@ -57,8 +57,8 @@ static expert_field ei_mms_zero_pdu = EI_INIT;
/*
* Dissect MMS PDUs inside a PPDU.
*/
-static void
-dissect_mms(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
+static int
+dissect_mms(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data _U_)
{
int offset = 0;
int old_offset;
@@ -72,7 +72,7 @@ dissect_mms(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
tree = proto_item_add_subtree(item, ett_mms);
}
col_set_str(pinfo->cinfo, COL_PROTOCOL, "MMS");
- col_clear(pinfo->cinfo, COL_INFO);
+ col_clear(pinfo->cinfo, COL_INFO);
while (tvb_reported_length_remaining(tvb, offset) > 0){
old_offset=offset;
@@ -82,6 +82,7 @@ dissect_mms(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
break;
}
}
+ return tvb_captured_length(tvb);
}
@@ -110,7 +111,7 @@ void proto_register_mms(void) {
/* Register protocol */
proto_mms = proto_register_protocol(PNAME, PSNAME, PFNAME);
- register_dissector("mms", dissect_mms, proto_mms);
+ new_register_dissector("mms", dissect_mms, proto_mms);
/* Register fields and subtrees */
proto_register_field_array(proto_mms, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
@@ -164,14 +165,14 @@ dissect_mms_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, voi
if (!tvb_bytes_exist(tvb, offset, length))
return FALSE;
- dissect_mms(tvb, pinfo, parent_tree);
+ dissect_mms(tvb, pinfo, parent_tree, data);
return TRUE;
}
/*--- proto_reg_handoff_mms --- */
void proto_reg_handoff_mms(void) {
- register_ber_oid_dissector("1.0.9506.2.3", dissect_mms, proto_mms,"MMS");
- register_ber_oid_dissector("1.0.9506.2.1", dissect_mms, proto_mms,"mms-abstract-syntax-version1(1)");
+ new_register_ber_oid_dissector("1.0.9506.2.3", dissect_mms, proto_mms,"MMS");
+ new_register_ber_oid_dissector("1.0.9506.2.1", dissect_mms, proto_mms,"mms-abstract-syntax-version1(1)");
heur_dissector_add("cotp", dissect_mms_heur, "MMS over COTP", "mms_cotp", proto_mms, HEURISTIC_ENABLE);
heur_dissector_add("cotp_is", dissect_mms_heur, "MMS over COTP (inactive subset)", "mms_cotp_is", proto_mms, HEURISTIC_ENABLE);
}
diff --git a/asn1/mpeg-pes/packet-mpeg-pes-template.c b/asn1/mpeg-pes/packet-mpeg-pes-template.c
index 98147d3bcf..7904fae2dd 100644
--- a/asn1/mpeg-pes/packet-mpeg-pes-template.c
+++ b/asn1/mpeg-pes/packet-mpeg-pes-template.c
@@ -364,8 +364,8 @@ dissect_mpeg_pes_pack_header(tvbuff_t *tvb, gint offset,
return offset;
}
-static void
-dissect_mpeg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
+static int
+dissect_mpeg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data);
static gboolean
dissect_mpeg_pes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
@@ -499,7 +499,7 @@ dissect_mpeg_pes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
if (tvb_get_ntoh24(es, 0) == PES_PREFIX)
dissect_mpeg_pes(es, pinfo, tree, NULL);
else if (tvb_get_guint8(es, 0) == 0xff)
- dissect_mpeg(es, pinfo, tree);
+ dissect_mpeg(es, pinfo, tree, data);
else
proto_tree_add_item(tree, hf_mpeg_pes_data, es,
0, -1, ENC_NA);
@@ -521,17 +521,18 @@ dissect_mpeg_pes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
static heur_dissector_list_t heur_subdissector_list;
-static void
-dissect_mpeg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_mpeg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
heur_dtbl_entry_t *hdtbl_entry;
if (!dissector_try_heuristic(heur_subdissector_list, tvb, pinfo, tree, &hdtbl_entry, NULL)) {
- col_set_str(pinfo->cinfo, COL_PROTOCOL, "MPEG");
- col_clear(pinfo->cinfo, COL_INFO);
- if (tree)
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "MPEG");
+ col_clear(pinfo->cinfo, COL_INFO);
+
proto_tree_add_item(tree, proto_mpeg, tvb, 0, -1, ENC_NA);
}
+ return tvb_captured_length(tvb);
}
void
@@ -653,7 +654,7 @@ proto_register_mpeg_pes(void)
proto_mpeg = proto_register_protocol(
"Moving Picture Experts Group", "MPEG", "mpeg");
- register_dissector("mpeg", dissect_mpeg, proto_mpeg);
+ new_register_dissector("mpeg", dissect_mpeg, proto_mpeg);
heur_subdissector_list = register_heur_dissector_list("mpeg");
proto_mpeg_pes = proto_register_protocol(
diff --git a/asn1/p22/packet-p22-template.c b/asn1/p22/packet-p22-template.c
index 23378390f1..be4d8602e7 100644
--- a/asn1/p22/packet-p22-template.c
+++ b/asn1/p22/packet-p22-template.c
@@ -88,8 +88,8 @@ static gint ett_p22 = -1;
/*
* Dissect P22 PDUs inside a PPDU.
*/
-static void
-dissect_p22(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
+static int
+dissect_p22(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data _U_)
{
int offset = 0;
proto_item *item=NULL;
@@ -106,6 +106,7 @@ dissect_p22(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
col_set_str(pinfo->cinfo, COL_INFO, "InterPersonal");
dissect_p22_InformationObject(TRUE, tvb, offset, &asn1_ctx , tree, -1);
+ return tvb_captured_length(tvb);
}
@@ -126,7 +127,7 @@ void proto_register_p22(void) {
/* Register protocol */
proto_p22 = proto_register_protocol(PNAME, PSNAME, PFNAME);
- register_dissector("p22", dissect_p22, proto_p22);
+ new_register_dissector("p22", dissect_p22, proto_p22);
/* Register fields and subtrees */
proto_register_field_array(proto_p22, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
@@ -139,8 +140,8 @@ void proto_reg_handoff_p22(void) {
#include "packet-p22-dis-tab.c"
- register_ber_oid_dissector("2.6.1.10.0", dissect_p22, proto_p22, "InterPersonal Message (1984)");
- register_ber_oid_dissector("2.6.1.10.1", dissect_p22, proto_p22, "InterPersonal Message (1988)");
+ new_register_ber_oid_dissector("2.6.1.10.0", dissect_p22, proto_p22, "InterPersonal Message (1984)");
+ new_register_ber_oid_dissector("2.6.1.10.1", dissect_p22, proto_p22, "InterPersonal Message (1988)");
}
diff --git a/asn1/p772/packet-p772-template.c b/asn1/p772/packet-p772-template.c
index a8959c488c..c2261dc1a5 100644
--- a/asn1/p772/packet-p772-template.c
+++ b/asn1/p772/packet-p772-template.c
@@ -59,8 +59,8 @@ static gint ett_p772 = -1;
/*
* Dissect STANAG 4406 PDUs inside a PPDU.
*/
-static void
-dissect_p772(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
+static int
+dissect_p772(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data _U_)
{
int offset = 0;
proto_item *item=NULL;
@@ -77,6 +77,7 @@ dissect_p772(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
col_set_str(pinfo->cinfo, COL_INFO, "Military");
dissect_p772_InformationObject(TRUE, tvb, offset, &asn1_ctx , tree, -1);
+ return tvb_captured_length(tvb);
}
@@ -98,13 +99,13 @@ void proto_register_p772(void) {
/* Register protocol */
proto_p772 = proto_register_protocol(PNAME, PSNAME, PFNAME);
- register_dissector("p772", dissect_p772, proto_p772);
+ new_register_dissector("p772", dissect_p772, proto_p772);
/* Register fields and subtrees */
proto_register_field_array(proto_p772, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
- register_ber_syntax_dissector("STANAG 4406", proto_p772, dissect_p772);
+ new_register_ber_syntax_dissector("STANAG 4406", proto_p772, dissect_p772);
register_ber_oid_syntax(".p772", NULL, "STANAG 4406");
}
@@ -113,5 +114,5 @@ void proto_register_p772(void) {
void proto_reg_handoff_p772(void) {
#include "packet-p772-dis-tab.c"
- register_ber_oid_dissector("1.3.26.0.4406.0.4.1", dissect_p772, proto_p772, "STANAG 4406");
+ new_register_ber_oid_dissector("1.3.26.0.4406.0.4.1", dissect_p772, proto_p772, "STANAG 4406");
}
diff --git a/asn1/pcap/packet-pcap-template.c b/asn1/pcap/packet-pcap-template.c
index 8807b99d37..86f77cc13f 100644
--- a/asn1/pcap/packet-pcap-template.c
+++ b/asn1/pcap/packet-pcap-template.c
@@ -124,8 +124,8 @@ static int dissect_OutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
return (dissector_try_uint(pcap_proc_out_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
-static void
-dissect_pcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_pcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *pcap_item = NULL;
proto_tree *pcap_tree = NULL;
@@ -138,6 +138,7 @@ dissect_pcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
pcap_tree = proto_item_add_subtree(pcap_item, ett_pcap);
dissect_PCAP_PDU_PDU(tvb, pinfo, pcap_tree, NULL);
+ return tvb_captured_length(tvb);
}
/*--- proto_reg_handoff_pcap ---------------------------------------*/
@@ -187,7 +188,7 @@ void proto_register_pcap(void) {
pcap_module = prefs_register_protocol(proto_pcap, proto_reg_handoff_pcap);
/* Register dissector */
- register_dissector("pcap", dissect_pcap, proto_pcap);
+ new_register_dissector("pcap", dissect_pcap, proto_pcap);
/* Register dissector tables */
pcap_ies_dissector_table = register_dissector_table("pcap.ies", "PCAP-PROTOCOL-IES", FT_UINT32, BASE_DEC, DISSECTOR_TABLE_ALLOW_DUPLICATE);
diff --git a/asn1/q932/packet-q932-template.c b/asn1/q932/packet-q932-template.c
index 694908766b..55bc31c08d 100644
--- a/asn1/q932/packet-q932-template.c
+++ b/asn1/q932/packet-q932-template.c
@@ -281,9 +281,9 @@ dissect_q932_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
}
/*--- dissect_q932_apdu -----------------------------------------------------*/
-static void
-dissect_q932_apdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
- call_dissector(q932_ros_handle, tvb, pinfo, tree);
+static int
+dissect_q932_apdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) {
+ return call_dissector(q932_ros_handle, tvb, pinfo, tree);
}
/*--- proto_register_q932 ---------------------------------------------------*/
@@ -334,7 +334,7 @@ void proto_register_q932(void) {
/* Register protocol and dissector */
proto_q932 = proto_register_protocol(PNAME, PSNAME, PFNAME);
- register_dissector("q932.apdu", dissect_q932_apdu, proto_q932);
+ new_register_dissector("q932.apdu", dissect_q932_apdu, proto_q932);
/* Register fields and subtrees */
proto_register_field_array(proto_q932, hf, array_length(hf));
diff --git a/asn1/rrc/packet-rrc-template.c b/asn1/rrc/packet-rrc-template.c
index f4efd30d18..17cdc9d637 100644
--- a/asn1/rrc/packet-rrc-template.c
+++ b/asn1/rrc/packet-rrc-template.c
@@ -194,8 +194,8 @@ static void rrc_free_value(gpointer value ){
-static void
-dissect_rrc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_rrc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
/* FIX ME Currently don't know the 'starting point' of this protocol
* exported DL-DCCH-Message is the entry point.
@@ -241,6 +241,7 @@ dissect_rrc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
;
}
}
+ return tvb_captured_length(tvb);
}
static void
@@ -333,7 +334,7 @@ void proto_register_rrc(void) {
expert_rrc = expert_register_protocol(proto_rrc);
expert_register_field_array(expert_rrc, ei, array_length(ei));
- register_dissector("rrc", dissect_rrc, proto_rrc);
+ new_register_dissector("rrc", dissect_rrc, proto_rrc);
#include "packet-rrc-dis-reg.c"
diff --git a/asn1/s1ap/packet-s1ap-template.c b/asn1/s1ap/packet-s1ap-template.c
index f0da694a95..d8861dfd14 100644
--- a/asn1/s1ap/packet-s1ap-template.c
+++ b/asn1/s1ap/packet-s1ap-template.c
@@ -185,8 +185,8 @@ static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, p
}
-static void
-dissect_s1ap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_s1ap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *s1ap_item = NULL;
proto_tree *s1ap_tree = NULL;
@@ -199,6 +199,7 @@ dissect_s1ap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
s1ap_tree = proto_item_add_subtree(s1ap_item, ett_s1ap);
dissect_S1AP_PDU_PDU(tvb, pinfo, s1ap_tree, NULL);
+ return tvb_captured_length(tvb);
}
/*--- proto_reg_handoff_s1ap ---------------------------------------*/
@@ -273,7 +274,7 @@ void proto_register_s1ap(void) {
proto_register_subtree_array(ett, array_length(ett));
/* Register dissector */
- register_dissector("s1ap", dissect_s1ap, proto_s1ap);
+ new_register_dissector("s1ap", dissect_s1ap, proto_s1ap);
/* Register dissector tables */
s1ap_ies_dissector_table = register_dissector_table("s1ap.ies", "S1AP-PROTOCOL-IES", FT_UINT32, BASE_DEC, DISSECTOR_TABLE_ALLOW_DUPLICATE);
diff --git a/asn1/spnego/packet-spnego-template.c b/asn1/spnego/packet-spnego-template.c
index 6041d4fedb..64e5accd64 100644
--- a/asn1/spnego/packet-spnego-template.c
+++ b/asn1/spnego/packet-spnego-template.c
@@ -1386,8 +1386,8 @@ dissect_spnego_wrap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d
}
-static void
-dissect_spnego(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
+static int
+dissect_spnego(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data _U_)
{
proto_item *item;
proto_tree *subtree;
@@ -1454,7 +1454,7 @@ dissect_spnego(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
*
*/
dissect_spnego_NegotiationToken(FALSE, tvb, offset, &asn1_ctx, subtree, -1);
-
+ return tvb_captured_length(tvb);
}
/*--- proto_register_spnego -------------------------------------------*/
@@ -1538,7 +1538,7 @@ void proto_register_spnego(void) {
/* Register protocol */
proto_spnego = proto_register_protocol(PNAME, PSNAME, PFNAME);
- register_dissector("spnego", dissect_spnego, proto_spnego);
+ new_register_dissector("spnego", dissect_spnego, proto_spnego);
proto_spnego_krb5 = proto_register_protocol("SPNEGO-KRB5",
"SPNEGO-KRB5",
diff --git a/asn1/sv/packet-sv-template.c b/asn1/sv/packet-sv-template.c
index c44321a8dd..d587a0237b 100644
--- a/asn1/sv/packet-sv-template.c
+++ b/asn1/sv/packet-sv-template.c
@@ -186,8 +186,8 @@ dissect_PhsMeas1(gboolean implicit_tag, packet_info *pinfo, proto_tree *tree, tv
/*
* Dissect SV PDUs inside a PPDU.
*/
-static void
-dissect_sv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
+static int
+dissect_sv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data _U_)
{
int offset = 0;
int old_offset;
@@ -225,8 +225,8 @@ dissect_sv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
}
}
- if(tree)
- tap_queue_packet(sv_tap, pinfo, &sv_data);
+ tap_queue_packet(sv_tap, pinfo, &sv_data);
+ return tvb_captured_length(tvb);
}
@@ -314,7 +314,7 @@ void proto_register_sv(void) {
/* Register protocol */
proto_sv = proto_register_protocol(PNAME, PSNAME, PFNAME);
- register_dissector("sv", dissect_sv, proto_sv);
+ new_register_dissector("sv", dissect_sv, proto_sv);
/* Register fields and subtrees */
proto_register_field_array(proto_sv, hf, array_length(hf));
diff --git a/asn1/t38/packet-t38-template.c b/asn1/t38/packet-t38-template.c
index eb209a1caf..7cb819bfe7 100644
--- a/asn1/t38/packet-t38-template.c
+++ b/asn1/t38/packet-t38-template.c
@@ -501,8 +501,8 @@ init_t38_info_conv(packet_info *pinfo)
}
/* Entry point for dissection */
-static void
-dissect_t38_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_t38_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint8 octet1;
proto_item *it;
@@ -515,8 +515,7 @@ dissect_t38_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (dissect_possible_rtpv2_packets_as_rtp){
octet1 = tvb_get_guint8(tvb, offset);
if (RTP_VERSION(octet1) == 2){
- call_dissector(rtp_handle,tvb,pinfo,tree);
- return;
+ return call_dissector(rtp_handle,tvb,pinfo,tree);
}
}
@@ -548,6 +547,7 @@ dissect_t38_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
"[MALFORMED PACKET or wrong preference settings]");
col_append_str(pinfo->cinfo, COL_INFO, " [Malformed?]");
}
+ return tvb_captured_length(tvb);
}
static void
@@ -720,7 +720,7 @@ proto_register_t38(void)
proto_register_subtree_array(ett, array_length(ett));
expert_t38 = expert_register_protocol(proto_t38);
expert_register_field_array(expert_t38, ei, array_length(ei));
- register_dissector("t38_udp", dissect_t38_udp, proto_t38);
+ new_register_dissector("t38_udp", dissect_t38_udp, proto_t38);
/* Init reassemble tables for HDLC */
register_init_routine(t38_defragment_init);
@@ -776,7 +776,7 @@ proto_reg_handoff_t38(void)
static guint udp_port;
if (!t38_prefs_initialized) {
- t38_udp_handle=create_dissector_handle(dissect_t38_udp, proto_t38);
+ t38_udp_handle=new_create_dissector_handle(dissect_t38_udp, proto_t38);
t38_tcp_handle=create_dissector_handle(dissect_t38_tcp, proto_t38);
t38_tcp_pdu_handle=create_dissector_handle(dissect_t38_tcp_pdu, proto_t38);
rtp_handle = find_dissector("rtp");
diff --git a/asn1/tcap/packet-tcap-template.c b/asn1/tcap/packet-tcap-template.c
index 83e5b6a991..1c43262cb7 100644
--- a/asn1/tcap/packet-tcap-template.c
+++ b/asn1/tcap/packet-tcap-template.c
@@ -121,8 +121,6 @@ static int dissect_tcap_ITU_ComponentPDU(gboolean implicit_tag _U_, tvbuff_t *tv
static GHashTable* ansi_sub_dissectors = NULL;
static GHashTable* itu_sub_dissectors = NULL;
-static void dissect_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree);
-
extern void add_ansi_tcap_subdissector(guint32 ssn, dissector_handle_t dissector) {
g_hash_table_insert(ansi_sub_dissectors,GUINT_TO_POINTER(ssn),dissector);
dissector_add_uint("sccp.ssn",ssn,tcap_handle);
@@ -1966,8 +1964,8 @@ const value_string tcap_component_type_str[] = {
{ 0, NULL }
};
-static void
-dissect_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
+static int
+dissect_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data _U_)
{
proto_item *item=NULL;
proto_tree *tree=NULL;
@@ -2003,12 +2001,10 @@ dissect_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
case 5:
case 6:
case 22:
- call_dissector(ansi_tcap_handle, tvb, pinfo, parent_tree);
- return;
- break;
+ return call_dissector(ansi_tcap_handle, tvb, pinfo, parent_tree);
default:
- return;
+ return tvb_captured_length(tvb);
}
}
@@ -2057,6 +2053,7 @@ dissect_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
(p_tcap_context->callback)(tvb, pinfo, tcap_stat_tree, p_tcap_context);
}
}
+ return tvb_captured_length(tvb);
}
void
@@ -2217,9 +2214,9 @@ proto_register_tcap(void)
itu_sub_dissectors = g_hash_table_new(g_direct_hash,g_direct_equal);
/* 'globally' register dissector */
- register_dissector("tcap", dissect_tcap, proto_tcap);
+ new_register_dissector("tcap", dissect_tcap, proto_tcap);
- tcap_handle = create_dissector_handle(dissect_tcap, proto_tcap);
+ tcap_handle = new_create_dissector_handle(dissect_tcap, proto_tcap);
register_init_routine(&init_tcap);
register_cleanup_routine(&cleanup_tcap);
@@ -2474,7 +2471,7 @@ call_tcap_dissector(dissector_handle_t handle, tvbuff_t* tvb, packet_info* pinfo
requested_subdissector_handle = handle;
TRY {
- dissect_tcap(tvb, pinfo, tree);
+ dissect_tcap(tvb, pinfo, tree, NULL);
} CATCH_ALL {
requested_subdissector_handle = NULL;
RETHROW;
diff --git a/asn1/tetra/packet-tetra-template.c b/asn1/tetra/packet-tetra-template.c
index dbd27ff339..49a4594f0d 100644
--- a/asn1/tetra/packet-tetra-template.c
+++ b/asn1/tetra/packet-tetra-template.c
@@ -50,7 +50,6 @@ static int proto_tetra = -1;
static dissector_handle_t data_handle = NULL;
static dissector_handle_t tetra_handle;
-static void dissect_tetra(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
static int global_tetra_port = 7074;
@@ -430,10 +429,9 @@ static void dissect_tetra_UNITDATA_REQ(tvbuff_t *tvb, packet_info *pinfo, proto_
}
}
-static void
-dissect_tetra(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_tetra(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
-
proto_item *tetra_item = NULL;
proto_item *tetra_sub_item = NULL;
proto_tree *tetra_tree = NULL;
@@ -546,6 +544,7 @@ dissect_tetra(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
break;
}
}
+ return tvb_captured_length(tvb);
}
void proto_reg_handoff_tetra(void)
@@ -554,7 +553,7 @@ void proto_reg_handoff_tetra(void)
if (!initialized) {
data_handle = find_dissector("data");
- tetra_handle = create_dissector_handle(dissect_tetra, proto_tetra);
+ tetra_handle = new_create_dissector_handle(dissect_tetra, proto_tetra);
dissector_add_uint("udp.port", global_tetra_port, tetra_handle);
}
@@ -643,7 +642,7 @@ void proto_register_tetra (void)
proto_tetra = proto_register_protocol("TETRA Protocol", "tetra", "tetra");
proto_register_field_array (proto_tetra, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
- register_dissector("tetra", dissect_tetra, proto_tetra);
+ new_register_dissector("tetra", dissect_tetra, proto_tetra);
expert_tetra = expert_register_protocol(proto_tetra);
expert_register_field_array(expert_tetra, ei, array_length(ei));