blob: cce061382e4073d4fe8296a00f22eba42cf13818 [file] [log] [blame]
Ben Cheng224b54f2013-10-15 18:26:18 -07001#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
123 RTM_NEWNETCONF = 80,
124#define RTM_NEWNETCONF RTM_NEWNETCONF
Christopher Ferris0543f742017-07-26 13:09:46 -0700125 RTM_DELNETCONF,
126#define RTM_DELNETCONF RTM_DELNETCONF
Ben Cheng224b54f2013-10-15 18:26:18 -0700127 RTM_GETNETCONF = 82,
128#define RTM_GETNETCONF RTM_GETNETCONF
129
130 RTM_NEWMDB = 84,
131#define RTM_NEWMDB RTM_NEWMDB
132 RTM_DELMDB = 85,
133#define RTM_DELMDB RTM_DELMDB
134 RTM_GETMDB = 86,
135#define RTM_GETMDB RTM_GETMDB
136
Christopher Ferris12e1f282016-02-04 12:35:07 -0800137 RTM_NEWNSID = 88,
138#define RTM_NEWNSID RTM_NEWNSID
139 RTM_DELNSID = 89,
140#define RTM_DELNSID RTM_DELNSID
141 RTM_GETNSID = 90,
142#define RTM_GETNSID RTM_GETNSID
143
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700144 RTM_NEWSTATS = 92,
145#define RTM_NEWSTATS RTM_NEWSTATS
146 RTM_GETSTATS = 94,
147#define RTM_GETSTATS RTM_GETSTATS
148
Ben Cheng224b54f2013-10-15 18:26:18 -0700149 __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
Christopher Ferris12e1f282016-02-04 12:35:07 -0800170#define RTA_ALIGNTO 4U
Ben Cheng224b54f2013-10-15 18:26:18 -0700171#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 */
251#define RTPROT_MROUTED 17 /* Multicast daemon */
Christopher Ferris12e1f282016-02-04 12:35:07 -0800252#define RTPROT_BABEL 42 /* Babel daemon */
Ben Cheng224b54f2013-10-15 18:26:18 -0700253
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 */
Christopher Ferris12e1f282016-02-04 12:35:07 -0800280#define RTM_F_LOOKUP_TABLE 0x1000 /* set rtm_table to FIB lookup result */
Ben Cheng224b54f2013-10-15 18:26:18 -0700281
282/* Reserved table identifiers */
283
284enum rt_class_t {
285 RT_TABLE_UNSPEC=0,
286/* User defined values */
287 RT_TABLE_COMPAT=252,
288 RT_TABLE_DEFAULT=253,
289 RT_TABLE_MAIN=254,
290 RT_TABLE_LOCAL=255,
291 RT_TABLE_MAX=0xFFFFFFFF
292};
293
294
295/* Routing message attributes */
296
297enum rtattr_type_t {
298 RTA_UNSPEC,
299 RTA_DST,
300 RTA_SRC,
301 RTA_IIF,
302 RTA_OIF,
303 RTA_GATEWAY,
304 RTA_PRIORITY,
305 RTA_PREFSRC,
306 RTA_METRICS,
307 RTA_MULTIPATH,
308 RTA_PROTOINFO, /* no longer used */
309 RTA_FLOW,
310 RTA_CACHEINFO,
311 RTA_SESSION, /* no longer used */
312 RTA_MP_ALGO, /* no longer used */
313 RTA_TABLE,
314 RTA_MARK,
315 RTA_MFC_STATS,
Christopher Ferris12e1f282016-02-04 12:35:07 -0800316 RTA_VIA,
317 RTA_NEWDST,
318 RTA_PREF,
319 RTA_ENCAP_TYPE,
320 RTA_ENCAP,
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700321 RTA_EXPIRES,
322 RTA_PAD,
Christopher Ferris2fd4b3c2017-02-21 12:32:08 -0800323 RTA_UID,
Christopher Ferris0543f742017-07-26 13:09:46 -0700324 RTA_TTL_PROPAGATE,
Ben Cheng224b54f2013-10-15 18:26:18 -0700325 __RTA_MAX
326};
327
328#define RTA_MAX (__RTA_MAX - 1)
329
330#define RTM_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct rtmsg))))
331#define RTM_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct rtmsg))
332
333/* RTM_MULTIPATH --- array of struct rtnexthop.
334 *
335 * "struct rtnexthop" describes all necessary nexthop information,
336 * i.e. parameters of path to a destination via this nexthop.
337 *
338 * At the moment it is impossible to set different prefsrc, mtu, window
339 * and rtt for different paths from multipath.
340 */
341
342struct rtnexthop {
343 unsigned short rtnh_len;
344 unsigned char rtnh_flags;
345 unsigned char rtnh_hops;
346 int rtnh_ifindex;
347};
348
349/* rtnh_flags */
350
351#define RTNH_F_DEAD 1 /* Nexthop is dead (used by multipath) */
352#define RTNH_F_PERVASIVE 2 /* Do recursive gateway lookup */
353#define RTNH_F_ONLINK 4 /* Gateway is forced on link */
Christopher Ferris12e1f282016-02-04 12:35:07 -0800354#define RTNH_F_OFFLOAD 8 /* offloaded route */
355#define RTNH_F_LINKDOWN 16 /* carrier-down on nexthop */
Christopher Ferris0543f742017-07-26 13:09:46 -0700356#define RTNH_F_UNRESOLVED 32 /* The entry is unresolved (ipmr) */
Christopher Ferris12e1f282016-02-04 12:35:07 -0800357
Christopher Ferris6e3550f2016-12-12 14:51:18 -0800358#define RTNH_COMPARE_MASK (RTNH_F_DEAD | RTNH_F_LINKDOWN | RTNH_F_OFFLOAD)
Ben Cheng224b54f2013-10-15 18:26:18 -0700359
360/* Macros to handle hexthops */
361
362#define RTNH_ALIGNTO 4
363#define RTNH_ALIGN(len) ( ((len)+RTNH_ALIGNTO-1) & ~(RTNH_ALIGNTO-1) )
364#define RTNH_OK(rtnh,len) ((rtnh)->rtnh_len >= sizeof(struct rtnexthop) && \
365 ((int)(rtnh)->rtnh_len) <= (len))
366#define RTNH_NEXT(rtnh) ((struct rtnexthop*)(((char*)(rtnh)) + RTNH_ALIGN((rtnh)->rtnh_len)))
367#define RTNH_LENGTH(len) (RTNH_ALIGN(sizeof(struct rtnexthop)) + (len))
368#define RTNH_SPACE(len) RTNH_ALIGN(RTNH_LENGTH(len))
369#define RTNH_DATA(rtnh) ((struct rtattr*)(((char*)(rtnh)) + RTNH_LENGTH(0)))
370
Christopher Ferris12e1f282016-02-04 12:35:07 -0800371/* RTA_VIA */
372struct rtvia {
373 __kernel_sa_family_t rtvia_family;
374 __u8 rtvia_addr[0];
375};
376
Ben Cheng224b54f2013-10-15 18:26:18 -0700377/* RTM_CACHEINFO */
378
379struct rta_cacheinfo {
380 __u32 rta_clntref;
381 __u32 rta_lastuse;
382 __s32 rta_expires;
383 __u32 rta_error;
384 __u32 rta_used;
385
386#define RTNETLINK_HAVE_PEERINFO 1
387 __u32 rta_id;
388 __u32 rta_ts;
389 __u32 rta_tsage;
390};
391
392/* RTM_METRICS --- array of struct rtattr with types of RTAX_* */
393
394enum {
395 RTAX_UNSPEC,
396#define RTAX_UNSPEC RTAX_UNSPEC
397 RTAX_LOCK,
398#define RTAX_LOCK RTAX_LOCK
399 RTAX_MTU,
400#define RTAX_MTU RTAX_MTU
401 RTAX_WINDOW,
402#define RTAX_WINDOW RTAX_WINDOW
403 RTAX_RTT,
404#define RTAX_RTT RTAX_RTT
405 RTAX_RTTVAR,
406#define RTAX_RTTVAR RTAX_RTTVAR
407 RTAX_SSTHRESH,
408#define RTAX_SSTHRESH RTAX_SSTHRESH
409 RTAX_CWND,
410#define RTAX_CWND RTAX_CWND
411 RTAX_ADVMSS,
412#define RTAX_ADVMSS RTAX_ADVMSS
413 RTAX_REORDERING,
414#define RTAX_REORDERING RTAX_REORDERING
415 RTAX_HOPLIMIT,
416#define RTAX_HOPLIMIT RTAX_HOPLIMIT
417 RTAX_INITCWND,
418#define RTAX_INITCWND RTAX_INITCWND
419 RTAX_FEATURES,
420#define RTAX_FEATURES RTAX_FEATURES
421 RTAX_RTO_MIN,
422#define RTAX_RTO_MIN RTAX_RTO_MIN
423 RTAX_INITRWND,
424#define RTAX_INITRWND RTAX_INITRWND
Christopher Ferrise0845012014-07-09 14:58:51 -0700425 RTAX_QUICKACK,
426#define RTAX_QUICKACK RTAX_QUICKACK
Christopher Ferris12e1f282016-02-04 12:35:07 -0800427 RTAX_CC_ALGO,
428#define RTAX_CC_ALGO RTAX_CC_ALGO
Ben Cheng224b54f2013-10-15 18:26:18 -0700429 __RTAX_MAX
430};
431
432#define RTAX_MAX (__RTAX_MAX - 1)
433
Christopher Ferris12e1f282016-02-04 12:35:07 -0800434#define RTAX_FEATURE_ECN (1 << 0)
435#define RTAX_FEATURE_SACK (1 << 1)
436#define RTAX_FEATURE_TIMESTAMP (1 << 2)
437#define RTAX_FEATURE_ALLFRAG (1 << 3)
438
439#define RTAX_FEATURE_MASK (RTAX_FEATURE_ECN | RTAX_FEATURE_SACK | \
440 RTAX_FEATURE_TIMESTAMP | RTAX_FEATURE_ALLFRAG)
Ben Cheng224b54f2013-10-15 18:26:18 -0700441
442struct rta_session {
443 __u8 proto;
444 __u8 pad1;
445 __u16 pad2;
446
447 union {
448 struct {
449 __u16 sport;
450 __u16 dport;
451 } ports;
452
453 struct {
454 __u8 type;
455 __u8 code;
456 __u16 ident;
457 } icmpt;
458
459 __u32 spi;
460 } u;
461};
462
463struct rta_mfc_stats {
464 __u64 mfcs_packets;
465 __u64 mfcs_bytes;
466 __u64 mfcs_wrong_if;
467};
468
469/****
470 * General form of address family dependent message.
471 ****/
472
473struct rtgenmsg {
474 unsigned char rtgen_family;
475};
476
477/*****************************************************************
478 * Link layer specific messages.
479 ****/
480
481/* struct ifinfomsg
482 * passes link level specific information, not dependent
483 * on network protocol.
484 */
485
486struct ifinfomsg {
487 unsigned char ifi_family;
488 unsigned char __ifi_pad;
489 unsigned short ifi_type; /* ARPHRD_* */
490 int ifi_index; /* Link index */
491 unsigned ifi_flags; /* IFF_* flags */
492 unsigned ifi_change; /* IFF_* change mask */
493};
494
495/********************************************************************
496 * prefix information
497 ****/
498
499struct prefixmsg {
500 unsigned char prefix_family;
501 unsigned char prefix_pad1;
502 unsigned short prefix_pad2;
503 int prefix_ifindex;
504 unsigned char prefix_type;
505 unsigned char prefix_len;
506 unsigned char prefix_flags;
507 unsigned char prefix_pad3;
508};
509
510enum
511{
512 PREFIX_UNSPEC,
513 PREFIX_ADDRESS,
514 PREFIX_CACHEINFO,
515 __PREFIX_MAX
516};
517
518#define PREFIX_MAX (__PREFIX_MAX - 1)
519
520struct prefix_cacheinfo {
521 __u32 preferred_time;
522 __u32 valid_time;
523};
524
525
526/*****************************************************************
527 * Traffic control messages.
528 ****/
529
530struct tcmsg {
531 unsigned char tcm_family;
532 unsigned char tcm__pad1;
533 unsigned short tcm__pad2;
534 int tcm_ifindex;
535 __u32 tcm_handle;
536 __u32 tcm_parent;
537 __u32 tcm_info;
538};
539
540enum {
541 TCA_UNSPEC,
542 TCA_KIND,
543 TCA_OPTIONS,
544 TCA_STATS,
545 TCA_XSTATS,
546 TCA_RATE,
547 TCA_FCNT,
548 TCA_STATS2,
549 TCA_STAB,
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700550 TCA_PAD,
Christopher Ferris0543f742017-07-26 13:09:46 -0700551 TCA_DUMP_INVISIBLE,
Ben Cheng224b54f2013-10-15 18:26:18 -0700552 __TCA_MAX
553};
554
555#define TCA_MAX (__TCA_MAX - 1)
556
557#define TCA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcmsg))))
558#define TCA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcmsg))
559
560/********************************************************************
561 * Neighbor Discovery userland options
562 ****/
563
564struct nduseroptmsg {
565 unsigned char nduseropt_family;
566 unsigned char nduseropt_pad1;
567 unsigned short nduseropt_opts_len; /* Total length of options */
568 int nduseropt_ifindex;
569 __u8 nduseropt_icmp_type;
570 __u8 nduseropt_icmp_code;
571 unsigned short nduseropt_pad2;
572 unsigned int nduseropt_pad3;
573 /* Followed by one or more ND options */
574};
575
576enum {
577 NDUSEROPT_UNSPEC,
578 NDUSEROPT_SRCADDR,
579 __NDUSEROPT_MAX
580};
581
582#define NDUSEROPT_MAX (__NDUSEROPT_MAX - 1)
583
584#ifndef __KERNEL__
585/* RTnetlink multicast groups - backwards compatibility for userspace */
586#define RTMGRP_LINK 1
587#define RTMGRP_NOTIFY 2
588#define RTMGRP_NEIGH 4
589#define RTMGRP_TC 8
590
591#define RTMGRP_IPV4_IFADDR 0x10
592#define RTMGRP_IPV4_MROUTE 0x20
593#define RTMGRP_IPV4_ROUTE 0x40
594#define RTMGRP_IPV4_RULE 0x80
595
596#define RTMGRP_IPV6_IFADDR 0x100
597#define RTMGRP_IPV6_MROUTE 0x200
598#define RTMGRP_IPV6_ROUTE 0x400
599#define RTMGRP_IPV6_IFINFO 0x800
600
601#define RTMGRP_DECnet_IFADDR 0x1000
602#define RTMGRP_DECnet_ROUTE 0x4000
603
604#define RTMGRP_IPV6_PREFIX 0x20000
605#endif
606
607/* RTnetlink multicast groups */
608enum rtnetlink_groups {
609 RTNLGRP_NONE,
610#define RTNLGRP_NONE RTNLGRP_NONE
611 RTNLGRP_LINK,
612#define RTNLGRP_LINK RTNLGRP_LINK
613 RTNLGRP_NOTIFY,
614#define RTNLGRP_NOTIFY RTNLGRP_NOTIFY
615 RTNLGRP_NEIGH,
616#define RTNLGRP_NEIGH RTNLGRP_NEIGH
617 RTNLGRP_TC,
618#define RTNLGRP_TC RTNLGRP_TC
619 RTNLGRP_IPV4_IFADDR,
620#define RTNLGRP_IPV4_IFADDR RTNLGRP_IPV4_IFADDR
621 RTNLGRP_IPV4_MROUTE,
622#define RTNLGRP_IPV4_MROUTE RTNLGRP_IPV4_MROUTE
623 RTNLGRP_IPV4_ROUTE,
624#define RTNLGRP_IPV4_ROUTE RTNLGRP_IPV4_ROUTE
625 RTNLGRP_IPV4_RULE,
626#define RTNLGRP_IPV4_RULE RTNLGRP_IPV4_RULE
627 RTNLGRP_IPV6_IFADDR,
628#define RTNLGRP_IPV6_IFADDR RTNLGRP_IPV6_IFADDR
629 RTNLGRP_IPV6_MROUTE,
630#define RTNLGRP_IPV6_MROUTE RTNLGRP_IPV6_MROUTE
631 RTNLGRP_IPV6_ROUTE,
632#define RTNLGRP_IPV6_ROUTE RTNLGRP_IPV6_ROUTE
633 RTNLGRP_IPV6_IFINFO,
634#define RTNLGRP_IPV6_IFINFO RTNLGRP_IPV6_IFINFO
635 RTNLGRP_DECnet_IFADDR,
636#define RTNLGRP_DECnet_IFADDR RTNLGRP_DECnet_IFADDR
637 RTNLGRP_NOP2,
638 RTNLGRP_DECnet_ROUTE,
639#define RTNLGRP_DECnet_ROUTE RTNLGRP_DECnet_ROUTE
640 RTNLGRP_DECnet_RULE,
641#define RTNLGRP_DECnet_RULE RTNLGRP_DECnet_RULE
642 RTNLGRP_NOP4,
643 RTNLGRP_IPV6_PREFIX,
644#define RTNLGRP_IPV6_PREFIX RTNLGRP_IPV6_PREFIX
645 RTNLGRP_IPV6_RULE,
646#define RTNLGRP_IPV6_RULE RTNLGRP_IPV6_RULE
647 RTNLGRP_ND_USEROPT,
648#define RTNLGRP_ND_USEROPT RTNLGRP_ND_USEROPT
649 RTNLGRP_PHONET_IFADDR,
650#define RTNLGRP_PHONET_IFADDR RTNLGRP_PHONET_IFADDR
651 RTNLGRP_PHONET_ROUTE,
652#define RTNLGRP_PHONET_ROUTE RTNLGRP_PHONET_ROUTE
653 RTNLGRP_DCB,
654#define RTNLGRP_DCB RTNLGRP_DCB
655 RTNLGRP_IPV4_NETCONF,
656#define RTNLGRP_IPV4_NETCONF RTNLGRP_IPV4_NETCONF
657 RTNLGRP_IPV6_NETCONF,
658#define RTNLGRP_IPV6_NETCONF RTNLGRP_IPV6_NETCONF
659 RTNLGRP_MDB,
660#define RTNLGRP_MDB RTNLGRP_MDB
Christopher Ferris12e1f282016-02-04 12:35:07 -0800661 RTNLGRP_MPLS_ROUTE,
662#define RTNLGRP_MPLS_ROUTE RTNLGRP_MPLS_ROUTE
663 RTNLGRP_NSID,
664#define RTNLGRP_NSID RTNLGRP_NSID
Christopher Ferris0543f742017-07-26 13:09:46 -0700665 RTNLGRP_MPLS_NETCONF,
666#define RTNLGRP_MPLS_NETCONF RTNLGRP_MPLS_NETCONF
Ben Cheng224b54f2013-10-15 18:26:18 -0700667 __RTNLGRP_MAX
668};
669#define RTNLGRP_MAX (__RTNLGRP_MAX - 1)
670
671/* TC action piece */
672struct tcamsg {
673 unsigned char tca_family;
674 unsigned char tca__pad1;
675 unsigned short tca__pad2;
676};
677#define TA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcamsg))))
678#define TA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcamsg))
679#define TCA_ACT_TAB 1 /* attr type must be >=1 */
680#define TCAA_MAX 1
681
682/* New extended info filters for IFLA_EXT_MASK */
683#define RTEXT_FILTER_VF (1 << 0)
684#define RTEXT_FILTER_BRVLAN (1 << 1)
Christopher Ferris12e1f282016-02-04 12:35:07 -0800685#define RTEXT_FILTER_BRVLAN_COMPRESSED (1 << 2)
686#define RTEXT_FILTER_SKIP_STATS (1 << 3)
Ben Cheng224b54f2013-10-15 18:26:18 -0700687
688/* End of information exported to user level */
689
690
691
692#endif /* _UAPI__LINUX_RTNETLINK_H */