aboutsummaryrefslogtreecommitdiffstats
path: root/packet-wcp.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2001-03-30 10:51:50 +0000
committerGuy Harris <guy@alum.mit.edu>2001-03-30 10:51:50 +0000
commita8cbb073d4db9e6194718dc7f280a629dc42e854 (patch)
treeea1b2b6021449726e2e9fbb2bee9621526b216b3 /packet-wcp.c
parent4f61e8c410c2e68b92bea146a2648e78c6f35f2d (diff)
NLPID's of 0x08 and 0x09 should be labeled as Q.933 and LMI,
respectively, not Q.931 and Q.2931, in Frame Relay. When dissecting Q.933-style multiprotocol encapsulated Frame Relay frames, use the "osinl" dissector table to check for OSI network layer protocols, include the NLPID in the tvbuff you hand to "dissector_try_port()" with that dissector table, and put the NLPID into the protocol tree as an invisible item - the NLPID is considered part of the PDU for those protocols, so you have to include it in the tvbuff, and the dissector will put it into the protocol tree. Also, make sure the top-level entry for the Frame Relay protocol includes all the bytes preceding the payload, and none of the payload bytes. Export a routine to do Q.933-style dissection, and have the WCP dissector call it, rather than duplicating that code in the WCP dissector. Don't register OSI network layer protocols with the "fr.ietf" dissector table; it's now sufficient to register them with the "osinl" dissector table, as the Frame Relay dissector now checks that. Get rid of unnecessary checks for protocols being enabled (if the dissector is always called through handles or dissector tables, the common code for handles and dissector tables will do the checks for you). Get rid of some unnecessary #includes. svn path=/trunk/; revision=3211
Diffstat (limited to 'packet-wcp.c')
-rw-r--r--packet-wcp.c43
1 files changed, 6 insertions, 37 deletions
diff --git a/packet-wcp.c b/packet-wcp.c
index 3ac71e5160..7b6dc24bf2 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.7 2001/03/29 08:05:07 guy Exp $
+ * $Id: packet-wcp.c,v 1.8 2001/03/30 10:51:50 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -110,12 +110,10 @@
#include <string.h>
#include "packet.h"
#include "packet-frame.h"
-#include "packet-osi.h"
+#include "packet-fr.h"
#include "conversation.h"
#include "etypes.h"
#include "nlpid.h"
-#include "oui.h"
-#include "packet-llc.h"
#define MAX_WIN_BUF_LEN 0x7fff /* storage size for decompressed data */
#define MAX_WCP_BUF_LEN 2048 /* storage size for decompressed data */
@@ -177,11 +175,6 @@ static int hf_wcp_short_run = -1;
static int hf_wcp_long_run = -1;
static int hf_wcp_offset = -1;
-/*$$ are these needed or should the Frame relay stuff be used (call a decoder in frame relay)?? */
-static int hf_wcp_oui = -1;
-static int hf_wcp_pid = -1;
-static int hf_wcp_type = -1;
-
static gint ett_wcp = -1;
static gint ett_wcp_field = -1;
@@ -316,19 +309,15 @@ void dissect_wcp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
int wcp_header_len;
guint16 temp, cmd, ext_cmd, seq;
tvbuff_t *next_tvb;
- guint8 protocol_id;
-
- temp = tvb_get_guint8(tvb, 0);
-
- if (!proto_is_protocol_enabled(proto_wcp))
- return;
- temp =tvb_get_ntohs(tvb, 0);
pinfo->current_proto = "WCP";
if (check_col(pinfo->fd, COL_PROTOCOL))
col_set_str(pinfo->fd, COL_PROTOCOL, "WCP");
+ if (check_col(pinfo->fd, COL_INFO))
+ col_clear(pinfo->fd, COL_INFO);
+ temp =tvb_get_ntohs(tvb, 0);
cmd = (temp & 0xf000) >> 12;
ext_cmd = (temp & 0x0f00) >> 8;
@@ -412,15 +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));
- protocol_id = tvb_get_guint8( next_tvb, 0);
-
-/*XXX This isn't really what we want to do !! Should be able to call a decoder */
-/* routine in the frame relay code or PPP (if that is added). */
-
- if (!dissector_try_port(fr_subdissector_table, protocol_id,
- tvb_new_subset(next_tvb, 1,-1,-1), pinfo, tree))
- dissect_snap(next_tvb, 0, pinfo, tree, wcp_tree, 0,
- hf_wcp_oui, hf_wcp_type, hf_wcp_pid, 0);
+ dissect_fr_uncompressed(next_tvb, pinfo, tree);
return;
}
@@ -727,15 +708,6 @@ proto_register_wcp(void)
{ &hf_wcp_short_run,
{ "Short Compression", "wcp.short_comp", FT_UINT8, BASE_HEX, NULL, 0,
"Short Compression type"}},
- { &hf_wcp_oui, {
- "Organization Code", "wcp.snap.oui", FT_UINT24, BASE_HEX,
- VALS(oui_vals), 0x0, ""}},
- { &hf_wcp_pid, {
- "Protocol ID", "wcp.snap.pid", FT_UINT16, BASE_HEX,
- NULL, 0x0, ""}},
- { &hf_wcp_type, {
- "Type", "wcp.type", FT_UINT16, BASE_HEX,
- NULL, 0x0, "WCP SNAP Encapsulated Protocol" }},
};
@@ -758,6 +730,3 @@ proto_reg_handoff_wcp(void) {
dissector_add("fr.ietf", NLPID_COMPRESSED, dissect_wcp, proto_wcp);
dissector_add("ethertype", ETHERTYPE_WCP, dissect_wcp, proto_wcp);
}
-
-
-