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.h File Reference
#include <pcap/funcattrs.h>
#include <pcap/pcap-inttypes.h>
#include <sys/types.h>
#include <sys/time.h>
#include <pcap/socket.h>
#include <pcap/bpf.h>
#include <stdio.h>
Include dependency graph for pcap.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  pcap_file_header
 
struct  pcap_pkthdr
 
struct  pcap_stat
 
struct  pcap_if
 
struct  pcap_addr
 
struct  pcap_rmtauth
 
struct  pcap_samp
 

Macros

#define PCAP_VERSION_MAJOR   2
 
#define PCAP_VERSION_MINOR   4
 
#define PCAP_ERRBUF_SIZE   256
 
#define LT_FCS_LENGTH_PRESENT(x)   ((x) & 0x04000000)
 
#define LT_FCS_LENGTH(x)   (((x) & 0xF0000000) >> 28)
 
#define LT_FCS_DATALINK_EXT(x)   ((((x) & 0xF) << 28) | 0x04000000)
 
#define PCAP_IF_LOOPBACK   0x00000001 /* interface is loopback */
 
#define PCAP_IF_UP   0x00000002 /* interface is up */
 
#define PCAP_IF_RUNNING   0x00000004 /* interface is running */
 
#define PCAP_IF_WIRELESS   0x00000008 /* interface is wireless (*NOT* necessarily Wi-Fi!) */
 
#define PCAP_IF_CONNECTION_STATUS   0x00000030 /* connection status: */
 
#define PCAP_IF_CONNECTION_STATUS_UNKNOWN   0x00000000 /* unknown */
 
#define PCAP_IF_CONNECTION_STATUS_CONNECTED   0x00000010 /* connected */
 
#define PCAP_IF_CONNECTION_STATUS_DISCONNECTED   0x00000020 /* disconnected */
 
#define PCAP_IF_CONNECTION_STATUS_NOT_APPLICABLE   0x00000030 /* not applicable */
 
#define PCAP_ERROR   -1 /* generic error code */
 
#define PCAP_ERROR_BREAK   -2 /* loop terminated by pcap_breakloop */
 
#define PCAP_ERROR_NOT_ACTIVATED   -3 /* the capture needs to be activated */
 
#define PCAP_ERROR_ACTIVATED   -4 /* the operation can't be performed on already activated captures */
 
#define PCAP_ERROR_NO_SUCH_DEVICE   -5 /* no such device exists */
 
#define PCAP_ERROR_RFMON_NOTSUP   -6 /* this device doesn't support rfmon (monitor) mode */
 
#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_IFACE_NOT_UP   -9 /* interface isn't up */
 
#define PCAP_ERROR_CANTSET_TSTAMP_TYPE   -10 /* this device doesn't support setting the time stamp type */
 
#define PCAP_ERROR_PROMISC_PERM_DENIED   -11 /* you don't have permission to capture in promiscuous mode */
 
#define PCAP_ERROR_TSTAMP_PRECISION_NOTSUP   -12 /* the requested time stamp precision is not supported */
 
#define PCAP_WARNING   1 /* generic warning code */
 
#define PCAP_WARNING_PROMISC_NOTSUP   2 /* this device doesn't support promiscuous mode */
 
#define PCAP_WARNING_TSTAMP_TYPE_NOTSUP   3 /* the requested time stamp type is not supported */
 
#define PCAP_NETMASK_UNKNOWN   0xffffffff
 
#define PCAP_CHAR_ENC_LOCAL   0x00000000U /* strings are in the local character encoding */
 
#define PCAP_CHAR_ENC_UTF_8   0x00000001U /* strings are in UTF-8 */
 
#define PCAP_TSTAMP_HOST   0 /* host-provided, unknown characteristics */
 
#define PCAP_TSTAMP_HOST_LOWPREC   1 /* host-provided, low precision, synced with the system clock */
 
#define PCAP_TSTAMP_HOST_HIPREC   2 /* host-provided, high precision, synced with the system clock */
 
#define PCAP_TSTAMP_ADAPTER   3 /* device-provided, synced with the system clock */
 
#define PCAP_TSTAMP_ADAPTER_UNSYNCED   4 /* device-provided, not synced with the system clock */
 
#define PCAP_TSTAMP_HOST_HIPREC_UNSYNCED   5 /* host-provided, high precision, not synced with the system clock */
 
#define PCAP_TSTAMP_PRECISION_MICRO   0 /* use timestamps with microsecond precision, default */
 
