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: --- 17 unchanged lines hidden (view full) --- 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 * $FreeBSD: head/contrib/libpcap/pcap.h 147897 2005-07-11 03:43:25Z sam $ |
35 * @(#) $Header: /tcpdump/master/libpcap/pcap.h,v 1.52 2004/12/18 08:52:11 guy Exp $ (LBL) 36 */ 37 38#ifndef lib_pcap_h 39#define lib_pcap_h 40 41#include <sys/types.h> 42#include <sys/time.h> --- 64 unchanged lines hidden (view full) --- 107 u_short version_major; 108 u_short version_minor; 109 bpf_int32 thiszone; /* gmt to local correction */ 110 bpf_u_int32 sigfigs; /* accuracy of timestamps */ 111 bpf_u_int32 snaplen; /* max length saved portion of each pkt */ 112 bpf_u_int32 linktype; /* data link type (LINKTYPE_*) */ 113}; 114 |
115typedef enum { 116 D_INOUT = 0, 117 D_IN, 118 D_OUT 119} direction_t; 120 |
121/* 122 * Each packet in the dump file is prepended with this generic header. 123 * This gets around the problem of different headers for different 124 * packet interfaces. 125 */ 126struct pcap_pkthdr { 127 struct timeval ts; /* time stamp */ 128 bpf_u_int32 caplen; /* length of portion present */ --- 82 unchanged lines hidden (view full) --- 211int pcap_loop(pcap_t *, int, pcap_handler, u_char *); 212int pcap_dispatch(pcap_t *, int, pcap_handler, u_char *); 213const u_char* 214 pcap_next(pcap_t *, struct pcap_pkthdr *); 215int pcap_next_ex(pcap_t *, struct pcap_pkthdr **, const u_char **); 216void pcap_breakloop(pcap_t *); 217int pcap_stats(pcap_t *, struct pcap_stat *); 218int pcap_setfilter(pcap_t *, struct bpf_program *); |
219int pcap_setdirection(pcap_t *, direction_t); |
220int pcap_getnonblock(pcap_t *, char *); 221int pcap_setnonblock(pcap_t *, int, char *); 222void pcap_perror(pcap_t *, char *); 223int pcap_inject(pcap_t *, const void *, size_t); 224int pcap_sendpacket(pcap_t *, const u_char *, int); 225char *pcap_strerror(int); 226char *pcap_geterr(pcap_t *); 227int pcap_compile(pcap_t *, struct bpf_program *, char *, int, --- 13 unchanged lines hidden (view full) --- 241int pcap_minor_version(pcap_t *); 242 243/* XXX */ 244FILE *pcap_file(pcap_t *); 245int pcap_fileno(pcap_t *); 246 247pcap_dumper_t *pcap_dump_open(pcap_t *, const char *); 248pcap_dumper_t *pcap_dump_fopen(pcap_t *, FILE *fp); |
249FILE *pcap_dump_file(pcap_dumper_t *); 250long pcap_dump_ftell(pcap_dumper_t *); |
251int pcap_dump_flush(pcap_dumper_t *); 252void pcap_dump_close(pcap_dumper_t *); 253void pcap_dump(u_char *, const struct pcap_pkthdr *, const u_char *); |
254 255int pcap_findalldevs(pcap_if_t **, char *); 256void pcap_freealldevs(pcap_if_t *); 257 258const char *pcap_lib_version(void); 259 260/* XXX this guy lives in the bpf tree */ 261u_int bpf_filter(struct bpf_insn *, u_char *, u_int, u_int); --- 48 unchanged lines hidden --- |