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# AF_NETLINK/NETLINK_ROUTE support. 5 6include <linux/net.h> 7include <linux/netdevice.h> 8include <uapi/linux/if.h> 9include <uapi/linux/if_link.h> 10include <uapi/linux/if_addr.h> 11include <uapi/linux/netlink.h> 12include <uapi/linux/netconf.h> 13include <uapi/linux/rtnetlink.h> 14include <uapi/linux/lwtunnel.h> 15include <uapi/linux/neighbour.h> 16include <uapi/linux/fib_rules.h> 17include <uapi/linux/if_tunnel.h> 18include <uapi/linux/veth.h> 19 20resource sock_nl_route[sock_netlink] 21 22socket$nl_route(domain const[AF_NETLINK], type const[SOCK_RAW], proto const[NETLINK_ROUTE]) sock_nl_route 23 24sendmsg$nl_route(fd sock_nl_route, msg ptr[in, msghdr_netlink[netlink_msg_route]], f flags[send_flags]) 25 26netlink_msg_route [ 27 newlink netlink_msg[RTM_NEWLINK, ifinfomsg[AF_UNSPEC], ifla_policy] 28 getlink netlink_msg[RTM_GETLINK, ifinfomsg[AF_UNSPEC], ifla_policy] 29 setlink netlink_msg[RTM_SETLINK, ifinfomsg[AF_UNSPEC], ifla_policy] 30 dellink netlink_msg[RTM_DELLINK, ifinfomsg[AF_UNSPEC], ifla_policy] 31 getaddr netlink_msg[RTM_GETADDR, rtgenmsg[AF_UNSPEC], void] 32 getroute netlink_msg[RTM_GETROUTE, rtgenmsg[AF_UNSPEC], void] 33 getrule netlink_msg[RTM_GETRULE, rtgenmsg[AF_UNSPEC], void] 34 getnetconf netlink_msg[RTM_GETNETCONF, rtgenmsg[AF_UNSPEC], void] 35 getstats netlink_msg[RTM_GETSTATS, if_stats_msg[AF_UNSPEC], void] 36 newneigh netlink_msg[RTM_NEWNEIGH, ndmsg, nd_policy] 37 delneigh netlink_msg[RTM_DELNEIGH, ndmsg, nd_policy] 38 getneigh netlink_msg[RTM_GETNEIGH, rtgenmsg[AF_UNSPEC], void] 39 getneightbl netlink_msg[RTM_GETNEIGHTBL, rtgenmsg[AF_UNSPEC], void] 40 setneightbl netlink_msg[RTM_SETNEIGHTBL, ndtmsg, nl_neightbl_policy] 41 42 ipv4_newaddr netlink_msg[RTM_NEWADDR, ifaddrmsg[AF_INET], ifa_ipv4_policy] 43 ipv4_deladdr netlink_msg[RTM_DELADDR, ifaddrmsg[AF_INET], ifa_ipv4_policy] 44 ipv4_getaddr netlink_msg[RTM_GETADDR, ifaddrmsg[AF_INET], ifa_ipv4_policy] 45 ipv4_newroute netlink_msg[RTM_NEWROUTE, rtmsg[AF_INET], rtm_ipv4_policy] 46 ipv4_delroute netlink_msg[RTM_DELROUTE, rtmsg[AF_INET], rtm_ipv4_policy] 47 ipv4_getroute netlink_msg[RTM_GETROUTE, rtmsg[AF_INET], void] 48 ipv4_getnetconf netlink_msg[RTM_GETNETCONF, netconfmsg[AF_INET], devconf_ip_policy] 49 ipv4_newrule netlink_msg[RTM_NEWRULE, fib_rule_hdr[AF_INET], fib4_rule_policy] 50 ipv4_delrule netlink_msg[RTM_DELRULE, fib_rule_hdr[AF_INET], fib4_rule_policy] 51 ipv4_getrule netlink_msg[RTM_GETRULE, fib_rule_hdr[AF_INET], void] 52 53 ipv6_newaddr netlink_msg[RTM_NEWADDR, ifaddrmsg[AF_INET6], ifa_ipv6_policy] 54 ipv6_deladdr netlink_msg[RTM_DELADDR, ifaddrmsg[AF_INET6], ifa_ipv6_policy] 55 ipv6_getaddr netlink_msg[RTM_GETADDR, ifaddrmsg[AF_INET6], ifa_ipv6_policy] 56 ipv6_newroute netlink_msg[RTM_NEWROUTE, rtmsg[AF_INET6], rtm_ipv6_policy] 57 ipv6_delroute netlink_msg[RTM_DELROUTE, rtmsg[AF_INET6], rtm_ipv6_policy] 58 ipv6_getroute netlink_msg[RTM_GETROUTE, rtmsg[AF_INET6], rtm_ipv6_policy] 59 ipv6_getmulticast netlink_msg[RTM_GETMULTICAST, rtgenmsg[AF_INET6], void] 60 ipv6_getanyicast netlink_msg[RTM_GETANYCAST, rtgenmsg[AF_INET6], void] 61 ipv6_getnetconf netlink_msg[RTM_GETNETCONF, netconfmsg[AF_INET6], devconf_ip_policy] 62 ipv6_newrule netlink_msg[RTM_NEWRULE, fib_rule_hdr[AF_INET6], fib6_rule_policy] 63 ipv6_delrule netlink_msg[RTM_DELRULE, fib_rule_hdr[AF_INET6], fib6_rule_policy] 64 ipv6_getrule netlink_msg[RTM_GETRULE, fib_rule_hdr[AF_INET6], void] 65 66 ipmr_newroute netlink_msg[RTM_NEWROUTE, rtmsg[RTNL_FAMILY_IPMR], rtm_ipv4_policy] 67 ipmr_delroute netlink_msg[RTM_DELROUTE, rtmsg[RTNL_FAMILY_IPMR], rtm_ipv4_policy] 68 ipmr_getroute netlink_msg[RTM_GETROUTE, rtmsg[RTNL_FAMILY_IPMR], void] 69 70 mpls_newroute netlink_msg[RTM_NEWROUTE, rtmsg[AF_MPLS], rtm_mpls_policy] 71 mpls_delroute netlink_msg[RTM_DELROUTE, rtmsg[AF_MPLS], rtm_mpls_policy] 72 mpls_getroute netlink_msg[RTM_GETROUTE, rtmsg[AF_MPLS], rtm_mpls_policy] 73 mpls_getnetconf netlink_msg[RTM_GETNETCONF, netconfmsg[AF_MPLS], devconf_mpls_policy] 74 75 bridge_newneigh netlink_msg[RTM_NEWNEIGH, ndmsg, nd_policy] 76 bridge_delneigh netlink_msg[RTM_DELNEIGH, ndmsg, nd_policy] 77 bridge_getneigh netlink_msg[RTM_GETNEIGH, ifinfomsg[AF_BRIDGE], ifla_policy] 78 bridge_getlink netlink_msg[RTM_GETLINK, ifinfomsg[AF_BRIDGE], ifla_policy] 79 bridge_setlink netlink_msg[RTM_SETLINK, ifinfomsg[AF_BRIDGE], ifla_policy] 80 bridge_dellink netlink_msg[RTM_DELLINK, ifinfomsg[AF_BRIDGE], ifla_policy] 81] [varlen] 82 83type rtgenmsg[FAMILY] { 84 rtgen_family const[FAMILY, int8] 85} 86 87type netconfmsg[FAMILY] { 88 ncm_family const[FAMILY, int8] 89} 90 91type ifinfomsg[FAMILY] { 92 ifi_family const[FAMILY, int8] 93 __ifi_pad const[0, int8] 94 ifi_type const[0, int16] 95 ifi_index ifindex[opt] 96 ifi_flags flags[net_device_flags, int32] 97 ifi_change flags[net_device_flags, int32] 98} 99 100type ifaddrmsg[FAMILY] { 101 ifa_family const[FAMILY, int8] 102 ifa_prefixlen flags[ifa_prefixlen, int8] 103 ifa_flags flags[ifa_flags, int8] 104 ifa_scope flags[rt_scope_t, int8] 105 ifa_index ifindex 106} 107 108type rtmsg[FAMILY] { 109 rtm_family const[FAMILY, int8] 110 rtm_dst_len flags[rtm_addr_len, int8] 111 rtmsrcdst_len flags[rtm_addr_len, int8] 112 rtm_tos int8 113 rtm_table flags[rt_table_types, int8] 114 rtm_protocol flags[rtm_protocol, int8] 115 rtm_scope flags[rt_scope_t, int8] 116 rtm_type flags[rtm_type, int8] 117 rtm_flags flags[rtm_flags, int32] 118} 119 120ndmsg { 121 ndm_family flags[rtnl_af, int8] 122 ndm_pad1 const[0, int8] 123 ndm_pad2 const[0, int16] 124 ndm_ifindex ifindex 125 ndm_state flags[ndm_state, int16] 126 ndm_flags flags[ndm_flags, int8] 127 ndm_type flags[rtm_type, int8] 128} 129 130ndtmsg { 131 ndm_family flags[rtnl_af, int8] 132 ndm_pad1 const[0, int8] 133 ndm_pad2 const[0, int16] 134} 135 136type if_stats_msg[FAMILY] { 137 family const[FAMILY, int8] 138 pad1 const[0, int8] 139 pad2 const[0, int16] 140 ifindex ifindex 141 filter_mask flags[filter_mask, int32] 142} 143 144ifla_policy [ 145 IFLA_IFNAME nlattr[IFLA_IFNAME, devname] 146 IFLA_ADDRESS nlattr[IFLA_ADDRESS, mac_addr] 147 IFLA_BROADCAST nlattr[IFLA_BROADCAST, mac_addr] 148 IFLA_MAP nlattr[IFLA_MAP, rtnl_link_ifmap] 149 IFLA_MTU nlattr[IFLA_MAP, int32] 150 IFLA_LINK nlattr[IFLA_LINK, int32] 151 IFLA_MASTER nlattr[IFLA_MASTER, int32] 152 IFLA_CARRIER nlattr[IFLA_CARRIER, int8] 153 IFLA_TXQLEN nlattr[IFLA_TXQLEN, int32] 154 IFLA_WEIGHT nlattr[IFLA_WEIGHT, int32] 155 IFLA_OPERSTATE nlattr[IFLA_OPERSTATE, int8] 156 IFLA_LINKMODE nlattr[IFLA_LINKMODE, int8] 157 IFLA_LINKINFO nlattr[IFLA_LINKINFO, ifla_info_policy] 158 IFLA_NET_NS_PID nlattr[IFLA_NET_NS_PID, pid] 159# TODO: this must be some 'nsfd' fd. 160 IFLA_NET_NS_FD nlattr[IFLA_NET_NS_FD, fd] 161 IFLA_IFALIAS nlattr[IFLA_IFALIAS, devname] 162 IFLA_IFALIASn nlattr[IFLA_IFALIAS, void] 163 IFLA_VFINFO_LIST nlattr[IFLA_VFINFO_LIST, array[nlattr[IFLA_VF_INFO, array[ifla_vf_policy]]]] 164 IFLA_VF_PORTS nlattr[IFLA_VF_PORTS, array[nlattr[IFLA_VF_PORT, array[ifla_port_policy]]]] 165 IFLA_PORT_SELF nlattr[IFLA_PORT_SELF, array[ifla_port_policy]] 166 IFLA_AF_SPEC nlattr[IFLA_AF_SPEC, array[nlattr_t[flags[rtnl_af, int16], void]]] 167 IFLA_EXT_MASK nlattr[IFLA_EXT_MASK, int32] 168 IFLA_PROMISCUITY nlattr[IFLA_PROMISCUITY, int32] 169 IFLA_NUM_TX_QUEUES nlattr[IFLA_NUM_TX_QUEUES, int32] 170 IFLA_NUM_RX_QUEUES nlattr[IFLA_NUM_RX_QUEUES, int32] 171 IFLA_PHYS_PORT_ID nlattr[IFLA_PHYS_PORT_ID, array[int8, 0:MAX_PHYS_ITEM_ID_LEN]] 172 IFLA_CARRIER_CHANGES nlattr[IFLA_CARRIER_CHANGES, int32] 173 IFLA_PHYS_SWITCH_ID nlattr[IFLA_PHYS_SWITCH_ID, array[int8, 0:MAX_PHYS_ITEM_ID_LEN]] 174# TODO: this is some net namespace id. 175 IFLA_LINK_NETNSID nlattr[IFLA_LINK_NETNSID, int32] 176 IFLA_PROTO_DOWN nlattr[IFLA_PROTO_DOWN, int8] 177 IFLA_XDP nlattr[IFLA_XDP, array[ifla_xdp_policy]] 178 IFLA_EVENT nlattr[IFLA_EVENT, int32] 179 IFLA_GROUP nlattr[IFLA_GROUP, int32] 180# TODO: probably also some net namespace id. 181 IFLA_IF_NETNSID nlattr[IFLA_IF_NETNSID, int32] 182] [varlen] 183 184type ifla_info_policy_t[TYPE, DATA_TYPE, DATA] { 185 IFLA_INFO_KIND nlattr[IFLA_INFO_KIND, string[TYPE]] 186 IFLA_INFO_DATA nlattr[DATA_TYPE, DATA] 187} 188 189# TODO: can, dummy, geneve, hsr, ifb, ipoib, ipvlan, macvlan, macvtap, netdevsim 190# nlmon, vlan, vrf, vxlan, macsec 191ifla_info_policy [ 192 bond ifla_info_policy_t["bond", IFLA_INFO_DATA, array[bond_policy]] 193 bond_slave ifla_info_policy_t["bond_slave", IFLA_INFO_SLAVE_DATA, bond_slave_policy] 194 bridge ifla_info_policy_t["bridge", IFLA_INFO_DATA, array[br_policy]] 195 bridge_slave ifla_info_policy_t["bridge_slave", IFLA_INFO_SLAVE_DATA, array[br_port_policy]] 196 gre ifla_info_policy_t["gre", IFLA_INFO_DATA, array[ipgre_policy]] 197 gretap ifla_info_policy_t["gretap", IFLA_INFO_DATA, array[ipgre_policy]] 198 erspan ifla_info_policy_t["erspan", IFLA_INFO_DATA, array[ipgre_policy]] 199 ip6gre ifla_info_policy_t["ip6gre", IFLA_INFO_DATA, array[ip6gre_policy]] 200 ip6gretap ifla_info_policy_t["ip6gretap", IFLA_INFO_DATA, array[ip6gre_policy]] 201 ip6erspan ifla_info_policy_t["ip6erspan", IFLA_INFO_DATA, array[ip6gre_policy]] 202 ipip ifla_info_policy_t["ipip", IFLA_INFO_DATA, array[ipip_policy]] 203 ipip6 ifla_info_policy_t["ip6tnl", IFLA_INFO_DATA, array[ipip6_policy]] 204 ip6ip6 ifla_info_policy_t["ip6tnl", IFLA_INFO_DATA, array[ip6ip6_policy]] 205 sit ifla_info_policy_t["sit", IFLA_INFO_DATA, array[sit_policy]] 206 veth ifla_info_policy_t["veth", IFLA_INFO_DATA, veth_policy] 207 vti ifla_info_policy_t["vti", IFLA_INFO_DATA, array[vti_policy]] 208 ip6vti ifla_info_policy_t["ip6vti", IFLA_INFO_DATA, array[ip6vti_policy]] 209] [varlen] 210 211bond_policy [ 212 IFLA_BOND_MODE nlattr[IFLA_BOND_MODE, int8[0:6]] 213 IFLA_BOND_ACTIVE_SLAVE nlattr[IFLA_BOND_ACTIVE_SLAVE, ifindex] 214 IFLA_BOND_MIIMON nlattr[IFLA_BOND_MIIMON, int32] 215 IFLA_BOND_UPDELAY nlattr[IFLA_BOND_UPDELAY, int32] 216 IFLA_BOND_DOWNDELAY nlattr[IFLA_BOND_DOWNDELAY, int32] 217 IFLA_BOND_USE_CARRIER nlattr[IFLA_BOND_USE_CARRIER, int8] 218 IFLA_BOND_ARP_INTERVAL nlattr[IFLA_BOND_ARP_INTERVAL, int32] 219 IFLA_BOND_ARP_IP_TARGET nlattr[IFLA_BOND_ARP_IP_TARGET, array[ipv4_addr]] 220 IFLA_BOND_ARP_VALIDATE nlattr[IFLA_BOND_ARP_VALIDATE, int32[0:3]] 221 IFLA_BOND_ARP_ALL_TARGETS nlattr[IFLA_BOND_ARP_ALL_TARGETS, int32[0:1]] 222 IFLA_BOND_PRIMARY nlattr[IFLA_BOND_PRIMARY, ifindex] 223 IFLA_BOND_PRIMARY_RESELECT nlattr[IFLA_BOND_PRIMARY_RESELECT, int8[0:2]] 224 IFLA_BOND_FAIL_OVER_MAC nlattr[IFLA_BOND_FAIL_OVER_MAC, int8[0:2]] 225 IFLA_BOND_XMIT_HASH_POLICY nlattr[IFLA_BOND_XMIT_HASH_POLICY, int8[0:4]] 226 IFLA_BOND_RESEND_IGMP nlattr[IFLA_BOND_RESEND_IGMP, int32] 227 IFLA_BOND_NUM_PEER_NOTIF nlattr[IFLA_BOND_NUM_PEER_NOTIF, int8] 228 IFLA_BOND_ALL_SLAVES_ACTIVE nlattr[IFLA_BOND_ALL_SLAVES_ACTIVE, int8] 229 IFLA_BOND_MIN_LINKS nlattr[IFLA_BOND_MIN_LINKS, int32] 230 IFLA_BOND_LP_INTERVAL nlattr[IFLA_BOND_LP_INTERVAL, int32] 231 IFLA_BOND_PACKETS_PER_SLAVE nlattr[IFLA_BOND_PACKETS_PER_SLAVE, int32] 232 IFLA_BOND_AD_LACP_RATE nlattr[IFLA_BOND_AD_LACP_RATE, int8[0:1]] 233 IFLA_BOND_AD_SELECT nlattr[IFLA_BOND_AD_SELECT, int8[0:2]] 234 IFLA_BOND_AD_ACTOR_SYS_PRIO nlattr[IFLA_BOND_AD_ACTOR_SYS_PRIO, int16] 235 IFLA_BOND_AD_USER_PORT_KEY nlattr[IFLA_BOND_AD_USER_PORT_KEY, int16] 236 IFLA_BOND_AD_ACTOR_SYSTEM nlattr[IFLA_BOND_AD_ACTOR_SYSTEM, ipv4_addr] 237 IFLA_BOND_TLB_DYNAMIC_LB nlattr[IFLA_BOND_TLB_DYNAMIC_LB, int8] 238] [varlen] 239 240bond_slave_policy [ 241 IFLA_BOND_SLAVE_QUEUE_ID nlattr[IFLA_BOND_SLAVE_QUEUE_ID, int16] 242] [varlen] 243 244br_policy [ 245 IFLA_BR_FORWARD_DELAY nlattr[IFLA_BR_FORWARD_DELAY, int32[2:30]] 246 IFLA_BR_HELLO_TIME nlattr[IFLA_BR_HELLO_TIME, int32[1:10]] 247 IFLA_BR_MAX_AGE nlattr[IFLA_BR_MAX_AGE, int32[6:40]] 248 IFLA_BR_AGEING_TIME nlattr[IFLA_BR_AGEING_TIME, int32] 249 IFLA_BR_STP_STATE nlattr[IFLA_BR_STP_STATE, int32[0:1]] 250 IFLA_BR_PRIORITY nlattr[IFLA_BR_PRIORITY, int16] 251 IFLA_BR_VLAN_FILTERING nlattr[IFLA_BR_VLAN_FILTERING, int8] 252 IFLA_BR_VLAN_PROTOCOL nlattr[IFLA_BR_VLAN_PROTOCOL, int32] 253 IFLA_BR_GROUP_FWD_MASK nlattr[IFLA_BR_GROUP_FWD_MASK, int32] 254 IFLA_BR_GROUP_ADDR nlattr[IFLA_BR_GROUP_ADDR, int32] 255 IFLA_BR_MCAST_ROUTER nlattr[IFLA_BR_MCAST_ROUTER, int32] 256 IFLA_BR_MCAST_SNOOPING nlattr[IFLA_BR_MCAST_SNOOPING, int32] 257 IFLA_BR_MCAST_QUERY_USE_IFADDR nlattr[IFLA_BR_MCAST_QUERY_USE_IFADDR, int32] 258 IFLA_BR_MCAST_QUERIER nlattr[IFLA_BR_MCAST_QUERIER, int32] 259 IFLA_BR_MCAST_HASH_ELASTICITY nlattr[IFLA_BR_MCAST_HASH_ELASTICITY, int32] 260 IFLA_BR_MCAST_HASH_MAX nlattr[IFLA_BR_MCAST_HASH_MAX, int32] 261 IFLA_BR_MCAST_LAST_MEMBER_CNT nlattr[IFLA_BR_MCAST_LAST_MEMBER_CNT, int32] 262 IFLA_BR_MCAST_STARTUP_QUERY_CNT nlattr[IFLA_BR_MCAST_STARTUP_QUERY_CNT, int32] 263 IFLA_BR_MCAST_LAST_MEMBER_INTVL nlattr[IFLA_BR_MCAST_LAST_MEMBER_INTVL, int32] 264 IFLA_BR_MCAST_MEMBERSHIP_INTVL nlattr[IFLA_BR_MCAST_MEMBERSHIP_INTVL, int32] 265 IFLA_BR_MCAST_QUERIER_INTVL nlattr[IFLA_BR_MCAST_QUERIER_INTVL, int32] 266 IFLA_BR_MCAST_QUERY_INTVL nlattr[IFLA_BR_MCAST_QUERY_INTVL, int32] 267 IFLA_BR_MCAST_QUERY_RESPONSE_INTVL nlattr[IFLA_BR_MCAST_QUERY_RESPONSE_INTVL, int32] 268 IFLA_BR_MCAST_STARTUP_QUERY_INTVL nlattr[IFLA_BR_MCAST_STARTUP_QUERY_INTVL, int32] 269 IFLA_BR_NF_CALL_IPTABLES nlattr[IFLA_BR_NF_CALL_IPTABLES, int32] 270 IFLA_BR_NF_CALL_IP6TABLES nlattr[IFLA_BR_NF_CALL_IP6TABLES, int32] 271 IFLA_BR_NF_CALL_ARPTABLES nlattr[IFLA_BR_NF_CALL_ARPTABLES, int32] 272 IFLA_BR_VLAN_DEFAULT_PVID nlattr[IFLA_BR_VLAN_DEFAULT_PVID, int32] 273 IFLA_BR_VLAN_STATS_ENABLED nlattr[IFLA_BR_VLAN_STATS_ENABLED, int32] 274 IFLA_BR_MCAST_STATS_ENABLED nlattr[IFLA_BR_MCAST_STATS_ENABLED, int32] 275 IFLA_BR_MCAST_IGMP_VERSION nlattr[IFLA_BR_MCAST_IGMP_VERSION, int32] 276 IFLA_BR_MCAST_MLD_VERSION nlattr[IFLA_BR_MCAST_MLD_VERSION, int32] 277] [varlen] 278 279br_port_policy [ 280 IFLA_BRPORT_STATE nlattr[IFLA_BRPORT_STATE, int8[0:4]] 281 IFLA_BRPORT_COST nlattr[IFLA_BRPORT_COST, int32] 282 IFLA_BRPORT_PRIORITY nlattr[IFLA_BRPORT_PRIORITY, int16] 283 IFLA_BRPORT_MODE nlattr[IFLA_BRPORT_MODE, int8[0:1]] 284 IFLA_BRPORT_GUARD nlattr[IFLA_BRPORT_GUARD, int8[0:1]] 285 IFLA_BRPORT_PROTECT nlattr[IFLA_BRPORT_PROTECT, int8[0:1]] 286 IFLA_BRPORT_FAST_LEAVE nlattr[IFLA_BRPORT_FAST_LEAVE, int8[0:1]] 287 IFLA_BRPORT_LEARNING nlattr[IFLA_BRPORT_LEARNING, int8[0:1]] 288 IFLA_BRPORT_UNICAST_FLOOD nlattr[IFLA_BRPORT_UNICAST_FLOOD, int8[0:1]] 289 IFLA_BRPORT_PROXYARP nlattr[IFLA_BRPORT_PROXYARP, int8[0:1]] 290 IFLA_BRPORT_PROXYARP_WIFI nlattr[IFLA_BRPORT_PROXYARP_WIFI, int8[0:1]] 291 IFLA_BRPORT_MULTICAST_ROUTER nlattr[IFLA_BRPORT_MULTICAST_ROUTER, int8[0:3]] 292 IFLA_BRPORT_MCAST_TO_UCAST nlattr[IFLA_BRPORT_MCAST_TO_UCAST, int8[0:1]] 293 IFLA_BRPORT_MCAST_FLOOD nlattr[IFLA_BRPORT_MCAST_FLOOD, int8[0:1]] 294 IFLA_BRPORT_BCAST_FLOOD nlattr[IFLA_BRPORT_BCAST_FLOOD, int8[0:1]] 295 IFLA_BRPORT_VLAN_TUNNEL nlattr[IFLA_BRPORT_VLAN_TUNNEL, int8[0:1]] 296 IFLA_BRPORT_GROUP_FWD_MASK nlattr[IFLA_BRPORT_GROUP_FWD_MASK, int16] 297 IFLA_BRPORT_NEIGH_SUPPRESS nlattr[IFLA_BRPORT_NEIGH_SUPPRESS, int8[0:1]] 298 IFLA_BRPORT_ISOLATED nlattr[IFLA_BRPORT_ISOLATED, int8[0:1]] 299 IFLA_BRPORT_FLUSH nlattr[IFLA_BRPORT_FLUSH, void] 300] [varlen] 301 302gre_common_policy [ 303 IFLA_GRE_LINK nlattr[IFLA_GRE_LINK, ifindex] 304 IFLA_GRE_IFLAGS nlattr[IFLA_GRE_IFLAGS, int16] 305 IFLA_GRE_OFLAGS nlattr[IFLA_GRE_OFLAGS, int16] 306 IFLA_GRE_IKEY nlattr[IFLA_GRE_IKEY, int32] 307 IFLA_GRE_OKEY nlattr[IFLA_GRE_OKEY, int32] 308 IFLA_GRE_TTL nlattr[IFLA_GRE_TTL, int8] 309 IFLA_GRE_TOS nlattr[IFLA_GRE_TOS, int8] 310 IFLA_GRE_PMTUDISC nlattr[IFLA_GRE_PMTUDISC, int8[0:1]] 311 IFLA_GRE_ENCAP_TYPE nlattr[IFLA_GRE_ENCAP_TYPE, flags[tunnel_encap_types, int16]] 312 IFLA_GRE_ENCAP_FLAGS nlattr[IFLA_GRE_ENCAP_FLAGS, int16] 313 IFLA_GRE_ENCAP_SPORT nlattr[IFLA_GRE_ENCAP_SPORT, sock_port] 314 IFLA_GRE_ENCAP_DPORT nlattr[IFLA_GRE_ENCAP_DPORT, sock_port] 315 IFLA_GRE_COLLECT_METADATA nlattr[IFLA_GRE_COLLECT_METADATA, void] 316 IFLA_GRE_IGNORE_DF nlattr[IFLA_GRE_IGNORE_DF, int8[0:1]] 317 IFLA_GRE_FWMARK nlattr[IFLA_GRE_FWMARK, int32] 318 IFLA_GRE_ERSPAN_INDEX nlattr[IFLA_GRE_ERSPAN_INDEX, int32[1:0xfffff]] 319 IFLA_GRE_ERSPAN_VER nlattr[IFLA_GRE_ERSPAN_VER, int8[1:2]] 320 IFLA_GRE_ERSPAN_DIR nlattr[IFLA_GRE_ERSPAN_DIR, int8[0:1]] 321 IFLA_GRE_ERSPAN_HWID nlattr[IFLA_GRE_ERSPAN_HWID, int16] 322] [varlen] 323 324ipgre_policy [ 325 IFLA_GRE_LOCAL nlattr[IFLA_GRE_LOCAL, ipv4_addr] 326 IFLA_GRE_REMOTE nlattr[IFLA_GRE_REMOTE, ipv4_addr] 327 gre_common_policy array[gre_common_policy] 328] [varlen] 329 330ip6gre_policy [ 331 IFLA_GRE_LOCAL nlattr[IFLA_GRE_LOCAL, ipv6_addr] 332 IFLA_GRE_REMOTE nlattr[IFLA_GRE_REMOTE, ipv6_addr] 333 gre_common_policy array[gre_common_policy] 334] [varlen] 335 336# TODO: There could have some ifla_policy after ifinfomsg 337veth_policy [ 338 VETH_INFO_PEER nlattr[VETH_INFO_PEER, ifinfomsg[AF_UNSPEC]] 339] [varlen] 340 341vit_common_policy [ 342 IFLA_VTI_LINK nlattr[IFLA_VTI_LINK, ifindex] 343 IFLA_VTI_IKEY nlattr[IFLA_VTI_IKEY, int32] 344 IFLA_VTI_OKEY nlattr[IFLA_VTI_OKEY, int32] 345 IFLA_VTI_FWMARK nlattr[IFLA_VTI_FWMARK, int32] 346] [varlen] 347 348vti_policy [ 349 IFLA_VTI_LOCAL nlattr[IFLA_VTI_LOCAL, ipv4_addr] 350 IFLA_VTI_REMOTE nlattr[IFLA_VTI_REMOTE, ipv4_addr] 351 vit_common_policy array[vit_common_policy] 352] [varlen] 353 354ip6vti_policy [ 355 IFLA_VTI_LOCAL nlattr[IFLA_VTI_LOCAL, ipv6_addr] 356 IFLA_VTI_REMOTE nlattr[IFLA_VTI_REMOTE, ipv6_addr] 357 vit_common_policy array[vit_common_policy] 358] [varlen] 359 360tunl_policy [ 361 IFLA_IPTUN_LINK nlattr[IFLA_INFO_DATA, ifindex] 362 IFLA_IPTUN_TTL nlattr[IFLA_IPTUN_TTL, int8] 363 IFLA_IPTUN_TOS nlattr[IFLA_IPTUN_TOS, int8] 364 IFLA_IPTUN_ENCAP_TYPE nlattr[IFLA_IPTUN_ENCAP_TYPE, flags[tunnel_encap_types, int16]] 365 IFLA_IPTUN_ENCAP_FLAGS nlattr[IFLA_IPTUN_ENCAP_FLAGS, int16] 366 IFLA_IPTUN_ENCAP_SPORT nlattr[IFLA_IPTUN_ENCAP_SPORT, sock_port] 367 IFLA_IPTUN_ENCAP_DPORT nlattr[IFLA_IPTUN_ENCAP_DPORT, sock_port] 368 IFLA_IPTUN_COLLECT_METADATA nlattr[IFLA_IPTUN_COLLECT_METADATA, void] 369 IFLA_IPTUN_FWMARK nlattr[IFLA_IPTUN_FWMARK, int32] 370] [varlen] 371 372ipip_policy [ 373 IFLA_IPTUN_PROTO nlattr[IFLA_IPTUN_PROTO, const[IPPROTO_IPIP, int8]] 374 IFLA_IPTUN_LOCAL nlattr[IFLA_IPTUN_LOCAL, ipv4_addr] 375 IFLA_IPTUN_REMOTE nlattr[IFLA_IPTUN_REMOTE, ipv4_addr] 376 tunl_policy array[tunl_policy] 377 IFLA_IPTUN_PMTUDISC nlattr[IFLA_IPTUN_PMTUDISC, int8[0:1]] 378] [varlen] 379 380tunl6_policy [ 381 IFLA_IPTUN_LOCAL nlattr[IFLA_IPTUN_LOCAL, ipv6_addr] 382 IFLA_IPTUN_REMOTE nlattr[IFLA_IPTUN_REMOTE, ipv6_addr] 383 tunl_policy array[tunl_policy] 384 IFLA_IPTUN_ENCAP_LIMIT nlattr[IFLA_IPTUN_ENCAP_LIMIT, int8] 385 IFLA_IPTUN_FLOWINFO nlattr[IFLA_IPTUN_FLOWINFO, int32] 386 IFLA_IPTUN_FLAGS nlattr[IFLA_IPTUN_FLAGS, int32[0:0x40]] 387] [varlen] 388 389ipip6_policy [ 390 IFLA_IPTUN_PROTO nlattr[IFLA_IPTUN_PROTO, const[IPPROTO_IPIP, int8]] 391 tunl6_policy array[tunl6_policy] 392] [varlen] 393 394ip6ip6_policy [ 395 IFLA_IPTUN_PROTO nlattr[IFLA_IPTUN_PROTO, const[IPPROTO_IPV6, int8]] 396 tunl6_policy array[tunl6_policy] 397] [varlen] 398 399sit_policy [ 400 IFLA_IPTUN_PROTO nlattr[IFLA_IPTUN_PROTO, const[IPPROTO_IPV6, int8]] 401 IFLA_IPTUN_LOCAL nlattr[IFLA_IPTUN_LOCAL, ipv6_addr] 402 IFLA_IPTUN_REMOTE nlattr[IFLA_IPTUN_REMOTE, ipv6_addr] 403 tunl_policy array[tunl_policy] 404 IFLA_IPTUN_FLAGS nlattr[IFLA_IPTUN_FLAGS, int32[0:0x40]] 405] [varlen] 406 407ifa_ipv4_policy [ 408 IFA_LOCAL nlattr[IFA_LOCAL, ipv4_addr] 409 IFA_ADDRESS nlattr[IFA_ADDRESS, ipv4_addr] 410 IFA_BROADCAST nlattr[IFA_BROADCAST, ipv4_addr] 411 IFA_LABEL nlattr[IFA_LABEL, devname] 412 IFA_CACHEINFO nlattr[IFA_CACHEINFO, ifa_cacheinfo] 413 IFA_FLAGS nlattr[IFA_FLAGS, flags[ifa_flags, int32]] 414] [varlen] 415 416ifa_ipv6_policy [ 417 IFA_ADDRESS nlattr[IFA_ADDRESS, ipv6_addr] 418 IFA_LOCAL nlattr[IFA_LOCAL, ipv6_addr] 419 IFA_CACHEINFO nlattr[IFA_CACHEINFO, ifa_cacheinfo] 420 IFA_FLAGS nlattr[IFA_FLAGS, flags[ifa_flags, int32]] 421] [varlen] 422 423rtm_ipv4_policy [ 424 RTA_DST nlattr[RTA_DST, ipv4_addr] 425 RTA_SRC nlattr[RTA_SRC, ipv4_addr] 426 RTA_IIF nlattr[RTA_DST, ifindex] 427 RTA_OIF nlattr[RTA_OIF, ifindex] 428 RTA_GATEWAY nlattr[RTA_GATEWAY, ipv4_addr] 429 RTA_PRIORITY nlattr[RTA_PRIORITY, int32] 430 RTA_PREFSRC nlattr[RTA_PREFSRC, ipv4_addr] 431# TODO: what's this? is this interesting? 432 RTA_METRICS nlattr[RTA_METRICS, array[int8]] 433 RTA_MULTIPATH nlattr[RTA_MULTIPATH, rtnexthop] 434 RTA_FLOW nlattr[RTA_FLOW, int32] 435 RTA_ENCAP_TYPE nlattr[RTA_ENCAP_TYPE, flags[lwtunnel_encap_types, int16]] 436# TODO: describe RTA_ENCAP 437 RTA_ENCAP nlattr[RTA_ENCAP, nl_generic_attr] 438 RTA_UID nlattr[RTA_UID, uid] 439 RTA_MARK nlattr[RTA_MARK, int32] 440] [varlen] 441 442rtm_ipv6_policy [ 443 RTA_GATEWAY nlattr[RTA_GATEWAY, ipv6_addr] 444 RTA_IIF nlattr[RTA_DST, ifindex] 445 RTA_OIF nlattr[RTA_OIF, ifindex] 446 RTA_PRIORITY nlattr[RTA_PRIORITY, int32] 447# TODO: what's this? is this interesting? 448 RTA_METRICS nlattr[RTA_METRICS, array[int8]] 449 RTA_MULTIPATH nlattr[RTA_MULTIPATH, rtnexthop] 450 RTA_PREF nlattr[RTA_PREF, int8] 451 RTA_ENCAP_TYPE nlattr[RTA_ENCAP_TYPE, flags[lwtunnel_encap_types, int16]] 452# TODO: describe RTA_ENCAP 453 RTA_ENCAP nlattr[RTA_ENCAP, nl_generic_attr] 454 RTA_EXPIRES nlattr[RTA_MARK, int32] 455 RTA_UID nlattr[RTA_UID, uid] 456 RTA_MARK nlattr[RTA_MARK, int32] 457] [varlen] 458 459rtm_mpls_policy [ 460 RTA_DST nlattr[RTA_DST, array[mpls_label]] 461 RTA_OIF nlattr[RTA_OIF, ifindex] 462 RTA_TTL_PROPAGATE nlattr[RTA_TTL_PROPAGATE, int8] 463] [varlen] 464 465type fib_rule_hdr[FAMILY] { 466 family const[FAMILY, int8] 467 dst_len flags[rtm_addr_len, int8] 468 rcdst_len flags[rtm_addr_len, int8] 469 tos int8 470 table int8 471 res1 const[0, int8] 472 res2 const[0, int8] 473 action flags[fr_actions, int32] 474 flags flags[fr_flags, int32] 475} 476 477fib_rule_uid_range { 478 start uid 479 end uid 480} 481 482fib_rule_port_range { 483 start sock_port 484 end sock_port 485} 486 487fra_generic_policy [ 488 FRA_IIFNAME nlattr[FRA_IIFNAME, devname] 489 FRA_OIFNAME nlattr[FRA_OIFNAME, devname] 490 FRA_PRIORITY nlattr[FRA_PRIORITY, int32] 491 FRA_FWMARK nlattr[FRA_FWMARK, int32] 492 FRA_FWMASK nlattr[FRA_FWMASK, int32] 493 FRA_TABLE nlattr[FRA_TABLE, int32] 494 FRA_SUPPRESS_PREFIXLEN nlattr[FRA_SUPPRESS_PREFIXLEN, int32] 495 FRA_SUPPRESS_IFGROUP nlattr[FRA_SUPPRESS_IFGROUP, int32] 496 FRA_GOTO nlattr[FRA_GOTO, int32] 497 FRA_L3MDEV nlattr[FRA_L3MDEV, int8] 498 FRA_UID_RANGE nlattr[FRA_UID_RANGE, fib_rule_uid_range] 499 FRA_PROTOCOL nlattr[FRA_PROTOCOL, flags[rtm_protocol, int8]] 500 FRA_IP_PROTO nlattr[FRA_IP_PROTO, flags[ipv6_types, int8]] 501 FRA_SPORT_RANGE nlattr[FRA_SPORT_RANGE, fib_rule_port_range] 502 FRA_DPORT_RANGE nlattr[FRA_DPORT_RANGE, fib_rule_port_range] 503] [varlen] 504 505# FRA_DST/SRC are not in fib4/6_rule_policy. But fib4/6 still need them. 506# So I add them here. 507fib4_rule_policy [ 508 FRA_DST nlattr[RTA_DST, ipv4_addr] 509 FRA_SRC nlattr[RTA_SRC, ipv4_addr] 510 FRA_GENERIC_POLICY fra_generic_policy 511 FRA_FLOW nlattr[FRA_FLOW, int32] 512] [varlen] 513 514fib6_rule_policy [ 515 FRA_DST nlattr[RTA_DST, ipv6_addr] 516 FRA_SRC nlattr[RTA_SRC, ipv6_addr] 517 FIB_RULE_POLICY fra_generic_policy 518] [varlen] 519 520nl_neightbl_policy [ 521 NDTA_NAME nlattr[NDTA_NAME, string] 522 NDTA_THRESH1 nlattr[NDTA_THRESH1, int32] 523 NDTA_THRESH2 nlattr[NDTA_THRESH2, int32] 524 NDTA_THRESH3 nlattr[NDTA_THRESH3, int32] 525 NDTA_GC_INTERVAL nlattr[NDTA_GC_INTERVAL, int64] 526 NDTA_PARMS nlattr[NDTA_PARMS, array[nl_ntbl_parm_policy]] 527] [varlen] 528 529nl_ntbl_parm_policy [ 530 NDTPA_IFINDEX nlattr[NDTPA_IFINDEX, ifindex] 531 NDTPA_QUEUE_LEN nlattr[NDTPA_QUEUE_LEN, int32] 532 NDTPA_PROXY_QLEN nlattr[NDTPA_PROXY_QLEN, int32] 533 NDTPA_APP_PROBES nlattr[NDTPA_APP_PROBES, int32] 534 NDTPA_UCAST_PROBES nlattr[NDTPA_UCAST_PROBES, int32] 535 NDTPA_MCAST_PROBES nlattr[NDTPA_MCAST_PROBES, int32] 536 NDTPA_MCAST_REPROBES nlattr[NDTPA_MCAST_REPROBES, int32] 537 NDTPA_BASE_REACHABLE_TIME nlattr[NDTPA_BASE_REACHABLE_TIME, int64] 538 NDTPA_GC_STALETIME nlattr[NDTPA_GC_STALETIME, int64] 539 NDTPA_DELAY_PROBE_TIME nlattr[NDTPA_DELAY_PROBE_TIME, int64] 540 NDTPA_RETRANS_TIME nlattr[NDTPA_RETRANS_TIME, int64] 541 NDTPA_ANYCAST_DELAY nlattr[NDTPA_ANYCAST_DELAY, int64] 542 NDTPA_PROXY_DELAY nlattr[NDTPA_PROXY_DELAY, int64] 543 NDTPA_LOCKTIME nlattr[NDTPA_LOCKTIME, int64] 544] [varlen] 545 546nd_policy [ 547 NDA_DST_IPV4 nlattr[NDA_DST, ipv4_addr] 548 NDA_DST_IPV6 nlattr[NDA_DST, ipv6_addr] 549 NDA_DST_MAC nlattr[NDA_DST, mac_addr] 550 NDA_LLADDR nlattr[NDA_LLADDR, mac_addr] 551 NDA_CACHEINFO nlattr[NDA_CACHEINFO, nda_cacheinfo] 552 NDA_PROBES nlattr[NDA_PROBES, int32] 553 NDA_VLAN nlattr[NDA_VLAN, int16[0:4]] 554 NDA_PORT nlattr[NDA_PORT, sock_port] 555 NDA_VNI nlattr[NDA_VNI, int32] 556 NDA_IFINDEX nlattr[NDA_IFINDEX, ifindex] 557 NDA_MASTER nlattr[NDA_MASTER, int32] 558 NDA_LINK_NETNSID nlattr[NDA_LINK_NETNSID, int32] 559 NDA_SRC_VNI nlattr[NDA_SRC_VNI, int32] 560] [varlen] 561 562nda_cacheinfo { 563 ndm_confirmed int32 564 ndm_used int32 565 ndm_updated int32 566 ndm_refcnt int32 567} 568 569rtnexthop { 570 rtnh_len int16 571 rtnh_flags int8 572 rtnh_hops int8 573 rtnh_ifindex ifindex 574} 575 576ifa_cacheinfo { 577 ifa_prefered int32 578 ifa_valid int32 579 cstamp int32 580 tstamp int32 581} 582 583devconf_ip_policy [ 584 NETCONFA_IFINDEX nlattr[NETCONFA_IFINDEX, ifindex] 585 NETCONFA_FORWARDING nlattr[NETCONFA_FORWARDING, int32] 586 NETCONFA_RP_FILTER nlattr[NETCONFA_RP_FILTER, int32] 587 NETCONFA_PROXY_NEIGH nlattr[NETCONFA_PROXY_NEIGH, int32] 588 IGNORE_ROUTES_WITH_LINKDOWN nlattr[NETCONFA_IGNORE_ROUTES_WITH_LINKDOWN, int32] 589] [varlen] 590 591devconf_mpls_policy [ 592 NETCONFA_IFINDEX nlattr[NETCONFA_IFINDEX, ifindex] 593 IGNORE_ROUTES_WITH_LINKDOWN nlattr[NETCONFA_IGNORE_ROUTES_WITH_LINKDOWN, int32] 594] [varlen] 595 596# TODO: implement these 597type ifla_vf_policy nl_generic_attr 598type ifla_port_policy nl_generic_attr 599type ifla_xdp_policy nl_generic_attr 600 601rtnl_link_ifmap { 602 mem_start int64 603 mem_end int64 604 base_addr int64 605 irq int16 606 dma int8 607 port int8 608} 609 610rtnl_af = AF_INET, AF_INET6, AF_BRIDGE, AF_MPLS 611net_device_flags = IFF_UP, IFF_BROADCAST, IFF_DEBUG, IFF_LOOPBACK, IFF_POINTOPOINT, IFF_NOTRAILERS, IFF_RUNNING, IFF_NOARP, IFF_PROMISC, IFF_ALLMULTI, IFF_MASTER, IFF_SLAVE, IFF_MULTICAST, IFF_PORTSEL, IFF_AUTOMEDIA, IFF_DYNAMIC, IFF_LOWER_UP, IFF_DORMANT, IFF_ECHO 612ifa_flags = IFA_F_SECONDARY, IFA_F_NODAD, IFA_F_OPTIMISTIC, IFA_F_DADFAILED, IFA_F_HOMEADDRESS, IFA_F_DEPRECATED, IFA_F_TENTATIVE, IFA_F_PERMANENT, IFA_F_MANAGETEMPADDR, IFA_F_NOPREFIXROUTE, IFA_F_MCAUTOJOIN 613rt_scope_t = RT_SCOPE_UNIVERSE, RT_SCOPE_SITE, RT_SCOPE_LINK, RT_SCOPE_HOST, RT_SCOPE_NOWHERE 614rtm_protocol = RTPROT_UNSPEC, RTPROT_REDIRECT, RTPROT_KERNEL, RTPROT_BOOT, RTPROT_STATIC 615rtm_type = RTN_UNSPEC, RTN_UNICAST, RTN_LOCAL, RTN_BROADCAST, RTN_ANYCAST, RTN_MULTICAST, RTN_BLACKHOLE, RTN_UNREACHABLE, RTN_PROHIBIT, RTN_THROW, RTN_NAT, RTN_XRESOLVE 616rtm_flags = RTM_F_NOTIFY, RTM_F_CLONED, RTM_F_EQUALIZE, RTM_F_PREFIX, RTM_F_LOOKUP_TABLE, RTM_F_FIB_MATCH 617fr_actions = FR_ACT_UNSPEC, FR_ACT_TO_TBL, FR_ACT_GOTO, FR_ACT_NOP, FR_ACT_RES3, FR_ACT_RES4, FR_ACT_BLACKHOLE, FR_ACT_UNREACHABLE, FR_ACT_PROHIBIT 618fr_flags = FIB_RULE_PERMANENT, FIB_RULE_INVERT, FIB_RULE_UNRESOLVED, FIB_RULE_IIF_DETACHED, FIB_RULE_OIF_DETACHED, FIB_RULE_FIND_SADDR 619lwtunnel_encap_types = LWTUNNEL_ENCAP_NONE, LWTUNNEL_ENCAP_MPLS, LWTUNNEL_ENCAP_IP, LWTUNNEL_ENCAP_ILA, LWTUNNEL_ENCAP_IP6, LWTUNNEL_ENCAP_SEG6, LWTUNNEL_ENCAP_BPF, LWTUNNEL_ENCAP_SEG6_LOCAL 620rt_table_types = RT_TABLE_UNSPEC, RT_TABLE_COMPAT, RT_TABLE_DEFAULT, RT_TABLE_MAIN, RT_TABLE_LOCAL 621ndm_state = NUD_INCOMPLETE, NUD_REACHABLE, NUD_STALE, NUD_DELAY, NUD_PROBE, NUD_FAILED, NUD_NOARP, NUD_PERMANENT, NUD_NONE 622ndm_flags = NTF_USE, NTF_SELF, NTF_MASTER, NTF_PROXY, NTF_EXT_LEARNED, NTF_OFFLOADED, NTF_ROUTER 623ifa_prefixlen = 0, 1, 8, 16, 24, 31, 32, 56, 63, 64, 128 624rtm_addr_len = 0, 16, 20, 32, 128 625filter_mask = IFLA_STATS_UNSPEC, IFLA_STATS_LINK_64, IFLA_STATS_LINK_XSTATS, IFLA_STATS_LINK_XSTATS_SLAVE, IFLA_STATS_LINK_OFFLOAD_XSTATS, IFLA_STATS_AF_SPEC 626tunnel_encap_types = TUNNEL_ENCAP_NONE, TUNNEL_ENCAP_FOU, TUNNEL_ENCAP_GUE, TUNNEL_ENCAP_MPLS 627