diff options
author | Guy Harris <guy@alum.mit.edu> | 2018-11-15 20:06:36 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2018-11-16 09:20:36 +0000 |
commit | a1372f6d017cb9798dce7de5e25d329c82a2da79 (patch) | |
tree | 4588e90f67d25c13f4b944242328b901e0a27514 /capinfos.c | |
parent | e12753d5f6e6f474af9934e8102cb4190aaa5846 (diff) |
Use an enum for compression types in various interfaces.
This:
1) means that we don't have to flag the compression argument with a
comment to indicate what it means (FALSE doesn't obviously say "not
compressed", WTAP_UNCOMPRESSED does);
2) leaves space in the interfaces in question for additional compression
types.
(No, this is not part 1 of an implementation of additional compression
types, it's just an API cleanup. Implementing additional compression
types involves significant work in libwiretap, as well as UI changes to
replace "compress the file" checkboxes with something to indicate *how*
to compress the file, or to always use some other form of compression).
Change-Id: I1d23dc720be10158e6b34f97baa247ba8a537abf
Reviewed-on: https://code.wireshark.org/review/30660
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'capinfos.c')
-rw-r--r-- | capinfos.c | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/capinfos.c b/capinfos.c index 5f227e6afe..bed9cfe2a8 100644 --- a/capinfos.c +++ b/capinfos.c @@ -177,41 +177,41 @@ typedef enum { } order_t; typedef struct _capture_info { - const char *filename; - guint16 file_type; - gboolean iscompressed; - int file_encap; - int file_tsprec; - gint64 filesize; - wtap_block_t shb; - guint64 packet_bytes; - gboolean times_known; - nstime_t start_time; - int start_time_tsprec; - nstime_t stop_time; - int stop_time_tsprec; - guint32 packet_count; - gboolean snap_set; /* If set in capture file header */ - guint32 snaplen; /* value from the capture file header */ - guint32 snaplen_min_inferred; /* If caplen < len for 1 or more rcds */ - guint32 snaplen_max_inferred; /* ... */ - gboolean drops_known; - guint32 drop_count; - - nstime_t duration; - int duration_tsprec; - double packet_rate; - double packet_size; - double data_rate; /* in bytes */ - gboolean know_order; - order_t order; - - int *encap_counts; /* array of per_packet encap counts; array has one entry per wtap_encap type */ - - guint num_interfaces; /* number of IDBs, and thus size of interface_packet_counts array */ - GArray *interface_packet_counts; /* array of per_packet interface_id counts; one entry per file IDB */ - guint32 pkt_interface_id_unknown; /* counts if packet interface_id didn't match a known one */ - GArray *idb_info_strings; /* array of IDB info strings */ + const char *filename; + guint16 file_type; + wtap_compression_type compression_type; + int file_encap; + int file_tsprec; + gint64 filesize; + wtap_block_t shb; + guint64 packet_bytes; + gboolean times_known; + nstime_t start_time; + int start_time_tsprec; + nstime_t stop_time; + int stop_time_tsprec; + guint32 packet_count; + gboolean snap_set; /* If set in capture file header */ + guint32 snaplen; /* value from the capture file header */ + guint32 snaplen_min_inferred; /* If caplen < len for 1 or more rcds */ + guint32 snaplen_max_inferred; /* ... */ + gboolean drops_known; + guint32 drop_count; + + nstime_t duration; + int duration_tsprec; + double packet_rate; + double packet_size; + double data_rate; /* in bytes/s */ + gboolean know_order; + order_t order; + + int *encap_counts; /* array of per_packet encap counts; array has one entry per wtap_encap type */ + + guint num_interfaces; /* number of IDBs, and thus size of interface_packet_counts array */ + GArray *interface_packet_counts; /* array of per_packet interface_id counts; one entry per file IDB */ + guint32 pkt_interface_id_unknown; /* counts if packet interface_id didn't match a known one */ + GArray *idb_info_strings; /* array of IDB info strings */ } capture_info; static char *decimal_point; @@ -585,7 +585,7 @@ print_stats(const gchar *filename, capture_info *cf_info) if (filename) printf ("File name: %s\n", filename); if (cap_file_type) printf ("File type: %s%s\n", file_type_string, - cf_info->iscompressed ? " (gzip compressed)" : ""); + cf_info->compression_type == WTAP_GZIP_COMPRESSED ? " (gzip compressed)" : ""); if (cap_file_encap) { printf ("File encapsulation: %s\n", file_encap_string); @@ -1241,7 +1241,7 @@ process_cap_file(wtap *wth, const char *filename) /* File Type */ cf_info.file_type = wtap_file_type_subtype(wth); - cf_info.iscompressed = wtap_iscompressed(wth); + cf_info.compression_type = wtap_get_compression_type(wth); /* File Encapsulation */ cf_info.file_encap = wtap_file_encap(wth); |