]> The Tcpdump Group git mirrors - libpcap/commitdiff
Move the RPCAP-specific functions to pcap-rpcap.h.
authorGuy Harris <[email protected]>
Tue, 21 Mar 2017 00:48:47 +0000 (17:48 -0700)
committerGuy Harris <[email protected]>
Tue, 21 Mar 2017 00:48:47 +0000 (17:48 -0700)
Move the declarations of the interfaces that are currently used for
RPCAP by pcap_open_live(), pcap_open(), and pcap_findalldevs_ex() to
pcap-rpcap.h; in the future, that will hold the routines used by
pcap_create() and any future API for enumerating interfaces.

Makefile.in
pcap-int.h
pcap-new.c
pcap-rpcap.c
pcap-rpcap.h [new file with mode: 0644]
pcap.c

index 6ed8c01558184bae61bc68a2e820b88b6da50dbc..320ed04311cca015ba1be24dc29b9bad3a146ed0 100644 (file)
@@ -128,6 +128,7 @@ HDR = $(PUBHDR) \
        nlpid.h \
        pcap-common.h \
        pcap-int.h \
+       pcap-rpcap.h \
        pcap-stdinc.h \
        portability.h \
        ppp.h \
index 43ddafc265e87f79a8ef3dbb118d0c28b3c1c15b..052c24892ecf79da7dac5ff0a8df3e3ed4e6266f 100644 (file)
@@ -449,20 +449,6 @@ int        add_addr_to_if(pcap_if_list_t *, const char *, bpf_u_int32,
            struct sockaddr *, size_t, struct sockaddr *, size_t, char *);
 #endif
 
-#ifdef HAVE_REMOTE
-/*
- * Internal interfaces for "pcap_open()".
- */
-pcap_t *pcap_open_rpcap(const char *source, int snaplen, int flags,
-    int read_timeout, struct pcap_rmtauth *auth, char *errbuf);
-
-/*
- * Internal interfaces for "pcap_findalldevs_ex()".
- */
-int    pcap_findalldevs_ex_remote(char *source, struct pcap_rmtauth *auth,
-   pcap_if_t **alldevs, char *errbuf);
-#endif
-
 /*
  * Internal interfaces for "pcap_open_offline()".
  *
index 8fcbd011ea3671cbfe17e161feffd0a3e360567d..fcf5f6ff76b9845392ddb6866ddcd3a7d5e49090 100644 (file)
@@ -37,6 +37,7 @@
 
 #include "pcap-int.h"  // for the details of the pcap_t structure
 #include "sockutils.h"
+#include "pcap-rpcap.h"
 #include "rpcap-protocol.h"
 #include "pcap-rpcap-int.h"
 #include <errno.h>             // for the errno variable
index b06e771533bd7166c600b54f9b329f53a3a84ab5..a737ccb2e03a06bcb46d46c204aab1a1ff64a8bf 100644 (file)
@@ -42,6 +42,7 @@
 #include "pcap-int.h"
 #include "sockutils.h"
 #include "rpcap-protocol.h"
+#include "pcap-rpcap.h"
 #include "pcap-rpcap-int.h"
 
 /*
diff --git a/pcap-rpcap.h b/pcap-rpcap.h
new file mode 100644 (file)
index 0000000..c4f3a97
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 1994, 1995, 1996
+ *     The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the Computer Systems
+ *     Engineering Group at Lawrence Berkeley Laboratory.
+ * 4. Neither the name of the University nor of the Laboratory may be used
+ *    to endorse or promote products derived from this software without
+ *    specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef pcap_rpcap_h
+#define        pcap_rpcap_h
+
+#ifdef HAVE_REMOTE
+/*
+ * Internal interfaces for "pcap_open()".
+ */
+pcap_t *pcap_open_rpcap(const char *source, int snaplen, int flags,
+    int read_timeout, struct pcap_rmtauth *auth, char *errbuf);
+
+/*
+ * Internal interfaces for "pcap_findalldevs_ex()".
+ */
+int    pcap_findalldevs_ex_remote(char *source, struct pcap_rmtauth *auth,
+   pcap_if_t **alldevs, char *errbuf);
+#endif
+
+#endif
diff --git a/pcap.c b/pcap.c
index 6729ba81bead7a37a769c3cc2edf9ca160abe99e..0f2f84388f9f2dd3cf1a30b470c706ad9e69042b 100644 (file)
--- a/pcap.c
+++ b/pcap.c
@@ -1101,6 +1101,10 @@ pcap_freealldevs(pcap_if_t *alldevs)
        }
 }
 
+#ifdef HAVE_REMOTE
+#include "pcap-rpcap.h"
+#endif
+
 pcap_t *
 pcap_create(const char *device, char *errbuf)
 {