github.com/google/syzkaller@v0.0.0-20240517125934-c0f1611a36d6/sys/linux/socket_phonet.txt (about)

     1  # Copyright 2020 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 <linux/socket.h>
     5  include <linux/net.h>
     6  include <uapi/linux/phonet.h>
     7  
     8  resource sock_phonet[sock]
     9  resource sock_phonet_dgram[sock_phonet]
    10  resource sock_phonet_pipe[sock_phonet]
    11  
    12  socket$phonet(domain const[AF_PHONET], type const[SOCK_DGRAM], proto const[PN_PROTO_PHONET]) sock_phonet_dgram
    13  ioctl$SIOCPNADDRESOURCE(fd sock_phonet, cmd const[SIOCPNGETOBJECT], arg ptr[in, int32])
    14  ioctl$SIOCPNDELRESOURCE(fd sock_phonet_dgram, cmd const[SIOCPNDELRESOURCE], arg ptr[in, int32])
    15  
    16  socket$phonet_pipe(domain const[AF_PHONET], type const[SOCK_SEQPACKET], proto const[PN_PROTO_PIPE]) sock_phonet_pipe
    17  accept$phonet_pipe(fd sock_phonet_pipe, peer ptr[out, sockaddr_pn, opt], peerlen ptr[inout, len[peer, int32]]) sock_phonet_pipe
    18  accept4$phonet_pipe(fd sock_phonet_pipe, peer ptr[out, sockaddr_pn, opt], peerlen ptr[inout, len[peer, int32]], flags flags[accept_flags]) sock_phonet_pipe
    19  connect$phonet_pipe(fd sock_phonet_pipe, addr ptr[in, sockaddr_pn], addrlen len[addr])
    20  ioctl$SIOCPNENABLEPIPE(fd sock_phonet_pipe, cmd const[SIOCPNENABLEPIPE], arg const[0])
    21  setsockopt$PNPIPE_ENCAP(fd sock_phonet_pipe, level const[SOL_PNPIPE], opt const[PNPIPE_ENCAP], val ptr[in, bool32], len bytesize[val])
    22  getsockopt$PNPIPE_ENCAP(fd sock_phonet_pipe, level const[SOL_PNPIPE], opt const[PNPIPE_ENCAP], val ptr[out, int32], len ptr[inout, len[val, int32]])
    23  setsockopt$PNPIPE_HANDLE(fd sock_phonet_pipe, level const[SOL_PNPIPE], opt const[PNPIPE_HANDLE], val ptr[in, int32], len bytesize[val])
    24  getsockopt$PNPIPE_HANDLE(fd sock_phonet_pipe, level const[SOL_PNPIPE], opt const[PNPIPE_HANDLE], val ptr[out, int32], len ptr[inout, len[val, int32]])
    25  setsockopt$PNPIPE_INITSTATE(fd sock_phonet_pipe, level const[SOL_PNPIPE], opt const[PNPIPE_INITSTATE], val ptr[in, bool32], len bytesize[val])
    26  getsockopt$PNPIPE_INITSTATE(fd sock_phonet_pipe, level const[SOL_PNPIPE], opt const[PNPIPE_INITSTATE], val ptr[out, int32], len ptr[inout, len[val, int32]])
    27  getsockopt$PNPIPE_IFINDEX(fd sock_phonet_pipe, level const[SOL_PNPIPE], opt const[PNPIPE_IFINDEX], val ptr[out, ifindex], len ptr[inout, len[val, int32]])
    28  
    29  # Common operations.
    30  
    31  bind$phonet(fd sock_phonet, addr ptr[in, sockaddr_pn], addrlen len[addr])
    32  sendto$phonet(fd sock_phonet, buf buffer[in], len len[buf], f flags[send_flags], addr ptr[in, sockaddr_pn, opt], addrlen len[addr])
    33  recvfrom$phonet(fd sock_phonet, buf buffer[out], len len[buf], f flags[recv_flags], addr ptr[in, sockaddr_pn, opt], addrlen len[addr])
    34  ioctl$SIOCPNGETOBJECT(fd sock_phonet, cmd const[SIOCPNGETOBJECT], arg ptr[in, int16])
    35  
    36  sockaddr_pn {
    37  	spn_family	const[AF_PHONET, int16]
    38  	spn_obj		int8
    39  	spn_dev		int8
    40  	spn_resource	int8
    41  	spn_zero	array[const[0, int8], 11]
    42  } [packed]