#define PCAP_TSTAMP_PRECISION_NANO   1 /* use timestamps with nanosecond precision */
 
#define PCAP_BUF_SIZE   1024
 
#define PCAP_SRC_FILE   2 /* local savefile */
 
#define PCAP_SRC_IFLOCAL   3 /* local network interface */
 
#define PCAP_SRC_IFREMOTE   4 /* interface on a remote host, using RPCAP */
 
#define PCAP_SRC_FILE_STRING   "file://"
 
#define PCAP_SRC_IF_STRING   "rpcap://"
 
#define PCAP_OPENFLAG_PROMISCUOUS   0x00000001
 
#define PCAP_OPENFLAG_DATATX_UDP   0x00000002
 
#define PCAP_OPENFLAG_NOCAPTURE_RPCAP   0x00000004
 
#define PCAP_OPENFLAG_NOCAPTURE_LOCAL   0x00000008
 
#define PCAP_OPENFLAG_MAX_RESPONSIVENESS   0x00000010
 
#define RPCAP_RMTAUTH_NULL   0
 
#define RPCAP_RMTAUTH_PWD   1
 
#define PCAP_SAMP_NOSAMP   0
 
#define PCAP_SAMP_1_EVERY_N   1
 
#define PCAP_SAMP_FIRST_AFTER_N_MS   2
 
#define RPCAP_HOSTLIST_SIZE   1024
 

Typedefs

typedef struct pcap pcap_t
 
typedef struct pcap_dumper pcap_dumper_t
 
typedef struct pcap_if pcap_if_t
 
typedef struct 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

int pcap_init (unsigned int, char *)
 
char * pcap_lookupdev (char *)
 
int pcap_lookupnet (const char *, bpf_u_int32 *, bpf_u_int32 *, char *)
 
pcap_tpcap_create (const char *, char *)
 
int pcap_set_snaplen (pcap_t *, int)
 
int pcap_set_promisc (pcap_t *, int)
 
int pcap_can_set_rfmon (pcap_t *)
 
int pcap_set_rfmon (pcap_t *, int)
 
int pcap_set_timeout (pcap_t *, int)
 
int pcap_set_tstamp_type (pcap_t *, int)
 
int pcap_set_immediate_mode (pcap_t *, int)
 
int pcap_set_buffer_size (pcap_t *, int)
 
int pcap_set_tstamp_precision (pcap_t *, int)
 
int pcap_get_tstamp_precision (pcap_t *)
 
int pcap_activate (pcap_t *)
 
int pcap_list_tstamp_types (pcap_t *, int **)
 
void pcap_free_tstamp_types (int *)
 
int pcap_tstamp_type_name_to_val (const char *)
 
const char * pcap_tstamp_type_val_to_name (int)
 
const char * pcap_tstamp_type_val_to_description (int)
 
pcap_tpcap_open_live (const char *, int, int, int, char *)
 
pcap_tpcap_open_dead (int, int)
 
pcap_tpcap_open_dead_with_tstamp_precision (int, int, u_int)
 
pcap_tpcap_open_offline_with_tstamp_precision (const char *, u_int, char *)
 
pcap_tpcap_open_offline (const char *, char *)
 
pcap_tpcap_fopen_offline_with_tstamp_precision (FILE *, u_int, 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 *)
 
int pcap_inject (pcap_t *, const void *, size_t)
 
int pcap_sendpacket (pcap_t *, const u_char *, int)
 
const char * pcap_statustostr (int)
 
const char * pcap_strerror (int)
 
char * pcap_geterr (pcap_t *)
 
void pcap_perror (pcap_t *, const char *)
 
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)
 
void pcap_freecode (struct bpf_program *)
 
int pcap_offline_filter (const struct bpf_program *, const struct pcap_pkthdr *, const u_char *)
 
int pcap_datalink (pcap_t *)
 
int pcap_datalink_ext (pcap_t *)
 
int pcap_list_datalinks (pcap_t *, int **)
 
int pcap_set_datalink (pcap_t *, int)
 
void pcap_free_datalinks (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)
 
const char * pcap_datalink_val_to_description_or_dlt (int)
 
int pcap_snapshot (pcap_t *)
 
int pcap_is_swapped (pcap_t *)
 
int pcap_major_version (pcap_t *)
 
int pcap_minor_version (pcap_t *)
 
int pcap_bufsize (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)
 
pcap_dumper_tpcap_dump_open_append (pcap_t *, const char *)
 
