2 * Utility definitions for packet capture
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 #ifndef __CAPTURE_PCAP_UTIL_H__
24 #define __CAPTURE_PCAP_UTIL_H__
32 #endif /* __cplusplus */
35 * A snapshot length of 0 is useless - and libpcap/WinPcap don't guarantee
36 * that a snapshot length of 0 will work, and, on some platforms, it won't
37 * (with BPF, for example, the kernel is told the snapshot length via the
38 * return value of the BPF program, and a return value of 0 means "drop
39 * the packet"), so the minimum packet size is 1 byte.
41 #define MIN_PACKET_SIZE 1 /* minimum amount of packet data we can read */
43 GList *get_interface_list(int *err, char **err_str);
44 #ifdef HAVE_PCAP_REMOTE
45 GList *get_remote_interface_list(const char *hostname, const char *port,
46 int auth_type, const char *username,
47 const char *passwd, int *err, char **err_str);
50 const char *linktype_val_to_name(int dlt);
51 int linktype_name_to_val(const char *linktype);
55 #endif /* __cplusplus */
57 #endif /* HAVE_LIBPCAP */
60 * Append to a GString an indication of the version of libpcap/WinPcap
61 * with which we were compiled, if we were, or an indication that we
62 * weren't compiled with libpcap/WinPcap, if we weren't.
64 extern void get_compiled_pcap_version(GString *str);
67 * Append to a GString an indication of the version of libpcap/WinPcap
68 * with which we're running, or an indication that we're not running
69 * with libpcap/WinPcap, if we were compiled with libpcap/WinPcap,
70 * or nothing, if we weren't compiled with libpcap/WinPcap.
72 extern void get_runtime_pcap_version(GString *str);
74 #endif /* __CAPTURE_PCAP_UTIL_H__ */