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/file_access.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/file_access.c')
-rw-r--r-- | wiretap/file_access.c | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/wiretap/file_access.c b/wiretap/file_access.c index 25d7a92584..74e4bb6260 100644 --- a/wiretap/file_access.c +++ b/wiretap/file_access.c @@ -1,6 +1,6 @@ /* file_access.c * - * $Id: file_access.c,v 1.2 2003/08/26 07:10:38 guy Exp $ + * $Id: file_access.c,v 1.3 2003/10/01 07:11:47 guy Exp $ * * Wiretap Library * Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu> @@ -124,25 +124,6 @@ static int (*const open_routines[])(wtap *, int *) = { #define N_FILE_TYPES (sizeof open_routines / sizeof open_routines[0]) -gboolean wtap_def_seek_read(wtap *wth, long seek_off, - union wtap_pseudo_header *pseudo_header _U_, - guint8 *pd, int len, int *err) -{ - int bytes_read; - - if (file_seek(wth->random_fh, seek_off, SEEK_SET, err) == -1) - return FALSE; - - bytes_read = file_read(pd, sizeof(guint8), len, wth->random_fh); - if (bytes_read != len) { - *err = file_error(wth->random_fh); - if (*err == 0) - *err = WTAP_ERR_SHORT_READ; - return FALSE; - } - return TRUE; -} - /* * Visual C++ on Win32 systems doesn't define these. (Old UNIX systems don't * define them either.) |