#include <net/bpf_private.h>
net/bpf_private.h
structbpf_setup_args
| uuid_t | bsa_uuid | |
| char[16] | bsa_ifname |
structbpf_comp_stats
| uint64_t | bcs_total_read | number of packets read from device |
| uint64_t | bcs_total_size | total size of filtered packets |
| uint64_t | bcs_total_hdr_size | total header size of captured packets |
| uint64_t | bcs_count_no_common_prefix | count of packets not compressible |
| uint64_t | bcs_count_compressed_prefix | count of compressed packets |
| uint64_t | bcs_total_compressed_prefix_size | total size of compressed data |
| uint64_t | bcs_max_compressed_prefix_size | max compressed data size |
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.
| struct timeval32 | bh_tstamp | time stamp |
| bpf_u_int32 | bh_caplen | length of captured portion |
| bpf_u_int32 | bh_datalen | original length of packet |
| u_short | bh_hdrlen | length of bpf header |
| u_char | bh_complen | |
| u_char | bh_flags | |
| pid_t | bh_pid | process PID |
| char[17] | bh_comm | process command |
| u_char | bh_pktflags | |
| uint16_t | bh_trace_tag | |
| bpf_u_int32 | bh_svc | service class |
| bpf_u_int32 | bh_flowid | kernel reserved; 0 in userland |
| bpf_u_int32 | bh_unsent_bytes | unsent bytes at interface |
| bpf_u_int32 | bh_unsent_snd | unsent bytes at socket buffer |
| bpf_u_int32 | bh_comp_gencnt | unsent 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
| uint32_t | bd_structsize | Size of this structure. |
| int32_t | bd_dev_minor | |
| int32_t | bd_sig | |
| uint32_t | bd_slen | |
| uint32_t | bd_hlen | |
| uint32_t | bd_bufsize | |
| pid_t | bd_pid | |
| uint8_t | bd_promisc | |
| uint8_t | bd_immediate | |
| uint8_t | bd_hdrcmplt | |
| uint8_t | bd_async | |
| uint8_t | bd_headdrop | |
| uint8_t | bd_direction | |
| uint8_t | bh_compreq | |
| uint8_t | bh_compenabled | |
| uint8_t | bd_exthdr | |
| uint8_t | bd_trunc | |
| uint8_t | bd_pkthdrv2 | |
| uint8_t:1 | bd_batch_write | |
| uint8_t:1 | bd_divert_in | |
| uint8_t:6 | bd_padding | |
| uint64_t | bd_rcount | |
| uint64_t | bd_dcount | |
| uint64_t | bd_fcount | |
| uint64_t | bd_wcount | |
| uint64_t | bd_wdcount | |
| char[16] | bd_ifname | |
| uint64_t | bd_comp_count | |
| uint64_t | bd_comp_size | |
| uint32_t | bd_scnt | number of packets in store buffer |
| uint32_t | bd_hcnt | number of packets in hold buffer |
| uint64_t | bd_read_count | |
| uint64_t | bd_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
| struct timeval32 | bh_tstamp | time stamp |
| bpf_u_int32 | bh_caplen | length of captured portion |
| bpf_u_int32 | bh_datalen | original length of packet |
| u_short | bh_hdrlen | length of bpf header (this struct plus alignment padding) |
| u_char | bh_complen | data portion compressed |
| u_char | bh_padding | data portion compressed |
macroHAS_BPF_HDR_COMP
#define HAS_BPF_HDR_COMP 1
macroBPF_HDR_COMP_LEN_MAX
#define BPF_HDR_COMP_LEN_MAX 255
macroDLT_USER0_APPLE_INTERNAL
For Apple private usage
#define DLT_USER0_APPLE_INTERNAL DLT_USER0
rdar://12019509