diff options
author | Guy Harris <guy@alum.mit.edu> | 2017-12-03 21:01:18 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2017-12-04 05:02:18 +0000 |
commit | 1834dca3654ccec238bae130715871be3d8fa344 (patch) | |
tree | 5f1de666575b16f58be5a2f7b4e40cc5b93c02dc /cfile.c | |
parent | 02944c412b4d9d7661c0a2b3eb9df44d632878ee (diff) |
Move the parts of a capture_file used by libwireshark to a new structure.
Embed one of those structures in a capture_file, and have a struct
epan_session point to that structure rather than to a capture_file.
Pass that structure to the routines that fetch data that libwireshark
uses when dissecting.
That separates the stuff that libwireshark expects from the stuff that
it doesn't look at.
Change-Id: Ia3cd28efb9622476437a2ce32204597fae720877
Reviewed-on: https://code.wireshark.org/review/24692
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'cfile.c')
-rw-r--r-- | cfile.c | 44 |
1 files changed, 0 insertions, 44 deletions
@@ -19,50 +19,6 @@ #include "cfile.h" #include "cfile-int.h" -const char * -cap_file_get_interface_name(capture_file *cf, guint32 interface_id) -{ - wtapng_iface_descriptions_t *idb_info; - wtap_block_t wtapng_if_descr = NULL; - char* interface_name; - - idb_info = wtap_file_get_idb_info(cf->wth); - - if (interface_id < idb_info->interface_data->len) - wtapng_if_descr = g_array_index(idb_info->interface_data, wtap_block_t, interface_id); - - g_free(idb_info); - - if (wtapng_if_descr) { - if (wtap_block_get_string_option_value(wtapng_if_descr, OPT_IDB_NAME, &interface_name) == WTAP_OPTTYPE_SUCCESS) - return interface_name; - if (wtap_block_get_string_option_value(wtapng_if_descr, OPT_IDB_DESCR, &interface_name) == WTAP_OPTTYPE_SUCCESS) - return interface_name; - } - return "unknown"; -} - -const char * -cap_file_get_interface_description(capture_file *cf, guint32 interface_id) -{ - wtapng_iface_descriptions_t *idb_info; - wtap_block_t wtapng_if_descr = NULL; - char* interface_name; - - idb_info = wtap_file_get_idb_info(cf->wth); - - if (interface_id < idb_info->interface_data->len) - wtapng_if_descr = g_array_index(idb_info->interface_data, wtap_block_t, interface_id); - - g_free(idb_info); - - if (wtapng_if_descr) { - if (wtap_block_get_string_option_value(wtapng_if_descr, OPT_IDB_DESCR, &interface_name) == WTAP_OPTTYPE_SUCCESS) - return interface_name; - } - return NULL; -} - void cap_file_init(capture_file *cf) { |