diff options
| author | Joseph Mingrone <jrm@FreeBSD.org> | 2026-01-07 12:56:48 -0400 |
|---|---|---|
| committer | Joseph Mingrone <jrm@FreeBSD.org> | 2026-01-07 12:56:48 -0400 |
| commit | 0a1fbf4c244d5cfb242d3d7b146fea2ee676d46d (patch) | |
| tree | 603f2cb82ae91e7dfc1174391a1f096db62827bf /pcap-int.h | |
| parent | 025be3f592b920ff0a3e602e5aa8b60a34e5e617 (diff) | |
Import libpcap 1.10.6vendor/libpcap/1.10.6vendor/libpcap
Diffstat (limited to 'pcap-int.h')
| -rw-r--r-- | pcap-int.h | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/pcap-int.h b/pcap-int.h index ed0c682968ad..ce0ac698f066 100644 --- a/pcap-int.h +++ b/pcap-int.h @@ -73,10 +73,28 @@ #endif /* + * Version string trailer. + * Uses SIZEOF_TIME_T from config.h. + * (There's no need to announce the pointer size; if it doesn't + * match the pointer size in code linked with libpcap, either + * build-time linking or run-time linking will fail.) + */ +#if SIZEOF_TIME_T == 8 + #define PCAP_SIZEOF_TIME_T_BITS_STRING "64" +#elif SIZEOF_TIME_T == 4 + #define PCAP_SIZEOF_TIME_T_BITS_STRING "32" +#else + #error Unknown time_t size +#endif + +/* * Version string. - * Uses PACKAGE_VERSION from config.h. + * Uses PACKAGE_VERSION from config.h and PCAP_SIZEOF_TIME_T_BITS_STRING. */ -#define PCAP_VERSION_STRING "libpcap version " PACKAGE_VERSION +#define PCAP_VERSION_STRING \ + "libpcap version " PACKAGE_VERSION " (" PCAP_SIZEOF_TIME_T_BITS_STRING "-bit time_t)" +#define PCAP_VERSION_STRING_WITH_ADDITIONAL_INFO(additional_info) \ + "libpcap version " PACKAGE_VERSION " (" PCAP_SIZEOF_TIME_T_BITS_STRING "-bit time_t, " additional_info ")" #ifdef __cplusplus extern "C" { @@ -413,6 +431,14 @@ int pcapint_setnonblock_fd(pcap_t *p, int); * by pcap_create routines. */ pcap_t *pcapint_create_interface(const char *, char *); +/* + * A format string for something-only libpcap builds, which use a stub + * implementation of pcapint_create_interface(). It contains the substring + * "No such device" (one of the standard descriptions of ENODEV) -- this way + * tcpdump can detect a particular error condition even though pcap_create() + * returns NULL for all errors. + */ +#define PCAP_ENODEV_MESSAGE "No such device (this build of libpcap supports %s devices only)." /* * This wrapper takes an error buffer pointer and a type to use for the @@ -530,10 +556,9 @@ FILE *pcapint_charset_fopen(const char *path, const char *mode); */ #ifdef _WIN32 #define pcap_code_handle_t HMODULE -#define pcap_funcptr_t FARPROC pcap_code_handle_t pcapint_load_code(const char *); -pcap_funcptr_t pcapint_find_function(pcap_code_handle_t, const char *); +void *pcapint_find_function(pcap_code_handle_t, const char *); #endif /* |
