"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.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2927
f5534014-38df-0310-8fa8-
9805f1628bb7
* 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>
#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 */
/* ************************************************************************* */
/* Dissect 802.11 frame */
/* ************************************************************************* */
-void
+static void
dissect_ieee80211 (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
{
guint16 fcf, flags;
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");
* 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>
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");
}
/* 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>
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");
}
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");
}
/* 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>
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);
* 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>
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))
/* 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>
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",
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);