* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#include "config.h"
+#include <config.h>
#include <glib.h>
#include <epan/packet.h>
+#include <wiretap/pcapng.h>
#include "cfile.h"
{
capture_file *cf = (capture_file *) data;
wtapng_iface_descriptions_t *idb_info;
- const wtapng_if_descr_t *wtapng_if_descr = NULL;
+ wtap_optionblock_t wtapng_if_descr = NULL;
+ char* interface_name;
- idb_info = wtap_file_get_idb_info(cf->wfth);
+ idb_info = wtap_file_get_idb_info(cf->wth);
- if (interface_id < idb_info->number_of_interfaces)
- wtapng_if_descr = &g_array_index(idb_info->interface_data, wtapng_if_descr_t, interface_id);
+ if (interface_id < idb_info->interface_data->len)
+ wtapng_if_descr = g_array_index(idb_info->interface_data, wtap_optionblock_t, interface_id);
g_free(idb_info);
if (wtapng_if_descr) {
- if (wtapng_if_descr->if_name)
- return wtapng_if_descr->if_name;
- else if (wtapng_if_descr->if_description)
- return wtapng_if_descr->if_description;
+ wtap_optionblock_get_option_string(wtapng_if_descr, OPT_IDB_NAME, &interface_name);
+ if (interface_name)
+ return interface_name;
+ wtap_optionblock_get_option_string(wtapng_if_descr, OPT_IDB_DESCR, &interface_name);
+ if (interface_name)
+ return interface_name;
}
return "unknown";
}
memset(cf, 0, sizeof(capture_file));
cf->snap = WTAP_MAX_PACKET_SIZE;
}
+
+/*
+ * Editor modelines - http://www.wireshark.org/tools/modelines.html
+ *
+ * Local Variables:
+ * c-basic-offset: 2
+ * tab-width: 8
+ * indent-tabs-mode: nil
+ * End:
+ *
+ * ex: set shiftwidth=2 tabstop=8 expandtab:
+ * :indentSize=2:tabSize=8:noTabs=true:
+ */