aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/ip6_route.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/ip6_route.h')
-rw-r--r--include/net/ip6_route.h53
1 files changed, 39 insertions, 14 deletions
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index 278312c95f96..5e91b72fc718 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -3,7 +3,6 @@
3 3
4#define IP6_RT_PRIO_USER 1024 4#define IP6_RT_PRIO_USER 1024
5#define IP6_RT_PRIO_ADDRCONF 256 5#define IP6_RT_PRIO_ADDRCONF 256
6#define IP6_RT_PRIO_KERN 512
7 6
8struct route_info { 7struct route_info {
9 __u8 type; 8 __u8 type;
@@ -22,8 +21,6 @@ struct route_info {
22 __u8 prefix[0]; /* 0,8 or 16 */ 21 __u8 prefix[0]; /* 0,8 or 16 */
23}; 22};
24 23
25#ifdef __KERNEL__
26
27#include <net/flow.h> 24#include <net/flow.h>
28#include <net/ip6_fib.h> 25#include <net/ip6_fib.h>
29#include <net/sock.h> 26#include <net/sock.h>
@@ -56,11 +53,23 @@ static inline unsigned int rt6_flags2srcprefs(int flags)
56 return (flags >> 3) & 7; 53 return (flags >> 3) & 7;
57} 54}
58 55
56extern void rt6_bind_peer(struct rt6_info *rt,
57 int create);
58
59static inline struct inet_peer *rt6_get_peer(struct rt6_info *rt)
60{
61 if (rt->rt6i_peer)
62 return rt->rt6i_peer;
63
64 rt6_bind_peer(rt, 0);
65 return rt->rt6i_peer;
66}
67
59extern void ip6_route_input(struct sk_buff *skb); 68extern void ip6_route_input(struct sk_buff *skb);
60 69
61extern struct dst_entry * ip6_route_output(struct net *net, 70extern struct dst_entry * ip6_route_output(struct net *net,
62 struct sock *sk, 71 const struct sock *sk,
63 struct flowi *fl); 72 struct flowi6 *fl6);
64 73
65extern int ip6_route_init(void); 74extern int ip6_route_init(void);
66extern void ip6_route_cleanup(void); 75extern void ip6_route_cleanup(void);
@@ -73,6 +82,12 @@ extern int ip6_route_add(struct fib6_config *cfg);
73extern int ip6_ins_rt(struct rt6_info *); 82extern int ip6_ins_rt(struct rt6_info *);
74extern int ip6_del_rt(struct rt6_info *); 83extern int ip6_del_rt(struct rt6_info *);
75 84
85extern int ip6_route_get_saddr(struct net *net,
86 struct rt6_info *rt,
87 const struct in6_addr *daddr,
88 unsigned int prefs,
89 struct in6_addr *saddr);
90
76extern struct rt6_info *rt6_lookup(struct net *net, 91extern struct rt6_info *rt6_lookup(struct net *net,
77 const struct in6_addr *daddr, 92 const struct in6_addr *daddr,
78 const struct in6_addr *saddr, 93 const struct in6_addr *saddr,
@@ -95,9 +110,9 @@ extern int ip6_dst_hoplimit(struct dst_entry *dst);
95 * support functions for ND 110 * support functions for ND
96 * 111 *
97 */ 112 */
98extern struct rt6_info * rt6_get_dflt_router(struct in6_addr *addr, 113extern struct rt6_info * rt6_get_dflt_router(const struct in6_addr *addr,
99 struct net_device *dev); 114 struct net_device *dev);
100extern struct rt6_info * rt6_add_dflt_router(struct in6_addr *gwaddr, 115extern struct rt6_info * rt6_add_dflt_router(const struct in6_addr *gwaddr,
101 struct net_device *dev, 116 struct net_device *dev,
102 unsigned int pref); 117 unsigned int pref);
103 118
@@ -105,17 +120,17 @@ extern void rt6_purge_dflt_routers(struct net *net);
105 120
106extern int rt6_route_rcv(struct net_device *dev, 121extern int rt6_route_rcv(struct net_device *dev,
107 u8 *opt, int len, 122 u8 *opt, int len,
108 struct in6_addr *gwaddr); 123 const struct in6_addr *gwaddr);
109 124
110extern void rt6_redirect(struct in6_addr *dest, 125extern void rt6_redirect(const struct in6_addr *dest,
111 struct in6_addr *src, 126 const struct in6_addr *src,
112 struct in6_addr *saddr, 127 const struct in6_addr *saddr,
113 struct neighbour *neigh, 128 struct neighbour *neigh,
114 u8 *lladdr, 129 u8 *lladdr,
115 int on_link); 130 int on_link);
116 131
117extern void rt6_pmtu_discovery(struct in6_addr *daddr, 132extern void rt6_pmtu_discovery(const struct in6_addr *daddr,
118 struct in6_addr *saddr, 133 const struct in6_addr *saddr,
119 struct net_device *dev, 134 struct net_device *dev,
120 u32 pmtu); 135 u32 pmtu);
121 136
@@ -130,6 +145,7 @@ struct rt6_rtnl_dump_arg {
130extern int rt6_dump_route(struct rt6_info *rt, void *p_arg); 145extern int rt6_dump_route(struct rt6_info *rt, void *p_arg);
131extern void rt6_ifdown(struct net *net, struct net_device *dev); 146extern void rt6_ifdown(struct net *net, struct net_device *dev);
132extern void rt6_mtu_change(struct net_device *dev, unsigned mtu); 147extern void rt6_mtu_change(struct net_device *dev, unsigned mtu);
148extern void rt6_remove_prefsrc(struct inet6_ifaddr *ifp);
133 149
134 150
135/* 151/*
@@ -164,5 +180,14 @@ static inline int ipv6_unicast_destination(struct sk_buff *skb)
164 return rt->rt6i_flags & RTF_LOCAL; 180 return rt->rt6i_flags & RTF_LOCAL;
165} 181}
166 182
167#endif 183int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *));
184
185static inline int ip6_skb_dst_mtu(struct sk_buff *skb)
186{
187 struct ipv6_pinfo *np = skb->sk ? inet6_sk(skb->sk) : NULL;
188
189 return (np && np->pmtudisc == IPV6_PMTUDISC_PROBE) ?
190 skb_dst(skb)->dev->mtu : dst_mtu(skb_dst(skb));
191}
192
168#endif 193#endif