diff options
author | Guy Harris <guy@alum.mit.edu> | 2018-08-10 19:08:40 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2018-08-11 02:09:15 +0000 |
commit | 08cbe559b3c82c4e152c3b8df2f6f6f1fe3d51a0 (patch) | |
tree | 69312aaa10e79c42055b5ae69d803b97e6cf34ca /wiretap/merge.c | |
parent | f4ac2635647d389db83b369ed72054627ddab1af (diff) |
Add support for reading and writing the new if_hardware IDB option.
Support for writing it in live captures will come later; this change,
but not that one, will be backported so older versions of Wireshark
won't remove it when writing a file out.
Change-Id: I9fd4067991acfd2d18c03d0a373ce8337a9f3a76
Reviewed-on: https://code.wireshark.org/review/29064
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap/merge.c')
-rw-r--r-- | wiretap/merge.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/wiretap/merge.c b/wiretap/merge.c index d706f79ae8..55ceed040c 100644 --- a/wiretap/merge.c +++ b/wiretap/merge.c @@ -453,8 +453,11 @@ is_duplicate_idb(const wtap_block_t idb1, const wtap_block_t idb2) guint64 idb1_if_speed, idb2_if_speed; guint8 idb1_if_tsresol, idb2_if_tsresol; guint8 idb1_if_fcslen, idb2_if_fcslen; - char *idb1_opt_comment, *idb2_opt_comment, *idb1_if_name, *idb2_if_name, - *idb1_if_description, *idb2_if_description, *idb1_if_os, *idb2_if_os; + char *idb1_opt_comment, *idb2_opt_comment; + char *idb1_if_name, *idb2_if_name; + char *idb1_if_description, *idb2_if_description; + char *idb1_if_hardware, *idb2_if_hardware; + char *idb1_if_os, *idb2_if_os; g_assert(idb1 && idb2); idb1_mand = (wtapng_if_descr_mandatory_t*)wtap_block_get_mandatory_data(idb1); @@ -578,6 +581,18 @@ is_duplicate_idb(const wtap_block_t idb1, const wtap_block_t idb2) } /* XXX - what do to if we have only one value? */ + have_idb1_value = (wtap_block_get_string_option_value(idb1, OPT_IDB_HARDWARE, &idb1_if_hardware) == WTAP_OPTTYPE_SUCCESS); + have_idb2_value = (wtap_block_get_string_option_value(idb2, OPT_IDB_HARDWARE, &idb2_if_hardware) == WTAP_OPTTYPE_SUCCESS); + if (have_idb1_value && have_idb2_value) { + merge_debug("g_strcmp0(idb1_if_hardware, idb2_if_hardware) == 0: %s", + (g_strcmp0(idb1_if_hardware, idb2_if_hardware) == 0) ? "TRUE":"FALSE"); + if (g_strcmp0(idb1_if_hardware, idb2_if_hardware) != 0) { + merge_debug("merge::is_duplicate_idb() returning FALSE"); + return FALSE; + } + } + + /* XXX - what do to if we have only one value? */ have_idb1_value = (wtap_block_get_string_option_value(idb1, OPT_IDB_OS, &idb1_if_os) == WTAP_OPTTYPE_SUCCESS); have_idb2_value = (wtap_block_get_string_option_value(idb2, OPT_IDB_OS, &idb2_if_os) == WTAP_OPTTYPE_SUCCESS); if (have_idb1_value && have_idb2_value) { |