]> The Tcpdump Group git mirrors - libpcap/blobdiff - pcap-null.c
pcap_create_interface() needs the interface name on Linux.
[libpcap] / pcap-null.c
index 963088fe04987b6f503688d0c543ff3585bdf296..b5fa3ab91fabfc576a22796e402ab9728ecd6d8b 100644 (file)
  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
-#ifndef lint
-static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/libpcap/pcap-null.c,v 1.8 2000-04-27 09:11:13 itojun Exp $ (LBL)";
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
 #endif
 
 #include <sys/param.h>                 /* optionally get BSD define */
 
 #include <string.h>
 
-#include "gnuc.h"
 #ifdef HAVE_OS_PROTO_H
 #include "os-proto.h"
 #endif
@@ -36,39 +35,19 @@ static const char rcsid[] =
 
 static char nosup[] = "live packet capture not supported on this system";
 
-int
-pcap_stats(pcap_t *p, struct pcap_stat *ps)
-{
-
-       (void)snprintf(p->errbuf, sizeof(p->errbuf), "pcap_stats: %s", nosup);
-       return (-1);
-}
-
-int
-pcap_read(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
-{
-
-       (void)snprintf(p->errbuf, sizeof(p->errbuf), "pcap_read: %s", nosup);
-       return (-1);
-}
-
 pcap_t *
-pcap_open_live(char *device, int snaplen, int promisc, int to_ms, char *ebuf)
+pcap_create_interface(const char *device _U_, char *ebuf)
 {
-
-       (void)strcpy(ebuf, nosup);
+       (void)strlcpy(ebuf, nosup, PCAP_ERRBUF_SIZE);
        return (NULL);
 }
 
 int
-pcap_setfilter(pcap_t *p, struct bpf_program *fp)
+pcap_platform_finddevs(pcap_if_t **alldevsp, char *errbuf)
 {
-
-       if (p->sf.rfile == NULL) {
-               (void)snprintf(p->errbuf, sizeof(p->errbuf),
-                   "pcap_setfilter: %s", nosup);
-               return (-1);
-       }
-       p->fcode = *fp;
+       /*
+        * There are no interfaces on which we can capture.
+        */
+       *alldevsp = NULL;
        return (0);
 }