debug keys
[metze/wireshark/wip.git] / caputils / capture-pcap-util-int.h
1 /* capture-pcap-util-int.h
2  * Definitions of routines internal to the libpcap/WinPcap utilities
3  *
4  * Wireshark - Network traffic analyzer
5  * By Gerald Combs <gerald@wireshark.org>
6  * Copyright 1998 Gerald Combs
7  *
8  * SPDX-License-Identifier: GPL-2.0-or-later
9  */
10
11 #ifndef __PCAP_UTIL_INT_H__
12 #define __PCAP_UTIL_INT_H__
13
14 extern if_info_t *if_info_new(const char *name, const char *description,
15         gboolean loopback);
16 extern void if_info_add_address(if_info_t *if_info, struct sockaddr *addr);
17 #ifdef HAVE_PCAP_FINDALLDEVS
18 #ifdef HAVE_PCAP_REMOTE
19 extern GList *get_interface_list_findalldevs_ex(const char *source,
20         struct pcap_rmtauth *auth, int *err, char **err_str);
21 #endif /* HAVE_PCAP_REMOTE */
22 extern GList *get_interface_list_findalldevs(int *err, char **err_str);
23 #endif /* HAVE_PCAP_FINDALLDEVS */
24
25 #ifdef HAVE_PCAP_SET_TSTAMP_PRECISION
26 /*
27  * Request that a pcap_t provide high-resolution (nanosecond) time
28  * stamps; if that request fails, we'll just silently continue to
29  * use the microsecond-resolution time stamps, and our caller will
30  * find out, when they call have_high_resolution_timestamp(), that
31  * we don't have high-resolution time stamps.
32  */
33 extern void request_high_resolution_timestamp(pcap_t *pcap_h);
34 #endif
35
36 extern if_capabilities_t *get_if_capabilities_local(interface_options *interface_opts,
37     cap_device_open_err *err, char **err_str);
38 extern pcap_t *open_capture_device_local(capture_options *capture_opts,
39     interface_options *interface_opts, int timeout,
40     cap_device_open_err *open_err, char (*open_err_str)[PCAP_ERRBUF_SIZE]);
41 #ifdef HAVE_PCAP_CREATE
42 extern if_capabilities_t *get_if_capabilities_pcap_create(interface_options *interface_opts,
43     cap_device_open_err *err, char **err_str);
44 extern pcap_t *open_capture_device_pcap_create(capture_options *capture_opts,
45     interface_options *interface_opts, int timeout,
46     cap_device_open_err *open_err,
47     char (*open_err_str)[PCAP_ERRBUF_SIZE]);
48 #endif /* HAVE_PCAP_CREATE */
49 extern if_capabilities_t *get_if_capabilities_pcap_open_live(interface_options *interface_opts,
50     cap_device_open_err *err, char **err_str);
51 extern pcap_t *open_capture_device_pcap_open_live(interface_options *interface_opts,
52     int timeout, cap_device_open_err *open_err,
53     char (*open_err_str)[PCAP_ERRBUF_SIZE]);
54
55 /*
56  * Get an error message string for a CANT_GET_INTERFACE_LIST error from
57  * "get_interface_list()".  This is used to let the error message string
58  * be platform-dependent.
59  */
60 extern gchar *cant_get_if_list_error_message(const char *err_str);
61
62 #endif /* __PCAP_UTIL_INT_H__ */