aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/wtap.h
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2003-10-01 07:11:49 +0000
committerGuy Harris <guy@alum.mit.edu>2003-10-01 07:11:49 +0000
commitbe2736adcf8ac583c2d56e37db9ef01f391913f9 (patch)
treedefd8c4db6a77dd4d288de2b0b10f39d6c701b73 /wiretap/wtap.h
parent44bb98184df93ebb56b5dce5dbd1deb6f37d716a (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/wtap.h')
-rw-r--r--wiretap/wtap.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/wiretap/wtap.h b/wiretap/wtap.h
index 98d8f8a02f..54be05aea6 100644
--- a/wiretap/wtap.h
+++ b/wiretap/wtap.h
@@ -1,6 +1,6 @@
/* wtap.h
*
- * $Id: wtap.h,v 1.140 2003/08/26 07:10:39 guy Exp $
+ * $Id: wtap.h,v 1.141 2003/10/01 07:11:49 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -197,6 +197,11 @@
* of that.
*/
+/* Packet "pseudo-header" information for Ethernet capture files. */
+struct eth_phdr {
+ gint fcs_len; /* Number of bytes of FCS - -1 means "unknown" */
+};
+
/* Packet "pseudo-header" information for X.25 capture files. */
#define FROM_DCE 0x80
struct x25_phdr {
@@ -353,6 +358,7 @@ struct cosine_phdr {
};
union wtap_pseudo_header {
+ struct eth_phdr eth;
struct x25_phdr x25;
struct isdn_phdr isdn;
struct atm_phdr atm;
@@ -420,8 +426,6 @@ void wtap_sequential_close(wtap *wth);
void wtap_close(wtap *wth);
gboolean wtap_seek_read (wtap *wth, long seek_off,
union wtap_pseudo_header *pseudo_header, guint8 *pd, int len, int *err);
-gboolean wtap_def_seek_read (wtap *wth, long seek_off,
- union wtap_pseudo_header *pseudo_header, guint8 *pd, int len, int *err);
gboolean wtap_dump_can_open(int filetype);
gboolean wtap_dump_can_write_encap(int filetype, int encap);