diff options
author | sam <sam@FreeBSD.org> | 2005-05-29 17:46:52 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2005-05-29 17:46:52 +0000 |
commit | 70f7ae46f5124d9a1805484495b57250a715bed4 (patch) | |
tree | b733a54335042f876f8969020dc9dc4408f485f4 /contrib/libpcap/pcap-int.h | |
parent | da13a5a9d72229b2a6026a49b9977934bdef13ed (diff) | |
download | FreeBSD-src-70f7ae46f5124d9a1805484495b57250a715bed4.zip FreeBSD-src-70f7ae46f5124d9a1805484495b57250a715bed4.tar.gz |
Virgin import of libpcap v0.9.1 (alpha 096) from tcpdump.org
Diffstat (limited to 'contrib/libpcap/pcap-int.h')
-rw-r--r-- | contrib/libpcap/pcap-int.h | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/contrib/libpcap/pcap-int.h b/contrib/libpcap/pcap-int.h index c56553c..a64fc3c 100644 --- a/contrib/libpcap/pcap-int.h +++ b/contrib/libpcap/pcap-int.h @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#) $Header: /tcpdump/master/libpcap/pcap-int.h,v 1.55.2.4 2003/12/15 01:42:24 guy Exp $ (LBL) + * @(#) $Header: /tcpdump/master/libpcap/pcap-int.h,v 1.68 2004/12/18 08:52:10 guy Exp $ (LBL) */ #ifndef pcap_int_h @@ -46,6 +46,11 @@ extern "C" { #include <packet32.h> #endif /* WIN32 */ +#ifdef MSDOS +#include <fcntl.h> +#include <io.h> +#endif + /* * Savefile */ @@ -74,13 +79,14 @@ struct pcap_md { u_long TotDrops; /* count of dropped packets */ long TotMissed; /* missed by i/f during this run */ long OrigMissed; /* missed by i/f before this run */ + char *device; /* device name */ #ifdef linux int sock_packet; /* using Linux 2.0 compatible interface */ int timeout; /* timeout specified to pcap_open_live */ int clear_promisc; /* must clear promiscuous mode when we close */ int cooked; /* using SOCK_DGRAM rather than SOCK_RAW */ + int ifindex; /* interface index of device we're bound to */ int lo_ifindex; /* interface index of the loopback device */ - char *device; /* device name */ struct pcap *next; /* list of open promiscuous sock_packet pcaps */ #endif @@ -89,7 +95,7 @@ struct pcap_md { u_int dag_mem_bottom; /* DAG card current memory bottom pointer */ u_int dag_mem_top; /* DAG card current memory top pointer */ int dag_fcs_bits; /* Number of checksum bits from link layer */ - int dag_offset_flags; /* Flags to pass to dag_offset(). */ + int dag_offset_flags; /* Flags to pass to dag_offset(). */ #endif }; @@ -102,6 +108,7 @@ struct pcap { #else int fd; int selectable_fd; + int send_fd; #endif /* WIN32 */ int snapshot; int linktype; @@ -110,6 +117,15 @@ struct pcap { int break_loop; /* flag set to force break from packet-reading loop */ +#ifdef PCAP_FDDIPAD + int fddipad; +#endif + +#ifdef MSDOS + int inter_packet_wait; /* offline: wait between packets */ + void (*wait_proc)(void); /* call proc while waiting */ +#endif + struct pcap_sf sf; struct pcap_md md; @@ -130,6 +146,7 @@ struct pcap { * Methods. */ int (*read_op)(pcap_t *, int cnt, pcap_handler, u_char *); + int (*inject_op)(pcap_t *, const void *, size_t); int (*setfilter_op)(pcap_t *, struct bpf_program *); int (*set_datalink_op)(pcap_t *, int); int (*getnonblock_op)(pcap_t *, char *); @@ -144,7 +161,7 @@ struct pcap { char errbuf[PCAP_ERRBUF_SIZE + 1]; int dlt_count; - int *dlt_list; + u_int *dlt_list; struct pcap_pkthdr pcap_header; /* This is needed for the pcap_next_ex() to work */ }; @@ -252,11 +269,13 @@ extern int vsnprintf (char *, size_t, const char *, va_list ap); /* * Routines that most pcap implementations can use for non-blocking mode. */ -#ifndef WIN32 +#if !defined(WIN32) && !defined(MSDOS) int pcap_getnonblock_fd(pcap_t *, char *); int pcap_setnonblock_fd(pcap_t *p, int, char *); #endif +void pcap_close_common(pcap_t *); + /* * Internal interfaces for "pcap_findalldevs()". * @@ -267,10 +286,10 @@ int pcap_setnonblock_fd(pcap_t *p, int, char *); * "pcap_add_if()" adds an interface to the list of interfaces. */ int pcap_platform_finddevs(pcap_if_t **, char *); -int add_addr_to_iflist(pcap_if_t **, char *, u_int, struct sockaddr *, +int add_addr_to_iflist(pcap_if_t **, const char *, u_int, struct sockaddr *, size_t, struct sockaddr *, size_t, struct sockaddr *, size_t, struct sockaddr *, size_t, char *); -int pcap_add_if(pcap_if_t **, char *, u_int, const char *, char *); +int pcap_add_if(pcap_if_t **, const char *, u_int, const char *, char *); struct sockaddr *dup_sockaddr(struct sockaddr *, size_t); int add_or_find_if(pcap_if_t **, pcap_if_t **, const char *, u_int, const char *, char *); @@ -279,9 +298,6 @@ int add_or_find_if(pcap_if_t **, pcap_if_t **, const char *, u_int, char *pcap_win32strerror(void); #endif -/* XXX */ -extern int pcap_fddipad; - int install_bpf_program(pcap_t *, struct bpf_program *); int pcap_strcasecmp(const char *, const char *); |