diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2001-12-03 04:00:26 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2001-12-03 04:00:26 +0000 |
commit | b6afcc102f8ba453034eda35648ff746ed329f4a (patch) | |
tree | 6303e298a7b136a1e1da306950398c99e3e71432 /packet-quake2.c | |
parent | cc6c7a4721cbfeee3556dacd8f019d9cc78ef293 (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.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4308 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-quake2.c')
-rw-r--r-- | packet-quake2.c | 15 |
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); } - |