Classes | Macros | Typedefs | Enumerations | Functions
pcap/pcap.h File Reference
#include <sys/types.h>
#include <sys/time.h>
#include <pcap/bpf.h>
#include <stdio.h>
Include dependency graph for pcap/pcap.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  pcap_addr
 
struct  pcap_file_header
 
struct  pcap_if
 
struct  pcap_pkthdr
 
struct  pcap_stat
 

Macros

#define LT_FCS_DATALINK_EXT(x)   ((((x) & 0xF) << 28) | 0x04000000)
 
#define LT_FCS_LENGTH(x)   (((x) & 0xF0000000) >> 28)
 
#define LT_FCS_LENGTH_PRESENT(x)   ((x) & 0x04000000)
 
#define PCAP_ERRBUF_SIZE   256
 
#define PCAP_ERROR   -1 /* generic error code */
 
#define PCAP_ERROR_ACTIVATED   -4 /* the operation can't be performed on already activated captures */
 
#define PCAP_ERROR_BREAK   -2 /* loop terminated by pcap_breakloop */
 
#define PCAP_ERROR_IFACE_NOT_UP   -9 /* interface isn't up */
 
#define PCAP_ERROR_NO_SUCH_DEVICE   -5 /* no such device exists */
 
#define PCAP_ERROR_NOT_ACTIVATED   -3 /* the capture needs to be activated */
 
#define PCAP_ERROR_NOT_RFMON   -7 /* operation supported only in monitor mode */
 
#define PCAP_ERROR_PERM_DENIED   -8 /* no permission to open the device */
 
#define PCAP_ERROR_RFMON_NOTSUP   -6 /* this device doesn't support rfmon (monitor) mode */
 
#define PCAP_IF_LOOPBACK   0x00000001 /* interface is loopback */
 
#define PCAP_VERSION_MAJOR   2
 
#define PCAP_VERSION_MINOR   4
 
#define PCAP_WARNING   1 /* generic warning code */
 
#define PCAP_WARNING_PROMISC_NOTSUP   2 /* this device doesn't support promiscuous mode */
 

Typedefs

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

Enumerations

enum  pcap_direction_t { PCAP_D_INOUT = 0, PCAP_D_IN, PCAP_D_OUT }
 

Functions

void bpf_dump (const struct bpf_program *, int)
 
u_int bpf_filter (const struct bpf_insn *, const u_char *, u_int, u_int)
 
char * bpf_image (const struct bpf_insn *, int)
 
int bpf_validate (const struct bpf_insn *f, int len)
 
int pcap_activate (pcap_t *)
 
void pcap_breakloop (pcap_t *)
 
int pcap_can_set_rfmon (pcap_t *)
 
void pcap_close (pcap_t *)
 
int pcap_compile (pcap_t *, struct bpf_program *, const char *, int, bpf_u_int32)
 
int pcap_compile_nopcap (int, int, struct bpf_program *, const char *, int, bpf_u_int32)
 
pcap_tpcap_create (const char *, char *)
 
int pcap_datalink (pcap_t *)
 
int pcap_datalink_ext (pcap_t *)
 
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 *)
 
void pcap_dump_close (pcap_dumper_t *)
 
FILE * pcap_dump_file (pcap_dumper_t *)
 
int pcap_dump_flush (pcap_dumper_t *)
 
pcap_dumper_tpcap_dump_fopen (pcap_t *, FILE *fp)
 
long pcap_dump_ftell (pcap_dumper_t *)
 
pcap_dumper_tpcap_dump_open (pcap_t *, const char *)
 
FILE * pcap_file (pcap_t *)
 
int pcap_fileno (pcap_t *)
 
int pcap_findalldevs (pcap_if_t **, char *)
 
pcap_tpcap_fopen_offline (FILE *, char *)
 
void pcap_free_datalinks (int *)
 
void pcap_freealldevs (pcap_if_t *)
 
void pcap_freecode (struct bpf_program *)
 
int pcap_get_selectable_fd (pcap_t *)
 
char * pcap_geterr (pcap_t *)
 
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 *)
 
int pcap_lookupnet (const char *, bpf_u_int32 *, bpf_u_int32 *, char *)
 
