Main Page | Modules | Class List | Directories | File List | Class Members | File Members | Related Pages

pcap.h File Reference

#include <sys/types.h>
#include <sys/time.h>
#include <pcap-bpf.h>
#include <stdio.h>

Go to the source code of this file.

Defines

#define PCAP_VERSION_MAJOR   2
#define PCAP_VERSION_MINOR   4
#define PCAP_ERRBUF_SIZE   256
#define PCAP_IF_LOOPBACK   0x00000001

Typedefs

typedef int bpf_int32
typedef u_int bpf_u_int32
typedef pcap pcap_t
typedef pcap_dumper pcap_dumper_t
typedef pcap_if pcap_if_t
typedef pcap_addr pcap_addr_t
typedef void(* pcap_handler )(u_char *, const struct pcap_pkthdr *, const u_char *)

Enumerations

enum  pcap_direction_t { PCAP_D_INOUT = 0, PCAP_D_IN, PCAP_D_OUT }

Functions

char * pcap_lookupdev (char *)
int pcap_lookupnet (const char *, bpf_u_int32 *, bpf_u_int32 *, char *)
pcap_tpcap_open_live (const char *, int, int, int, char *)
pcap_tpcap_open_dead (int, int)
pcap_tpcap_open_offline (const char *, char *)
pcap_tpcap_fopen_offline (FILE *, char *)
void pcap_close (pcap_t *)
int pcap_loop (pcap_t *, int, pcap_handler, u_char *)
int pcap_dispatch (pcap_t *, int, pcap_handler, u_char *)
const u_char * pcap_next (pcap_t *, struct pcap_pkthdr *)
int pcap_next_ex (pcap_t *, struct pcap_pkthdr **, const u_char **)
void pcap_breakloop (pcap_t *)
int pcap_stats (pcap_t *, struct pcap_stat *)
int pcap_setfilter (pcap_t *, struct bpf_program *)
int pcap_setdirection (pcap_t *, pcap_direction_t)
int pcap_getnonblock (pcap_t *, char *)
int pcap_setnonblock (pcap_t *, int, char *)
void pcap_perror (pcap_t *, char *)
int pcap_inject (pcap_t *, const void *, size_t)
int pcap_sendpacket (pcap_t *, const u_char *, int)
char * pcap_strerror (int)
char * pcap_geterr (pcap_t *)
int pcap_compile (pcap_t *, struct bpf_program *, char *, int, bpf_u_int32)
int pcap_compile_nopcap (int, int, struct bpf_program *, char *, int, bpf_u_int32)
void pcap_freecode (struct bpf_program *)
int pcap_datalink (pcap_t *)
int pcap_list_datalinks (pcap_t *, int **)
int pcap_set_datalink (pcap_t *, int)
int pcap_datalink_name_to_val (const char *)
const char * pcap_datalink_val_to_name (int)
const char * pcap_datalink_val_to_description (int)
int pcap_snapshot (pcap_t *)
int pcap_is_swapped (pcap_t *)
int pcap_major_version (pcap_t *)
int pcap_minor_version (pcap_t *)
FILE * pcap_file (pcap_t *)
int pcap_fileno (pcap_t *)
pcap_dumper_tpcap_dump_open (pcap_t *, const char *)
pcap_dumper_tpcap_dump_fopen (pcap_t *, FILE *fp)
FILE * pcap_dump_file (pcap_dumper_t *)
long pcap_dump_ftell (pcap_dumper_t *)
int pcap_dump_flush (pcap_dumper_t *)
void pcap_dump_close (pcap_dumper_t *)
void pcap_dump (u_char *, const struct pcap_pkthdr *, const u_char *)
int pcap_findalldevs (pcap_if_t **, char *)
void pcap_freealldevs (pcap_if_t *)
const char * pcap_lib_version (void)
u_int bpf_filter (struct bpf_insn *, u_char *, u_int, u_int)
int bpf_validate (struct bpf_insn *f, int len)
char * bpf_image (struct bpf_insn *, int)
void bpf_dump (struct bpf_program *, int)
int pcap_get_selectable_fd (pcap_t *)


Define Documentation

#define PCAP_ERRBUF_SIZE   256
 

Definition at line 76 of file pcap.h.

Referenced by OpenPcap(), and ParseCmdLine().

#define PCAP_IF_LOOPBACK   0x00000001
 

Definition at line 211 of file pcap.h.

#define PCAP_VERSION_MAJOR   2
 

Definition at line 73 of file pcap.h.

#define PCAP_VERSION_MINOR   4
 

Definition at line 74 of file pcap.h.


Typedef Documentation

typedef int bpf_int32
 

Definition at line 83 of file pcap.h.

typedef u_int bpf_u_int32
 

Definition at line 84 of file pcap.h.

typedef struct pcap_addr pcap_addr_t
 

Definition at line 90 of file pcap.h.

typedef struct pcap_dumper pcap_dumper_t
 

Definition at line 88 of file pcap.h.

typedef void(* pcap_handler)(u_char *, const struct pcap_pkthdr *, const u_char *)
 

