2 * capture_file GUI-independent manipulation
3 * Vassilii Khachaturov <vassilii@tarunz.org>
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
28 #include <epan/packet.h>
33 cap_file_get_interface_name(void *data, guint32 interface_id)
35 capture_file *cf = (capture_file *) data;
36 wtapng_iface_descriptions_t *idb_info;
37 const wtapng_if_descr_t *wtapng_if_descr = NULL;
39 idb_info = wtap_file_get_idb_info(cf->wth);
41 if (interface_id < idb_info->interface_data->len)
42 wtapng_if_descr = &g_array_index(idb_info->interface_data, wtapng_if_descr_t, interface_id);
46 if (wtapng_if_descr) {
47 if (wtapng_if_descr->if_name)
48 return wtapng_if_descr->if_name;
49 else if (wtapng_if_descr->if_description)
50 return wtapng_if_descr->if_description;
56 cap_file_init(capture_file *cf)
58 /* Initialize the capture file struct */
59 memset(cf, 0, sizeof(capture_file));
60 cf->snap = WTAP_MAX_PACKET_SIZE;
64 * Editor modelines - http://www.wireshark.org/tools/modelines.html
69 * indent-tabs-mode: nil
72 * ex: set shiftwidth=2 tabstop=8 expandtab:
73 * :indentSize=2:tabSize=8:noTabs=true: