diff options
author | Guy Harris <guy@alum.mit.edu> | 2000-01-23 08:55:37 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2000-01-23 08:55:37 +0000 |
commit | 2461d79698e685644e2f07ee46381a092348461c (patch) | |
tree | 8647292ca380ae9108970a167959b9df1c931ec9 /packet-fddi.c | |
parent | 42d68156a9599948fb0c5c633efc9d61548d5a5b (diff) | |
download | wireshark-2461d79698e685644e2f07ee46381a092348461c.tar.gz wireshark-2461d79698e685644e2f07ee46381a092348461c.tar.bz2 wireshark-2461d79698e685644e2f07ee46381a092348461c.zip |
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.
svn path=/trunk/; revision=1525
Diffstat (limited to 'packet-fddi.c')
-rw-r--r-- | packet-fddi.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/packet-fddi.c b/packet-fddi.c index cdfae657b5..a044ac87be 100644 --- a/packet-fddi.c +++ b/packet-fddi.c @@ -3,7 +3,7 @@ * * Laurent Deniel <deniel@worldnet.fr> * - * $Id: packet-fddi.c,v 1.25 1999/11/16 11:42:30 guy Exp $ + * $Id: packet-fddi.c,v 1.26 2000/01/23 08:55:32 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -137,10 +137,11 @@ swap_mac_addr(u_char *swapped_addr, const u_char *orig_addr) void -capture_fddi(const u_char *pd, guint32 cap_len, packet_counts *ld) { +capture_fddi(const u_char *pd, packet_counts *ld) +{ int offset = 0, fc; - if (cap_len < FDDI_HEADER_SIZE) { + if (!BYTES_ARE_IN_FRAME(0, FDDI_HEADER_SIZE)) { ld->other++; return; } @@ -168,7 +169,7 @@ capture_fddi(const u_char *pd, guint32 cap_len, packet_counts *ld) { case FDDI_FC_LLC_ASYNC + 13 : case FDDI_FC_LLC_ASYNC + 14 : case FDDI_FC_LLC_ASYNC + 15 : - capture_llc(pd, offset, cap_len, ld); + capture_llc(pd, offset, ld); return; default : ld->other++; @@ -259,7 +260,7 @@ void dissect_fddi(const u_char *pd, frame_data *fd, proto_tree *tree, static u_char src[6], dst[6]; u_char src_swapped[6], dst_swapped[6]; - if (fd->cap_len < FDDI_HEADER_SIZE) { + if (!BYTES_ARE_IN_FRAME(0, FDDI_HEADER_SIZE)) { dissect_data(pd, offset, fd, tree); return; } |