blob: 14366de38616c9b5cfe2e0241978ca3035d31540 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _UAPI__LINUX_RTNETLINK_H
20#define _UAPI__LINUX_RTNETLINK_H
21#include <linux/types.h>
22#include <linux/netlink.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070023#include <linux/if_link.h>
24#include <linux/if_addr.h>
25#include <linux/neighbour.h>
26#define RTNL_FAMILY_IPMR 128
Ben Cheng655a7c02013-10-16 16:09:24 -070027#define RTNL_FAMILY_IP6MR 129
28#define RTNL_FAMILY_MAX 129
29enum {
Tao Baod7db5942015-01-28 10:07:51 -080030 RTM_BASE = 16,
Ben Cheng655a7c02013-10-16 16:09:24 -070031#define RTM_BASE RTM_BASE
Tao Baod7db5942015-01-28 10:07:51 -080032 RTM_NEWLINK = 16,
Ben Cheng655a7c02013-10-16 16:09:24 -070033#define RTM_NEWLINK RTM_NEWLINK
Tao Baod7db5942015-01-28 10:07:51 -080034 RTM_DELLINK,
Ben Cheng655a7c02013-10-16 16:09:24 -070035#define RTM_DELLINK RTM_DELLINK
Tao Baod7db5942015-01-28 10:07:51 -080036 RTM_GETLINK,
Ben Cheng655a7c02013-10-16 16:09:24 -070037#define RTM_GETLINK RTM_GETLINK
Tao Baod7db5942015-01-28 10:07:51 -080038 RTM_SETLINK,
Ben Cheng655a7c02013-10-16 16:09:24 -070039#define RTM_SETLINK RTM_SETLINK
Tao Baod7db5942015-01-28 10:07:51 -080040 RTM_NEWADDR = 20,
Ben Cheng655a7c02013-10-16 16:09:24 -070041#define RTM_NEWADDR RTM_NEWADDR
Tao Baod7db5942015-01-28 10:07:51 -080042 RTM_DELADDR,
Ben Cheng655a7c02013-10-16 16:09:24 -070043#define RTM_DELADDR RTM_DELADDR
Tao Baod7db5942015-01-28 10:07:51 -080044 RTM_GETADDR,
Ben Cheng655a7c02013-10-16 16:09:24 -070045#define RTM_GETADDR RTM_GETADDR
Tao Baod7db5942015-01-28 10:07:51 -080046 RTM_NEWROUTE = 24,
Ben Cheng655a7c02013-10-16 16:09:24 -070047#define RTM_NEWROUTE RTM_NEWROUTE
Tao Baod7db5942015-01-28 10:07:51 -080048 RTM_DELROUTE,
Ben Cheng655a7c02013-10-16 16:09:24 -070049#define RTM_DELROUTE RTM_DELROUTE
Tao Baod7db5942015-01-28 10:07:51 -080050 RTM_GETROUTE,
Ben Cheng655a7c02013-10-16 16:09:24 -070051#define RTM_GETROUTE RTM_GETROUTE
Tao Baod7db5942015-01-28 10:07:51 -080052 RTM_NEWNEIGH = 28,
Ben Cheng655a7c02013-10-16 16:09:24 -070053#define RTM_NEWNEIGH RTM_NEWNEIGH
Tao Baod7db5942015-01-28 10:07:51 -080054 RTM_DELNEIGH,
Ben Cheng655a7c02013-10-16 16:09:24 -070055#define RTM_DELNEIGH RTM_DELNEIGH
Tao Baod7db5942015-01-28 10:07:51 -080056 RTM_GETNEIGH,
Ben Cheng655a7c02013-10-16 16:09:24 -070057#define RTM_GETNEIGH RTM_GETNEIGH
Tao Baod7db5942015-01-28 10:07:51 -080058 RTM_NEWRULE = 32,
Ben Cheng655a7c02013-10-16 16:09:24 -070059#define RTM_NEWRULE RTM_NEWRULE
Tao Baod7db5942015-01-28 10:07:51 -080060 RTM_DELRULE,
Ben Cheng655a7c02013-10-16 16:09:24 -070061#define RTM_DELRULE RTM_DELRULE
Tao Baod7db5942015-01-28 10:07:51 -080062 RTM_GETRULE,
Ben Cheng655a7c02013-10-16 16:09:24 -070063#define RTM_GETRULE RTM_GETRULE
Tao Baod7db5942015-01-28 10:07:51 -080064 RTM_NEWQDISC = 36,
Ben Cheng655a7c02013-10-16 16:09:24 -070065#define RTM_NEWQDISC RTM_NEWQDISC
Tao Baod7db5942015-01-28 10:07:51 -080066 RTM_DELQDISC,
Ben Cheng655a7c02013-10-16 16:09:24 -070067#define RTM_DELQDISC RTM_DELQDISC
Tao Baod7db5942015-01-28 10:07:51 -080068 RTM_GETQDISC,
Ben Cheng655a7c02013-10-16 16:09:24 -070069#define RTM_GETQDISC RTM_GETQDISC
Tao Baod7db5942015-01-28 10:07:51 -080070 RTM_NEWTCLASS = 40,
Ben Cheng655a7c02013-10-16 16:09:24 -070071#define RTM_NEWTCLASS RTM_NEWTCLASS
Tao Baod7db5942015-01-28 10:07:51 -080072 RTM_DELTCLASS,
Ben Cheng655a7c02013-10-16 16:09:24 -070073#define RTM_DELTCLASS RTM_DELTCLASS
Tao Baod7db5942015-01-28 10:07:51 -080074 RTM_GETTCLASS,
Ben Cheng655a7c02013-10-16 16:09:24 -070075#define RTM_GETTCLASS RTM_GETTCLASS
Tao Baod7db5942015-01-28 10:07:51 -080076 RTM_NEWTFILTER = 44,
Ben Cheng655a7c02013-10-16 16:09:24 -070077#define RTM_NEWTFILTER RTM_NEWTFILTER
Tao Baod7db5942015-01-28 10:07:51 -080078 RTM_DELTFILTER,
Ben Cheng655a7c02013-10-16 16:09:24 -070079#define RTM_DELTFILTER RTM_DELTFILTER
Tao Baod7db5942015-01-28 10:07:51 -080080 RTM_GETTFILTER,
Ben Cheng655a7c02013-10-16 16:09:24 -070081#define RTM_GETTFILTER RTM_GETTFILTER
Tao Baod7db5942015-01-28 10:07:51 -080082 RTM_NEWACTION = 48,
Ben Cheng655a7c02013-10-16 16:09:24 -070083#define RTM_NEWACTION RTM_NEWACTION
Tao Baod7db5942015-01-28 10:07:51 -080084 RTM_DELACTION,
Ben Cheng655a7c02013-10-16 16:09:24 -070085#define RTM_DELACTION RTM_DELACTION
Tao Baod7db5942015-01-28 10:07:51 -080086 RTM_GETACTION,
Ben Cheng655a7c02013-10-16 16:09:24 -070087#define RTM_GETACTION RTM_GETACTION
Tao Baod7db5942015-01-28 10:07:51 -080088 RTM_NEWPREFIX = 52,
Ben Cheng655a7c02013-10-16 16:09:24 -070089#define RTM_NEWPREFIX RTM_NEWPREFIX
Tao Baod7db5942015-01-28 10:07:51 -080090 RTM_GETMULTICAST = 58,
Ben Cheng655a7c02013-10-16 16:09:24 -070091#define RTM_GETMULTICAST RTM_GETMULTICAST
Tao Baod7db5942015-01-28 10:07:51 -080092 RTM_GETANYCAST = 62,
Ben Cheng655a7c02013-10-16 16:09:24 -070093#define RTM_GETANYCAST RTM_GETANYCAST
Tao Baod7db5942015-01-28 10:07:51 -080094 RTM_NEWNEIGHTBL = 64,
Ben Cheng655a7c02013-10-16 16:09:24 -070095#define RTM_NEWNEIGHTBL RTM_NEWNEIGHTBL
Tao Baod7db5942015-01-28 10:07:51 -080096 RTM_GETNEIGHTBL = 66,
Ben Cheng655a7c02013-10-16 16:09:24 -070097#define RTM_GETNEIGHTBL RTM_GETNEIGHTBL
Tao Baod7db5942015-01-28 10:07:51 -080098 RTM_SETNEIGHTBL,
Ben Cheng655a7c02013-10-16 16:09:24 -070099#define RTM_SETNEIGHTBL RTM_SETNEIGHTBL
Tao Baod7db5942015-01-28 10:07:51 -0800100 RTM_NEWNDUSEROPT = 68,
Ben Cheng655a7c02013-10-16 16:09:24 -0700101#define RTM_NEWNDUSEROPT RTM_NEWNDUSEROPT
Tao Baod7db5942015-01-28 10:07:51 -0800102 RTM_NEWADDRLABEL = 72,
Ben Cheng655a7c02013-10-16 16:09:24 -0700103#define RTM_NEWADDRLABEL RTM_NEWADDRLABEL
Tao Baod7db5942015-01-28 10:07:51 -0800104 RTM_DELADDRLABEL,
Ben Cheng655a7c02013-10-16 16:09:24 -0700105#define RTM_DELADDRLABEL RTM_DELADDRLABEL
Tao Baod7db5942015-01-28 10:07:51 -0800106 RTM_GETADDRLABEL,
Ben Cheng655a7c02013-10-16 16:09:24 -0700107#define RTM_GETADDRLABEL RTM_GETADDRLABEL
Tao Baod7db5942015-01-28 10:07:51 -0800108 RTM_GETDCB = 78,
Ben Cheng655a7c02013-10-16 16:09:24 -0700109#define RTM_GETDCB RTM_GETDCB
Tao Baod7db5942015-01-28 10:07:51 -0800110 RTM_SETDCB,
Ben Cheng655a7c02013-10-16 16:09:24 -0700111#define RTM_SETDCB RTM_SETDCB
Tao Baod7db5942015-01-28 10:07:51 -0800112 RTM_NEWNETCONF = 80,
Ben Cheng655a7c02013-10-16 16:09:24 -0700113#define RTM_NEWNETCONF RTM_NEWNETCONF
Christopher Ferris525ce912017-07-26 13:12:53 -0700114 RTM_DELNETCONF,
115#define RTM_DELNETCONF RTM_DELNETCONF
Tao Baod7db5942015-01-28 10:07:51 -0800116 RTM_GETNETCONF = 82,
Ben Cheng655a7c02013-10-16 16:09:24 -0700117#define RTM_GETNETCONF RTM_GETNETCONF
Tao Baod7db5942015-01-28 10:07:51 -0800118 RTM_NEWMDB = 84,
Ben Cheng655a7c02013-10-16 16:09:24 -0700119#define RTM_NEWMDB RTM_NEWMDB
Tao Baod7db5942015-01-28 10:07:51 -0800120 RTM_DELMDB = 85,
Ben Cheng655a7c02013-10-16 16:09:24 -0700121#define RTM_DELMDB RTM_DELMDB
Tao Baod7db5942015-01-28 10:07:51 -0800122 RTM_GETMDB = 86,
Ben Cheng655a7c02013-10-16 16:09:24 -0700123#define RTM_GETMDB RTM_GETMDB
Christopher Ferris05d08e92016-02-04 13:16:38 -0800124 RTM_NEWNSID = 88,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800125#define RTM_NEWNSID RTM_NEWNSID
126 RTM_DELNSID = 89,
127#define RTM_DELNSID RTM_DELNSID
128 RTM_GETNSID = 90,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800129#define RTM_GETNSID RTM_GETNSID
Christopher Ferris106b3a82016-08-24 12:15:38 -0700130 RTM_NEWSTATS = 92,
131#define RTM_NEWSTATS RTM_NEWSTATS
132 RTM_GETSTATS = 94,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700133#define RTM_GETSTATS RTM_GETSTATS
Christopher Ferris1308ad32017-11-14 17:32:13 -0800134 RTM_NEWCACHEREPORT = 96,
135#define RTM_NEWCACHEREPORT RTM_NEWCACHEREPORT
Christopher Ferris9ce28842018-10-25 12:11:39 -0700136 RTM_NEWCHAIN = 100,
137#define RTM_NEWCHAIN RTM_NEWCHAIN
138 RTM_DELCHAIN,
139#define RTM_DELCHAIN RTM_DELCHAIN
140 RTM_GETCHAIN,
141#define RTM_GETCHAIN RTM_GETCHAIN
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700142 RTM_NEWNEXTHOP = 104,
143#define RTM_NEWNEXTHOP RTM_NEWNEXTHOP
144 RTM_DELNEXTHOP,
145#define RTM_DELNEXTHOP RTM_DELNEXTHOP
146 RTM_GETNEXTHOP,
147#define RTM_GETNEXTHOP RTM_GETNEXTHOP
Christopher Ferrisd32ca142020-02-04 16:16:51 -0800148 RTM_NEWLINKPROP = 108,
149#define RTM_NEWLINKPROP RTM_NEWLINKPROP
150 RTM_DELLINKPROP,
151#define RTM_DELLINKPROP RTM_DELLINKPROP
152 RTM_GETLINKPROP,
153#define RTM_GETLINKPROP RTM_GETLINKPROP
Christopher Ferris05d08e92016-02-04 13:16:38 -0800154 __RTM_MAX,
Ben Cheng655a7c02013-10-16 16:09:24 -0700155#define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1)
156};
157#define RTM_NR_MSGTYPES (RTM_MAX + 1 - RTM_BASE)
158#define RTM_NR_FAMILIES (RTM_NR_MSGTYPES >> 2)
Ben Cheng655a7c02013-10-16 16:09:24 -0700159#define RTM_FAM(cmd) (((cmd) - RTM_BASE) >> 2)
160struct rtattr {
Tao Baod7db5942015-01-28 10:07:51 -0800161 unsigned short rta_len;
162 unsigned short rta_type;
Ben Cheng655a7c02013-10-16 16:09:24 -0700163};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800164#define RTA_ALIGNTO 4U
Tao Baod7db5942015-01-28 10:07:51 -0800165#define RTA_ALIGN(len) (((len) + RTA_ALIGNTO - 1) & ~(RTA_ALIGNTO - 1))
166#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 -0800167#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 -0700168#define RTA_LENGTH(len) (RTA_ALIGN(sizeof(struct rtattr)) + (len))
169#define RTA_SPACE(len) RTA_ALIGN(RTA_LENGTH(len))
Tao Baod7db5942015-01-28 10:07:51 -0800170#define RTA_DATA(rta) ((void *) (((char *) (rta)) + RTA_LENGTH(0)))
Tao Baod7db5942015-01-28 10:07:51 -0800171#define RTA_PAYLOAD(rta) ((int) ((rta)->rta_len) - RTA_LENGTH(0))
Ben Cheng655a7c02013-10-16 16:09:24 -0700172struct rtmsg {
Tao Baod7db5942015-01-28 10:07:51 -0800173 unsigned char rtm_family;
174 unsigned char rtm_dst_len;
Tao Baod7db5942015-01-28 10:07:51 -0800175 unsigned char rtm_src_len;
176 unsigned char rtm_tos;
177 unsigned char rtm_table;
178 unsigned char rtm_protocol;
Tao Baod7db5942015-01-28 10:07:51 -0800179 unsigned char rtm_scope;
180 unsigned char rtm_type;
181 unsigned rtm_flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700182};
Ben Cheng655a7c02013-10-16 16:09:24 -0700183enum {
Tao Baod7db5942015-01-28 10:07:51 -0800184 RTN_UNSPEC,
185 RTN_UNICAST,
186 RTN_LOCAL,
Tao Baod7db5942015-01-28 10:07:51 -0800187 RTN_BROADCAST,
188 RTN_ANYCAST,
189 RTN_MULTICAST,
190 RTN_BLACKHOLE,
Tao Baod7db5942015-01-28 10:07:51 -0800191 RTN_UNREACHABLE,
192 RTN_PROHIBIT,
193 RTN_THROW,
194 RTN_NAT,
Tao Baod7db5942015-01-28 10:07:51 -0800195 RTN_XRESOLVE,
196 __RTN_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -0700197};
198#define RTN_MAX (__RTN_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700199#define RTPROT_UNSPEC 0
200#define RTPROT_REDIRECT 1
201#define RTPROT_KERNEL 2
202#define RTPROT_BOOT 3
Ben Cheng655a7c02013-10-16 16:09:24 -0700203#define RTPROT_STATIC 4
204#define RTPROT_GATED 8
205#define RTPROT_RA 9
206#define RTPROT_MRT 10
Ben Cheng655a7c02013-10-16 16:09:24 -0700207#define RTPROT_ZEBRA 11
208#define RTPROT_BIRD 12
209#define RTPROT_DNROUTED 13
210#define RTPROT_XORP 14
Ben Cheng655a7c02013-10-16 16:09:24 -0700211#define RTPROT_NTK 15
212#define RTPROT_DHCP 16
Christopher Ferris05d08e92016-02-04 13:16:38 -0800213#define RTPROT_MROUTED 17
214#define RTPROT_BABEL 42
Christopher Ferris9ce28842018-10-25 12:11:39 -0700215#define RTPROT_BGP 186
216#define RTPROT_ISIS 187
217#define RTPROT_OSPF 188
218#define RTPROT_RIP 189
219#define RTPROT_EIGRP 192
Christopher Ferris05d08e92016-02-04 13:16:38 -0800220enum rt_scope_t {
Tao Baod7db5942015-01-28 10:07:51 -0800221 RT_SCOPE_UNIVERSE = 0,
222 RT_SCOPE_SITE = 200,
223 RT_SCOPE_LINK = 253,
224 RT_SCOPE_HOST = 254,
Tao Baod7db5942015-01-28 10:07:51 -0800225 RT_SCOPE_NOWHERE = 255
Ben Cheng655a7c02013-10-16 16:09:24 -0700226};
227#define RTM_F_NOTIFY 0x100
228#define RTM_F_CLONED 0x200
Ben Cheng655a7c02013-10-16 16:09:24 -0700229#define RTM_F_EQUALIZE 0x400
230#define RTM_F_PREFIX 0x800
Christopher Ferris05d08e92016-02-04 13:16:38 -0800231#define RTM_F_LOOKUP_TABLE 0x1000
Christopher Ferris1308ad32017-11-14 17:32:13 -0800232#define RTM_F_FIB_MATCH 0x2000
Ben Cheng655a7c02013-10-16 16:09:24 -0700233enum rt_class_t {
Tao Baod7db5942015-01-28 10:07:51 -0800234 RT_TABLE_UNSPEC = 0,
Tao Baod7db5942015-01-28 10:07:51 -0800235 RT_TABLE_COMPAT = 252,
236 RT_TABLE_DEFAULT = 253,
237 RT_TABLE_MAIN = 254,
238 RT_TABLE_LOCAL = 255,
Tao Baod7db5942015-01-28 10:07:51 -0800239 RT_TABLE_MAX = 0xFFFFFFFF
Ben Cheng655a7c02013-10-16 16:09:24 -0700240};
241enum rtattr_type_t {
Tao Baod7db5942015-01-28 10:07:51 -0800242 RTA_UNSPEC,
Tao Baod7db5942015-01-28 10:07:51 -0800243 RTA_DST,
244 RTA_SRC,
245 RTA_IIF,
246 RTA_OIF,
Tao Baod7db5942015-01-28 10:07:51 -0800247 RTA_GATEWAY,
248 RTA_PRIORITY,
249 RTA_PREFSRC,
250 RTA_METRICS,
Tao Baod7db5942015-01-28 10:07:51 -0800251 RTA_MULTIPATH,
252 RTA_PROTOINFO,
253 RTA_FLOW,
254 RTA_CACHEINFO,
Tao Baod7db5942015-01-28 10:07:51 -0800255 RTA_SESSION,
256 RTA_MP_ALGO,
257 RTA_TABLE,
258 RTA_MARK,
Tao Baod7db5942015-01-28 10:07:51 -0800259 RTA_MFC_STATS,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800260 RTA_VIA,
261 RTA_NEWDST,
262 RTA_PREF,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800263 RTA_ENCAP_TYPE,
264 RTA_ENCAP,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700265 RTA_EXPIRES,
266 RTA_PAD,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800267 RTA_UID,
Christopher Ferris525ce912017-07-26 13:12:53 -0700268 RTA_TTL_PROPAGATE,
Christopher Ferris9ce28842018-10-25 12:11:39 -0700269 RTA_IP_PROTO,
270 RTA_SPORT,
271 RTA_DPORT,
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700272 RTA_NH_ID,
Tao Baod7db5942015-01-28 10:07:51 -0800273 __RTA_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -0700274};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800275#define RTA_MAX (__RTA_MAX - 1)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800276#define RTM_RTA(r) ((struct rtattr *) (((char *) (r)) + NLMSG_ALIGN(sizeof(struct rtmsg))))
Tao Baod7db5942015-01-28 10:07:51 -0800277#define RTM_PAYLOAD(n) NLMSG_PAYLOAD(n, sizeof(struct rtmsg))
Ben Cheng655a7c02013-10-16 16:09:24 -0700278struct rtnexthop {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800279 unsigned short rtnh_len;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800280 unsigned char rtnh_flags;
Tao Baod7db5942015-01-28 10:07:51 -0800281 unsigned char rtnh_hops;
282 int rtnh_ifindex;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800283};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800284#define RTNH_F_DEAD 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700285#define RTNH_F_PERVASIVE 2
286#define RTNH_F_ONLINK 4
Christopher Ferris05d08e92016-02-04 13:16:38 -0800287#define RTNH_F_OFFLOAD 8
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800288#define RTNH_F_LINKDOWN 16
Christopher Ferris525ce912017-07-26 13:12:53 -0700289#define RTNH_F_UNRESOLVED 32
Christopher Ferris49f525c2016-12-12 14:55:36 -0800290#define RTNH_COMPARE_MASK (RTNH_F_DEAD | RTNH_F_LINKDOWN | RTNH_F_OFFLOAD)
Ben Cheng655a7c02013-10-16 16:09:24 -0700291#define RTNH_ALIGNTO 4
Tao Baod7db5942015-01-28 10:07:51 -0800292#define RTNH_ALIGN(len) (((len) + RTNH_ALIGNTO - 1) & ~(RTNH_ALIGNTO - 1))
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800293#define RTNH_OK(rtnh,len) ((rtnh)->rtnh_len >= sizeof(struct rtnexthop) && ((int) (rtnh)->rtnh_len) <= (len))
Tao Baod7db5942015-01-28 10:07:51 -0800294#define RTNH_NEXT(rtnh) ((struct rtnexthop *) (((char *) (rtnh)) + RTNH_ALIGN((rtnh)->rtnh_len)))
Ben Cheng655a7c02013-10-16 16:09:24 -0700295#define RTNH_LENGTH(len) (RTNH_ALIGN(sizeof(struct rtnexthop)) + (len))
Ben Cheng655a7c02013-10-16 16:09:24 -0700296#define RTNH_SPACE(len) RTNH_ALIGN(RTNH_LENGTH(len))
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800297#define RTNH_DATA(rtnh) ((struct rtattr *) (((char *) (rtnh)) + RTNH_LENGTH(0)))
Christopher Ferris05d08e92016-02-04 13:16:38 -0800298struct rtvia {
299 __kernel_sa_family_t rtvia_family;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800300 __u8 rtvia_addr[0];
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800301};
Ben Cheng655a7c02013-10-16 16:09:24 -0700302struct rta_cacheinfo {
Tao Baod7db5942015-01-28 10:07:51 -0800303 __u32 rta_clntref;
Tao Baod7db5942015-01-28 10:07:51 -0800304 __u32 rta_lastuse;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800305 __s32 rta_expires;
Tao Baod7db5942015-01-28 10:07:51 -0800306 __u32 rta_error;
307 __u32 rta_used;
Ben Cheng655a7c02013-10-16 16:09:24 -0700308#define RTNETLINK_HAVE_PEERINFO 1
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800309 __u32 rta_id;
Tao Baod7db5942015-01-28 10:07:51 -0800310 __u32 rta_ts;
311 __u32 rta_tsage;
Ben Cheng655a7c02013-10-16 16:09:24 -0700312};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800313enum {
Tao Baod7db5942015-01-28 10:07:51 -0800314 RTAX_UNSPEC,
Ben Cheng655a7c02013-10-16 16:09:24 -0700315#define RTAX_UNSPEC RTAX_UNSPEC
Tao Baod7db5942015-01-28 10:07:51 -0800316 RTAX_LOCK,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800317#define RTAX_LOCK RTAX_LOCK
Tao Baod7db5942015-01-28 10:07:51 -0800318 RTAX_MTU,
Ben Cheng655a7c02013-10-16 16:09:24 -0700319#define RTAX_MTU RTAX_MTU
Tao Baod7db5942015-01-28 10:07:51 -0800320 RTAX_WINDOW,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800321#define RTAX_WINDOW RTAX_WINDOW
Tao Baod7db5942015-01-28 10:07:51 -0800322 RTAX_RTT,
Ben Cheng655a7c02013-10-16 16:09:24 -0700323#define RTAX_RTT RTAX_RTT
Tao Baod7db5942015-01-28 10:07:51 -0800324 RTAX_RTTVAR,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800325#define RTAX_RTTVAR RTAX_RTTVAR
Tao Baod7db5942015-01-28 10:07:51 -0800326 RTAX_SSTHRESH,
Ben Cheng655a7c02013-10-16 16:09:24 -0700327#define RTAX_SSTHRESH RTAX_SSTHRESH
Tao Baod7db5942015-01-28 10:07:51 -0800328 RTAX_CWND,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800329#define RTAX_CWND RTAX_CWND
Tao Baod7db5942015-01-28 10:07:51 -0800330 RTAX_ADVMSS,
Ben Cheng655a7c02013-10-16 16:09:24 -0700331#define RTAX_ADVMSS RTAX_ADVMSS
Tao Baod7db5942015-01-28 10:07:51 -0800332 RTAX_REORDERING,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800333#define RTAX_REORDERING RTAX_REORDERING
Tao Baod7db5942015-01-28 10:07:51 -0800334 RTAX_HOPLIMIT,
Ben Cheng655a7c02013-10-16 16:09:24 -0700335#define RTAX_HOPLIMIT RTAX_HOPLIMIT
Tao Baod7db5942015-01-28 10:07:51 -0800336 RTAX_INITCWND,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800337#define RTAX_INITCWND RTAX_INITCWND
Tao Baod7db5942015-01-28 10:07:51 -0800338 RTAX_FEATURES,
Ben Cheng655a7c02013-10-16 16:09:24 -0700339#define RTAX_FEATURES RTAX_FEATURES
Tao Baod7db5942015-01-28 10:07:51 -0800340 RTAX_RTO_MIN,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800341#define RTAX_RTO_MIN RTAX_RTO_MIN
Tao Baod7db5942015-01-28 10:07:51 -0800342 RTAX_INITRWND,
Ben Cheng655a7c02013-10-16 16:09:24 -0700343#define RTAX_INITRWND RTAX_INITRWND
Tao Baod7db5942015-01-28 10:07:51 -0800344 RTAX_QUICKACK,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800345#define RTAX_QUICKACK RTAX_QUICKACK
Christopher Ferris05d08e92016-02-04 13:16:38 -0800346 RTAX_CC_ALGO,
347#define RTAX_CC_ALGO RTAX_CC_ALGO
Christopher Ferris934ec942018-01-31 15:29:16 -0800348 RTAX_FASTOPEN_NO_COOKIE,
349#define RTAX_FASTOPEN_NO_COOKIE RTAX_FASTOPEN_NO_COOKIE
Tao Baod7db5942015-01-28 10:07:51 -0800350 __RTAX_MAX
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800351};
Ben Cheng655a7c02013-10-16 16:09:24 -0700352#define RTAX_MAX (__RTAX_MAX - 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800353#define RTAX_FEATURE_ECN (1 << 0)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800354#define RTAX_FEATURE_SACK (1 << 1)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800355#define RTAX_FEATURE_TIMESTAMP (1 << 2)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800356#define RTAX_FEATURE_ALLFRAG (1 << 3)
357#define RTAX_FEATURE_MASK (RTAX_FEATURE_ECN | RTAX_FEATURE_SACK | RTAX_FEATURE_TIMESTAMP | RTAX_FEATURE_ALLFRAG)
Ben Cheng655a7c02013-10-16 16:09:24 -0700358struct rta_session {
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800359 __u8 proto;
Tao Baod7db5942015-01-28 10:07:51 -0800360 __u8 pad1;
Tao Baod7db5942015-01-28 10:07:51 -0800361 __u16 pad2;
362 union {
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800363 struct {
Tao Baod7db5942015-01-28 10:07:51 -0800364 __u16 sport;
Tao Baod7db5942015-01-28 10:07:51 -0800365 __u16 dport;
366 } ports;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800367 struct {
Tao Baod7db5942015-01-28 10:07:51 -0800368 __u8 type;
Tao Baod7db5942015-01-28 10:07:51 -0800369 __u8 code;
370 __u16 ident;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800371 } icmpt;
Tao Baod7db5942015-01-28 10:07:51 -0800372 __u32 spi;
Tao Baod7db5942015-01-28 10:07:51 -0800373 } u;
Ben Cheng655a7c02013-10-16 16:09:24 -0700374};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800375struct rta_mfc_stats {
Tao Baod7db5942015-01-28 10:07:51 -0800376 __u64 mfcs_packets;
Tao Baod7db5942015-01-28 10:07:51 -0800377 __u64 mfcs_bytes;
378 __u64 mfcs_wrong_if;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800379};
Ben Cheng655a7c02013-10-16 16:09:24 -0700380struct rtgenmsg {
Tao Baod7db5942015-01-28 10:07:51 -0800381 unsigned char rtgen_family;
Ben Cheng655a7c02013-10-16 16:09:24 -0700382};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800383struct ifinfomsg {
Tao Baod7db5942015-01-28 10:07:51 -0800384 unsigned char ifi_family;
Tao Baod7db5942015-01-28 10:07:51 -0800385 unsigned char __ifi_pad;
386 unsigned short ifi_type;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800387 int ifi_index;
Tao Baod7db5942015-01-28 10:07:51 -0800388 unsigned ifi_flags;
Tao Baod7db5942015-01-28 10:07:51 -0800389 unsigned ifi_change;
Ben Cheng655a7c02013-10-16 16:09:24 -0700390};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800391struct prefixmsg {
Tao Baod7db5942015-01-28 10:07:51 -0800392 unsigned char prefix_family;
Tao Baod7db5942015-01-28 10:07:51 -0800393 unsigned char prefix_pad1;
394 unsigned short prefix_pad2;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800395 int prefix_ifindex;
Tao Baod7db5942015-01-28 10:07:51 -0800396 unsigned char prefix_type;
Tao Baod7db5942015-01-28 10:07:51 -0800397 unsigned char prefix_len;
398 unsigned char prefix_flags;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800399 unsigned char prefix_pad3;
Ben Cheng655a7c02013-10-16 16:09:24 -0700400};
Tao Baod7db5942015-01-28 10:07:51 -0800401enum {
402 PREFIX_UNSPEC,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800403 PREFIX_ADDRESS,
Tao Baod7db5942015-01-28 10:07:51 -0800404 PREFIX_CACHEINFO,
Tao Baod7db5942015-01-28 10:07:51 -0800405 __PREFIX_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -0700406};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800407#define PREFIX_MAX (__PREFIX_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700408struct prefix_cacheinfo {
Tao Baod7db5942015-01-28 10:07:51 -0800409 __u32 preferred_time;
410 __u32 valid_time;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800411};
Ben Cheng655a7c02013-10-16 16:09:24 -0700412struct tcmsg {
Tao Baod7db5942015-01-28 10:07:51 -0800413 unsigned char tcm_family;
414 unsigned char tcm__pad1;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800415 unsigned short tcm__pad2;
Tao Baod7db5942015-01-28 10:07:51 -0800416 int tcm_ifindex;
Tao Baod7db5942015-01-28 10:07:51 -0800417 __u32 tcm_handle;
418 __u32 tcm_parent;
Christopher Ferris76a1d452018-06-27 14:12:29 -0700419#define tcm_block_index tcm_parent
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800420 __u32 tcm_info;
Ben Cheng655a7c02013-10-16 16:09:24 -0700421};
Christopher Ferris76a1d452018-06-27 14:12:29 -0700422#define TCM_IFINDEX_MAGIC_BLOCK (0xFFFFFFFFU)
Ben Cheng655a7c02013-10-16 16:09:24 -0700423enum {
Tao Baod7db5942015-01-28 10:07:51 -0800424 TCA_UNSPEC,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800425 TCA_KIND,
Tao Baod7db5942015-01-28 10:07:51 -0800426 TCA_OPTIONS,
Tao Baod7db5942015-01-28 10:07:51 -0800427 TCA_STATS,
428 TCA_XSTATS,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800429 TCA_RATE,
Tao Baod7db5942015-01-28 10:07:51 -0800430 TCA_FCNT,
Tao Baod7db5942015-01-28 10:07:51 -0800431 TCA_STATS2,
432 TCA_STAB,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800433 TCA_PAD,
Christopher Ferris525ce912017-07-26 13:12:53 -0700434 TCA_DUMP_INVISIBLE,
Christopher Ferris1308ad32017-11-14 17:32:13 -0800435 TCA_CHAIN,
Christopher Ferris934ec942018-01-31 15:29:16 -0800436 TCA_HW_OFFLOAD,
Christopher Ferris76a1d452018-06-27 14:12:29 -0700437 TCA_INGRESS_BLOCK,
438 TCA_EGRESS_BLOCK,
Tao Baod7db5942015-01-28 10:07:51 -0800439 __TCA_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -0700440};
441#define TCA_MAX (__TCA_MAX - 1)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800442#define TCA_RTA(r) ((struct rtattr *) (((char *) (r)) + NLMSG_ALIGN(sizeof(struct tcmsg))))
Tao Baod7db5942015-01-28 10:07:51 -0800443#define TCA_PAYLOAD(n) NLMSG_PAYLOAD(n, sizeof(struct tcmsg))
Ben Cheng655a7c02013-10-16 16:09:24 -0700444struct nduseroptmsg {
Tao Baod7db5942015-01-28 10:07:51 -0800445 unsigned char nduseropt_family;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800446 unsigned char nduseropt_pad1;
Tao Baod7db5942015-01-28 10:07:51 -0800447 unsigned short nduseropt_opts_len;
448 int nduseropt_ifindex;
Tao Baod7db5942015-01-28 10:07:51 -0800449 __u8 nduseropt_icmp_type;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800450 __u8 nduseropt_icmp_code;
Tao Baod7db5942015-01-28 10:07:51 -0800451 unsigned short nduseropt_pad2;
452 unsigned int nduseropt_pad3;
Ben Cheng655a7c02013-10-16 16:09:24 -0700453};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800454enum {
Tao Baod7db5942015-01-28 10:07:51 -0800455 NDUSEROPT_UNSPEC,
456 NDUSEROPT_SRCADDR,
Tao Baod7db5942015-01-28 10:07:51 -0800457 __NDUSEROPT_MAX
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800458};
Ben Cheng655a7c02013-10-16 16:09:24 -0700459#define NDUSEROPT_MAX (__NDUSEROPT_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700460#define RTMGRP_LINK 1
461#define RTMGRP_NOTIFY 2
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800462#define RTMGRP_NEIGH 4
Ben Cheng655a7c02013-10-16 16:09:24 -0700463#define RTMGRP_TC 8
Ben Cheng655a7c02013-10-16 16:09:24 -0700464#define RTMGRP_IPV4_IFADDR 0x10
465#define RTMGRP_IPV4_MROUTE 0x20
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800466#define RTMGRP_IPV4_ROUTE 0x40
Ben Cheng655a7c02013-10-16 16:09:24 -0700467#define RTMGRP_IPV4_RULE 0x80
Ben Cheng655a7c02013-10-16 16:09:24 -0700468#define RTMGRP_IPV6_IFADDR 0x100
469#define RTMGRP_IPV6_MROUTE 0x200
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800470#define RTMGRP_IPV6_ROUTE 0x400
Ben Cheng655a7c02013-10-16 16:09:24 -0700471#define RTMGRP_IPV6_IFINFO 0x800
Ben Cheng655a7c02013-10-16 16:09:24 -0700472#define RTMGRP_DECnet_IFADDR 0x1000
473#define RTMGRP_DECnet_ROUTE 0x4000
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800474#define RTMGRP_IPV6_PREFIX 0x20000
Ben Cheng655a7c02013-10-16 16:09:24 -0700475enum rtnetlink_groups {
Tao Baod7db5942015-01-28 10:07:51 -0800476 RTNLGRP_NONE,
Ben Cheng655a7c02013-10-16 16:09:24 -0700477#define RTNLGRP_NONE RTNLGRP_NONE
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800478 RTNLGRP_LINK,
Ben Cheng655a7c02013-10-16 16:09:24 -0700479#define RTNLGRP_LINK RTNLGRP_LINK
Tao Baod7db5942015-01-28 10:07:51 -0800480 RTNLGRP_NOTIFY,
Ben Cheng655a7c02013-10-16 16:09:24 -0700481#define RTNLGRP_NOTIFY RTNLGRP_NOTIFY
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800482 RTNLGRP_NEIGH,
Ben Cheng655a7c02013-10-16 16:09:24 -0700483#define RTNLGRP_NEIGH RTNLGRP_NEIGH
Tao Baod7db5942015-01-28 10:07:51 -0800484 RTNLGRP_TC,
Ben Cheng655a7c02013-10-16 16:09:24 -0700485#define RTNLGRP_TC RTNLGRP_TC
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800486 RTNLGRP_IPV4_IFADDR,
Ben Cheng655a7c02013-10-16 16:09:24 -0700487#define RTNLGRP_IPV4_IFADDR RTNLGRP_IPV4_IFADDR
Tao Baod7db5942015-01-28 10:07:51 -0800488 RTNLGRP_IPV4_MROUTE,
Ben Cheng655a7c02013-10-16 16:09:24 -0700489#define RTNLGRP_IPV4_MROUTE RTNLGRP_IPV4_MROUTE
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800490 RTNLGRP_IPV4_ROUTE,
Ben Cheng655a7c02013-10-16 16:09:24 -0700491#define RTNLGRP_IPV4_ROUTE RTNLGRP_IPV4_ROUTE
Tao Baod7db5942015-01-28 10:07:51 -0800492 RTNLGRP_IPV4_RULE,
Ben Cheng655a7c02013-10-16 16:09:24 -0700493#define RTNLGRP_IPV4_RULE RTNLGRP_IPV4_RULE
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800494 RTNLGRP_IPV6_IFADDR,
Ben Cheng655a7c02013-10-16 16:09:24 -0700495#define RTNLGRP_IPV6_IFADDR RTNLGRP_IPV6_IFADDR
Tao Baod7db5942015-01-28 10:07:51 -0800496 RTNLGRP_IPV6_MROUTE,
Ben Cheng655a7c02013-10-16 16:09:24 -0700497#define RTNLGRP_IPV6_MROUTE RTNLGRP_IPV6_MROUTE
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800498 RTNLGRP_IPV6_ROUTE,
Ben Cheng655a7c02013-10-16 16:09:24 -0700499#define RTNLGRP_IPV6_ROUTE RTNLGRP_IPV6_ROUTE
Tao Baod7db5942015-01-28 10:07:51 -0800500 RTNLGRP_IPV6_IFINFO,
Ben Cheng655a7c02013-10-16 16:09:24 -0700501#define RTNLGRP_IPV6_IFINFO RTNLGRP_IPV6_IFINFO
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800502 RTNLGRP_DECnet_IFADDR,
Ben Cheng655a7c02013-10-16 16:09:24 -0700503#define RTNLGRP_DECnet_IFADDR RTNLGRP_DECnet_IFADDR
Tao Baod7db5942015-01-28 10:07:51 -0800504 RTNLGRP_NOP2,
Tao Baod7db5942015-01-28 10:07:51 -0800505 RTNLGRP_DECnet_ROUTE,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800506#define RTNLGRP_DECnet_ROUTE RTNLGRP_DECnet_ROUTE
Tao Baod7db5942015-01-28 10:07:51 -0800507 RTNLGRP_DECnet_RULE,
Ben Cheng655a7c02013-10-16 16:09:24 -0700508#define RTNLGRP_DECnet_RULE RTNLGRP_DECnet_RULE
Tao Baod7db5942015-01-28 10:07:51 -0800509 RTNLGRP_NOP4,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800510 RTNLGRP_IPV6_PREFIX,
Ben Cheng655a7c02013-10-16 16:09:24 -0700511#define RTNLGRP_IPV6_PREFIX RTNLGRP_IPV6_PREFIX
Tao Baod7db5942015-01-28 10:07:51 -0800512 RTNLGRP_IPV6_RULE,
Ben Cheng655a7c02013-10-16 16:09:24 -0700513#define RTNLGRP_IPV6_RULE RTNLGRP_IPV6_RULE
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800514 RTNLGRP_ND_USEROPT,
Ben Cheng655a7c02013-10-16 16:09:24 -0700515#define RTNLGRP_ND_USEROPT RTNLGRP_ND_USEROPT
Tao Baod7db5942015-01-28 10:07:51 -0800516 RTNLGRP_PHONET_IFADDR,
Ben Cheng655a7c02013-10-16 16:09:24 -0700517#define RTNLGRP_PHONET_IFADDR RTNLGRP_PHONET_IFADDR
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800518 RTNLGRP_PHONET_ROUTE,
Ben Cheng655a7c02013-10-16 16:09:24 -0700519#define RTNLGRP_PHONET_ROUTE RTNLGRP_PHONET_ROUTE
Tao Baod7db5942015-01-28 10:07:51 -0800520 RTNLGRP_DCB,
Ben Cheng655a7c02013-10-16 16:09:24 -0700521#define RTNLGRP_DCB RTNLGRP_DCB
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800522 RTNLGRP_IPV4_NETCONF,
Ben Cheng655a7c02013-10-16 16:09:24 -0700523#define RTNLGRP_IPV4_NETCONF RTNLGRP_IPV4_NETCONF
Tao Baod7db5942015-01-28 10:07:51 -0800524 RTNLGRP_IPV6_NETCONF,
Ben Cheng655a7c02013-10-16 16:09:24 -0700525#define RTNLGRP_IPV6_NETCONF RTNLGRP_IPV6_NETCONF
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800526 RTNLGRP_MDB,
Ben Cheng655a7c02013-10-16 16:09:24 -0700527#define RTNLGRP_MDB RTNLGRP_MDB
Christopher Ferris05d08e92016-02-04 13:16:38 -0800528 RTNLGRP_MPLS_ROUTE,
529#define RTNLGRP_MPLS_ROUTE RTNLGRP_MPLS_ROUTE
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800530 RTNLGRP_NSID,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800531#define RTNLGRP_NSID RTNLGRP_NSID
Christopher Ferris525ce912017-07-26 13:12:53 -0700532 RTNLGRP_MPLS_NETCONF,
533#define RTNLGRP_MPLS_NETCONF RTNLGRP_MPLS_NETCONF
Christopher Ferris1308ad32017-11-14 17:32:13 -0800534 RTNLGRP_IPV4_MROUTE_R,
535#define RTNLGRP_IPV4_MROUTE_R RTNLGRP_IPV4_MROUTE_R
536 RTNLGRP_IPV6_MROUTE_R,
537#define RTNLGRP_IPV6_MROUTE_R RTNLGRP_IPV6_MROUTE_R
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700538 RTNLGRP_NEXTHOP,
539#define RTNLGRP_NEXTHOP RTNLGRP_NEXTHOP
Christopher Ferris05d08e92016-02-04 13:16:38 -0800540 __RTNLGRP_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -0700541};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800542#define RTNLGRP_MAX (__RTNLGRP_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700543struct tcamsg {
Tao Baod7db5942015-01-28 10:07:51 -0800544 unsigned char tca_family;
Tao Baod7db5942015-01-28 10:07:51 -0800545 unsigned char tca__pad1;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800546 unsigned short tca__pad2;
Ben Cheng655a7c02013-10-16 16:09:24 -0700547};
Christopher Ferris1308ad32017-11-14 17:32:13 -0800548enum {
549 TCA_ROOT_UNSPEC,
550 TCA_ROOT_TAB,
551#define TCA_ACT_TAB TCA_ROOT_TAB
552#define TCAA_MAX TCA_ROOT_TAB
553 TCA_ROOT_FLAGS,
554 TCA_ROOT_COUNT,
555 TCA_ROOT_TIME_DELTA,
556 __TCA_ROOT_MAX,
557#define TCA_ROOT_MAX (__TCA_ROOT_MAX - 1)
558};
Tao Baod7db5942015-01-28 10:07:51 -0800559#define TA_RTA(r) ((struct rtattr *) (((char *) (r)) + NLMSG_ALIGN(sizeof(struct tcamsg))))
Tao Baod7db5942015-01-28 10:07:51 -0800560#define TA_PAYLOAD(n) NLMSG_PAYLOAD(n, sizeof(struct tcamsg))
Christopher Ferris1308ad32017-11-14 17:32:13 -0800561#define TCA_FLAG_LARGE_DUMP_ON (1 << 0)
Ben Cheng655a7c02013-10-16 16:09:24 -0700562#define RTEXT_FILTER_VF (1 << 0)
563#define RTEXT_FILTER_BRVLAN (1 << 1)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800564#define RTEXT_FILTER_BRVLAN_COMPRESSED (1 << 2)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800565#define RTEXT_FILTER_SKIP_STATS (1 << 3)
Ben Cheng655a7c02013-10-16 16:09:24 -0700566#endif