diff options
Diffstat (limited to 'include/net/ip6_route.h')
-rw-r--r-- | include/net/ip6_route.h | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h index 96b0e66406ec..6ca6b71dfe0f 100644 --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h | |||
@@ -32,6 +32,10 @@ struct route_info { | |||
32 | #include <linux/ip.h> | 32 | #include <linux/ip.h> |
33 | #include <linux/ipv6.h> | 33 | #include <linux/ipv6.h> |
34 | 34 | ||
35 | #define RT6_LOOKUP_F_IFACE 0x1 | ||
36 | #define RT6_LOOKUP_F_REACHABLE 0x2 | ||
37 | #define RT6_LOOKUP_F_HAS_SADDR 0x4 | ||
38 | |||
35 | struct pol_chain { | 39 | struct pol_chain { |
36 | int type; | 40 | int type; |
37 | int priority; | 41 | int priority; |
@@ -41,6 +45,11 @@ struct pol_chain { | |||
41 | 45 | ||
42 | extern struct rt6_info ip6_null_entry; | 46 | extern struct rt6_info ip6_null_entry; |
43 | 47 | ||
48 | #ifdef CONFIG_IPV6_MULTIPLE_TABLES | ||
49 | extern struct rt6_info ip6_prohibit_entry; | ||
50 | extern struct rt6_info ip6_blk_hole_entry; | ||
51 | #endif | ||
52 | |||
44 | extern int ip6_rt_gc_interval; | 53 | extern int ip6_rt_gc_interval; |
45 | 54 | ||
46 | extern void ip6_route_input(struct sk_buff *skb); | 55 | extern void ip6_route_input(struct sk_buff *skb); |
@@ -48,25 +57,14 @@ extern void ip6_route_input(struct sk_buff *skb); | |||
48 | extern struct dst_entry * ip6_route_output(struct sock *sk, | 57 | extern struct dst_entry * ip6_route_output(struct sock *sk, |
49 | struct flowi *fl); | 58 | struct flowi *fl); |
50 | 59 | ||
51 | extern int ip6_route_me_harder(struct sk_buff *skb); | ||
52 | |||
53 | extern void ip6_route_init(void); | 60 | extern void ip6_route_init(void); |
54 | extern void ip6_route_cleanup(void); | 61 | extern void ip6_route_cleanup(void); |
55 | 62 | ||
56 | extern int ipv6_route_ioctl(unsigned int cmd, void __user *arg); | 63 | extern int ipv6_route_ioctl(unsigned int cmd, void __user *arg); |
57 | 64 | ||
58 | extern int ip6_route_add(struct in6_rtmsg *rtmsg, | 65 | extern int ip6_route_add(struct fib6_config *cfg); |
59 | struct nlmsghdr *, | 66 | extern int ip6_ins_rt(struct rt6_info *); |
60 | void *rtattr, | 67 | extern int ip6_del_rt(struct rt6_info *); |
61 | struct netlink_skb_parms *req); | ||
62 | extern int ip6_ins_rt(struct rt6_info *, | ||
63 | struct nlmsghdr *, | ||
64 | void *rtattr, | ||
65 | struct netlink_skb_parms *req); | ||
66 | extern int ip6_del_rt(struct rt6_info *, | ||
67 | struct nlmsghdr *, | ||
68 | void *rtattr, | ||
69 | struct netlink_skb_parms *req); | ||
70 | 68 | ||
71 | extern int ip6_rt_addr_add(struct in6_addr *addr, | 69 | extern int ip6_rt_addr_add(struct in6_addr *addr, |
72 | struct net_device *dev, | 70 | struct net_device *dev, |
@@ -114,6 +112,7 @@ extern int rt6_route_rcv(struct net_device *dev, | |||
114 | struct in6_addr *gwaddr); | 112 | struct in6_addr *gwaddr); |
115 | 113 | ||
116 | extern void rt6_redirect(struct in6_addr *dest, | 114 | extern void rt6_redirect(struct in6_addr *dest, |
115 | struct in6_addr *src, | ||
117 | struct in6_addr *saddr, | 116 | struct in6_addr *saddr, |
118 | struct neighbour *neigh, | 117 | struct neighbour *neigh, |
119 | u8 *lladdr, | 118 | u8 *lladdr, |
@@ -131,6 +130,13 @@ extern int inet6_rtm_newroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *a | |||
131 | extern int inet6_rtm_delroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg); | 130 | extern int inet6_rtm_delroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg); |
132 | extern int inet6_rtm_getroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg); | 131 | extern int inet6_rtm_getroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg); |
133 | 132 | ||
133 | struct rt6_rtnl_dump_arg | ||
134 | { | ||
135 | struct sk_buff *skb; | ||
136 | struct netlink_callback *cb; | ||
137 | }; | ||
138 | |||
139 | extern int rt6_dump_route(struct rt6_info *rt, void *p_arg); | ||
134 | extern void rt6_ifdown(struct net_device *dev); | 140 | extern void rt6_ifdown(struct net_device *dev); |
135 | extern void rt6_mtu_change(struct net_device *dev, unsigned mtu); | 141 | extern void rt6_mtu_change(struct net_device *dev, unsigned mtu); |
136 | 142 | ||
@@ -140,21 +146,24 @@ extern rwlock_t rt6_lock; | |||
140 | * Store a destination cache entry in a socket | 146 | * Store a destination cache entry in a socket |
141 | */ | 147 | */ |
142 | static inline void __ip6_dst_store(struct sock *sk, struct dst_entry *dst, | 148 | static inline void __ip6_dst_store(struct sock *sk, struct dst_entry *dst, |
143 | struct in6_addr *daddr) | 149 | struct in6_addr *daddr, struct in6_addr *saddr) |
144 | { | 150 | { |
145 | struct ipv6_pinfo *np = inet6_sk(sk); | 151 | struct ipv6_pinfo *np = inet6_sk(sk); |
146 | struct rt6_info *rt = (struct rt6_info *) dst; | 152 | struct rt6_info *rt = (struct rt6_info *) dst; |
147 | 153 | ||
148 | sk_setup_caps(sk, dst); | 154 | sk_setup_caps(sk, dst); |
149 | np->daddr_cache = daddr; | 155 | np->daddr_cache = daddr; |
156 | #ifdef CONFIG_IPV6_SUBTREES | ||
157 | np->saddr_cache = saddr; | ||
158 | #endif | ||
150 | np->dst_cookie = rt->rt6i_node ? rt->rt6i_node->fn_sernum : 0; | 159 | np->dst_cookie = rt->rt6i_node ? rt->rt6i_node->fn_sernum : 0; |
151 | } | 160 | } |
152 | 161 | ||
153 | static inline void ip6_dst_store(struct sock *sk, struct dst_entry *dst, | 162 | static inline void ip6_dst_store(struct sock *sk, struct dst_entry *dst, |
154 | struct in6_addr *daddr) | 163 | struct in6_addr *daddr, struct in6_addr *saddr) |
155 | { | 164 | { |
156 | write_lock(&sk->sk_dst_lock); | 165 | write_lock(&sk->sk_dst_lock); |
157 | __ip6_dst_store(sk, dst, daddr); | 166 | __ip6_dst_store(sk, dst, daddr, saddr); |
158 | write_unlock(&sk->sk_dst_lock); | 167 | write_unlock(&sk->sk_dst_lock); |
159 | } | 168 | } |
160 | 169 | ||