int pcap_loop (pcap_t *, int, pcap_handler, u_char *)
 
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 **)
 
int pcap_offline_filter (struct bpf_program *, const struct pcap_pkthdr *, const u_char *)
 
pcap_tpcap_open_dead (int, int)
 
pcap_tpcap_open_live (const char *, int, int, int, char *)
 
pcap_tpcap_open_offline (const char *, char *)
 
void pcap_perror (pcap_t *, char *)
 
int pcap_sendpacket (pcap_t *, const u_char *, int)
 
int pcap_set_buffer_size (pcap_t *, int)
 
int pcap_set_datalink (pcap_t *, int)
 
int pcap_set_promisc (pcap_t *, int)
 
int pcap_set_rfmon (pcap_t *, int)
 
int pcap_set_snaplen (pcap_t *, int)
 
int pcap_set_timeout (pcap_t *, int)
 
int pcap_setdirection (pcap_t *, pcap_direction_t)
 
int pcap_setfilter (pcap_t *, struct bpf_program *)
 
int pcap_setnonblock (pcap_t *, int, char *)
 
int pcap_snapshot (pcap_t *)
 
int pcap_stats (pcap_t *, struct pcap_stat *)
 
const char * pcap_statustostr (int)
 
const char * pcap_strerror (int)
 

Macro Definition Documentation

◆ LT_FCS_DATALINK_EXT

#define LT_FCS_DATALINK_EXT (   x)    ((((x) & 0xF) << 28) | 0x04000000)

Definition at line 147 of file pcap/pcap.h.

◆ LT_FCS_LENGTH

#define LT_FCS_LENGTH (   x)    (((x) & 0xF0000000) >> 28)

Definition at line 146 of file pcap/pcap.h.

◆ LT_FCS_LENGTH_PRESENT

#define LT_FCS_LENGTH_PRESENT (   x)    ((x) & 0x04000000)

Definition at line 145 of file pcap/pcap.h.

◆ PCAP_ERRBUF_SIZE

#define PCAP_ERRBUF_SIZE   256

Definition at line 76 of file pcap/pcap.h.

◆ PCAP_ERROR

#define PCAP_ERROR   -1 /* generic error code */

Definition at line 253 of file pcap/pcap.h.

◆ PCAP_ERROR_ACTIVATED

#define PCAP_ERROR_ACTIVATED   -4 /* the operation can't be performed on already activated captures */

Definition at line 256 of file pcap/pcap.h.

◆ PCAP_ERROR_BREAK

#define PCAP_ERROR_BREAK   -2 /* loop terminated by pcap_breakloop */

Definition at line 254 of file pcap/pcap.h.

◆ PCAP_ERROR_IFACE_NOT_UP

#define PCAP_ERROR_IFACE_NOT_UP   -9 /* interface isn't up */

Definition at line 261 of file pcap/pcap.h.

◆ PCAP_ERROR_NO_SUCH_DEVICE

#define PCAP_ERROR_NO_SUCH_DEVICE   -5 /* no such device exists */

Definition at line 257 of file pcap/pcap.h.

◆ PCAP_ERROR_NOT_ACTIVATED

#define PCAP_ERROR_NOT_ACTIVATED   -3 /* the capture needs to be activated */

Definition at line 255 of file pcap/pcap.h.

◆ PCAP_ERROR_NOT_RFMON

#define PCAP_ERROR_NOT_RFMON   -7 /* operation supported only in monitor mode */

Definition at line 259 of file pcap/pcap.h.

◆ PCAP_ERROR_PERM_DENIED

#define PCAP_ERROR_PERM_DENIED   -8 /* no permission to open the device */

Definition at line 260 of file pcap/pcap.h.

◆ PCAP_ERROR_RFMON_NOTSUP

#define PCAP_ERROR_RFMON_NOTSUP   -6 /* this device doesn't support rfmon (monitor) mode */

Definition at line 258 of file pcap/pcap.h.

◆ PCAP_IF_LOOPBACK

#define PCAP_IF_LOOPBACK   0x00000001 /* interface is loopback */

