xref: /linux/include/uapi/linux/ipv6_route.h (revision 664b0bae0b87f69bc9deb098f5e0158b9cf18e04)
1*e2be04c7SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2607ca46eSDavid Howells /*
3607ca46eSDavid Howells  *	Linux INET6 implementation
4607ca46eSDavid Howells  *
5607ca46eSDavid Howells  *	Authors:
6607ca46eSDavid Howells  *	Pedro Roque		<roque@di.fc.ul.pt>
7607ca46eSDavid Howells  *
8607ca46eSDavid Howells  *	This program is free software; you can redistribute it and/or
9607ca46eSDavid Howells  *      modify it under the terms of the GNU General Public License
10607ca46eSDavid Howells  *      as published by the Free Software Foundation; either version
11607ca46eSDavid Howells  *      2 of the License, or (at your option) any later version.
12607ca46eSDavid Howells  */
13607ca46eSDavid Howells 
14607ca46eSDavid Howells #ifndef _UAPI_LINUX_IPV6_ROUTE_H
15607ca46eSDavid Howells #define _UAPI_LINUX_IPV6_ROUTE_H
16607ca46eSDavid Howells 
17607ca46eSDavid Howells #include <linux/types.h>
186c07ec0fSDmitry V. Levin #include <linux/in6.h>			/* For struct in6_addr. */
19607ca46eSDavid Howells 
20607ca46eSDavid Howells #define RTF_DEFAULT	0x00010000	/* default - learned via ND	*/
21607ca46eSDavid Howells #define RTF_ALLONLINK	0x00020000	/* (deprecated and will be removed)
22607ca46eSDavid Howells 					   fallback, no routers on link */
23607ca46eSDavid Howells #define RTF_ADDRCONF	0x00040000	/* addrconf route - RA		*/
24607ca46eSDavid Howells #define RTF_PREFIX_RT	0x00080000	/* A prefix only route - RA	*/
25607ca46eSDavid Howells #define RTF_ANYCAST	0x00100000	/* Anycast			*/
26607ca46eSDavid Howells 
27607ca46eSDavid Howells #define RTF_NONEXTHOP	0x00200000	/* route with no nexthop	*/
28607ca46eSDavid Howells #define RTF_EXPIRES	0x00400000
29607ca46eSDavid Howells 
30607ca46eSDavid Howells #define RTF_ROUTEINFO	0x00800000	/* route information - RA	*/
31607ca46eSDavid Howells 
322ea2352eSWei Wang #define RTF_CACHE	0x01000000	/* read-only: can not be set by user */
33607ca46eSDavid Howells #define RTF_FLOW	0x02000000	/* flow significant route	*/
34607ca46eSDavid Howells #define RTF_POLICY	0x04000000	/* policy route			*/
35607ca46eSDavid Howells 
36607ca46eSDavid Howells #define RTF_PREF(pref)	((pref) << 27)
37607ca46eSDavid Howells #define RTF_PREF_MASK	0x18000000
38607ca46eSDavid Howells 
39557c44beSDavid Ahern #define RTF_PCPU	0x40000000	/* read-only: can not be set by user */
40607ca46eSDavid Howells #define RTF_LOCAL	0x80000000
41607ca46eSDavid Howells 
42607ca46eSDavid Howells 
43607ca46eSDavid Howells struct in6_rtmsg {
44607ca46eSDavid Howells 	struct in6_addr		rtmsg_dst;
45607ca46eSDavid Howells 	struct in6_addr		rtmsg_src;
46607ca46eSDavid Howells 	struct in6_addr		rtmsg_gateway;
47607ca46eSDavid Howells 	__u32			rtmsg_type;
48607ca46eSDavid Howells 	__u16			rtmsg_dst_len;
49607ca46eSDavid Howells 	__u16			rtmsg_src_len;
50607ca46eSDavid Howells 	__u32			rtmsg_metric;
51607ca46eSDavid Howells 	unsigned long		rtmsg_info;
52607ca46eSDavid Howells         __u32			rtmsg_flags;
53607ca46eSDavid Howells 	int			rtmsg_ifindex;
54607ca46eSDavid Howells };
55607ca46eSDavid Howells 
56607ca46eSDavid Howells #define RTMSG_NEWDEVICE		0x11
57607ca46eSDavid Howells #define RTMSG_DELDEVICE		0x12
58607ca46eSDavid Howells #define RTMSG_NEWROUTE		0x21
59607ca46eSDavid Howells #define RTMSG_DELROUTE		0x22
60607ca46eSDavid Howells 
61130cd273SNicolas Dichtel #define IP6_RT_PRIO_USER	1024
62130cd273SNicolas Dichtel #define IP6_RT_PRIO_ADDRCONF	256
63130cd273SNicolas Dichtel 
64607ca46eSDavid Howells #endif /* _UAPI_LINUX_IPV6_ROUTE_H */
65