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_INFO_PRIVATE 0x00000008
18 #define NXF_STATE_SETUP (1ULL<<32)
20 #define NXF_SC_HELPER (1ULL<<36)
21 #define NXF_PERSISTENT (1ULL<<38)
23 #define NXF_ONE_TIME (0x0001ULL<<32)
25 #define NXF_INIT_SET (0)
30 #define NXA_TYPE_IPV4 1
31 #define NXA_TYPE_IPV6 2
33 #define NXA_MOD_BCAST (1<<8)
35 #define NXA_TYPE_ANY ((uint16_t)-1)
40 #include <linux/list.h>
41 #include <linux/spinlock.h>
42 #include <linux/rcupdate.h>
43 #include <asm/atomic.h>
47 struct hlist_node nx_hlist; /* linked list of nxinfos */
48 nid_t nx_id; /* vnet id */
49 atomic_t nx_usecnt; /* usage count */
50 atomic_t nx_tasks; /* tasks count */
51 int nx_state; /* context state */
53 uint64_t nx_flags; /* network flag word */
54 uint64_t nx_ncaps; /* network capabilities */
57 __u32 ipv4[NB_IPV4ROOT]; /* Process can only bind to these IPs */
58 /* The first one is used to connect */
59 /* and for bind any service */
60 /* The other must be used explicity */
61 __u32 mask[NB_IPV4ROOT]; /* Netmask for each ipv4 */
62 /* Used to select the proper source */
63 /* address for sockets */
64 __u32 v4_bcast; /* Broadcast address to receive UDP */
66 char nx_name[65]; /* network context name */
72 #define NXS_HASHED 0x0001
73 #define NXS_SHUTDOWN 0x0100
74 #define NXS_RELEASED 0x8000
76 extern struct nx_info *lookup_nx_info(int);
78 extern int get_nid_list(int, unsigned int *, int);
79 extern int nid_is_hashed(nid_t);
81 extern int nx_migrate_task(struct task_struct *, struct nx_info *);
83 extern long vs_net_change(struct nx_info *, unsigned int);
89 int ifa_in_nx_info(struct in_ifaddr *, struct nx_info *);
90 int dev_in_nx_info(struct net_device *, struct nx_info *);
92 #else /* CONFIG_INET */
94 int ifa_in_nx_info(struct in_ifaddr *a, struct nx_info *n)
100 int dev_in_nx_info(struct net_device *d, struct nx_info *n)
104 #endif /* CONFIG_INET */
109 int nx_addr_conflict(struct nx_info *, uint32_t, struct sock *);
110 #else /* CONFIG_INET */
112 int nx_addr_conflict(struct nx_info *n, uint32_t a, struct sock *s)
116 #endif /* CONFIG_INET */
118 #endif /* __KERNEL__ */
119 #else /* _VX_NETWORK_H */
120 #warning duplicate inclusion
121 #endif /* _VX_NETWORK_H */