From njohnkev:
[obnox/wireshark/wip.git] / wiretap / wtap.h
index 6f6d7158fde6edff5fc08f58431da5e0bc160025..eb70e745a832a4565632eef7dcd1ee98d7bc48fe 100644 (file)
@@ -214,6 +214,13 @@ extern "C" {
 #define WTAP_ENCAP_FIBRE_CHANNEL_FC2_WITH_FRAME_DELIMS 122
 #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()
 
@@ -280,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()
 
@@ -356,6 +364,8 @@ struct isdn_phdr {
  * Status bits.
  */
 #define ATM_RAW_CELL   0x01    /* TRUE if the packet is a single cell */
+#define ATM_NO_HEC     0x02    /* TRUE if the cell has HEC stripped out */
+#define ATM_AAL2_NOPHDR        0x04    /* TRUE if the AAL2 PDU has no pseudo-header */
 
 /*
  * AAL types.
@@ -610,60 +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.
- */
-struct usb_device_setup_hdr {
-    gint8 bmRequestType;
-    guint8 bRequest;
-    guint16 wValue;
-    guint16 wIndex;
-    guint16 wLength;
-};
-
-/*
- * Header prepended by Linux kernel to each USB event.
- * Always followed by a struct usb_device_setup_hdr, although that header
- * is valid only if setup_flag is 0; otherwise it's 8 bytes of junk.
- * (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.
- *
- * We present this as a pseudo-header; 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 present */
-    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
 
@@ -822,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;
@@ -834,12 +790,11 @@ union wtap_pseudo_header {
        struct cosine_phdr      cosine;
        struct irda_phdr        irda;
        struct nettl_phdr       nettl;
-       struct mtp2_phdr        mtp2;
+       struct mtp2_phdr        mtp2;
        struct k12_phdr         k12;
        struct lapd_phdr        lapd;
        struct catapult_dct2000_phdr dct2000;
-       struct linux_usb_phdr   linux_usb;
-       struct erf_mc_phdr      erf;
+       struct erf_mc_phdr      erf;
        struct sita_phdr        sita;
        struct bthci_phdr       bthci;
        struct l1event_phdr     l1event;
@@ -860,7 +815,6 @@ struct wtap_pkthdr {
        int pkt_encap;
 };
 
-struct wtap;
 struct Buffer;
 struct wtap_dumper;
 
@@ -870,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 */
@@ -885,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 *);
 };
 
 
@@ -910,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. */
@@ -1022,6 +983,8 @@ int wtap_register_encap_type(char* name, char* short_name);
        /* We're trying to open the standard input for random access */
 #define WTAP_ERR_COMPRESSION_NOT_SUPPORTED -19
        /* The filetype doesn't support output compression */
+#define        WTAP_ERR_CANT_SEEK                      -20
+       /* An attempt to seek failed, reason unknown */
 
 /* Errors from zlib; zlib error Z_xxx turns into Wiretap error
    WTAP_ERR_ZLIB + Z_xxx.