Definition at line 231 of file pcap/pcap.h.

◆ PCAP_VERSION_MAJOR

#define PCAP_VERSION_MAJOR   2

Definition at line 73 of file pcap/pcap.h.

◆ PCAP_VERSION_MINOR

#define PCAP_VERSION_MINOR   4

Definition at line 74 of file pcap/pcap.h.

◆ PCAP_WARNING

#define PCAP_WARNING   1 /* generic warning code */

Definition at line 268 of file pcap/pcap.h.

◆ PCAP_WARNING_PROMISC_NOTSUP

#define PCAP_WARNING_PROMISC_NOTSUP   2 /* this device doesn't support promiscuous mode */

Definition at line 269 of file pcap/pcap.h.

Typedef Documentation

◆ bpf_int32

typedef int bpf_int32

Definition at line 83 of file pcap/pcap.h.

◆ bpf_u_int32

typedef u_int bpf_u_int32

Definition at line 84 of file pcap/pcap.h.

◆ pcap_addr_t

typedef struct pcap_addr pcap_addr_t

Definition at line 90 of file pcap/pcap.h.

◆ pcap_dumper_t

typedef struct pcap_dumper pcap_dumper_t

Definition at line 88 of file pcap/pcap.h.

◆ pcap_handler

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

Definition at line 244 of file pcap/pcap.h.

◆ pcap_if_t

typedef struct pcap_if pcap_if_t

Definition at line 89 of file pcap/pcap.h.

◆ pcap_t

typedef struct pcap pcap_t

Definition at line 87 of file pcap/pcap.h.

Enumeration Type Documentation

◆ pcap_direction_t

Enumerator
PCAP_D_INOUT 
PCAP_D_IN 
PCAP_D_OUT 

Definition at line 149 of file pcap/pcap.h.

Function Documentation

◆ bpf_dump()

void bpf_dump ( const struct bpf_program ,
int   
)

◆ bpf_filter()

u_int bpf_filter ( const struct bpf_insn ,
const u_char *  ,
u_int  ,
u_int   
)

◆ bpf_image()

char* bpf_image ( const struct bpf_insn ,
int   
)

◆ bpf_validate()

int bpf_validate ( const struct bpf_insn f,
int  len 
)

◆ pcap_activate()

int pcap_activate ( pcap_t )

◆ pcap_breakloop()

void pcap_breakloop ( pcap_t )

◆ pcap_can_set_rfmon()

int pcap_can_set_rfmon ( pcap_t )

◆ pcap_close()

void pcap_close ( pcap_t )

◆ pcap_compile()

int pcap_compile ( pcap_t ,
struct bpf_program ,
const char *  ,
int  ,
bpf_u_int32   
)

◆ pcap_compile_nopcap()

int pcap_compile_nopcap ( int  ,
int  ,
struct bpf_program ,
const char *  ,
int  ,
bpf_u_int32   
)

◆ pcap_create()

pcap_t* pcap_create ( const char *  ,
char *   
)

◆ pcap_datalink()

int pcap_datalink ( pcap_t )

◆ pcap_datalink_ext()

int pcap_datalink_ext ( pcap_t )

◆ pcap_datalink_name_to_val()

int pcap_datalink_name_to_val ( const char *  )

◆ pcap_datalink_val_to_description()

const char* pcap_datalink_val_to_description ( int  )

◆ pcap_datalink_val_to_name()

const char* pcap_datalink_val_to_name ( int  )

◆ pcap_dispatch()

int pcap_dispatch ( pcap_t ,
int  ,
pcap_handler  ,
u_char *   
)

◆ pcap_dump()

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

◆ pcap_dump_close()

void pcap_dump_close ( pcap_dumper_t )

◆ pcap_dump_file()

FILE* pcap_dump_file ( pcap_dumper_t )

◆ pcap_dump_flush()

int pcap_dump_flush ( pcap_dumper_t )

◆ pcap_dump_fopen()

pcap_dumper_t* pcap_dump_fopen ( pcap_t ,
FILE *  fp 
)

◆ pcap_dump_ftell()

long pcap_dump_ftell ( pcap_dumper_t )

◆ pcap_dump_open()

