4 #define MAX_N_CONTEXT 65535 /* Arbitrary limit */
6 #define IP_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 <asm/resource.h>
16 #include <asm/atomic.h>
20 struct list_head nx_list; /* linked list of nxinfos */
21 nid_t nx_id; /* vnet id */
24 uint64_t nx_flags; /* network flag word */
25 uint64_t nx_ncaps; /* network capabilities */
28 __u32 ipv4[NB_IPV4ROOT]; /* Process can only bind to these IPs */
29 /* The first one is used to connect */
30 /* and for bind any service */
31 /* The other must be used explicity */
32 __u32 mask[NB_IPV4ROOT]; /* Netmask for each ipv4 */
33 /* Used to select the proper source */
34 /* address for sockets */
35 __u32 v4_bcast; /* Broadcast address to receive UDP */
37 char nx_name[65]; /* network context name */
41 extern spinlock_t nxlist_lock;
42 extern struct list_head nx_infos;
45 void free_nx_info(struct nx_info *);
46 struct nx_info *create_nx_info(void);
48 extern struct nx_info *find_nx_info(int);
49 extern int nx_info_id_valid(int);
54 int ifa_in_nx_info(struct in_ifaddr *, struct nx_info *);
55 int dev_in_nx_info(struct net_device *, struct nx_info *);
58 #endif /* __KERNEL__ */
64 #define VCMD_task_nid VC_CMD(VINFO, 2, 0)
67 extern int vc_task_nid(uint32_t, void __user *);
69 #endif /* __KERNEL__ */
71 #define VCMD_nx_info VC_CMD(VINFO, 6, 0)
73 struct vcmd_nx_info_v0 {
79 extern int vc_nx_info(uint32_t, void __user *);
81 #endif /* __KERNEL__ */
83 #define VCMD_net_create VC_CMD(VNET, 1, 0)
84 #define VCMD_net_migrate VC_CMD(NETMIG, 1, 0)
86 #define VCMD_net_add VC_CMD(NETALT, 1, 0)
87 #define VCMD_net_remove VC_CMD(NETALT, 2, 0)
89 struct vcmd_net_nx_v0 {
101 extern int vc_net_create(uint32_t, void __user *);
102 extern int vc_net_migrate(uint32_t, void __user *);
104 #endif /* __KERNEL__ */
106 #define VCMD_get_nflags VC_CMD(FLAGS, 5, 0)
107 #define VCMD_set_nflags VC_CMD(FLAGS, 6, 0)
109 struct vcmd_net_flags_v0 {
115 extern int vc_get_nflags(uint32_t, void __user *);
116 extern int vc_set_nflags(uint32_t, void __user *);
118 #endif /* __KERNEL__ */
120 #define IPF_STATE_SETUP (1ULL<<32)
123 #define IPF_ONE_TIME (0x0001ULL<<32)
125 #define VCMD_get_ncaps VC_CMD(FLAGS, 7, 0)
126 #define VCMD_set_ncaps VC_CMD(FLAGS, 8, 0)
128 struct vcmd_net_caps_v0 {
134 extern int vc_get_ncaps(uint32_t, void __user *);
135 extern int vc_set_ncaps(uint32_t, void __user *);
137 #endif /* __KERNEL__ */
139 #define IPC_WOSSNAME 0x00000001
142 #endif /* _VX_NETWORK_H */