1/*
2 * Copyright (c) 1994, 1995, 1996
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
--- 16 unchanged lines hidden (view full) ---
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * $FreeBSD: head/contrib/libpcap/pcap-int.h 146771 2005-05-29 18:09:04Z sam $
34 * @(#) $Header: /tcpdump/master/libpcap/pcap-int.h,v 1.68 2004/12/18 08:52:10 guy Exp $ (LBL)
35 */
36
37#ifndef pcap_int_h
38#define pcap_int_h
39
40#ifdef __cplusplus
41extern "C" {
42#endif
--- 52 unchanged lines hidden (view full) ---
95 void *dag_mem_base; /* DAG card memory base address */
96 u_int dag_mem_bottom; /* DAG card current memory bottom pointer */
97 u_int dag_mem_top; /* DAG card current memory top pointer */
98 int dag_fcs_bits; /* Number of checksum bits from link layer */
99 int dag_offset_flags; /* Flags to pass to dag_offset(). */
100#endif
101};
102
103struct pcap {
104#ifdef WIN32
105 ADAPTER *adapter;
106 LPPACKET Packet;
107 int timeout;
108 int nonblock;
109#else
110 int fd;
--- 27 unchanged lines hidden (view full) ---
138 u_char *bp;
139 int cc;
140
141 /*
142 * Place holder for pcap_next().
143 */
144 u_char *pkt;
145
146 /*
147 * Methods.
148 */
149 int (*read_op)(pcap_t *, int cnt, pcap_handler, u_char *);
150 int (*inject_op)(pcap_t *, const void *, size_t);
151 int (*setfilter_op)(pcap_t *, struct bpf_program *);
152 int (*set_datalink_op)(pcap_t *, int);
153 int (*getnonblock_op)(pcap_t *, char *);
154 int (*setnonblock_op)(pcap_t *, int, char *);
155 int (*stats_op)(pcap_t *, struct pcap_stat *);
156 void (*close_op)(pcap_t *);
157
158 /*
159 * Placeholder for filter code if bpf not in kernel.
--- 74 unchanged lines hidden (view full) ---
234#ifndef min
235#define min(a, b) ((a) > (b) ? (b) : (a))
236#endif
237
238/* XXX should these be in pcap.h? */
239int pcap_offline_read(pcap_t *, int, pcap_handler, u_char *);
240int pcap_read(pcap_t *, int cnt, pcap_handler, u_char *);
241
242
243/*
244 * Ultrix, DEC OSF/1^H^H^H^H^H^H^H^H^HDigital UNIX^H^H^H^H^H^H^H^H^H^H^H^H
245 * Tru64 UNIX, and NetBSD pad to make everything line up on a nice boundary.
246 */
247#if defined(ultrix) || defined(__osf__) || defined(__NetBSD__)
248#define PCAP_FDDIPAD 3
249#endif
250
251#include <stdarg.h>
252
253/*
254 * Routines that most pcap implementations can use for non-blocking mode.
255 */
256#if !defined(WIN32) && !defined(MSDOS)
--- 37 unchanged lines hidden ---
2 * Copyright (c) 1994, 1995, 1996
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
--- 16 unchanged lines hidden (view full) ---
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * $FreeBSD: head/contrib/libpcap/pcap-int.h 146771 2005-05-29 18:09:04Z sam $
34 * @(#) $Header: /tcpdump/master/libpcap/pcap-int.h,v 1.68 2004/12/18 08:52:10 guy Exp $ (LBL)
35 */
36
37#ifndef pcap_int_h
38#define pcap_int_h
39
40#ifdef __cplusplus
41extern "C" {
42#endif
--- 52 unchanged lines hidden (view full) ---
95 void *dag_mem_base; /* DAG card memory base address */
96 u_int dag_mem_bottom; /* DAG card current memory bottom pointer */
97 u_int dag_mem_top; /* DAG card current memory top pointer */
98 int dag_fcs_bits; /* Number of checksum bits from link layer */
99 int dag_offset_flags; /* Flags to pass to dag_offset(). */
100#endif
101};
102
103struct pcap {
104#ifdef WIN32
105 ADAPTER *adapter;
106 LPPACKET Packet;
107 int timeout;
108 int nonblock;
109#else
110 int fd;
--- 27 unchanged lines hidden (view full) ---
138 u_char *bp;
139 int cc;
140
141 /*
142 * Place holder for pcap_next().
143 */
144 u_char *pkt;
145
146 /*
147 * Methods.
148 */
149 int (*read_op)(pcap_t *, int cnt, pcap_handler, u_char *);
150 int (*inject_op)(pcap_t *, const void *, size_t);
151 int (*setfilter_op)(pcap_t *, struct bpf_program *);
152 int (*set_datalink_op)(pcap_t *, int);
153 int (*getnonblock_op)(pcap_t *, char *);
154 int (*setnonblock_op)(pcap_t *, int, char *);
155 int (*stats_op)(pcap_t *, struct pcap_stat *);
156 void (*close_op)(pcap_t *);
157
158 /*
159 * Placeholder for filter code if bpf not in kernel.
--- 74 unchanged lines hidden (view full) ---
234#ifndef min
235#define min(a, b) ((a) > (b) ? (b) : (a))
236#endif
237
238/* XXX should these be in pcap.h? */
239int pcap_offline_read(pcap_t *, int, pcap_handler, u_char *);
240int pcap_read(pcap_t *, int cnt, pcap_handler, u_char *);
241
242
243/*
244 * Ultrix, DEC OSF/1^H^H^H^H^H^H^H^H^HDigital UNIX^H^H^H^H^H^H^H^H^H^H^H^H
245 * Tru64 UNIX, and NetBSD pad to make everything line up on a nice boundary.
246 */
247#if defined(ultrix) || defined(__osf__) || defined(__NetBSD__)
248#define PCAP_FDDIPAD 3
249#endif
250
251#include <stdarg.h>
252
253/*
254 * Routines that most pcap implementations can use for non-blocking mode.
255 */
256#if !defined(WIN32) && !defined(MSDOS)
--- 37 unchanged lines hidden ---