libpcap
1.10.1
About: libpcap is a packet filter library used by tools like tcpdump.
![]() ![]() |
#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"
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_t * | pcap_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) |
#define ENDT_FDDI 4 |
|
static |
Definition at line 551 of file pcap-pf.c.
Referenced by pcap_platform_finddevs().
|
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().
|
static |
Definition at line 293 of file pcap-pf.c.
References pcap::buffer, pcap::bufsize, BUFSPACE, pcap_opt::device, pcap::dlt_count, DLT_DOCSIS, DLT_EN10MB, DLT_FDDI, DLT_IEEE802, pcap::dlt_list, DLT_PPP, DLT_SLIP, ENDT_FDDI, pcap::errbuf, errno, pcap::fd, pcap::fddipad, pcap::getnonblock_op, pcap_opt::immediate, pcap::inject_op, ioctl(), pcap::linktype, MAXIMUM_SNAPLEN, pcap::offset, pcap::opt, pcap_pf::OrigMissed, pcap_cleanup_live_common(), PCAP_ERRBUF_SIZE, PCAP_ERROR, PCAP_ERROR_PERM_DENIED, PCAP_FDDIPAD, pcap_fmt_errmsg_for_errno(), pcap_getnonblock_fd(), pcap_inject_pf(), pcap_read_pf(), pcap_setfilter_pf(), pcap_setnonblock_fd(), pcap_stats_pf(), pfopen(), pcap::priv, pcap_opt::promisc, pcap::read_op, pcap::selectable_fd, pcap::set_datalink_op, pcap::setdirection_op, pcap::setfilter_op, pcap::setnonblock_op, pcap::snapshot, snprintf(), pcap::stats_op, and pcap_opt::timeout.
Referenced by 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.
|
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().
const char* pcap_lib_version | ( | void | ) |
Definition at line 675 of file pcap-pf.c.
References PCAP_VERSION_STRING.
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().
|
static |
Definition at line 100 of file pcap-pf.c.
References bpf_program::bf_insns, pcap::bp, pcap::break_loop, pcap::buffer, pcap::bufsize, pcap_pkthdr::caplen, pcap::cc, pcap::errbuf, errno, pcap::fcode, pcap::fd, pcap::fddipad, pcap_pf::filtering_in_kernel, pcap_pkthdr::len, lseek(), pcap::offset, pcap_pf::OrigMissed, PACKET_COUNT_IS_UNLIMITED, pcap_filter(), pcap_fmt_errmsg_for_errno(), pcap::priv, read(), pcap::snapshot, snprintf(), pcap_pf::TotAccepted, pcap_pf::TotDrops, pcap_pf::TotMissed, pcap_pf::TotPkts, and pcap_pkthdr::ts.
Referenced by pcap_activate_pf().
|
static |
Definition at line 585 of file pcap-pf.c.
References pcap::cc, pcap::errbuf, errno, pcap::fd, pcap_pf::filtering_in_kernel, install_bpf_program(), ioctl(), pcap_fmt_errmsg_for_errno(), and pcap::priv.
Referenced by pcap_activate_pf().
Definition at line 238 of file pcap-pf.c.
References pcap_pf::OrigMissed, pcap::priv, pcap_stat::ps_drop, pcap_stat::ps_ifdrop, pcap_stat::ps_recv, pcap_pf::TotAccepted, pcap_pf::TotDrops, and pcap_pf::TotMissed.
Referenced by pcap_activate_pf().