FILE * pcap_dump_file (pcap_dumper_t *)
 
long pcap_dump_ftell (pcap_dumper_t *)
 
int64_t pcap_dump_ftell64 (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)
 
int pcap_get_selectable_fd (pcap_t *)
 
const struct timeval * pcap_get_required_select_timeout (pcap_t *)
 
pcap_tpcap_open (const char *source, int snaplen, int flags, int read_timeout, struct pcap_rmtauth *auth, char *errbuf)
 
int pcap_createsrcstr (char *source, int type, const char *host, const char *port, const char *name, char *errbuf)
 
int pcap_parsesrcstr (const char *source, int *type, char *host, char *port, char *name, char *errbuf)
 
int pcap_findalldevs_ex (const char *source, struct pcap_rmtauth *auth, pcap_if_t **alldevs, char *errbuf)
 
struct pcap_samppcap_setsampling (pcap_t *p)
 
int pcap_remoteact_accept (const char *address, const char *port, const char *hostlist, char *connectinghost, struct pcap_rmtauth *auth, char *errbuf)
 
int pcap_remoteact_accept_ex (const char *address, const char *port, const char *hostlist, char *connectinghost, struct pcap_rmtauth *auth, int uses_ssl, char *errbuf)
 
int pcap_remoteact_list (char *hostlist, char sep, int size, char *errbuf)
 
int pcap_remoteact_close (const char *host, char *errbuf)
 
void pcap_remoteact_cleanup (void)
 

Macro Definition Documentation

◆ LT_FCS_DATALINK_EXT

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

Definition at line 225 of file pcap.h.

◆ LT_FCS_LENGTH

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

Definition at line 224 of file pcap.h.

◆ LT_FCS_LENGTH_PRESENT

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

Definition at line 223 of file pcap.h.

◆ PCAP_BUF_SIZE

#define PCAP_BUF_SIZE   1024

Definition at line 869 of file pcap.h.

◆ PCAP_CHAR_ENC_LOCAL

#define PCAP_CHAR_ENC_LOCAL   0x00000000U /* strings are in the local character encoding */

Definition at line 382 of file pcap.h.

◆ PCAP_CHAR_ENC_UTF_8

#define PCAP_CHAR_ENC_UTF_8   0x00000001U /* strings are in UTF-8 */

Definition at line 383 of file pcap.h.

◆ PCAP_ERRBUF_SIZE

#define PCAP_ERRBUF_SIZE   256

Definition at line 152 of file pcap.h.

◆ PCAP_ERROR

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

Definition at line 339 of file pcap.h.

◆ PCAP_ERROR_ACTIVATED

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

Definition at line 342 of file pcap.h.

◆ PCAP_ERROR_BREAK

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

Definition at line 340 of file pcap.h.

◆ PCAP_ERROR_CANTSET_TSTAMP_TYPE

#define PCAP_ERROR_CANTSET_TSTAMP_TYPE   -10 /* this device doesn't support setting the time stamp type */

Definition at line 348 of file pcap.h.

◆ PCAP_ERROR_IFACE_NOT_UP

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

Definition at line 347 of file pcap.h.

◆ PCAP_ERROR_NO_SUCH_DEVICE

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

Definition at line 343 of file pcap.h.

◆ PCAP_ERROR_NOT_ACTIVATED

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

Definition at line 341 of file pcap.h.

◆ PCAP_ERROR_NOT_RFMON

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

Definition at line 345 of file pcap.h.

◆ PCAP_ERROR_PERM_DENIED

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

Definition at line 346 of file pcap.h.

◆ PCAP_ERROR_PROMISC_PERM_DENIED

#define PCAP_ERROR_PROMISC_PERM_DENIED   -11 /* you don't have permission to capture in promiscuous mode */

Definition at line 349 of file pcap.h.

◆ PCAP_ERROR_RFMON_NOTSUP

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

Definition at line 344 of file pcap.h.

◆ PCAP_ERROR_TSTAMP_PRECISION_NOTSUP

#define PCAP_ERROR_TSTAMP_PRECISION_NOTSUP   -12 /* the requested time stamp precision is not supported */

Definition at line 350 of file pcap.h.

◆ PCAP_IF_CONNECTION_STATUS

#define PCAP_IF_CONNECTION_STATUS   0x00000030 /* connection status: */

Definition at line 313 of file pcap.h.

◆ PCAP_IF_CONNECTION_STATUS_CONNECTED

