aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorBill Meier <wmeier@newsguy.com>2008-09-02 19:08:29 +0000
committerBill Meier <wmeier@newsguy.com>2008-09-02 19:08:29 +0000
commit40bd43db835887c90b4278fecae751c6ae33c9eb (patch)
tree23a8315aa3db2235e9cb026b3cf61a52ee4f0c88 /epan
parentc63ac0b2e35e2b73a64d1d82f068b4a2297fe09e (diff)
Minor cleanup (mostly related to proto_reg_handoff...)
svn path=/trunk/; revision=26121
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-3com-njack.c7
-rw-r--r--epan/dissectors/packet-3com-xns.c7
-rw-r--r--epan/dissectors/packet-9p.c4
-rw-r--r--epan/dissectors/packet-beep.c3
-rw-r--r--epan/dissectors/packet-etheric.c8
-rw-r--r--epan/dissectors/packet-quake2.c4
-rw-r--r--epan/dissectors/packet-quake3.c4
-rw-r--r--epan/dissectors/packet-quakeworld.c4
-rw-r--r--epan/dissectors/packet-sflow.c9
-rw-r--r--epan/dissectors/packet-sscop.c2
10 files changed, 16 insertions, 36 deletions
diff --git a/epan/dissectors/packet-3com-njack.c b/epan/dissectors/packet-3com-njack.c
index 034e49053c..e5d278a13e 100644
--- a/epan/dissectors/packet-3com-njack.c
+++ b/epan/dissectors/packet-3com-njack.c
@@ -676,8 +676,6 @@ dissect_njack_static(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
return dissect_njack(tvb, pinfo, tree);
}
-void proto_register_njack(void);
-
void
proto_register_njack(void)
{
@@ -786,14 +784,11 @@ proto_register_njack(void)
&ett_njack_tlv_header,
};
- proto_njack = proto_register_protocol(PROTO_LONG_NAME,
- PROTO_SHORT_NAME, "njack");
+ proto_njack = proto_register_protocol(PROTO_LONG_NAME, PROTO_SHORT_NAME, "njack");
proto_register_field_array(proto_njack, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
}
-void proto_reg_handoff_njack(void);
-
void
proto_reg_handoff_njack(void)
{
diff --git a/epan/dissectors/packet-3com-xns.c b/epan/dissectors/packet-3com-xns.c
index 75790e5ed4..a9e0392521 100644
--- a/epan/dissectors/packet-3com-xns.c
+++ b/epan/dissectors/packet-3com-xns.c
@@ -88,8 +88,6 @@ dissect_3com_xns(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
-void proto_register_3com_xns(void);
-
void
proto_register_3com_xns(void)
{
@@ -113,8 +111,6 @@ proto_register_3com_xns(void)
proto_register_subtree_array(ett, array_length(ett));
}
-void proto_reg_handoff_3com_xns(void);
-
void
proto_reg_handoff_3com_xns(void)
{
@@ -122,7 +118,6 @@ proto_reg_handoff_3com_xns(void)
retix_bpdu_handle = find_dissector("rbpdu");
- our_xns_handle = create_dissector_handle(dissect_3com_xns,
- proto_3com_xns);
+ our_xns_handle = create_dissector_handle(dissect_3com_xns, proto_3com_xns);
dissector_add("llc.dsap", 0x80, our_xns_handle);
}
diff --git a/epan/dissectors/packet-9p.c b/epan/dissectors/packet-9p.c
index ebd5b893ac..e63bdf1da7 100644
--- a/epan/dissectors/packet-9p.c
+++ b/epan/dissectors/packet-9p.c
@@ -676,8 +676,6 @@ static void dissect_9P_dm(tvbuff_t * tvb, proto_item * item,int offset,int iscr
}
/* Register 9P with Wireshark */
-void proto_register_9P(void);
-
void proto_register_9P(void)
{
static hf_register_info hf[] = {
@@ -825,8 +823,6 @@ void proto_register_9P(void)
proto_register_subtree_array(ett, array_length(ett));
}
-void proto_reg_handoff_9P(void);
-
void proto_reg_handoff_9P(void)
{
dissector_handle_t ninep_handle;
diff --git a/epan/dissectors/packet-beep.c b/epan/dissectors/packet-beep.c
index c13c7e86b4..477b7a1f05 100644
--- a/epan/dissectors/packet-beep.c
+++ b/epan/dissectors/packet-beep.c
@@ -47,7 +47,6 @@
#define TCP_PORT_BEEP 10288
void proto_reg_handoff_beep(void);
-
static guint global_beep_tcp_port = TCP_PORT_BEEP;
static int global_beep_strict_term = TRUE;
@@ -1093,7 +1092,7 @@ proto_register_beep(void)
void
proto_reg_handoff_beep(void)
{
- static int beep_prefs_initialized = FALSE;
+ static gboolean beep_prefs_initialized = FALSE;
static dissector_handle_t beep_handle;
if (!beep_prefs_initialized) {
diff --git a/epan/dissectors/packet-etheric.c b/epan/dissectors/packet-etheric.c
index 78afa7290d..b91bae727f 100644
--- a/epan/dissectors/packet-etheric.c
+++ b/epan/dissectors/packet-etheric.c
@@ -1009,11 +1009,11 @@ proto_reg_handoff_etheric(void)
static int tcp_port1 = 1806;
static int tcp_port2 = 10002;
- static int Initialized=FALSE;
-
+ static gboolean Initialized=FALSE;
if (!Initialized) {
etheric_handle = find_dissector("etheric");
+ q931_ie_handle = find_dissector("q931.ie");
Initialized=TRUE;
}else{
dissector_delete("udp.port", tcp_port1, etheric_handle);
@@ -1025,8 +1025,6 @@ proto_reg_handoff_etheric(void)
dissector_add("tcp.port", ethericTCPport1, etheric_handle);
dissector_add("tcp.port", ethericTCPport2, etheric_handle);
- q931_ie_handle = find_dissector("q931.ie");
-
}
void
@@ -1198,7 +1196,7 @@ proto_register_etheric(void)
/* Register a configuration option for port */
etheric_module = prefs_register_protocol(proto_etheric,
- proto_reg_handoff_etheric);
+ proto_reg_handoff_etheric);
prefs_register_uint_preference(etheric_module, "tcp.port1",
"etheric TCP Port 1",
diff --git a/epan/dissectors/packet-quake2.c b/epan/dissectors/packet-quake2.c
index 9b480f0fe2..4f21383e25 100644
--- a/epan/dissectors/packet-quake2.c
+++ b/epan/dissectors/packet-quake2.c
@@ -764,13 +764,14 @@ dissect_quake2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
void
proto_reg_handoff_quake2(void)
{
- static int Initialized=FALSE;
+ static gboolean Initialized=FALSE;
static dissector_handle_t quake2_handle;
static int ServerPort=0;
if (!Initialized) {
quake2_handle = create_dissector_handle(dissect_quake2,
proto_quake2);
+ data_handle = find_dissector("data");
Initialized=TRUE;
} else {
dissector_delete("udp.port", ServerPort, quake2_handle);
@@ -780,7 +781,6 @@ proto_reg_handoff_quake2(void)
ServerPort=gbl_quake2ServerPort;
dissector_add("udp.port", gbl_quake2ServerPort, quake2_handle);
- data_handle = find_dissector("data");
}
diff --git a/epan/dissectors/packet-quake3.c b/epan/dissectors/packet-quake3.c
index 87f2b2dd44..111cb1e8ce 100644
--- a/epan/dissectors/packet-quake3.c
+++ b/epan/dissectors/packet-quake3.c
@@ -544,7 +544,7 @@ dissect_quake3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
void
proto_reg_handoff_quake3(void)
{
- static int initialized=FALSE;
+ static gboolean initialized=FALSE;
static dissector_handle_t quake3_handle;
static int server_port;
static int master_port;
@@ -553,6 +553,7 @@ proto_reg_handoff_quake3(void)
if (!initialized) {
quake3_handle = create_dissector_handle(dissect_quake3,
proto_quake3);
+ data_handle = find_dissector("data");
initialized=TRUE;
} else {
for (i=0;i<4;i++)
@@ -572,7 +573,6 @@ proto_reg_handoff_quake3(void)
for (i=0;i<4;i++)
dissector_add("udp.port", gbl_quake3_master_port + i,
quake3_handle);
- data_handle = find_dissector("data");
}
diff --git a/epan/dissectors/packet-quakeworld.c b/epan/dissectors/packet-quakeworld.c
index 2720e3e5a9..1feb93fac5 100644
--- a/epan/dissectors/packet-quakeworld.c
+++ b/epan/dissectors/packet-quakeworld.c
@@ -771,13 +771,14 @@ dissect_quakeworld(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
void
proto_reg_handoff_quakeworld(void)
{
- static int Initialized=FALSE;
+ static gboolean Initialized=FALSE;
static dissector_handle_t quakeworld_handle;
static int ServerPort=0;
if (!Initialized) {
quakeworld_handle = create_dissector_handle(dissect_quakeworld,
proto_quakeworld);
+ data_handle = find_dissector("data");
Initialized=TRUE;
} else {
dissector_delete("udp.port", ServerPort, quakeworld_handle);
@@ -787,7 +788,6 @@ proto_reg_handoff_quakeworld(void)
ServerPort=gbl_quakeworldServerPort;
dissector_add("udp.port", gbl_quakeworldServerPort, quakeworld_handle);
- data_handle = find_dissector("data");
}
diff --git a/epan/dissectors/packet-sflow.c b/epan/dissectors/packet-sflow.c
index 9cfd153ebd..f149b934d1 100644
--- a/epan/dissectors/packet-sflow.c
+++ b/epan/dissectors/packet-sflow.c
@@ -1492,24 +1492,21 @@ proto_register_sflow(void)
void
proto_reg_handoff_sflow(void)
{
- static int sflow_prefs_initialized = FALSE;
+ static gboolean sflow_prefs_initialized = FALSE;
+
if (!sflow_prefs_initialized) {
sflow_handle = new_create_dissector_handle(dissect_sflow,
proto_sflow);
+ data_handle = find_dissector("data");
sflow_prefs_initialized = TRUE;
}
-
sflow_reinit();
- /*dissector_handle_t sflow_handle;*/
-
/*
* XXX - should this be done with a dissector table?
*/
- data_handle = find_dissector("data");
-
if (global_dissect_samp_headers) {
eth_withoutfcs_handle = find_dissector("eth_withoutfcs");
tr_handle = find_dissector("tr");
diff --git a/epan/dissectors/packet-sscop.c b/epan/dissectors/packet-sscop.c
index 0ca0aef24a..070fc2fabe 100644
--- a/epan/dissectors/packet-sscop.c
+++ b/epan/dissectors/packet-sscop.c
@@ -403,7 +403,7 @@ gboolean sscop_allowed_subdissector(dissector_handle_t handle)
void
proto_reg_handoff_sscop(void)
{
- static int prefs_initialized = FALSE;
+ static gboolean prefs_initialized = FALSE;
if (!prefs_initialized) {
initialize_handles_once();