diff options
Diffstat (limited to 'include/net/ip6_route.h')
-rw-r--r-- | include/net/ip6_route.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h index 4a808de7c0f6..68f67836e146 100644 --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h | |||
@@ -37,6 +37,24 @@ struct route_info { | |||
37 | #define RT6_LOOKUP_F_SRCPREF_PUBLIC 0x00000010 | 37 | #define RT6_LOOKUP_F_SRCPREF_PUBLIC 0x00000010 |
38 | #define RT6_LOOKUP_F_SRCPREF_COA 0x00000020 | 38 | #define RT6_LOOKUP_F_SRCPREF_COA 0x00000020 |
39 | 39 | ||
40 | /* | ||
41 | * rt6_srcprefs2flags() and rt6_flags2srcprefs() translate | ||
42 | * between IPV6_ADDR_PREFERENCES socket option values | ||
43 | * IPV6_PREFER_SRC_TMP = 0x1 | ||
44 | * IPV6_PREFER_SRC_PUBLIC = 0x2 | ||
45 | * IPV6_PREFER_SRC_COA = 0x4 | ||
46 | * and above RT6_LOOKUP_F_SRCPREF_xxx flags. | ||
47 | */ | ||
48 | static inline int rt6_srcprefs2flags(unsigned int srcprefs) | ||
49 | { | ||
50 | /* No need to bitmask because srcprefs have only 3 bits. */ | ||
51 | return srcprefs << 3; | ||
52 | } | ||
53 | |||
54 | static inline unsigned int rt6_flags2srcprefs(int flags) | ||
55 | { | ||
56 | return (flags >> 3) & 7; | ||
57 | } | ||
40 | 58 | ||
41 | extern void ip6_route_input(struct sk_buff *skb); | 59 | extern void ip6_route_input(struct sk_buff *skb); |
42 | 60 | ||