2 * capture_file GUI-independent manipulation
3 * Vassilii Khachaturov <vassilii@tarunz.org>
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
30 #include <epan/packet.h>
35 cap_file_get_interface_name(void *data
, guint32 interface_id
)
37 capture_file
*cf
= (capture_file
*) data
;
38 wtapng_iface_descriptions_t
*idb_info
;
39 const wtapng_if_descr_t
*wtapng_if_descr
= NULL
;
41 idb_info
= wtap_file_get_idb_info(cf
->wth
);
43 if (interface_id
< idb_info
->number_of_interfaces
)
44 wtapng_if_descr
= &g_array_index(idb_info
->interface_data
, wtapng_if_descr_t
, interface_id
);
48 if (wtapng_if_descr
) {
49 if (wtapng_if_descr
->if_name
)
50 return wtapng_if_descr
->if_name
;
51 else if (wtapng_if_descr
->if_description
)
52 return wtapng_if_descr
->if_description
;
58 cap_file_init(capture_file
*cf
)
60 /* Initialize the capture file struct */
61 memset(cf
, 0, sizeof(capture_file
));
62 cf
->snap
= WTAP_MAX_PACKET_SIZE
;