Merge four header files into gencode.c.
Remove DAG card support on Windows as Linux is the only
platform currently supported.
+ Fix "tcpdump -i <n>" for something-only libpcap builds.
Link-layer types:
Add LINKTYPE_ETW/DLT_ETW.
Add LINKTYPE_NETANALYZER_NG/DLT_NETANALYZER_NG (pull request
pcap_t *
pcapint_create_interface(const char *device _U_, char *errbuf)
{
- snprintf(errbuf, PCAP_ERRBUF_SIZE,
- "This version of libpcap only supports DAG cards");
+ snprintf(errbuf, PCAP_ERRBUF_SIZE, PCAP_ENODEV_MESSAGE, "DAG");
return NULL;
}
pcap_t *
pcapint_create_interface(const char *device, char *errbuf)
{
- snprintf(errbuf, PCAP_ERRBUF_SIZE,
- "This version of libpcap only supports DPDK");
+ snprintf(errbuf, PCAP_ERRBUF_SIZE, PCAP_ENODEV_MESSAGE, "DPDK");
return NULL;
}
* 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
pcap_t *
pcapint_create_interface(const char *device, char *errbuf)
{
- snprintf(errbuf, PCAP_ERRBUF_SIZE,
- "This version of libpcap only supports Septel cards");
+ snprintf(errbuf, PCAP_ERRBUF_SIZE, PCAP_ENODEV_MESSAGE, "Septel");
return (NULL);
}
pcap_t *
pcapint_create_interface(const char *device _U_, char *errbuf)
{
- snprintf(errbuf, PCAP_ERRBUF_SIZE,
- "This version of libpcap only supports SNF cards");
+ snprintf(errbuf, PCAP_ERRBUF_SIZE, PCAP_ENODEV_MESSAGE, "SNF");
return NULL;
}