Try to fix some of the build problems, it still bumms out on:
[obnox/wireshark/wip.git] / capture-pcap-util.h
index 6de58441a90b6460340230be3c834c0b23fbf05c..781979e05edf052c82f7a892eb200d079906c650 100644 (file)
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 
-#ifndef __PCAP_UTIL_H__
-#define __PCAP_UTIL_H__
+#ifndef __CAPTURE_PCAP_UTIL_H__
+#define __CAPTURE_PCAP_UTIL_H__
 
 #ifdef HAVE_LIBPCAP
 
+#include <pcap.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif /* __cplusplus */
 
-#include <epan/address.h>
-
-#include <pcap.h>
-
-/*
- * XXX - this is also the traditional default snapshot size in
- * tcpdump - but, if IPv6 is enabled, it defaults to 96, to get an
- * IPv6 header + TCP + 22 extra bytes.
- *
- * Some libpcap versions for particular capture devices might happen
- * to impose a minimum, but it's not always 68.
- */
-#define MIN_PACKET_SIZE 68     /* minimum amount of packet data we can read */
-
-/*
- * The list of interfaces returned by "get_interface_list()" is
- * a list of these structures.
- */
-typedef struct {
-       char    *name;          /* e.g. "eth0" */
-       char    *description;   /* from OS, e.g. "Local Area Connection" or NULL */
-       GSList  *ip_addr;       /* containing address values of if_addr_t */
-       gboolean loopback;      /* TRUE if loopback, FALSE otherwise */
-} if_info_t;
-
 /*
- * An address in the "ip_addr" list.
+ * A snapshot length of 0 is useless - and libpcap/WinPcap don't guarantee
+ * that a snapshot length of 0 will work, and, on some platforms, it won't
+ * (with BPF, for example, the kernel is told the snapshot length via the
+ * return value of the BPF program, and a return value of 0 means "drop
+ * the packet"), so the minimum packet size is 1 byte.
  */
-typedef struct {
-       address_type type;      /* AT_IPv4 or AT_IPv6 */
-       union {
-               guint32 ip4_addr;   /*  4 byte IP V4 address, or */
-               guint8 ip6_addr[16];/* 16 byte IP V6 address */
-       } ip_addr;
-} if_addr_t;
+#define MIN_PACKET_SIZE 1      /* minimum amount of packet data we can read */
 
 GList *get_interface_list(int *err, char **err_str);
+#ifdef HAVE_PCAP_REMOTE
+GList *get_remote_interface_list(const char *hostname, const char *port,
+                                 int auth_type, const char *username,
+                                 const char *passwd, int *err, char **err_str);
+#endif
 
-/* Error values from "get_interface_list()/capture_interface_list()". */
-#define        CANT_GET_INTERFACE_LIST 1       /* error getting list */
-#define        NO_INTERFACES_FOUND     2       /* list is empty */
-#define        CANT_RUN_DUMPCAP        3       /* problem running dumpcap */
-
-void free_interface_list(GList *if_list);
-
-/*
- * The list of data link types returned by "get_pcap_linktype_list()" is
- * a list of these structures.
- */
-typedef struct {
-       int     dlt;                /* e.g. DLT_EN10MB (which is 1) */
-       char    *name;          /* e.g. "EN10MB" or "DLT 1" */
-       char    *description;   /* descriptive name from wiretap e.g. "Ethernet", NULL if unknown */
-} data_link_info_t;
-
-GList *get_pcap_linktype_list(char *devname, char **err_str);
-void free_pcap_linktype_list(GList *linktype_list);
-
-/* get/set the link type of an interface */
-/* (only used in capture_loop.c / capture-pcap-util.c) */
-int get_pcap_linktype(pcap_t *pch, const char *devname);
-const char *set_pcap_linktype(pcap_t *pch, char *devname, int dlt);
-
-
-#ifdef HAVE_PCAP_DATALINK_VAL_TO_NAME
 const char *linktype_val_to_name(int dlt);
-#endif
-#ifdef HAVE_PCAP_DATALINK_NAME_TO_VAL
 int linktype_name_to_val(const char *linktype);
-#endif
 
 #ifdef __cplusplus
 }
@@ -123,4 +73,4 @@ extern void get_compiled_pcap_version(GString *str);
  */
 extern void get_runtime_pcap_version(GString *str);
 
-#endif /* __PCAP_UTIL_H__ */
+#endif /* __CAPTURE_PCAP_UTIL_H__ */