Add data structure to hold information from ISB:s
authorAnders Broman <anders.broman@ericsson.com>
Tue, 13 Mar 2012 08:36:52 +0000 (08:36 -0000)
committerAnders Broman <anders.broman@ericsson.com>
Tue, 13 Mar 2012 08:36:52 +0000 (08:36 -0000)
svn path=/trunk/; revision=41522

wiretap/file_access.c
wiretap/pcapng.c
wiretap/wtap.h

index 51a92f0ff049b3d909617aae81a86174fa37a08a..5675cc22efe0616f7ae53583ac9ae6e1bf9af699 100644 (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);
index 5a99b137d649681632227a987ca7bce35e88d63a..333ad4042fd11325f92bbf5bb083a276003ab7e3 100644 (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 */
index 6ac2322210e558a3acd58d5b269addf574098473..2ab8b10f0e014928cb937e13f15cfa33d4a54472 100644 (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;