aboutsummaryrefslogtreecommitdiffstats
path: root/packet-vlan.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2000-01-23 08:55:37 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2000-01-23 08:55:37 +0000
commit9cb57e6407c1ab93c2775e3da8d4cac20f19e5c3 (patch)
tree8647292ca380ae9108970a167959b9df1c931ec9 /packet-vlan.c
parent02e20af37c3ca0af72d23974424291f760283843 (diff)
In "dissect_eth()", update "pi.len" and "pi.captured_len" regardless of
whether we're building a protocol tree or not. Make "dissect_eth()" use "BYTES_ARE_IN_FRAME()" to see if we have a full Ethernet header - it can be called with a non-zero offset, if Ethernet frames are encapsulated inside other frames (e.g., ATM LANE). Make capture routines take an "offset" argument if the corresponding dissect routine takes one (for symmetry, and for Cisco ISL or any other protocol that encapsulates Ethernet or Token-Ring frames inside other frames). Pass the frame lengths to capture routines via the "pi" structure, rather than as an in-line argument, so that they can macros such as "BYTES_ARE_IN_FRAME()" the way the corresponding dissect routines do. Make capture routines update "pi.len" and "pi.captured_len" the same way the corresponding diseect routines do, if the capture routines then call other capture routines. Make "capture_vlan()" count as "other" frames that are too short, the way other capture routines do. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1525 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-vlan.c')
-rw-r--r--packet-vlan.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/packet-vlan.c b/packet-vlan.c
index e9d7f91cc6..7df004b6ee 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.6 1999/12/05 20:05:44 nneul Exp $
+ * $Id: packet-vlan.c,v 1.7 2000/01/23 08:55:37 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -48,20 +48,21 @@ static int hf_vlan_cfi = -1;
static gint ett_vlan = -1;
void
-capture_vlan(const u_char *pd, int offset, guint32 cap_len, packet_counts *ld ) {
+capture_vlan(const u_char *pd, int offset, packet_counts *ld ) {
guint32 encap_proto;
if ( !BYTES_ARE_IN_FRAME(offset,5) ) {
+ ld->other++;
return;
}
encap_proto = pntohs( &pd[offset+2] );
if ( encap_proto <= IEEE_802_3_MAX_LEN) {
if ( pd[offset+4] == 0xff && pd[offset+5] == 0xff ) {
- capture_ipx(pd,offset+4,cap_len,ld);
+ capture_ipx(pd,offset+4,ld);
} else {
- capture_llc(pd,offset+4,cap_len,ld);
+ capture_llc(pd,offset+4,ld);
}
} else {
- capture_ethertype(encap_proto, offset+4, pd, cap_len, ld);
+ capture_ethertype(encap_proto, offset+4, pd, ld);
}
}