xref: /openbmc/linux/include/uapi/linux/rtnetlink.h (revision 6aa7de05)
1 #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 
23 enum {
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
125 	RTM_DELNETCONF,
126 #define RTM_DELNETCONF RTM_DELNETCONF
127 	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 
137 	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 
144 	RTM_NEWSTATS = 92,
145 #define RTM_NEWSTATS RTM_NEWSTATS
146 	RTM_GETSTATS = 94,
147 #define RTM_GETSTATS RTM_GETSTATS
148 
149 	RTM_NEWCACHEREPORT = 96,
150 #define RTM_NEWCACHEREPORT RTM_NEWCACHEREPORT
151 
152 	__RTM_MAX,
153 #define RTM_MAX		(((__RTM_MAX + 3) & ~3) - 1)
154 };
155 
156 #define RTM_NR_MSGTYPES	(RTM_MAX + 1 - RTM_BASE)
157 #define RTM_NR_FAMILIES	(RTM_NR_MSGTYPES >> 2)
158 #define RTM_FAM(cmd)	(((cmd) - RTM_BASE) >> 2)
159 
160 /*
161    Generic structure for encapsulation of optional route information.
162    It is reminiscent of sockaddr, but with sa_family replaced
163    with attribute type.
164  */
165 
166 struct rtattr {
167 	unsigned short	rta_len;
168 	unsigned short	rta_type;
169 };
170 
171 /* Macros to handle rtattributes */
172 
173 #define RTA_ALIGNTO	4U
174 #define RTA_ALIGN(len) ( ((len)+RTA_ALIGNTO-1) & ~(RTA_ALIGNTO-1) )
175 #define RTA_OK(rta,len) ((len) >= (int)sizeof(struct rtattr) && \
176 			 (rta)->rta_len >= sizeof(struct rtattr) && \
177 			 (rta)->rta_len <= (len))
178 #define RTA_NEXT(rta,attrlen)	((attrlen) -= RTA_ALIGN((rta)->rta_len), \
179 				 (struct rtattr*)(((char*)(rta)) + RTA_ALIGN((rta)->rta_len)))
180 #define RTA_LENGTH(len)	(RTA_ALIGN(sizeof(struct rtattr)) + (len))
181 #define RTA_SPACE(len)	RTA_ALIGN(RTA_LENGTH(len))
182 #define RTA_DATA(rta)   ((void*)(((char*)(rta)) + RTA_LENGTH(0)))
183 #define RTA_PAYLOAD(rta) ((int)((rta)->rta_len) - RTA_LENGTH(0))
184 
185 
186 
187 
188 /******************************************************************************
189  *		Definitions used in routing table administration.
190  ****/
191 
192 struct rtmsg {
193 	unsigned char		rtm_family;
194 	unsigned char		rtm_dst_len;
195 	unsigned char		rtm_src_len;
196 	unsigned char		rtm_tos;
197 
198 	unsigned char		rtm_table;	/* Routing table id */
199 	unsigned char		rtm_protocol;	/* Routing protocol; see below	*/
200 	unsigned char		rtm_scope;	/* See below */
201 	unsigned char		rtm_type;	/* See below	*/
202 
203 	unsigned		rtm_flags;
204 };
205 
206 /* rtm_type */
207 
208 enum {
209 	RTN_UNSPEC,
210 	RTN_UNICAST,		/* Gateway or direct route	*/
211 	RTN_LOCAL,		/* Accept locally		*/
212 	RTN_BROADCAST,		/* Accept locally as broadcast,
213 				   send as broadcast */
214 	RTN_ANYCAST,		/* Accept locally as broadcast,
215 				   but send as unicast */
216 	RTN_MULTICAST,		/* Multicast route		*/
217 	RTN_BLACKHOLE,		/* Drop				*/
218 	RTN_UNREACHABLE,	/* Destination is unreachable   */
219 	RTN_PROHIBIT,		/* Administratively prohibited	*/
220 	RTN_THROW,		/* Not in this table		*/
221 	RTN_NAT,		/* Translate this address	*/
222 	RTN_XRESOLVE,		/* Use external resolver	*/
223 	__RTN_MAX
224 };
225 
226 #define RTN_MAX (__RTN_MAX - 1)
227 
228 
229 /* rtm_protocol */
230 
231 #define RTPROT_UNSPEC	0
232 #define RTPROT_REDIRECT	1	/* Route installed by ICMP redirects;
233 				   not used by current IPv4 */
234 #define RTPROT_KERNEL	2	/* Route installed by kernel		*/
235 #define RTPROT_BOOT	3	/* Route installed during boot		*/
236 #define RTPROT_STATIC	4	/* Route installed by administrator	*/
237 
238 /* Values of protocol >= RTPROT_STATIC are not interpreted by kernel;
239    they are just passed from user and back as is.
240    It will be used by hypothetical multiple routing daemons.
241    Note that protocol values should be standardized in order to
242    avoid conflicts.
243  */
244 
245 #define RTPROT_GATED	8	/* Apparently, GateD */
246 #define RTPROT_RA	9	/* RDISC/ND router advertisements */
247 #define RTPROT_MRT	10	/* Merit MRT */
248 #define RTPROT_ZEBRA	11	/* Zebra */
249 #define RTPROT_BIRD	12	/* BIRD */
250 #define RTPROT_DNROUTED	13	/* DECnet routing daemon */
251 #define RTPROT_XORP	14	/* XORP */
252 #define RTPROT_NTK	15	/* Netsukuku */
253 #define RTPROT_DHCP	16      /* DHCP client */
254 #define RTPROT_MROUTED	17      /* Multicast daemon */
255 #define RTPROT_BABEL	42      /* Babel daemon */
256 
257 /* rtm_scope
258 
259    Really it is not scope, but sort of distance to the destination.
260    NOWHERE are reserved for not existing destinations, HOST is our
261    local addresses, LINK are destinations, located on directly attached
262    link and UNIVERSE is everywhere in the Universe.
263 
264    Intermediate values are also possible f.e. interior routes
265    could be assigned a value between UNIVERSE and LINK.
266 */
267 
268 enum rt_scope_t {
269 	RT_SCOPE_UNIVERSE=0,
270 /* User defined values  */
271 	RT_SCOPE_SITE=200,
272 	RT_SCOPE_LINK=253,
273 	RT_SCOPE_HOST=254,
274 	RT_SCOPE_NOWHERE=255
275 };
276 
277 /* rtm_flags */
278 
279 #define RTM_F_NOTIFY		0x100	/* Notify user of route change	*/
280 #define RTM_F_CLONED		0x200	/* This route is cloned		*/
281 #define RTM_F_EQUALIZE		0x400	/* Multipath equalizer: NI	*/
282 #define RTM_F_PREFIX		0x800	/* Prefix addresses		*/
283 #define RTM_F_LOOKUP_TABLE	0x1000	/* set rtm_table to FIB lookup result */
284 #define RTM_F_FIB_MATCH	        0x2000	/* return full fib lookup match */
285 
286 /* Reserved table identifiers */
287 
288 enum rt_class_t {
289 	RT_TABLE_UNSPEC=0,
290 /* User defined values */
291 	RT_TABLE_COMPAT=252,
292 	RT_TABLE_DEFAULT=253,
293 	RT_TABLE_MAIN=254,
294 	RT_TABLE_LOCAL=255,
295 	RT_TABLE_MAX=0xFFFFFFFF
296 };
297 
298 
299 /* Routing message attributes */
300 
301 enum rtattr_type_t {
302 	RTA_UNSPEC,
303 	RTA_DST,
304 	RTA_SRC,
305 	RTA_IIF,
306 	RTA_OIF,
307 	RTA_GATEWAY,
308 	RTA_PRIORITY,
309 	RTA_PREFSRC,
310 	RTA_METRICS,
311 	RTA_MULTIPATH,
312 	RTA_PROTOINFO, /* no longer used */
313 	RTA_FLOW,
314 	RTA_CACHEINFO,
315 	RTA_SESSION, /* no longer used */
316 	RTA_MP_ALGO, /* no longer used */
317 	RTA_TABLE,
318 	RTA_MARK,
319 	RTA_MFC_STATS,
320 	RTA_VIA,
321 	RTA_NEWDST,
322 	RTA_PREF,
323 	RTA_ENCAP_TYPE,
324 	RTA_ENCAP,
325 	RTA_EXPIRES,
326 	RTA_PAD,
327 	RTA_UID,
328 	RTA_TTL_PROPAGATE,
329 	__RTA_MAX
330 };
331 
332 #define RTA_MAX (__RTA_MAX - 1)
333 
334 #define RTM_RTA(r)  ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct rtmsg))))
335 #define RTM_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct rtmsg))
336 
337 /* RTM_MULTIPATH --- array of struct rtnexthop.
338  *
339  * "struct rtnexthop" describes all necessary nexthop information,
340  * i.e. parameters of path to a destination via this nexthop.
341  *
342  * At the moment it is impossible to set different prefsrc, mtu, window
343  * and rtt for different paths from multipath.
344  */
345 
346 struct rtnexthop {
347 	unsigned short		rtnh_len;
348 	unsigned char		rtnh_flags;
349 	unsigned char		rtnh_hops;
350 	int			rtnh_ifindex;
351 };
352 
353 /* rtnh_flags */
354 
355 #define RTNH_F_DEAD		1	/* Nexthop is dead (used by multipath)	*/
356 #define RTNH_F_PERVASIVE	2	/* Do recursive gateway lookup	*/
357 #define RTNH_F_ONLINK		4	/* Gateway is forced on link	*/
358 #define RTNH_F_OFFLOAD		8	/* offloaded route */
359 #define RTNH_F_LINKDOWN		16	/* carrier-down on nexthop */
360 #define RTNH_F_UNRESOLVED	32	/* The entry is unresolved (ipmr) */
361 
362 #define RTNH_COMPARE_MASK	(RTNH_F_DEAD | RTNH_F_LINKDOWN | RTNH_F_OFFLOAD)
363 
364 /* Macros to handle hexthops */
365 
366 #define RTNH_ALIGNTO	4
367 #define RTNH_ALIGN(len) ( ((len)+RTNH_ALIGNTO-1) & ~(RTNH_ALIGNTO-1) )
368 #define RTNH_OK(rtnh,len) ((rtnh)->rtnh_len >= sizeof(struct rtnexthop) && \
369 			   ((int)(rtnh)->rtnh_len) <= (len))
370 #define RTNH_NEXT(rtnh)	((struct rtnexthop*)(((char*)(rtnh)) + RTNH_ALIGN((rtnh)->rtnh_len)))
371 #define RTNH_LENGTH(len) (RTNH_ALIGN(sizeof(struct rtnexthop)) + (len))
372 #define RTNH_SPACE(len)	RTNH_ALIGN(RTNH_LENGTH(len))
373 #define RTNH_DATA(rtnh)   ((struct rtattr*)(((char*)(rtnh)) + RTNH_LENGTH(0)))
374 
375 /* RTA_VIA */
376 struct rtvia {
377 	__kernel_sa_family_t	rtvia_family;
378 	__u8			rtvia_addr[0];
379 };
380 
381 /* RTM_CACHEINFO */
382 
383 struct rta_cacheinfo {
384 	__u32	rta_clntref;
385 	__u32	rta_lastuse;
386 	__s32	rta_expires;
387 	__u32	rta_error;
388 	__u32	rta_used;
389 
390 #define RTNETLINK_HAVE_PEERINFO 1
391 	__u32	rta_id;
392 	__u32	rta_ts;
393 	__u32	rta_tsage;
394 };
395 
396 /* RTM_METRICS --- array of struct rtattr with types of RTAX_* */
397 
398 enum {
399 	RTAX_UNSPEC,
400 #define RTAX_UNSPEC RTAX_UNSPEC
401 	RTAX_LOCK,
402 #define RTAX_LOCK RTAX_LOCK
403 	RTAX_MTU,
404 #define RTAX_MTU RTAX_MTU
405 	RTAX_WINDOW,
406 #define RTAX_WINDOW RTAX_WINDOW
407 	RTAX_RTT,
408 #define RTAX_RTT RTAX_RTT
409 	RTAX_RTTVAR,
410 #define RTAX_RTTVAR RTAX_RTTVAR
411 	RTAX_SSTHRESH,
412 #define RTAX_SSTHRESH RTAX_SSTHRESH
413 	RTAX_CWND,
414 #define RTAX_CWND RTAX_CWND
415 	RTAX_ADVMSS,
416 #define RTAX_ADVMSS RTAX_ADVMSS
417 	RTAX_REORDERING,
418 #define RTAX_REORDERING RTAX_REORDERING
419 	RTAX_HOPLIMIT,
420 #define RTAX_HOPLIMIT RTAX_HOPLIMIT
421 	RTAX_INITCWND,
422 #define RTAX_INITCWND RTAX_INITCWND
423 	RTAX_FEATURES,
424 #define RTAX_FEATURES RTAX_FEATURES
425 	RTAX_RTO_MIN,
426 #define RTAX_RTO_MIN RTAX_RTO_MIN
427 	RTAX_INITRWND,
428 #define RTAX_INITRWND RTAX_INITRWND
429 	RTAX_QUICKACK,
430 #define RTAX_QUICKACK RTAX_QUICKACK
431 	RTAX_CC_ALGO,
432 #define RTAX_CC_ALGO RTAX_CC_ALGO
433 	__RTAX_MAX
434 };
435 
436 #define RTAX_MAX (__RTAX_MAX - 1)
437 
438 #define RTAX_FEATURE_ECN	(1 << 0)
439 #define RTAX_FEATURE_SACK	(1 << 1)
440 #define RTAX_FEATURE_TIMESTAMP	(1 << 2)
441 #define RTAX_FEATURE_ALLFRAG	(1 << 3)
442 
443 #define RTAX_FEATURE_MASK	(RTAX_FEATURE_ECN | RTAX_FEATURE_SACK | \
444 				 RTAX_FEATURE_TIMESTAMP | RTAX_FEATURE_ALLFRAG)
445 
446 struct rta_session {
447 	__u8	proto;
448 	__u8	pad1;
449 	__u16	pad2;
450 
451 	union {
452 		struct {
453 			__u16	sport;
454 			__u16	dport;
455 		} ports;
456 
457 		struct {
458 			__u8	type;
459 			__u8	code;
460 			__u16	ident;
461 		} icmpt;
462 
463 		__u32		spi;
464 	} u;
465 };
466 
467 struct rta_mfc_stats {
468 	__u64	mfcs_packets;
469 	__u64	mfcs_bytes;
470 	__u64	mfcs_wrong_if;
471 };
472 
473 /****
474  *		General form of address family dependent message.
475  ****/
476 
477 struct rtgenmsg {
478 	unsigned char		rtgen_family;
479 };
480 
481 /*****************************************************************
482  *		Link layer specific messages.
483  ****/
484 
485 /* struct ifinfomsg
486  * passes link level specific information, not dependent
487  * on network protocol.
488  */
489 
490 struct ifinfomsg {
491 	unsigned char	ifi_family;
492 	unsigned char	__ifi_pad;
493 	unsigned short	ifi_type;		/* ARPHRD_* */
494 	int		ifi_index;		/* Link index	*/
495 	unsigned	ifi_flags;		/* IFF_* flags	*/
496 	unsigned	ifi_change;		/* IFF_* change mask */
497 };
498 
499 /********************************************************************
500  *		prefix information
501  ****/
502 
503 struct prefixmsg {
504 	unsigned char	prefix_family;
505 	unsigned char	prefix_pad1;
506 	unsigned short	prefix_pad2;
507 	int		prefix_ifindex;
508 	unsigned char	prefix_type;
509 	unsigned char	prefix_len;
510 	unsigned char	prefix_flags;
511 	unsigned char	prefix_pad3;
512 };
513 
514 enum
515 {
516 	PREFIX_UNSPEC,
517 	PREFIX_ADDRESS,
518 	PREFIX_CACHEINFO,
519 	__PREFIX_MAX
520 };
521 
522 #define PREFIX_MAX	(__PREFIX_MAX - 1)
523 
524 struct prefix_cacheinfo {
525 	__u32	preferred_time;
526 	__u32	valid_time;
527 };
528 
529 
530 /*****************************************************************
531  *		Traffic control messages.
532  ****/
533 
534 struct tcmsg {
535 	unsigned char	tcm_family;
536 	unsigned char	tcm__pad1;
537 	unsigned short	tcm__pad2;
538 	int		tcm_ifindex;
539 	__u32		tcm_handle;
540 	__u32		tcm_parent;
541 	__u32		tcm_info;
542 };
543 
544 enum {
545 	TCA_UNSPEC,
546 	TCA_KIND,
547 	TCA_OPTIONS,
548 	TCA_STATS,
549 	TCA_XSTATS,
550 	TCA_RATE,
551 	TCA_FCNT,
552 	TCA_STATS2,
553 	TCA_STAB,
554 	TCA_PAD,
555 	TCA_DUMP_INVISIBLE,
556 	TCA_CHAIN,
557 	__TCA_MAX
558 };
559 
560 #define TCA_MAX (__TCA_MAX - 1)
561 
562 #define TCA_RTA(r)  ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcmsg))))
563 #define TCA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcmsg))
564 
565 /********************************************************************
566  *		Neighbor Discovery userland options
567  ****/
568 
569 struct nduseroptmsg {
570 	unsigned char	nduseropt_family;
571 	unsigned char	nduseropt_pad1;
572 	unsigned short	nduseropt_opts_len;	/* Total length of options */
573 	int		nduseropt_ifindex;
574 	__u8		nduseropt_icmp_type;
575 	__u8		nduseropt_icmp_code;
576 	unsigned short	nduseropt_pad2;
577 	unsigned int	nduseropt_pad3;
578 	/* Followed by one or more ND options */
579 };
580 
581 enum {
582 	NDUSEROPT_UNSPEC,
583 	NDUSEROPT_SRCADDR,
584 	__NDUSEROPT_MAX
585 };
586 
587 #define NDUSEROPT_MAX	(__NDUSEROPT_MAX - 1)
588 
589 #ifndef __KERNEL__
590 /* RTnetlink multicast groups - backwards compatibility for userspace */
591 #define RTMGRP_LINK		1
592 #define RTMGRP_NOTIFY		2
593 #define RTMGRP_NEIGH		4
594 #define RTMGRP_TC		8
595 
596 #define RTMGRP_IPV4_IFADDR	0x10
597 #define RTMGRP_IPV4_MROUTE	0x20
598 #define RTMGRP_IPV4_ROUTE	0x40
599 #define RTMGRP_IPV4_RULE	0x80
600 
601 #define RTMGRP_IPV6_IFADDR	0x100
602 #define RTMGRP_IPV6_MROUTE	0x200
603 #define RTMGRP_IPV6_ROUTE	0x400
604 #define RTMGRP_IPV6_IFINFO	0x800
605 
606 #define RTMGRP_DECnet_IFADDR    0x1000
607 #define RTMGRP_DECnet_ROUTE     0x4000
608 
609 #define RTMGRP_IPV6_PREFIX	0x20000
610 #endif
611 
612 /* RTnetlink multicast groups */
613 enum rtnetlink_groups {
614 	RTNLGRP_NONE,
615 #define RTNLGRP_NONE		RTNLGRP_NONE
616 	RTNLGRP_LINK,
617 #define RTNLGRP_LINK		RTNLGRP_LINK
618 	RTNLGRP_NOTIFY,
619 #define RTNLGRP_NOTIFY		RTNLGRP_NOTIFY
620 	RTNLGRP_NEIGH,
621 #define RTNLGRP_NEIGH		RTNLGRP_NEIGH
622 	RTNLGRP_TC,
623 #define RTNLGRP_TC		RTNLGRP_TC
624 	RTNLGRP_IPV4_IFADDR,
625 #define RTNLGRP_IPV4_IFADDR	RTNLGRP_IPV4_IFADDR
626 	RTNLGRP_IPV4_MROUTE,
627 #define	RTNLGRP_IPV4_MROUTE	RTNLGRP_IPV4_MROUTE
628 	RTNLGRP_IPV4_ROUTE,
629 #define RTNLGRP_IPV4_ROUTE	RTNLGRP_IPV4_ROUTE
630 	RTNLGRP_IPV4_RULE,
631 #define RTNLGRP_IPV4_RULE	RTNLGRP_IPV4_RULE
632 	RTNLGRP_IPV6_IFADDR,
633 #define RTNLGRP_IPV6_IFADDR	RTNLGRP_IPV6_IFADDR
634 	RTNLGRP_IPV6_MROUTE,
635 #define RTNLGRP_IPV6_MROUTE	RTNLGRP_IPV6_MROUTE
636 	RTNLGRP_IPV6_ROUTE,
637 #define RTNLGRP_IPV6_ROUTE	RTNLGRP_IPV6_ROUTE
638 	RTNLGRP_IPV6_IFINFO,
639 #define RTNLGRP_IPV6_IFINFO	RTNLGRP_IPV6_IFINFO
640 	RTNLGRP_DECnet_IFADDR,
641 #define RTNLGRP_DECnet_IFADDR	RTNLGRP_DECnet_IFADDR
642 	RTNLGRP_NOP2,
643 	RTNLGRP_DECnet_ROUTE,
644 #define RTNLGRP_DECnet_ROUTE	RTNLGRP_DECnet_ROUTE
645 	RTNLGRP_DECnet_RULE,
646 #define RTNLGRP_DECnet_RULE	RTNLGRP_DECnet_RULE
647 	RTNLGRP_NOP4,
648 	RTNLGRP_IPV6_PREFIX,
649 #define RTNLGRP_IPV6_PREFIX	RTNLGRP_IPV6_PREFIX
650 	RTNLGRP_IPV6_RULE,
651 #define RTNLGRP_IPV6_RULE	RTNLGRP_IPV6_RULE
652 	RTNLGRP_ND_USEROPT,
653 #define RTNLGRP_ND_USEROPT	RTNLGRP_ND_USEROPT
654 	RTNLGRP_PHONET_IFADDR,
655 #define RTNLGRP_PHONET_IFADDR	RTNLGRP_PHONET_IFADDR
656 	RTNLGRP_PHONET_ROUTE,
657 #define RTNLGRP_PHONET_ROUTE	RTNLGRP_PHONET_ROUTE
658 	RTNLGRP_DCB,
659 #define RTNLGRP_DCB		RTNLGRP_DCB
660 	RTNLGRP_IPV4_NETCONF,
661 #define RTNLGRP_IPV4_NETCONF	RTNLGRP_IPV4_NETCONF
662 	RTNLGRP_IPV6_NETCONF,
663 #define RTNLGRP_IPV6_NETCONF	RTNLGRP_IPV6_NETCONF
664 	RTNLGRP_MDB,
665 #define RTNLGRP_MDB		RTNLGRP_MDB
666 	RTNLGRP_MPLS_ROUTE,
667 #define RTNLGRP_MPLS_ROUTE	RTNLGRP_MPLS_ROUTE
668 	RTNLGRP_NSID,
669 #define RTNLGRP_NSID		RTNLGRP_NSID
670 	RTNLGRP_MPLS_NETCONF,
671 #define RTNLGRP_MPLS_NETCONF	RTNLGRP_MPLS_NETCONF
672 	RTNLGRP_IPV4_MROUTE_R,
673 #define RTNLGRP_IPV4_MROUTE_R	RTNLGRP_IPV4_MROUTE_R
674 	RTNLGRP_IPV6_MROUTE_R,
675 #define RTNLGRP_IPV6_MROUTE_R	RTNLGRP_IPV6_MROUTE_R
676 	__RTNLGRP_MAX
677 };
678 #define RTNLGRP_MAX	(__RTNLGRP_MAX - 1)
679 
680 /* TC action piece */
681 struct tcamsg {
682 	unsigned char	tca_family;
683 	unsigned char	tca__pad1;
684 	unsigned short	tca__pad2;
685 };
686 
687 enum {
688 	TCA_ROOT_UNSPEC,
689 	TCA_ROOT_TAB,
690 #define TCA_ACT_TAB TCA_ROOT_TAB
691 #define TCAA_MAX TCA_ROOT_TAB
692 	TCA_ROOT_FLAGS,
693 	TCA_ROOT_COUNT,
694 	TCA_ROOT_TIME_DELTA, /* in msecs */
695 	__TCA_ROOT_MAX,
696 #define	TCA_ROOT_MAX (__TCA_ROOT_MAX - 1)
697 };
698 
699 #define TA_RTA(r)  ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcamsg))))
700 #define TA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcamsg))
701 /* tcamsg flags stored in attribute TCA_ROOT_FLAGS
702  *
703  * TCA_FLAG_LARGE_DUMP_ON user->kernel to request for larger than TCA_ACT_MAX_PRIO
704  * actions in a dump. All dump responses will contain the number of actions
705  * being dumped stored in for user app's consumption in TCA_ROOT_COUNT
706  *
707  */
708 #define TCA_FLAG_LARGE_DUMP_ON		(1 << 0)
709 
710 /* New extended info filters for IFLA_EXT_MASK */
711 #define RTEXT_FILTER_VF		(1 << 0)
712 #define RTEXT_FILTER_BRVLAN	(1 << 1)
713 #define RTEXT_FILTER_BRVLAN_COMPRESSED	(1 << 2)
714 #define	RTEXT_FILTER_SKIP_STATS	(1 << 3)
715 
716 /* End of information exported to user level */
717 
718 
719 
720 #endif /* _UAPI__LINUX_RTNETLINK_H */
721