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>
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>
35 /*#include <net/af_ipn.h>*/
38 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
40 #define ipn_port br_port
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
);
56 return (struct ipn_node
*) rcu_dereference(dev
->rx_handler_data
);
60 static inline void ipn_netdevsync(void)