- Updates to the documentation
SKIPPED: psi/velodorn.h
This commit is contained in:
77
nconman.tex
77
nconman.tex
@ -44,7 +44,7 @@ Clients can choose to suppress certain types of messages in order to
|
||||
reduce I/O.
|
||||
|
||||
The logic is mostly implemented in the
|
||||
file static function SCNormalWrite. The follwoing conditions are
|
||||
file static function SCNormalWrite. The following conditions are
|
||||
implemented:
|
||||
\begin{itemize}
|
||||
\item Any output is logged to the
|
||||
@ -60,17 +60,17 @@ type error or warning are printed to the socket even during macro
|
||||
evaluation.
|
||||
\item In the normal case the output is printed to the socket and all
|
||||
log files configured for the connection.
|
||||
\item As of recent the output function can be modified by setting a
|
||||
new function. One sich function exists which supresses all output to
|
||||
the socket. This is done in order to help when the connection gets
|
||||
lost. For instance with the cron command.
|
||||
\end{itemize}
|
||||
This aspect of the connection object could do with a cleanup. A
|
||||
possible cleanup path is the implementation of the different output
|
||||
strategies in different functions and devise a SCsetOutMode function which
|
||||
switches between the various possibilities. Also, it can be argued if
|
||||
the client specific log files are still needed. Then this part of the
|
||||
code can be cleaned out as well.
|
||||
The above described the default. It turned out that many special cases
|
||||
exist where it is feasible to suppress parts of the output. In order
|
||||
to take care of this, SCWrite calls a configurable write
|
||||
function. This write function can be retrieved and set with
|
||||
SCGetWriteFunc and SCSetWriteFunc. SCnoSock, SConlySock, SCnotWrite
|
||||
select some predefined write functions for special cases. Please note
|
||||
that each of these calls switches the write function for the lifetime
|
||||
of the connection or until it is set to a new one through
|
||||
SCSetWriteFunc.
|
||||
|
||||
|
||||
|
||||
\subsubsection{Command Execution Path}
|
||||
@ -120,6 +120,9 @@ $\langle$condat {\footnotesize ?}$\rangle\equiv$
|
||||
\vspace{-1ex}
|
||||
\begin{list}{}{} \item
|
||||
\mbox{}\verb@@\\
|
||||
\mbox{}\verb@typedef int (*writeFunc)(struct __SConnection *pCon,@\\
|
||||
\mbox{}\verb@ char *pMessage, int iCode);@\\
|
||||
\mbox{}\verb@@\\
|
||||
\mbox{}\verb@ typedef struct __SConnection {@\\
|
||||
\mbox{}\verb@ /* object basics */@\\
|
||||
\mbox{}\verb@ pObjectDescriptor pDes;@\\
|
||||
@ -133,8 +136,7 @@ $\langle$condat {\footnotesize ?}$\rangle\equiv$
|
||||
\mbox{}\verb@ int iTelnet;@\\
|
||||
\mbox{}\verb@ int iOutput; @\\
|
||||
\mbox{}\verb@ int iFiles;@\\
|
||||
\mbox{}\verb@ int (*write)(struct __SConnection *pCon,@\\
|
||||
\mbox{}\verb@ char *pMessage, int iCode);@\\
|
||||
\mbox{}\verb@ writeFunc write;@\\
|
||||
\mbox{}\verb@ mkChannel *pDataSock;@\\
|
||||
\mbox{}\verb@ char *pDataComp;@\\
|
||||
\mbox{}\verb@ int iDataPort;@\\
|
||||
@ -146,6 +148,7 @@ $\langle$condat {\footnotesize ?}$\rangle\equiv$
|
||||
\mbox{}\verb@ int iDummy;@\\
|
||||
\mbox{}\verb@ int iGrab;@\\
|
||||
\mbox{}\verb@ int iErrCode;@\\
|
||||
\mbox{}\verb@ int parameterChange;@\\
|
||||
\mbox{}\verb@ SicsInterp *pSics;@\\
|
||||
\mbox{}\verb@ @\\
|
||||
\mbox{}\verb@ /* a FIFO */@\\
|
||||
@ -153,9 +156,15 @@ $\langle$condat {\footnotesize ?}$\rangle\equiv$
|
||||
\mbox{}\verb@@\\
|
||||
\mbox{}\verb@ /* callback registry */@\\
|
||||
\mbox{}\verb@ int iList;@\\
|
||||
\mbox{}\verb@ @\\
|
||||
\mbox{}\verb@@\\
|
||||
\mbox{}\verb@ /* Tasking Stuff */@\\
|
||||
\mbox{}\verb@ int iEnd;@\\
|
||||
\mbox{}\verb@ /* for keeping track of the login@\\
|
||||
\mbox{}\verb@ process on a non telnet connection.@\\
|
||||
\mbox{}\verb@ Should only be used in SCTaskFunction@\\
|
||||
\mbox{}\verb@ */@\\
|
||||
\mbox{}\verb@ int iLogin;@\\
|
||||
\mbox{}\verb@ time_t conStart;@\\
|
||||
\mbox{}\verb@ }SConnection;@\\
|
||||
\mbox{}\verb@@$\diamond$
|
||||
\end{list}
|
||||
@ -214,6 +223,10 @@ registered on this connection object.
|
||||
\item[iEnd] iEnd is a flag which is usually 0. It is set by certain
|
||||
interrupts or if the connection is broken and causes the connection task to
|
||||
end and the connection data structure to be removed from the system.
|
||||
\item[iLogin] A flag which is set when we are not yet logged in.
|
||||
\item[conStart] The time the connection was established. Used to
|
||||
timeout connections when no valid login comes within a decent time
|
||||
intervall.
|
||||
\end{description}
|
||||
Quite a few places in SICS refer to this data structure directly,
|
||||
without a function interface. The reason for this is performance. Therefore
|
||||
@ -247,6 +260,11 @@ $\langle$conint {\footnotesize ?}$\rangle\equiv$
|
||||
\mbox{}\verb@ int SCSendOK(SConnection *self);@\\
|
||||
\mbox{}\verb@ int SCnoSock(SConnection *pCon);@\\
|
||||
\mbox{}\verb@ int SCWriteUUencoded(SConnection *pCon, char *pName, void *iData, int iLen);@\\
|
||||
\mbox{}\verb@ int SCWriteZipped(SConnection *pCon, char *pName, void *pData, int iDataLen);@\\
|
||||
\mbox{}\verb@ writeFunc SCGetWriteFunc(SConnection *pCon);@\\
|
||||
\mbox{}\verb@ void SCSetWriteFunc(SConnection *pCon, writeFunc x);@\\
|
||||
\mbox{}\verb@ int SCOnlySockWrite(SConnection *self, char *buffer, int iOut);@\\
|
||||
\mbox{}\verb@ int SCNotWrite(SConnection *self, char *buffer, int iOut);@\\
|
||||
\mbox{}\verb@/************************* CallBack *********************************** */@\\
|
||||
\mbox{}\verb@ int SCRegister(SConnection *pCon, SicsInterp *pSics,@\\
|
||||
\mbox{}\verb@ void *pInter, long lID);@\\
|
||||
@ -254,19 +272,20 @@ $\langle$conint {\footnotesize ?}$\rangle\equiv$
|
||||
\mbox{}\verb@/******************************* Error **************************************/@\\
|
||||
\mbox{}\verb@ void SCSetInterrupt(SConnection *self, int eCode);@\\
|
||||
\mbox{}\verb@ int SCGetInterrupt(SConnection *self); @\\
|
||||
\mbox{}\verb@ void SCSetError(SConnection *pCon, int iCode);@\\
|
||||
\mbox{}\verb@ int SCGetError(SConnection *pCon); @\\
|
||||
\mbox{}\verb@/****************************** Macro ***************************************/@\\
|
||||
\mbox{}\verb@ int SCinMacro(SConnection *pCon);@\\
|
||||
\mbox{}\verb@ int SCsetMacro(SConnection *pCon, int iMode); @\\
|
||||
\mbox{}\verb@@\\
|
||||
\mbox{}\verb@/************************** parameters changed ? **************************/@\\
|
||||
\mbox{}\verb@ void SCparChange(SConnection *pCon);@\\
|
||||
\mbox{}\verb@/* *************************** Info *************************************** */@\\
|
||||
\mbox{}\verb@ int SCGetRights(SConnection *self);@\\
|
||||
\mbox{}\verb@ int SCSetRights(SConnection *pCon, int iNew);@\\
|
||||
\mbox{}\verb@ int SCMatchRights(SConnection *pCon, int iCode);@\\
|
||||
\mbox{}\verb@ int SCGetOutClass(SConnection *self);@\\
|
||||
\mbox{}\verb@ int SCGetGrab(SConnection *pCon);@\\
|
||||
\mbox{}\verb@@\\
|
||||
\mbox{}\verb@/********************* simulation mode ************************************/@\\
|
||||
\mbox{}\verb@ void SCSetSimMode(SConnection *pCon, int value);@\\
|
||||
\mbox{}\verb@ int SCinSimMode(SConnection *pCon);@\\
|
||||
\mbox{}\verb@/* **************************** Invocation ******************************** */@\\
|
||||
\mbox{}\verb@ int SCInvoke(SConnection *self,SicsInterp *pInter,char *pCommand);@\\
|
||||
\mbox{}\verb@ @\\
|
||||
@ -318,6 +337,20 @@ timeout period. pPrompt is the prompt for the client, pResult is the buffer
|
||||
with the client reply. Maximum iLen bytes will be copied to
|
||||
pResult. Returns true (1) on a successfull read, else 0 (false).
|
||||
\item[SCSendOK] A short cut which sends OK to the client.
|
||||
\item[SCnoSock] Suppress output onto the client socket but keeps on
|
||||
logging output to file. This is mostly used when the socket connection
|
||||
closes with a batch file still being active.
|
||||
\item[SCWriteUUencoded] sends iData in UU encoded form. For
|
||||
communication with status clients.
|
||||
\item[SCWriteZipped] writes pData in zipped form. Works only if the
|
||||
connection is a plain connection, no telnet mode. This first sends a
|
||||
line: SICSBIN ZIP dataname datalength followed by datalength bytes of
|
||||
zipped data after the newline. Used for transferring larger amounts of
|
||||
data to status clients.
|
||||
\item[SCGetWriteFunc] gets the currently active write function.
|
||||
\item[SCSetWriteFunc] sets a new write function.
|
||||
\item[SCOnlySockWrite] write only to socket, not to log files.
|
||||
\item[SCNotWrite] do not write at all.
|
||||
\item[SCRegister] registers a callback with the connection. Parameters are:
|
||||
The interpreter to use, the interface with which the callback was
|
||||
registered and the ID of the callback. All automatic notifications to a
|
||||
@ -329,11 +362,11 @@ happen.
|
||||
\item[SCSetInterrupt] sets an interrupt on the connection.
|
||||
\item[SCGetInterrupt] retrives the current interrupt status of the
|
||||
connection.
|
||||
\item[SCSetError] sets an error code in the connection.
|
||||
\item[SCGetError] retreives the current error code on the connection.
|
||||
\item[SCinMacro] returns true if the connection is executing a tcl script,
|
||||
returns false otherwise.
|
||||
\item[SCsetMacro] sets the iMacro flag.
|
||||
\item[SCparChange] sets the flag that a parameter was changed and the
|
||||
status file needs to be rewritten.
|
||||
\item[SCGetRights] returns the current user rights associated with the
|
||||
connection.
|
||||
\item[SCGetGrab] gets the status of the control token for this connection.
|
||||
@ -344,6 +377,8 @@ connection has the control token.
|
||||
rights of the connection, 0 (false) otherwise. SCMatchRights also checks for
|
||||
the status of the control token. Suitable error messages are written to pCon
|
||||
if the user rights do not match.
|
||||
\item[SCSetSimMode] sets this connection into simulation mode.
|
||||
\item[SCinSimMode] checks for the simulation mode flag.
|
||||
\item[SCInvoke] invokes pCommand in the SICS interpreter pSics for the
|
||||
connection pCon. This function also prints the executed command into
|
||||
logfiles and into the commandlog.
|
||||
@ -366,6 +401,8 @@ logfiles and into the commandlog.
|
||||
\mbox{}\verb@@\\
|
||||
\mbox{}\verb@ Mark Koennecke, September 1997@\\
|
||||
\mbox{}\verb@@\\
|
||||
\mbox{}\verb@ Mark Koennecke, Aprl 2003@\\
|
||||
\mbox{}\verb@@\\
|
||||
\mbox{}\verb@ copyright: see copyright.h@\\
|
||||
\mbox{}\verb@----------------------------------------------------------------------------*/@\\
|
||||
\mbox{}\verb@#ifndef SICSCONNECT@\\
|
||||
|
Reference in New Issue
Block a user