#include <net/bpf_private.h>

net/bpf_private.h Kernel.framework

49 macros · 5 structs

structbpf_setup_args

size 32, align 1
uuid_tbsa_uuid
char[16]bsa_ifname

structbpf_comp_stats

size 56, align 8
uint64_tbcs_total_readnumber of packets read from device
uint64_tbcs_total_sizetotal size of filtered packets
uint64_tbcs_total_hdr_sizetotal header size of captured packets
uint64_tbcs_count_no_common_prefixcount of packets not compressible
uint64_tbcs_count_compressed_prefixcount of compressed packets
uint64_tbcs_total_compressed_prefix_sizetotal size of compressed data
uint64_tbcs_max_compressed_prefix_sizemax compressed data size

macroBIOCGETTC

#define BIOCGETTC _IOR('B', 122, int)

macroBIOCSETTC

#define BIOCSETTC _IOW('B', 123, int)

macroBIOCSEXTHDR

#define BIOCSEXTHDR _IOW('B', 124, u_int)

macroBIOCGIFATTACHCOUNT

#define BIOCGIFATTACHCOUNT _IOWR('B', 125, struct ifreq)

macroBIOCGWANTPKTAP

#define BIOCGWANTPKTAP _IOR('B', 127, u_int)

macroBIOCSWANTPKTAP

#define BIOCSWANTPKTAP _IOWR('B', 127, u_int)

macroBIOCSHEADDROP

#define BIOCSHEADDROP _IOW('B', 128, int)

macroBIOCGHEADDROP

#define BIOCGHEADDROP _IOR('B', 128, int)

macroBIOCSTRUNCATE

#define BIOCSTRUNCATE _IOW('B', 129, u_int)

macroBIOCGETUUID

#define BIOCGETUUID _IOR('B', 130, uuid_t)

macroBIOCSETUP

#define BIOCSETUP _IOW('B', 131, struct bpf_setup_args)

macroBIOCSPKTHDRV2

#define BIOCSPKTHDRV2 _IOW('B', 132, int)

macroBIOCGPKTHDRV2

#define BIOCGPKTHDRV2 _IOW('B', 133, int)

macroBIOCGHDRCOMP

#define BIOCGHDRCOMP _IOR('B', 134, int)

macroBIOCSHDRCOMP

#define BIOCSHDRCOMP _IOW('B', 135, int)

macroBIOCGHDRCOMPSTATS

#define BIOCGHDRCOMPSTATS _IOR('B', 136, struct bpf_comp_stats)

macroBIOCGHDRCOMPON

#define BIOCGHDRCOMPON _IOR('B', 137, int)

macroBIOCGDIRECTION

#define BIOCGDIRECTION _IOR('B', 138, int)

macroBIOCSDIRECTION

#define BIOCSDIRECTION _IOW('B', 139, int)

macroBIOCSWRITEMAX

#define BIOCSWRITEMAX _IOW('B', 140, u_int)

macroBIOCGWRITEMAX

#define BIOCGWRITEMAX _IOR('B', 141, u_int)

macroBIOCGBATCHWRITE

#define BIOCGBATCHWRITE _IOR('B', 142, int)

macroBIOCSBATCHWRITE

#define BIOCSBATCHWRITE _IOW('B', 143, int)

macroBIOCGNOTSTAMP

#define BIOCGNOTSTAMP _IOR('B', 144, int)

macroBIOCSNOTSTAMP

#define BIOCSNOTSTAMP _IOW('B', 145, int)

macroBIOCGDVRTIN

#define BIOCGDVRTIN _IOR('B', 146, int)

macroBIOCSDVRTIN

#define BIOCSDVRTIN _IOW('B', 146, int)

structbpf_hdr_ext

This structure must be a multiple of 4 bytes. It includes padding and spare fields that we can use later if desired.
size 64, align 4
struct timeval32bh_tstamptime stamp
bpf_u_int32bh_caplenlength of captured portion
bpf_u_int32bh_datalenoriginal length of packet
u_shortbh_hdrlenlength of bpf header
u_charbh_complen
u_charbh_flags
pid_tbh_pidprocess PID
char[17]bh_commprocess command
u_charbh_pktflags
uint16_tbh_trace_tag
bpf_u_int32bh_svcservice class
bpf_u_int32bh_flowidkernel reserved; 0 in userland
bpf_u_int32bh_unsent_bytesunsent bytes at interface
bpf_u_int32bh_unsent_sndunsent bytes at socket buffer
bpf_u_int32bh_comp_gencntunsent bytes at socket buffer

