Removed trailing whitespaces from .h and .c files using the
[obnox/wireshark/wip.git] / wiretap / wtap-int.h
index 972b1d1988fd9b6669116765bb1bb52abee49608..b9b3b0d686dda446dbd5616f57ec4f909f11bcd5 100644 (file)
@@ -1,47 +1,38 @@
 /* wtap-int.h
  *
- * $Id: wtap-int.h,v 1.16 2001/12/04 07:32:05 guy Exp $
+ * $Id: wtap-int.h,v 1.28 2002/08/28 20:30:45 jmayer Exp $
  *
  * Wiretap Library
  * Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
- * 
+ *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2
  * of the License, or (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
  */
 
 #ifndef __WTAP_INT_H__
 #define __WTAP_INT_H__
 
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-
 #ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
 #endif
 
-#ifdef HAVE_WINSOCK_H
-#include <winsock.h>
-#endif
-
 #include <glib.h>
 #include <stdio.h>
 #include <time.h>
 
 #ifdef HAVE_LIBZ
-#include "zlib.h"
+#include <zlib.h>
 #define FILE_T gzFile
 #else /* No zLib */
 #define FILE_T FILE *
@@ -98,12 +89,13 @@ typedef struct {
 } netmon_t;
 
 typedef struct {
-       time_t  start_time;
-       double  timeunit;
-       double  start_timestamp;
-       int     wrapped;
-       int     end_offset;
-       int     version_major;
+       time_t          start_time;
+       double          timeunit;
+       double          start_timestamp;
+       gboolean        wrapped;
+       int             end_offset;
+       int             version_major;
+       guint           padding;        /* end-of-packet padding */
 } netxray_t;
 
 typedef struct {
@@ -116,9 +108,13 @@ typedef struct {
        gboolean byteswapped;
 } csids_t;
 
-typedef int (*subtype_read_func)(struct wtap*, int*, long*);
-typedef int (*subtype_seek_read_func)(struct wtap*, long, union wtap_pseudo_header*,
-                                       guint8*, int);
+typedef struct {
+       struct timeval reference_time;
+} etherpeek_t;
+
+typedef gboolean (*subtype_read_func)(struct wtap*, int*, long*);
+typedef gboolean (*subtype_seek_read_func)(struct wtap*, long, union wtap_pseudo_header*,
+                                       guint8*, int, int *);
 struct wtap {
        FILE_T                  fh;
         int                     fd;           /* File descriptor for cap file */
@@ -141,6 +137,7 @@ struct wtap {
                netxray_t               *netxray;
                ascend_t                *ascend;
                csids_t                 *csids;
+               etherpeek_t             *etherpeek;
                void                    *generic;
        } capture;
 
@@ -158,7 +155,7 @@ struct wtap_dumper;
 
 typedef gboolean (*subtype_write_func)(struct wtap_dumper*,
                const struct wtap_pkthdr*, const union wtap_pseudo_header*,
-               const u_char*, int*);
+               const guchar*, int*);
 typedef gboolean (*subtype_close_func)(struct wtap_dumper*, int*);
 
 typedef struct {
@@ -186,7 +183,7 @@ struct wtap_dumper {
        int                     file_type;
        int                     snaplen;
        int                     encap;
-       int                     bytes_dumped;
+       long                    bytes_dumped;
 
        union {
                void                    *opaque;
@@ -347,4 +344,9 @@ struct wtap_dumper {
        } \
        G_STMT_END
 
+/* glib doesn't have g_ptr_array_len of all things!*/
+#ifndef g_ptr_array_len
+#define g_ptr_array_len(a)      ((a)->len)
+#endif
+
 #endif /* __WTAP_INT_H__ */