libpcap  1.10.1
About: libpcap is a packet filter library used by tools like tcpdump.
  Fossies Dox: libpcap-1.10.1.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

pcap-pf.c File Reference
#include <sys/types.h>
#include <sys/time.h>
#include <sys/timeb.h>
#include <sys/socket.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#include <net/pfilt.h>
#include <net/if.h>
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/if_ether.h>
#include <netinet/ip_var.h>
#include <netinet/udp.h>
#include <netinet/udp_var.h>
#include <netinet/tcp.h>
#include <netinet/tcpip.h>
#include <errno.h>
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <net/bpf.h>
#include "pcap-int.h"
Include dependency graph for pcap-pf.c:

Go to the source code of this file.

Data Structures

struct  pcap_pf
 

Macros

#define PCAP_DONT_INCLUDE_PCAP_BPF_H
 
#define PCAP_FDDIPAD   3
 
#define BUFSPACE   (200 * 256)
 
#define ENDT_FDDI   4
 

Functions

static int pcap_setfilter_pf (pcap_t *, struct bpf_program *)
 
static int pcap_read_pf (pcap_t *pc, int cnt, pcap_handler callback, u_char *user)
 
static int pcap_inject_pf (pcap_t *p, const void *buf, int size)
 
static int pcap_stats_pf (pcap_t *p, struct pcap_stat *ps)
 
static int pcap_activate_pf (pcap_t *p)
 
pcap_tpcap_create_interface (const char *device, char *ebuf)
 
static int can_be_bound (const char *name)
 
static int get_if_flags (const char *name, bpf_u_int32 *flags, char *errbuf)
 
int pcap_platform_finddevs (pcap_if_list_t *devlistp, char *errbuf)
 
const char * pcap_lib_version (void)
 

Macro Definition Documentation

◆ BUFSPACE

#define BUFSPACE   (200 * 256)

Definition at line 97 of file pcap-pf.c.

◆ ENDT_FDDI

#define ENDT_FDDI   4

◆ PCAP_DONT_INCLUDE_PCAP_BPF_H

#define PCAP_DONT_INCLUDE_PCAP_BPF_H

Definition at line 62 of file pcap-pf.c.

◆ PCAP_FDDIPAD

#define PCAP_FDDIPAD   3

Definition at line 74 of file pcap-pf.c.

Function Documentation

◆ can_be_bound()

static int can_be_bound ( const char *  name)
static

Definition at line 551 of file pcap-pf.c.

Referenced by pcap_platform_finddevs().

◆ get_if_flags()

static int get_if_flags ( const char *  name,
bpf_u_int32 flags,
char *  errbuf 
)
static

Definition at line 557 of file pcap-pf.c.

References PCAP_IF_CONNECTION_STATUS_NOT_APPLICABLE, and PCAP_IF_LOOPBACK.

Referenced by pcap_platform_finddevs().

◆ pcap_activate_pf()

◆ pcap_create_interface()

pcap_t* pcap_create_interface ( const char *  device,
char *  ebuf 
)

Definition at line 534 of file pcap-pf.c.

References pcap::activate_op, pcap_activate_pf(), and PCAP_CREATE_COMMON.

◆ pcap_inject_pf()

static int pcap_inject_pf ( pcap_t p,
const void *  buf,
int  size 
)
static

Definition at line 224 of file pcap-pf.c.

References pcap::errbuf, errno, pcap::fd, PCAP_ERRBUF_SIZE, pcap_fmt_errmsg_for_errno(), and write().

Referenced by pcap_activate_pf().

◆ pcap_lib_version()

const char* pcap_lib_version ( void  )

Definition at line 675 of file pcap-pf.c.

References PCAP_VERSION_STRING.

◆ pcap_platform_finddevs()

int pcap_platform_finddevs ( pcap_if_list_t devlistp,
char *  errbuf 
)

Definition at line 578 of file pcap-pf.c.

References can_be_bound(), get_if_flags(), and pcap_findalldevs_interfaces().

◆ pcap_read_pf()

◆ pcap_setfilter_pf()

static int pcap_setfilter_pf ( pcap_t p,
struct bpf_program fp 
)
static

◆ pcap_stats_pf()

static int pcap_stats_pf ( pcap_t p,
struct pcap_stat ps 
)
static