blob: 6309914e922dc0d5b62da9f30b17027b4232bf16 [file] [log] [blame]
Elliott Hughes180edef2023-11-02 00:08:05 +00001/*
2 * This file is auto-generated. Modifications will be lost.
3 *
4 * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5 * for more information.
6 */
Ben Cheng655a7c02013-10-16 16:09:24 -07007#ifndef _UAPI__LINUX_RTNETLINK_H
8#define _UAPI__LINUX_RTNETLINK_H
9#include <linux/types.h>
10#include <linux/netlink.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070011#include <linux/if_link.h>
12#include <linux/if_addr.h>
13#include <linux/neighbour.h>
14#define RTNL_FAMILY_IPMR 128
Ben Cheng655a7c02013-10-16 16:09:24 -070015#define RTNL_FAMILY_IP6MR 129
16#define RTNL_FAMILY_MAX 129
17enum {
Tao Baod7db5942015-01-28 10:07:51 -080018 RTM_BASE = 16,
Ben Cheng655a7c02013-10-16 16:09:24 -070019#define RTM_BASE RTM_BASE
Tao Baod7db5942015-01-28 10:07:51 -080020 RTM_NEWLINK = 16,
Ben Cheng655a7c02013-10-16 16:09:24 -070021#define RTM_NEWLINK RTM_NEWLINK
Tao Baod7db5942015-01-28 10:07:51 -080022 RTM_DELLINK,
Ben Cheng655a7c02013-10-16 16:09:24 -070023#define RTM_DELLINK RTM_DELLINK
Tao Baod7db5942015-01-28 10:07:51 -080024 RTM_GETLINK,
Ben Cheng655a7c02013-10-16 16:09:24 -070025#define RTM_GETLINK RTM_GETLINK
Tao Baod7db5942015-01-28 10:07:51 -080026 RTM_SETLINK,
Ben Cheng655a7c02013-10-16 16:09:24 -070027#define RTM_SETLINK RTM_SETLINK
Tao Baod7db5942015-01-28 10:07:51 -080028 RTM_NEWADDR = 20,
Ben Cheng655a7c02013-10-16 16:09:24 -070029#define RTM_NEWADDR RTM_NEWADDR
Tao Baod7db5942015-01-28 10:07:51 -080030 RTM_DELADDR,
Ben Cheng655a7c02013-10-16 16:09:24 -070031#define RTM_DELADDR RTM_DELADDR
Tao Baod7db5942015-01-28 10:07:51 -080032 RTM_GETADDR,
Ben Cheng655a7c02013-10-16 16:09:24 -070033#define RTM_GETADDR RTM_GETADDR
Tao Baod7db5942015-01-28 10:07:51 -080034 RTM_NEWROUTE = 24,
Ben Cheng655a7c02013-10-16 16:09:24 -070035#define RTM_NEWROUTE RTM_NEWROUTE
Tao Baod7db5942015-01-28 10:07:51 -080036 RTM_DELROUTE,
Ben Cheng655a7c02013-10-16 16:09:24 -070037#define RTM_DELROUTE RTM_DELROUTE
Tao Baod7db5942015-01-28 10:07:51 -080038 RTM_GETROUTE,
Ben Cheng655a7c02013-10-16 16:09:24 -070039#define RTM_GETROUTE RTM_GETROUTE
Tao Baod7db5942015-01-28 10:07:51 -080040 RTM_NEWNEIGH = 28,
Ben Cheng655a7c02013-10-16 16:09:24 -070041#define RTM_NEWNEIGH RTM_NEWNEIGH
Tao Baod7db5942015-01-28 10:07:51 -080042 RTM_DELNEIGH,
Ben Cheng655a7c02013-10-16 16:09:24 -070043#define RTM_DELNEIGH RTM_DELNEIGH
Tao Baod7db5942015-01-28 10:07:51 -080044 RTM_GETNEIGH,
Ben Cheng655a7c02013-10-16 16:09:24 -070045#define RTM_GETNEIGH RTM_GETNEIGH
Tao Baod7db5942015-01-28 10:07:51 -080046 RTM_NEWRULE = 32,
Ben Cheng655a7c02013-10-16 16:09:24 -070047#define RTM_NEWRULE RTM_NEWRULE
Tao Baod7db5942015-01-28 10:07:51 -080048 RTM_DELRULE,
Ben Cheng655a7c02013-10-16 16:09:24 -070049#define RTM_DELRULE RTM_DELRULE
Tao Baod7db5942015-01-28 10:07:51 -080050 RTM_GETRULE,
Ben Cheng655a7c02013-10-16 16:09:24 -070051#define RTM_GETRULE RTM_GETRULE
Tao Baod7db5942015-01-28 10:07:51 -080052 RTM_NEWQDISC = 36,
Ben Cheng655a7c02013-10-16 16:09:24 -070053#define RTM_NEWQDISC RTM_NEWQDISC
Tao Baod7db5942015-01-28 10:07:51 -080054 RTM_DELQDISC,
Ben Cheng655a7c02013-10-16 16:09:24 -070055#define RTM_DELQDISC RTM_DELQDISC
Tao Baod7db5942015-01-28 10:07:51 -080056 RTM_GETQDISC,
Ben Cheng655a7c02013-10-16 16:09:24 -070057#define RTM_GETQDISC RTM_GETQDISC
Tao Baod7db5942015-01-28 10:07:51 -080058 RTM_NEWTCLASS = 40,
Ben Cheng655a7c02013-10-16 16:09:24 -070059#define RTM_NEWTCLASS RTM_NEWTCLASS
Tao Baod7db5942015-01-28 10:07:51 -080060 RTM_DELTCLASS,
Ben Cheng655a7c02013-10-16 16:09:24 -070061#define RTM_DELTCLASS RTM_DELTCLASS
Tao Baod7db5942015-01-28 10:07:51 -080062 RTM_GETTCLASS,
Ben Cheng655a7c02013-10-16 16:09:24 -070063#define RTM_GETTCLASS RTM_GETTCLASS
Tao Baod7db5942015-01-28 10:07:51 -080064 RTM_NEWTFILTER = 44,
Ben Cheng655a7c02013-10-16 16:09:24 -070065#define RTM_NEWTFILTER RTM_NEWTFILTER
Tao Baod7db5942015-01-28 10:07:51 -080066 RTM_DELTFILTER,
Ben Cheng655a7c02013-10-16 16:09:24 -070067#define RTM_DELTFILTER RTM_DELTFILTER
Tao Baod7db5942015-01-28 10:07:51 -080068 RTM_GETTFILTER,
Ben Cheng655a7c02013-10-16 16:09:24 -070069#define RTM_GETTFILTER RTM_GETTFILTER
Tao Baod7db5942015-01-28 10:07:51 -080070 RTM_NEWACTION = 48,
Ben Cheng655a7c02013-10-16 16:09:24 -070071#define RTM_NEWACTION RTM_NEWACTION
Tao Baod7db5942015-01-28 10:07:51 -080072 RTM_DELACTION,
Ben Cheng655a7c02013-10-16 16:09:24 -070073#define RTM_DELACTION RTM_DELACTION
Tao Baod7db5942015-01-28 10:07:51 -080074 RTM_GETACTION,
Ben Cheng655a7c02013-10-16 16:09:24 -070075#define RTM_GETACTION RTM_GETACTION
Tao Baod7db5942015-01-28 10:07:51 -080076 RTM_NEWPREFIX = 52,
Ben Cheng655a7c02013-10-16 16:09:24 -070077#define RTM_NEWPREFIX RTM_NEWPREFIX
Tao Baod7db5942015-01-28 10:07:51 -080078 RTM_GETMULTICAST = 58,
Ben Cheng655a7c02013-10-16 16:09:24 -070079#define RTM_GETMULTICAST RTM_GETMULTICAST
Tao Baod7db5942015-01-28 10:07:51 -080080 RTM_GETANYCAST = 62,
Ben Cheng655a7c02013-10-16 16:09:24 -070081#define RTM_GETANYCAST RTM_GETANYCAST
Tao Baod7db5942015-01-28 10:07:51 -080082 RTM_NEWNEIGHTBL = 64,
Ben Cheng655a7c02013-10-16 16:09:24 -070083#define RTM_NEWNEIGHTBL RTM_NEWNEIGHTBL
Tao Baod7db5942015-01-28 10:07:51 -080084 RTM_GETNEIGHTBL = 66,
Ben Cheng655a7c02013-10-16 16:09:24 -070085#define RTM_GETNEIGHTBL RTM_GETNEIGHTBL
Tao Baod7db5942015-01-28 10:07:51 -080086 RTM_SETNEIGHTBL,
Ben Cheng655a7c02013-10-16 16:09:24 -070087#define RTM_SETNEIGHTBL RTM_SETNEIGHTBL
Tao Baod7db5942015-01-28 10:07:51 -080088 RTM_NEWNDUSEROPT = 68,
Ben Cheng655a7c02013-10-16 16:09:24 -070089#define RTM_NEWNDUSEROPT RTM_NEWNDUSEROPT
Tao Baod7db5942015-01-28 10:07:51 -080090 RTM_NEWADDRLABEL = 72,
Ben Cheng655a7c02013-10-16 16:09:24 -070091#define RTM_NEWADDRLABEL RTM_NEWADDRLABEL
Tao Baod7db5942015-01-28 10:07:51 -080092 RTM_DELADDRLABEL,
Ben Cheng655a7c02013-10-16 16:09:24 -070093#define RTM_DELADDRLABEL RTM_DELADDRLABEL
Tao Baod7db5942015-01-28 10:07:51 -080094 RTM_GETADDRLABEL,
Ben Cheng655a7c02013-10-16 16:09:24 -070095#define RTM_GETADDRLABEL RTM_GETADDRLABEL
Tao Baod7db5942015-01-28 10:07:51 -080096 RTM_GETDCB = 78,
Ben Cheng655a7c02013-10-16 16:09:24 -070097#define RTM_GETDCB RTM_GETDCB
Tao Baod7db5942015-01-28 10:07:51 -080098 RTM_SETDCB,
Ben Cheng655a7c02013-10-16 16:09:24 -070099#define RTM_SETDCB RTM_SETDCB
Tao Baod7db5942015-01-28 10:07:51 -0800100 RTM_NEWNETCONF = 80,
Ben Cheng655a7c02013-10-16 16:09:24 -0700101#define RTM_NEWNETCONF RTM_NEWNETCONF
Christopher Ferris525ce912017-07-26 13:12:53 -0700102 RTM_DELNETCONF,
103#define RTM_DELNETCONF RTM_DELNETCONF
Tao Baod7db5942015-01-28 10:07:51 -0800104 RTM_GETNETCONF = 82,
Ben Cheng655a7c02013-10-16 16:09:24 -0700105#define RTM_GETNETCONF RTM_GETNETCONF
Tao Baod7db5942015-01-28 10:07:51 -0800106 RTM_NEWMDB = 84,
Ben Cheng655a7c02013-10-16 16:09:24 -0700107#define RTM_NEWMDB RTM_NEWMDB
Tao Baod7db5942015-01-28 10:07:51 -0800108 RTM_DELMDB = 85,
Ben Cheng655a7c02013-10-16 16:09:24 -0700109#define RTM_DELMDB RTM_DELMDB
Tao Baod7db5942015-01-28 10:07:51 -0800110 RTM_GETMDB = 86,
Ben Cheng655a7c02013-10-16 16:09:24 -0700111#define RTM_GETMDB RTM_GETMDB
Christopher Ferris05d08e92016-02-04 13:16:38 -0800112 RTM_NEWNSID = 88,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800113#define RTM_NEWNSID RTM_NEWNSID
114 RTM_DELNSID = 89,
115#define RTM_DELNSID RTM_DELNSID
116 RTM_GETNSID = 90,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800117#define RTM_GETNSID RTM_GETNSID
Christopher Ferris106b3a82016-08-24 12:15:38 -0700118 RTM_NEWSTATS = 92,
119#define RTM_NEWSTATS RTM_NEWSTATS
120 RTM_GETSTATS = 94,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700121#define RTM_GETSTATS RTM_GETSTATS
Christopher Ferris10a76e62022-06-08 13:31:52 -0700122 RTM_SETSTATS,
123#define RTM_SETSTATS RTM_SETSTATS
Christopher Ferris1308ad32017-11-14 17:32:13 -0800124 RTM_NEWCACHEREPORT = 96,
125#define RTM_NEWCACHEREPORT RTM_NEWCACHEREPORT
Christopher Ferris9ce28842018-10-25 12:11:39 -0700126 RTM_NEWCHAIN = 100,
127#define RTM_NEWCHAIN RTM_NEWCHAIN
128 RTM_DELCHAIN,
129#define RTM_DELCHAIN RTM_DELCHAIN
130 RTM_GETCHAIN,
131#define RTM_GETCHAIN RTM_GETCHAIN
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700132 RTM_NEWNEXTHOP = 104,
133#define RTM_NEWNEXTHOP RTM_NEWNEXTHOP
134 RTM_DELNEXTHOP,
135#define RTM_DELNEXTHOP RTM_DELNEXTHOP
136 RTM_GETNEXTHOP,
137#define RTM_GETNEXTHOP RTM_GETNEXTHOP
Christopher Ferrisd32ca142020-02-04 16:16:51 -0800138 RTM_NEWLINKPROP = 108,
139#define RTM_NEWLINKPROP RTM_NEWLINKPROP
140 RTM_DELLINKPROP,
141#define RTM_DELLINKPROP RTM_DELLINKPROP
142 RTM_GETLINKPROP,
143#define RTM_GETLINKPROP RTM_GETLINKPROP
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700144 RTM_NEWVLAN = 112,
145#define RTM_NEWNVLAN RTM_NEWVLAN
146 RTM_DELVLAN,
147#define RTM_DELVLAN RTM_DELVLAN
148 RTM_GETVLAN,
149#define RTM_GETVLAN RTM_GETVLAN
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000150 RTM_NEWNEXTHOPBUCKET = 116,
151#define RTM_NEWNEXTHOPBUCKET RTM_NEWNEXTHOPBUCKET
152 RTM_DELNEXTHOPBUCKET,
153#define RTM_DELNEXTHOPBUCKET RTM_DELNEXTHOPBUCKET
154 RTM_GETNEXTHOPBUCKET,
155#define RTM_GETNEXTHOPBUCKET RTM_GETNEXTHOPBUCKET
Christopher Ferris10a76e62022-06-08 13:31:52 -0700156 RTM_NEWTUNNEL = 120,
157#define RTM_NEWTUNNEL RTM_NEWTUNNEL
158 RTM_DELTUNNEL,
159#define RTM_DELTUNNEL RTM_DELTUNNEL
160 RTM_GETTUNNEL,
161#define RTM_GETTUNNEL RTM_GETTUNNEL
Christopher Ferris05d08e92016-02-04 13:16:38 -0800162 __RTM_MAX,
Ben Cheng655a7c02013-10-16 16:09:24 -0700163#define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1)
164};
165#define RTM_NR_MSGTYPES (RTM_MAX + 1 - RTM_BASE)
166#define RTM_NR_FAMILIES (RTM_NR_MSGTYPES >> 2)
Ben Cheng655a7c02013-10-16 16:09:24 -0700167#define RTM_FAM(cmd) (((cmd) - RTM_BASE) >> 2)
168struct rtattr {
Tao Baod7db5942015-01-28 10:07:51 -0800169 unsigned short rta_len;
170 unsigned short rta_type;
Ben Cheng655a7c02013-10-16 16:09:24 -0700171};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800172#define RTA_ALIGNTO 4U
Tao Baod7db5942015-01-28 10:07:51 -0800173#define RTA_ALIGN(len) (((len) + RTA_ALIGNTO - 1) & ~(RTA_ALIGNTO - 1))
174#define RTA_OK(rta,len) ((len) >= (int) sizeof(struct rtattr) && (rta)->rta_len >= sizeof(struct rtattr) && (rta)->rta_len <= (len))
Tao Baod7db5942015-01-28 10:07:51 -0800175#define RTA_NEXT(rta,attrlen) ((attrlen) -= RTA_ALIGN((rta)->rta_len), (struct rtattr *) (((char *) (rta)) + RTA_ALIGN((rta)->rta_len)))
Ben Cheng655a7c02013-10-16 16:09:24 -0700176#define RTA_LENGTH(len) (RTA_ALIGN(sizeof(struct rtattr)) + (len))
177#define RTA_SPACE(len) RTA_ALIGN(RTA_LENGTH(len))
Tao Baod7db5942015-01-28 10:07:51 -0800178#define RTA_DATA(rta) ((void *) (((char *) (rta)) + RTA_LENGTH(0)))
Tao Baod7db5942015-01-28 10:07:51 -0800179#define RTA_PAYLOAD(rta) ((int) ((rta)->rta_len) - RTA_LENGTH(0))
Ben Cheng655a7c02013-10-16 16:09:24 -0700180struct rtmsg {
Tao Baod7db5942015-01-28 10:07:51 -0800181 unsigned char rtm_family;
182 unsigned char rtm_dst_len;
Tao Baod7db5942015-01-28 10:07:51 -0800183 unsigned char rtm_src_len;
184 unsigned char rtm_tos;
185 unsigned char rtm_table;
186 unsigned char rtm_protocol;
Tao Baod7db5942015-01-28 10:07:51 -0800187 unsigned char rtm_scope;
188 unsigned char rtm_type;
189 unsigned rtm_flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700190};
Ben Cheng655a7c02013-10-16 16:09:24 -0700191enum {
Tao Baod7db5942015-01-28 10:07:51 -0800192 RTN_UNSPEC,
193 RTN_UNICAST,
194 RTN_LOCAL,
Tao Baod7db5942015-01-28 10:07:51 -0800195 RTN_BROADCAST,
196 RTN_ANYCAST,
197 RTN_MULTICAST,
198 RTN_BLACKHOLE,
Tao Baod7db5942015-01-28 10:07:51 -0800199 RTN_UNREACHABLE,
200 RTN_PROHIBIT,
201 RTN_THROW,
202 RTN_NAT,
Tao Baod7db5942015-01-28 10:07:51 -0800203 RTN_XRESOLVE,
204 __RTN_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -0700205};
206#define RTN_MAX (__RTN_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700207#define RTPROT_UNSPEC 0
208#define RTPROT_REDIRECT 1
209#define RTPROT_KERNEL 2
210#define RTPROT_BOOT 3
Ben Cheng655a7c02013-10-16 16:09:24 -0700211#define RTPROT_STATIC 4
212#define RTPROT_GATED 8
213#define RTPROT_RA 9
214#define RTPROT_MRT 10
Ben Cheng655a7c02013-10-16 16:09:24 -0700215#define RTPROT_ZEBRA 11
216#define RTPROT_BIRD 12
217#define RTPROT_DNROUTED 13
218#define RTPROT_XORP 14
Ben Cheng655a7c02013-10-16 16:09:24 -0700219#define RTPROT_NTK 15
220#define RTPROT_DHCP 16
Christopher Ferris05d08e92016-02-04 13:16:38 -0800221#define RTPROT_MROUTED 17
Christopher Ferris25c18d42020-10-14 17:42:58 -0700222#define RTPROT_KEEPALIVED 18
Christopher Ferris05d08e92016-02-04 13:16:38 -0800223#define RTPROT_BABEL 42
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000224#define RTPROT_OPENR 99
Christopher Ferris9ce28842018-10-25 12:11:39 -0700225#define RTPROT_BGP 186
226#define RTPROT_ISIS 187
227#define RTPROT_OSPF 188
228#define RTPROT_RIP 189
229#define RTPROT_EIGRP 192
Christopher Ferris05d08e92016-02-04 13:16:38 -0800230enum rt_scope_t {
Tao Baod7db5942015-01-28 10:07:51 -0800231 RT_SCOPE_UNIVERSE = 0,
232 RT_SCOPE_SITE = 200,
233 RT_SCOPE_LINK = 253,
234 RT_SCOPE_HOST = 254,
Tao Baod7db5942015-01-28 10:07:51 -0800235 RT_SCOPE_NOWHERE = 255
Ben Cheng655a7c02013-10-16 16:09:24 -0700236};
237#define RTM_F_NOTIFY 0x100
238#define RTM_F_CLONED 0x200
Ben Cheng655a7c02013-10-16 16:09:24 -0700239#define RTM_F_EQUALIZE 0x400
240#define RTM_F_PREFIX 0x800
Christopher Ferris05d08e92016-02-04 13:16:38 -0800241#define RTM_F_LOOKUP_TABLE 0x1000
Christopher Ferris1308ad32017-11-14 17:32:13 -0800242#define RTM_F_FIB_MATCH 0x2000
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700243#define RTM_F_OFFLOAD 0x4000
244#define RTM_F_TRAP 0x8000
Christopher Ferrisa9750ed2021-05-03 14:02:49 -0700245#define RTM_F_OFFLOAD_FAILED 0x20000000
Ben Cheng655a7c02013-10-16 16:09:24 -0700246enum rt_class_t {
Tao Baod7db5942015-01-28 10:07:51 -0800247 RT_TABLE_UNSPEC = 0,
Tao Baod7db5942015-01-28 10:07:51 -0800248 RT_TABLE_COMPAT = 252,
249 RT_TABLE_DEFAULT = 253,
250 RT_TABLE_MAIN = 254,
251 RT_TABLE_LOCAL = 255,
Tao Baod7db5942015-01-28 10:07:51 -0800252 RT_TABLE_MAX = 0xFFFFFFFF
Ben Cheng655a7c02013-10-16 16:09:24 -0700253};
254enum rtattr_type_t {
Tao Baod7db5942015-01-28 10:07:51 -0800255 RTA_UNSPEC,
Tao Baod7db5942015-01-28 10:07:51 -0800256 RTA_DST,
257 RTA_SRC,
258 RTA_IIF,
259 RTA_OIF,
Tao Baod7db5942015-01-28 10:07:51 -0800260 RTA_GATEWAY,
261 RTA_PRIORITY,
262 RTA_PREFSRC,
263 RTA_METRICS,
Tao Baod7db5942015-01-28 10:07:51 -0800264 RTA_MULTIPATH,
265 RTA_PROTOINFO,
266 RTA_FLOW,
267 RTA_CACHEINFO,
Tao Baod7db5942015-01-28 10:07:51 -0800268 RTA_SESSION,
269 RTA_MP_ALGO,
270 RTA_TABLE,
271 RTA_MARK,
Tao Baod7db5942015-01-28 10:07:51 -0800272 RTA_MFC_STATS,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800273 RTA_VIA,
274 RTA_NEWDST,
275 RTA_PREF,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800276 RTA_ENCAP_TYPE,
277 RTA_ENCAP,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700278 RTA_EXPIRES,
279 RTA_PAD,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800280 RTA_UID,
Christopher Ferris525ce912017-07-26 13:12:53 -0700281 RTA_TTL_PROPAGATE,
Christopher Ferris9ce28842018-10-25 12:11:39 -0700282 RTA_IP_PROTO,
283 RTA_SPORT,
284 RTA_DPORT,
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700285 RTA_NH_ID,
Tao Baod7db5942015-01-28 10:07:51 -0800286 __RTA_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -0700287};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800288#define RTA_MAX (__RTA_MAX - 1)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800289#define RTM_RTA(r) ((struct rtattr *) (((char *) (r)) + NLMSG_ALIGN(sizeof(struct rtmsg))))
Tao Baod7db5942015-01-28 10:07:51 -0800290#define RTM_PAYLOAD(n) NLMSG_PAYLOAD(n, sizeof(struct rtmsg))
Ben Cheng655a7c02013-10-16 16:09:24 -0700291struct rtnexthop {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800292 unsigned short rtnh_len;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800293 unsigned char rtnh_flags;
Tao Baod7db5942015-01-28 10:07:51 -0800294 unsigned char rtnh_hops;
295 int rtnh_ifindex;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800296};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800297#define RTNH_F_DEAD 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700298#define RTNH_F_PERVASIVE 2
299#define RTNH_F_ONLINK 4
Christopher Ferris05d08e92016-02-04 13:16:38 -0800300#define RTNH_F_OFFLOAD 8
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800301#define RTNH_F_LINKDOWN 16
Christopher Ferris525ce912017-07-26 13:12:53 -0700302#define RTNH_F_UNRESOLVED 32
Christopher Ferris05667cd2021-02-16 16:01:34 -0800303#define RTNH_F_TRAP 64
304#define RTNH_COMPARE_MASK (RTNH_F_DEAD | RTNH_F_LINKDOWN | RTNH_F_OFFLOAD | RTNH_F_TRAP)
Ben Cheng655a7c02013-10-16 16:09:24 -0700305#define RTNH_ALIGNTO 4
Tao Baod7db5942015-01-28 10:07:51 -0800306#define RTNH_ALIGN(len) (((len) + RTNH_ALIGNTO - 1) & ~(RTNH_ALIGNTO - 1))
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800307#define RTNH_OK(rtnh,len) ((rtnh)->rtnh_len >= sizeof(struct rtnexthop) && ((int) (rtnh)->rtnh_len) <= (len))
Tao Baod7db5942015-01-28 10:07:51 -0800308#define RTNH_NEXT(rtnh) ((struct rtnexthop *) (((char *) (rtnh)) + RTNH_ALIGN((rtnh)->rtnh_len)))
Ben Cheng655a7c02013-10-16 16:09:24 -0700309#define RTNH_LENGTH(len) (RTNH_ALIGN(sizeof(struct rtnexthop)) + (len))
Ben Cheng655a7c02013-10-16 16:09:24 -0700310#define RTNH_SPACE(len) RTNH_ALIGN(RTNH_LENGTH(len))
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800311#define RTNH_DATA(rtnh) ((struct rtattr *) (((char *) (rtnh)) + RTNH_LENGTH(0)))
Christopher Ferris05d08e92016-02-04 13:16:38 -0800312struct rtvia {
313 __kernel_sa_family_t rtvia_family;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700314 __u8 rtvia_addr[];
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800315};
Ben Cheng655a7c02013-10-16 16:09:24 -0700316struct rta_cacheinfo {
Tao Baod7db5942015-01-28 10:07:51 -0800317 __u32 rta_clntref;
Tao Baod7db5942015-01-28 10:07:51 -0800318 __u32 rta_lastuse;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800319 __s32 rta_expires;
Tao Baod7db5942015-01-28 10:07:51 -0800320 __u32 rta_error;
321 __u32 rta_used;
Ben Cheng655a7c02013-10-16 16:09:24 -0700322#define RTNETLINK_HAVE_PEERINFO 1
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800323 __u32 rta_id;
Tao Baod7db5942015-01-28 10:07:51 -0800324 __u32 rta_ts;
325 __u32 rta_tsage;
Ben Cheng655a7c02013-10-16 16:09:24 -0700326};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800327enum {
Tao Baod7db5942015-01-28 10:07:51 -0800328 RTAX_UNSPEC,
Ben Cheng655a7c02013-10-16 16:09:24 -0700329#define RTAX_UNSPEC RTAX_UNSPEC
Tao Baod7db5942015-01-28 10:07:51 -0800330 RTAX_LOCK,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800331#define RTAX_LOCK RTAX_LOCK
Tao Baod7db5942015-01-28 10:07:51 -0800332 RTAX_MTU,
Ben Cheng655a7c02013-10-16 16:09:24 -0700333#define RTAX_MTU RTAX_MTU
Tao Baod7db5942015-01-28 10:07:51 -0800334 RTAX_WINDOW,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800335#define RTAX_WINDOW RTAX_WINDOW
Tao Baod7db5942015-01-28 10:07:51 -0800336 RTAX_RTT,
Ben Cheng655a7c02013-10-16 16:09:24 -0700337#define RTAX_RTT RTAX_RTT
Tao Baod7db5942015-01-28 10:07:51 -0800338 RTAX_RTTVAR,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800339#define RTAX_RTTVAR RTAX_RTTVAR
Tao Baod7db5942015-01-28 10:07:51 -0800340 RTAX_SSTHRESH,
Ben Cheng655a7c02013-10-16 16:09:24 -0700341#define RTAX_SSTHRESH RTAX_SSTHRESH
Tao Baod7db5942015-01-28 10:07:51 -0800342 RTAX_CWND,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800343#define RTAX_CWND RTAX_CWND
Tao Baod7db5942015-01-28 10:07:51 -0800344 RTAX_ADVMSS,
Ben Cheng655a7c02013-10-16 16:09:24 -0700345#define RTAX_ADVMSS RTAX_ADVMSS
Tao Baod7db5942015-01-28 10:07:51 -0800346 RTAX_REORDERING,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800347#define RTAX_REORDERING RTAX_REORDERING
Tao Baod7db5942015-01-28 10:07:51 -0800348 RTAX_HOPLIMIT,
Ben Cheng655a7c02013-10-16 16:09:24 -0700349#define RTAX_HOPLIMIT RTAX_HOPLIMIT
Tao Baod7db5942015-01-28 10:07:51 -0800350 RTAX_INITCWND,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800351#define RTAX_INITCWND RTAX_INITCWND
Tao Baod7db5942015-01-28 10:07:51 -0800352 RTAX_FEATURES,
Ben Cheng655a7c02013-10-16 16:09:24 -0700353#define RTAX_FEATURES RTAX_FEATURES
Tao Baod7db5942015-01-28 10:07:51 -0800354 RTAX_RTO_MIN,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800355#define RTAX_RTO_MIN RTAX_RTO_MIN
Tao Baod7db5942015-01-28 10:07:51 -0800356 RTAX_INITRWND,
Ben Cheng655a7c02013-10-16 16:09:24 -0700357#define RTAX_INITRWND RTAX_INITRWND
Tao Baod7db5942015-01-28 10:07:51 -0800358 RTAX_QUICKACK,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800359#define RTAX_QUICKACK RTAX_QUICKACK
Christopher Ferris05d08e92016-02-04 13:16:38 -0800360 RTAX_CC_ALGO,
361#define RTAX_CC_ALGO RTAX_CC_ALGO
Christopher Ferris934ec942018-01-31 15:29:16 -0800362 RTAX_FASTOPEN_NO_COOKIE,
363#define RTAX_FASTOPEN_NO_COOKIE RTAX_FASTOPEN_NO_COOKIE
Tao Baod7db5942015-01-28 10:07:51 -0800364 __RTAX_MAX
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800365};
Ben Cheng655a7c02013-10-16 16:09:24 -0700366#define RTAX_MAX (__RTAX_MAX - 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800367#define RTAX_FEATURE_ECN (1 << 0)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800368#define RTAX_FEATURE_SACK (1 << 1)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800369#define RTAX_FEATURE_TIMESTAMP (1 << 2)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800370#define RTAX_FEATURE_ALLFRAG (1 << 3)
371#define RTAX_FEATURE_MASK (RTAX_FEATURE_ECN | RTAX_FEATURE_SACK | RTAX_FEATURE_TIMESTAMP | RTAX_FEATURE_ALLFRAG)
Ben Cheng655a7c02013-10-16 16:09:24 -0700372struct rta_session {
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800373 __u8 proto;
Tao Baod7db5942015-01-28 10:07:51 -0800374 __u8 pad1;
Tao Baod7db5942015-01-28 10:07:51 -0800375 __u16 pad2;
376 union {
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800377 struct {
Tao Baod7db5942015-01-28 10:07:51 -0800378 __u16 sport;
Tao Baod7db5942015-01-28 10:07:51 -0800379 __u16 dport;
380 } ports;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800381 struct {
Tao Baod7db5942015-01-28 10:07:51 -0800382 __u8 type;
Tao Baod7db5942015-01-28 10:07:51 -0800383 __u8 code;
384 __u16 ident;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800385 } icmpt;
Tao Baod7db5942015-01-28 10:07:51 -0800386 __u32 spi;
Tao Baod7db5942015-01-28 10:07:51 -0800387 } u;
Ben Cheng655a7c02013-10-16 16:09:24 -0700388};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800389struct rta_mfc_stats {
Tao Baod7db5942015-01-28 10:07:51 -0800390 __u64 mfcs_packets;
Tao Baod7db5942015-01-28 10:07:51 -0800391 __u64 mfcs_bytes;
392 __u64 mfcs_wrong_if;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800393};
Ben Cheng655a7c02013-10-16 16:09:24 -0700394struct rtgenmsg {
Tao Baod7db5942015-01-28 10:07:51 -0800395 unsigned char rtgen_family;
Ben Cheng655a7c02013-10-16 16:09:24 -0700396};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800397struct ifinfomsg {
Tao Baod7db5942015-01-28 10:07:51 -0800398 unsigned char ifi_family;
Tao Baod7db5942015-01-28 10:07:51 -0800399 unsigned char __ifi_pad;
400 unsigned short ifi_type;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800401 int ifi_index;
Tao Baod7db5942015-01-28 10:07:51 -0800402 unsigned ifi_flags;
Tao Baod7db5942015-01-28 10:07:51 -0800403 unsigned ifi_change;
Ben Cheng655a7c02013-10-16 16:09:24 -0700404};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800405struct prefixmsg {
Tao Baod7db5942015-01-28 10:07:51 -0800406 unsigned char prefix_family;
Tao Baod7db5942015-01-28 10:07:51 -0800407 unsigned char prefix_pad1;
408 unsigned short prefix_pad2;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800409 int prefix_ifindex;
Tao Baod7db5942015-01-28 10:07:51 -0800410 unsigned char prefix_type;
Tao Baod7db5942015-01-28 10:07:51 -0800411 unsigned char prefix_len;
412 unsigned char prefix_flags;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800413 unsigned char prefix_pad3;
Ben Cheng655a7c02013-10-16 16:09:24 -0700414};
Tao Baod7db5942015-01-28 10:07:51 -0800415enum {
416 PREFIX_UNSPEC,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800417 PREFIX_ADDRESS,
Tao Baod7db5942015-01-28 10:07:51 -0800418 PREFIX_CACHEINFO,
Tao Baod7db5942015-01-28 10:07:51 -0800419 __PREFIX_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -0700420};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800421#define PREFIX_MAX (__PREFIX_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700422struct prefix_cacheinfo {
Tao Baod7db5942015-01-28 10:07:51 -0800423 __u32 preferred_time;
424 __u32 valid_time;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800425};
Ben Cheng655a7c02013-10-16 16:09:24 -0700426struct tcmsg {
Tao Baod7db5942015-01-28 10:07:51 -0800427 unsigned char tcm_family;
428 unsigned char tcm__pad1;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800429 unsigned short tcm__pad2;
Tao Baod7db5942015-01-28 10:07:51 -0800430 int tcm_ifindex;
Tao Baod7db5942015-01-28 10:07:51 -0800431 __u32 tcm_handle;
432 __u32 tcm_parent;
Christopher Ferris76a1d452018-06-27 14:12:29 -0700433#define tcm_block_index tcm_parent
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800434 __u32 tcm_info;
Ben Cheng655a7c02013-10-16 16:09:24 -0700435};
Christopher Ferris76a1d452018-06-27 14:12:29 -0700436#define TCM_IFINDEX_MAGIC_BLOCK (0xFFFFFFFFU)
Ben Cheng655a7c02013-10-16 16:09:24 -0700437enum {
Tao Baod7db5942015-01-28 10:07:51 -0800438 TCA_UNSPEC,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800439 TCA_KIND,
Tao Baod7db5942015-01-28 10:07:51 -0800440 TCA_OPTIONS,
Tao Baod7db5942015-01-28 10:07:51 -0800441 TCA_STATS,
442 TCA_XSTATS,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800443 TCA_RATE,
Tao Baod7db5942015-01-28 10:07:51 -0800444 TCA_FCNT,
Tao Baod7db5942015-01-28 10:07:51 -0800445 TCA_STATS2,
446 TCA_STAB,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800447 TCA_PAD,
Christopher Ferris525ce912017-07-26 13:12:53 -0700448 TCA_DUMP_INVISIBLE,
Christopher Ferris1308ad32017-11-14 17:32:13 -0800449 TCA_CHAIN,
Christopher Ferris934ec942018-01-31 15:29:16 -0800450 TCA_HW_OFFLOAD,
Christopher Ferris76a1d452018-06-27 14:12:29 -0700451 TCA_INGRESS_BLOCK,
452 TCA_EGRESS_BLOCK,
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700453 TCA_DUMP_FLAGS,
Christopher Ferrisb7cef6d2023-05-09 19:04:15 +0000454 TCA_EXT_WARN_MSG,
Tao Baod7db5942015-01-28 10:07:51 -0800455 __TCA_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -0700456};
457#define TCA_MAX (__TCA_MAX - 1)
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700458#define TCA_DUMP_FLAGS_TERSE (1 << 0)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800459#define TCA_RTA(r) ((struct rtattr *) (((char *) (r)) + NLMSG_ALIGN(sizeof(struct tcmsg))))
Tao Baod7db5942015-01-28 10:07:51 -0800460#define TCA_PAYLOAD(n) NLMSG_PAYLOAD(n, sizeof(struct tcmsg))
Ben Cheng655a7c02013-10-16 16:09:24 -0700461struct nduseroptmsg {
Tao Baod7db5942015-01-28 10:07:51 -0800462 unsigned char nduseropt_family;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800463 unsigned char nduseropt_pad1;
Tao Baod7db5942015-01-28 10:07:51 -0800464 unsigned short nduseropt_opts_len;
465 int nduseropt_ifindex;
Tao Baod7db5942015-01-28 10:07:51 -0800466 __u8 nduseropt_icmp_type;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800467 __u8 nduseropt_icmp_code;
Tao Baod7db5942015-01-28 10:07:51 -0800468 unsigned short nduseropt_pad2;
469 unsigned int nduseropt_pad3;
Ben Cheng655a7c02013-10-16 16:09:24 -0700470};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800471enum {
Tao Baod7db5942015-01-28 10:07:51 -0800472 NDUSEROPT_UNSPEC,
473 NDUSEROPT_SRCADDR,
Tao Baod7db5942015-01-28 10:07:51 -0800474 __NDUSEROPT_MAX
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800475};
Ben Cheng655a7c02013-10-16 16:09:24 -0700476#define NDUSEROPT_MAX (__NDUSEROPT_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700477#define RTMGRP_LINK 1
478#define RTMGRP_NOTIFY 2
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800479#define RTMGRP_NEIGH 4
Ben Cheng655a7c02013-10-16 16:09:24 -0700480#define RTMGRP_TC 8
Ben Cheng655a7c02013-10-16 16:09:24 -0700481#define RTMGRP_IPV4_IFADDR 0x10
482#define RTMGRP_IPV4_MROUTE 0x20
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800483#define RTMGRP_IPV4_ROUTE 0x40
Ben Cheng655a7c02013-10-16 16:09:24 -0700484#define RTMGRP_IPV4_RULE 0x80
Ben Cheng655a7c02013-10-16 16:09:24 -0700485#define RTMGRP_IPV6_IFADDR 0x100
486#define RTMGRP_IPV6_MROUTE 0x200
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800487#define RTMGRP_IPV6_ROUTE 0x400
Ben Cheng655a7c02013-10-16 16:09:24 -0700488#define RTMGRP_IPV6_IFINFO 0x800
Ben Cheng655a7c02013-10-16 16:09:24 -0700489#define RTMGRP_DECnet_IFADDR 0x1000
490#define RTMGRP_DECnet_ROUTE 0x4000
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800491#define RTMGRP_IPV6_PREFIX 0x20000
Ben Cheng655a7c02013-10-16 16:09:24 -0700492enum rtnetlink_groups {
Tao Baod7db5942015-01-28 10:07:51 -0800493 RTNLGRP_NONE,
Ben Cheng655a7c02013-10-16 16:09:24 -0700494#define RTNLGRP_NONE RTNLGRP_NONE
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800495 RTNLGRP_LINK,
Ben Cheng655a7c02013-10-16 16:09:24 -0700496#define RTNLGRP_LINK RTNLGRP_LINK
Tao Baod7db5942015-01-28 10:07:51 -0800497 RTNLGRP_NOTIFY,
Ben Cheng655a7c02013-10-16 16:09:24 -0700498#define RTNLGRP_NOTIFY RTNLGRP_NOTIFY
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800499 RTNLGRP_NEIGH,
Ben Cheng655a7c02013-10-16 16:09:24 -0700500#define RTNLGRP_NEIGH RTNLGRP_NEIGH
Tao Baod7db5942015-01-28 10:07:51 -0800501 RTNLGRP_TC,
Ben Cheng655a7c02013-10-16 16:09:24 -0700502#define RTNLGRP_TC RTNLGRP_TC
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800503 RTNLGRP_IPV4_IFADDR,
Ben Cheng655a7c02013-10-16 16:09:24 -0700504#define RTNLGRP_IPV4_IFADDR RTNLGRP_IPV4_IFADDR
Tao Baod7db5942015-01-28 10:07:51 -0800505 RTNLGRP_IPV4_MROUTE,
Ben Cheng655a7c02013-10-16 16:09:24 -0700506#define RTNLGRP_IPV4_MROUTE RTNLGRP_IPV4_MROUTE
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800507 RTNLGRP_IPV4_ROUTE,
Ben Cheng655a7c02013-10-16 16:09:24 -0700508#define RTNLGRP_IPV4_ROUTE RTNLGRP_IPV4_ROUTE
Tao Baod7db5942015-01-28 10:07:51 -0800509 RTNLGRP_IPV4_RULE,
Ben Cheng655a7c02013-10-16 16:09:24 -0700510#define RTNLGRP_IPV4_RULE RTNLGRP_IPV4_RULE
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800511 RTNLGRP_IPV6_IFADDR,
Ben Cheng655a7c02013-10-16 16:09:24 -0700512#define RTNLGRP_IPV6_IFADDR RTNLGRP_IPV6_IFADDR
Tao Baod7db5942015-01-28 10:07:51 -0800513 RTNLGRP_IPV6_MROUTE,
Ben Cheng655a7c02013-10-16 16:09:24 -0700514#define RTNLGRP_IPV6_MROUTE RTNLGRP_IPV6_MROUTE
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800515 RTNLGRP_IPV6_ROUTE,
Ben Cheng655a7c02013-10-16 16:09:24 -0700516#define RTNLGRP_IPV6_ROUTE RTNLGRP_IPV6_ROUTE
Tao Baod7db5942015-01-28 10:07:51 -0800517 RTNLGRP_IPV6_IFINFO,
Ben Cheng655a7c02013-10-16 16:09:24 -0700518#define RTNLGRP_IPV6_IFINFO RTNLGRP_IPV6_IFINFO
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800519 RTNLGRP_DECnet_IFADDR,
Ben Cheng655a7c02013-10-16 16:09:24 -0700520#define RTNLGRP_DECnet_IFADDR RTNLGRP_DECnet_IFADDR
Tao Baod7db5942015-01-28 10:07:51 -0800521 RTNLGRP_NOP2,
Tao Baod7db5942015-01-28 10:07:51 -0800522 RTNLGRP_DECnet_ROUTE,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800523#define RTNLGRP_DECnet_ROUTE RTNLGRP_DECnet_ROUTE
Tao Baod7db5942015-01-28 10:07:51 -0800524 RTNLGRP_DECnet_RULE,
Ben Cheng655a7c02013-10-16 16:09:24 -0700525#define RTNLGRP_DECnet_RULE RTNLGRP_DECnet_RULE
Tao Baod7db5942015-01-28 10:07:51 -0800526 RTNLGRP_NOP4,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800527 RTNLGRP_IPV6_PREFIX,
Ben Cheng655a7c02013-10-16 16:09:24 -0700528#define RTNLGRP_IPV6_PREFIX RTNLGRP_IPV6_PREFIX
Tao Baod7db5942015-01-28 10:07:51 -0800529 RTNLGRP_IPV6_RULE,
Ben Cheng655a7c02013-10-16 16:09:24 -0700530#define RTNLGRP_IPV6_RULE RTNLGRP_IPV6_RULE
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800531 RTNLGRP_ND_USEROPT,
Ben Cheng655a7c02013-10-16 16:09:24 -0700532#define RTNLGRP_ND_USEROPT RTNLGRP_ND_USEROPT
Tao Baod7db5942015-01-28 10:07:51 -0800533 RTNLGRP_PHONET_IFADDR,
Ben Cheng655a7c02013-10-16 16:09:24 -0700534#define RTNLGRP_PHONET_IFADDR RTNLGRP_PHONET_IFADDR
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800535 RTNLGRP_PHONET_ROUTE,
Ben Cheng655a7c02013-10-16 16:09:24 -0700536#define RTNLGRP_PHONET_ROUTE RTNLGRP_PHONET_ROUTE
Tao Baod7db5942015-01-28 10:07:51 -0800537 RTNLGRP_DCB,
Ben Cheng655a7c02013-10-16 16:09:24 -0700538#define RTNLGRP_DCB RTNLGRP_DCB
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800539 RTNLGRP_IPV4_NETCONF,
Ben Cheng655a7c02013-10-16 16:09:24 -0700540#define RTNLGRP_IPV4_NETCONF RTNLGRP_IPV4_NETCONF
Tao Baod7db5942015-01-28 10:07:51 -0800541 RTNLGRP_IPV6_NETCONF,
Ben Cheng655a7c02013-10-16 16:09:24 -0700542#define RTNLGRP_IPV6_NETCONF RTNLGRP_IPV6_NETCONF
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800543 RTNLGRP_MDB,
Ben Cheng655a7c02013-10-16 16:09:24 -0700544#define RTNLGRP_MDB RTNLGRP_MDB
Christopher Ferris05d08e92016-02-04 13:16:38 -0800545 RTNLGRP_MPLS_ROUTE,
546#define RTNLGRP_MPLS_ROUTE RTNLGRP_MPLS_ROUTE
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800547 RTNLGRP_NSID,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800548#define RTNLGRP_NSID RTNLGRP_NSID
Christopher Ferris525ce912017-07-26 13:12:53 -0700549 RTNLGRP_MPLS_NETCONF,
550#define RTNLGRP_MPLS_NETCONF RTNLGRP_MPLS_NETCONF
Christopher Ferris1308ad32017-11-14 17:32:13 -0800551 RTNLGRP_IPV4_MROUTE_R,
552#define RTNLGRP_IPV4_MROUTE_R RTNLGRP_IPV4_MROUTE_R
553 RTNLGRP_IPV6_MROUTE_R,
554#define RTNLGRP_IPV6_MROUTE_R RTNLGRP_IPV6_MROUTE_R
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700555 RTNLGRP_NEXTHOP,
556#define RTNLGRP_NEXTHOP RTNLGRP_NEXTHOP
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700557 RTNLGRP_BRVLAN,
558#define RTNLGRP_BRVLAN RTNLGRP_BRVLAN
Christopher Ferris1ed55342022-03-22 16:06:25 -0700559 RTNLGRP_MCTP_IFADDR,
560#define RTNLGRP_MCTP_IFADDR RTNLGRP_MCTP_IFADDR
Christopher Ferris10a76e62022-06-08 13:31:52 -0700561 RTNLGRP_TUNNEL,
562#define RTNLGRP_TUNNEL RTNLGRP_TUNNEL
563 RTNLGRP_STATS,
564#define RTNLGRP_STATS RTNLGRP_STATS
Christopher Ferris05d08e92016-02-04 13:16:38 -0800565 __RTNLGRP_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -0700566};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800567#define RTNLGRP_MAX (__RTNLGRP_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700568struct tcamsg {
Tao Baod7db5942015-01-28 10:07:51 -0800569 unsigned char tca_family;
Tao Baod7db5942015-01-28 10:07:51 -0800570 unsigned char tca__pad1;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800571 unsigned short tca__pad2;
Ben Cheng655a7c02013-10-16 16:09:24 -0700572};
Christopher Ferris1308ad32017-11-14 17:32:13 -0800573enum {
574 TCA_ROOT_UNSPEC,
575 TCA_ROOT_TAB,
576#define TCA_ACT_TAB TCA_ROOT_TAB
577#define TCAA_MAX TCA_ROOT_TAB
578 TCA_ROOT_FLAGS,
579 TCA_ROOT_COUNT,
580 TCA_ROOT_TIME_DELTA,
Christopher Ferrisb7cef6d2023-05-09 19:04:15 +0000581 TCA_ROOT_EXT_WARN_MSG,
Christopher Ferris1308ad32017-11-14 17:32:13 -0800582 __TCA_ROOT_MAX,
583#define TCA_ROOT_MAX (__TCA_ROOT_MAX - 1)
584};
Tao Baod7db5942015-01-28 10:07:51 -0800585#define TA_RTA(r) ((struct rtattr *) (((char *) (r)) + NLMSG_ALIGN(sizeof(struct tcamsg))))
Tao Baod7db5942015-01-28 10:07:51 -0800586#define TA_PAYLOAD(n) NLMSG_PAYLOAD(n, sizeof(struct tcamsg))
Christopher Ferris1308ad32017-11-14 17:32:13 -0800587#define TCA_FLAG_LARGE_DUMP_ON (1 << 0)
Christopher Ferris05667cd2021-02-16 16:01:34 -0800588#define TCA_ACT_FLAG_LARGE_DUMP_ON TCA_FLAG_LARGE_DUMP_ON
589#define TCA_ACT_FLAG_TERSE_DUMP (1 << 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700590#define RTEXT_FILTER_VF (1 << 0)
591#define RTEXT_FILTER_BRVLAN (1 << 1)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800592#define RTEXT_FILTER_BRVLAN_COMPRESSED (1 << 2)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800593#define RTEXT_FILTER_SKIP_STATS (1 << 3)
Christopher Ferris25c18d42020-10-14 17:42:58 -0700594#define RTEXT_FILTER_MRP (1 << 4)
Christopher Ferris05667cd2021-02-16 16:01:34 -0800595#define RTEXT_FILTER_CFM_CONFIG (1 << 5)
596#define RTEXT_FILTER_CFM_STATUS (1 << 6)
Christopher Ferris10a76e62022-06-08 13:31:52 -0700597#define RTEXT_FILTER_MST (1 << 7)
Ben Cheng655a7c02013-10-16 16:09:24 -0700598#endif