pcap_dumper_t* pcap_dump_open ( pcap_t ,
const char *   
)

◆ pcap_file()

FILE* pcap_file ( pcap_t )

◆ pcap_fileno()

int pcap_fileno ( pcap_t )

◆ pcap_findalldevs()

int pcap_findalldevs ( pcap_if_t **  ,
char *   
)

◆ pcap_fopen_offline()

pcap_t* pcap_fopen_offline ( FILE *  ,
char *   
)

◆ pcap_free_datalinks()

void pcap_free_datalinks ( int *  )

◆ pcap_freealldevs()

void pcap_freealldevs ( pcap_if_t )

◆ pcap_freecode()

void pcap_freecode ( struct bpf_program )

◆ pcap_get_selectable_fd()

int pcap_get_selectable_fd ( pcap_t )

◆ pcap_geterr()

char* pcap_geterr ( pcap_t )

◆ pcap_getnonblock()

int pcap_getnonblock ( pcap_t ,
char *   
)

◆ pcap_inject()

int pcap_inject ( pcap_t ,
const void *  ,
size_t   
)

◆ pcap_is_swapped()

int pcap_is_swapped ( pcap_t )

◆ pcap_lib_version()

const char* pcap_lib_version ( void  )

◆ pcap_list_datalinks()

int pcap_list_datalinks ( pcap_t ,
int **   
)

◆ pcap_lookupdev()

char* pcap_lookupdev ( char *  )

◆ pcap_lookupnet()

int pcap_lookupnet ( const char *  ,
bpf_u_int32 ,
bpf_u_int32 ,
char *   
)

◆ pcap_loop()

int pcap_loop ( pcap_t ,
int  ,
pcap_handler  ,
u_char *   
)

◆ pcap_major_version()

int pcap_major_version ( pcap_t )

◆ pcap_minor_version()

int pcap_minor_version ( pcap_t )

◆ pcap_next()

const u_char* pcap_next ( pcap_t ,
struct pcap_pkthdr  
)

◆ pcap_next_ex()

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

◆ pcap_offline_filter()

int pcap_offline_filter ( struct bpf_program ,
const struct pcap_pkthdr ,
const u_char *   
)

◆ pcap_open_dead()

pcap_t* pcap_open_dead ( int  ,
int   
)

◆ pcap_open_live()

pcap_t* pcap_open_live ( const char *  ,
int  ,
int  ,
int  ,
char *   
)

◆ pcap_open_offline()

pcap_t* pcap_open_offline ( const char *  ,
char *   
)

◆ pcap_perror()

void pcap_perror ( pcap_t ,
char *   
)

◆ pcap_sendpacket()

int pcap_sendpacket ( pcap_t ,
const u_char *  ,
int   
)

◆ pcap_set_buffer_size()

int pcap_set_buffer_size ( pcap_t ,
int   
)

◆ pcap_set_datalink()

int pcap_set_datalink ( pcap_t ,
int   
)

◆ pcap_set_promisc()

int pcap_set_promisc ( pcap_t ,
int   
)

◆ pcap_set_rfmon()

int pcap_set_rfmon ( pcap_t ,
int   
)

◆ pcap_set_snaplen()

int pcap_set_snaplen ( pcap_t ,
int   
)

◆ pcap_set_timeout()

int pcap_set_timeout ( pcap_t ,
int   
)

◆ pcap_setdirection()

int pcap_setdirection ( pcap_t ,
pcap_direction_t   
)

◆ pcap_setfilter()

int pcap_setfilter ( pcap_t ,
struct bpf_program  
)

◆ pcap_setnonblock()

int pcap_setnonblock ( pcap_t ,
int  ,
char *   
)

◆ pcap_snapshot()

int pcap_snapshot ( pcap_t )

◆ pcap_stats()

int pcap_stats ( pcap_t ,
struct pcap_stat  
)

◆ pcap_statustostr()

const char* pcap_statustostr ( int  )

◆ pcap_strerror()

const char* pcap_strerror ( int  )


soem
Author(s): Arthur Ketels and M.J.G. van den Molengraft
autogenerated on Wed Mar 2 2022 01:01:49