blob: 103ff5d630237ba0c56536f146c7617d32b96442 [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
Tao Baod7db5942015-01-28 10:07:51 -0800114 RTM_GETNETCONF = 82,
Ben Cheng655a7c02013-10-16 16:09:24 -0700115#define RTM_GETNETCONF RTM_GETNETCONF
Tao Baod7db5942015-01-28 10:07:51 -0800116 RTM_NEWMDB = 84,
Ben Cheng655a7c02013-10-16 16:09:24 -0700117#define RTM_NEWMDB RTM_NEWMDB
Tao Baod7db5942015-01-28 10:07:51 -0800118 RTM_DELMDB = 85,
Ben Cheng655a7c02013-10-16 16:09:24 -0700119#define RTM_DELMDB RTM_DELMDB
Tao Baod7db5942015-01-28 10:07:51 -0800120 RTM_GETMDB = 86,
Ben Cheng655a7c02013-10-16 16:09:24 -0700121#define RTM_GETMDB RTM_GETMDB
Christopher Ferris05d08e92016-02-04 13:16:38 -0800122 RTM_NEWNSID = 88,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800123#define RTM_NEWNSID RTM_NEWNSID
124 RTM_DELNSID = 89,
125#define RTM_DELNSID RTM_DELNSID
126 RTM_GETNSID = 90,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800127#define RTM_GETNSID RTM_GETNSID
Christopher Ferris106b3a82016-08-24 12:15:38 -0700128 RTM_NEWSTATS = 92,
129#define RTM_NEWSTATS RTM_NEWSTATS
130 RTM_GETSTATS = 94,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700131#define RTM_GETSTATS RTM_GETSTATS
Christopher Ferris05d08e92016-02-04 13:16:38 -0800132 __RTM_MAX,
Ben Cheng655a7c02013-10-16 16:09:24 -0700133#define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1)
134};
135#define RTM_NR_MSGTYPES (RTM_MAX + 1 - RTM_BASE)
136#define RTM_NR_FAMILIES (RTM_NR_MSGTYPES >> 2)
Ben Cheng655a7c02013-10-16 16:09:24 -0700137#define RTM_FAM(cmd) (((cmd) - RTM_BASE) >> 2)
138struct rtattr {
Tao Baod7db5942015-01-28 10:07:51 -0800139 unsigned short rta_len;
140 unsigned short rta_type;
Ben Cheng655a7c02013-10-16 16:09:24 -0700141};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800142#define RTA_ALIGNTO 4U
Tao Baod7db5942015-01-28 10:07:51 -0800143#define RTA_ALIGN(len) (((len) + RTA_ALIGNTO - 1) & ~(RTA_ALIGNTO - 1))
144#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 -0800145#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 -0700146#define RTA_LENGTH(len) (RTA_ALIGN(sizeof(struct rtattr)) + (len))
147#define RTA_SPACE(len) RTA_ALIGN(RTA_LENGTH(len))
Tao Baod7db5942015-01-28 10:07:51 -0800148#define RTA_DATA(rta) ((void *) (((char *) (rta)) + RTA_LENGTH(0)))
Tao Baod7db5942015-01-28 10:07:51 -0800149#define RTA_PAYLOAD(rta) ((int) ((rta)->rta_len) - RTA_LENGTH(0))
Ben Cheng655a7c02013-10-16 16:09:24 -0700150struct rtmsg {
Tao Baod7db5942015-01-28 10:07:51 -0800151 unsigned char rtm_family;
152 unsigned char rtm_dst_len;
Tao Baod7db5942015-01-28 10:07:51 -0800153 unsigned char rtm_src_len;
154 unsigned char rtm_tos;
155 unsigned char rtm_table;
156 unsigned char rtm_protocol;
Tao Baod7db5942015-01-28 10:07:51 -0800157 unsigned char rtm_scope;
158 unsigned char rtm_type;
159 unsigned rtm_flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700160};
Ben Cheng655a7c02013-10-16 16:09:24 -0700161enum {
Tao Baod7db5942015-01-28 10:07:51 -0800162 RTN_UNSPEC,
163 RTN_UNICAST,
164 RTN_LOCAL,
Tao Baod7db5942015-01-28 10:07:51 -0800165 RTN_BROADCAST,
166 RTN_ANYCAST,
167 RTN_MULTICAST,
168 RTN_BLACKHOLE,
Tao Baod7db5942015-01-28 10:07:51 -0800169 RTN_UNREACHABLE,
170 RTN_PROHIBIT,
171 RTN_THROW,
172 RTN_NAT,
Tao Baod7db5942015-01-28 10:07:51 -0800173 RTN_XRESOLVE,
174 __RTN_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -0700175};
176#define RTN_MAX (__RTN_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700177#define RTPROT_UNSPEC 0
178#define RTPROT_REDIRECT 1
179#define RTPROT_KERNEL 2
180#define RTPROT_BOOT 3
Ben Cheng655a7c02013-10-16 16:09:24 -0700181#define RTPROT_STATIC 4
182#define RTPROT_GATED 8
183#define RTPROT_RA 9
184#define RTPROT_MRT 10
Ben Cheng655a7c02013-10-16 16:09:24 -0700185#define RTPROT_ZEBRA 11
186#define RTPROT_BIRD 12
187#define RTPROT_DNROUTED 13
188#define RTPROT_XORP 14
Ben Cheng655a7c02013-10-16 16:09:24 -0700189#define RTPROT_NTK 15
190#define RTPROT_DHCP 16
Christopher Ferris05d08e92016-02-04 13:16:38 -0800191#define RTPROT_MROUTED 17
192#define RTPROT_BABEL 42
193enum rt_scope_t {
Tao Baod7db5942015-01-28 10:07:51 -0800194 RT_SCOPE_UNIVERSE = 0,
195 RT_SCOPE_SITE = 200,
196 RT_SCOPE_LINK = 253,
197 RT_SCOPE_HOST = 254,
Tao Baod7db5942015-01-28 10:07:51 -0800198 RT_SCOPE_NOWHERE = 255
Ben Cheng655a7c02013-10-16 16:09:24 -0700199};
200#define RTM_F_NOTIFY 0x100
201#define RTM_F_CLONED 0x200
Ben Cheng655a7c02013-10-16 16:09:24 -0700202#define RTM_F_EQUALIZE 0x400
203#define RTM_F_PREFIX 0x800
Christopher Ferris05d08e92016-02-04 13:16:38 -0800204#define RTM_F_LOOKUP_TABLE 0x1000
Ben Cheng655a7c02013-10-16 16:09:24 -0700205enum rt_class_t {
Tao Baod7db5942015-01-28 10:07:51 -0800206 RT_TABLE_UNSPEC = 0,
Tao Baod7db5942015-01-28 10:07:51 -0800207 RT_TABLE_COMPAT = 252,
208 RT_TABLE_DEFAULT = 253,
209 RT_TABLE_MAIN = 254,
210 RT_TABLE_LOCAL = 255,
Tao Baod7db5942015-01-28 10:07:51 -0800211 RT_TABLE_MAX = 0xFFFFFFFF
Ben Cheng655a7c02013-10-16 16:09:24 -0700212};
213enum rtattr_type_t {
Tao Baod7db5942015-01-28 10:07:51 -0800214 RTA_UNSPEC,
Tao Baod7db5942015-01-28 10:07:51 -0800215 RTA_DST,
216 RTA_SRC,
217 RTA_IIF,
218 RTA_OIF,
Tao Baod7db5942015-01-28 10:07:51 -0800219 RTA_GATEWAY,
220 RTA_PRIORITY,
221 RTA_PREFSRC,
222 RTA_METRICS,
Tao Baod7db5942015-01-28 10:07:51 -0800223 RTA_MULTIPATH,
224 RTA_PROTOINFO,
225 RTA_FLOW,
226 RTA_CACHEINFO,
Tao Baod7db5942015-01-28 10:07:51 -0800227 RTA_SESSION,
228 RTA_MP_ALGO,
229 RTA_TABLE,
230 RTA_MARK,
Tao Baod7db5942015-01-28 10:07:51 -0800231 RTA_MFC_STATS,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800232 RTA_VIA,
233 RTA_NEWDST,
234 RTA_PREF,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800235 RTA_ENCAP_TYPE,
236 RTA_ENCAP,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700237 RTA_EXPIRES,
238 RTA_PAD,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800239 RTA_UID,
Tao Baod7db5942015-01-28 10:07:51 -0800240 __RTA_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -0700241};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800242#define RTA_MAX (__RTA_MAX - 1)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800243#define RTM_RTA(r) ((struct rtattr *) (((char *) (r)) + NLMSG_ALIGN(sizeof(struct rtmsg))))
Tao Baod7db5942015-01-28 10:07:51 -0800244#define RTM_PAYLOAD(n) NLMSG_PAYLOAD(n, sizeof(struct rtmsg))
Ben Cheng655a7c02013-10-16 16:09:24 -0700245struct rtnexthop {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800246 unsigned short rtnh_len;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800247 unsigned char rtnh_flags;
Tao Baod7db5942015-01-28 10:07:51 -0800248 unsigned char rtnh_hops;
249 int rtnh_ifindex;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800250};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800251#define RTNH_F_DEAD 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700252#define RTNH_F_PERVASIVE 2
253#define RTNH_F_ONLINK 4
Christopher Ferris05d08e92016-02-04 13:16:38 -0800254#define RTNH_F_OFFLOAD 8
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800255#define RTNH_F_LINKDOWN 16
Christopher Ferris49f525c2016-12-12 14:55:36 -0800256#define RTNH_COMPARE_MASK (RTNH_F_DEAD | RTNH_F_LINKDOWN | RTNH_F_OFFLOAD)
Ben Cheng655a7c02013-10-16 16:09:24 -0700257#define RTNH_ALIGNTO 4
Tao Baod7db5942015-01-28 10:07:51 -0800258#define RTNH_ALIGN(len) (((len) + RTNH_ALIGNTO - 1) & ~(RTNH_ALIGNTO - 1))
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800259#define RTNH_OK(rtnh,len) ((rtnh)->rtnh_len >= sizeof(struct rtnexthop) && ((int) (rtnh)->rtnh_len) <= (len))
Tao Baod7db5942015-01-28 10:07:51 -0800260#define RTNH_NEXT(rtnh) ((struct rtnexthop *) (((char *) (rtnh)) + RTNH_ALIGN((rtnh)->rtnh_len)))
Ben Cheng655a7c02013-10-16 16:09:24 -0700261#define RTNH_LENGTH(len) (RTNH_ALIGN(sizeof(struct rtnexthop)) + (len))
Ben Cheng655a7c02013-10-16 16:09:24 -0700262#define RTNH_SPACE(len) RTNH_ALIGN(RTNH_LENGTH(len))
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800263#define RTNH_DATA(rtnh) ((struct rtattr *) (((char *) (rtnh)) + RTNH_LENGTH(0)))
Christopher Ferris05d08e92016-02-04 13:16:38 -0800264struct rtvia {
265 __kernel_sa_family_t rtvia_family;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800266 __u8 rtvia_addr[0];
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800267};
Ben Cheng655a7c02013-10-16 16:09:24 -0700268struct rta_cacheinfo {
Tao Baod7db5942015-01-28 10:07:51 -0800269 __u32 rta_clntref;
Tao Baod7db5942015-01-28 10:07:51 -0800270 __u32 rta_lastuse;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800271 __s32 rta_expires;
Tao Baod7db5942015-01-28 10:07:51 -0800272 __u32 rta_error;
273 __u32 rta_used;
Ben Cheng655a7c02013-10-16 16:09:24 -0700274#define RTNETLINK_HAVE_PEERINFO 1
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800275 __u32 rta_id;
Tao Baod7db5942015-01-28 10:07:51 -0800276 __u32 rta_ts;
277 __u32 rta_tsage;
Ben Cheng655a7c02013-10-16 16:09:24 -0700278};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800279enum {
Tao Baod7db5942015-01-28 10:07:51 -0800280 RTAX_UNSPEC,
Ben Cheng655a7c02013-10-16 16:09:24 -0700281#define RTAX_UNSPEC RTAX_UNSPEC
Tao Baod7db5942015-01-28 10:07:51 -0800282 RTAX_LOCK,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800283#define RTAX_LOCK RTAX_LOCK
Tao Baod7db5942015-01-28 10:07:51 -0800284 RTAX_MTU,
Ben Cheng655a7c02013-10-16 16:09:24 -0700285#define RTAX_MTU RTAX_MTU
Tao Baod7db5942015-01-28 10:07:51 -0800286 RTAX_WINDOW,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800287#define RTAX_WINDOW RTAX_WINDOW
Tao Baod7db5942015-01-28 10:07:51 -0800288 RTAX_RTT,
Ben Cheng655a7c02013-10-16 16:09:24 -0700289#define RTAX_RTT RTAX_RTT
Tao Baod7db5942015-01-28 10:07:51 -0800290 RTAX_RTTVAR,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800291#define RTAX_RTTVAR RTAX_RTTVAR
Tao Baod7db5942015-01-28 10:07:51 -0800292 RTAX_SSTHRESH,
Ben Cheng655a7c02013-10-16 16:09:24 -0700293#define RTAX_SSTHRESH RTAX_SSTHRESH
Tao Baod7db5942015-01-28 10:07:51 -0800294 RTAX_CWND,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800295#define RTAX_CWND RTAX_CWND
Tao Baod7db5942015-01-28 10:07:51 -0800296 RTAX_ADVMSS,
Ben Cheng655a7c02013-10-16 16:09:24 -0700297#define RTAX_ADVMSS RTAX_ADVMSS
Tao Baod7db5942015-01-28 10:07:51 -0800298 RTAX_REORDERING,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800299#define RTAX_REORDERING RTAX_REORDERING
Tao Baod7db5942015-01-28 10:07:51 -0800300 RTAX_HOPLIMIT,
Ben Cheng655a7c02013-10-16 16:09:24 -0700301#define RTAX_HOPLIMIT RTAX_HOPLIMIT
Tao Baod7db5942015-01-28 10:07:51 -0800302 RTAX_INITCWND,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800303#define RTAX_INITCWND RTAX_INITCWND
Tao Baod7db5942015-01-28 10:07:51 -0800304 RTAX_FEATURES,
Ben Cheng655a7c02013-10-16 16:09:24 -0700305#define RTAX_FEATURES RTAX_FEATURES
Tao Baod7db5942015-01-28 10:07:51 -0800306 RTAX_RTO_MIN,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800307#define RTAX_RTO_MIN RTAX_RTO_MIN
Tao Baod7db5942015-01-28 10:07:51 -0800308 RTAX_INITRWND,
Ben Cheng655a7c02013-10-16 16:09:24 -0700309#define RTAX_INITRWND RTAX_INITRWND
Tao Baod7db5942015-01-28 10:07:51 -0800310 RTAX_QUICKACK,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800311#define RTAX_QUICKACK RTAX_QUICKACK
Christopher Ferris05d08e92016-02-04 13:16:38 -0800312 RTAX_CC_ALGO,
313#define RTAX_CC_ALGO RTAX_CC_ALGO
Tao Baod7db5942015-01-28 10:07:51 -0800314 __RTAX_MAX
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800315};
Ben Cheng655a7c02013-10-16 16:09:24 -0700316#define RTAX_MAX (__RTAX_MAX - 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800317#define RTAX_FEATURE_ECN (1 << 0)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800318#define RTAX_FEATURE_SACK (1 << 1)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800319#define RTAX_FEATURE_TIMESTAMP (1 << 2)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800320#define RTAX_FEATURE_ALLFRAG (1 << 3)
321#define RTAX_FEATURE_MASK (RTAX_FEATURE_ECN | RTAX_FEATURE_SACK | RTAX_FEATURE_TIMESTAMP | RTAX_FEATURE_ALLFRAG)
Ben Cheng655a7c02013-10-16 16:09:24 -0700322struct rta_session {
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800323 __u8 proto;
Tao Baod7db5942015-01-28 10:07:51 -0800324 __u8 pad1;
Tao Baod7db5942015-01-28 10:07:51 -0800325 __u16 pad2;
326 union {
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800327 struct {
Tao Baod7db5942015-01-28 10:07:51 -0800328 __u16 sport;
Tao Baod7db5942015-01-28 10:07:51 -0800329 __u16 dport;
330 } ports;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800331 struct {
Tao Baod7db5942015-01-28 10:07:51 -0800332 __u8 type;
Tao Baod7db5942015-01-28 10:07:51 -0800333 __u8 code;
334 __u16 ident;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800335 } icmpt;
Tao Baod7db5942015-01-28 10:07:51 -0800336 __u32 spi;
Tao Baod7db5942015-01-28 10:07:51 -0800337 } u;
Ben Cheng655a7c02013-10-16 16:09:24 -0700338};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800339struct rta_mfc_stats {
Tao Baod7db5942015-01-28 10:07:51 -0800340 __u64 mfcs_packets;
Tao Baod7db5942015-01-28 10:07:51 -0800341 __u64 mfcs_bytes;
342 __u64 mfcs_wrong_if;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800343};
Ben Cheng655a7c02013-10-16 16:09:24 -0700344struct rtgenmsg {
Tao Baod7db5942015-01-28 10:07:51 -0800345 unsigned char rtgen_family;
Ben Cheng655a7c02013-10-16 16:09:24 -0700346};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800347struct ifinfomsg {
Tao Baod7db5942015-01-28 10:07:51 -0800348 unsigned char ifi_family;
Tao Baod7db5942015-01-28 10:07:51 -0800349 unsigned char __ifi_pad;
350 unsigned short ifi_type;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800351 int ifi_index;
Tao Baod7db5942015-01-28 10:07:51 -0800352 unsigned ifi_flags;
Tao Baod7db5942015-01-28 10:07:51 -0800353 unsigned ifi_change;
Ben Cheng655a7c02013-10-16 16:09:24 -0700354};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800355struct prefixmsg {
Tao Baod7db5942015-01-28 10:07:51 -0800356 unsigned char prefix_family;
Tao Baod7db5942015-01-28 10:07:51 -0800357 unsigned char prefix_pad1;
358 unsigned short prefix_pad2;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800359 int prefix_ifindex;
Tao Baod7db5942015-01-28 10:07:51 -0800360 unsigned char prefix_type;
Tao Baod7db5942015-01-28 10:07:51 -0800361 unsigned char prefix_len;
362 unsigned char prefix_flags;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800363 unsigned char prefix_pad3;
Ben Cheng655a7c02013-10-16 16:09:24 -0700364};
Tao Baod7db5942015-01-28 10:07:51 -0800365enum {
366 PREFIX_UNSPEC,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800367 PREFIX_ADDRESS,
Tao Baod7db5942015-01-28 10:07:51 -0800368 PREFIX_CACHEINFO,
Tao Baod7db5942015-01-28 10:07:51 -0800369 __PREFIX_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -0700370};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800371#define PREFIX_MAX (__PREFIX_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700372struct prefix_cacheinfo {
Tao Baod7db5942015-01-28 10:07:51 -0800373 __u32 preferred_time;
374 __u32 valid_time;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800375};
Ben Cheng655a7c02013-10-16 16:09:24 -0700376struct tcmsg {
Tao Baod7db5942015-01-28 10:07:51 -0800377 unsigned char tcm_family;
378 unsigned char tcm__pad1;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800379 unsigned short tcm__pad2;
Tao Baod7db5942015-01-28 10:07:51 -0800380 int tcm_ifindex;
Tao Baod7db5942015-01-28 10:07:51 -0800381 __u32 tcm_handle;
382 __u32 tcm_parent;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800383 __u32 tcm_info;
Ben Cheng655a7c02013-10-16 16:09:24 -0700384};
385enum {
Tao Baod7db5942015-01-28 10:07:51 -0800386 TCA_UNSPEC,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800387 TCA_KIND,
Tao Baod7db5942015-01-28 10:07:51 -0800388 TCA_OPTIONS,
Tao Baod7db5942015-01-28 10:07:51 -0800389 TCA_STATS,
390 TCA_XSTATS,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800391 TCA_RATE,
Tao Baod7db5942015-01-28 10:07:51 -0800392 TCA_FCNT,
Tao Baod7db5942015-01-28 10:07:51 -0800393 TCA_STATS2,
394 TCA_STAB,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800395 TCA_PAD,
Tao Baod7db5942015-01-28 10:07:51 -0800396 __TCA_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -0700397};
398#define TCA_MAX (__TCA_MAX - 1)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800399#define TCA_RTA(r) ((struct rtattr *) (((char *) (r)) + NLMSG_ALIGN(sizeof(struct tcmsg))))
Tao Baod7db5942015-01-28 10:07:51 -0800400#define TCA_PAYLOAD(n) NLMSG_PAYLOAD(n, sizeof(struct tcmsg))
Ben Cheng655a7c02013-10-16 16:09:24 -0700401struct nduseroptmsg {
Tao Baod7db5942015-01-28 10:07:51 -0800402 unsigned char nduseropt_family;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800403 unsigned char nduseropt_pad1;
Tao Baod7db5942015-01-28 10:07:51 -0800404 unsigned short nduseropt_opts_len;
405 int nduseropt_ifindex;
Tao Baod7db5942015-01-28 10:07:51 -0800406 __u8 nduseropt_icmp_type;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800407 __u8 nduseropt_icmp_code;
Tao Baod7db5942015-01-28 10:07:51 -0800408 unsigned short nduseropt_pad2;
409 unsigned int nduseropt_pad3;
Ben Cheng655a7c02013-10-16 16:09:24 -0700410};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800411enum {
Tao Baod7db5942015-01-28 10:07:51 -0800412 NDUSEROPT_UNSPEC,
413 NDUSEROPT_SRCADDR,
Tao Baod7db5942015-01-28 10:07:51 -0800414 __NDUSEROPT_MAX
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800415};
Ben Cheng655a7c02013-10-16 16:09:24 -0700416#define NDUSEROPT_MAX (__NDUSEROPT_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700417#define RTMGRP_LINK 1
418#define RTMGRP_NOTIFY 2
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800419#define RTMGRP_NEIGH 4
Ben Cheng655a7c02013-10-16 16:09:24 -0700420#define RTMGRP_TC 8
Ben Cheng655a7c02013-10-16 16:09:24 -0700421#define RTMGRP_IPV4_IFADDR 0x10
422#define RTMGRP_IPV4_MROUTE 0x20
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800423#define RTMGRP_IPV4_ROUTE 0x40
Ben Cheng655a7c02013-10-16 16:09:24 -0700424#define RTMGRP_IPV4_RULE 0x80
Ben Cheng655a7c02013-10-16 16:09:24 -0700425#define RTMGRP_IPV6_IFADDR 0x100
426#define RTMGRP_IPV6_MROUTE 0x200
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800427#define RTMGRP_IPV6_ROUTE 0x400
Ben Cheng655a7c02013-10-16 16:09:24 -0700428#define RTMGRP_IPV6_IFINFO 0x800
Ben Cheng655a7c02013-10-16 16:09:24 -0700429#define RTMGRP_DECnet_IFADDR 0x1000
430#define RTMGRP_DECnet_ROUTE 0x4000
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800431#define RTMGRP_IPV6_PREFIX 0x20000
Ben Cheng655a7c02013-10-16 16:09:24 -0700432enum rtnetlink_groups {
Tao Baod7db5942015-01-28 10:07:51 -0800433 RTNLGRP_NONE,
Ben Cheng655a7c02013-10-16 16:09:24 -0700434#define RTNLGRP_NONE RTNLGRP_NONE
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800435 RTNLGRP_LINK,
Ben Cheng655a7c02013-10-16 16:09:24 -0700436#define RTNLGRP_LINK RTNLGRP_LINK
Tao Baod7db5942015-01-28 10:07:51 -0800437 RTNLGRP_NOTIFY,
Ben Cheng655a7c02013-10-16 16:09:24 -0700438#define RTNLGRP_NOTIFY RTNLGRP_NOTIFY
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800439 RTNLGRP_NEIGH,
Ben Cheng655a7c02013-10-16 16:09:24 -0700440#define RTNLGRP_NEIGH RTNLGRP_NEIGH
Tao Baod7db5942015-01-28 10:07:51 -0800441 RTNLGRP_TC,
Ben Cheng655a7c02013-10-16 16:09:24 -0700442#define RTNLGRP_TC RTNLGRP_TC
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800443 RTNLGRP_IPV4_IFADDR,
Ben Cheng655a7c02013-10-16 16:09:24 -0700444#define RTNLGRP_IPV4_IFADDR RTNLGRP_IPV4_IFADDR
Tao Baod7db5942015-01-28 10:07:51 -0800445 RTNLGRP_IPV4_MROUTE,
Ben Cheng655a7c02013-10-16 16:09:24 -0700446#define RTNLGRP_IPV4_MROUTE RTNLGRP_IPV4_MROUTE
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800447 RTNLGRP_IPV4_ROUTE,
Ben Cheng655a7c02013-10-16 16:09:24 -0700448#define RTNLGRP_IPV4_ROUTE RTNLGRP_IPV4_ROUTE
Tao Baod7db5942015-01-28 10:07:51 -0800449 RTNLGRP_IPV4_RULE,
Ben Cheng655a7c02013-10-16 16:09:24 -0700450#define RTNLGRP_IPV4_RULE RTNLGRP_IPV4_RULE
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800451 RTNLGRP_IPV6_IFADDR,
Ben Cheng655a7c02013-10-16 16:09:24 -0700452#define RTNLGRP_IPV6_IFADDR RTNLGRP_IPV6_IFADDR
Tao Baod7db5942015-01-28 10:07:51 -0800453 RTNLGRP_IPV6_MROUTE,
Ben Cheng655a7c02013-10-16 16:09:24 -0700454#define RTNLGRP_IPV6_MROUTE RTNLGRP_IPV6_MROUTE
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800455 RTNLGRP_IPV6_ROUTE,
Ben Cheng655a7c02013-10-16 16:09:24 -0700456#define RTNLGRP_IPV6_ROUTE RTNLGRP_IPV6_ROUTE
Tao Baod7db5942015-01-28 10:07:51 -0800457 RTNLGRP_IPV6_IFINFO,
Ben Cheng655a7c02013-10-16 16:09:24 -0700458#define RTNLGRP_IPV6_IFINFO RTNLGRP_IPV6_IFINFO
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800459 RTNLGRP_DECnet_IFADDR,
Ben Cheng655a7c02013-10-16 16:09:24 -0700460#define RTNLGRP_DECnet_IFADDR RTNLGRP_DECnet_IFADDR
Tao Baod7db5942015-01-28 10:07:51 -0800461 RTNLGRP_NOP2,
Tao Baod7db5942015-01-28 10:07:51 -0800462 RTNLGRP_DECnet_ROUTE,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800463#define RTNLGRP_DECnet_ROUTE RTNLGRP_DECnet_ROUTE
Tao Baod7db5942015-01-28 10:07:51 -0800464 RTNLGRP_DECnet_RULE,
Ben Cheng655a7c02013-10-16 16:09:24 -0700465#define RTNLGRP_DECnet_RULE RTNLGRP_DECnet_RULE
Tao Baod7db5942015-01-28 10:07:51 -0800466 RTNLGRP_NOP4,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800467 RTNLGRP_IPV6_PREFIX,
Ben Cheng655a7c02013-10-16 16:09:24 -0700468#define RTNLGRP_IPV6_PREFIX RTNLGRP_IPV6_PREFIX
Tao Baod7db5942015-01-28 10:07:51 -0800469 RTNLGRP_IPV6_RULE,
Ben Cheng655a7c02013-10-16 16:09:24 -0700470#define RTNLGRP_IPV6_RULE RTNLGRP_IPV6_RULE
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800471 RTNLGRP_ND_USEROPT,
Ben Cheng655a7c02013-10-16 16:09:24 -0700472#define RTNLGRP_ND_USEROPT RTNLGRP_ND_USEROPT
Tao Baod7db5942015-01-28 10:07:51 -0800473 RTNLGRP_PHONET_IFADDR,
Ben Cheng655a7c02013-10-16 16:09:24 -0700474#define RTNLGRP_PHONET_IFADDR RTNLGRP_PHONET_IFADDR
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800475 RTNLGRP_PHONET_ROUTE,
Ben Cheng655a7c02013-10-16 16:09:24 -0700476#define RTNLGRP_PHONET_ROUTE RTNLGRP_PHONET_ROUTE
Tao Baod7db5942015-01-28 10:07:51 -0800477 RTNLGRP_DCB,
Ben Cheng655a7c02013-10-16 16:09:24 -0700478#define RTNLGRP_DCB RTNLGRP_DCB
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800479 RTNLGRP_IPV4_NETCONF,
Ben Cheng655a7c02013-10-16 16:09:24 -0700480#define RTNLGRP_IPV4_NETCONF RTNLGRP_IPV4_NETCONF
Tao Baod7db5942015-01-28 10:07:51 -0800481 RTNLGRP_IPV6_NETCONF,
Ben Cheng655a7c02013-10-16 16:09:24 -0700482#define RTNLGRP_IPV6_NETCONF RTNLGRP_IPV6_NETCONF
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800483 RTNLGRP_MDB,
Ben Cheng655a7c02013-10-16 16:09:24 -0700484#define RTNLGRP_MDB RTNLGRP_MDB
Christopher Ferris05d08e92016-02-04 13:16:38 -0800485 RTNLGRP_MPLS_ROUTE,
486#define RTNLGRP_MPLS_ROUTE RTNLGRP_MPLS_ROUTE
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800487 RTNLGRP_NSID,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800488#define RTNLGRP_NSID RTNLGRP_NSID
489 __RTNLGRP_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -0700490};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800491#define RTNLGRP_MAX (__RTNLGRP_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700492struct tcamsg {
Tao Baod7db5942015-01-28 10:07:51 -0800493 unsigned char tca_family;
Tao Baod7db5942015-01-28 10:07:51 -0800494 unsigned char tca__pad1;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800495 unsigned short tca__pad2;
Ben Cheng655a7c02013-10-16 16:09:24 -0700496};
Tao Baod7db5942015-01-28 10:07:51 -0800497#define TA_RTA(r) ((struct rtattr *) (((char *) (r)) + NLMSG_ALIGN(sizeof(struct tcamsg))))
Tao Baod7db5942015-01-28 10:07:51 -0800498#define TA_PAYLOAD(n) NLMSG_PAYLOAD(n, sizeof(struct tcamsg))
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800499#define TCA_ACT_TAB 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700500#define TCAA_MAX 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700501#define RTEXT_FILTER_VF (1 << 0)
502#define RTEXT_FILTER_BRVLAN (1 << 1)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800503#define RTEXT_FILTER_BRVLAN_COMPRESSED (1 << 2)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800504#define RTEXT_FILTER_SKIP_STATS (1 << 3)
Ben Cheng655a7c02013-10-16 16:09:24 -0700505#endif