github.com/google/syzkaller@v0.0.0-20240517125934-c0f1611a36d6/sys/openbsd/socket_inet.txt (about) 1 # Copyright 2017 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/socket.h> 6 include <sys/sockio.h> 7 include <netinet/in.h> 8 9 # IP sockets 10 11 resource sock_in[sock] 12 13 sockaddr_in { 14 family const[AF_INET, int16] 15 port sock_port 16 pad array[const[0, int8], 8] 17 } 18 19 socket$inet(domain const[AF_INET], type flags[socket_type], proto int8) sock_in 20 accept$inet(fd sock_in, peer ptr[out, sockaddr_in, opt], peerlen ptr[inout, len[peer, int32]]) sock_in 21 bind$inet(fd sock_in, addr ptr[in, sockaddr_in], addrlen len[addr]) 22 connect$inet(fd sock_in, addr ptr[in, sockaddr_in], addrlen len[addr]) 23 sendto$inet(fd sock_in, buf buffer[in], len len[buf], f flags[send_flags], addr ptr[in, sockaddr_in, opt], addrlen len[addr]) 24 recvfrom$inet(fd sock_in, buf buffer[out], len len[buf], f flags[recv_flags], addr ptr[in, sockaddr_in, opt], addrlen len[addr]) 25 getsockname$inet(fd sock_in, addr ptr[out, sockaddr_in], addrlen ptr[inout, len[addr, int32]]) 26 getpeername$inet(fd sock_in, peer ptr[out, sockaddr_in], peerlen ptr[inout, len[peer, int32]]) 27 28 # Generic IP options 29 30 # Specific IP options 31 32 sockopt_opt_ip_opts = IP_OPTIONS 33 34 getsockopt$inet_opts(fd sock_in, level const[IPPROTO_IP], optname flags[sockopt_opt_ip_opts], optval buffer[out], optlen ptr[inout, len[optval, int32]]) 35 setsockopt$inet_opts(fd sock_in, level const[IPPROTO_IP], optname flags[sockopt_opt_ip_opts], optval buffer[in], optlen len[optval])