111
119
void log(level, /* log level */
120
longstring, /* subchannel or "" */
112
121
longstring /* log message */
114
123
/* This is a special procedure: The controller does not send a
115
124
* response for performance reasons.
127
longstring call_plugin(_int64 hyper, /* plugin ID */
128
longstring, /* proc name */
129
longstring /* proc argument */
131
/* Proc argument and return value are XDR-encoded according to the
135
void register_container_socket(longstring, /* service name */
136
longstring, /* proto name */
137
longstring /* socket path */
139
/* Registers this socket under the passed service and protocol names.
140
It is automatically unregistered when the container finishes.
143
internal_ports lookup_container_sockets(longstring,
145
/* Returns all container sockets for these service and protocol
146
names. The list may be empty if there is no such socket.
149
longstring activate_lever(int, longstring) = 7;
150
/* Activates the already registered lever. The int is the ID.
151
The string argument is the marshalled argument exception.
152
The return value is the marshalled result exception.
295
void ping (void) = 0;
297
_int64 hyper increment(longstring) = 1; /* semaphore name */
298
/* Increments the semaphore by 1, and returns the new semaphore
299
value. If the semaphore does not exist, it is created with an
300
initial value of 0, and 1 is returned.
303
_int64 hyper decrement(longstring, bool) = 3;
304
/* Decrements the semaphore by 1, and returns the new value.
305
A semaphore value cannot become negative. If the value is already
306
0, the semaphore is not decremented, but -1 is returned.
307
If the semaphore does not exist,
308
it is created with an initial value of 0, and -1 is returned.
310
If the bool arg is true, and the semaphore is already 0, it is
311
first waited until it is incremented again.
314
_int64 hyper get(longstring) = 4;
315
/* Returns the value of the semaphore. If the semaphore does not
316
exist a value of 0 is returned instead.
319
bool create(longstring, _int64 hyper, bool) = 5;
320
/* Create the semaphore if it does not exist. The second arg is the
321
initial value. Returns whether the semaphore has been created
322
(true), or the semaphore already existed (false).
324
The bool arg says whether the semaphore is protected.
325
When the container finishes (or even crashes), the protected
326
semaphore is decremented by the number pi-d, where pi is
327
the number of increments the container has requested,
328
and d the number of decrements the container has requested.
330
It is not possible to change the style of semaphores from
331
non-protected to protected or back after creation.
332
Implicitly created semaphores are always protected.
335
void destroy(longstring) = 6;
336
/* Destroys this semaphore. Any waiting [decrement] operation gets
337
immediately (-1) as return value.
346
SHVAR_OK = 0, /* success */
347
SHVAR_BADTYPE = 1, /* bad type */
348
SHVAR_NOTFOUND = 2, /* variable does not exist */
349
SHVAR_EXISTS = 3, /* variable exists */
350
SHVAR_NOPERM = 4 /* no permission */
353
union shvar_code switch(shvar_enum d) {
358
union shvar_get switch(shvar_enum d) {
372
shvar_code create_var(longstring, bool, bool, longstring) = 1;
373
/* create_var(var_name, own_flag, ro_flag, ty): Creates the variable
376
as value. It is an error if the variable has already been created.
377
Returns whether the function is successful (i.e. the variable
378
did not exist before).
380
own_flag: if true, the created variable is owned by the calling
382
Only the caller can delete it, and when the last component of
383
the socket service terminates, the variable is automatically
386
ro_flag: if true, only the owner can set the value
388
ty: the type identifier ("string", or "exn")
391
shvar_code set_value(longstring, longstring, longstring) = 2;
392
/* set_value(var_name, var_value, ty): Sets the variable var_name to
393
var_value. This is only possible when the variable exists,
394
and has the right type.
395
Returns whether the function is successful (i.e. the variable
399
shvar_get get_value(longstring, longstring) = 3;
400
/* get_value(var_name, ty): Returns the value of the existing variable,
401
or an error if the variable does not exist.
404
shvar_code delete_var(longstring) = 4;
405
/* delete_var(var_name): Deletes the variable. This is only possible
406
when the variable exists. Returns whether the function is
407
successful (i.e. the variable existed).
410
shvar_get wait_for_value(longstring, longstring) = 5;
411
/* wait_for_value(var_name,ty): If the variable exists and
412
set_value has already been called, the current value is
413
simply returned. If the variable exists, but set_value has
414
not yet been called, the function waits until set_value is
415
called, and returns the value set then. If the variable
416
does not exist, the function immediately returns NULL.
419
void dump(longstring, longstring) = 6;
420
/* dump(var_name, log_level): Dump the access counter of this
421
variable (or all variables if var_name="*"). log_level is
422
the stringified log level