aboutsummaryrefslogtreecommitdiffstats
path: root/packet-wcp.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2001-11-27 07:13:32 +0000
committerGuy Harris <guy@alum.mit.edu>2001-11-27 07:13:32 +0000
commit07b2709f8a32951cc2503d2e048d662a01cb472c (patch)
tree21d265bf7402a2739905bd87227383ae0a9f78ab /packet-wcp.c
parentfd456eaf0b5af46449882983b95529e073fd989f (diff)
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
Diffstat (limited to 'packet-wcp.c')
-rw-r--r--packet-wcp.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/packet-wcp.c b/packet-wcp.c
index ab47a90385..aaaa68919a 100644
--- a/packet-wcp.c
+++ b/packet-wcp.c
@@ -2,7 +2,7 @@
* Routines for Wellfleet Compression frame disassembly
* Copyright 2001, Jeffrey C. Foster <jfoste@woodward.com>
*
- * $Id: packet-wcp.c,v 1.14 2001/11/21 21:37:26 guy Exp $
+ * $Id: packet-wcp.c,v 1.15 2001/11/27 07:13:26 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -109,7 +109,6 @@
#include <string.h>
#include "packet.h"
#include "packet-frame.h"
-#include "packet-fr.h"
#include "conversation.h"
#include "etypes.h"
#include "nlpid.h"
@@ -177,6 +176,8 @@ static int hf_wcp_offset = -1;
static gint ett_wcp = -1;
static gint ett_wcp_field = -1;
+static dissector_handle_t fr_handle;
+
/*
* Bits in the address field.
*/
@@ -400,7 +401,7 @@ void dissect_wcp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
tvb_reported_length( tvb)-1, 1,
tvb_get_guint8( tvb, tvb_reported_length(tvb)-1));
- dissect_fr_uncompressed(next_tvb, pinfo, tree);
+ call_dissector(fr_handle, next_tvb, pinfo, tree);
return;
}
@@ -731,6 +732,11 @@ proto_register_wcp(void)
void
proto_reg_handoff_wcp(void) {
+ /*
+ * Get handle for the Frame Relay (uncompressed) dissector.
+ */
+ fr_handle = find_dissector("fr");
+
dissector_add("fr.ietf", NLPID_COMPRESSED, dissect_wcp, proto_wcp);
dissector_add("ethertype", ETHERTYPE_WCP, dissect_wcp, proto_wcp);
}