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

     1  # Copyright 2019 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  # AF_NETLINK/NETLINK_GENERIC/gtp support.
     5  
     6  # TODO: describe gtp packets in vnet.txt (they go inside of udp packets, see gtp_encap_recv()).
     7  
     8  include <linux/net.h>
     9  include <uapi/linux/netlink.h>
    10  include <uapi/linux/genetlink.h>
    11  include <uapi/linux/if_link.h>
    12  include <uapi/linux/gtp.h>
    13  
    14  resource genl_gtp_family_id[int16]
    15  type msghdr_nl_gtp[CMD] msghdr_netlink[netlink_msg_t[genl_gtp_family_id, genlmsghdr_t[CMD], gtp_genl_policy]]
    16  
    17  syz_genetlink_get_family_id$gtp(name ptr[in, string["gtp"]], fd sock_nl_generic) genl_gtp_family_id
    18  
    19  sendmsg$GTP_CMD_NEWPDP(fd sock_nl_generic, msg ptr[in, msghdr_nl_gtp[GTP_CMD_NEWPDP]], f flags[send_flags])
    20  sendmsg$GTP_CMD_DELPDP(fd sock_nl_generic, msg ptr[in, msghdr_nl_gtp[GTP_CMD_DELPDP]], f flags[send_flags])
    21  sendmsg$GTP_CMD_GETPDP(fd sock_nl_generic, msg ptr[in, msghdr_nl_gtp[GTP_CMD_GETPDP]], f flags[send_flags])
    22  
    23  gtp_genl_policy [
    24  # TODO: fuzzer will have hard time getting ifindex of a gtp device (which needs to be created before).
    25  	GTPA_LINK		nlattr[GTPA_LINK, ifindex]
    26  	GTPA_VERSION		nlattr[GTPA_VERSION, int32[GTP_V0:GTP_V1]]
    27  	GTPA_TID		nlattr[GTPA_TID, int64[0:4]]
    28  	GTPA_PEER_ADDRESS	nlattr[GTPA_PEER_ADDRESS, ipv4_addr]
    29  	GTPA_MS_ADDRESS		nlattr[GTPA_MS_ADDRESS, ipv4_addr]
    30  	GTPA_FLOW		nlattr[GTPA_FLOW, int16[0:4]]
    31  	GTPA_NET_NS_FD		nlattr[GTPA_NET_NS_FD, fd_namespace]
    32  	GTPA_I_TEI		nlattr[GTPA_I_TEI, int32[0:4]]
    33  	GTPA_O_TEI		nlattr[GTPA_O_TEI, int32[0:4]]
    34  ] [varlen]
    35  
    36  gtp_policy {
    37  	IFLA_GTP_FD0	nlattr[IFLA_GTP_FD0, sock_udp]
    38  	IFLA_GTP_FD1	nlattr[IFLA_GTP_FD1, sock_udp]
    39  	var		array[gtp_policy$var]
    40  }
    41  
    42  gtp_policy$var [
    43  	IFLA_GTP_FD0		nlattr[IFLA_GTP_FD0, sock_udp6]
    44  	IFLA_GTP_FD1		nlattr[IFLA_GTP_FD1, sock_udp6]
    45  	IFLA_GTP_PDP_HASHSIZE	nlattr[IFLA_GTP_PDP_HASHSIZE, int32]
    46  	IFLA_GTP_ROLE		nlattr[IFLA_GTP_ROLE, int32[0:2]]
    47  ] [varlen]