#define PCAP_IF_CONNECTION_STATUS_CONNECTED   0x00000010 /* connected */

Definition at line 315 of file pcap.h.

◆ PCAP_IF_CONNECTION_STATUS_DISCONNECTED

#define PCAP_IF_CONNECTION_STATUS_DISCONNECTED   0x00000020 /* disconnected */

Definition at line 316 of file pcap.h.

◆ PCAP_IF_CONNECTION_STATUS_NOT_APPLICABLE

#define PCAP_IF_CONNECTION_STATUS_NOT_APPLICABLE   0x00000030 /* not applicable */

Definition at line 317 of file pcap.h.

◆ PCAP_IF_CONNECTION_STATUS_UNKNOWN

#define PCAP_IF_CONNECTION_STATUS_UNKNOWN   0x00000000 /* unknown */

Definition at line 314 of file pcap.h.

◆ PCAP_IF_LOOPBACK

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

Definition at line 309 of file pcap.h.

◆ PCAP_IF_RUNNING

#define PCAP_IF_RUNNING   0x00000004 /* interface is running */

Definition at line 311 of file pcap.h.

◆ PCAP_IF_UP

#define PCAP_IF_UP   0x00000002 /* interface is up */

Definition at line 310 of file pcap.h.

◆ PCAP_IF_WIRELESS

#define PCAP_IF_WIRELESS   0x00000008 /* interface is wireless (*NOT* necessarily Wi-Fi!) */

Definition at line 312 of file pcap.h.

◆ PCAP_NETMASK_UNKNOWN

#define PCAP_NETMASK_UNKNOWN   0xffffffff

Definition at line 365 of file pcap.h.

◆ PCAP_OPENFLAG_DATATX_UDP

#define PCAP_OPENFLAG_DATATX_UDP   0x00000002

Definition at line 952 of file pcap.h.

◆ PCAP_OPENFLAG_MAX_RESPONSIVENESS

#define PCAP_OPENFLAG_MAX_RESPONSIVENESS   0x00000010

Definition at line 993 of file pcap.h.

◆ PCAP_OPENFLAG_NOCAPTURE_LOCAL

#define PCAP_OPENFLAG_NOCAPTURE_LOCAL   0x00000008

Definition at line 977 of file pcap.h.

◆ PCAP_OPENFLAG_NOCAPTURE_RPCAP

#define PCAP_OPENFLAG_NOCAPTURE_RPCAP   0x00000004

Definition at line 966 of file pcap.h.

◆ PCAP_OPENFLAG_PROMISCUOUS

#define PCAP_OPENFLAG_PROMISCUOUS   0x00000001

Definition at line 938 of file pcap.h.

◆ PCAP_SAMP_1_EVERY_N

#define PCAP_SAMP_1_EVERY_N   1

Definition at line 1143 of file pcap.h.

◆ PCAP_SAMP_FIRST_AFTER_N_MS

#define PCAP_SAMP_FIRST_AFTER_N_MS   2

Definition at line 1154 of file pcap.h.

◆ PCAP_SAMP_NOSAMP

#define PCAP_SAMP_NOSAMP   0

Definition at line 1132 of file pcap.h.

◆ PCAP_SRC_FILE

#define PCAP_SRC_FILE   2 /* local savefile */

Definition at line 874 of file pcap.h.

◆ PCAP_SRC_FILE_STRING

#define PCAP_SRC_FILE_STRING   "file://"

Definition at line 922 of file pcap.h.

◆ PCAP_SRC_IF_STRING

#define PCAP_SRC_IF_STRING   "rpcap://"

Definition at line 929 of file pcap.h.

◆ PCAP_SRC_IFLOCAL

#define PCAP_SRC_IFLOCAL   3 /* local network interface */

Definition at line 875 of file pcap.h.

◆ PCAP_SRC_IFREMOTE

#define PCAP_SRC_IFREMOTE   4 /* interface on a remote host, using RPCAP */

Definition at line 876 of file pcap.h.

◆ PCAP_TSTAMP_ADAPTER

#define PCAP_TSTAMP_ADAPTER   3 /* device-provided, synced with the system clock */

Definition at line 501 of file pcap.h.

◆ PCAP_TSTAMP_ADAPTER_UNSYNCED

#define PCAP_TSTAMP_ADAPTER_UNSYNCED   4 /* device-provided, not synced with the system clock */

Definition at line 502 of file pcap.h.

◆ PCAP_TSTAMP_HOST

