Add data structure to hold information from ISB:s

svn path=/trunk/; revision=41522
This commit is contained in:
Anders Broman 2012-03-13 08:36:52 +00:00
parent cd1debf183
commit bb611755e9
3 changed files with 27 additions and 2 deletions

View File

@ -1027,6 +1027,8 @@ wtap_dumper* wtap_dump_open_ng(const char *filename, int filetype, int encap,
descr.if_filter_bpf_bytes= NULL;
descr.if_os = NULL;
descr.if_fcslen = -1;
descr.num_stat_entries = 0; /* Number of ISB:s */
descr.interface_statistics = NULL;
wdh->number_of_interfaces= 1;
wdh->interface_data= g_array_new(FALSE, FALSE, sizeof(wtapng_if_descr_t));
g_array_append_val(wdh->interface_data, descr);

View File

@ -329,7 +329,8 @@ typedef struct wtapng_name_res_s {
/* XXX */
} wtapng_name_res_t;
/* Interface Statistics */
#if 0
/* Interface Statistics moved to wtap.h*/
typedef struct wtapng_if_stats_s {
/* mandatory */
guint32 interface_id;
@ -345,7 +346,7 @@ typedef struct wtapng_if_stats_s {
guint64 isb_osdrop;
guint64 isb_usrdeliv;
} wtapng_if_stats_t;
#endif
typedef struct wtapng_block_s {
guint32 type; /* block_type as defined by pcapng */

View File

@ -939,8 +939,30 @@ typedef struct wtapng_if_descr_s {
gchar *if_os; /**< NULL if not available, 12 A UTF-8 string containing the name of the operating system of the machine in which this interface is installed. */
gint8 if_fcslen; /**< -1 if unknown or changes between packets, opt 13 An integer value that specified the length of the Frame Check Sequence (in bits) for this interface. */
/* XXX: guint64 if_tsoffset; opt 14 A 64 bits integer value that specifies an offset (in seconds)...*/
guint8 num_stat_entries;
GArray *interface_statistics; /**< An array holding the interface statistics from pcapng ISB:s or equivalent(?)*/
} wtapng_if_descr_t;
/**
* Interface Statistics. pcap-ng Interface Statistics Block (ISB).
*/
typedef struct wtapng_if_stats_s {
/* mandatory */
guint32 interface_id;
guint32 ts_high;
guint32 ts_low;
/* options */
gchar *opt_comment; /**< NULL if not available */
guint64 isb_starttime;
guint64 isb_endtime;
guint64 isb_ifrecv;
guint64 isb_ifdrop;
guint64 isb_filteraccept;
guint64 isb_osdrop;
guint64 isb_usrdeliv;
} wtapng_if_stats_t;
struct Buffer;
struct wtap_dumper;