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 */
44 extern void rcu_free_nx_info(void *);
45 extern void unhash_nx_info(struct nx_info *);
47 extern struct nx_info *locate_nx_info(int);
48 extern struct nx_info *locate_or_create_nx_info(int);
50 extern int get_nid_list(int, unsigned int *, int);
51 extern int nx_info_is_hashed(nid_t);
53 extern int nx_migrate_task(struct task_struct *, struct nx_info *);
58 int ifa_in_nx_info(struct in_ifaddr *, struct nx_info *);
59 int dev_in_nx_info(struct net_device *, struct nx_info *);
62 #endif /* __KERNEL__ */
68 #define VCMD_task_nid VC_CMD(VINFO, 2, 0)
71 extern int vc_task_nid(uint32_t, void __user *);
73 #endif /* __KERNEL__ */
75 #define VCMD_nx_info VC_CMD(VINFO, 6, 0)
77 struct vcmd_nx_info_v0 {
83 extern int vc_nx_info(uint32_t, void __user *);
85 #endif /* __KERNEL__ */
87 #define VCMD_net_create VC_CMD(VNET, 1, 0)
88 #define VCMD_net_migrate VC_CMD(NETMIG, 1, 0)
90 #define VCMD_net_add VC_CMD(NETALT, 1, 0)
91 #define VCMD_net_remove VC_CMD(NETALT, 2, 0)
93 struct vcmd_net_nx_v0 {
105 extern int vc_net_create(uint32_t, void __user *);
106 extern int vc_net_migrate(uint32_t, void __user *);
108 #endif /* __KERNEL__ */
110 #define VCMD_get_nflags VC_CMD(FLAGS, 5, 0)
111 #define VCMD_set_nflags VC_CMD(FLAGS, 6, 0)
113 struct vcmd_net_flags_v0 {
119 extern int vc_get_nflags(uint32_t, void __user *);
120 extern int vc_set_nflags(uint32_t, void __user *);
122 #endif /* __KERNEL__ */
124 #define IPF_STATE_SETUP (1ULL<<32)
127 #define IPF_ONE_TIME (0x0001ULL<<32)
129 #define VCMD_get_ncaps VC_CMD(FLAGS, 7, 0)
130 #define VCMD_set_ncaps VC_CMD(FLAGS, 8, 0)
132 struct vcmd_net_caps_v0 {
138 extern int vc_get_ncaps(uint32_t, void __user *);
139 extern int vc_set_ncaps(uint32_t, void __user *);
141 #endif /* __KERNEL__ */
143 #define IPC_WOSSNAME 0x00000001
146 #endif /* _VX_NETWORK_H */