aboutsummaryrefslogtreecommitdiffstats
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
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
-rw-r--r--Makefile.am3
-rw-r--r--nlpid.h7
-rw-r--r--packet-clnp.c4
-rw-r--r--packet-esis.c3
-rw-r--r--packet-fr.c204
-rw-r--r--packet-fr.h27
-rw-r--r--packet-isis.c3
-rw-r--r--packet-llc.c3
-rw-r--r--packet-lmi.c34
-rw-r--r--packet-osi.c10
-rw-r--r--packet-osi.h9
-rw-r--r--packet-wcp.c43
-rw-r--r--packet-x25.c5
13 files changed, 217 insertions, 138 deletions
diff --git a/Makefile.am b/Makefile.am
index ae71558054..47655aa711 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,7 @@
# Makefile.am
# Automake file for Ethereal
#
-# $Id: Makefile.am,v 1.296 2001/03/24 02:07:20 guy Exp $
+# $Id: Makefile.am,v 1.297 2001/03/30 10:51:48 guy Exp $
#
# Ethereal - Network traffic analyzer
# By Gerald Combs <gerald@zing.org>
@@ -253,6 +253,7 @@ noinst_HEADERS = \
packet-esis.h \
packet-eth.h \
packet-fddi.h \
+ packet-fr.h \
packet-frame.h \
packet-gvrp.h \
packet-h261.h \
diff --git a/nlpid.h b/nlpid.h
index 03e306bc2d..4b06ed2ee6 100644
--- a/nlpid.h
+++ b/nlpid.h
@@ -2,7 +2,7 @@
* Definitions of OSI NLPIDs (Network Layer Protocol IDs)
* Laurent Deniel <deniel@worldnet.fr>
*
- * $Id: nlpid.h,v 1.7 2001/03/29 06:09:50 guy Exp $
+ * $Id: nlpid.h,v 1.8 2001/03/30 10:51:49 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -49,4 +49,9 @@
extern const value_string nlpid_vals[];
+/*
+ * 0x09 is, in Frame Relay, LMI, Q.2931.
+ */
+#define NLPID_LMI 0x09 /* LMI */
+
#endif
diff --git a/packet-clnp.c b/packet-clnp.c
index 37bda86c7b..2e7dd82fd5 100644
--- a/packet-clnp.c
+++ b/packet-clnp.c
@@ -1,7 +1,7 @@
/* packet-clnp.c
* Routines for ISO/OSI network and transport protocol packet disassembly
*
- * $Id: packet-clnp.c,v 1.26 2001/03/15 06:41:12 guy Exp $
+ * $Id: packet-clnp.c,v 1.27 2001/03/30 10:51:49 guy Exp $
* Laurent Deniel <deniel@worldnet.fr>
* Ralf Schneider <Ralf.Schneider@t-online.de>
*
@@ -1930,6 +1930,4 @@ proto_reg_handoff_clnp(void)
proto_clnp);
dissector_add("osinl", NLPID_NULL, dissect_clnp,
proto_clnp); /* Inactive subset */
- dissector_add("fr.ietf", NLPID_ISO8473_CLNP, dissect_clnp,
- proto_clnp); /* Inactive subset */
}
diff --git a/packet-esis.c b/packet-esis.c
index 225b9de403..906b1987ed 100644
--- a/packet-esis.c
+++ b/packet-esis.c
@@ -2,7 +2,7 @@
* Routines for ISO/OSI End System to Intermediate System
* Routeing Exchange Protocol ISO 9542.
*
- * $Id: packet-esis.c,v 1.13 2001/01/22 08:03:45 guy Exp $
+ * $Id: packet-esis.c,v 1.14 2001/03/30 10:51:50 guy Exp $
* Ralf Schneider <Ralf.Schneider@t-online.de>
*
* Ethereal - Network traffic analyzer
@@ -431,5 +431,4 @@ void
proto_reg_handoff_esis(void)
{
dissector_add("osinl", NLPID_ISO9542_ESIS, dissect_esis, proto_esis);
- dissector_add("fr.ietf", NLPID_ISO9542_ESIS, dissect_esis, proto_esis);
}
diff --git a/packet-fr.c b/packet-fr.c
index 33a011ee3d..1a1ea85a7a 100644
--- a/packet-fr.c
+++ b/packet-fr.c
@@ -3,7 +3,7 @@
*
* Copyright 2001, Paul Ionescu <paul@acorp.ro>
*
- * $Id: packet-fr.c,v 1.13 2001/03/29 08:05:06 guy Exp $
+ * $Id: packet-fr.c,v 1.14 2001/03/30 10:51:50 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -47,6 +47,8 @@
#include <string.h>
#include <glib.h>
#include "packet.h"
+#include "packet-fr.h"
+#include "packet-osi.h"
#include "packet-llc.h"
#include "packet-chdlc.h"
#include "xdlc.h"
@@ -101,21 +103,47 @@ static const true_false_string ea_string = {
"More Follows"
};
+/*
+ * This isn't the same as "nlpid_vals[]"; 0x08 is Q.933, not Q.931,
+ * and 0x09 is LMI, not Q.2931.
+ */
+static const value_string fr_nlpid_vals[] = {
+ { NLPID_NULL, "NULL" },
+ { NLPID_T_70, "T.70" },
+ { NLPID_X_633, "X.633" },
+ { NLPID_Q_931, "Q.933" },
+ { NLPID_LMI, "LMI" },
+ { NLPID_Q_2119, "Q.2119" },
+ { NLPID_SNAP, "SNAP" },
+ { NLPID_ISO8473_CLNP, "CLNP" },
+ { NLPID_ISO9542_ESIS, "ESIS" },
+ { NLPID_ISO10589_ISIS, "ISIS" },
+ { NLPID_ISO10747_IDRP, "IDRP" },
+ { NLPID_ISO9542X25_ESIS, "ESIS (X.25)" },
+ { NLPID_ISO10030, "ISO 10030" },
+ { NLPID_ISO11577, "ISO 11577" },
+ { NLPID_COMPRESSED, "Data compression protocol" },
+ { NLPID_IP, "IP" },
+ { NLPID_PPP, "PPP" },
+ { 0, NULL },
+};
+
dissector_table_t fr_subdissector_table;
+static void dissect_fr_nlpid(tvbuff_t *tvb, int offset, packet_info *pinfo,
+ proto_tree *tree, proto_item *ti,
+ proto_tree *fr_tree, guint8 fr_ctrl);
static void dissect_lapf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
static void dissect_fr_xid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
static void dissect_fr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
- proto_item *ti;
+ proto_item *ti = NULL;
proto_tree *fr_tree = NULL;
guint16 fr_header,fr_type,offset=2; /* default header length of FR is 2 bytes */
guint16 address;
char buf[32];
- guint8 fr_nlpid,fr_ctrl;
-
- CHECK_DISPLAY_AS_DATA(proto_fr, tvb, pinfo, tree);
+ guint8 fr_ctrl;
pinfo->current_proto = "Frame Relay";
if (check_col(pinfo->fd, COL_PROTOCOL))
@@ -144,7 +172,7 @@ static void dissect_fr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_add_fstr(pinfo->fd, COL_INFO, "DLCI %u", address);
if (tree) {
- ti = proto_tree_add_protocol_format(tree, proto_fr, tvb, 0, 4, "Frame Relay");
+ ti = proto_tree_add_protocol_format(tree, proto_fr, tvb, 0, 3, "Frame Relay");
fr_tree = proto_item_add_subtree(ti, ett_fr);
decode_bitfield_value(buf, fr_header, FRELAY_DLCI, 16);
@@ -168,48 +196,10 @@ static void dissect_fr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_text(fr_tree, tvb, offset, 1, "Unnumbered Information");
}
offset++;
- fr_nlpid = tvb_get_guint8 (tvb,offset);
- if (fr_nlpid == 0) {
- if (tree)
- proto_tree_add_text(fr_tree, tvb, offset, 1, "Padding");
- offset++;
- fr_nlpid=tvb_get_guint8( tvb,offset);
- }
- if (tree)
- proto_tree_add_uint(fr_tree, hf_fr_nlpid, tvb, offset, 1, fr_nlpid );
- offset++;
SET_ADDRESS(&pinfo->dl_src, AT_DLCI, 2, (guint8*)&address);
- if (fr_nlpid == NLPID_SNAP) {
- dissect_snap(tvb, offset, pinfo, tree, fr_tree, fr_ctrl,
- hf_fr_oui, hf_fr_snaptype, hf_fr_pid, 0);
- return;
- }
-
- /*
- * XXX - we should just call "dissect_osi()" here, but
- * some of the routines "dissect_osi()" calls themselves put
- * the NLPID into the tree, and not everything registered with
- * "fr.ietf" is also registered with "osinl".
- *
- * We'd need to figure out what to do with the NLPID.
- * "dissect_osi()" is registered with the "llc.dsap" dissector
- * table, so if it were to put the NLPID into the protocol
- * tree it'd have to create its own subtree for it - not all its
- * callers can do that for it (without knowing whether they're
- * going to call it or not, and the LLC dissector doesn't).
- *
- * Currently, it hands the NLPID as part of the tvbuff to
- * the sub-dissectors it calls; if none of them need to look
- * at it, we could perhaps have it put the NLPID into the
- * tree and *not* have the subdissectors expect it - that's
- * what would have to be done for IP, for example, as IP,
- * unlike CLNP, doesn't expect an NLPID as the first byte.
- */
- if (!dissector_try_port(fr_subdissector_table,fr_nlpid, tvb_new_subset(tvb,offset,-1,-1), pinfo, tree))
- dissect_data(tvb_new_subset(tvb,offset,-1,-1), 0, pinfo, tree);
- return;
+ dissect_fr_nlpid(tvb, offset, pinfo, tree, ti, fr_tree, fr_ctrl);
} else {
if (address == 0) {
/* this must be some sort of lapf on DLCI 0 for SVC */
@@ -234,6 +224,128 @@ static void dissect_fr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
+
+void dissect_fr_uncompressed(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+{
+ proto_item *ti = NULL;
+ proto_tree *fr_tree = NULL;
+
+ CHECK_DISPLAY_AS_DATA(proto_fr, tvb, pinfo, tree);
+
+ pinfo->current_proto = "Frame Relay";
+ if (check_col(pinfo->fd, COL_PROTOCOL))
+ col_set_str(pinfo->fd, COL_PROTOCOL, "FR");
+ if (check_col(pinfo->fd, COL_INFO))
+ col_clear(pinfo->fd, COL_INFO);
+
+ if (tree) {
+ ti = proto_tree_add_protocol_format(tree, proto_fr, tvb, 0, 4, "Frame Relay");
+ fr_tree = proto_item_add_subtree(ti, ett_fr);
+ }
+ dissect_fr_nlpid(tvb, 0, pinfo, tree, ti, fr_tree, XDLC_U);
+}
+
+static void dissect_fr_nlpid(tvbuff_t *tvb, int offset, packet_info *pinfo,
+ proto_tree *tree, proto_item *ti,
+ proto_tree *fr_tree, guint8 fr_ctrl)
+{
+ guint8 fr_nlpid;
+ tvbuff_t *next_tvb;
+
+ fr_nlpid = tvb_get_guint8 (tvb,offset);
+ if (fr_nlpid == 0) {
+ if (tree)
+ proto_tree_add_text(fr_tree, tvb, offset, 1, "Padding");
+ offset++;
+ if (ti != NULL) {
+ /* Include the padding in the top-level protocol tree item. */
+ proto_item_set_len(ti, proto_item_get_len(ti) + 1);
+ }
+ fr_nlpid=tvb_get_guint8( tvb,offset);
+ }
+
+ /*
+ * OSI network layer protocols consider the NLPID to be part
+ * of the frame, so we'll pass it as part of the payload and,
+ * if the protocol is one of those, add it as a hidden item here.
+ */
+ next_tvb = tvb_new_subset(tvb,offset,-1,-1);
+ if (dissector_try_port(osinl_subdissector_table, fr_nlpid, next_tvb,
+ pinfo, tree)) {
+ /*
+ * Yes, we got a match. Add the NLPID as a hidden item,
+ * so you can, at least, filter on it.
+ */
+ if (tree)
+ proto_tree_add_uint_hidden(fr_tree, hf_fr_nlpid,
+ tvb, offset, 1, fr_nlpid );
+ return;
+ }
+
+ /*
+ * All other protocols don't.
+ *
+ * XXX - not true for Q.933 and LMI, but we don't yet have a
+ * Q.933 dissector (it'd be similar to the Q.931 dissector,
+ * but I don't think it'd be identical, although it's less
+ * different than is the Q.2931 dissector), and the LMI
+ * dissector doesn't yet put the protocol discriminator
+ * (NLPID) into the tree.
+ *
+ * Note that an NLPID of 0x08 for Q.933 could either be a
+ * Q.933 signaling message or a message for a protocol
+ * identified by a 2-octet layer 2 protocol type and a
+ * 2-octet layer 3 protocol type, those protocol type
+ * octets having the values from octets 6, 6a, 7, and 7a
+ * of a Q.931 low layer compatibility information element
+ * (section 4.5.19 of Q.931; Q.933 says they have the values
+ * from a Q.933 low layer compatibility information element,
+ * but Q.933 low layer compatibility information elements
+ * don't have protocol values in them).
+ *
+ * Assuming that, as Q.933 seems to imply, that Q.933 messages
+ * look just like Q.931 messages except where it explicitly
+ * says they differ, then the octet after the NLPID would,
+ * in a Q.933 message, have its upper 4 bits zero (that's
+ * the length of the call reference value, in Q.931, and
+ * is limited to 15 or fewer octets). As appears to be the case,
+ * octet 6 of a Q.931 low layer compatibility element has the
+ * 0x40 bit set, so you can distinguish between a Q.933
+ * message and an encapsulated packet by checking whether
+ * the upper 4 bits of the octet after the NLPID are zero.
+ *
+ * To handle this, we'd handle Q.933's NLPID specially, which
+ * we'd want to do anyway, so that we give it a tvbuff that
+ * includes the NLPID.
+ */
+ if (tree)
+ proto_tree_add_uint(fr_tree, hf_fr_nlpid, tvb, offset, 1, fr_nlpid );
+ offset++;
+ if (ti != NULL) {
+ /* Include the NLPID in the top-level protocol tree item. */
+ proto_item_set_len(ti, proto_item_get_len(ti) + 1);
+ }
+
+ switch (fr_nlpid) {
+
+ case NLPID_SNAP:
+ if (ti != NULL) {
+ /* Include the SNAP header in the top-level protocol tree item. */
+ proto_item_set_len(ti, proto_item_get_len(ti) + 5);
+ }
+ dissect_snap(tvb, offset, pinfo, tree, fr_tree, fr_ctrl,
+ hf_fr_oui, hf_fr_snaptype, hf_fr_pid, 0);
+ return;
+
+ default:
+ next_tvb = tvb_new_subset(tvb,offset,-1,-1);
+ if (!dissector_try_port(fr_subdissector_table,fr_nlpid,
+ next_tvb, pinfo, tree))
+ dissect_data(next_tvb, 0, pinfo, tree);
+ break;
+ }
+}
+
static void dissect_lapf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_tree_add_text(tree, tvb, 0, 0, "Frame relay lapf not yet implemented");
@@ -274,7 +386,7 @@ void proto_register_fr(void)
FRELAY_EA, "Extended Address" }},
{ &hf_fr_nlpid, {
"NLPID", "fr.nlpid", FT_UINT8, BASE_HEX,
- VALS(nlpid_vals), 0x0, "FrameRelay Encapsulated Protocol NLPID" }},
+ VALS(fr_nlpid_vals), 0x0, "FrameRelay Encapsulated Protocol NLPID" }},
{ &hf_fr_oui, {
"Organization Code", "fr.snap.oui", FT_UINT24, BASE_HEX,
VALS(oui_vals), 0x0, ""}},
diff --git a/packet-fr.h b/packet-fr.h
new file mode 100644
index 0000000000..3185739553
--- /dev/null
+++ b/packet-fr.h
@@ -0,0 +1,27 @@
+/* packet-fr.h
+ * Declaration of routines for Frame Relay dissection
+ *
+ * $Id: packet-fr.h,v 1.1 2001/03/30 10:51:50 guy Exp $
+ *
+ * Ethereal - Network traffic analyzer
+ * By Gerald Combs <gerald@zing.org>
+ * Copyright 1998 Gerald Combs
+ *
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+void dissect_fr_uncompressed(tvbuff_t *tvb, packet_info *pinfo,
+ proto_tree *tree);
diff --git a/packet-isis.c b/packet-isis.c
index 67376fbecc..4bb6d21d56 100644
--- a/packet-isis.c
+++ b/packet-isis.c
@@ -2,7 +2,7 @@
* Routines for ISO/OSI network and transport protocol packet disassembly, core
* bits.
*
- * $Id: packet-isis.c,v 1.18 2001/01/10 09:07:35 guy Exp $
+ * $Id: packet-isis.c,v 1.19 2001/03/30 10:51:50 guy Exp $
* Stuart Stanley <stuarts@mxmail.net>
*
* Ethereal - Network traffic analyzer
@@ -338,5 +338,4 @@ void
proto_reg_handoff_isis(void)
{
old_dissector_add("osinl", NLPID_ISO10589_ISIS, dissect_isis, proto_isis);
- old_dissector_add("fr.ietf", NLPID_ISO10589_ISIS, dissect_isis, proto_isis);
}
diff --git a/packet-llc.c b/packet-llc.c
index 378eaa128c..edc982baea 100644
--- a/packet-llc.c
+++ b/packet-llc.c
@@ -2,7 +2,7 @@
* Routines for IEEE 802.2 LLC layer
* Gilbert Ramirez <gram@xiexie.org>
*
- * $Id: packet-llc.c,v 1.83 2001/03/22 16:24:14 gram Exp $
+ * $Id: packet-llc.c,v 1.84 2001/03/30 10:51:50 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -42,7 +42,6 @@
#include "packet-ip.h"
#include "packet-ipx.h"
#include "packet-netbios.h"
-#include "packet-osi.h"
#include "sna-utils.h"
#include "packet-llc.h"
diff --git a/packet-lmi.c b/packet-lmi.c
index 6e07e878c7..4ccc0a80ee 100644
--- a/packet-lmi.c
+++ b/packet-lmi.c
@@ -2,7 +2,7 @@
* Routines for Frame Relay Local Management Interface (LMI) disassembly
* Copyright 2001, Jeffrey C. Foster <jfoste@woodward.com>
*
- * $Id: packet-lmi.c,v 1.2 2001/03/29 07:46:08 guy Exp $
+ * $Id: packet-lmi.c,v 1.3 2001/03/30 10:51:50 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -47,8 +47,7 @@
#include <glib.h>
#include <string.h>
#include "packet.h"
-#include "packet-osi.h"
-
+#include "nlpid.h"
static int proto_lmi = -1;
static int hf_lmi_call_ref = -1;
@@ -67,35 +66,6 @@ static int hf_lmi_act = -1;
static gint ett_lmi = -1;
static gint ett_lmi_ele = -1;
-/*
- * XXX - 0x09 means Q.2931 in some places, and Q.933 says 0x08 is the
- * NLPID for Q.933.
- *
- * However, RFC 2427 also says that an NLPID of 0x08 is used for
- * protocols that have neither an NLPID nor a SNAP encapsulation.
- *
- * What's the deal here? Is 0x08 for Q.933, and 0x09 for LMI, with
- * Q.933 used for full blown "phone call"-style signaling and LMI used
- * only for PVC status information? The IBM reference above says
- * that 0x08 is used for LMI.
- *
- * The Linux 2.2.14 "drivers/net/comx-proto-fr.c" has 0x08 as
- * NLPID_Q933_LMI and 0x09 as NLPID_CISCO_LMI. The page at
- *
- * http://dtool.com/gang.html
- *
- * speaks of "ANSI or ANSI Annex D or ITU-T Annex A" LMI,
- * "Cisco" or "Gang of Four" LMI, and "Q933A (ITU-T)" or "Annex-A"
- * LMI.
- *
- * If 0x08 is for Q.933, how do you distinguish the Q.931-style
- * signaling packets from the RFC 2427 encapsulation? Require a
- * call reference value of 0, which would presumably not be valid
- * for the first octet of an L2 protocol ID? RFC 2427 appears to
- * be silent on this.
- */
-#define NLPID_LMI 0x09 /* NLPID value for LMI */
-
#ifdef _OLD_
/*
* Bits in the address field.
diff --git a/packet-osi.c b/packet-osi.c
index 53c7bc5274..e3588acb28 100644
--- a/packet-osi.c
+++ b/packet-osi.c
@@ -2,7 +2,7 @@
* Routines for ISO/OSI network and transport protocol packet disassembly
* Main entrance point and common functions
*
- * $Id: packet-osi.c,v 1.40 2001/03/29 08:05:06 guy Exp $
+ * $Id: packet-osi.c,v 1.41 2001/03/30 10:51:50 guy Exp $
* Laurent Deniel <deniel@worldnet.fr>
* Ralf Schneider <Ralf.Schneider@t-online.de>
*
@@ -224,9 +224,9 @@ const value_string nlpid_vals[] = {
{ 0, NULL },
};
-static dissector_table_t subdissector_table;
+dissector_table_t osinl_subdissector_table;
-void dissect_osi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static void dissect_osi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
guint8 nlpid;
@@ -235,7 +235,7 @@ void dissect_osi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
nlpid = tvb_get_guint8(tvb, 0);
/* do lookup with the subdissector table */
- if (dissector_try_port(subdissector_table, nlpid, tvb, pinfo, tree))
+ if (dissector_try_port(osinl_subdissector_table, nlpid, tvb, pinfo, tree))
return;
switch (nlpid) {
@@ -272,7 +272,7 @@ proto_register_osi(void)
/* There's no "OSI" protocol *per se*, but we do register a
dissector table so various protocols running at the
network layer can register themselves. */
- subdissector_table = register_dissector_table("osinl");
+ osinl_subdissector_table = register_dissector_table("osinl");
}
void
diff --git a/packet-osi.h b/packet-osi.h
index b5c759228b..c7d1bbeed0 100644
--- a/packet-osi.h
+++ b/packet-osi.h
@@ -1,6 +1,6 @@
/* packet-osi.h
*
- * $Id: packet-osi.h,v 1.5 2000/11/18 10:38:25 guy Exp $
+ * $Id: packet-osi.h,v 1.6 2001/03/30 10:51:50 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -97,16 +97,19 @@
#define BIT_15 0x4000
#define BIT_16 0x8000
+/*
+ * Dissector table for NLPIDs for protocols whose packets begin with
+ * the NLPID.
+ */
+dissector_table_t osinl_subdissector_table;
/*
* published API functions
*/
-extern void dissect_osi( tvbuff_t *, packet_info *, proto_tree *);
extern gchar *print_nsap_net ( const u_char *, int );
extern gchar *print_area ( const u_char *, int );
extern gchar *print_system_id( const u_char *, int );
extern gchar *calc_checksum ( tvbuff_t *, int, u_int, u_int );
#endif /* _PACKET_OSI_H */
-
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);
}
-
-
-
diff --git a/packet-x25.c b/packet-x25.c
index a0f1b70cc5..f8b210f83e 100644
--- a/packet-x25.c
+++ b/packet-x25.c
@@ -2,7 +2,7 @@
* Routines for x25 packet disassembly
* Olivier Abad <oabad@cybercable.fr>
*
- * $Id: packet-x25.c,v 1.46 2001/02/12 09:06:17 guy Exp $
+ * $Id: packet-x25.c,v 1.47 2001/03/30 10:51:50 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -36,11 +36,8 @@
#include <glib.h>
#include <stdlib.h>
#include <string.h>
-#include "etypes.h"
#include "llcsaps.h"
#include "packet.h"
-#include "packet-ip.h"
-#include "packet-osi.h"
#include "nlpid.h"
#define FROM_DCE 0x80