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 #define NXF_STATE_SETUP (1ULL<<32)
18 #define NXF_STATE_HELPER (1ULL<<36)
20 #define NXF_INIT_SET (0)
25 #include <linux/list.h>
26 #include <linux/spinlock.h>
27 #include <linux/rcupdate.h>
28 #include <asm/atomic.h>
32 struct hlist_node nx_hlist; /* linked list of nxinfos */
33 nid_t nx_id; /* vnet id */
34 atomic_t nx_usecnt; /* usage count */
35 atomic_t nx_tasks; /* tasks count */
36 int nx_state; /* context state */
38 uint64_t nx_flags; /* network flag word */
39 uint64_t nx_ncaps; /* network capabilities */
42 __u32 ipv4[NB_IPV4ROOT]; /* Process can only bind to these IPs */
43 /* The first one is used to connect */
44 /* and for bind any service */
45 /* The other must be used explicity */
46 __u32 mask[NB_IPV4ROOT]; /* Netmask for each ipv4 */
47 /* Used to select the proper source */
48 /* address for sockets */
49 __u32 v4_bcast; /* Broadcast address to receive UDP */
51 char nx_name[65]; /* network context name */
57 #define NXS_HASHED 0x0001
58 #define NXS_SHUTDOWN 0x0100
59 #define NXS_RELEASED 0x8000
61 extern struct nx_info *locate_nx_info(int);
62 extern struct nx_info *locate_or_create_nx_info(int);
64 extern int get_nid_list(int, unsigned int *, int);
65 extern int nid_is_hashed(nid_t);
67 extern int nx_migrate_task(struct task_struct *, struct nx_info *);
69 extern long vs_net_change(struct nx_info *, unsigned int);
74 int ifa_in_nx_info(struct in_ifaddr *, struct nx_info *);
75 int dev_in_nx_info(struct net_device *, struct nx_info *);
79 int nx_addr_conflict(struct nx_info *, uint32_t, struct sock *);
81 #endif /* __KERNEL__ */
82 #else /* _VX_NETWORK_H */
83 #warning duplicate inclusion
84 #endif /* _VX_NETWORK_H */