github.com/google/syzkaller@v0.0.0-20240517125934-c0f1611a36d6/sys/netbsd/socket_inet6.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 <stddef.h>
     5  include <sys/types.h>
     6  include <sys/param.h>
     7  include <sys/socket.h>
     8  include <netinet/in.h>
     9  include <net/route.h>
    10  include <netinet6/ip6_mroute.h>
    11  include <compat/linux/common/linux_socket.h>
    12  include <sys/sockio.h>
    13  
    14  # IPv6 sockets
    15  
    16  resource sock_in6[sock]
    17  
    18  sockaddr_in6 {
    19  	family	const[AF_INET6, int16]
    20  	port	sock_port
    21  	flow	int32
    22  	scope	int32
    23  }
    24  
    25  socket$inet6(domain const[AF_INET6], type flags[socket_type], proto int8) sock_in6
    26  accept$inet6(fd sock_in6, peer ptr[out, sockaddr_in6, opt], peerlen ptr[inout, len[peer, int32]]) sock_in6
    27  bind$inet6(fd sock_in6, addr ptr[in, sockaddr_in6], addrlen len[addr])
    28  connect$inet6(fd sock_in6, addr ptr[in, sockaddr_in6], addrlen len[addr])
    29  sendto$inet6(fd sock_in6, buf buffer[in], len len[buf], f flags[send_flags], addr ptr[in, sockaddr_in6, opt], addrlen len[addr])
    30  recvfrom$inet6(fd sock_in6, buf buffer[out], len len[buf], f flags[recv_flags], addr ptr[in, sockaddr_in6, opt], addrlen len[addr])
    31  getsockname$inet6(fd sock_in6, addr ptr[out, sockaddr_in6], addrlen ptr[inout, len[addr, int32]])
    32  getpeername$inet6(fd sock_in6, peer ptr[out, sockaddr_in6], peerlen ptr[inout, len[peer, int32]])
    33  
    34  # Generic IPv6 options
    35  
    36  # Specific IPv6 options
    37  
    38  # TODO: IPV6_HOPOPTS, IPV6_RTHDRDSTOPTS, IPV6_RTHDR, IPV6_DSTOPTS
    39  # TODO: IPV6_PATHMTU
    40  # TODO: IP6T_SO_GET_REVISION_MATCH, IP6T_SO_GET_REVISION_TARGET
    41  
    42  setsockopt$inet6_MRT6_ADD_MIF(fd sock_in6, level const[IPPROTO_IPV6], optname const[MRT6_ADD_MIF], optval ptr[in, mif6ctl], optlen len[optval])
    43  setsockopt$inet6_MRT6_ADD_MFC(fd sock_in6, level const[IPPROTO_IPV6], optname const[MRT6_ADD_MFC], optval ptr[in, mf6cctl], optlen len[optval])
    44  setsockopt$inet6_MRT6_DEL_MFC(fd sock_in6, level const[IPPROTO_IPV6], optname const[MRT6_DEL_MFC], optval ptr[in, mf6cctl], optlen len[optval])
    45  
    46  mif6ctl {
    47  	mif6c_mifi	int16
    48  	mif6c_flags	flags[mif6c_flags, int8]
    49  	vifc_threshold	int8
    50  	mif6c_pifi	int16
    51  	vifc_rate_limit	int32
    52  }
    53  
    54  mif6c_flags = MIFF_REGISTER
    55  
    56  mf6cctl {
    57  	mf6cc_origin	sockaddr_in6
    58  	mf6cc_mcastgrp	sockaddr_in6
    59  	mf6cc_parent	int16
    60  	mf6cc_ifset	array[int32, 8]
    61  }