added URL which describes context-creation
[util-vserver.git] / util-vserver / lib / vserver.h
index d45dc9d..2d19794 100644 (file)
@@ -22,6 +22,7 @@
 
 #include <stdint.h>
 #include <stdlib.h>
+#include <stdbool.h>
 #include <sys/types.h>
 
 /** the value which is returned in error-case (no ctx found) */
@@ -112,7 +113,8 @@ extern "C" {
      *  Special values for ctx are
      *  - VC_SAMECTX  which means the current context (just for changing caps and flags)
      *  - VC_RANDCTX  which means the next free context; this value can be used by
-     *                ordinary users also */
+     *                ordinary users also
+     *  See http://vserver.13thfloor.at/Stuff/Logic.txt for details */
   int  vc_new_s_context(xid_t ctx, unsigned int remove_cap, unsigned int flags);
 
     /** Sets the ipv4root information.
@@ -175,9 +177,15 @@ extern "C" {
 
   char *       vc_getVserverVdir(char const *id, vcCfgStyle style);
 
-  /** Returns the ctx of the given vserver, or VC_NOCTX if vserver is not
-   *  running */
-  xid_t                vc_getVserverCtx(char const *id, vcCfgStyle style);
+  /** Returns the ctx of the given vserver. When vserver is not running and
+   *  'honor_static' is false, VC_NOCTX will be returned. Else, when
+   *  'honor_static' is true and a static assignment exists, those value will
+   *  be returned. Else, the result will be VC_NOCTX.
+   *
+   *  When 'is_running' is not null, the status of the vserver will be
+   *  assigned to this variable. */
+  xid_t                vc_getVserverCtx(char const *id, vcCfgStyle style,
+                                bool honor_static, bool /*@null@*/ *is_running);
 
   /** Resolves the cfg-path of the vserver owning the given ctx. 'revdir' will
       be used as the directory holding the mapping-links; when NULL, the