]> The Tcpdump Group git mirrors - libpcap/blobdiff - pcap-int.h
pcap_create_interface() needs the interface name on Linux.
[libpcap] / pcap-int.h
index a2a15463a7c69410a642a2b1eb70df9bc092f427..c5a030f5fe5435cebbe21bde9ecb873adb14423d 100644 (file)
@@ -47,7 +47,6 @@ extern "C" {
    */
   #define BPF_MAJOR_VERSION
   #include <Packet32.h>
-  extern CRITICAL_SECTION g_PcapCompileCriticalSection;
 #elif defined(MSDOS)
   #include <fcntl.h>
   #include <io.h>
@@ -109,7 +108,7 @@ extern "C" {
 #define MAXIMUM_SNAPLEN                262144
 
 struct pcap_opt {
-       char    *source;
+       char    *device;
        int     timeout;        /* timeout for buffering */
        int     buffer_size;
        int     promisc;
@@ -135,8 +134,8 @@ typedef int (*setbuff_op_t)(pcap_t *, int);
 typedef int    (*setmode_op_t)(pcap_t *, int);
 typedef int    (*setmintocopy_op_t)(pcap_t *, int);
 typedef HANDLE (*getevent_op_t)(pcap_t *);
-typedef int    (*oid_get_request_op_t)(pcap_t *, bpf_u_int32, void *, size_t);
-typedef int    (*oid_set_request_op_t)(pcap_t *, bpf_u_int32, const void *, size_t);
+typedef int    (*oid_get_request_op_t)(pcap_t *, bpf_u_int32, void *, size_t *);
+typedef int    (*oid_set_request_op_t)(pcap_t *, bpf_u_int32, const void *, size_t *);
 typedef u_int  (*sendqueue_transmit_op_t)(pcap_t *, pcap_send_queue *, int);
 typedef int    (*setuserbuffer_op_t)(pcap_t *, int);
 typedef int    (*live_dump_op_t)(pcap_t *, char *, int, int);
@@ -448,7 +447,7 @@ int pcap_setnonblock_fd(pcap_t *p, int, char *);
  * by pcap_create routines.
  */
 pcap_t *pcap_create_interface(const char *, char *);
-pcap_t *pcap_create_common(const char *, char *, size_t);
+pcap_t *pcap_create_common(char *, size_t);
 int    pcap_do_addexit(pcap_t *);
 void   pcap_add_to_pcaps_to_close(pcap_t *);
 void   pcap_remove_from_pcaps_to_close(pcap_t *);
@@ -458,17 +457,20 @@ int       pcap_check_activated(pcap_t *);
 /*
  * Internal interfaces for "pcap_findalldevs()".
  *
- * "pcap_findalldevs_interfaces()" finds interfaces using the
- * "standard" mechanisms (SIOCGIFCONF, "getifaddrs()", etc.).
- *
  * "pcap_platform_finddevs()" is a platform-dependent routine to
- * add devices not found by the "standard" mechanisms.
+ * find local network interfaces.
+ *
+ * "pcap_findalldevs_interfaces()" is a helper to find those interfaces
+ * using the "standard" mechanisms (SIOCGIFCONF, "getifaddrs()", etc.).
  *
  * "pcap_add_if()" adds an interface to the list of interfaces, for
  * use by various "find interfaces" routines.
  */
-int    pcap_findalldevs_interfaces(pcap_if_t **, char *);
 int    pcap_platform_finddevs(pcap_if_t **, char *);
+#if !defined(_WIN32) && !defined(MSDOS)
+int    pcap_findalldevs_interfaces(pcap_if_t **, char *,
+           int (*)(const char *));
+#endif
 int    add_addr_to_iflist(pcap_if_t **, const char *, bpf_u_int32,
            struct sockaddr *, size_t, struct sockaddr *, size_t,
            struct sockaddr *, size_t, struct sockaddr *, size_t, char *);
@@ -477,7 +479,6 @@ int add_addr_to_dev(pcap_if_t *, struct sockaddr *, size_t,
            struct sockaddr *dstaddr, size_t, char *errbuf);
 int    pcap_add_if(pcap_if_t **, const char *, bpf_u_int32, const char *,
            char *);
-struct sockaddr *dup_sockaddr(struct sockaddr *, size_t);
 int    add_or_find_if(pcap_if_t **, pcap_if_t **, const char *, bpf_u_int32,
            const char *, char *);
 #ifndef _WIN32