added vc_isSupported()
[util-vserver.git] / util-vserver / lib / vserver.h
index c6eb0f1..0d5e293 100644 (file)
@@ -28,7 +28,7 @@
 /** the value which is returned in error-case (no ctx found) */
 #define VC_NOCTX               ((xid_t)(-1))
 /** the value which means a random (the next free) ctx */
-#define VC_RANDCTX             ((xid_t)(-1))
+#define VC_DYNAMIC_XID         ((xid_t)(-1))
 /** the value which means the current ctx */
 #define VC_SAMECTX             ((xid_t)(-2))
 
 #  define S_CTX_INFO_ULIMIT    64
 #endif
 
+#ifndef S_CTX_INFO_NAMESPACE
+#  define S_CTX_INFO_NAMESPACE 128
+#endif
+
 #define VC_CAP_CHOWN                    0
 #define VC_CAP_DAC_OVERRIDE             1
 #define VC_CAP_DAC_READ_SEARCH          2
@@ -133,11 +137,13 @@ extern "C" {
     /** Sets the ipv4root information.
      *  \precondition: nb<16 */
   int  vc_set_ipv4root(uint32_t  bcast, size_t nb, struct vc_ip_mask_pair const *ips);
+
+  xid_t        vc_create_context(xid_t xid);
+  int  vc_migrate_context(xid_t xid);
   
   /* rlimit related functions */
   typedef uint64_t     vc_limit_t;
-  
-  
   struct vc_rlimit {
       vc_limit_t min;
       vc_limit_t soft;
@@ -186,7 +192,16 @@ extern "C" {
 
 
   int          vc_enter_namespace(xid_t xid);
-  
+  int          vc_set_namespace();
+  int          vc_cleanup_namespace();
+
+  struct  vc_ctx_flags {
+      uint64_t flagword;
+      uint64_t mask;
+  };
+
+  int          vc_get_flags(xid_t xid, struct vc_ctx_flags *);
+  int          vc_set_flags(xid_t xid, struct vc_ctx_flags const *);
 
   uint32_t     vc_textlist2flag(char const *, size_t len,
                                 char const **err_ptr, size_t *err_len);
@@ -216,7 +231,14 @@ extern "C" {
     if (vc_get_iattr(filename, &res, 0,0)==-1) return VC_NOCTX;
     return res;
   }
-  
+
+
+  typedef enum { vcFEATURE_VKILL,  vcFEATURE_IATTR,   vcFEATURE_RLIMIT,
+                vcFEATURE_COMPAT, vcFEATURE_MIGRATE, vcFEATURE_NAMESPACE,
+                vcFEATURE_SCHED,  vcFEATURE_VINFO,   vcFEATURE_VHI }
+    vcFeatureSet;
+
+  bool         vc_isSupported(vcFeatureSet);
   
   /* The management part */