aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/dst.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-01-29 06:54:01 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-01-29 06:54:01 -0500
commit0ba6c33bcddc64a54b5f1c25a696c4767dc76292 (patch)
tree62e616f97a4762d8e75bf732e4827af2d15d52c5 /include/net/dst.h
parent21af0297c7e56024a5ccc4d8ad2a590f9ec371ba (diff)
parent85040bcb4643cba578839e953f25e2d1965d83d0 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.25
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.25: (1470 commits) [IPV6] ADDRLABEL: Fix double free on label deletion. [PPP]: Sparse warning fixes. [IPV4] fib_trie: remove unneeded NULL check [IPV4] fib_trie: More whitespace cleanup. [NET_SCHED]: Use nla_policy for attribute validation in ematches [NET_SCHED]: Use nla_policy for attribute validation in actions [NET_SCHED]: Use nla_policy for attribute validation in classifiers [NET_SCHED]: Use nla_policy for attribute validation in packet schedulers [NET_SCHED]: sch_api: introduce constant for rate table size [NET_SCHED]: Use typeful attribute parsing helpers [NET_SCHED]: Use typeful attribute construction helpers [NET_SCHED]: Use NLA_PUT_STRING for string dumping [NET_SCHED]: Use nla_nest_start/nla_nest_end [NET_SCHED]: Propagate nla_parse return value [NET_SCHED]: act_api: use PTR_ERR in tcf_action_init/tcf_action_get [NET_SCHED]: act_api: use nlmsg_parse [NET_SCHED]: act_api: fix netlink API conversion bug [NET_SCHED]: sch_netem: use nla_parse_nested_compat [NET_SCHED]: sch_atm: fix format string warning [NETNS]: Add namespace for ICMP replying code. ...
Diffstat (limited to 'include/net/dst.h')
-rw-r--r--include/net/dst.h23
1 files changed, 15 insertions, 8 deletions
diff --git a/include/net/dst.h b/include/net/dst.h
index 2f65e894b829..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__
@@ -180,6 +180,7 @@ static inline struct dst_entry *dst_pop(struct dst_entry *dst)
180 return child; 180 return child;
181} 181}
182 182
183extern int dst_discard(struct sk_buff *skb);
183extern void * dst_alloc(struct dst_ops * ops); 184extern void * dst_alloc(struct dst_ops * ops);
184extern void __dst_free(struct dst_entry * dst); 185extern void __dst_free(struct dst_entry * dst);
185extern struct dst_entry *dst_destroy(struct dst_entry * dst); 186extern struct dst_entry *dst_destroy(struct dst_entry * dst);
@@ -264,6 +265,12 @@ static inline struct dst_entry *dst_check(struct dst_entry *dst, u32 cookie)
264 265
265extern void dst_init(void); 266extern void dst_init(void);
266 267
268/* Flags for xfrm_lookup flags argument. */
269enum {
270 XFRM_LOOKUP_WAIT = 1 << 0,
271 XFRM_LOOKUP_ICMP = 1 << 1,
272};
273
267struct flowi; 274struct flowi;
268#ifndef CONFIG_XFRM 275#ifndef CONFIG_XFRM
269static 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,