#define PCAP_TSTAMP_HOST   0 /* host-provided, unknown characteristics */

Definition at line 498 of file pcap.h.

◆ PCAP_TSTAMP_HOST_HIPREC

#define PCAP_TSTAMP_HOST_HIPREC   2 /* host-provided, high precision, synced with the system clock */

Definition at line 500 of file pcap.h.

◆ PCAP_TSTAMP_HOST_HIPREC_UNSYNCED

#define PCAP_TSTAMP_HOST_HIPREC_UNSYNCED   5 /* host-provided, high precision, not synced with the system clock */

Definition at line 503 of file pcap.h.

◆ PCAP_TSTAMP_HOST_LOWPREC

#define PCAP_TSTAMP_HOST_LOWPREC   1 /* host-provided, low precision, synced with the system clock */

Definition at line 499 of file pcap.h.

◆ PCAP_TSTAMP_PRECISION_MICRO

#define PCAP_TSTAMP_PRECISION_MICRO   0 /* use timestamps with microsecond precision, default */

Definition at line 511 of file pcap.h.

◆ PCAP_TSTAMP_PRECISION_NANO

#define PCAP_TSTAMP_PRECISION_NANO   1 /* use timestamps with nanosecond precision */

Definition at line 512 of file pcap.h.

◆ PCAP_VERSION_MAJOR

#define PCAP_VERSION_MAJOR   2

Definition at line 149 of file pcap.h.

◆ PCAP_VERSION_MINOR

#define PCAP_VERSION_MINOR   4

Definition at line 150 of file pcap.h.

◆ PCAP_WARNING

#define PCAP_WARNING   1 /* generic warning code */

Definition at line 357 of file pcap.h.

◆ PCAP_WARNING_PROMISC_NOTSUP

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

Definition at line 358 of file pcap.h.

◆ PCAP_WARNING_TSTAMP_TYPE_NOTSUP

#define PCAP_WARNING_TSTAMP_TYPE_NOTSUP   3 /* the requested time stamp type is not supported */

Definition at line 359 of file pcap.h.

◆ RPCAP_HOSTLIST_SIZE

#define RPCAP_HOSTLIST_SIZE   1024

Definition at line 1193 of file pcap.h.

◆ RPCAP_RMTAUTH_NULL

#define RPCAP_RMTAUTH_NULL   0

Definition at line 1007 of file pcap.h.

◆ RPCAP_RMTAUTH_PWD

#define RPCAP_RMTAUTH_PWD   1

Definition at line 1021 of file pcap.h.

Typedef Documentation

◆ pcap_addr_t

typedef struct pcap_addr pcap_addr_t

Definition at line 1 of file pcap.h.

◆ pcap_dumper_t

typedef struct pcap_dumper pcap_dumper_t

Definition at line 1 of file pcap.h.

◆ pcap_handler

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

Definition at line 330 of file pcap.h.

◆ pcap_if_t

typedef struct pcap_if pcap_if_t

Definition at line 1 of file pcap.h.

◆ pcap_t

typedef struct pcap pcap_t

Definition at line 1 of file pcap.h.

Enumeration Type Documentation

◆ pcap_direction_t

Enumerator
PCAP_D_INOUT 
PCAP_D_IN 
PCAP_D_OUT 

Definition at line 227 of file pcap.h.

Function Documentation

◆ pcap_activate()

◆ pcap_breakloop()

void pcap_breakloop ( pcap_t p)

Definition at line 2921 of file pcap.c.

References pcap::breakloop_op.

Referenced by main(), session_close(), sigint_handler(), and stop_capture().

◆ pcap_bufsize()

int pcap_bufsize ( pcap_t p)

Definition at line 3443 of file pcap.c.

References pcap::activated, pcap::bufsize, and PCAP_ERROR_NOT_ACTIVATED.

Referenced by daemon_msg_startcap_req().

◆ pcap_can_set_rfmon()

int pcap_can_set_rfmon ( pcap_t p)

Definition at line 500 of file pcap.c.

References pcap::can_set_rfmon_op.

Referenced by main().

◆ pcap_close()

◆ pcap_compile()

◆ pcap_compile_nopcap()

int pcap_compile_nopcap ( int  snaplen_arg,
int  linktype_arg,
struct bpf_program program,
const char *  buf,
int  optimize,
bpf_u_int32  mask 
)

Definition at line 880 of file gencode.c.

References pcap_close(), pcap_compile(), and pcap_open_dead().

◆ pcap_create()

