Merge to Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.13-vs2...
[linux-2.6.git] / include / linux / vserver / network.h
index 591ec21..0e0253b 100644 (file)
 #define NB_IPV4ROOT    16
 
 
+/* network flags */
+
+#define NXF_STATE_SETUP                (1ULL<<32)
+
+#define NXF_SC_HELPER          (1ULL<<36)
+#define NXF_PERSISTENT         (1ULL<<38)
+
+#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 NXA_TYPE_ANY           ((uint16_t)-1)
+
+
 #ifdef __KERNEL__
 
 #include <linux/list.h>
 
 struct nx_info {
        struct hlist_node nx_hlist;     /* linked list of nxinfos */
-       struct rcu_head nx_rcu;         /* the rcu head */
        nid_t nx_id;                    /* vnet id */
        atomic_t nx_usecnt;             /* usage count */
-       atomic_t nx_refcnt;             /* reference count */
+       atomic_t nx_tasks;              /* tasks count */
+       int nx_state;                   /* context state */
 
        uint64_t nx_flags;              /* network flag word */
        uint64_t nx_ncaps;              /* network capabilities */
@@ -43,27 +65,53 @@ struct nx_info {
 };
 
 
-struct rcu_head;
+/* status flags */
 
-extern void unhash_nx_info(struct nx_info *);
+#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 struct nx_info *lookup_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 *);
 
+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;
 
+#ifdef CONFIG_INET
 int nx_addr_conflict(struct nx_info *, uint32_t, struct sock *);
+#else /* CONFIG_INET */
+static inline
+int nx_addr_conflict(struct nx_info *n, uint32_t a, struct sock *s)
+{
+       return 1;
+}
+#endif /* CONFIG_INET */
 
 #endif /* __KERNEL__ */
 #else  /* _VX_NETWORK_H */