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

     1  # Copyright 2018 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/net.h>
     5  include <uapi/linux/tipc.h>
     6  include <net/tipc/core.h>
     7  
     8  resource sock_tipc[sock]
     9  
    10  type tipc_instance int32[0:4]
    11  type tipc_node_addr int32[0:4]
    12  type tipc_port int32[20000:20004]
    13  
    14  socket$tipc(domain const[AF_TIPC], type flags[tipc_socket_types], proto const[0]) sock_tipc
    15  socketpair$tipc(domain const[AF_TIPC], type flags[tipc_socket_types], proto const[0], fds ptr[out, tipc_pair])
    16  bind$tipc(fd sock_tipc, addr ptr[in, sockaddr_tipc, opt], addrlen len[addr])
    17  connect$tipc(fd sock_tipc, addr ptr[in, sockaddr_tipc], addrlen len[addr])
    18  accept4$tipc(fd sock_tipc, peer ptr[out, sockaddr_tipc, opt], peerlen ptr[inout, len[peer, int32]], flags flags[accept_flags]) sock_tipc
    19  getsockname$tipc(fd sock_tipc, addr ptr[out, sockaddr_tipc], addrlen ptr[inout, len[addr, int32]])
    20  getpeername$tipc(fd sock_tipc, peer ptr[out, sockaddr_tipc], peerlen ptr[inout, len[peer, int32]])
    21  sendmsg$tipc(fd sock_tipc, msg ptr[in, msghdr_tipc], f flags[send_flags])
    22  
    23  ioctl$SIOCGETLINKNAME(fd sock_tipc, cmd const[SIOCGETLINKNAME], arg ptr[in, tipc_sioc_ln_req])
    24  ioctl$SIOCGETNODEID(fd sock_tipc, cmd const[SIOCGETNODEID], arg ptr[in, tipc_sioc_nodeid_req])
    25  
    26  setsockopt$TIPC_IMPORTANCE(fd sock_tipc, level const[SOL_TIPC], opt const[TIPC_IMPORTANCE], val ptr[in, int32], len bytesize[val])
    27  setsockopt$TIPC_SRC_DROPPABLE(fd sock_tipc, level const[SOL_TIPC], opt const[TIPC_SRC_DROPPABLE], val ptr[in, int32], len bytesize[val])
    28  setsockopt$TIPC_DEST_DROPPABLE(fd sock_tipc, level const[SOL_TIPC], opt const[TIPC_DEST_DROPPABLE], val ptr[in, int32], len bytesize[val])
    29  setsockopt$TIPC_CONN_TIMEOUT(fd sock_tipc, level const[SOL_TIPC], opt const[TIPC_CONN_TIMEOUT], val ptr[in, int32], len bytesize[val])
    30  setsockopt$TIPC_MCAST_BROADCAST(fd sock_tipc, level const[SOL_TIPC], opt const[TIPC_MCAST_BROADCAST])
    31  setsockopt$TIPC_MCAST_REPLICAST(fd sock_tipc, level const[SOL_TIPC], opt const[TIPC_MCAST_REPLICAST])
    32  setsockopt$TIPC_GROUP_LEAVE(fd sock_tipc, level const[SOL_TIPC], opt const[TIPC_GROUP_LEAVE])
    33  setsockopt$TIPC_GROUP_JOIN(fd sock_tipc, level const[SOL_TIPC], opt const[TIPC_GROUP_JOIN], val ptr[in, tipc_group_req], len bytesize[val])
    34  
    35  getsockopt$TIPC_IMPORTANCE(fd sock_tipc, level const[SOL_TIPC], opt const[TIPC_IMPORTANCE], val ptr[out, int32], len ptr[inout, bytesize[val, int32]])
    36  getsockopt$TIPC_SRC_DROPPABLE(fd sock_tipc, level const[SOL_TIPC], opt const[TIPC_SRC_DROPPABLE], val ptr[out, int32], len ptr[inout, bytesize[val, int32]])
    37  getsockopt$TIPC_DEST_DROPPABLE(fd sock_tipc, level const[SOL_TIPC], opt const[TIPC_DEST_DROPPABLE], val ptr[out, int32], len ptr[inout, bytesize[val, int32]])
    38  getsockopt$TIPC_CONN_TIMEOUT(fd sock_tipc, level const[SOL_TIPC], opt const[TIPC_CONN_TIMEOUT], val ptr[out, int32], len ptr[inout, bytesize[val, int32]])
    39  getsockopt$TIPC_NODE_RECVQ_DEPTH(fd sock_tipc, level const[SOL_TIPC], opt const[TIPC_NODE_RECVQ_DEPTH], val ptr[out, int32], len ptr[inout, bytesize[val, int32]])
    40  getsockopt$TIPC_SOCK_RECVQ_DEPTH(fd sock_tipc, level const[SOL_TIPC], opt const[TIPC_SOCK_RECVQ_DEPTH], val ptr[out, int32], len ptr[inout, bytesize[val, int32]])
    41  getsockopt$TIPC_GROUP_JOIN(fd sock_tipc, level const[SOL_TIPC], opt const[TIPC_GROUP_JOIN], val ptr[out, int32], len ptr[inout, bytesize[val, int32]])
    42  
    43  tipc_socket_types = SOCK_DGRAM, SOCK_SEQPACKET, SOCK_DGRAM
    44  tipc_service_type = TIPC_NODE_STATE, TIPC_TOP_SRV, TIPC_LINK_STATE, TIPC_SERVICE_TYPE0, TIPC_SERVICE_TYPE1, TIPC_SERVICE_TYPE2, TIPC_SERVICE_TYPE3
    45  define TIPC_SERVICE_TYPE0	TIPC_RESERVED_TYPES + 0
    46  define TIPC_SERVICE_TYPE1	TIPC_RESERVED_TYPES + 1
    47  define TIPC_SERVICE_TYPE2	TIPC_RESERVED_TYPES + 2
    48  define TIPC_SERVICE_TYPE3	TIPC_RESERVED_TYPES + 3
    49  
    50  tipc_pair {
    51  	fd0	sock_tipc
    52  	fd1	sock_tipc
    53  }
    54  
    55  sockaddr_tipc [
    56  	nameseq	sockaddr_tipc_t[TIPC_ADDR_NAMESEQ, tipc_service_range]
    57  	name	sockaddr_tipc_t[TIPC_ADDR_NAME, tipc_address_name]
    58  	id	sockaddr_tipc_t[TIPC_ADDR_ID, tipc_socket_addr]
    59  ]
    60  
    61  type sockaddr_tipc_t[TYP, DATA] {
    62  	family		const[AF_TIPC, int16]
    63  	addrtype	const[TYP, int8]
    64  	scope		flags[tipc_scope, int8]
    65  	addr		DATA
    66  }
    67  
    68  msghdr_tipc {
    69  	msg_name	ptr[in, sockaddr_tipc, opt]
    70  	msg_namelen	len[msg_name, int32]
    71  	msg_iov		ptr[in, array[iovec_in]]
    72  	msg_iovlen	len[msg_iov, intptr]
    73  	msg_control	ptr[in, array[int8], opt]
    74  	msg_controllen	bytesize[msg_control, intptr]
    75  	msg_flags	flags[send_flags, int32]
    76  }
    77  
    78  tipc_address_name {
    79  	name	tipc_service_addr
    80  	domain	tipc_node_addr
    81  }
    82  
    83  tipc_socket_addr {
    84  	ref	tipc_port
    85  	node	tipc_node_addr
    86  }
    87  
    88  tipc_service_addr {
    89  	type		flags[tipc_service_type, int32]
    90  	instance	tipc_instance
    91  }
    92  
    93  tipc_service_range {
    94  	type	flags[tipc_service_type, int32]
    95  	lower	tipc_instance
    96  	upper	tipc_instance
    97  }
    98  
    99  tipc_sioc_ln_req {
   100  	peer		tipc_node_addr
   101  	bearer_id	int32[0:MAX_BEARERS]
   102  	linkname	array[const[0, int8], TIPC_MAX_LINK_NAME]
   103  }
   104  
   105  tipc_sioc_nodeid_req {
   106  	peer		tipc_node_addr
   107  	linkname	array[const[0, int8], TIPC_NODEID_LEN]
   108  }
   109  
   110  tipc_group_req {
   111  	type		int32[TIPC_SERVICE_TYPE0:TIPC_SERVICE_TYPE3]
   112  	instance	tipc_instance
   113  	scope		flags[tipc_scope, int32]
   114  	flags		const[0, int32]
   115  }