◆ pcap_createsrcstr()

int pcap_createsrcstr ( char *  source,
int  type,
const char *  host,
const char *  port,
const char *  name,
char *  errbuf 
)

Referenced by pcap_findalldevs_ex().

◆ pcap_datalink()

int pcap_datalink ( pcap_t p)

Definition at line 2927 of file pcap.c.

References pcap::activated, pcap::linktype, and PCAP_ERROR_NOT_ACTIVATED.

Referenced by daemon_msg_open_req(), init_linktype(), and main().

◆ pcap_datalink_ext()

int pcap_datalink_ext ( pcap_t p)

Definition at line 2935 of file pcap.c.

References pcap::activated, pcap::linktype_ext, and PCAP_ERROR_NOT_ACTIVATED.

◆ pcap_datalink_name_to_val()

int pcap_datalink_name_to_val ( const char *  name)

Definition at line 3308 of file pcap.c.

References dlt_choice::dlt, dlt_choices, dlt_choice::name, and pcap_strcasecmp().

Referenced by main().

◆ pcap_datalink_val_to_description()

const char* pcap_datalink_val_to_description ( int  dlt)

◆ pcap_datalink_val_to_description_or_dlt()

const char* pcap_datalink_val_to_description_or_dlt ( int  dlt)

◆ pcap_datalink_val_to_name()

const char* pcap_datalink_val_to_name ( int  dlt)

Definition at line 3320 of file pcap.c.

References dlt_choice::dlt, dlt_choices, and dlt_choice::name.

Referenced by main(), and pcap_set_datalink().

◆ pcap_dispatch()

int pcap_dispatch ( pcap_t p,
int  cnt,
pcap_handler  callback,
u_char *  user 
)

Definition at line 2882 of file pcap.c.

References pcap::read_op.

Referenced by capture_thread_func(), main(), and pcap_next().

◆ pcap_dump()

void pcap_dump ( u_char *  user,
const struct pcap_pkthdr h,
const u_char *  sp 
)

◆ pcap_dump_close()

void pcap_dump_close ( pcap_dumper_t p)

Definition at line 1155 of file sf-pcap.c.

References error().

◆ pcap_dump_file()

FILE* pcap_dump_file ( pcap_dumper_t p)

Definition at line 1094 of file sf-pcap.c.

◆ pcap_dump_flush()

int pcap_dump_flush ( pcap_dumper_t p)

Definition at line 1145 of file sf-pcap.c.

◆ pcap_dump_fopen()

pcap_dumper_t* pcap_dump_fopen ( pcap_t p,
FILE *  fp 
)

◆ pcap_dump_ftell()

long pcap_dump_ftell ( pcap_dumper_t p)

Definition at line 1100 of file sf-pcap.c.

◆ pcap_dump_ftell64()

int64_t pcap_dump_ftell64 ( pcap_dumper_t p)

Definition at line 1138 of file sf-pcap.c.

◆ pcap_dump_open()

pcap_dumper_t* pcap_dump_open ( pcap_t p,
const char *  fname 
)

◆ pcap_dump_open_append()

◆ pcap_file()

FILE* pcap_file ( pcap_t p)

Definition at line 3451 of file pcap.c.

References pcap::rfile.

◆ pcap_fileno()

int pcap_fileno ( pcap_t p)

Definition at line 3478 of file pcap.c.

References pcap::fd.

Referenced by main().

◆ pcap_findalldevs()

◆ pcap_findalldevs_ex()

◆ pcap_fopen_offline()

pcap_t* pcap_fopen_offline ( FILE *  fp,
char *  errbuf 
)

◆ pcap_fopen_offline_with_tstamp_precision()

◆ pcap_free_datalinks()

void pcap_free_datalinks ( int *  dlt_list)

Definition at line 2987 of file pcap.c.

Referenced by main().

◆ pcap_free_tstamp_types()

void pcap_free_tstamp_types ( int *  tstamp_type_list)

Definition at line 568 of file pcap.c.

◆ pcap_freealldevs()

◆ pcap_freecode()

◆ pcap_get_required_select_timeout()

const struct timeval* pcap_get_required_select_timeout ( pcap_t p)

Definition at line 3492 of file pcap.c.

References pcap::required_select_timeout.

Referenced by main().

◆ pcap_get_selectable_fd()

int pcap_get_selectable_fd ( pcap_t p)

Definition at line 3486 of file pcap.c.

References pcap::selectable_fd.

Referenced by main().

