aboutsummaryrefslogtreecommitdiffstats
path: root/packet-quake2.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2001-12-03 04:00:26 +0000
committerGuy Harris <guy@alum.mit.edu>2001-12-03 04:00:26 +0000
commitbced8711f67b5dba76e9d6cdfd1a0246b235df27 (patch)
tree6303e298a7b136a1e1da306950398c99e3e71432 /packet-quake2.c
parent8d0ea8bc932de5cf57183a593be160515af064d9 (diff)
Make "dissector_add()", "dissector_delete()", and "dissector_change()"
take a dissector handle as an argument, rather than a pointer to a dissector function and a protocol ID. Associate dissector handles with dissector table entries. svn path=/trunk/; revision=4308
Diffstat (limited to 'packet-quake2.c')
-rw-r--r--packet-quake2.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/packet-quake2.c b/packet-quake2.c
index 666f1d8255..2308bccf69 100644
--- a/packet-quake2.c
+++ b/packet-quake2.c
@@ -7,7 +7,7 @@
* http://www.dgs.monash.edu.au/~timf/bottim/
* http://www.opt-sci.Arizona.EDU/Pandora/default.asp
*
- * $Id: packet-quake2.c,v 1.5 2001/11/27 07:13:26 guy Exp $
+ * $Id: packet-quake2.c,v 1.6 2001/12/03 03:59:38 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -326,19 +326,21 @@ void
proto_reg_handoff_quake2(void)
{
static int Initialized=FALSE;
+ static dissector_handle_t quake2_handle;
static int ServerPort=0;
- if (Initialized) {
- dissector_delete("udp.port", ServerPort, dissect_quake2);
- } else {
+ if (!Initialized) {
+ quake2_handle = create_dissector_handle(dissect_quake2,
+ proto_quake2);
Initialized=TRUE;
+ } else {
+ dissector_delete("udp.port", ServerPort, quake2_handle);
}
/* set port for future deletes */
ServerPort=gbl_quake2ServerPort;
- dissector_add("udp.port", gbl_quake2ServerPort,
- dissect_quake2, proto_quake2);
+ dissector_add("udp.port", gbl_quake2ServerPort, quake2_handle);
data_handle = find_dissector("data");
}
@@ -416,4 +418,3 @@ proto_register_quake2(void)
"Set the UDP port for the Quake II Server",
10, &gbl_quake2ServerPort);
}
-