aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/dst.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/dst.h')
-rw-r--r--include/net/dst.h30
1 files changed, 22 insertions, 8 deletions
diff --git a/include/net/dst.h b/include/net/dst.h
index e9ff4a4caef9..e3ac7d0fc4e1 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -50,14 +50,17 @@ struct dst_entry
50 unsigned long expires; 50 unsigned long expires;
51 51
52 unsigned short header_len; /* more space at head required */ 52 unsigned short header_len; /* more space at head required */
53 unsigned short nfheader_len; /* more non-fragment space at head required */
54 unsigned short trailer_len; /* space to reserve at tail */ 53 unsigned short trailer_len; /* space to reserve at tail */
55 54
56 u32 metrics[RTAX_MAX]; 55 u32 metrics[RTAX_MAX];
57 struct dst_entry *path; 56 struct dst_entry *path;
58 57
59 unsigned long rate_last; /* rate limiting for ICMP */ 58 unsigned long rate_last; /* rate limiting for ICMP */
60 unsigned long rate_tokens; 59 unsigned int rate_tokens;
60
61#ifdef CONFIG_NET_CLS_ROUTE
62 __u32 tclassid;
63#endif
61 64
62 struct neighbour *neighbour; 65 struct neighbour *neighbour;
63 struct hh_cache *hh; 66 struct hh_cache *hh;
@@ -66,10 +69,6 @@ struct dst_entry
66 int (*input)(struct sk_buff*); 69 int (*input)(struct sk_buff*);
67 int (*output)(struct sk_buff*); 70 int (*output)(struct sk_buff*);
68 71
69#ifdef CONFIG_NET_CLS_ROUTE
70 __u32 tclassid;
71#endif
72
73 struct dst_ops *ops; 72 struct dst_ops *ops;
74 73
75 unsigned long lastuse; 74 unsigned long lastuse;
@@ -81,7 +80,6 @@ struct dst_entry
81 struct rt6_info *rt6_next; 80 struct rt6_info *rt6_next;
82 struct dn_route *dn_next; 81 struct dn_route *dn_next;
83 }; 82 };
84 char info[0];
85}; 83};
86 84
87 85
@@ -91,7 +89,7 @@ struct dst_ops
91 __be16 protocol; 89 __be16 protocol;
92 unsigned gc_thresh; 90 unsigned gc_thresh;
93 91
94 int (*gc)(void); 92 int (*gc)(struct dst_ops *ops);
95 struct dst_entry * (*check)(struct dst_entry *, __u32 cookie); 93 struct dst_entry * (*check)(struct dst_entry *, __u32 cookie);
96 void (*destroy)(struct dst_entry *); 94 void (*destroy)(struct dst_entry *);
97 void (*ifdown)(struct dst_entry *, 95 void (*ifdown)(struct dst_entry *,
@@ -99,10 +97,12 @@ struct dst_ops
99 struct dst_entry * (*negative_advice)(struct dst_entry *); 97 struct dst_entry * (*negative_advice)(struct dst_entry *);
100 void (*link_failure)(struct sk_buff *); 98 void (*link_failure)(struct sk_buff *);
101 void (*update_pmtu)(struct dst_entry *dst, u32 mtu); 99 void (*update_pmtu)(struct dst_entry *dst, u32 mtu);
100 int (*local_out)(struct sk_buff *skb);
102 int entry_size; 101 int entry_size;
103 102
104 atomic_t entries; 103 atomic_t entries;
105 struct kmem_cache *kmem_cachep; 104 struct kmem_cache *kmem_cachep;
105 struct net *dst_net;
106}; 106};
107 107
108#ifdef __KERNEL__ 108#ifdef __KERNEL__
@@ -143,6 +143,13 @@ static inline void dst_hold(struct dst_entry * dst)
143 atomic_inc(&dst->__refcnt); 143 atomic_inc(&dst->__refcnt);
144} 144}
145 145
146static inline void dst_use(struct dst_entry *dst, unsigned long time)
147{
148 dst_hold(dst);
149 dst->__use++;
150 dst->lastuse = time;
151}
152
146static inline 153static inline
147struct dst_entry * dst_clone(struct dst_entry * dst) 154struct dst_entry * dst_clone(struct dst_entry * dst)
148{ 155{
@@ -173,6 +180,7 @@ static inline struct dst_entry *dst_pop(struct dst_entry *dst)
173 return child; 180 return child;
174} 181}
175 182
183extern int dst_discard(struct sk_buff *skb);
176extern void * dst_alloc(struct dst_ops * ops); 184extern void * dst_alloc(struct dst_ops * ops);
177extern void __dst_free(struct dst_entry * dst); 185extern void __dst_free(struct dst_entry * dst);
178extern struct dst_entry *dst_destroy(struct dst_entry * dst); 186extern struct dst_entry *dst_destroy(struct dst_entry * dst);
@@ -257,6 +265,12 @@ static inline struct dst_entry *dst_check(struct dst_entry *dst, u32 cookie)
257 265
258extern void dst_init(void); 266extern void dst_init(void);
259 267
268/* Flags for xfrm_lookup flags argument. */
269enum {
270 XFRM_LOOKUP_WAIT = 1 << 0,
271 XFRM_LOOKUP_ICMP = 1 << 1,
272};
273
260struct flowi; 274struct flowi;
261#ifndef CONFIG_XFRM 275#ifndef CONFIG_XFRM
262static inline int xfrm_lookup(struct dst_entry **dst_p, struct flowi *fl, 276static inline int xfrm_lookup(struct dst_entry **dst_p, struct flowi *fl,