X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=kernel%2Fnetwork.h;h=e6d77840018ff335d8c81f7d4133b7e5e0a1f384;hb=95e2774070e989fe9cf9f48dae5fa054e55e2a3e;hp=29c5bd2fee3daf7b19a9bf88c6a6881a270015fb;hpb=3f3cf95f755f3ef1c31ad8e38153deb4ee214c66;p=util-vserver.git diff --git a/kernel/network.h b/kernel/network.h index 29c5bd2..e6d7784 100644 --- a/kernel/network.h +++ b/kernel/network.h @@ -6,91 +6,45 @@ #define MAX_N_CONTEXT 65535 /* Arbitrary limit */ -#define NX_DYNAMIC_ID ((uint32_t)-1) /* id for dynamic context */ - #define NB_IPV4ROOT 16 /* network flags */ -#define NXF_STATE_SETUP (1ULL<<32) - -#define NXF_STATE_HELPER (1ULL<<36) - -#define NXF_ONE_TIME (0x0001ULL<<32) - -#define NXF_INIT_SET (0) - - -/* address types */ - -#define NXA_TYPE_IPV4 1 -#define NXA_TYPE_IPV6 2 - -#define NXA_MOD_BCAST (1<<8) +#define NXF_INFO_PRIVATE 0x00000008 -#define NXA_TYPE_ANY (~0) +#define NXF_SINGLE_IP 0x00000100 +#define NXF_HIDE_NETIF 0x02000000 -#ifdef __KERNEL__ +#define NXF_STATE_SETUP (1ULL << 32) +#define NXF_STATE_ADMIN (1ULL << 34) -#include -#include -#include -#include +#define NXF_SC_HELPER (1ULL << 36) +#define NXF_PERSISTENT (1ULL << 38) +#define NXF_ONE_TIME (0x0005ULL << 32) -struct nx_info { - struct hlist_node nx_hlist; /* linked list of nxinfos */ - nid_t nx_id; /* vnet id */ - atomic_t nx_usecnt; /* usage count */ - atomic_t nx_tasks; /* tasks count */ - int nx_state; /* context state */ +#define NXF_INIT_SET (NXF_STATE_ADMIN) - uint64_t nx_flags; /* network flag word */ - uint64_t nx_ncaps; /* network capabilities */ - int nbipv4; - __u32 ipv4[NB_IPV4ROOT]; /* Process can only bind to these IPs */ - /* The first one is used to connect */ - /* and for bind any service */ - /* The other must be used explicity */ - __u32 mask[NB_IPV4ROOT]; /* Netmask for each ipv4 */ - /* Used to select the proper source */ - /* address for sockets */ - __u32 v4_bcast; /* Broadcast address to receive UDP */ - - char nx_name[65]; /* network context name */ -}; - - -/* status flags */ - -#define NXS_HASHED 0x0001 -#define NXS_SHUTDOWN 0x0100 -#define NXS_RELEASED 0x8000 - -extern struct nx_info *locate_nx_info(int); -extern struct nx_info *locate_or_create_nx_info(int); - -extern int get_nid_list(int, unsigned int *, int); -extern int nid_is_hashed(nid_t); - -extern int nx_migrate_task(struct task_struct *, struct nx_info *); +/* address types */ -extern long vs_net_change(struct nx_info *, unsigned int); +#define NXA_TYPE_IPV4 0x0001 +#define NXA_TYPE_IPV6 0x0002 -struct in_ifaddr; -struct net_device; +#define NXA_TYPE_NONE 0x0000 +#define NXA_TYPE_ANY 0x00FF +#define NXA_MOD_ALL (1<<9) -int ifa_in_nx_info(struct in_ifaddr *, struct nx_info *); -int dev_in_nx_info(struct net_device *, struct nx_info *); +#define NXA_TYPE_ADDR 0x0003 +#define NXA_TYPE_MASK 0x0013 +#define NXA_TYPE_RANGE 0x0023 -struct sock; +#define NXA_MOD_BCAST 0x0100 +#define NXA_MOD_LBACK 0x0200 -int nx_addr_conflict(struct nx_info *, uint32_t, struct sock *); -#endif /* __KERNEL__ */ #else /* _VX_NETWORK_H */ #warning duplicate inclusion #endif /* _VX_NETWORK_H */