X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Flinux%2Fvserver%2Fnetwork.h;h=77f6a8d413a87bf6d97bb355414e597835deb853;hb=refs%2Fheads%2Fvserver;hp=29c5bd2fee3daf7b19a9bf88c6a6881a270015fb;hpb=f7f1b0f1e2fbadeab12d24236000e778aa9b1ead;p=linux-2.6.git diff --git a/include/linux/vserver/network.h b/include/linux/vserver/network.h index 29c5bd2fe..77f6a8d41 100644 --- a/include/linux/vserver/network.h +++ b/include/linux/vserver/network.h @@ -13,23 +13,27 @@ /* network flags */ +#define NXF_INFO_PRIVATE 0x00000008 + #define NXF_STATE_SETUP (1ULL<<32) +#define NXF_STATE_ADMIN (1ULL<<34) -#define NXF_STATE_HELPER (1ULL<<36) +#define NXF_SC_HELPER (1ULL<<36) +#define NXF_PERSISTENT (1ULL<<38) -#define NXF_ONE_TIME (0x0001ULL<<32) +#define NXF_ONE_TIME (0x0005ULL<<32) -#define NXF_INIT_SET (0) +#define NXF_INIT_SET (NXF_STATE_ADMIN) /* address types */ -#define NXA_TYPE_IPV4 1 -#define NXA_TYPE_IPV6 2 +#define NXA_TYPE_IPV4 1 +#define NXA_TYPE_IPV6 2 -#define NXA_MOD_BCAST (1<<8) +#define NXA_MOD_BCAST (1<<8) -#define NXA_TYPE_ANY (~0) +#define NXA_TYPE_ANY ((uint16_t)-1) #ifdef __KERNEL__ @@ -70,8 +74,27 @@ struct nx_info { #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); +/* check conditions */ + +#define NX_ADMIN 0x0001 +#define NX_WATCH 0x0002 +#define NX_BLEND 0x0004 +#define NX_HOSTID 0x0008 + +#define NX_IDENT 0x0010 +#define NX_EQUIV 0x0020 +#define NX_PARENT 0x0040 +#define NX_CHILD 0x0080 + +#define NX_ARG_MASK 0x00F0 + +#define NX_DYNAMIC 0x0100 +#define NX_STATIC 0x0200 + +#define NX_ATR_MASK 0x0F00 + + +extern struct nx_info *lookup_nx_info(int); extern int get_nid_list(int, unsigned int *, int); extern int nid_is_hashed(nid_t); @@ -83,12 +106,35 @@ extern long vs_net_change(struct nx_info *, unsigned int); struct in_ifaddr; struct net_device; +#ifdef CONFIG_INET int ifa_in_nx_info(struct in_ifaddr *, struct nx_info *); int dev_in_nx_info(struct net_device *, struct nx_info *); +#else /* CONFIG_INET */ +static inline +int ifa_in_nx_info(struct in_ifaddr *a, struct nx_info *n) +{ + return 1; +} + +static inline +int dev_in_nx_info(struct net_device *d, struct nx_info *n) +{ + return 1; +} +#endif /* CONFIG_INET */ + struct sock; -int nx_addr_conflict(struct nx_info *, uint32_t, struct sock *); +#ifdef CONFIG_INET +int nx_addr_conflict(struct nx_info *, uint32_t, const struct sock *); +#else /* CONFIG_INET */ +static inline +int nx_addr_conflict(struct nx_info *n, uint32_t a, const struct sock *s) +{ + return 1; +} +#endif /* CONFIG_INET */ #endif /* __KERNEL__ */ #else /* _VX_NETWORK_H */