X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=util-vserver%2Flib%2Fvserver.h;h=0d5e2935e6ed4e1f3d0924648559571a6e2885eb;hb=de7c77f60f210a6b06d98ad044cb6f8adb6e8732;hp=f3080c39897c4d4e1837c2c6108e0cb6038555c0;hpb=8f22352c76cef3063f5b7fc95c2b7beb38236b07;p=util-vserver.git diff --git a/util-vserver/lib/vserver.h b/util-vserver/lib/vserver.h index f3080c3..0d5e293 100644 --- a/util-vserver/lib/vserver.h +++ b/util-vserver/lib/vserver.h @@ -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)) @@ -64,6 +64,10 @@ # 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; @@ -185,6 +191,18 @@ extern "C" { int vc_get_vhi_name(xid_t xid, vc_uts_type type, char *val, size_t len); + 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); uint32_t vc_text2flag(char const *, size_t len); @@ -213,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 */