#include "pcap-encap.h"
#include "pcapng.h"
-#if 0
+#if 1
#define pcapng_debug0(str) g_warning(str)
#define pcapng_debug1(str,p1) g_warning(str,p1)
#define pcapng_debug2(str,p1,p2) g_warning(str,p1,p2)
/* ... Padding ... */
} pcapng_simple_packet_block_t;
-/* pcapng: simple packet block */
+/* pcapng: name resolution block */
typedef struct pcapng_name_resolution_block_s {
guint16 record_type;
guint16 record_len;
wth->phdr.pkt_encap = int_data.wtap_encap;
wth->phdr.ts.secs = (time_t)(ts / time_units_per_second);
wth->phdr.ts.nsecs = (int)(((ts % time_units_per_second) * 1000000000) / time_units_per_second);
+
+ wth->phdr.interface_id = wblock.data.packet.interface_id;
+ wth->phdr.drops_count = wblock.data.packet.drops_count;
+ wth->phdr.opt_comment = wblock.data.packet.opt_comment;
+ wth->phdr.drop_count = wblock.data.packet.drop_count;
+ wth->phdr.pack_flags = wblock.data.packet.pack_flags;
} else {
wth->phdr.pkt_encap = WTAP_ENCAP_UNKNOWN;
*err = WTAP_ERR_BAD_FILE;
void (*subtype_sequential_close)(struct wtap*);
void (*subtype_close)(struct wtap*);
int file_encap; /* per-file, for those
- file formats that have
- per-file encapsulation
- types */
+ * file formats that have
+ * per-file encapsulation
+ * types
+ */
int tsprecision; /* timestamp precision of the lower 32bits
- * e.g. WTAP_FILE_TSPREC_USEC */
+ * e.g. WTAP_FILE_TSPREC_USEC
+ */
wtap_new_ipv4_callback_t add_new_ipv4;
wtap_new_ipv6_callback_t add_new_ipv6;
GPtrArray *fast_seek;
struct wtap_pkthdr {
struct wtap_nstime ts;
- guint32 caplen;
- guint32 len;
+ guint32 caplen; /* data length in the file */
+ guint32 len; /* data length on the wire */
int pkt_encap;
+ /* pcapng variables */
+ guint32 interface_id; /* identifier of the interface. */
+ guint16 drops_count; /* drops count, only valid for packet block */
+ /* 0xffff if information not available */
+ /* options */
+ gchar *opt_comment; /* NULL if not available */
+ guint64 drop_count;
+ guint32 pack_flags; /* XXX - 0 for now (any value for "we don't have it"?) */
};
struct Buffer;