4 #define MAX_N_CONTEXT 65535 /* Arbitrary limit */
6 #define NX_DYNAMIC_ID ((uint32_t)-1) /* id for dynamic context */
12 #include <linux/list.h>
13 #include <linux/spinlock.h>
14 #include <linux/utsname.h>
15 #include <linux/rcupdate.h>
16 #include <asm/resource.h>
17 #include <asm/atomic.h>
21 struct hlist_node nx_hlist; /* linked list of nxinfos */
22 struct rcu_head nx_rcu; /* the rcu head */
23 nid_t nx_id; /* vnet id */
24 atomic_t nx_usecnt; /* usage count */
25 atomic_t nx_refcnt; /* reference count */
27 uint64_t nx_flags; /* network flag word */
28 uint64_t nx_ncaps; /* network capabilities */
31 __u32 ipv4[NB_IPV4ROOT]; /* Process can only bind to these IPs */
32 /* The first one is used to connect */
33 /* and for bind any service */
34 /* The other must be used explicity */
35 __u32 mask[NB_IPV4ROOT]; /* Netmask for each ipv4 */
36 /* Used to select the proper source */
37 /* address for sockets */
38 __u32 v4_bcast; /* Broadcast address to receive UDP */
40 char nx_name[65]; /* network context name */
46 extern void rcu_free_nx_info(struct rcu_head *);
47 extern void unhash_nx_info(struct nx_info *);
49 extern struct nx_info *locate_nx_info(int);
50 extern struct nx_info *locate_or_create_nx_info(int);
52 extern int get_nid_list(int, unsigned int *, int);
53 extern int nx_info_is_hashed(nid_t);
55 extern int nx_migrate_task(struct task_struct *, struct nx_info *);
60 int ifa_in_nx_info(struct in_ifaddr *, struct nx_info *);
61 int dev_in_nx_info(struct net_device *, struct nx_info *);
64 #endif /* __KERNEL__ */
70 #define VCMD_task_nid VC_CMD(VINFO, 2, 0)
73 extern int vc_task_nid(uint32_t, void __user *);
75 #endif /* __KERNEL__ */
77 #define VCMD_nx_info VC_CMD(VINFO, 6, 0)
79 struct vcmd_nx_info_v0 {
85 extern int vc_nx_info(uint32_t, void __user *);
87 #endif /* __KERNEL__ */
89 #define VCMD_net_create VC_CMD(VNET, 1, 0)
90 #define VCMD_net_migrate VC_CMD(NETMIG, 1, 0)
92 #define VCMD_net_add VC_CMD(NETALT, 1, 0)
93 #define VCMD_net_remove VC_CMD(NETALT, 2, 0)
95 struct vcmd_net_nx_v0 {
107 extern int vc_net_create(uint32_t, void __user *);
108 extern int vc_net_migrate(uint32_t, void __user *);
110 #endif /* __KERNEL__ */
112 #define VCMD_get_nflags VC_CMD(FLAGS, 5, 0)
113 #define VCMD_set_nflags VC_CMD(FLAGS, 6, 0)
115 struct vcmd_net_flags_v0 {
121 extern int vc_get_nflags(uint32_t, void __user *);
122 extern int vc_set_nflags(uint32_t, void __user *);
124 #endif /* __KERNEL__ */
126 #define IPF_STATE_SETUP (1ULL<<32)
129 #define IPF_ONE_TIME (0x0001ULL<<32)
131 #define VCMD_get_ncaps VC_CMD(FLAGS, 7, 0)
132 #define VCMD_set_ncaps VC_CMD(FLAGS, 8, 0)
134 struct vcmd_net_caps_v0 {
140 extern int vc_get_ncaps(uint32_t, void __user *);
141 extern int vc_set_ncaps(uint32_t, void __user *);
143 #endif /* __KERNEL__ */
145 #define IPC_WOSSNAME 0x00000001
148 #endif /* _VX_NETWORK_H */