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_ONE_TIME (0x0001ULL<<32)
22 #define NXF_INIT_SET (0)
27 #define NXA_TYPE_IPV4 1
28 #define NXA_TYPE_IPV6 2
30 #define NXA_MOD_BCAST (1<<8)
32 #define NXA_TYPE_ANY (~0)
37 #include <linux/list.h>
38 #include <linux/spinlock.h>
39 #include <linux/rcupdate.h>
40 #include <asm/atomic.h>
44 struct hlist_node nx_hlist; /* linked list of nxinfos */
45 nid_t nx_id; /* vnet id */
46 atomic_t nx_usecnt; /* usage count */
47 atomic_t nx_tasks; /* tasks count */
48 int nx_state; /* context state */
50 uint64_t nx_flags; /* network flag word */
51 uint64_t nx_ncaps; /* network capabilities */
54 __u32 ipv4[NB_IPV4ROOT]; /* Process can only bind to these IPs */
55 /* The first one is used to connect */
56 /* and for bind any service */
57 /* The other must be used explicity */
58 __u32 mask[NB_IPV4ROOT]; /* Netmask for each ipv4 */
59 /* Used to select the proper source */
60 /* address for sockets */
61 __u32 v4_bcast; /* Broadcast address to receive UDP */
63 char nx_name[65]; /* network context name */
69 #define NXS_HASHED 0x0001
70 #define NXS_SHUTDOWN 0x0100
71 #define NXS_RELEASED 0x8000
73 extern struct nx_info *locate_nx_info(int);
74 extern struct nx_info *locate_or_create_nx_info(int);
76 extern int get_nid_list(int, unsigned int *, int);
77 extern int nid_is_hashed(nid_t);
79 extern int nx_migrate_task(struct task_struct *, struct nx_info *);
81 extern long vs_net_change(struct nx_info *, unsigned int);
86 int ifa_in_nx_info(struct in_ifaddr *, struct nx_info *);
87 int dev_in_nx_info(struct net_device *, struct nx_info *);
91 int nx_addr_conflict(struct nx_info *, uint32_t, struct sock *);
93 #endif /* __KERNEL__ */
94 #else /* _VX_NETWORK_H */
95 #warning duplicate inclusion
96 #endif /* _VX_NETWORK_H */