From njohnkev:
[obnox/wireshark/wip.git] / wiretap / wtap.h
index ab562b5698db9c97f5456d71ca452c9e11a6464b..eb70e745a832a4565632eef7dcd1ee98d7bc48fe 100644 (file)
@@ -215,6 +215,12 @@ extern "C" {
 #define WTAP_ENCAP_JPEG_JFIF                    123
 #define WTAP_ENCAP_IPNET                        124
 #define WTAP_ENCAP_SOCKETCAN                    125
+#define WTAP_ENCAP_IEEE802_11_NETMON_RADIO      126
+#define WTAP_ENCAP_IEEE802_15_4_NOFCS           127
+#define WTAP_ENCAP_RAW_IPFIX                    128
+#define WTAP_ENCAP_RAW_IP4                      129
+#define WTAP_ENCAP_RAW_IP6                      130
+#define WTAP_ENCAP_LAPD                         131
 
 #define WTAP_NUM_ENCAP_TYPES                    wtap_get_num_encap_types()
 
@@ -281,6 +287,7 @@ extern "C" {
 #define WTAP_FILE_NETSCALER_1_0                 57
 #define WTAP_FILE_NETSCALER_2_0                 58
 #define WTAP_FILE_JPEG_JFIF                     59
+#define WTAP_FILE_IPFIX                         60
 
 #define WTAP_NUM_FILE_TYPES                     wtap_get_num_file_types()
 
@@ -613,75 +620,6 @@ struct catapult_dct2000_phdr
        struct wtap *wth;
 };
 
-/*
- * possible event type
- */
-#define URB_SUBMIT        'S'
-#define URB_COMPLETE      'C'
-#define URB_ERROR         'E'
-
-/*
- * possible transfer mode
- */
-#define URB_ISOCHRONOUS   0x0
-#define URB_INTERRUPT     0x1
-#define URB_CONTROL       0x2
-#define URB_BULK          0x3
-
-#define URB_TRANSFER_IN   0x80         /* to host */
-
-/*
- * USB setup header as defined in USB specification
- * See usb_20.pdf, Chapter 9.3 'USB Device Requests' for details.
- * http://www.usb.org/developers/docs/usb_20_122909-2.zip
- */
-struct usb_device_setup_hdr {
-    gint8 bmRequestType;
-    guint8 bRequest;
-    guint16 wValue;
-    guint16 wIndex;
-    guint16 wLength;
-};
-
-/*
- * Information from the URB for Isochronous transfers.
- */
-struct iso_rec {
-    guint32 error_count;
-    guint32 numdesc;
-};
-
-/*
- * Header prepended by Linux kernel to each USB event.
- * Always followed either by:
- *
- *     a struct usb_device_setup_hdr, if "setup_flag" is 0;
- *
- *     a struct iso_rec, if this is an isochronous transfer;
- *
- *     8 bytes of junk, otherwise.
- *
- * (Setup flag is '-', 'D', 'Z', or 0.  Data flag is '<', '>', 'Z', or 0.)
- * See linux/Documentation/usb/usbmon.txt and libpcap/pcap/usb.h for details.
- *
- * The values are in *host* byte order.
- */
-struct linux_usb_phdr {
-    guint64 id;             /* urb id, to link submission and completion events */
-    guint8 event_type;      /* Submit ('S'), Completed ('C'), Error ('E') */
-    guint8 transfer_type;   /* ISO (0), Intr, Control, Bulk (3) */
-    guint8 endpoint_number; /* Endpoint number (0-15) and transfer direction */
-    guint8 device_address;  /* 0-127 */
-    guint16 bus_id;
-    gint8 setup_flag;       /* 0, if the urb setup header is meaningful */
-    gint8 data_flag;        /* 0, if urb data is present */
-    gint64 ts_sec;
-    gint32 ts_usec;
-    gint32 status;
-    guint32 urb_len;        /* whole len of urb this event refers to */
-    guint32 data_len;       /* amount of urb data really present in this event */
-};
-
 #define LIBPCAP_BT_PHDR_SENT    0
 #define LIBPCAP_BT_PHDR_RECV    1
 
@@ -840,7 +778,7 @@ struct gsm_um_phdr {
 #define GSM_UM_CHANNEL_RACH    6
 #define GSM_UM_CHANNEL_AGCH    7
 #define GSM_UM_CHANNEL_PCH     8
-  
+
 union wtap_pseudo_header {
        struct eth_phdr         eth;
        struct x25_phdr         x25;
@@ -886,11 +824,11 @@ typedef struct wtap_dumper wtap_dumper;
 struct file_type_info {
     /* the file type name */
     /* should be NULL for all "pseudo" types that are only internally used and not read/writeable */
-       const char *name;
+    const char *name;
 
     /* the file type short name, used as a shortcut for the command line tools */
     /* should be NULL for all "pseudo" types that are only internally used and not read/writeable */
-       const char *short_name;
+    const char *short_name;
 
     /* the common file extensions for this type (seperated by semicolon) */
     /* should be *.* if no common extension is applicable */
@@ -901,15 +839,15 @@ struct file_type_info {
     const char *file_extension_default;
 
     /* can this type be compressed with gzip? */
-       gboolean        can_compress;
+    gboolean can_compress;
 
     /* can this type write this encapsulation format? */
     /* should be NULL is this file type don't have write support */
-       int     (*can_write_encap)(int);
+    int (*can_write_encap)(int);
 
     /* the function to open the capture file for writing */
     /* should be NULL is this file type don't have write support */
-       int     (*dump_open)(wtap_dumper *, gboolean, int *);
+    int (*dump_open)(wtap_dumper *, gboolean, int *);
 };
 
 
@@ -926,6 +864,13 @@ typedef int (*wtap_open_routine_t)(struct wtap*, int *, char **);
 struct wtap* wtap_open_offline(const char *filename, int *err,
     gchar **err_info, gboolean do_random);
 
+/*
+ * If we were compiled with zlib and we're at EOF, unset EOF so that
+ * wtap_read/gzread has a chance to succeed. This is necessary if
+ * we're tailing a file.
+ */
+void wtap_cleareof(wtap *wth);
+
 /* Returns TRUE if read was successful. FALSE if failure. data_offset is
  * set to the offset in the file where the data for the read packet is
  * located. */