aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorJakub Zawadzki <darkjames-ws@darkjames.pl>2013-08-05 19:09:44 +0000
committerJakub Zawadzki <darkjames-ws@darkjames.pl>2013-08-05 19:09:44 +0000
commitf4bcbeb9f26874ab763e78056638541a5b371cde (patch)
tree0cfd0c6f58226d6d85bdc0613cdcbfc97432e228 /epan
parentd3af98bb91b83d58b03a6264423b658af111d44b (diff)
Keep result of [new_]register_dissector in some dissectors. [2 of x]
(don't create new dissector handle if we can use already existing one) svn path=/trunk/; revision=51159
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-ansi_637.c11
-rw-r--r--epan/dissectors/packet-ansi_801.c8
-rw-r--r--epan/dissectors/packet-asterix.c6
-rw-r--r--epan/dissectors/packet-atm.c12
-rw-r--r--epan/dissectors/packet-ber.c8
-rw-r--r--epan/dissectors/packet-bfcp.c7
-rw-r--r--epan/dissectors/packet-bootp.c7
-rw-r--r--epan/dissectors/packet-brp.c6
-rw-r--r--epan/dissectors/packet-cfm.c6
-rw-r--r--epan/dissectors/packet-etch.c6
-rw-r--r--epan/dissectors/packet-fcgi.c6
-rw-r--r--epan/dissectors/packet-ged125.c13
-rw-r--r--epan/dissectors/packet-giop.c3
-rw-r--r--epan/dissectors/packet-hdfsdata.c6
-rw-r--r--epan/dissectors/packet-imap.c9
-rw-r--r--epan/dissectors/packet-imf.c2
-rw-r--r--epan/dissectors/packet-isis.c7
-rw-r--r--epan/dissectors/packet-isup.c7
-rw-r--r--epan/dissectors/packet-ixveriwave.c8
-rw-r--r--epan/dissectors/packet-mbtcp.c25
-rw-r--r--epan/dissectors/packet-mikey.c6
-rw-r--r--epan/dissectors/packet-mp2t.c9
-rw-r--r--epan/dissectors/packet-mux27010.c9
-rw-r--r--epan/dissectors/packet-nwmtp.c8
-rw-r--r--epan/dissectors/packet-sscop.c5
-rw-r--r--epan/dissectors/packet-sync.c3
-rw-r--r--epan/dissectors/packet-synphasor.c6
-rw-r--r--epan/dissectors/packet-tds.c5
-rw-r--r--epan/dissectors/packet-tnef.c2
-rw-r--r--epan/dissectors/packet-tpncp.c13
-rw-r--r--epan/dissectors/packet-tzsp.c7
31 files changed, 107 insertions, 129 deletions
diff --git a/epan/dissectors/packet-ansi_637.c b/epan/dissectors/packet-ansi_637.c
index 4843af86a7..9e7ddff68d 100644
--- a/epan/dissectors/packet-ansi_637.c
+++ b/epan/dissectors/packet-ansi_637.c
@@ -197,6 +197,9 @@ static gint ett_ansi_637_tele = -1;
static gint ett_ansi_637_trans = -1;
static gint ett_params = -1;
+static dissector_handle_t ansi_637_tele_handle;
+static dissector_handle_t ansi_637_trans_handle;
+
static guint32 ansi_637_trans_tele_id;
static char ansi_637_bigbuf[1024];
static char gsm_637_bigbuf[1024];
@@ -2331,8 +2334,8 @@ proto_register_ansi_637(void)
proto_ansi_637_trans =
proto_register_protocol(ansi_proto_name_trans, "ANSI IS-637-A Transport", "ansi_637_trans");
- register_dissector("ansi_637_tele", dissect_ansi_637_tele, proto_ansi_637_tele);
- register_dissector("ansi_637_trans", dissect_ansi_637_trans, proto_ansi_637_trans);
+ ansi_637_tele_handle = register_dissector("ansi_637_tele", dissect_ansi_637_tele, proto_ansi_637_tele);
+ ansi_637_trans_handle = register_dissector("ansi_637_trans", dissect_ansi_637_trans, proto_ansi_637_trans);
/* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_ansi_637_tele, hf_tele, array_length(hf_tele));
@@ -2348,13 +2351,9 @@ proto_register_ansi_637(void)
void
proto_reg_handoff_ansi_637(void)
{
- dissector_handle_t ansi_637_tele_handle;
- dissector_handle_t ansi_637_trans_handle;
dissector_handle_t ansi_637_trans_app_handle;
guint i;
- ansi_637_tele_handle = create_dissector_handle(dissect_ansi_637_tele, proto_ansi_637_tele);
- ansi_637_trans_handle = create_dissector_handle(dissect_ansi_637_trans, proto_ansi_637_trans);
ansi_637_trans_app_handle = create_dissector_handle(dissect_ansi_637_trans_app, proto_ansi_637_trans);
/* Dissect messages embedded in SIP */
diff --git a/epan/dissectors/packet-ansi_801.c b/epan/dissectors/packet-ansi_801.c
index ab7f9dea4f..7a42cb8ead 100644
--- a/epan/dissectors/packet-ansi_801.c
+++ b/epan/dissectors/packet-ansi_801.c
@@ -97,6 +97,8 @@ static int hf_ansi_801_num_fixes = -1;
static int hf_ansi_801_t_betw_fixes = -1;
static int hf_ansi_801_offset_req = -1;
+static dissector_handle_t ansi_801_handle;
+
static char bigbuf[1024];
static dissector_handle_t data_handle;
@@ -2385,17 +2387,13 @@ proto_register_ansi_801(void)
proto_register_subtree_array(ett, array_length(ett));
/* subdissector code */
- register_dissector("ansi_801", dissect_ansi_801, proto_ansi_801);
+ ansi_801_handle = register_dissector("ansi_801", dissect_ansi_801, proto_ansi_801);
}
void
proto_reg_handoff_ansi_801(void)
{
- dissector_handle_t ansi_801_handle;
-
- ansi_801_handle = create_dissector_handle(dissect_ansi_801, proto_ansi_801);
-
dissector_add_uint("ansi_map.pld", ANSI_801_FORWARD, ansi_801_handle);
dissector_add_uint("ansi_map.pld", ANSI_801_REVERSE, ansi_801_handle);
dissector_add_uint("ansi_a.pld", ANSI_801_FORWARD, ansi_801_handle);
diff --git a/epan/dissectors/packet-asterix.c b/epan/dissectors/packet-asterix.c
index 52fcbc5d1d..20b6236ae5 100644
--- a/epan/dissectors/packet-asterix.c
+++ b/epan/dissectors/packet-asterix.c
@@ -1466,9 +1466,9 @@ static gint ett_065_050 = -1;
static gint ett_065_RE = -1;
static gint ett_065_SP = -1;
+static dissector_handle_t asterix_handle;
static dissector_handle_t data_handle = NULL;
-static dissector_handle_t asterix_handle;
#define FIXED 0x01
#define REPETITIVE 0x02
@@ -6152,13 +6152,13 @@ void proto_register_asterix (void)
proto_register_field_array (proto_asterix, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
- register_dissector ("asterix", dissect_asterix, proto_asterix);
+
+ asterix_handle = register_dissector ("asterix", dissect_asterix, proto_asterix);
}
void proto_reg_handoff_asterix (void)
{
data_handle = find_dissector ("data");
- asterix_handle = create_dissector_handle (dissect_asterix, proto_asterix);
dissector_add_uint ("udp.port", ASTERIX_PORT, asterix_handle);
}
diff --git a/epan/dissectors/packet-atm.c b/epan/dissectors/packet-atm.c
index d71bbd2afd..98b28b008a 100644
--- a/epan/dissectors/packet-atm.c
+++ b/epan/dissectors/packet-atm.c
@@ -128,6 +128,9 @@ static gint ett_aal1 = -1;
static gint ett_aal3_4 = -1;
static gint ett_oamaal = -1;
+static dissector_handle_t atm_handle;
+static dissector_handle_t atm_untruncated_handle;
+
static dissector_handle_t eth_withoutfcs_handle;
static dissector_handle_t tr_handle;
static dissector_handle_t fr_handle;
@@ -2148,8 +2151,8 @@ proto_register_atm(void)
"ATM LANE", "lane");
register_dissector("lane", dissect_lane, proto_atm_lane);
- register_dissector("atm_untruncated", dissect_atm_untruncated, proto_atm);
- register_dissector("atm_truncated", dissect_atm, proto_atm);
+ atm_handle = register_dissector("atm_truncated", dissect_atm, proto_atm);
+ atm_untruncated_handle = register_dissector("atm_untruncated", dissect_atm_untruncated, proto_atm);
register_dissector("atm_oam_cell", dissect_atm_oam_cell, proto_oamaal);
atm_module = prefs_register_protocol ( proto_atm, NULL );
@@ -2166,8 +2169,6 @@ proto_register_atm(void)
void
proto_reg_handoff_atm(void)
{
- dissector_handle_t atm_handle, atm_untruncated_handle;
-
/*
* Get handles for the Ethernet, Token Ring, Frame Relay, LLC,
* SSCOP, LANE, and ILMI dissectors.
@@ -2186,11 +2187,8 @@ proto_reg_handoff_atm(void)
fp_handle = find_dissector("fp");
gprs_ns_handle = find_dissector("gprs_ns");
- atm_handle = create_dissector_handle(dissect_atm, proto_atm);
dissector_add_uint("wtap_encap", WTAP_ENCAP_ATM_PDUS, atm_handle);
- atm_untruncated_handle = create_dissector_handle(dissect_atm_untruncated,
- proto_atm);
dissector_add_uint("wtap_encap", WTAP_ENCAP_ATM_PDUS_UNTRUNCATED,
atm_untruncated_handle);
}
diff --git a/epan/dissectors/packet-ber.c b/epan/dissectors/packet-ber.c
index 3fbc143f14..dcd54b1efb 100644
--- a/epan/dissectors/packet-ber.c
+++ b/epan/dissectors/packet-ber.c
@@ -179,6 +179,8 @@ static expert_field ei_ber_illegal_padding = EI_INIT;
static expert_field ei_ber_invalid_format_generalized_time = EI_INIT;
static expert_field ei_ber_invalid_format_utctime = EI_INIT;
+static dissector_handle_t ber_handle;
+
static gboolean show_internal_ber_fields = FALSE;
static gboolean decode_octetstring_as_ber = FALSE;
static gboolean decode_primitive_as_ber = FALSE;
@@ -5334,7 +5336,9 @@ proto_register_ber(void)
users_flds);
proto_ber = proto_register_protocol("Basic Encoding Rules (ASN.1 X.690)", "BER", "ber");
- register_dissector ("ber", dissect_ber, proto_ber);
+
+ ber_handle = register_dissector("ber", dissect_ber, proto_ber);
+
proto_register_field_array(proto_ber, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
expert_ber = expert_register_protocol(proto_ber);
@@ -5386,12 +5390,10 @@ void
proto_reg_handoff_ber(void)
{
guint i = 1;
- dissector_handle_t ber_handle;
oid_add_from_string("asn1", "2.1");
oid_add_from_string("basic-encoding", "2.1.1");
- ber_handle = create_dissector_handle(dissect_ber, proto_ber);
dissector_add_uint("wtap_encap", WTAP_ENCAP_BER, ber_handle);
ber_decode_as_foreach(ber_add_syntax_name, &i);
diff --git a/epan/dissectors/packet-bfcp.c b/epan/dissectors/packet-bfcp.c
index 1ce174378d..3eaf4dfa86 100644
--- a/epan/dissectors/packet-bfcp.c
+++ b/epan/dissectors/packet-bfcp.c
@@ -77,6 +77,8 @@ static gint ett_bfcp_attr = -1;
static expert_field ei_bfcp_attribute_length_too_small = EI_INIT;
+static dissector_handle_t bfcp_handle;
+
/* Initialize BFCP primitives */
static const value_string map_bfcp_primitive[] = {
{ 0, "<Invalid Primitive>"},
@@ -667,7 +669,7 @@ void proto_register_bfcp(void)
proto_bfcp = proto_register_protocol("Binary Floor Control Protocol",
"BFCP", "bfcp");
- register_dissector("bfcp", dissect_bfcp, proto_bfcp);
+ bfcp_handle = register_dissector("bfcp", dissect_bfcp, proto_bfcp);
bfcp_module = prefs_register_protocol(proto_bfcp,
proto_reg_handoff_bfcp);
@@ -695,11 +697,8 @@ void proto_reg_handoff_bfcp(void)
*/
if (!prefs_initialized)
{
- dissector_handle_t bfcp_handle;
-
heur_dissector_add("tcp", dissect_bfcp_heur, proto_bfcp);
heur_dissector_add("udp", dissect_bfcp_heur, proto_bfcp);
- bfcp_handle = create_dissector_handle(dissect_bfcp, proto_bfcp);
dissector_add_handle("tcp.port", bfcp_handle);
dissector_add_handle("udp.port", bfcp_handle);
prefs_initialized = TRUE;
diff --git a/epan/dissectors/packet-bootp.c b/epan/dissectors/packet-bootp.c
index 3c17de2068..76ca9f1c2b 100644
--- a/epan/dissectors/packet-bootp.c
+++ b/epan/dissectors/packet-bootp.c
@@ -481,6 +481,8 @@ static expert_field ei_bootp_suboption_invalid = EI_INIT;
static expert_field ei_bootp_secs_le = EI_INIT;
static expert_field ei_bootp_end_option_missing = EI_INIT;
+static dissector_handle_t bootp_handle;
+
/* RFC2937 The Name Service Search Option for DHCP */
#define RFC2937_LOCAL_NAMING_INFORMATION 0
#define RFC2937_DOMAIN_NAME_SERVER_OPTION 6
@@ -6895,7 +6897,7 @@ proto_register_bootp(void)
register_init_routine(&bootp_init_protocol);
/* Allow dissector to find be found by name. */
- register_dissector("bootp", dissect_bootp, proto_bootp);
+ bootp_handle = register_dissector("bootp", dissect_bootp, proto_bootp);
bootp_module = prefs_register_protocol(proto_bootp, NULL);
@@ -6943,9 +6945,6 @@ proto_register_bootp(void)
void
proto_reg_handoff_bootp(void)
{
- dissector_handle_t bootp_handle;
-
- bootp_handle = create_dissector_handle(dissect_bootp, proto_bootp);
dissector_add_uint("udp.port", UDP_PORT_BOOTPS, bootp_handle);
dissector_add_uint("udp.port", UDP_PORT_BOOTPC, bootp_handle);
}
diff --git a/epan/dissectors/packet-brp.c b/epan/dissectors/packet-brp.c
index 13ac9e7f49..72a1b3ef9f 100644
--- a/epan/dissectors/packet-brp.c
+++ b/epan/dissectors/packet-brp.c
@@ -44,6 +44,8 @@ void proto_reg_handoff_brp(void);
/* Wireshark ID of the BRP protocol */
static int proto_brp = -1;
+static dissector_handle_t brp_handle;
+
/*static int global_brp_port = 1958; *//* The port is registered for another protocol */
static const value_string brp_packettype_names[] = {
@@ -412,18 +414,16 @@ void proto_register_brp (void)
"Set the UDP port for BRP messages",
10, &global_brp_port);
- new_register_dissector("brp", dissect_brp, proto_brp);
+ brp_handle = new_register_dissector("brp", dissect_brp, proto_brp);
}
/*--- proto_reg_handoff_brp -------------------------------------------*/
void proto_reg_handoff_brp(void)
{
static gboolean initialized = FALSE;
- static dissector_handle_t brp_handle;
static guint saved_brp_port;
if (!initialized) {
- brp_handle = new_create_dissector_handle(dissect_brp, proto_brp);
dissector_add_handle("udp.port", brp_handle);
initialized = TRUE;
} else {
diff --git a/epan/dissectors/packet-cfm.c b/epan/dissectors/packet-cfm.c
index d0162d2d89..9168915659 100644
--- a/epan/dissectors/packet-cfm.c
+++ b/epan/dissectors/packet-cfm.c
@@ -429,6 +429,8 @@ static gint ett_cfm_all_tlvs = -1;
static gint ett_cfm_tlv = -1;
static gint ett_cfm_raps_flags = -1;
+static dissector_handle_t cfm_handle;
+
/* CFM EOAM sub-protocol dissectors: CCM, LBM, LBR, LTM, LTR */
static int dissect_cfm_ccm(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset)
{
@@ -2110,7 +2112,7 @@ void proto_register_cfm(void)
"cfm" /* abbrev */
);
- register_dissector("cfm", dissect_cfm, proto_cfm);
+ cfm_handle = register_dissector("cfm", dissect_cfm, proto_cfm);
proto_register_field_array(proto_cfm, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
@@ -2120,8 +2122,6 @@ void proto_register_cfm(void)
/* Register CFM OEAM protocol handler */
void proto_reg_handoff_cfm(void)
{
- dissector_handle_t cfm_handle;
- cfm_handle = create_dissector_handle(dissect_cfm, proto_cfm);
dissector_add_uint("ethertype", ETHERTYPE_CFM, cfm_handle);
}
diff --git a/epan/dissectors/packet-etch.c b/epan/dissectors/packet-etch.c
index f3396f70a0..dd75a0421e 100644
--- a/epan/dissectors/packet-etch.c
+++ b/epan/dissectors/packet-etch.c
@@ -134,6 +134,8 @@ static int hf_etch_struct = -1;
static int hf_etch_dim = -1;
static int hf_etch_symbol = -1;
+static dissector_handle_t etch_handle;
+
/*
* internal fields/defines for dissector
*/
@@ -950,7 +952,7 @@ void proto_register_etch(void)
proto_register_field_array(proto_etch, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
- new_register_dissector("etch", dissect_etch, proto_etch);
+ etch_handle = new_register_dissector("etch", dissect_etch, proto_etch);
register_init_routine(&etch_dissector_init);
@@ -973,12 +975,10 @@ void proto_register_etch(void)
void proto_reg_handoff_etch(void)
{
static gboolean etch_prefs_initialized = FALSE;
- static dissector_handle_t etch_handle;
static guint old_etch_port = 0;
/* create dissector handle only once */
if(!etch_prefs_initialized) {
- etch_handle = new_create_dissector_handle(dissect_etch, proto_etch);
/* add heuristic dissector for tcp */
heur_dissector_add("tcp", dissect_etch, proto_etch);
etch_prefs_initialized = TRUE;
diff --git a/epan/dissectors/packet-fcgi.c b/epan/dissectors/packet-fcgi.c
index 4252a3a255..c6e3b5915f 100644
--- a/epan/dissectors/packet-fcgi.c
+++ b/epan/dissectors/packet-fcgi.c
@@ -51,6 +51,8 @@ static int ett_fcgi_begin_request = -1;
static int ett_fcgi_end_request = -1;
static int ett_fcgi_params = -1;
+static dissector_handle_t fcgi_handle;
+
#define FCGI_BEGIN_REQUEST 1
#define FCGI_ABORT_REQUEST 2
#define FCGI_END_REQUEST 3
@@ -396,18 +398,16 @@ proto_register_fcgi(void)
10,
&tcp_port);
- register_dissector("fcgi", dissect_fcgi, proto_fcgi);
+ fcgi_handle = register_dissector("fcgi", dissect_fcgi, proto_fcgi);
}
void
proto_reg_handoff_fcgi(void)
{
static gboolean initialized = FALSE;
- static dissector_handle_t fcgi_handle;
static guint saved_tcp_port;
if (!initialized) {
- fcgi_handle = create_dissector_handle(dissect_fcgi, proto_fcgi);
dissector_add_handle("tcp.port", fcgi_handle); /* for "decode as" */
initialized = TRUE;
} else if (saved_tcp_port != 0) {
diff --git a/epan/dissectors/packet-ged125.c b/epan/dissectors/packet-ged125.c
index acb8832a91..94ec632f3e 100644
--- a/epan/dissectors/packet-ged125.c
+++ b/epan/dissectors/packet-ged125.c
@@ -153,6 +153,8 @@ static expert_field ei_ged125_service_control_value_unknown = EI_INIT;
static expert_field ei_ged125_trunk_group_id = EI_INIT;
static expert_field ei_ged125_TrunkCount_invalid = EI_INIT;
+static dissector_handle_t ged125_handle;
+
/* Preferences */
static guint global_tcp_port_ged125 = 0;
static gboolean ged125_desegment_body = TRUE;
@@ -1752,7 +1754,8 @@ proto_register_ged125 (void)
proto_register_subtree_array (ett, array_length (ett));
expert_ged125 = expert_register_protocol(proto_ged125);
expert_register_field_array(expert_ged125, ei, array_length(ei));
- new_register_dissector("ged125", dissect_ged125, proto_ged125);
+
+ ged125_handle = new_register_dissector("ged125", dissect_ged125, proto_ged125);
ged125_module = prefs_register_protocol(proto_ged125, NULL);
@@ -1769,16 +1772,8 @@ proto_register_ged125 (void)
void
proto_reg_handoff_ged125(void)
{
- static dissector_handle_t ged125_handle;
- static int ged125_initialized = FALSE;
static guint old_ged125_tcp_port = 0;
- if(!ged125_initialized)
- {
- ged125_handle = new_create_dissector_handle(dissect_ged125, proto_ged125);
- ged125_initialized = TRUE;
- }
-
/* Register TCP port for dissection */
if(old_ged125_tcp_port != 0 && old_ged125_tcp_port != global_tcp_port_ged125)
dissector_delete_uint("tcp.port", old_ged125_tcp_port, ged125_handle);
diff --git a/epan/dissectors/packet-giop.c b/epan/dissectors/packet-giop.c
index 8566cf2939..035c8cc292 100644
--- a/epan/dissectors/packet-giop.c
+++ b/epan/dissectors/packet-giop.c
@@ -5383,7 +5383,7 @@ proto_register_giop (void)
proto_giop = proto_register_protocol("General Inter-ORB Protocol", "GIOP", "giop");
/* Register by name */
- register_dissector("giop", dissect_giop_tcp, proto_giop);
+ giop_tcp_handle = register_dissector("giop", dissect_giop_tcp, proto_giop);
proto_register_field_array (proto_giop, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
@@ -5419,7 +5419,6 @@ proto_register_giop (void)
void proto_reg_handoff_giop (void) {
data_handle = find_dissector("data");
- giop_tcp_handle = create_dissector_handle(dissect_giop_tcp, proto_giop);
heur_dissector_add("tcp", dissect_giop_heur, proto_giop);
/* Support DIOP (GIOP/UDP) */
heur_dissector_add("udp", dissect_giop_heur, proto_giop);
diff --git a/epan/dissectors/packet-hdfsdata.c b/epan/dissectors/packet-hdfsdata.c
index bbd670653c..fab9beb2d2 100644
--- a/epan/dissectors/packet-hdfsdata.c
+++ b/epan/dissectors/packet-hdfsdata.c
@@ -106,6 +106,8 @@ static int hf_hdfsdata_node = -1;
static gint ett_hdfsdata = -1;
+static dissector_handle_t hdfsdata_handle;
+
void proto_reg_handoff_hdfsdata(void);
/* Taken from HDFS
@@ -787,7 +789,7 @@ proto_register_hdfsdata(void)
10,
&tcp_port);
- register_dissector("hdfsdata", dissect_hdfsdata, proto_hdfsdata);
+ hdfsdata_handle = register_dissector("hdfsdata", dissect_hdfsdata, proto_hdfsdata);
}
/* registers handoff */
@@ -795,11 +797,9 @@ void
proto_reg_handoff_hdfsdata(void)
{
static gboolean initialized = FALSE;
- static dissector_handle_t hdfsdata_handle;
static guint saved_tcp_port;
if (!initialized) {
- hdfsdata_handle = create_dissector_handle(dissect_hdfsdata, proto_hdfsdata);
dissector_add_handle("tcp.port", hdfsdata_handle); /* for "decode as" */
initialized = TRUE;
} else if (saved_tcp_port != 0) {
diff --git a/epan/dissectors/packet-imap.c b/epan/dissectors/packet-imap.c
index 70f9f8936d..52c3e1fb0b 100644
--- a/epan/dissectors/packet-imap.c
+++ b/epan/dissectors/packet-imap.c
@@ -49,6 +49,8 @@ static int hf_imap_request_uid = -1;
static gint ett_imap = -1;
static gint ett_imap_reqresp = -1;
+static dissector_handle_t imap_handle;
+
#define TCP_PORT_IMAP 143
#define TCP_PORT_SSL_IMAP 993
#define MAX_BUFFER 1024
@@ -287,7 +289,9 @@ proto_register_imap(void)
proto_imap = proto_register_protocol("Internet Message Access Protocol",
"IMAP", "imap");
- register_dissector("imap", dissect_imap, proto_imap);
+
+ imap_handle = register_dissector("imap", dissect_imap, proto_imap);
+
proto_register_field_array(proto_imap, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
}
@@ -295,9 +299,6 @@ proto_register_imap(void)
void
proto_reg_handoff_imap(void)
{
- dissector_handle_t imap_handle;
-
- imap_handle = create_dissector_handle(dissect_imap, proto_imap);
dissector_add_uint("tcp.port", TCP_PORT_IMAP, imap_handle);
ssl_dissector_add(TCP_PORT_SSL_IMAP, "imap", TRUE);
}
diff --git a/epan/dissectors/packet-imf.c b/epan/dissectors/packet-imf.c
index 1a7f4af42e..7056031b3c 100644
--- a/epan/dissectors/packet-imf.c
+++ b/epan/dissectors/packet-imf.c
@@ -1269,7 +1269,7 @@ proto_reg_handoff_imf(void)
dissector_add_string("media_type",
"message/rfc822", imf_handle);
- register_ber_oid_dissector("1.2.840.113549.1.7.1", dissect_imf, proto_imf, "id-data");
+ register_ber_oid_dissector_handle("1.2.840.113549.1.7.1", imf_handle, proto_imf, "id-data");
/*
* Get the content type and Internet media type table
diff --git a/epan/dissectors/packet-isis.c b/epan/dissectors/packet-isis.c
index c476c50e4a..4abb540b59 100644
--- a/epan/dissectors/packet-isis.c
+++ b/epan/dissectors/packet-isis.c
@@ -51,6 +51,8 @@ static int hf_isis_max_area_adr = -1;
static gint ett_isis = -1;
+static dissector_handle_t isis_handle;
+
static const value_string isis_vals[] = {
{ ISIS_TYPE_L1_HELLO, "L1 HELLO"},
{ ISIS_TYPE_L2_HELLO, "L2 HELLO"},
@@ -298,7 +300,7 @@ proto_register_isis(void) {
proto_register_field_array(proto_isis, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
- register_dissector("isis", dissect_isis, proto_isis);
+ isis_handle = register_dissector("isis", dissect_isis, proto_isis);
/*
* Call registration routines for other source files in the ISIS
@@ -313,9 +315,6 @@ proto_register_isis(void) {
void
proto_reg_handoff_isis(void)
{
- dissector_handle_t isis_handle;
-
- isis_handle = create_dissector_handle(dissect_isis, proto_isis);
dissector_add_uint("osinl", NLPID_ISO10589_ISIS, isis_handle);
dissector_add_uint("ethertype", ETHERTYPE_L2ISIS, isis_handle);
}
diff --git a/epan/dissectors/packet-isup.c b/epan/dissectors/packet-isup.c
index 3e6979211d..e5ce1fa7f1 100644
--- a/epan/dissectors/packet-isup.c
+++ b/epan/dissectors/packet-isup.c
@@ -3036,6 +3036,7 @@ static gint ett_isup_apm_msg_fragment = -1;
static gint ett_isup_apm_msg_fragments = -1;
static gint ett_isup_range = -1;
+static dissector_handle_t bicc_handle;
static dissector_handle_t sdp_handle = NULL;
static dissector_handle_t q931_ie_handle = NULL;
@@ -12197,7 +12198,9 @@ proto_register_bicc(void)
};
proto_bicc = proto_register_protocol("Bearer Independent Call Control",
"BICC", "bicc");
- register_dissector("bicc", dissect_bicc, proto_bicc);
+
+ bicc_handle = register_dissector("bicc", dissect_bicc, proto_bicc);
+
/* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_bicc, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
@@ -12209,11 +12212,9 @@ proto_register_bicc(void)
void
proto_reg_handoff_bicc(void)
{
- dissector_handle_t bicc_handle;
sdp_handle = find_dissector("sdp");
q931_ie_handle = find_dissector("q931.ie");
- bicc_handle = create_dissector_handle(dissect_bicc, proto_bicc);
dissector_add_uint("mtp3.service_indicator", MTP_SI_BICC, bicc_handle);
dissector_add_uint("sctp.ppi", BICC_PAYLOAD_PROTOCOL_ID, bicc_handle);
}
diff --git a/epan/dissectors/packet-ixveriwave.c b/epan/dissectors/packet-ixveriwave.c
index 49092b14c7..7084623ae6 100644
--- a/epan/dissectors/packet-ixveriwave.c
+++ b/epan/dissectors/packet-ixveriwave.c
@@ -252,6 +252,8 @@ static gint ett_radiotap_info = -1;
static gint ett_radiotap_errors = -1;
static gint ett_radiotap_times = -1;
+static dissector_handle_t ixveriwave_handle;
+
#define ALIGN_OFFSET(offset, width) \
( (((offset) + ((width) - 1)) & (~((width) - 1))) - offset )
@@ -1505,20 +1507,18 @@ void proto_register_ixveriwave(void)
proto_ixveriwave = proto_register_protocol("ixveriwave", "ixveriwave", "ixveriwave");
proto_register_field_array(proto_ixveriwave, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
- register_dissector("ixveriwave", dissect_ixveriwave, proto_ixveriwave);
+
+ ixveriwave_handle = register_dissector("ixveriwave", dissect_ixveriwave, proto_ixveriwave);
}
void proto_reg_handoff_ixveriwave(void)
{
- dissector_handle_t ixveriwave_handle;
-
/* handle for ethertype dissector */
ethernet_handle = find_dissector("eth_withoutfcs");
/* handle for 802.11 dissector */
ieee80211_handle = find_dissector("wlan");
ieee80211_datapad_handle = find_dissector("wlan_datapad");
- ixveriwave_handle = create_dissector_handle(dissect_ixveriwave, proto_ixveriwave);
dissector_add_uint("wtap_encap", WTAP_ENCAP_IXVERIWAVE, ixveriwave_handle);
}
diff --git a/epan/dissectors/packet-mbtcp.c b/epan/dissectors/packet-mbtcp.c
index 14c0c5f410..85cd3aa50d 100644
--- a/epan/dissectors/packet-mbtcp.c
+++ b/epan/dissectors/packet-mbtcp.c
@@ -163,9 +163,12 @@ static gint ett_device_id_object_items = -1;
static expert_field ei_mbrtu_crc16_incorrect = EI_INIT;
static expert_field ei_modbus_data_decode = EI_INIT;
+static dissector_handle_t modbus_handle;
+static dissector_handle_t mbtcp_handle;
+static dissector_handle_t mbrtu_handle;
+
static dissector_table_t modbus_data_dissector_table;
static dissector_table_t modbus_dissector_table;
-static dissector_handle_t modbus_handle;
/* Globals for Modbus/TCP Preferences */
@@ -1728,9 +1731,9 @@ proto_register_modbus(void)
proto_modbus = proto_register_protocol("Modbus", "Modbus", "modbus");
/* Registering protocol to be called by another dissector */
- new_register_dissector("mbtcp", dissect_mbtcp, proto_mbtcp);
- new_register_dissector("mbrtu", dissect_mbrtu, proto_mbrtu);
- new_register_dissector("modbus", dissect_modbus, proto_modbus);
+ modbus_handle = new_register_dissector("modbus", dissect_modbus, proto_modbus);
+ mbtcp_handle = new_register_dissector("mbtcp", dissect_mbtcp, proto_mbtcp);
+ mbrtu_handle = new_register_dissector("mbrtu", dissect_mbrtu, proto_mbrtu);
/* Registering subdissectors table */
modbus_data_dissector_table = register_dissector_table("modbus.data", "Modbus Data", FT_STRING, BASE_NONE);
@@ -1822,15 +1825,9 @@ proto_register_modbus(void)
void
proto_reg_handoff_mbtcp(void)
{
- static int mbtcp_prefs_initialized = FALSE;
- static dissector_handle_t mbtcp_handle;
static unsigned int mbtcp_port;
/* Make sure to use Modbus/TCP Preferences field to determine default TCP port */
- if (! mbtcp_prefs_initialized) {
- mbtcp_handle = new_create_dissector_handle(dissect_mbtcp, proto_mbtcp);
- mbtcp_prefs_initialized = TRUE;
- }
if(mbtcp_port != 0 && mbtcp_port != global_mbus_tcp_port){
dissector_delete_uint("tcp.port", mbtcp_port, mbtcp_handle);
@@ -1842,7 +1839,6 @@ proto_reg_handoff_mbtcp(void)
mbtcp_port = global_mbus_tcp_port;
- modbus_handle = new_create_dissector_handle(dissect_modbus, proto_modbus);
dissector_add_uint("mbtcp.prot_id", MODBUS_PROTOCOL_ID, modbus_handle);
}
@@ -1850,15 +1846,9 @@ proto_reg_handoff_mbtcp(void)
void
proto_reg_handoff_mbrtu(void)
{
- static int mbrtu_prefs_initialized = FALSE;
- static dissector_handle_t mbrtu_handle;
static unsigned int mbrtu_port = 0;
/* Make sure to use Modbus RTU Preferences field to determine default TCP port */
- if (! mbrtu_prefs_initialized) {
- mbrtu_handle = new_create_dissector_handle(dissect_mbrtu, proto_mbrtu);
- mbrtu_prefs_initialized = TRUE;
- }
if(mbrtu_port != 0 && mbrtu_port != global_mbus_rtu_port){
dissector_delete_uint("tcp.port", mbrtu_port, mbrtu_handle);
@@ -1870,7 +1860,6 @@ proto_reg_handoff_mbrtu(void)
mbrtu_port = global_mbus_rtu_port;
- modbus_handle = new_create_dissector_handle(dissect_modbus, proto_modbus);
dissector_add_uint("mbtcp.prot_id", MODBUS_PROTOCOL_ID, modbus_handle);
}
diff --git a/epan/dissectors/packet-mikey.c b/epan/dissectors/packet-mikey.c
index 4e4b4bb491..f62327da1f 100644
--- a/epan/dissectors/packet-mikey.c
+++ b/epan/dissectors/packet-mikey.c
@@ -621,6 +621,7 @@ static gint ett_mikey_sp_param = -1;
static gint ett_mikey_hdr_id = -1;
static gint ett_mikey_enc_data = -1;
+static dissector_handle_t mikey_handle;
static const struct mikey_dissector_entry *
mikey_dissector_lookup(const struct mikey_dissector_entry *map, int type)
@@ -1903,7 +1904,8 @@ proto_register_mikey(void)
/* Register the protocol name and description */
proto_mikey = proto_register_protocol("Multimedia Internet KEYing",
"MIKEY", "mikey");
- new_register_dissector("mikey", dissect_mikey, proto_mikey);
+
+ mikey_handle = new_register_dissector("mikey", dissect_mikey, proto_mikey);
/* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_mikey, hf, array_length(hf));
@@ -1926,13 +1928,11 @@ proto_register_mikey(void)
void
proto_reg_handoff_mikey(void)
{
- static dissector_handle_t mikey_handle;
static guint mikey_tcp_port;
static guint mikey_udp_port;
static gboolean inited = FALSE;
if (!inited) {
- mikey_handle = new_create_dissector_handle(dissect_mikey, proto_mikey);
dissector_add_string("key_mgmt", "mikey", mikey_handle);
inited = TRUE;
} else {
diff --git a/epan/dissectors/packet-mp2t.c b/epan/dissectors/packet-mp2t.c
index 270d6b8285..63140a36f0 100644
--- a/epan/dissectors/packet-mp2t.c
+++ b/epan/dissectors/packet-mp2t.c
@@ -47,6 +47,8 @@
#define MP2T_PID_DOCSIS 0x1FFE
#define MP2T_PID_NULL 0x1FFF
+static dissector_handle_t mp2t_handle;
+
static dissector_handle_t docsis_handle;
static dissector_handle_t mpeg_pes_handle;
static dissector_handle_t mpeg_sect_handle;
@@ -1549,7 +1551,9 @@ proto_register_mp2t(void)
expert_module_t* expert_mp2t;
proto_mp2t = proto_register_protocol("ISO/IEC 13818-1", "MP2T", "mp2t");
- register_dissector("mp2t", dissect_mp2t, proto_mp2t);
+
+ mp2t_handle = register_dissector("mp2t", dissect_mp2t, proto_mp2t);
+
proto_register_field_array(proto_mp2t, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
expert_mp2t = expert_register_protocol(proto_mp2t);
@@ -1565,11 +1569,8 @@ proto_register_mp2t(void)
void
proto_reg_handoff_mp2t(void)
{
- dissector_handle_t mp2t_handle;
-
heur_dissector_add("udp", heur_dissect_mp2t, proto_mp2t);
- mp2t_handle = create_dissector_handle(dissect_mp2t, proto_mp2t);
dissector_add_uint("rtp.pt", PT_MP2T, mp2t_handle);
dissector_add_handle("udp.port", mp2t_handle); /* for decode-as */
heur_dissector_add("usb.bulk", heur_dissect_mp2t, proto_mp2t);
diff --git a/epan/dissectors/packet-mux27010.c b/epan/dissectors/packet-mux27010.c
index 2f272bc8e0..99a215ad37 100644
--- a/epan/dissectors/packet-mux27010.c
+++ b/epan/dissectors/packet-mux27010.c
@@ -281,6 +281,8 @@ static int hf_msg_reassembled_length = -1;
static gint ett_msg_fragment = -1;
static gint ett_msg_fragments = -1;
+static dissector_handle_t mux27010_handle;
+
static const fragment_items msg_frag_items = {
/* Fragment subtrees */
&ett_msg_fragment,
@@ -1405,7 +1407,9 @@ proto_register_mux27010 (void)
/*Register arrays*/
proto_register_field_array (proto_mux27010, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
- register_dissector("mux27010", dissect_mux27010, proto_mux27010);
+
+ mux27010_handle = register_dissector("mux27010", dissect_mux27010, proto_mux27010);
+
expert_mux27010 = expert_register_protocol(proto_mux27010);
expert_register_field_array(expert_mux27010, ei, array_length(ei));
@@ -1416,10 +1420,7 @@ proto_register_mux27010 (void)
void
proto_reg_handoff_mux27010(void)
{
- dissector_handle_t mux27010_handle;
-
/*Initialization of dissector*/
- mux27010_handle = create_dissector_handle(dissect_mux27010, proto_mux27010);
dissector_add_uint("wtap_encap", WTAP_ENCAP_MUX27010, mux27010_handle);
ppp_handle = find_dissector("ppp");
diff --git a/epan/dissectors/packet-nwmtp.c b/epan/dissectors/packet-nwmtp.c
index d0b6e59c3b..5e231d0ece 100644
--- a/epan/dissectors/packet-nwmtp.c
+++ b/epan/dissectors/packet-nwmtp.c
@@ -43,6 +43,8 @@ static int hf_nwmtp_data_length = -1;
/* subtree pointer */
static gint ett_mwmtp = -1;
+static dissector_handle_t nwmtp_handle;
+
static const value_string nwmtp_transport_type_vals[] = {
{ 2, "UDP" },
{ 3, "TCP" },
@@ -155,14 +157,12 @@ void proto_register_mwmtp(void)
proto_register_field_array(proto_nwmtp, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
- register_dissector("nw_mtp", dissect_nwmtp, proto_nwmtp);
+
+ nwmtp_handle = register_dissector("nw_mtp", dissect_nwmtp, proto_nwmtp);
}
void proto_reg_handoff_nwmtp(void)
{
- dissector_handle_t nwmtp_handle;
-
- nwmtp_handle = create_dissector_handle(dissect_nwmtp, proto_nwmtp);
/* For decode as */
dissector_add_handle("udp.port", nwmtp_handle);
mtp_handle = find_dissector("mtp3");
diff --git a/epan/dissectors/packet-sscop.c b/epan/dissectors/packet-sscop.c
index 67cab7a00a..bd1811e5ef 100644
--- a/epan/dissectors/packet-sscop.c
+++ b/epan/dissectors/packet-sscop.c
@@ -371,8 +371,6 @@ static void range_add_callback(guint32 port)
static void initialize_handles_once(void) {
static gboolean initialized = FALSE;
if (!initialized) {
- sscop_handle = create_dissector_handle(dissect_sscop, proto_sscop);
-
q2931_handle = find_dissector("q2931");
data_handle = find_dissector("data");
sscf_nni_handle = find_dissector("sscf-nni");
@@ -448,7 +446,8 @@ proto_register_sscop(void)
proto_sscop = proto_register_protocol("SSCOP", "SSCOP", "sscop");
proto_register_field_array(proto_sscop, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
- register_dissector("sscop", dissect_sscop, proto_sscop);
+
+ sscop_handle = register_dissector("sscop", dissect_sscop, proto_sscop);
sscop_module = prefs_register_protocol(proto_sscop, proto_reg_handoff_sscop);
diff --git a/epan/dissectors/packet-sync.c b/epan/dissectors/packet-sync.c
index cf0e66e217..f0587291b1 100644
--- a/epan/dissectors/packet-sync.c
+++ b/epan/dissectors/packet-sync.c
@@ -287,13 +287,12 @@ proto_register_sync(void)
proto_register_field_array(proto_sync, hf_sync, array_length(hf_sync));
proto_register_subtree_array(ett_sync_array, array_length(ett_sync_array));
- new_register_dissector("sync", dissect_sync, proto_sync);
+ sync_handle = new_register_dissector("sync", dissect_sync, proto_sync);
}
void
proto_reg_handoff_sync(void)
{
- sync_handle = new_create_dissector_handle(dissect_sync, proto_sync);
ip_handle = find_dissector("ip");
dissector_add_handle("udp.port", sync_handle);
diff --git a/epan/dissectors/packet-synphasor.c b/epan/dissectors/packet-synphasor.c
index 545fdba70f..1d4c89a236 100644
--- a/epan/dissectors/packet-synphasor.c
+++ b/epan/dissectors/packet-synphasor.c
@@ -106,6 +106,8 @@ static int hf_data_statb05to04 = -1;
static int hf_data_statb03to00 = -1;
static int hf_command = -1;
+static dissector_handle_t synphasor_udp_handle;
+
/* the five different frame types for this protocol */
enum FrameType {
DATA = 0,
@@ -1353,7 +1355,7 @@ void proto_register_synphasor(void)
PROTOCOL_ABBREV);
/* Registering protocol to be called by another dissector */
- new_register_dissector("synphasor", dissect_udp, proto_synphasor);
+ synphasor_udp_handle = new_register_dissector("synphasor", dissect_udp, proto_synphasor);
proto_register_field_array(proto_synphasor, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
@@ -1379,13 +1381,11 @@ void proto_register_synphasor(void)
void proto_reg_handoff_synphasor(void)
{
static gboolean initialized = FALSE;
- static dissector_handle_t synphasor_udp_handle;
static dissector_handle_t synphasor_tcp_handle;
static guint current_udp_port;
static guint current_tcp_port;
if (!initialized) {
- synphasor_udp_handle = new_create_dissector_handle(dissect_udp, proto_synphasor);
synphasor_tcp_handle = new_create_dissector_handle(dissect_tcp, proto_synphasor);
initialized = TRUE;
diff --git a/epan/dissectors/packet-tds.c b/epan/dissectors/packet-tds.c
index 8de38ee32e..fce694c690 100644
--- a/epan/dissectors/packet-tds.c
+++ b/epan/dissectors/packet-tds.c
@@ -558,6 +558,7 @@ static reassembly_table tds_reassembly_table;
static gboolean tds_defragment = TRUE;
static dissector_handle_t tds_tcp_handle;
+
static dissector_handle_t ntlmssp_handle;
static dissector_handle_t gssapi_handle;
static dissector_handle_t data_handle;
@@ -3172,7 +3173,7 @@ proto_register_tds(void)
proto_register_subtree_array(ett, array_length(ett));
/* Allow dissector to be found by name. */
- register_dissector("tds", dissect_tds_tcp, proto_tds);
+ tds_tcp_handle = register_dissector("tds", dissect_tds_tcp, proto_tds);
tds_module = prefs_register_protocol(proto_tds, NULL);
prefs_register_bool_preference(tds_module, "desegment_buffers",
@@ -3207,8 +3208,6 @@ proto_register_tds(void)
void
proto_reg_handoff_tds(void)
{
- tds_tcp_handle = create_dissector_handle(dissect_tds_tcp, proto_tds);
-
/* Initial TDS ports: MS SQL default ports */
dissector_add_uint("tcp.port", 1433, tds_tcp_handle);
dissector_add_uint("tcp.port", 2433, tds_tcp_handle);
diff --git a/epan/dissectors/packet-tnef.c b/epan/dissectors/packet-tnef.c
index a78be492f5..1794edb694 100644
--- a/epan/dissectors/packet-tnef.c
+++ b/epan/dissectors/packet-tnef.c
@@ -846,7 +846,7 @@ proto_reg_handoff_tnef(void)
dissector_add_string("media_type", "application/ms-tnef", tnef_handle);
/* X.400 file transfer bodypart */
- register_ber_oid_dissector("1.2.840.113556.3.10.1", dissect_tnef, proto_tnef, "id-et-tnef");
+ register_ber_oid_dissector_handle("1.2.840.113556.3.10.1", tnef_handle, proto_tnef, "id-et-tnef");
dissector_add_uint("wtap_encap", WTAP_ENCAP_TNEF, tnef_file_handle);
}
diff --git a/epan/dissectors/packet-tpncp.c b/epan/dissectors/packet-tpncp.c
index b6d0b1e55c..92d2e17be5 100644
--- a/epan/dissectors/packet-tpncp.c
+++ b/epan/dissectors/packet-tpncp.c
@@ -111,6 +111,8 @@ static guint global_tpncp_trunkpack_udp_port = UDP_PORT_TPNCP_TRUNKPACK;
static guint global_tpncp_host_tcp_port = TCP_PORT_TPNCP_HOST;
static guint global_tpncp_host_udp_port = UDP_PORT_TPNCP_HOST;
+static dissector_handle_t tpncp_handle;
+
static guint trunkpack_tcp_port = 0;
static guint trunkpack_udp_port = 0;
static guint host_tcp_port = 0;
@@ -720,7 +722,7 @@ static gint init_tpncp_db(void) {
void proto_reg_handoff_tpncp(void) {
static gint tpncp_prefs_initialized = FALSE;
- static dissector_handle_t tpncp_udp_handle, tpncp_tcp_handle;
+ static dissector_handle_t tpncp_tcp_handle;
/* If we weren't able to load the database (and thus the hf_ entries)
* do not attach to any ports (if we did then we'd get a "dissector bug"
@@ -731,16 +733,15 @@ void proto_reg_handoff_tpncp(void) {
return;
if (!tpncp_prefs_initialized) {
- tpncp_udp_handle = create_dissector_handle(dissect_tpncp, proto_tpncp);
tpncp_tcp_handle = create_dissector_handle(dissect_tpncp_tcp, proto_tpncp);
tpncp_prefs_initialized = TRUE;
}
else {
dissector_delete_uint("tcp.port", trunkpack_tcp_port, tpncp_tcp_handle);
- dissector_delete_uint("udp.port", trunkpack_udp_port, tpncp_udp_handle);
+ dissector_delete_uint("udp.port", trunkpack_udp_port, tpncp_handle);
dissector_delete_uint("tcp.port", host_tcp_port, tpncp_tcp_handle);
- dissector_delete_uint("udp.port", host_udp_port, tpncp_udp_handle);
+ dissector_delete_uint("udp.port", host_udp_port, tpncp_handle);
}
trunkpack_tcp_port = global_tpncp_trunkpack_tcp_port;
@@ -750,7 +751,7 @@ void proto_reg_handoff_tpncp(void) {
host_udp_port = global_tpncp_host_udp_port;
dissector_add_uint("tcp.port", global_tpncp_trunkpack_tcp_port, tpncp_tcp_handle);
- dissector_add_uint("udp.port", global_tpncp_trunkpack_udp_port, tpncp_udp_handle);
+ dissector_add_uint("udp.port", global_tpncp_trunkpack_udp_port, tpncp_handle);
}
/*-------------------------------------------------------------------------------------------------------------------------------------------*/
@@ -792,7 +793,7 @@ void proto_register_tpncp(void) {
proto_register_subtree_array(ett, array_length(ett));
- register_dissector("tpncp", dissect_tpncp, proto_tpncp);
+ tpncp_handle = register_dissector("tpncp", dissect_tpncp, proto_tpncp);
tpncp_module = prefs_register_protocol(proto_tpncp, proto_reg_handoff_tpncp);
diff --git a/epan/dissectors/packet-tzsp.c b/epan/dissectors/packet-tzsp.c
index 050721822d..e377c99330 100644
--- a/epan/dissectors/packet-tzsp.c
+++ b/epan/dissectors/packet-tzsp.c
@@ -47,6 +47,8 @@ static int hf_tzsp_version = -1;
static int hf_tzsp_type = -1;
static int hf_tzsp_encap = -1;
+static dissector_handle_t tzsp_handle;
+
/*
* Packet types.
*/
@@ -532,16 +534,13 @@ proto_register_tzsp(void)
"tzsp");
proto_register_field_array(proto_tzsp, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
- register_dissector("tzsp", dissect_tzsp, proto_tzsp);
+ tzsp_handle = register_dissector("tzsp", dissect_tzsp, proto_tzsp);
}
void
proto_reg_handoff_tzsp(void)
{
- dissector_handle_t tzsp_handle;
-
- tzsp_handle = create_dissector_handle(dissect_tzsp, proto_tzsp);
dissector_add_uint("udp.port", UDP_PORT_TZSP, tzsp_handle);
/* Get the data dissector for handling unknown encapsulation types. */