diff options
author | Guy Harris <guy@alum.mit.edu> | 2003-10-01 07:11:49 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2003-10-01 07:11:49 +0000 |
commit | be2736adcf8ac583c2d56e37db9ef01f391913f9 (patch) | |
tree | defd8c4db6a77dd4d288de2b0b10f39d6c701b73 /wiretap/5views.c | |
parent | 44bb98184df93ebb56b5dce5dbd1deb6f37d716a (diff) |
Have a pseudo-header for Ethernet packets, giving the size of the FCS -
0 means "there is no FCS in the packet data", 4 means "there is an FCS
in the packet data", -1 means "I don't know whether there's an FCS in
the packet data, guess based on the packet size".
Assume that Ethernet encapsulated inside other protocols has no FCS, by
having the "eth" dissector assume that (and not check for an Ethernet
pseudo-header).
Have "ethertype()" take an argument giving the FCS size; pass 0 when
appropriate.
Fix up Wiretap routines to set the pseudo-header. This means we no
longer use the "generic" seek-and-read routine, so get rid of it.
svn path=/trunk/; revision=8574
Diffstat (limited to 'wiretap/5views.c')
-rw-r--r-- | wiretap/5views.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/wiretap/5views.c b/wiretap/5views.c index baf70a3112..327653e8f2 100644 --- a/wiretap/5views.c +++ b/wiretap/5views.c @@ -1,6 +1,6 @@ /* 5views.c * - * $Id: 5views.c,v 1.2 2003/07/29 20:26:34 guy Exp $ + * $Id: 5views.c,v 1.3 2003/10/01 07:11:46 guy Exp $ * * Wiretap Library * Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu> @@ -251,6 +251,14 @@ _5views_read(wtap *wth, int *err, long *data_offset) wth->phdr.len = orig_size; wth->phdr.pkt_encap = wth->file_encap; + switch (wth->file_encap) { + + case WTAP_ENCAP_ETHERNET: + /* We assume there's no FCS in this frame. */ + wth->pseudo_header.eth.fcs_len = 0; + break; + } + return TRUE; } @@ -301,7 +309,7 @@ _5views_read_header(wtap *wth _U_, FILE_T fh, t_5VW_TimeStamped_Header *hdr, static gboolean _5views_seek_read(wtap *wth, long seek_off, - union wtap_pseudo_header *pseudo_header _U_, guchar *pd, int length, int *err) + union wtap_pseudo_header *pseudo_header, guchar *pd, int length, int *err) { if (file_seek(wth->random_fh, seek_off, SEEK_SET, err) == -1) return FALSE; @@ -311,6 +319,13 @@ _5views_seek_read(wtap *wth, long seek_off, if (!_5views_read_rec_data(wth->random_fh, pd, length, err)) return FALSE; + switch (wth->file_encap) { + + case WTAP_ENCAP_ETHERNET: + /* We assume there's no FCS in this frame. */ + pseudo_header->eth.fcs_len = 0; + break; + } return TRUE; } |