diff options
author | Hadriel Kaplan <hadrielk@yahoo.com> | 2015-08-16 12:37:11 -0400 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2015-08-18 14:52:00 +0000 |
commit | 8fcdcb9c95e7436c4da02d39df048f4a1fbeca9c (patch) | |
tree | 8d22d06db1cf990f273a4d80d496598a4f47671f /wiretap/wtap.c | |
parent | a3c175a82332ba8be150caf5943a4d0a2b5ff552 (diff) | |
download | wireshark-8fcdcb9c95e7436c4da02d39df048f4a1fbeca9c.tar.gz |
Improve file merging for mergecap and wireshark
Refactor the file merging code by removing the duplicate logic from mergecap.c
and file.c's cf_merge_files(), into a new merge_files() function in merge.c.
Also the following user-visible changes:
* Removed the '-T' encap type option from mergecap, as it's illogical for
mergecap and would complicate common merge code.
* Input files with IDBs of different name, speed, tsprecision, etc., will produce
an output PCAPNG file with separate IDBs, even if their encap types are the same.
* Added a '-I' IDB merge mode option for mergecap, to control how IDBs are merged.
* Changed Wireshark's drag-and-drop merging to use PCAPNG instead of PCAP.
Bug: 8795
Bug: 7381
Change-Id: Icc30d217e093d6f40114422204afd2e332834f71
Reviewed-on: https://code.wireshark.org/review/10058
Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'wiretap/wtap.c')
-rw-r--r-- | wiretap/wtap.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/wiretap/wtap.c b/wiretap/wtap.c index e5a6af7021..ea8004febf 100644 --- a/wiretap/wtap.c +++ b/wiretap/wtap.c @@ -263,6 +263,30 @@ wtap_file_get_idb_info(wtap *wth) return idb_info; } +gchar * +wtap_get_debug_if_descr(const wtapng_if_descr_t *if_descr) +{ + GString *info = g_string_new(""); + + g_assert(if_descr); + + g_string_printf(info, + "Interface description: wtap_encap=%d, time_units_per_second=%" G_GINT64_MODIFIER "u" + ", tsprecision=%d, link_type=%u, snap_len=%u, opt_comment='%s', if_name='%s'" + ", if_description='%s', if_speed=%" G_GINT64_MODIFIER "u, if_tsresol=%d" + ", if_filter_str='%s', bpf_filter_len=%u, if_fcslen=%d, num_stat_entries=%u", + if_descr->wtap_encap, if_descr->time_units_per_second, if_descr->tsprecision, + if_descr->link_type, if_descr->snap_len, + if_descr->opt_comment ? if_descr->opt_comment : "NONE", + if_descr->if_name ? if_descr->if_name : "NONE", + if_descr->if_description ? if_descr->if_description : "NONE", + if_descr->if_speed, if_descr->if_tsresol, + if_descr->if_filter_str ? if_descr->if_filter_str : "NONE", + if_descr->bpf_filter_len, if_descr->if_fcslen, if_descr->num_stat_entries); + + return g_string_free(info, FALSE); +} + wtapng_name_res_t * wtap_file_get_nrb_for_new_file(wtap *wth) { |