◆ pcap_get_tstamp_precision()

int pcap_get_tstamp_precision ( pcap_t p)

Definition at line 2702 of file pcap.c.

References pcap::opt, and pcap_opt::tstamp_precision.

◆ pcap_geterr()

char* pcap_geterr ( pcap_t p)

◆ pcap_getnonblock()

int pcap_getnonblock ( pcap_t p,
char *  errbuf 
)

Definition at line 3511 of file pcap.c.

References pcap::errbuf, pcap::getnonblock_op, PCAP_ERRBUF_SIZE, and pcap_strlcpy().

◆ pcap_init()

int pcap_init ( unsigned int  opts,
char *  errbuf 
)

◆ pcap_inject()

int pcap_inject ( pcap_t p,
const void *  buf,
size_t  size 
)

◆ pcap_is_swapped()

int pcap_is_swapped ( pcap_t p)

Definition at line 3419 of file pcap.c.

References pcap::activated, PCAP_ERROR_NOT_ACTIVATED, and pcap::swapped.

◆ pcap_lib_version()

const char* pcap_lib_version ( void  )

Definition at line 3590 of file pcap-bpf.c.

References pcap_asprintf(), pcap_lib_version_string, and PCAP_VERSION_STRING.

Referenced by dag_get_datalink(), printusage(), and usage().

◆ pcap_list_datalinks()

int pcap_list_datalinks ( pcap_t p,
int **  dlt_buffer 
)

◆ pcap_list_tstamp_types()

int pcap_list_tstamp_types ( pcap_t p,
int **  tstamp_typesp 
)

◆ pcap_lookupdev()

◆ pcap_lookupnet()

int pcap_lookupnet ( const char *  device,
bpf_u_int32 localnet,
bpf_u_int32 netmask,
char *  errbuf 
)

◆ pcap_loop()

int pcap_loop ( pcap_t p,
int  cnt,
pcap_handler  callback,
u_char *  user 
)

Definition at line 2888 of file pcap.c.

References PACKET_COUNT_IS_UNLIMITED, pcap_offline_read(), pcap::read_op, and pcap::rfile.

◆ pcap_major_version()

int pcap_major_version ( pcap_t p)

Definition at line 3427 of file pcap.c.

References pcap::activated, PCAP_ERROR_NOT_ACTIVATED, and pcap::version_major.

◆ pcap_minor_version()

int pcap_minor_version ( pcap_t p)

Definition at line 3435 of file pcap.c.

References pcap::activated, PCAP_ERROR_NOT_ACTIVATED, and pcap::version_minor.

◆ pcap_next()

const u_char* pcap_next ( pcap_t p,
struct pcap_pkthdr h 
)

◆ pcap_next_ex()

int pcap_next_ex ( pcap_t p,
struct pcap_pkthdr **  pkt_header,
const u_char **  pkt_data 
)

◆ pcap_offline_filter()

int pcap_offline_filter ( const struct bpf_program fp,
const struct pcap_pkthdr h,
const u_char *  pkt 
)

Definition at line 4155 of file pcap.c.

References bpf_program::bf_insns, pcap_pkthdr::caplen, pcap_pkthdr::len, and pcap_filter().

Referenced by LLVMFuzzerTestOneInput().

◆ pcap_open()

◆ pcap_open_dead()

pcap_t* pcap_open_dead ( int  linktype,
int  snaplen 
)

◆ pcap_open_dead_with_tstamp_precision()

◆ pcap_open_live()

◆ pcap_open_offline()

pcap_t* pcap_open_offline ( const char *  fname,
char *  errbuf 
)

◆ pcap_open_offline_with_tstamp_precision()

pcap_t* pcap_open_offline_with_tstamp_precision ( const char *  fname,
u_int  precision,
char *  errbuf 
)

◆ pcap_parsesrcstr()

int pcap_parsesrcstr ( const char *  source,
int *  type,
char *  host,
char *  port,
char *  name,
char *  errbuf 
)

◆ pcap_perror()

void pcap_perror ( pcap_t p,
const char *  prefix 
)

Definition at line 3499 of file pcap.c.

References pcap::errbuf.

◆ pcap_remoteact_accept()

int pcap_remoteact_accept ( const char *  address,
const char *  port,
const char *  hostlist,
char *  connectinghost,
struct pcap_rmtauth auth,
char *  errbuf 
)

Definition at line 2974 of file pcap-rpcap.c.

References address, hostlist, pcap_remoteact_accept_ex(), and port.

