4 #include <linux/types.h>
7 #define MAX_N_CONTEXT 65535 /* Arbitrary limit */
9 #define NX_DYNAMIC_ID ((uint32_t)-1) /* id for dynamic context */
11 #define NB_IPV4ROOT 16
16 #include <linux/list.h>
17 #include <linux/spinlock.h>
18 #include <linux/rcupdate.h>
19 #include <asm/atomic.h>
23 struct hlist_node nx_hlist; /* linked list of nxinfos */
24 struct rcu_head nx_rcu; /* the rcu head */
25 nid_t nx_id; /* vnet id */
26 atomic_t nx_usecnt; /* usage count */
27 atomic_t nx_refcnt; /* reference count */
29 uint64_t nx_flags; /* network flag word */
30 uint64_t nx_ncaps; /* network capabilities */
33 __u32 ipv4[NB_IPV4ROOT]; /* Process can only bind to these IPs */
34 /* The first one is used to connect */
35 /* and for bind any service */
36 /* The other must be used explicity */
37 __u32 mask[NB_IPV4ROOT]; /* Netmask for each ipv4 */
38 /* Used to select the proper source */
39 /* address for sockets */
40 __u32 v4_bcast; /* Broadcast address to receive UDP */
42 char nx_name[65]; /* network context name */
48 extern void unhash_nx_info(struct nx_info *);
50 extern struct nx_info *locate_nx_info(int);
51 extern struct nx_info *locate_or_create_nx_info(int);
53 extern int get_nid_list(int, unsigned int *, int);
54 extern int nid_is_hashed(nid_t);
56 extern int nx_migrate_task(struct task_struct *, struct nx_info *);
61 int ifa_in_nx_info(struct in_ifaddr *, struct nx_info *);
62 int dev_in_nx_info(struct net_device *, struct nx_info *);
66 int nx_addr_conflict(struct nx_info *, uint32_t, struct sock *);
68 #endif /* __KERNEL__ */
69 #else /* _VX_NETWORK_H */
70 #warning duplicate inclusion
71 #endif /* _VX_NETWORK_H */