summaryrefslogtreecommitdiffstats
path: root/include/net/dst_ops.h
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2009-08-29 01:34:49 +0000
committerDavid S. Miller <davem@davemloft.net>2009-09-01 17:40:31 -0700
commit86393e52c3f1e2f6be18383f6ecdbcdc5727d545 (patch)
treef5c688c0cb5292143478249f807c4b2372f69dfd /include/net/dst_ops.h
parent885a136c52a8871175477baf3903e1c38751b35a (diff)
downloadlinux-86393e52c3f1e2f6be18383f6ecdbcdc5727d545.tar.gz
linux-86393e52c3f1e2f6be18383f6ecdbcdc5727d545.tar.xz
netns: embed ip6_dst_ops directly
struct net::ipv6.ip6_dst_ops is separatedly dynamically allocated, but there is no fundamental reason for it. Embed it directly into struct netns_ipv6. For that: * move struct dst_ops into separate header to fix circular dependencies I honestly tried not to, it's pretty impossible to do other way * drop dynamical allocation, allocate together with netns For a change, remove struct dst_ops::dst_net, it's deducible by using container_of() given dst_ops pointer. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/dst_ops.h')
-rw-r--r--include/net/dst_ops.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/include/net/dst_ops.h b/include/net/dst_ops.h
new file mode 100644
index 000000000000..d1ff9b7e99b8
--- /dev/null
+++ b/include/net/dst_ops.h
@@ -0,0 +1,28 @@
+#ifndef _NET_DST_OPS_H
+#define _NET_DST_OPS_H
+#include <linux/types.h>
+
+struct dst_entry;
+struct kmem_cachep;
+struct net_device;
+struct sk_buff;
+
+struct dst_ops {
+ unsigned short family;
+ __be16 protocol;
+ unsigned gc_thresh;
+
+ int (*gc)(struct dst_ops *ops);
+ struct dst_entry * (*check)(struct dst_entry *, __u32 cookie);
+ void (*destroy)(struct dst_entry *);
+ void (*ifdown)(struct dst_entry *,
+ struct net_device *dev, int how);
+ struct dst_entry * (*negative_advice)(struct dst_entry *);
+ void (*link_failure)(struct sk_buff *);
+ void (*update_pmtu)(struct dst_entry *dst, u32 mtu);
+ int (*local_out)(struct sk_buff *skb);
+
+ atomic_t entries;
+ struct kmem_cache *kmem_cachep;
+};
+#endif