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 147897 2005-07-11 03:43:25Z sam $ 34 * @(#) $Header: /tcpdump/master/libpcap/pcap-int.h,v 1.68.2.2 2005/05/03 18:54:36 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 |
103/* 104 * 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 105 * Tru64 UNIX, and NetBSD pad to make everything line up on a nice boundary. 106 */ 107#if defined(ultrix) || defined(__osf__) || (defined(__NetBSD__) && __NetBSD_Version__ > 106000000) 108#define PCAP_FDDIPAD 3 109#endif 110 |
111struct pcap { 112#ifdef WIN32 113 ADAPTER *adapter; 114 LPPACKET Packet; 115 int timeout; 116 int nonblock; 117#else 118 int fd; --- 27 unchanged lines hidden (view full) --- 146 u_char *bp; 147 int cc; 148 149 /* 150 * Place holder for pcap_next(). 151 */ 152 u_char *pkt; 153 |
154 /* We're accepting only packets in this direction/these directions. */ 155 direction_t direction; 156 |
157 /* 158 * Methods. 159 */ 160 int (*read_op)(pcap_t *, int cnt, pcap_handler, u_char *); 161 int (*inject_op)(pcap_t *, const void *, size_t); 162 int (*setfilter_op)(pcap_t *, struct bpf_program *); |
163 int (*setdirection_op)(pcap_t *, direction_t); |
164 int (*set_datalink_op)(pcap_t *, int); 165 int (*getnonblock_op)(pcap_t *, char *); 166 int (*setnonblock_op)(pcap_t *, int, char *); 167 int (*stats_op)(pcap_t *, struct pcap_stat *); 168 void (*close_op)(pcap_t *); 169 170 /* 171 * Placeholder for filter code if bpf not in kernel. --- 74 unchanged lines hidden (view full) --- 246#ifndef min 247#define min(a, b) ((a) > (b) ? (b) : (a)) 248#endif 249 250/* XXX should these be in pcap.h? */ 251int pcap_offline_read(pcap_t *, int, pcap_handler, u_char *); 252int pcap_read(pcap_t *, int cnt, pcap_handler, u_char *); 253 |
254#ifndef HAVE_STRLCPY 255#define strlcpy(x, y, z) \ 256 (strncpy((x), (y), (z)), \ 257 ((z) <= 0 ? 0 : ((x)[(z) - 1] = '\0')), \ 258 strlen((y))) |
259#endif 260 261#include <stdarg.h> 262 263/* 264 * Routines that most pcap implementations can use for non-blocking mode. 265 */ 266#if !defined(WIN32) && !defined(MSDOS) --- 37 unchanged lines hidden --- |