aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/ip6_route.h
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
commit8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch)
treea8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /include/net/ip6_route.h
parent406089d01562f1e2bf9f089fd7637009ebaad589 (diff)
Patched in Tegra support.
Diffstat (limited to 'include/net/ip6_route.h')
-rw-r--r--include/net/ip6_route.h54
1 files changed, 25 insertions, 29 deletions
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index 27d83183e61..5e91b72fc71 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -1,6 +1,9 @@
1#ifndef _NET_IP6_ROUTE_H 1#ifndef _NET_IP6_ROUTE_H
2#define _NET_IP6_ROUTE_H 2#define _NET_IP6_ROUTE_H
3 3
4#define IP6_RT_PRIO_USER 1024
5#define IP6_RT_PRIO_ADDRCONF 256
6
4struct route_info { 7struct route_info {
5 __u8 type; 8 __u8 type;
6 __u8 length; 9 __u8 length;
@@ -50,25 +53,16 @@ static inline unsigned int rt6_flags2srcprefs(int flags)
50 return (flags >> 3) & 7; 53 return (flags >> 3) & 7;
51} 54}
52 55
53extern void rt6_bind_peer(struct rt6_info *rt, int create); 56extern void rt6_bind_peer(struct rt6_info *rt,
54 57 int create);
55static inline struct inet_peer *__rt6_get_peer(struct rt6_info *rt, int create)
56{
57 if (rt6_has_peer(rt))
58 return rt6_peer_ptr(rt);
59
60 rt6_bind_peer(rt, create);
61 return (rt6_has_peer(rt) ? rt6_peer_ptr(rt) : NULL);
62}
63 58
64static inline struct inet_peer *rt6_get_peer(struct rt6_info *rt) 59static inline struct inet_peer *rt6_get_peer(struct rt6_info *rt)
65{ 60{
66 return __rt6_get_peer(rt, 0); 61 if (rt->rt6i_peer)
67} 62 return rt->rt6i_peer;
68 63
69static inline struct inet_peer *rt6_get_peer_create(struct rt6_info *rt) 64 rt6_bind_peer(rt, 0);
70{ 65 return rt->rt6i_peer;
71 return __rt6_get_peer(rt, 1);
72} 66}
73 67
74extern void ip6_route_input(struct sk_buff *skb); 68extern void ip6_route_input(struct sk_buff *skb);
@@ -76,8 +70,6 @@ extern void ip6_route_input(struct sk_buff *skb);
76extern struct dst_entry * ip6_route_output(struct net *net, 70extern struct dst_entry * ip6_route_output(struct net *net,
77 const struct sock *sk, 71 const struct sock *sk,
78 struct flowi6 *fl6); 72 struct flowi6 *fl6);
79extern struct dst_entry * ip6_route_lookup(struct net *net,
80 struct flowi6 *fl6, int flags);
81 73
82extern int ip6_route_init(void); 74extern int ip6_route_init(void);
83extern void ip6_route_cleanup(void); 75extern void ip6_route_cleanup(void);
@@ -103,14 +95,14 @@ extern struct rt6_info *rt6_lookup(struct net *net,
103 95
104extern struct dst_entry *icmp6_dst_alloc(struct net_device *dev, 96extern struct dst_entry *icmp6_dst_alloc(struct net_device *dev,
105 struct neighbour *neigh, 97 struct neighbour *neigh,
106 struct flowi6 *fl6); 98 const struct in6_addr *addr);
107extern int icmp6_dst_gc(void); 99extern int icmp6_dst_gc(void);
108 100
109extern void fib6_force_start_gc(struct net *net); 101extern void fib6_force_start_gc(struct net *net);
110 102
111extern struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev, 103extern struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev,
112 const struct in6_addr *addr, 104 const struct in6_addr *addr,
113 bool anycast); 105 int anycast);
114 106
115extern int ip6_dst_hoplimit(struct dst_entry *dst); 107extern int ip6_dst_hoplimit(struct dst_entry *dst);
116 108
@@ -130,12 +122,17 @@ extern int rt6_route_rcv(struct net_device *dev,
130 u8 *opt, int len, 122 u8 *opt, int len,
131 const struct in6_addr *gwaddr); 123 const struct in6_addr *gwaddr);
132 124
133extern void ip6_update_pmtu(struct sk_buff *skb, struct net *net, __be32 mtu, 125extern void rt6_redirect(const struct in6_addr *dest,
134 int oif, u32 mark); 126 const struct in6_addr *src,
135extern void ip6_sk_update_pmtu(struct sk_buff *skb, struct sock *sk, 127 const struct in6_addr *saddr,
136 __be32 mtu); 128 struct neighbour *neigh,
137extern void ip6_redirect(struct sk_buff *skb, struct net *net, int oif, u32 mark); 129 u8 *lladdr,
138extern void ip6_sk_redirect(struct sk_buff *skb, struct sock *sk); 130 int on_link);
131
132extern void rt6_pmtu_discovery(const struct in6_addr *daddr,
133 const struct in6_addr *saddr,
134 struct net_device *dev,
135 u32 pmtu);
139 136
140struct netlink_callback; 137struct netlink_callback;
141 138
@@ -147,7 +144,7 @@ struct rt6_rtnl_dump_arg {
147 144
148extern int rt6_dump_route(struct rt6_info *rt, void *p_arg); 145extern int rt6_dump_route(struct rt6_info *rt, void *p_arg);
149extern void rt6_ifdown(struct net *net, struct net_device *dev); 146extern void rt6_ifdown(struct net *net, struct net_device *dev);
150extern void rt6_mtu_change(struct net_device *dev, unsigned int mtu); 147extern void rt6_mtu_change(struct net_device *dev, unsigned mtu);
151extern void rt6_remove_prefsrc(struct inet6_ifaddr *ifp); 148extern void rt6_remove_prefsrc(struct inet6_ifaddr *ifp);
152 149
153 150
@@ -155,8 +152,7 @@ extern void rt6_remove_prefsrc(struct inet6_ifaddr *ifp);
155 * Store a destination cache entry in a socket 152 * Store a destination cache entry in a socket
156 */ 153 */
157static inline void __ip6_dst_store(struct sock *sk, struct dst_entry *dst, 154static inline void __ip6_dst_store(struct sock *sk, struct dst_entry *dst,
158 const struct in6_addr *daddr, 155 struct in6_addr *daddr, struct in6_addr *saddr)
159 const struct in6_addr *saddr)
160{ 156{
161 struct ipv6_pinfo *np = inet6_sk(sk); 157 struct ipv6_pinfo *np = inet6_sk(sk);
162 struct rt6_info *rt = (struct rt6_info *) dst; 158 struct rt6_info *rt = (struct rt6_info *) dst;
@@ -177,7 +173,7 @@ static inline void ip6_dst_store(struct sock *sk, struct dst_entry *dst,
177 spin_unlock(&sk->sk_dst_lock); 173 spin_unlock(&sk->sk_dst_lock);
178} 174}
179 175
180static inline bool ipv6_unicast_destination(const struct sk_buff *skb) 176static inline int ipv6_unicast_destination(struct sk_buff *skb)
181{ 177{
182 struct rt6_info *rt = (struct rt6_info *) skb_dst(skb); 178 struct rt6_info *rt = (struct rt6_info *) skb_dst(skb);
183 179