Definition at line 224 of file pcap.h.

typedef struct pcap_if pcap_if_t
 

Definition at line 89 of file pcap.h.

typedef struct pcap pcap_t
 

Definition at line 87 of file pcap.h.


Enumeration Type Documentation

enum pcap_direction_t
 

Enumeration values:
PCAP_D_INOUT 
PCAP_D_IN 
PCAP_D_OUT 

Definition at line 136 of file pcap.h.


Function Documentation

void bpf_dump struct bpf_program ,
int 
 

u_int bpf_filter struct bpf_insn ,
u_char *  ,
u_int  ,
u_int 
 

char* bpf_image struct bpf_insn ,
int 
 

int bpf_validate struct bpf_insn f,
int  len
 

void pcap_breakloop pcap_t  ) 
 

void pcap_close pcap_t  ) 
 

Referenced by CleanExit(), ParseConfig(), and Restart().

int pcap_compile pcap_t ,
struct bpf_program ,
char *  ,
int  ,
bpf_u_int32 
 

Referenced by OpenPcap().

int pcap_compile_nopcap int  ,
int  ,
struct bpf_program ,
char *  ,
int  ,
bpf_u_int32 
 

int pcap_datalink pcap_t  ) 
 

Referenced by OpenPcap().

int pcap_datalink_name_to_val const char *   ) 
 

const char* pcap_datalink_val_to_description int   ) 
 

const char* pcap_datalink_val_to_name int   ) 
 

int pcap_dispatch pcap_t ,
int  ,
pcap_handler  ,
u_char * 
 

void pcap_dump u_char *  ,
const struct pcap_pkthdr ,
const u_char * 
 

Referenced by DirectLogTcpdump(), LogTcpdumpSingle(), and LogTcpdumpStream().

void pcap_dump_close pcap_dumper_t  ) 
 

Referenced by SpoLogTcpdumpCleanExitFunc(), and SpoLogTcpdumpRestartFunc().

FILE* pcap_dump_file pcap_dumper_t  ) 
 

int pcap_dump_flush pcap_dumper_t  ) 
 

pcap_dumper_t* pcap_dump_fopen pcap_t ,
FILE *  fp
 

long pcap_dump_ftell pcap_dumper_t  ) 
 

pcap_dumper_t* pcap_dump_open pcap_t ,
const char * 
 

Referenced by TcpdumpInitLogFile().

FILE* pcap_file pcap_t  ) 
 

int pcap_fileno pcap_t  ) 
 

int pcap_findalldevs pcap_if_t **  ,
char * 
 

pcap_t* pcap_fopen_offline FILE *  ,
char * 
 

void pcap_freealldevs pcap_if_t  ) 
 

void pcap_freecode struct bpf_program  ) 
 

int pcap_get_selectable_fd pcap_t  ) 
 

char* pcap_geterr pcap_t  ) 
 

Referenced by InterfaceThread(), and OpenPcap().

int pcap_getnonblock pcap_t ,
char * 
 

int pcap_inject pcap_t ,
const void *  ,
size_t 
 

int pcap_is_swapped pcap_t  ) 
 

const char* pcap_lib_version void   ) 
 

int pcap_list_datalinks pcap_t ,
int ** 
 

char* pcap_lookupdev char *   ) 
 

Referenced by OpenPcap(), and ParseCmdLine().

int pcap_lookupnet const char *  ,
bpf_u_int32 ,
bpf_u_int32 ,
char * 
 

Referenced by OpenPcap().

int pcap_loop pcap_t ,
int  ,
pcap_handler  ,
u_char * 
 

Referenced by InterfaceThread().

int pcap_major_version pcap_t  ) 
 

int pcap_minor_version pcap_t  ) 
 

const u_char* pcap_next pcap_t ,
struct pcap_pkthdr
 

int pcap_next_ex pcap_t ,
struct pcap_pkthdr **  ,
const u_char ** 
 

pcap_t* pcap_open_dead int  ,
int 
 

pcap_t* pcap_open_live const char *  ,
int  ,
int  ,
int  ,
char * 
 

Referenced by OpenPcap().

pcap_t* pcap_open_offline const char *  ,
char * 
 

Referenced by OpenPcap().

void pcap_perror pcap_t ,
char * 
 

Referenced by DropStats().

int pcap_sendpacket pcap_t ,
const u_char *  ,
int 
 

int pcap_set_datalink pcap_t ,
int 
 

int pcap_setdirection pcap_t ,
pcap_direction_t 
 

int pcap_setfilter pcap_t ,
struct bpf_program
 

Referenced by OpenPcap().

int pcap_setnonblock pcap_t ,
int  ,
char * 
 

int pcap_snapshot pcap_t  ) 
 

Referenced by OpenPcap().

int pcap_stats pcap_t ,
struct pcap_stat
 

Referenced by DropStats(), and GetPktDropStats().

char* pcap_strerror int   ) 
 

Referenced by read_infile().


Generated on Sun May 14 14:51:29 2006 by  doxygen 1.4.2