macroBPF_HDR_EXT_FLAGS_DIR_IN

#define BPF_HDR_EXT_FLAGS_DIR_IN 0x00

macroBPF_HDR_EXT_FLAGS_DIR_OUT

#define BPF_HDR_EXT_FLAGS_DIR_OUT 0x01

macroBPF_PKTFLAGS_TCP_REXMT

#define BPF_PKTFLAGS_TCP_REXMT 0x01

macroBPF_PKTFLAGS_START_SEQ

#define BPF_PKTFLAGS_START_SEQ 0x02

macroBPF_PKTFLAGS_LAST_PKT

#define BPF_PKTFLAGS_LAST_PKT 0x04

macroBPF_PKTFLAGS_WAKE_PKT

#define BPF_PKTFLAGS_WAKE_PKT 0x08

macroBPF_PKTFLAGS_ULPN

#define BPF_PKTFLAGS_ULPN 0x10

macroBPF_HDR_EXT_HAS_TRACE_TAG

#define BPF_HDR_EXT_HAS_TRACE_TAG 1

macroBPF_HDR_EXT_HAS_COMP_GENCNT

#define BPF_HDR_EXT_HAS_COMP_GENCNT 1

structxbpf_d

External representation of the bpf descriptor
size 136, align 8
uint32_tbd_structsizeSize of this structure.
int32_tbd_dev_minor
int32_tbd_sig
uint32_tbd_slen
uint32_tbd_hlen
uint32_tbd_bufsize
pid_tbd_pid
uint8_tbd_promisc
uint8_tbd_immediate
uint8_tbd_hdrcmplt
uint8_tbd_async
uint8_tbd_headdrop
uint8_tbd_direction
uint8_tbh_compreq
uint8_tbh_compenabled
uint8_tbd_exthdr
uint8_tbd_trunc
uint8_tbd_pkthdrv2
uint8_t:1bd_batch_write
uint8_t:1bd_divert_in
uint8_t:6bd_padding
uint64_tbd_rcount
uint64_tbd_dcount
uint64_tbd_fcount
uint64_tbd_wcount
uint64_tbd_wdcount
char[16]bd_ifname
uint64_tbd_comp_count
uint64_tbd_comp_size
uint32_tbd_scntnumber of packets in store buffer
uint32_tbd_hcntnumber of packets in hold buffer
uint64_tbd_read_count
uint64_tbd_fsize

macrobd_seesent

Code compatibility workaround so that old versions of network_cmds will continue to build even if netstat -B shows an incorrect value.
#define bd_seesent bd_direction

macro_HAS_STRUCT_XBPF_D_

#define _HAS_STRUCT_XBPF_D_ 2

structbpf_comp_hdr

size 20, align 4
struct timeval32bh_tstamptime stamp
bpf_u_int32bh_caplenlength of captured portion
bpf_u_int32bh_datalenoriginal length of packet
u_shortbh_hdrlenlength of bpf header (this struct plus alignment padding)
u_charbh_complendata portion compressed
u_charbh_paddingdata portion compressed

macroHAS_BPF_HDR_COMP

#define HAS_BPF_HDR_COMP 1

macroBPF_HDR_COMP_LEN_MAX

#define BPF_HDR_COMP_LEN_MAX 255

macroBPF_D_NONE

Packet tap directions
#define BPF_D_NONE 0x0
See no packet (for writing only)

macroBPF_D_IN

#define BPF_D_IN 0x1
See incoming packets

macroBPF_D_OUT

#define BPF_D_OUT 0x2
See outgoing packets

macroBPF_D_INOUT

#define BPF_D_INOUT 0x3
See incoming and outgoing packets

macroDLT_USER0_APPLE_INTERNAL

For Apple private usage
#define DLT_USER0_APPLE_INTERNAL DLT_USER0
rdar://12019509

macroDLT_USER1_APPLE_INTERNAL

#define DLT_USER1_APPLE_INTERNAL DLT_USER1
rdar://12019509

macroDLT_PKTAP

#define DLT_PKTAP DLT_USER2
rdar://11779467

macroDLT_USER3_APPLE_INTERNAL

#define DLT_USER3_APPLE_INTERNAL DLT_USER3
rdar://19614531

macroDLT_USER4_APPLE_INTERNAL

#define DLT_USER4_APPLE_INTERNAL DLT_USER4
rdar://19614531