Skip to content

Commit

Permalink
*BSD: Add ioctls for BPF/network interface operations
Browse files Browse the repository at this point in the history
  • Loading branch information
nathaniel-bennett committed Aug 16, 2024
1 parent bc3c8cb commit 385709d
Show file tree
Hide file tree
Showing 14 changed files with 379 additions and 25 deletions.
4 changes: 4 additions & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ fn test_openbsd(target: &str) {
"netinet/ip.h",
"netinet/tcp.h",
"netinet/udp.h",
"netinet6/in6_var.h",
"net/bpf.h",
"regex.h",
"resolv.h",
Expand Down Expand Up @@ -1035,6 +1036,7 @@ fn test_netbsd(target: &str) {
"netinet/ip.h",
"netinet/tcp.h",
"netinet/udp.h",
"netinet6/in6_var.h",
"poll.h",
"pthread.h",
"pwd.h",
Expand Down Expand Up @@ -1240,6 +1242,7 @@ fn test_dragonflybsd(target: &str) {
"netinet/ip.h",
"netinet/tcp.h",
"netinet/udp.h",
"netinet6/in6_var.h",
"poll.h",
"pthread.h",
"pthread_np.h",
Expand Down Expand Up @@ -2056,6 +2059,7 @@ fn test_freebsd(target: &str) {
"netinet/sctp.h",
"netinet/tcp.h",
"netinet/udp.h",
"netinet6/in6_var.h",
"poll.h",
"pthread.h",
"pthread_np.h",
Expand Down
27 changes: 27 additions & 0 deletions libc-test/semver/apple.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1313,7 +1313,32 @@ SIGINFO
SIGIO
SIGNATURE
SIGSTKSZ
SIOCADDMULTI
SIOCAIFADDR
SIOCAIFADDR_IN6
SIOCDELMULTI
SIOCDIFADDR
SIOCDIFADDR_IN6
SIOCGIFADDR
SIOCGIFBRDADDR
SIOCGIFCAP
SIOCGIFDEVMTU
SIOCGIFDSTADDR
SIOCGIFFLAGS
SIOCGIFMTU
SIOCGIFNETMASK
SIOCIFCREATE
SIOCIFCREATE2
SIOCIFDESTROY
SIOCSDRVSPEC
SIOCSIFADDR
SIOCSIFBRDADDR
SIOCSIFCAP
SIOCSIFDSTADDR
SIOCSIFFLAGS
SIOCSIFLLADDR
SIOCSIFMTU
SIOCSIFNETMASK
SOCK_MAXADDRLEN
SOCK_RAW
SOCK_RDM
Expand Down Expand Up @@ -1768,6 +1793,8 @@ backtrace_symbols_fd
basename
boolean_t
bpf_hdr
bpf_stat
bpf_version
brk
bsearch
chflags
Expand Down
43 changes: 43 additions & 0 deletions libc-test/semver/dragonfly.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,22 +82,26 @@ B14400
B28800
B7200
B76800
BIOCFEEDBACK
BIOCFLUSH
BIOCGBLEN
BIOCGDLT
BIOCGDLTLIST
BIOCGETIF
BIOCGFEEDBACK
BIOCGHDRCMPLT
BIOCGRSIG
BIOCGRTIMEOUT
BIOCGSEESENT
BIOCGSTATS
BIOCIMMEDIATE
BIOCLOCK
BIOCPROMISC
BIOCSBLEN
BIOCSDLT
BIOCSETF
BIOCSETIF
BIOCSFEEDBACK
BIOCSHDRCMPLT
BIOCSRSIG
BIOCSRTIMEOUT
Expand Down Expand Up @@ -870,6 +874,22 @@ RLIMIT_STACK
RLIMIT_VMEM
RLIM_INFINITY
RLIM_NLIMITS
RTAX_AUTHOR
RTAX_BRD
RTAX_DST
RTAX_GATEWAY
RTAX_GENMASK
RTAX_IFA
RTAX_IFP
RTAX_NETMASK
RTA_AUTHOR
RTA_BRD
RTA_DST
RTA_GATEWAY
RTA_GENMASK
RTA_IFA
RTA_IFP
RTA_NETMASK
RTLD_NEXT
RTLD_NODELETE
RTLD_NOLOAD
Expand Down Expand Up @@ -918,7 +938,30 @@ SIGINFO
SIGIO
SIGNATURE
SIGSTKSZ
SIOCADDMULTI
SIOCAIFADDR
SIOCAIFADDR_IN6
SIOCDELMULTI
SIOCDIFADDR
SIOCDIFADDR_IN6
SIOCGIFADDR
SIOCGIFBRDADDR
SIOCGIFCAP
SIOCGIFDSTADDR
SIOCGIFFLAGS
SIOCGIFMTU
SIOCGIFNETMASK
SIOCIFCREATE
SIOCIFCREATE2
SIOCIFDESTROY
SIOCSDRVSPEC
SIOCSIFADDR
SIOCSIFBRDADDR
SIOCSIFCAP
SIOCSIFDSTADDR
SIOCSIFFLAGS
SIOCSIFMTU
SIOCSIFNETMASK
SLIPDISC
SOCK_CLOEXEC
SOCK_MAXADDRLEN
Expand Down
46 changes: 46 additions & 0 deletions libc-test/semver/freebsd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ B7200
B76800
B921600
BIOCFLUSH
BIOCFEEDBACK
BIOCGBLEN
BIOCGDLT
BIOCGDLTLIST
Expand All @@ -127,12 +128,15 @@ BIOCGRTIMEOUT
BIOCGSEESENT
BIOCGSTATS
BIOCIMMEDIATE
BIOCLOCK
BIOCPROMISC
BIOCROTZBUF
BIOCSBLEN
BIOCSDLT
BIOCSETF
BIOCSETFNR
BIOCSETIF
BIOCSETZBUF
BIOCSHDRCMPLT
BIOCSRSIG
BIOCSRTIMEOUT
Expand Down Expand Up @@ -1221,6 +1225,22 @@ RLIMIT_UMTXP
RLIMIT_VMEM
RLIM_INFINITY
RLIM_NLIMITS
RTAX_AUTHOR
RTAX_BRD
RTAX_DST
RTAX_GATEWAY
RTAX_GENMASK
RTAX_IFA
RTAX_IFP
RTAX_NETMASK
RTA_AUTHOR
RTA_BRD
RTA_DST
RTA_GATEWAY
RTA_GENMASK
RTA_IFA
RTA_IFP
RTA_NETMASK
RTLD_NEXT
RTLD_NODELETE
RTLD_NOLOAD
Expand Down Expand Up @@ -1417,7 +1437,30 @@ SIGLIBRT
SIGLWP
SIGSTKSZ
SIGTHR
SIOCADDMULTI
SIOCAIFADDR
SIOCAIFADDR_IN6
SIOCDELMULTI
SIOCDIFADDR
SIOCDIFADDR_IN6
SIOCGIFADDR
SIOCGIFBRDADDR
SIOCGIFCAP
SIOCGIFDSTADDR
SIOCGIFFLAGS
SIOCGIFMTU
SIOCGIFNETMASK
SIOCIFCREATE
SIOCIFCREATE2
SIOCIFDESTROY
SIOCSDRVSPEC
SIOCSIFADDR
SIOCSIFBRDADDR
SIOCSIFCAP
SIOCSIFDSTADDR
SIOCSIFFLAGS
SIOCSIFMTU
SIOCSIFNETMASK
SLIPDISC
SOCKCREDSIZE
SOCK_CLOEXEC
Expand Down Expand Up @@ -1819,7 +1862,10 @@ bpf_hdr
bpf_insn
bpf_program
bpf_stat
bpf_ts
bpf_version
bpf_xhdr
bpf_zbuf
bsearch
cap_enter
cap_getmode
Expand Down
45 changes: 45 additions & 0 deletions libc-test/semver/netbsd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,19 +104,23 @@ B460800
B7200
B76800
B921600
BIOCFEEDBACK
BIOCFLUSH
BIOCGBLEN
BIOCGDLT
BIOCGETIF
BIOCGFEEDBACK
BIOCGHDRCMPLT
BIOCGRSIG
BIOCGSEESENT
BIOCGSTATS
BIOCIMMEDIATE
BIOCLOCK
BIOCPROMISC
BIOCSBLEN
BIOCSDLT
BIOCSETIF
BIOCSFEEDBACK
BIOCSHDRCMPLT
BIOCSRSIG
BIOCSSEESENT
Expand Down Expand Up @@ -926,6 +930,22 @@ RLIM_INFINITY
RLIM_NLIMITS
RLIM_SAVED_CUR
RLIM_SAVED_MAX
RTAX_AUTHOR
RTAX_BRD
RTAX_DST
RTAX_GATEWAY
RTAX_GENMASK
RTAX_IFA
RTAX_IFP
RTAX_NETMASK
RTA_AUTHOR
RTA_BRD
RTA_DST
RTA_GATEWAY
RTA_GENMASK
RTA_IFA
RTA_IFP
RTA_NETMASK
RTLD_NEXT
RTLD_NOLOAD
RTLD_SELF
Expand Down Expand Up @@ -958,7 +978,30 @@ SIGINFO
SIGIO
SIGNATURE
SIGSTKSZ
SIOCADDMULTI
SIOCAIFADDR
SIOCAIFADDR_IN6
SIOCDELMULTI
SIOCDIFADDR
SIOCDIFADDR_IN6
SIOCGIFADDR
SIOCGIFBRDADDR
SIOCGIFCAP
SIOCGIFDSTADDR
SIOCGIFFLAGS
SIOCGIFMTU
SIOCGIFNETMASK
SIOCIFCREATE
SIOCIFCREATE2
SIOCIFDESTROY
SIOCSDRVSPEC
SIOCSIFADDR
SIOCSIFBRDADDR
SIOCSIFCAP
SIOCSIFDSTADDR
SIOCSIFFLAGS
SIOCSIFMTU
SIOCSIFNETMASK
SOCKCREDSIZE
SOCK_CLOEXEC
SOCK_CONN_DGRAM
Expand Down Expand Up @@ -1214,6 +1257,8 @@ backtrace_symbols
backtrace_symbols_fd
backtrace_symbols_fmt
backtrace_symbols_fd_fmt
bpf_stat
bpf_version
bsearch
chflags
chroot
Expand Down
38 changes: 38 additions & 0 deletions libc-test/semver/openbsd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ BIOCGHDRCMPLT
BIOCGRSIG
BIOCGSTATS
BIOCIMMEDIATE
BIOCLOCK
BIOCPROMISC
BIOCSBLEN
BIOCSDLT
Expand Down Expand Up @@ -760,6 +761,22 @@ RLIM_INFINITY
RLIM_NLIMITS
RLIM_SAVED_CUR
RLIM_SAVED_MAX
RTAX_AUTHOR
RTAX_BRD
RTAX_DST
RTAX_GATEWAY
RTAX_GENMASK
RTAX_IFA
RTAX_IFP
RTAX_NETMASK
RTA_AUTHOR
RTA_BRD
RTA_DST
RTA_GATEWAY
RTA_GENMASK
RTA_IFA
RTA_IFP
RTA_NETMASK
RTLD_NEXT
RTLD_SELF
RUSAGE_CHILDREN
Expand All @@ -781,7 +798,26 @@ SIGEMT
SIGINFO
SIGIO
SIGSTKSZ
SIOCADDMULTI
SIOCAIFADDR
SIOCAIFADDR_IN6
SIOCDELMULTI
SIOCDIFADDR
SIOCDIFADDR_IN6
SIOCGIFADDR
SIOCGIFBRDADDR
SIOCGIFDSTADDR
SIOCGIFFLAGS
SIOCGIFMTU
SIOCGIFNETMASK
SIOCIFCREATE
SIOCIFDESTROY
SIOCSIFADDR
SIOCSIFBRDADDR
SIOCSIFDSTADDR
SIOCSIFFLAGS
SIOCSIFMTU
SIOCSIFNETMASK
SOCK_CLOEXEC
SOCK_DNS
SOCK_NONBLOCK
Expand Down Expand Up @@ -1012,6 +1048,8 @@ backtrace_symbols
backtrace_symbols_fd
backtrace_symbols_fmt
basename
bpf_stat
bpf_version
bsearch
caddr_t
calloc_conceal
Expand Down
Loading

0 comments on commit 385709d

Please sign in to comment.