diff options
Diffstat (limited to 'include/net/route.h')
-rw-r--r-- | include/net/route.h | 78 |
1 files changed, 41 insertions, 37 deletions
diff --git a/include/net/route.h b/include/net/route.h index afdeeb5bec25..f68c167280a7 100644 --- a/include/net/route.h +++ b/include/net/route.h | |||
@@ -39,6 +39,7 @@ | |||
39 | #define RTO_ONLINK 0x01 | 39 | #define RTO_ONLINK 0x01 |
40 | 40 | ||
41 | #define RT_CONN_FLAGS(sk) (RT_TOS(inet_sk(sk)->tos) | sock_flag(sk, SOCK_LOCALROUTE)) | 41 | #define RT_CONN_FLAGS(sk) (RT_TOS(inet_sk(sk)->tos) | sock_flag(sk, SOCK_LOCALROUTE)) |
42 | #define RT_CONN_FLAGS_TOS(sk,tos) (RT_TOS(tos) | sock_flag(sk, SOCK_LOCALROUTE)) | ||
42 | 43 | ||
43 | struct fib_nh; | 44 | struct fib_nh; |
44 | struct fib_info; | 45 | struct fib_info; |
@@ -87,34 +88,28 @@ struct ip_rt_acct { | |||
87 | }; | 88 | }; |
88 | 89 | ||
89 | struct rt_cache_stat { | 90 | struct rt_cache_stat { |
90 | unsigned int in_hit; | ||
91 | unsigned int in_slow_tot; | 91 | unsigned int in_slow_tot; |
92 | unsigned int in_slow_mc; | 92 | unsigned int in_slow_mc; |
93 | unsigned int in_no_route; | 93 | unsigned int in_no_route; |
94 | unsigned int in_brd; | 94 | unsigned int in_brd; |
95 | unsigned int in_martian_dst; | 95 | unsigned int in_martian_dst; |
96 | unsigned int in_martian_src; | 96 | unsigned int in_martian_src; |
97 | unsigned int out_hit; | ||
98 | unsigned int out_slow_tot; | 97 | unsigned int out_slow_tot; |
99 | unsigned int out_slow_mc; | 98 | unsigned int out_slow_mc; |
100 | unsigned int gc_total; | ||
101 | unsigned int gc_ignored; | ||
102 | unsigned int gc_goal_miss; | ||
103 | unsigned int gc_dst_overflow; | ||
104 | unsigned int in_hlist_search; | ||
105 | unsigned int out_hlist_search; | ||
106 | }; | 99 | }; |
107 | 100 | ||
108 | extern struct ip_rt_acct __percpu *ip_rt_acct; | 101 | extern struct ip_rt_acct __percpu *ip_rt_acct; |
109 | 102 | ||
110 | struct in_device; | 103 | struct in_device; |
111 | extern int ip_rt_init(void); | 104 | |
112 | extern void rt_cache_flush(struct net *net); | 105 | int ip_rt_init(void); |
113 | extern void rt_flush_dev(struct net_device *dev); | 106 | void rt_cache_flush(struct net *net); |
114 | extern struct rtable *__ip_route_output_key(struct net *, struct flowi4 *flp); | 107 | void rt_flush_dev(struct net_device *dev); |
115 | extern struct rtable *ip_route_output_flow(struct net *, struct flowi4 *flp, | 108 | struct rtable *__ip_route_output_key(struct net *, struct flowi4 *flp); |
116 | struct sock *sk); | 109 | struct rtable *ip_route_output_flow(struct net *, struct flowi4 *flp, |
117 | extern struct dst_entry *ipv4_blackhole_route(struct net *net, struct dst_entry *dst_orig); | 110 | struct sock *sk); |
111 | struct dst_entry *ipv4_blackhole_route(struct net *net, | ||
112 | struct dst_entry *dst_orig); | ||
118 | 113 | ||
119 | static inline struct rtable *ip_route_output_key(struct net *net, struct flowi4 *flp) | 114 | static inline struct rtable *ip_route_output_key(struct net *net, struct flowi4 *flp) |
120 | { | 115 | { |
@@ -162,8 +157,8 @@ static inline struct rtable *ip_route_output_gre(struct net *net, struct flowi4 | |||
162 | return ip_route_output_key(net, fl4); | 157 | return ip_route_output_key(net, fl4); |
163 | } | 158 | } |
164 | 159 | ||
165 | extern int ip_route_input_noref(struct sk_buff *skb, __be32 dst, __be32 src, | 160 | int ip_route_input_noref(struct sk_buff *skb, __be32 dst, __be32 src, |
166 | u8 tos, struct net_device *devin); | 161 | u8 tos, struct net_device *devin); |
167 | 162 | ||
168 | static inline int ip_route_input(struct sk_buff *skb, __be32 dst, __be32 src, | 163 | static inline int ip_route_input(struct sk_buff *skb, __be32 dst, __be32 src, |
169 | u8 tos, struct net_device *devin) | 164 | u8 tos, struct net_device *devin) |
@@ -179,24 +174,25 @@ static inline int ip_route_input(struct sk_buff *skb, __be32 dst, __be32 src, | |||
179 | return err; | 174 | return err; |
180 | } | 175 | } |
181 | 176 | ||
182 | extern void ipv4_update_pmtu(struct sk_buff *skb, struct net *net, u32 mtu, | 177 | void ipv4_update_pmtu(struct sk_buff *skb, struct net *net, u32 mtu, int oif, |
183 | int oif, u32 mark, u8 protocol, int flow_flags); | 178 | u32 mark, u8 protocol, int flow_flags); |
184 | extern void ipv4_sk_update_pmtu(struct sk_buff *skb, struct sock *sk, u32 mtu); | 179 | void ipv4_sk_update_pmtu(struct sk_buff *skb, struct sock *sk, u32 mtu); |
185 | extern void ipv4_redirect(struct sk_buff *skb, struct net *net, | 180 | void ipv4_redirect(struct sk_buff *skb, struct net *net, int oif, u32 mark, |
186 | int oif, u32 mark, u8 protocol, int flow_flags); | 181 | u8 protocol, int flow_flags); |
187 | extern void ipv4_sk_redirect(struct sk_buff *skb, struct sock *sk); | 182 | void ipv4_sk_redirect(struct sk_buff *skb, struct sock *sk); |
188 | extern void ip_rt_send_redirect(struct sk_buff *skb); | 183 | void ip_rt_send_redirect(struct sk_buff *skb); |
189 | 184 | ||
190 | extern unsigned int inet_addr_type(struct net *net, __be32 addr); | 185 | unsigned int inet_addr_type(struct net *net, __be32 addr); |
191 | extern unsigned int inet_dev_addr_type(struct net *net, const struct net_device *dev, __be32 addr); | 186 | unsigned int inet_dev_addr_type(struct net *net, const struct net_device *dev, |
192 | extern void ip_rt_multicast_event(struct in_device *); | 187 | __be32 addr); |
193 | extern int ip_rt_ioctl(struct net *, unsigned int cmd, void __user *arg); | 188 | void ip_rt_multicast_event(struct in_device *); |
194 | extern void ip_rt_get_source(u8 *src, struct sk_buff *skb, struct rtable *rt); | 189 | int ip_rt_ioctl(struct net *, unsigned int cmd, void __user *arg); |
195 | extern int ip_rt_dump(struct sk_buff *skb, struct netlink_callback *cb); | 190 | void ip_rt_get_source(u8 *src, struct sk_buff *skb, struct rtable *rt); |
191 | int ip_rt_dump(struct sk_buff *skb, struct netlink_callback *cb); | ||
196 | 192 | ||
197 | struct in_ifaddr; | 193 | struct in_ifaddr; |
198 | extern void fib_add_ifaddr(struct in_ifaddr *); | 194 | void fib_add_ifaddr(struct in_ifaddr *); |
199 | extern void fib_del_ifaddr(struct in_ifaddr *, struct in_ifaddr *); | 195 | void fib_del_ifaddr(struct in_ifaddr *, struct in_ifaddr *); |
200 | 196 | ||
201 | static inline void ip_rt_put(struct rtable *rt) | 197 | static inline void ip_rt_put(struct rtable *rt) |
202 | { | 198 | { |
@@ -317,12 +313,20 @@ static inline int ip4_dst_hoplimit(const struct dst_entry *dst) | |||
317 | return hoplimit; | 313 | return hoplimit; |
318 | } | 314 | } |
319 | 315 | ||
320 | static inline int ip_skb_dst_mtu(struct sk_buff *skb) | 316 | static inline bool ip_sk_accept_pmtu(const struct sock *sk) |
317 | { | ||
318 | return inet_sk(sk)->pmtudisc != IP_PMTUDISC_INTERFACE; | ||
319 | } | ||
320 | |||
321 | static inline bool ip_sk_use_pmtu(const struct sock *sk) | ||
321 | { | 322 | { |
322 | struct inet_sock *inet = skb->sk ? inet_sk(skb->sk) : NULL; | 323 | return inet_sk(sk)->pmtudisc < IP_PMTUDISC_PROBE; |
324 | } | ||
323 | 325 | ||
324 | return (inet && inet->pmtudisc == IP_PMTUDISC_PROBE) ? | 326 | static inline int ip_skb_dst_mtu(const struct sk_buff *skb) |
325 | skb_dst(skb)->dev->mtu : dst_mtu(skb_dst(skb)); | 327 | { |
328 | return (!skb->sk || ip_sk_use_pmtu(skb->sk)) ? | ||
329 | dst_mtu(skb_dst(skb)) : skb_dst(skb)->dev->mtu; | ||
326 | } | 330 | } |
327 | 331 | ||
328 | #endif /* _ROUTE_H */ | 332 | #endif /* _ROUTE_H */ |