aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2001-01-21 22:51:46 +0000
committerGuy Harris <guy@alum.mit.edu>2001-01-21 22:51:46 +0000
commitd9718a693d2ee60f6e9b018313efb4905b5a2509 (patch)
treea5ba5f29141aafb5d72821e978779663274ab03c
parent412318920cc91433503bea190063df715aedeb84 (diff)
Remove some more "CHECK_DISPLAY_AS_DATA()" calls and code to set
"pinfo->current_proto", in dissectors always called through dissector tables and handles. Make the IEEE 802.11 dissector static, as it's not called externally. Clear the Info column in the Linux cooked capture and 802.1q VLAN dissectors, before extracting anything from the packet, so that if an exception is thrown, the Info column doesn't reflect the previous protocol. Don't extract the encapsulated protocol in the VLAN dissector until you use it, so that if the frame contains the VLAN ID but not the encapsulated protocol, we at least put the VLAN ID into the protocol tree. svn path=/trunk/; revision=2927
-rw-r--r--packet-ieee80211.c14
-rw-r--r--packet-llc.c6
-rw-r--r--packet-pppoe.c10
-rw-r--r--packet-sll.c7
-rw-r--r--packet-trmac.c5
-rw-r--r--packet-vlan.c10
6 files changed, 12 insertions, 40 deletions
diff --git a/packet-ieee80211.c b/packet-ieee80211.c
index e242e8bd15..006c92d174 100644
--- a/packet-ieee80211.c
+++ b/packet-ieee80211.c
@@ -3,7 +3,7 @@
* Copyright 2000, Axis Communications AB
* Inquiries/bugreports should be sent to Johan.Jorgensen@axis.com
*
- * $Id: packet-ieee80211.c,v 1.10 2001/01/10 23:28:46 guy Exp $
+ * $Id: packet-ieee80211.c,v 1.11 2001/01/21 22:51:46 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
@@ -175,12 +175,6 @@ col_add_str(fd,COL_INFO,info);
#define TAG_CHALLENGE_TEXT 0x10
-/* ************************************************************************* */
-/* Various constants used in this module */
-/* ************************************************************************* */
-static const char *capture_proto_name = "IEEE 802.11";
-
-
static int proto_wlan = -1;
/* ************************************************************************* */
/* Header field info values for FC-field */
@@ -728,7 +722,7 @@ add_tagged_field (proto_tree * tree, tvbuff_t * tvb, int offset)
/* ************************************************************************* */
/* Dissect 802.11 frame */
/* ************************************************************************* */
-void
+static void
dissect_ieee80211 (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
{
guint16 fcf, flags;
@@ -749,10 +743,6 @@ dissect_ieee80211 (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
cap_len = pinfo->captured_len;
fcf = tvb_get_letohs (tvb, 0);
- CHECK_DISPLAY_AS_DATA(proto_wlan, tvb, pinfo, tree);
-
- pinfo->current_proto = capture_proto_name;
-
if (check_col (pinfo->fd, COL_PROTOCOL))
col_set_str (pinfo->fd, COL_PROTOCOL, "IEEE 802.11");
diff --git a/packet-llc.c b/packet-llc.c
index c517b19f74..f4e7e3d5f9 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.81 2001/01/18 07:44:39 guy Exp $
+ * $Id: packet-llc.c,v 1.82 2001/01/21 22:51:46 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -280,10 +280,6 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint8 dsap, ssap;
tvbuff_t *next_tvb;
- CHECK_DISPLAY_AS_DATA(proto_llc, tvb, pinfo, tree);
-
- pinfo->current_proto = "LLC";
-
if (check_col(pinfo->fd, COL_PROTOCOL)) {
col_set_str(pinfo->fd, COL_PROTOCOL, "LLC");
}
diff --git a/packet-pppoe.c b/packet-pppoe.c
index 64a78430d2..58230d5050 100644
--- a/packet-pppoe.c
+++ b/packet-pppoe.c
@@ -1,7 +1,7 @@
/* packet-pppoe.c
* Routines for PPP Over Ethernet (PPPoE) packet disassembly (RFC2516)
*
- * $Id: packet-pppoe.c,v 1.15 2001/01/09 06:31:40 guy Exp $
+ * $Id: packet-pppoe.c,v 1.16 2001/01/21 22:51:46 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -163,10 +163,6 @@ dissect_pppoed(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
proto_tree *pppoe_tree;
proto_item *ti;
- CHECK_DISPLAY_AS_DATA(proto_pppoed, tvb, pinfo, tree);
-
- pinfo->current_proto = "PPPoED";
-
if (check_col(pinfo->fd, COL_PROTOCOL)) {
col_set_str(pinfo->fd,COL_PROTOCOL, "PPPoED");
}
@@ -239,10 +235,6 @@ dissect_pppoes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
proto_item *ti;
tvbuff_t *next_tvb;
- CHECK_DISPLAY_AS_DATA(proto_pppoes, tvb, pinfo, tree);
-
- pinfo->current_proto = "PPPoES";
-
if (check_col(pinfo->fd, COL_PROTOCOL)) {
col_set_str(pinfo->fd,COL_PROTOCOL, "PPPoES");
}
diff --git a/packet-sll.c b/packet-sll.c
index 78bec6f64c..1dbf75b2ef 100644
--- a/packet-sll.c
+++ b/packet-sll.c
@@ -1,7 +1,7 @@
/* packet-sll.c
* Routines for disassembly of packets from Linux "cooked mode" captures
*
- * $Id: packet-sll.c,v 1.6 2001/01/18 07:44:39 guy Exp $
+ * $Id: packet-sll.c,v 1.7 2001/01/21 22:51:46 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -141,11 +141,10 @@ dissect_sll(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tvbuff_t *next_tvb;
proto_tree *fh_tree = NULL;
- CHECK_DISPLAY_AS_DATA(proto_sll, tvb, pinfo, tree);
-
- pinfo->current_proto = "SLL";
if (check_col(pinfo->fd, COL_PROTOCOL))
col_set_str(pinfo->fd, COL_PROTOCOL, "SLL");
+ if (check_col(pinfo->fd, COL_INFO))
+ col_clear(pinfo->fd, COL_INFO);
pkttype = tvb_get_ntohs(tvb, 0);
diff --git a/packet-trmac.c b/packet-trmac.c
index 8eda4136c0..3f3907d037 100644
--- a/packet-trmac.c
+++ b/packet-trmac.c
@@ -2,7 +2,7 @@
* Routines for Token-Ring Media Access Control
* Gilbert Ramirez <gram@xiexie.org>
*
- * $Id: packet-trmac.c,v 1.30 2001/01/09 06:31:44 guy Exp $
+ * $Id: packet-trmac.c,v 1.31 2001/01/21 22:51:46 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -280,9 +280,6 @@ dissect_trmac(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint8 mv_val;
char *mv_text;
- CHECK_DISPLAY_AS_DATA(proto_trmac, tvb, pinfo, tree);
-
- pinfo->current_proto = "TR MAC";
if (check_col(pinfo->fd, COL_PROTOCOL))
col_set_str(pinfo->fd, COL_PROTOCOL, "TR MAC");
if (check_col(pinfo->fd, COL_INFO))
diff --git a/packet-vlan.c b/packet-vlan.c
index 595ec8f8e9..a85c1070db 100644
--- a/packet-vlan.c
+++ b/packet-vlan.c
@@ -1,7 +1,7 @@
/* packet-vlan.c
* Routines for VLAN 802.1Q ethernet header disassembly
*
- * $Id: packet-vlan.c,v 1.30 2001/01/18 07:44:39 guy Exp $
+ * $Id: packet-vlan.c,v 1.31 2001/01/21 22:51:46 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -83,15 +83,12 @@ dissect_vlan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tvbuff_t *volatile trailer_tvb;
proto_tree *volatile vlan_tree;
- CHECK_DISPLAY_AS_DATA(proto_vlan, tvb, pinfo, tree);
-
- pinfo->current_proto = "VLAN";
-
if (check_col(pinfo->fd, COL_PROTOCOL))
col_set_str(pinfo->fd, COL_PROTOCOL, "VLAN");
+ if (check_col(pinfo->fd, COL_INFO))
+ col_clear(pinfo->fd, COL_INFO);
tci = tvb_get_ntohs( tvb, 0 );
- encap_proto = tvb_get_ntohs( tvb, 2 );
if (check_col(pinfo->fd, COL_INFO)) {
col_add_fstr(pinfo->fd, COL_INFO, "PRI: %d CFI: %d ID: %d",
@@ -109,6 +106,7 @@ dissect_vlan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_uint(vlan_tree, hf_vlan_id, tvb, 0, 2, tci);
}
+ encap_proto = tvb_get_ntohs( tvb, 2 );
if ( encap_proto <= IEEE_802_3_MAX_LEN) {
/* Give the next dissector only 'encap_proto' number of bytes */
proto_tree_add_uint(vlan_tree, hf_vlan_len, tvb, 2, 2, encap_proto);