github.com/google/syzkaller@v0.0.0-20240517125934-c0f1611a36d6/sys/openbsd/dev_bpf.txt (about) 1 # Copyright 2019 syzkaller project authors. All rights reserved. 2 # Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. 3 4 include <sys/types.h> 5 include <sys/time.h> 6 include <sys/fcntl.h> 7 include <sys/ioctl.h> 8 include <net/bpf.h> 9 include <net/if.h> 10 11 resource fd_bpf[fd] 12 13 openat$bpf(fd const[AT_FDCWD], file ptr[in, string["/dev/bpf"]], flags flags[open_flags], mode const[0]) fd_bpf 14 15 ioctl$BIOCFLUSH(fd fd_bpf, cmd const[BIOCFLUSH]) 16 ioctl$BIOCGBLEN(fd fd_bpf, cmd const[BIOCGBLEN], arg ptr[out, int32]) 17 ioctl$BIOCGDIRFILT(fd fd_bpf, cmd const[BIOCGDIRFILT], arg ptr[out, int32]) 18 ioctl$BIOCGDLTLIST(fd fd_bpf, cmd const[BIOCGDLTLIST], arg ptr[out, bpf_dltlist]) 19 ioctl$BIOCGETIF(fd fd_bpf, cmd const[BIOCGETIF], arg ptr[out, ifreq]) 20 ioctl$BIOCGFILDROP(fd fd_bpf, cmd const[BIOCGFILDROP], arg ptr[out, int32]) 21 ioctl$BIOCGHDRCMPLT(fd fd_bpf, cmd const[BIOCGHDRCMPLT], arg ptr[out, int32]) 22 ioctl$BIOCGRSIG(fd fd_bpf, cmd const[BIOCGRSIG], arg ptr[out, int32]) 23 ioctl$BIOCGRTIMEOUT(fd fd_bpf, cmd const[BIOCGRTIMEOUT], arg ptr[out, timeval]) 24 ioctl$BIOCGSTATS(fd fd_bpf, cmd const[BIOCGSTATS], arg ptr[out, bpf_stat]) 25 ioctl$BIOCIMMEDIATE(fd fd_bpf, cmd const[BIOCIMMEDIATE], arg ptr[in, int32]) 26 ioctl$BIOCLOCK(fd fd_bpf, cmd const[BIOCLOCK]) 27 ioctl$BIOCPROMISC(fd fd_bpf, cmd const[BIOCPROMISC]) 28 ioctl$BIOCSBLEN(fd fd_bpf, cmd const[BIOCSBLEN], arg ptr[in, int32]) 29 ioctl$BIOCSDIRFILT(fd fd_bpf, cmd const[BIOCSDIRFILT], arg ptr[in, int32]) 30 ioctl$BIOCSDLT(fd fd_bpf, cmd const[BIOCSDLT], arg ptr[in, int32]) 31 ioctl$BIOCSETF(fd fd_bpf, cmd const[BIOCSETF], arg ptr[in, bpf_program]) 32 ioctl$BIOCSETIF(fd fd_bpf, cmd const[BIOCSETIF], arg ptr[in, ifreq_name]) 33 ioctl$BIOCSETWF(fd fd_bpf, cmd const[BIOCSETWF], arg ptr[in, bpf_program]) 34 ioctl$BIOCSFILDROP(fd fd_bpf, cmd const[BIOCSFILDROP], arg ptr[in, int32]) 35 ioctl$BIOCSHDRCMPLT(fd fd_bpf, cmd const[BIOCSHDRCMPLT], arg ptr[in, int32]) 36 ioctl$BIOCSRSIG(fd fd_bpf, cmd const[BIOCSRSIG], arg ptr[in, int32]) 37 ioctl$BIOCSRTIMEOUT(fd fd_bpf, cmd const[BIOCSRTIMEOUT], arg ptr[in, timeval]) 38 ioctl$BIOCVERSION(fd fd_bpf, cmd const[BIOCVERSION], arg ptr[out, bpf_version]) 39 40 bpf_dltlist { 41 bfl_len len[bfl_list, int32] 42 bfl_list ptr[in, array[int32]] 43 } 44 45 bf_insns { 46 code int16 47 jt int8 48 jf int8 49 k int32 50 } 51 52 bpf_program { 53 bf_len len[bf_insns, int32] 54 bf_insns ptr[in, array[bf_insns]] 55 } 56 57 bpf_stat { 58 bs_recv int32 59 bs_drop int32 60 } 61 62 bpf_version { 63 bv_major int16 64 bv_minor int16 65 } 66 67 ifreq { 68 ifr_name string[filename, IFNAMSIZ] 69 ifr_ifru ifr_ifru 70 } 71 72 ifreq_name { 73 ifr_name stringnoz["tap"] 74 tapindex proc['0', 1, int8] 75 z const[0, int8] 76 } [size[IFREQ_SIZE]] 77 78 define IFREQ_SIZE sizeof(struct ifreq) 79 80 ifr_ifru [ 81 ifru_addr sockaddr_storage 82 ifru_dstaddr sockaddr_storage 83 ifru_broadaddr sockaddr_storage 84 ifru_flags int16 85 ifru_metric int32 86 ifru_vnetid int64 87 ifru_media int64 88 ifru_data buffer[in] 89 ifru_index int32 90 ] [varlen]