github.com/google/syzkaller@v0.0.0-20240517125934-c0f1611a36d6/sys/freebsd/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 <sys/types.h>
     5  include <sys/param.h>
     6  include <sys/socket.h>
     7  include <netinet/in.h>
     8  include <net/route.h>
     9  include <netinet6/ip6_mroute.h>
    10  include <sys/sockio.h>
    11  
    12  # IPv6 sockets
    13  
    14  resource sock_in6[sock]
    15  
    16  sockaddr_in6 {
    17  	len	len[parent, int8]
    18  	family	const[AF_INET6, int8]
    19  	port	sock_port
    20  	flow	int32
    21  	addr	ipv6_addr
    22  	scope	int32
    23  }
    24  
    25  sockaddr_storage_in6 {
    26  	addr	sockaddr_in6
    27  	pad	array[const[0, int64], 12]
    28  }
    29  
    30  socket$inet6(domain const[AF_INET6], type flags[socket_type], proto int8) sock_in6
    31  accept$inet6(fd sock_in6, peer ptr[out, sockaddr_in6, opt], peerlen ptr[inout, len[peer, int32]]) sock_in6
    32  accept4$inet6(fd sock_in6, peer ptr[out, sockaddr_in6, opt], peerlen ptr[inout, len[peer, int32]], flags flags[accept_flags]) sock_in6
    33  bind$inet6(fd sock_in6, addr ptr[in, sockaddr_in6], addrlen len[addr])
    34  connect$inet6(fd sock_in6, addr ptr[in, sockaddr_in6], addrlen len[addr])
    35  sendto$inet6(fd sock_in6, buf buffer[in], len len[buf], f flags[send_flags], addr ptr[in, sockaddr_in6, opt], addrlen len[addr])
    36  recvfrom$inet6(fd sock_in6, buf buffer[out], len len[buf], f flags[recv_flags], addr ptr[in, sockaddr_in6, opt], addrlen len[addr])
    37  getsockname$inet6(fd sock_in6, addr ptr[out, sockaddr_in6], addrlen ptr[inout, len[addr, int32]])
    38  getpeername$inet6(fd sock_in6, peer ptr[out, sockaddr_in6], peerlen ptr[inout, len[peer, int32]])
    39  
    40  # Generic IPv6 options
    41  
    42  inet6_option_types_int = IPV6_2292PKTINFO, IPV6_2292HOPOPTS, IPV6_2292DSTOPTS, IPV6_2292RTHDR, IPV6_CHECKSUM, IPV6_2292HOPLIMIT, IPV6_NEXTHOP, IPV6_UNICAST_HOPS, IPV6_MULTICAST_IF, IPV6_MULTICAST_HOPS, IPV6_MULTICAST_LOOP, IPV6_V6ONLY, IPV6_RECVPKTINFO, IPV6_RECVHOPLIMIT, IPV6_HOPLIMIT, IPV6_RECVHOPOPTS, IPV6_RECVRTHDR, IPV6_RECVDSTOPTS, IPV6_RECVPATHMTU, IPV6_DONTFRAG, IPV6_RECVTCLASS, IPV6_TCLASS, IPV6_AUTOFLOWLABEL, IPV6_RECVORIGDSTADDR
    43  
    44  inet6_option_types_buf = IPV6_2292PKTOPTIONS, IPV6_IPSEC_POLICY, MCAST_JOIN_GROUP, MCAST_LEAVE_GROUP, IPV6_PKTINFO, IPV6_HOPOPTS, IPV6_RTHDRDSTOPTS, IPV6_RTHDR, IPV6_DSTOPTS, IPV6_PATHMTU, MRT6_ADD_MIF, MRT6_ADD_MFC, MRT6_DEL_MFC, sockopt_opt_group_source_req
    45  
    46  getsockopt$inet6_int(fd sock_in6, level const[IPPROTO_IPV6], optname flags[inet6_option_types_int], optval ptr[out, int32], optlen ptr[inout, len[optval, int32]])
    47  setsockopt$inet6_int(fd sock_in6, level const[IPPROTO_IPV6], optname flags[inet6_option_types_int], optval ptr[in, int32], optlen len[optval])
    48  getsockopt$inet6_buf(fd sock_in6, level const[IPPROTO_IPV6], optname flags[inet6_option_types_buf], optval buffer[out], optlen ptr[inout, len[optval, int32]])
    49  setsockopt$inet6_buf(fd sock_in6, level const[IPPROTO_IPV6], optname flags[inet6_option_types_buf], optval buffer[in], optlen len[optval])
    50  
    51  # Specific IPv6 options
    52  
    53  setsockopt$inet6_MCAST_JOIN_GROUP(fd sock_in6, level const[IPPROTO_IPV6], optname const[MCAST_JOIN_GROUP], optval ptr[in, group_req_in6], optlen len[optval])
    54  setsockopt$inet6_MCAST_LEAVE_GROUP(fd sock_in6, level const[IPPROTO_IPV6], optname const[MCAST_LEAVE_GROUP], optval ptr[in, group_req_in6], optlen len[optval])
    55  
    56  setsockopt$inet6_group_source_req(fd sock_in6, level const[IPPROTO_IPV6], optname flags[sockopt_opt_group_source_req], optval ptr[in, group_source_req_in6], optlen len[optval])
    57  
    58  setsockopt$inet6_IPV6_PKTINFO(fd sock_in6, level const[IPPROTO_IPV6], optname const[IPV6_PKTINFO], optval ptr[in, in6_pktinfo], optlen len[optval])
    59  setsockopt$inet6_IPV6_HOPOPTS(fd sock_in6, level const[IPPROTO_IPV6], optname const[IPV6_HOPOPTS], optval ptr[in, ipv6_hopopts_ext_header], optlen len[optval])
    60  setsockopt$inet6_IPV6_RTHDR(fd sock_in6, level const[IPPROTO_IPV6], optname const[IPV6_RTHDR], optval ptr[in, ipv6_rt_hdr], optlen len[optval])
    61  setsockopt$inet6_IPV6_RTHDRDSTOPTS(fd sock_in6, level const[IPPROTO_IPV6], optname const[IPV6_RTHDRDSTOPTS], optval ptr[in, ipv6_dstopts_ext_header], optlen len[optval])
    62  setsockopt$inet6_IPV6_DSTOPTS(fd sock_in6, level const[IPPROTO_IPV6], optname const[IPV6_DSTOPTS], optval ptr[in, ipv6_dstopts_ext_header], optlen len[optval])
    63  
    64  # TODO: IPV6_PATHMTU
    65  # TODO: IP6T_SO_GET_REVISION_MATCH, IP6T_SO_GET_REVISION_TARGET
    66  
    67  setsockopt$inet6_MRT6_ADD_MIF(fd sock_in6, level const[IPPROTO_IPV6], optname const[MRT6_ADD_MIF], optval ptr[in, mif6ctl], optlen len[optval])
    68  setsockopt$inet6_MRT6_ADD_MFC(fd sock_in6, level const[IPPROTO_IPV6], optname const[MRT6_ADD_MFC], optval ptr[in, mf6cctl], optlen len[optval])
    69  setsockopt$inet6_MRT6_DEL_MFC(fd sock_in6, level const[IPPROTO_IPV6], optname const[MRT6_DEL_MFC], optval ptr[in, mf6cctl], optlen len[optval])
    70  
    71  mif6ctl {
    72  	mif6c_mifi	int16
    73  	mif6c_flags	flags[mif6c_flags, int8]
    74  	vifc_threshold	int8
    75  	mif6c_pifi	int16
    76  	vifc_rate_limit	int32
    77  }
    78  
    79  mif6c_flags = MIFF_REGISTER
    80  
    81  mf6cctl {
    82  	mf6cc_origin	sockaddr_in6
    83  	mf6cc_mcastgrp	sockaddr_in6
    84  	mf6cc_parent	int16
    85  	mf6cc_ifset	array[int32, 8]
    86  }
    87  
    88  group_req_in6 {
    89  	gr_interface	int32
    90  	gr_group	sockaddr_storage_in6
    91  }
    92  
    93  group_source_req_in6 {
    94  	gsr_interface	int32
    95  	gsr_group	sockaddr_storage_in6
    96  	gsr_source	sockaddr_storage_in6
    97  }
    98  
    99  in6_pktinfo {
   100  	ipi6_addr	ipv6_addr
   101  	ipi6_ifindex	ifindex
   102  }