diff options
author | Guy Harris <guy@alum.mit.edu> | 2016-06-30 21:29:14 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2016-06-30 21:29:31 -0700 |
commit | 56889e2bb6d732af2fd881bc24e45a2c1a51e38b (patch) | |
tree | 0a0b9d52d40222be4eb71d82828cea02e8047931 /pcap-snf.c | |
parent | 6d0826f3abc912db6bc2916e725291cb16d08b90 (diff) | |
download | libpcap-56889e2bb6d732af2fd881bc24e45a2c1a51e38b.tar.gz |
Clean up {DAG, Septel, Myricom SNF}-only builds.
In the core code, treat them similarly to other builds. In the
configure script, ensure that no other pcap-XXX.c file is built, so we
have only the entries for the capture mechanism in question in the
tables for pcap_findalldevs() and pcap_create(), so that those routines
are the only ones called. If XXX_ONLY is defined in pcap-XXX.c, define
a stub pcap_platform_finddevs() that finds no regular interfaces and a
stub pcap_create_interface() that fails with a "we only support XXX"
error message.
Diffstat (limited to 'pcap-snf.c')
-rw-r--r-- | pcap-snf.c | 28 |
1 files changed, 28 insertions, 0 deletions
@@ -490,3 +490,31 @@ snf_create(const char *device, char *ebuf, int *is_ours) ps->snf_boardnum = boardnum; return p; } + +#ifdef SNF_ONLY +/* + * This libpcap build supports only SNF cards, not regular network + * interfaces.. + */ + +/* + * There are no regular interfaces, just DAG interfaces. + */ +int +pcap_platform_finddevs(pcap_if_t **alldevsp, char *errbuf) +{ + *alldevsp = NULL; + return (0); +} + +/* + * Attempts to open a regular interface fail. + */ +pcap_t * +pcap_create_interface(const char *device, char *errbuf) +{ + pcap_snprintf(errbuf, PCAP_ERRBUF_SIZE, + "This version of libpcap only supports SNF cards"); + return NULL; +} +#endif |