% $Id: implementation.nw 2555 2012-08-29 13:16:38Z jkoshy $ % % The implementation itself. \part{The Implementation}\label{part.implementation} \chapter{Overview}\label{chap.overview} \chapter{Protocol}\label{chap.protocol} From the despatcher to the slave. \begin{itemize} \item \protodef{BYE}{\protoarg{nbytes}} Terminate the session. A human readable message providing the reason for termination follows. \item \protodef{CLOSE}{\protoarg{token} \protoarg{childfd}} Close a file descriptor for a running script. \item \protodef{CWD}{\protoarg{childfd}} Set the current directory for new scripts. \item \protodef{ENV}{\protoarg{nbytes}} Store a default environment for use with subsequent \protodef{SCRIPT} commands. \item \protodef{ERROR}{\protoarg{severity} \protoarg{nbytes}} Receive an error message sent from the despatcher. \item \protodef{SCRIPT}{\protoarg{token} \protoarg{uid} \protoarg{gid} \protoarg{nbytes} \protoarg{fd}\ldots} Execute a script with the given privileges, while monitoring the specified file descriptors. \item \protodef{SIGNAL}{\protoarg{token} \protoarg{signal}} Send a signal to an executing script. \item \protodef{STATUS}{\protoarg{token}} Retrieve the status of a previously issued \protocmd{SCRIPT} command. \item \protodef{SYSINFO}{} Return system information. \item \protodef{WRITE}{\protoarg{token} \protoarg{fd} \protoarg{nbytes}} Write to an executing script on the specified file descriptor. \end{itemize} From the slave to the despatcher: \begin{itemize} \item \protodef{CLOSE}{\protoarg{token} \protoarg{fd}} Report the closing of a file descriptor by a script. \item \protodef{DATA}{\protoarg{token} \protoarg{fd} \protoarg{nbytes}} Read data generated by a script. \item \protodef{ERROR}{\protoarg{args}\ldots} Report an error. \item \protodef{EXIT}{\protoarg{token} \protoarg{exittype} \protoarg{code}} Report a script exit. \item \protodef{HELLO}{\protoarg{identifier} \protoarg{version}} Announce presence to the despatcher. \item \protodef{OK}{\protoarg{args}\ldots} Acknowledge successful execution of a command. \item \protodef{SYSINFO}{\protoarg{nbytes}} Return system information. \end{itemize}