◆ pcap_remoteact_accept_ex()

◆ pcap_remoteact_cleanup()

void pcap_remoteact_cleanup ( void  )

Definition at line 3094 of file pcap-rpcap.c.

References closesocket, sock_cleanup(), sockmain, and ssl_main.

◆ pcap_remoteact_close()

◆ pcap_remoteact_list()

int pcap_remoteact_list ( char *  hostlist,
char  sep,
int  size,
char *  errbuf 
)

◆ pcap_sendpacket()

int pcap_sendpacket ( pcap_t p,
const u_char *  buf,
int  size 
)

◆ pcap_set_buffer_size()

int pcap_set_buffer_size ( pcap_t p,
int  buffer_size 
)

Definition at line 2638 of file pcap.c.

References pcap_opt::buffer_size, pcap::opt, pcap_check_activated(), and PCAP_ERROR_ACTIVATED.

Referenced by main().

◆ pcap_set_datalink()

int pcap_set_datalink ( pcap_t p,
int  dlt 
)

◆ pcap_set_immediate_mode()

int pcap_set_immediate_mode ( pcap_t p,
int  immediate 
)

Definition at line 2629 of file pcap.c.

References pcap_opt::immediate, pcap::opt, pcap_check_activated(), and PCAP_ERROR_ACTIVATED.

Referenced by main(), and pcap_open().

◆ pcap_set_promisc()

int pcap_set_promisc ( pcap_t p,
int  promisc 
)

Definition at line 2557 of file pcap.c.

References pcap::opt, pcap_check_activated(), PCAP_ERROR_ACTIVATED, and pcap_opt::promisc.

Referenced by main(), pcap_open(), and pcap_open_live().

◆ pcap_set_rfmon()

int pcap_set_rfmon ( pcap_t p,
int  rfmon 
)

Definition at line 2566 of file pcap.c.

References pcap::opt, pcap_check_activated(), PCAP_ERROR_ACTIVATED, and pcap_opt::rfmon.

Referenced by main().

◆ pcap_set_snaplen()

int pcap_set_snaplen ( pcap_t p,
int  snaplen 
)

Definition at line 2548 of file pcap.c.

References pcap_check_activated(), PCAP_ERROR_ACTIVATED, and pcap::snapshot.

Referenced by main(), open_interface(), pcap_open(), and pcap_open_live().

◆ pcap_set_timeout()

int pcap_set_timeout ( pcap_t p,
int  timeout_ms 
)

◆ pcap_set_tstamp_precision()

◆ pcap_set_tstamp_type()

◆ pcap_setdirection()

int pcap_setdirection ( pcap_t p,
pcap_direction_t  d 
)

◆ pcap_setfilter()

int pcap_setfilter ( pcap_t p,
struct bpf_program fp 
)

Definition at line 3695 of file pcap.c.

References pcap::setfilter_op.

Referenced by daemon_unpackapplyfilter(), LLVMFuzzerTestOneInput(), and main().

◆ pcap_setnonblock()

int pcap_setnonblock ( pcap_t p,
int  nonblock,
char *  errbuf 
)

Definition at line 3555 of file pcap.c.

References pcap::errbuf, PCAP_ERRBUF_SIZE, pcap_strlcpy(), and pcap::setnonblock_op.

Referenced by main().

◆ pcap_setsampling()

struct pcap_samp* pcap_setsampling ( pcap_t p)

Definition at line 462 of file pcap-new.c.

◆ pcap_snapshot()

int pcap_snapshot ( pcap_t p)

Definition at line 3411 of file pcap.c.

References pcap::activated, PCAP_ERROR_NOT_ACTIVATED, and pcap::snapshot.

Referenced by daemon_thrdatamain(), and pcap_compile().

◆ pcap_stats()

int pcap_stats ( pcap_t p,
struct pcap_stat ps 
)

◆ pcap_statustostr()

◆ pcap_strerror()

const char* pcap_strerror ( int  errnum)

◆ pcap_tstamp_type_name_to_val()

int pcap_tstamp_type_name_to_val ( const char *  name)

◆ pcap_tstamp_type_val_to_description()

const char* pcap_tstamp_type_val_to_description ( int  tstamp_type)

◆ pcap_tstamp_type_val_to_name()

const char* pcap_tstamp_type_val_to_name ( int  tstamp_type)

Definition at line 3387 of file pcap.c.

References tstamp_type_choice::name, tstamp_type_choices, and tstamp_type_choice::type.