diff options
author | Guy Harris <guy@alum.mit.edu> | 2001-12-03 04:00:26 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2001-12-03 04:00:26 +0000 |
commit | bced8711f67b5dba76e9d6cdfd1a0246b235df27 (patch) | |
tree | 6303e298a7b136a1e1da306950398c99e3e71432 /packet-quakeworld.c | |
parent | 8d0ea8bc932de5cf57183a593be160515af064d9 (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-quakeworld.c')
-rw-r--r-- | packet-quakeworld.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/packet-quakeworld.c b/packet-quakeworld.c index 68fa541c34..f5a6acfebe 100644 --- a/packet-quakeworld.c +++ b/packet-quakeworld.c @@ -4,7 +4,7 @@ * Uwe Girlich <uwe@planetquake.com> * http://www.idsoftware.com/q1source/q1source.zip * - * $Id: packet-quakeworld.c,v 1.7 2001/11/27 07:13:26 guy Exp $ + * $Id: packet-quakeworld.c,v 1.8 2001/12/03 03:59:38 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -776,19 +776,21 @@ void proto_reg_handoff_quakeworld(void) { static int Initialized=FALSE; + static dissector_handle_t quakeworld_handle; static int ServerPort=0; - if (Initialized) { - dissector_delete("udp.port", ServerPort, dissect_quakeworld); - } else { + if (!Initialized) { + quakeworld_handle = create_dissector_handle(dissect_quakeworld, + proto_quakeworld); Initialized=TRUE; + } else { + dissector_delete("udp.port", ServerPort, quakeworld_handle); } /* set port for future deletes */ ServerPort=gbl_quakeworldServerPort; - dissector_add("udp.port", gbl_quakeworldServerPort, - dissect_quakeworld, proto_quakeworld); + dissector_add("udp.port", gbl_quakeworldServerPort, quakeworld_handle); data_handle = find_dissector("data"); } |