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