From 07b2709f8a32951cc2503d2e048d662a01cb472c Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Tue, 27 Nov 2001 07:13:32 +0000 Subject: Change "conversation_set_dissector()" to take a dissector handle, rather than a pointer to a dissector function, as an argument. This means that the conversation dissector is called through "call_dissector()", so the dissector itself doesn't have to worry about checking whether the protocol is enabled or setting "pinfo->current_proto", so get rid of the code that does that in conversation dissectors. Also, make the conversation dissectors static. Get rid of some direct calls to dissectors; replace them with calls through handles, and, again, get rid of code to check whether a protocol is enabled and set "pinfo->current_proto" where that code isn't needed. Make those dissectors static if they aren't already static. Add a routine "create_dissector_handle()" to create a dissector handle without registering it by name, if the dissector isn't used outside the module in which it's defined. svn path=/trunk/; revision=4281 --- packet-quake2.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'packet-quake2.c') diff --git a/packet-quake2.c b/packet-quake2.c index fb8bbf3259..666f1d8255 100644 --- a/packet-quake2.c +++ b/packet-quake2.c @@ -7,10 +7,10 @@ * http://www.dgs.monash.edu.au/~timf/bottim/ * http://www.opt-sci.Arizona.EDU/Pandora/default.asp * - * $Id: packet-quake2.c,v 1.4 2001/11/26 05:13:11 hagbard Exp $ + * $Id: packet-quake2.c,v 1.5 2001/11/27 07:13:26 guy Exp $ * * Ethereal - Network traffic analyzer - * By Gerald Combs + * By Gerald Combs * Copyright 1998 Gerald Combs * * Copied from packet-quakeworld.c @@ -270,18 +270,9 @@ dissect_quake2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_item *quake2_item = NULL; int direction; - /* - * XXX - this is a conversation dissector, and the code to - * call a conversation dissector doesn't check for disabled - * protocols or set "pinfo->current_proto". - */ - CHECK_DISPLAY_AS_X(data_handle,proto_quake2, tvb, pinfo, tree); - direction = (pinfo->destport == gbl_quake2ServerPort) ? DIR_C2S : DIR_S2C; - pinfo->current_proto = "QUAKE2"; - if (check_col(pinfo->fd, COL_PROTOCOL)) col_set_str(pinfo->fd, COL_PROTOCOL, "QUAKE2"); if (check_col(pinfo->fd, COL_INFO)) -- cgit v1.2.3