WinPcap  4.1.2
incs/pcap.h
Go to the documentation of this file.
1 /* -*- Mode: c; tab-width: 8; indent-tabs-mode: 1; c-basic-offset: 8; -*- */
2 /*
3  * Copyright (c) 1993, 1994, 1995, 1996, 1997
4  * The Regents of the University of California. All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  * 1. Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the distribution.
14  * 3. All advertising materials mentioning features or use of this software
15  * must display the following acknowledgement:
16  * This product includes software developed by the Computer Systems
17  * Engineering Group at Lawrence Berkeley Laboratory.
18  * 4. Neither the name of the University nor of the Laboratory may be used
19  * to endorse or promote products derived from this software without
20  * specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25  * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32  * SUCH DAMAGE.
33  *
34  * @(#) $Header: /usr/cvsroot_private/winpcap/dox/libpcap/incs/pcap.h,v 1.5 2005-11-30 21:48:23 gianlucav Exp $ (LBL)
35  */
36 
37 
44 #ifndef lib_pcap_h
45 #define lib_pcap_h
46 
47 #include <pcap-stdinc.h>
48 #include <net/bpf.h>
49 
50 #include <stdio.h>
51 
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55 
56 #define PCAP_VERSION_MAJOR 2
57 #define PCAP_VERSION_MINOR 4
58 
59 #define PCAP_ERRBUF_SIZE 256
60 
61 
65 #if BPF_RELEASE - 0 < 199406
66 typedef int bpf_int32;
67 typedef u_int bpf_u_int32;
68 #endif
69 
70 typedef struct pcap pcap_t;
71 typedef struct pcap_dumper pcap_dumper_t;
72 typedef struct pcap_if pcap_if_t;
73 typedef struct pcap_addr pcap_addr_t;
74 
111  bpf_u_int32 magic;
112  u_short version_major;
113  u_short version_minor;
114  bpf_int32 thiszone;
115  bpf_u_int32 sigfigs;
116  bpf_u_int32 snaplen;
117  bpf_u_int32 linktype;
118 };
119 
126 struct pcap_pkthdr {
127  struct timeval ts;
128  bpf_u_int32 caplen;
129  bpf_u_int32 len;
130 };
131 
136 struct pcap_stat {
137  u_int ps_recv;
138  u_int ps_drop;
139  u_int ps_ifdrop;
140 #ifdef WIN32
141  u_int bs_capt;
142 #endif /* WIN32 */
143 };
144 
148 struct pcap_if {
149  struct pcap_if *next;
150  char *name;
151  char *description;
153  u_int flags;
154 };
155 
156 #define PCAP_IF_LOOPBACK 0x00000001
157 
158 
161 struct pcap_addr {
162  struct pcap_addr *next;
163  struct sockaddr *addr;
164  struct sockaddr *netmask;
165  struct sockaddr *broadaddr;
166  struct sockaddr *dstaddr;
167 };
168 
169 #if defined(WIN32)
170 
171 
172 #define MODE_CAPT 0
173 #define MODE_STAT 1
174 
175 #endif /* WIN32 */
176 
177 #ifdef __cplusplus
178 }
179 #endif
180 
181 #endif
182 

documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 CACE Technologies. All rights reserved.