Linux >= 3.9 compatibility issue fixed: hlist_for_each_entry has 3 args now
[vde.git] / ipn / ipn_netdev.h
blobe96850c2fcdc04143a4a45129b707ee6eecdbdc0
1 #ifndef _IPN_NETDEV_H
2 #define _IPN_NETDEV_H
3 /*
4 * Inter process networking (virtual distributed ethernet) module
5 * Net devices: tap and grab
6 * (part of the View-OS project: wiki.virtualsquare.org)
8 * Copyright (C) 2007 Renzo Davoli (renzo@cs.unibo.it)
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * Due to this file being licensed under the GPL there is controversy over
16 * whether this permits you to write a module that #includes this file
17 * without placing your module under the GPL. Please consult a lawyer for
18 * advice before doing this.
20 * WARNING: THIS CODE IS ALREADY EXPERIMENTAL
24 #include <linux/init.h>
25 #include <linux/module.h>
26 #include <linux/socket.h>
27 #include <linux/poll.h>
28 #include <linux/un.h>
29 #include <linux/list.h>
30 #include <linux/mount.h>
31 #include <linux/etherdevice.h>
32 #include <linux/if_bridge.h>
33 #include <linux/version.h>
34 #include <net/sock.h>
35 /*#include <net/af_ipn.h>*/
36 #include "af_ipn.h"
38 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
39 #ifdef IPN_STEALING
40 #define ipn_port br_port
41 #endif
42 #endif
44 struct net_device *ipn_netdev_alloc(struct net *net,int type, char *name, int *err);
45 int ipn_netdev_activate(struct ipn_node *ipn_node);
46 void ipn_netdev_close(struct ipn_node *ipn_node);
47 void ipn_netdev_sendmsg(struct ipn_node *to,struct msgpool_item *msg);
48 int ipn_netdev_init(void);
49 void ipn_netdev_fini(void);
51 static inline struct ipn_node *ipn_netdev2node(struct net_device *dev)
53 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
54 return (struct ipn_node *) rcu_dereference(dev->ipn_port);
55 #else
56 return (struct ipn_node *) rcu_dereference(dev->rx_handler_data);
57 #endif
60 static inline void ipn_netdevsync(void)
62 synchronize_rcu();
64 #endif