gre: Compatibility with older Linux kernel versions.
[sliver-openvswitch.git] / datapath / linux-2.6 / compat-2.6 / include / net / net_namespace.h
diff --git a/datapath/linux-2.6/compat-2.6/include/net/net_namespace.h b/datapath/linux-2.6/compat-2.6/include/net/net_namespace.h
new file mode 100644 (file)
index 0000000..9b66c91
--- /dev/null
@@ -0,0 +1,26 @@
+#ifndef __NET_NAMESPACE_WRAPPER_H
+#define __NET_NAMESPACE_WRAPPER_H 1
+
+#include <linux/version.h>
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,24)
+#include_next <net/net_namespace.h>
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
+struct net;
+
+struct pernet_operations {
+       struct list_head list;
+       int (*init)(struct net *net);
+       void (*exit)(struct net *net);
+};
+#endif /* linux kernel < 2.6.24 */
+
+extern int register_pernet_gen_device(int *id, struct pernet_operations *);
+extern void unregister_pernet_gen_device(int id, struct pernet_operations *);
+
+#endif /* linux kernel < 2.6.26 */
+
+#endif