* Routines for Wellfleet Compression frame disassembly
* Copyright 2001, Jeffrey C. Foster <jfoste@woodward.com>
*
- * $Id: packet-wcp.c,v 1.13 2001/11/20 22:29:04 guy Exp $
+ * $Id: packet-wcp.c,v 1.18 2001/12/03 03:59:42 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
#include <string.h>
#include "packet.h"
#include "packet-frame.h"
-#include "packet-fr.h"
#include "conversation.h"
#include "etypes.h"
#include "nlpid.h"
static GMemChunk *wcp_window = NULL;
static GMemChunk *wcp_pdata = NULL;
-extern dissector_table_t fr_subdissector_table;
-
static int proto_wcp = -1;
static int hf_wcp_cmd = -1;
static int hf_wcp_ext_cmd = -1;
static gint ett_wcp = -1;
static gint ett_wcp_field = -1;
+static dissector_handle_t fr_handle;
+
/*
* Bits in the address field.
*/
}
-void wcp_save_data( tvbuff_t *tvb, packet_info *pinfo){
+static void wcp_save_data( tvbuff_t *tvb, packet_info *pinfo){
wcp_window_t *buf_ptr = 0;
int len;
}
-void dissect_wcp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
+static void dissect_wcp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
proto_tree *wcp_tree;
proto_item *ti;
int wcp_header_len;
guint16 temp, cmd, ext_cmd, seq;
tvbuff_t *next_tvb;
- packet_info save_pi;
- gboolean must_restore_pi = FALSE;
-
- pinfo->current_proto = "WCP";
if (check_col(pinfo->fd, COL_PROTOCOL))
col_set_str(pinfo->fd, COL_PROTOCOL, "WCP");
"[Malformed Frame: Bad WCP compressed data]" );
return;
}
-
- /* XXX - is this still necessary? Do we have to worry
- about subdissectors changing "pi", or, given that
- we're no longer doing so, is that no longer an issue? */
- save_pi = pi;
- must_restore_pi = TRUE;
}
if ( tree) /* add the check byte */
tvb_reported_length( tvb)-1, 1,
tvb_get_guint8( tvb, tvb_reported_length(tvb)-1));
- dissect_fr_uncompressed(next_tvb, pinfo, tree);
-
- if (must_restore_pi)
- pi = save_pi;
+ call_dissector(fr_handle, next_tvb, pinfo, tree);
return;
}
void
proto_reg_handoff_wcp(void) {
+ dissector_handle_t wcp_handle;
+
+ /*
+ * 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);
+ wcp_handle = create_dissector_handle(dissect_wcp, proto_wcp);
+ dissector_add("fr.ietf", NLPID_COMPRESSED, wcp_handle);
+ dissector_add("ethertype", ETHERTYPE_WCP, wcp_handle);
}