blob: 564790e854f7d1ab903e85420639806d4381ae81 [file] [log] [blame]
David Howells607ca462012-10-13 10:46:48 +01001#ifndef _UAPI__LINUX_RTNETLINK_H
2#define _UAPI__LINUX_RTNETLINK_H
3
4#include <linux/types.h>
5#include <linux/netlink.h>
6#include <linux/if_link.h>
7#include <linux/if_addr.h>
8#include <linux/neighbour.h>
9
10/* rtnetlink families. Values up to 127 are reserved for real address
11 * families, values above 128 may be used arbitrarily.
12 */
13#define RTNL_FAMILY_IPMR 128
14#define RTNL_FAMILY_IP6MR 129
15#define RTNL_FAMILY_MAX 129
16
17/****
18 * Routing/neighbour discovery messages.
19 ****/
20
21/* Types of messages */
22
23enum {
24 RTM_BASE = 16,
25#define RTM_BASE RTM_BASE
26
27 RTM_NEWLINK = 16,
28#define RTM_NEWLINK RTM_NEWLINK
29 RTM_DELLINK,
30#define RTM_DELLINK RTM_DELLINK
31 RTM_GETLINK,
32#define RTM_GETLINK RTM_GETLINK
33 RTM_SETLINK,
34#define RTM_SETLINK RTM_SETLINK
35
36 RTM_NEWADDR = 20,
37#define RTM_NEWADDR RTM_NEWADDR
38 RTM_DELADDR,
39#define RTM_DELADDR RTM_DELADDR
40 RTM_GETADDR,
41#define RTM_GETADDR RTM_GETADDR
42
43 RTM_NEWROUTE = 24,
44#define RTM_NEWROUTE RTM_NEWROUTE
45 RTM_DELROUTE,
46#define RTM_DELROUTE RTM_DELROUTE
47 RTM_GETROUTE,
48#define RTM_GETROUTE RTM_GETROUTE
49
50 RTM_NEWNEIGH = 28,
51#define RTM_NEWNEIGH RTM_NEWNEIGH
52 RTM_DELNEIGH,
53#define RTM_DELNEIGH RTM_DELNEIGH
54 RTM_GETNEIGH,
55#define RTM_GETNEIGH RTM_GETNEIGH
56
57 RTM_NEWRULE = 32,
58#define RTM_NEWRULE RTM_NEWRULE
59 RTM_DELRULE,
60#define RTM_DELRULE RTM_DELRULE
61 RTM_GETRULE,
62#define RTM_GETRULE RTM_GETRULE
63
64 RTM_NEWQDISC = 36,
65#define RTM_NEWQDISC RTM_NEWQDISC
66 RTM_DELQDISC,
67#define RTM_DELQDISC RTM_DELQDISC
68 RTM_GETQDISC,
69#define RTM_GETQDISC RTM_GETQDISC
70
71 RTM_NEWTCLASS = 40,
72#define RTM_NEWTCLASS RTM_NEWTCLASS
73 RTM_DELTCLASS,
74#define RTM_DELTCLASS RTM_DELTCLASS
75 RTM_GETTCLASS,
76#define RTM_GETTCLASS RTM_GETTCLASS
77
78 RTM_NEWTFILTER = 44,
79#define RTM_NEWTFILTER RTM_NEWTFILTER
80 RTM_DELTFILTER,
81#define RTM_DELTFILTER RTM_DELTFILTER
82 RTM_GETTFILTER,
83#define RTM_GETTFILTER RTM_GETTFILTER
84
85 RTM_NEWACTION = 48,
86#define RTM_NEWACTION RTM_NEWACTION
87 RTM_DELACTION,
88#define RTM_DELACTION RTM_DELACTION
89 RTM_GETACTION,
90#define RTM_GETACTION RTM_GETACTION
91
92 RTM_NEWPREFIX = 52,
93#define RTM_NEWPREFIX RTM_NEWPREFIX
94
95 RTM_GETMULTICAST = 58,
96#define RTM_GETMULTICAST RTM_GETMULTICAST
97
98 RTM_GETANYCAST = 62,
99#define RTM_GETANYCAST RTM_GETANYCAST
100
101 RTM_NEWNEIGHTBL = 64,
102#define RTM_NEWNEIGHTBL RTM_NEWNEIGHTBL
103 RTM_GETNEIGHTBL = 66,
104#define RTM_GETNEIGHTBL RTM_GETNEIGHTBL
105 RTM_SETNEIGHTBL,
106#define RTM_SETNEIGHTBL RTM_SETNEIGHTBL
107
108 RTM_NEWNDUSEROPT = 68,
109#define RTM_NEWNDUSEROPT RTM_NEWNDUSEROPT
110
111 RTM_NEWADDRLABEL = 72,
112#define RTM_NEWADDRLABEL RTM_NEWADDRLABEL
113 RTM_DELADDRLABEL,
114#define RTM_DELADDRLABEL RTM_DELADDRLABEL
115 RTM_GETADDRLABEL,
116#define RTM_GETADDRLABEL RTM_GETADDRLABEL
117
118 RTM_GETDCB = 78,
119#define RTM_GETDCB RTM_GETDCB
120 RTM_SETDCB,
121#define RTM_SETDCB RTM_SETDCB
122
Nicolas Dichteld9000822012-10-25 22:28:49 +0000123 RTM_NEWNETCONF = 80,
124#define RTM_NEWNETCONF RTM_NEWNETCONF
David Ahern983701e2017-03-28 14:28:01 -0700125 RTM_DELNETCONF,
126#define RTM_DELNETCONF RTM_DELNETCONF
Nicolas Dichteld9000822012-10-25 22:28:49 +0000127 RTM_GETNETCONF = 82,
128#define RTM_GETNETCONF RTM_GETNETCONF
129
Cong Wang37a393b2012-12-11 22:23:07 +0000130 RTM_NEWMDB = 84,
131#define RTM_NEWMDB RTM_NEWMDB
132 RTM_DELMDB = 85,
133#define RTM_DELMDB RTM_DELMDB
Cong Wangee07c6e2012-12-07 00:04:48 +0000134 RTM_GETMDB = 86,
135#define RTM_GETMDB RTM_GETMDB
136
Nicolas Dichtel0c7aecd2015-01-15 15:11:15 +0100137 RTM_NEWNSID = 88,
138#define RTM_NEWNSID RTM_NEWNSID
Nicolas Dichtel9a963452015-04-07 11:51:53 +0200139 RTM_DELNSID = 89,
140#define RTM_DELNSID RTM_DELNSID
Nicolas Dichtel0c7aecd2015-01-15 15:11:15 +0100141 RTM_GETNSID = 90,
142#define RTM_GETNSID RTM_GETNSID
143
Roopa Prabhu10c9ead2016-04-20 08:43:43 -0700144 RTM_NEWSTATS = 92,
145#define RTM_NEWSTATS RTM_NEWSTATS
146 RTM_GETSTATS = 94,
147#define RTM_GETSTATS RTM_GETSTATS
148
David Howells607ca462012-10-13 10:46:48 +0100149 __RTM_MAX,
150#define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1)
151};
152
153#define RTM_NR_MSGTYPES (RTM_MAX + 1 - RTM_BASE)
154#define RTM_NR_FAMILIES (RTM_NR_MSGTYPES >> 2)
155#define RTM_FAM(cmd) (((cmd) - RTM_BASE) >> 2)
156
157/*
158 Generic structure for encapsulation of optional route information.
159 It is reminiscent of sockaddr, but with sa_family replaced
160 with attribute type.
161 */
162
163struct rtattr {
164 unsigned short rta_len;
165 unsigned short rta_type;
166};
167
168/* Macros to handle rtattributes */
169
Arad, Ronene8444632015-10-09 10:35:47 -0700170#define RTA_ALIGNTO 4U
David Howells607ca462012-10-13 10:46:48 +0100171#define RTA_ALIGN(len) ( ((len)+RTA_ALIGNTO-1) & ~(RTA_ALIGNTO-1) )
172#define RTA_OK(rta,len) ((len) >= (int)sizeof(struct rtattr) && \
173 (rta)->rta_len >= sizeof(struct rtattr) && \
174 (rta)->rta_len <= (len))
175#define RTA_NEXT(rta,attrlen) ((attrlen) -= RTA_ALIGN((rta)->rta_len), \
176 (struct rtattr*)(((char*)(rta)) + RTA_ALIGN((rta)->rta_len)))
177#define RTA_LENGTH(len) (RTA_ALIGN(sizeof(struct rtattr)) + (len))
178#define RTA_SPACE(len) RTA_ALIGN(RTA_LENGTH(len))
179#define RTA_DATA(rta) ((void*)(((char*)(rta)) + RTA_LENGTH(0)))
180#define RTA_PAYLOAD(rta) ((int)((rta)->rta_len) - RTA_LENGTH(0))
181
182
183
184
185/******************************************************************************
186 * Definitions used in routing table administration.
187 ****/
188
189struct rtmsg {
190 unsigned char rtm_family;
191 unsigned char rtm_dst_len;
192 unsigned char rtm_src_len;
193 unsigned char rtm_tos;
194
195 unsigned char rtm_table; /* Routing table id */
196 unsigned char rtm_protocol; /* Routing protocol; see below */
197 unsigned char rtm_scope; /* See below */
198 unsigned char rtm_type; /* See below */
199
200 unsigned rtm_flags;
201};
202
203/* rtm_type */
204
205enum {
206 RTN_UNSPEC,
207 RTN_UNICAST, /* Gateway or direct route */
208 RTN_LOCAL, /* Accept locally */
209 RTN_BROADCAST, /* Accept locally as broadcast,
210 send as broadcast */
211 RTN_ANYCAST, /* Accept locally as broadcast,
212 but send as unicast */
213 RTN_MULTICAST, /* Multicast route */
214 RTN_BLACKHOLE, /* Drop */
215 RTN_UNREACHABLE, /* Destination is unreachable */
216 RTN_PROHIBIT, /* Administratively prohibited */
217 RTN_THROW, /* Not in this table */
218 RTN_NAT, /* Translate this address */
219 RTN_XRESOLVE, /* Use external resolver */
220 __RTN_MAX
221};
222
223#define RTN_MAX (__RTN_MAX - 1)
224
225
226/* rtm_protocol */
227
228#define RTPROT_UNSPEC 0
229#define RTPROT_REDIRECT 1 /* Route installed by ICMP redirects;
230 not used by current IPv4 */
231#define RTPROT_KERNEL 2 /* Route installed by kernel */
232#define RTPROT_BOOT 3 /* Route installed during boot */
233#define RTPROT_STATIC 4 /* Route installed by administrator */
234
235/* Values of protocol >= RTPROT_STATIC are not interpreted by kernel;
236 they are just passed from user and back as is.
237 It will be used by hypothetical multiple routing daemons.
238 Note that protocol values should be standardized in order to
239 avoid conflicts.
240 */
241
242#define RTPROT_GATED 8 /* Apparently, GateD */
243#define RTPROT_RA 9 /* RDISC/ND router advertisements */
244#define RTPROT_MRT 10 /* Merit MRT */
245#define RTPROT_ZEBRA 11 /* Zebra */
246#define RTPROT_BIRD 12 /* BIRD */
247#define RTPROT_DNROUTED 13 /* DECnet routing daemon */
248#define RTPROT_XORP 14 /* XORP */
249#define RTPROT_NTK 15 /* Netsukuku */
250#define RTPROT_DHCP 16 /* DHCP client */
Nicolas Dichtel9a68ac72012-12-04 01:13:38 +0000251#define RTPROT_MROUTED 17 /* Multicast daemon */
Dave Tahtbe955b22014-11-06 08:10:14 -0800252#define RTPROT_BABEL 42 /* Babel daemon */
David Howells607ca462012-10-13 10:46:48 +0100253
254/* rtm_scope
255
256 Really it is not scope, but sort of distance to the destination.
257 NOWHERE are reserved for not existing destinations, HOST is our
258 local addresses, LINK are destinations, located on directly attached
259 link and UNIVERSE is everywhere in the Universe.
260
261 Intermediate values are also possible f.e. interior routes
262 could be assigned a value between UNIVERSE and LINK.
263*/
264
265enum rt_scope_t {
266 RT_SCOPE_UNIVERSE=0,
267/* User defined values */
268 RT_SCOPE_SITE=200,
269 RT_SCOPE_LINK=253,
270 RT_SCOPE_HOST=254,
271 RT_SCOPE_NOWHERE=255
272};
273
274/* rtm_flags */
275
276#define RTM_F_NOTIFY 0x100 /* Notify user of route change */
277#define RTM_F_CLONED 0x200 /* This route is cloned */
278#define RTM_F_EQUALIZE 0x400 /* Multipath equalizer: NI */
279#define RTM_F_PREFIX 0x800 /* Prefix addresses */
David Ahernc36ba662015-09-02 13:58:36 -0700280#define RTM_F_LOOKUP_TABLE 0x1000 /* set rtm_table to FIB lookup result */
Roopa Prabhu0be1b302017-05-25 10:42:38 -0700281#define RTM_F_FIB_MATCH 0x2000 /* return full fib lookup match */
David Howells607ca462012-10-13 10:46:48 +0100282
283/* Reserved table identifiers */
284
285enum rt_class_t {
286 RT_TABLE_UNSPEC=0,
287/* User defined values */
288 RT_TABLE_COMPAT=252,
289 RT_TABLE_DEFAULT=253,
290 RT_TABLE_MAIN=254,
291 RT_TABLE_LOCAL=255,
292 RT_TABLE_MAX=0xFFFFFFFF
293};
294
295
296/* Routing message attributes */
297
298enum rtattr_type_t {
299 RTA_UNSPEC,
300 RTA_DST,
301 RTA_SRC,
302 RTA_IIF,
303 RTA_OIF,
304 RTA_GATEWAY,
305 RTA_PRIORITY,
306 RTA_PREFSRC,
307 RTA_METRICS,
308 RTA_MULTIPATH,
309 RTA_PROTOINFO, /* no longer used */
310 RTA_FLOW,
311 RTA_CACHEINFO,
312 RTA_SESSION, /* no longer used */
313 RTA_MP_ALGO, /* no longer used */
314 RTA_TABLE,
315 RTA_MARK,
Nicolas Dichteladfa85e2012-12-04 01:13:37 +0000316 RTA_MFC_STATS,
Eric W. Biederman03c05662015-03-03 19:13:56 -0600317 RTA_VIA,
318 RTA_NEWDST,
Lubomir Rintelc78ba6d2015-03-11 15:39:21 +0100319 RTA_PREF,
Roopa Prabhua0d9a862015-07-21 10:43:45 +0200320 RTA_ENCAP_TYPE,
321 RTA_ENCAP,
Xin Long32bc2012015-12-16 17:50:11 +0800322 RTA_EXPIRES,
Nicolas Dichtela9a08042016-04-21 18:58:26 +0200323 RTA_PAD,
Lorenzo Colitti622ec2c2016-11-04 02:23:42 +0900324 RTA_UID,
Robert Shearman5b441ac2017-03-10 20:43:24 +0000325 RTA_TTL_PROPAGATE,
David Howells607ca462012-10-13 10:46:48 +0100326 __RTA_MAX
327};
328
329#define RTA_MAX (__RTA_MAX - 1)
330
331#define RTM_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct rtmsg))))
332#define RTM_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct rtmsg))
333
334/* RTM_MULTIPATH --- array of struct rtnexthop.
335 *
336 * "struct rtnexthop" describes all necessary nexthop information,
337 * i.e. parameters of path to a destination via this nexthop.
338 *
339 * At the moment it is impossible to set different prefsrc, mtu, window
340 * and rtt for different paths from multipath.
341 */
342
343struct rtnexthop {
344 unsigned short rtnh_len;
345 unsigned char rtnh_flags;
346 unsigned char rtnh_hops;
347 int rtnh_ifindex;
348};
349
350/* rtnh_flags */
351
352#define RTNH_F_DEAD 1 /* Nexthop is dead (used by multipath) */
353#define RTNH_F_PERVASIVE 2 /* Do recursive gateway lookup */
354#define RTNH_F_ONLINK 4 /* Gateway is forced on link */
Roopa Prabhueea39942015-05-13 21:17:41 -0700355#define RTNH_F_OFFLOAD 8 /* offloaded route */
Andy Gospodarek8a3d0312015-06-23 13:45:36 -0400356#define RTNH_F_LINKDOWN 16 /* carrier-down on nexthop */
Nikolay Aleksandrov1708ebc2017-01-03 12:13:39 +0100357#define RTNH_F_UNRESOLVED 32 /* The entry is unresolved (ipmr) */
Andy Gospodarek8a3d0312015-06-23 13:45:36 -0400358
Jiri Pirko85dda4e2016-10-18 18:59:34 +0200359#define RTNH_COMPARE_MASK (RTNH_F_DEAD | RTNH_F_LINKDOWN | RTNH_F_OFFLOAD)
David Howells607ca462012-10-13 10:46:48 +0100360
361/* Macros to handle hexthops */
362
363#define RTNH_ALIGNTO 4
364#define RTNH_ALIGN(len) ( ((len)+RTNH_ALIGNTO-1) & ~(RTNH_ALIGNTO-1) )
365#define RTNH_OK(rtnh,len) ((rtnh)->rtnh_len >= sizeof(struct rtnexthop) && \
366 ((int)(rtnh)->rtnh_len) <= (len))
367#define RTNH_NEXT(rtnh) ((struct rtnexthop*)(((char*)(rtnh)) + RTNH_ALIGN((rtnh)->rtnh_len)))
368#define RTNH_LENGTH(len) (RTNH_ALIGN(sizeof(struct rtnexthop)) + (len))
369#define RTNH_SPACE(len) RTNH_ALIGN(RTNH_LENGTH(len))
370#define RTNH_DATA(rtnh) ((struct rtattr*)(((char*)(rtnh)) + RTNH_LENGTH(0)))
371
Eric W. Biederman03c05662015-03-03 19:13:56 -0600372/* RTA_VIA */
373struct rtvia {
374 __kernel_sa_family_t rtvia_family;
375 __u8 rtvia_addr[0];
376};
377
David Howells607ca462012-10-13 10:46:48 +0100378/* RTM_CACHEINFO */
379
380struct rta_cacheinfo {
381 __u32 rta_clntref;
382 __u32 rta_lastuse;
383 __s32 rta_expires;
384 __u32 rta_error;
385 __u32 rta_used;
386
387#define RTNETLINK_HAVE_PEERINFO 1
388 __u32 rta_id;
389 __u32 rta_ts;
390 __u32 rta_tsage;
391};
392
393/* RTM_METRICS --- array of struct rtattr with types of RTAX_* */
394
395enum {
396 RTAX_UNSPEC,
397#define RTAX_UNSPEC RTAX_UNSPEC
398 RTAX_LOCK,
399#define RTAX_LOCK RTAX_LOCK
400 RTAX_MTU,
401#define RTAX_MTU RTAX_MTU
402 RTAX_WINDOW,
403#define RTAX_WINDOW RTAX_WINDOW
404 RTAX_RTT,
405#define RTAX_RTT RTAX_RTT
406 RTAX_RTTVAR,
407#define RTAX_RTTVAR RTAX_RTTVAR
408 RTAX_SSTHRESH,
409#define RTAX_SSTHRESH RTAX_SSTHRESH
410 RTAX_CWND,
411#define RTAX_CWND RTAX_CWND
412 RTAX_ADVMSS,
413#define RTAX_ADVMSS RTAX_ADVMSS
414 RTAX_REORDERING,
415#define RTAX_REORDERING RTAX_REORDERING
416 RTAX_HOPLIMIT,
417#define RTAX_HOPLIMIT RTAX_HOPLIMIT
418 RTAX_INITCWND,
419#define RTAX_INITCWND RTAX_INITCWND
420 RTAX_FEATURES,
421#define RTAX_FEATURES RTAX_FEATURES
422 RTAX_RTO_MIN,
423#define RTAX_RTO_MIN RTAX_RTO_MIN
424 RTAX_INITRWND,
425#define RTAX_INITRWND RTAX_INITRWND
Cong Wangbcefe172013-06-15 09:39:18 +0800426 RTAX_QUICKACK,
427#define RTAX_QUICKACK RTAX_QUICKACK
Daniel Borkmannea697632015-01-05 23:57:47 +0100428 RTAX_CC_ALGO,
429#define RTAX_CC_ALGO RTAX_CC_ALGO
David Howells607ca462012-10-13 10:46:48 +0100430 __RTAX_MAX
431};
432
433#define RTAX_MAX (__RTAX_MAX - 1)
434
Daniel Borkmannb8d3e412015-08-31 15:58:46 +0200435#define RTAX_FEATURE_ECN (1 << 0)
436#define RTAX_FEATURE_SACK (1 << 1)
437#define RTAX_FEATURE_TIMESTAMP (1 << 2)
438#define RTAX_FEATURE_ALLFRAG (1 << 3)
439
440#define RTAX_FEATURE_MASK (RTAX_FEATURE_ECN | RTAX_FEATURE_SACK | \
441 RTAX_FEATURE_TIMESTAMP | RTAX_FEATURE_ALLFRAG)
David Howells607ca462012-10-13 10:46:48 +0100442
443struct rta_session {
444 __u8 proto;
445 __u8 pad1;
446 __u16 pad2;
447
448 union {
449 struct {
450 __u16 sport;
451 __u16 dport;
452 } ports;
453
454 struct {
455 __u8 type;
456 __u8 code;
457 __u16 ident;
458 } icmpt;
459
460 __u32 spi;
461 } u;
462};
463
Nicolas Dichteladfa85e2012-12-04 01:13:37 +0000464struct rta_mfc_stats {
465 __u64 mfcs_packets;
466 __u64 mfcs_bytes;
467 __u64 mfcs_wrong_if;
468};
469
David Howells607ca462012-10-13 10:46:48 +0100470/****
471 * General form of address family dependent message.
472 ****/
473
474struct rtgenmsg {
475 unsigned char rtgen_family;
476};
477
478/*****************************************************************
479 * Link layer specific messages.
480 ****/
481
482/* struct ifinfomsg
483 * passes link level specific information, not dependent
484 * on network protocol.
485 */
486
487struct ifinfomsg {
488 unsigned char ifi_family;
489 unsigned char __ifi_pad;
490 unsigned short ifi_type; /* ARPHRD_* */
491 int ifi_index; /* Link index */
492 unsigned ifi_flags; /* IFF_* flags */
493 unsigned ifi_change; /* IFF_* change mask */
494};
495
496/********************************************************************
497 * prefix information
498 ****/
499
500struct prefixmsg {
501 unsigned char prefix_family;
502 unsigned char prefix_pad1;
503 unsigned short prefix_pad2;
504 int prefix_ifindex;
505 unsigned char prefix_type;
506 unsigned char prefix_len;
507 unsigned char prefix_flags;
508 unsigned char prefix_pad3;
509};
510
511enum
512{
513 PREFIX_UNSPEC,
514 PREFIX_ADDRESS,
515 PREFIX_CACHEINFO,
516 __PREFIX_MAX
517};
518
519#define PREFIX_MAX (__PREFIX_MAX - 1)
520
521struct prefix_cacheinfo {
522 __u32 preferred_time;
523 __u32 valid_time;
524};
525
526
527/*****************************************************************
528 * Traffic control messages.
529 ****/
530
531struct tcmsg {
532 unsigned char tcm_family;
533 unsigned char tcm__pad1;
534 unsigned short tcm__pad2;
535 int tcm_ifindex;
536 __u32 tcm_handle;
537 __u32 tcm_parent;
538 __u32 tcm_info;
539};
540
541enum {
542 TCA_UNSPEC,
543 TCA_KIND,
544 TCA_OPTIONS,
545 TCA_STATS,
546 TCA_XSTATS,
547 TCA_RATE,
548 TCA_FCNT,
549 TCA_STATS2,
550 TCA_STAB,
Nicolas Dichtel9854518e2016-04-26 10:06:18 +0200551 TCA_PAD,
Jiri Kosina49b49972017-03-08 16:03:32 +0100552 TCA_DUMP_INVISIBLE,
Jiri Pirko5bc17012017-05-17 11:08:01 +0200553 TCA_CHAIN,
David Howells607ca462012-10-13 10:46:48 +0100554 __TCA_MAX
555};
556
557#define TCA_MAX (__TCA_MAX - 1)
558
559#define TCA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcmsg))))
560#define TCA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcmsg))
561
562/********************************************************************
563 * Neighbor Discovery userland options
564 ****/
565
566struct nduseroptmsg {
567 unsigned char nduseropt_family;
568 unsigned char nduseropt_pad1;
569 unsigned short nduseropt_opts_len; /* Total length of options */
570 int nduseropt_ifindex;
571 __u8 nduseropt_icmp_type;
572 __u8 nduseropt_icmp_code;
573 unsigned short nduseropt_pad2;
574 unsigned int nduseropt_pad3;
575 /* Followed by one or more ND options */
576};
577
578enum {
579 NDUSEROPT_UNSPEC,
580 NDUSEROPT_SRCADDR,
581 __NDUSEROPT_MAX
582};
583
584#define NDUSEROPT_MAX (__NDUSEROPT_MAX - 1)
585
586#ifndef __KERNEL__
587/* RTnetlink multicast groups - backwards compatibility for userspace */
588#define RTMGRP_LINK 1
589#define RTMGRP_NOTIFY 2
590#define RTMGRP_NEIGH 4
591#define RTMGRP_TC 8
592
593#define RTMGRP_IPV4_IFADDR 0x10
594#define RTMGRP_IPV4_MROUTE 0x20
595#define RTMGRP_IPV4_ROUTE 0x40
596#define RTMGRP_IPV4_RULE 0x80
597
598#define RTMGRP_IPV6_IFADDR 0x100
599#define RTMGRP_IPV6_MROUTE 0x200
600#define RTMGRP_IPV6_ROUTE 0x400
601#define RTMGRP_IPV6_IFINFO 0x800
602
603#define RTMGRP_DECnet_IFADDR 0x1000
604#define RTMGRP_DECnet_ROUTE 0x4000
605
606#define RTMGRP_IPV6_PREFIX 0x20000
607#endif
608
609/* RTnetlink multicast groups */
610enum rtnetlink_groups {
611 RTNLGRP_NONE,
612#define RTNLGRP_NONE RTNLGRP_NONE
613 RTNLGRP_LINK,
614#define RTNLGRP_LINK RTNLGRP_LINK
615 RTNLGRP_NOTIFY,
616#define RTNLGRP_NOTIFY RTNLGRP_NOTIFY
617 RTNLGRP_NEIGH,
618#define RTNLGRP_NEIGH RTNLGRP_NEIGH
619 RTNLGRP_TC,
620#define RTNLGRP_TC RTNLGRP_TC
621 RTNLGRP_IPV4_IFADDR,
622#define RTNLGRP_IPV4_IFADDR RTNLGRP_IPV4_IFADDR
623 RTNLGRP_IPV4_MROUTE,
624#define RTNLGRP_IPV4_MROUTE RTNLGRP_IPV4_MROUTE
625 RTNLGRP_IPV4_ROUTE,
626#define RTNLGRP_IPV4_ROUTE RTNLGRP_IPV4_ROUTE
627 RTNLGRP_IPV4_RULE,
628#define RTNLGRP_IPV4_RULE RTNLGRP_IPV4_RULE
629 RTNLGRP_IPV6_IFADDR,
630#define RTNLGRP_IPV6_IFADDR RTNLGRP_IPV6_IFADDR
631 RTNLGRP_IPV6_MROUTE,
632#define RTNLGRP_IPV6_MROUTE RTNLGRP_IPV6_MROUTE
633 RTNLGRP_IPV6_ROUTE,
634#define RTNLGRP_IPV6_ROUTE RTNLGRP_IPV6_ROUTE
635 RTNLGRP_IPV6_IFINFO,
636#define RTNLGRP_IPV6_IFINFO RTNLGRP_IPV6_IFINFO
637 RTNLGRP_DECnet_IFADDR,
638#define RTNLGRP_DECnet_IFADDR RTNLGRP_DECnet_IFADDR
639 RTNLGRP_NOP2,
640 RTNLGRP_DECnet_ROUTE,
641#define RTNLGRP_DECnet_ROUTE RTNLGRP_DECnet_ROUTE
642 RTNLGRP_DECnet_RULE,
643#define RTNLGRP_DECnet_RULE RTNLGRP_DECnet_RULE
644 RTNLGRP_NOP4,
645 RTNLGRP_IPV6_PREFIX,
646#define RTNLGRP_IPV6_PREFIX RTNLGRP_IPV6_PREFIX
647 RTNLGRP_IPV6_RULE,
648#define RTNLGRP_IPV6_RULE RTNLGRP_IPV6_RULE
649 RTNLGRP_ND_USEROPT,
650#define RTNLGRP_ND_USEROPT RTNLGRP_ND_USEROPT
651 RTNLGRP_PHONET_IFADDR,
652#define RTNLGRP_PHONET_IFADDR RTNLGRP_PHONET_IFADDR
653 RTNLGRP_PHONET_ROUTE,
654#define RTNLGRP_PHONET_ROUTE RTNLGRP_PHONET_ROUTE
655 RTNLGRP_DCB,
656#define RTNLGRP_DCB RTNLGRP_DCB
Nicolas Dichteledc9e742012-10-25 22:28:52 +0000657 RTNLGRP_IPV4_NETCONF,
658#define RTNLGRP_IPV4_NETCONF RTNLGRP_IPV4_NETCONF
Nicolas Dichtelf3a1bfb2012-10-25 22:28:50 +0000659 RTNLGRP_IPV6_NETCONF,
660#define RTNLGRP_IPV6_NETCONF RTNLGRP_IPV6_NETCONF
Cong Wang37a393b2012-12-11 22:23:07 +0000661 RTNLGRP_MDB,
662#define RTNLGRP_MDB RTNLGRP_MDB
Eric W. Biederman8de147d2015-03-03 19:14:31 -0600663 RTNLGRP_MPLS_ROUTE,
664#define RTNLGRP_MPLS_ROUTE RTNLGRP_MPLS_ROUTE
Nicolas Dichtel9a963452015-04-07 11:51:53 +0200665 RTNLGRP_NSID,
666#define RTNLGRP_NSID RTNLGRP_NSID
David Ahern24045a02017-02-20 08:03:30 -0800667 RTNLGRP_MPLS_NETCONF,
668#define RTNLGRP_MPLS_NETCONF RTNLGRP_MPLS_NETCONF
David Howells607ca462012-10-13 10:46:48 +0100669 __RTNLGRP_MAX
670};
671#define RTNLGRP_MAX (__RTNLGRP_MAX - 1)
672
673/* TC action piece */
674struct tcamsg {
675 unsigned char tca_family;
676 unsigned char tca__pad1;
677 unsigned short tca__pad2;
678};
679#define TA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcamsg))))
680#define TA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcamsg))
681#define TCA_ACT_TAB 1 /* attr type must be >=1 */
682#define TCAA_MAX 1
683
684/* New extended info filters for IFLA_EXT_MASK */
685#define RTEXT_FILTER_VF (1 << 0)
Vlad Yasevich6cbdcee2013-02-13 12:00:13 +0000686#define RTEXT_FILTER_BRVLAN (1 << 1)
Roopa Prabhu35a27ce2015-01-10 07:31:13 -0800687#define RTEXT_FILTER_BRVLAN_COMPRESSED (1 << 2)
Sowmini Varadhand5566fd2015-09-11 16:48:48 -0400688#define RTEXT_FILTER_SKIP_STATS (1 << 3)
David Howells607ca462012-10-13 10:46:48 +0100689
690/* End of information exported to user level */
691
692
693
694#endif /* _UAPI__LINUX_RTNETLINK_H */