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 *);
65 int nx_addr_conflict(struct nx_info *, uint32_t, struct sock *);
68 #endif /* __KERNEL__ */
74 #define VCMD_task_nid VC_CMD(VINFO, 2, 0)
77 extern int vc_task_nid(uint32_t, void __user *);
79 #endif /* __KERNEL__ */
81 #define VCMD_nx_info VC_CMD(VINFO, 6, 0)
83 struct vcmd_nx_info_v0 {
89 extern int vc_nx_info(uint32_t, void __user *);
91 #endif /* __KERNEL__ */
93 #define VCMD_net_create VC_CMD(VNET, 1, 0)
94 #define VCMD_net_migrate VC_CMD(NETMIG, 1, 0)
96 #define VCMD_net_add VC_CMD(NETALT, 1, 0)
97 #define VCMD_net_remove VC_CMD(NETALT, 2, 0)
99 struct vcmd_net_nx_v0 {
111 extern int vc_net_create(uint32_t, void __user *);
112 extern int vc_net_migrate(uint32_t, void __user *);
114 #endif /* __KERNEL__ */
116 #define VCMD_get_nflags VC_CMD(FLAGS, 5, 0)
117 #define VCMD_set_nflags VC_CMD(FLAGS, 6, 0)
119 struct vcmd_net_flags_v0 {
125 extern int vc_get_nflags(uint32_t, void __user *);
126 extern int vc_set_nflags(uint32_t, void __user *);
128 #endif /* __KERNEL__ */
130 #define IPF_STATE_SETUP (1ULL<<32)
133 #define IPF_ONE_TIME (0x0001ULL<<32)
135 #define VCMD_get_ncaps VC_CMD(FLAGS, 7, 0)
136 #define VCMD_set_ncaps VC_CMD(FLAGS, 8, 0)
138 struct vcmd_net_caps_v0 {
144 extern int vc_get_ncaps(uint32_t, void __user *);
145 extern int vc_set_ncaps(uint32_t, void __user *);
147 #endif /* __KERNEL__ */
149 #define IPC_WOSSNAME 0x00000001
152 #endif /* _VX_NETWORK_H */