added $(src_legacy_*)
[util-vserver.git] / util-vserver / lib / vserver.h
index 1056494..f3ad36e 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 VC_IATTR_ADMIN                 0x00000001
 #define VC_IATTR_WATCH                 0x00000002
 #define VC_IATTR_HIDE                  0x00000004
+#define VC_IATTR_FLAGS                 0x00000007
 
 #define VC_IATTR_BARRIER               0x00010000
 #define        VC_IATTR_IUNLINK                0x00020000
-
+#define VC_IATTR_IMMUTABLE             0x00040000
 
 #ifdef __cplusplus
 extern "C" {
@@ -137,11 +138,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;
@@ -190,7 +193,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);
@@ -220,7 +232,24 @@ extern "C" {
     if (vc_get_iattr(filename, &res, 0,0)==-1) return VC_NOCTX;
     return res;
   }
+
+
+  struct vc_set_sched {
+      int32_t  fill_rate;
+      int32_t  period;
+      int32_t  fill_level;
+      int32_t  bucket_size;
+  };
+
+  int          vc_set_sched(xid_t xid, struct vc_set_sched const *);
+  
   
+  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 */