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_SC_HELPER (1ULL<<36)
19 #define NXF_PERSISTENT (1ULL<<38)
21 #define NXF_ONE_TIME (0x0001ULL<<32)
23 #define NXF_INIT_SET (0)
28 #define NXA_TYPE_IPV4 1
29 #define NXA_TYPE_IPV6 2
31 #define NXA_MOD_BCAST (1<<8)
33 #define NXA_TYPE_ANY ((uint16_t)-1)
38 #include <linux/list.h>
39 #include <linux/spinlock.h>
40 #include <linux/rcupdate.h>
41 #include <asm/atomic.h>
45 struct hlist_node nx_hlist; /* linked list of nxinfos */
46 nid_t nx_id; /* vnet id */
47 atomic_t nx_usecnt; /* usage count */
48 atomic_t nx_tasks; /* tasks count */
49 int nx_state; /* context state */
51 uint64_t nx_flags; /* network flag word */
52 uint64_t nx_ncaps; /* network capabilities */
55 __u32 ipv4[NB_IPV4ROOT]; /* Process can only bind to these IPs */
56 /* The first one is used to connect */
57 /* and for bind any service */
58 /* The other must be used explicity */
59 __u32 mask[NB_IPV4ROOT]; /* Netmask for each ipv4 */
60 /* Used to select the proper source */
61 /* address for sockets */
62 __u32 v4_bcast; /* Broadcast address to receive UDP */
64 char nx_name[65]; /* network context name */
70 #define NXS_HASHED 0x0001
71 #define NXS_SHUTDOWN 0x0100
72 #define NXS_RELEASED 0x8000
74 extern struct nx_info *lookup_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);
87 int ifa_in_nx_info(struct in_ifaddr *, struct nx_info *);
88 int dev_in_nx_info(struct net_device *, struct nx_info *);
90 #else /* CONFIG_INET */
92 int ifa_in_nx_info(struct in_ifaddr *a, struct nx_info *n)
98 int dev_in_nx_info(struct net_device *d, struct nx_info *n)
102 #endif /* CONFIG_INET */
107 int nx_addr_conflict(struct nx_info *, uint32_t, struct sock *);
108 #else /* CONFIG_INET */
110 int nx_addr_conflict(struct nx_info *n, uint32_t a, struct sock *s)
114 #endif /* CONFIG_INET */
116 #endif /* __KERNEL__ */
117 #else /* _VX_NETWORK_H */
118 #warning duplicate inclusion
119 #endif /* _VX_NETWORK_H */