diff --git a/wiretap/pcapng.c b/wiretap/pcapng.c index 1892e34854..ee781964a5 100644 --- a/wiretap/pcapng.c +++ b/wiretap/pcapng.c @@ -70,7 +70,7 @@ #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) @@ -151,7 +151,7 @@ typedef struct pcapng_simple_packet_block_s { /* ... 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; @@ -1558,6 +1558,12 @@ pcapng_read(wtap *wth, int *err, gchar **err_info, gint64 *data_offset) 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; diff --git a/wiretap/wtap-int.h b/wiretap/wtap-int.h index 2d0dd94fda..0e00d68866 100644 --- a/wiretap/wtap-int.h +++ b/wiretap/wtap-int.h @@ -62,11 +62,13 @@ struct wtap { 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; diff --git a/wiretap/wtap.h b/wiretap/wtap.h index 1d002de72c..d070f91fb3 100644 --- a/wiretap/wtap.h +++ b/wiretap/wtap.h @@ -822,9 +822,17 @@ struct wtap_nstime { 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;