- Updates to the documentation
SKIPPED: psi/velodorn.h
This commit is contained in:
77
nconman.w
77
nconman.w
@ -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}
|
||||
@ -115,6 +115,9 @@ Given the plethora of things to take care of, each connection is
|
||||
represented by a rather large data structure.
|
||||
|
||||
@d condat @{
|
||||
typedef int (*writeFunc)(struct __SConnection *pCon,
|
||||
char *pMessage, int iCode);
|
||||
|
||||
typedef struct __SConnection {
|
||||
/* object basics */
|
||||
pObjectDescriptor pDes;
|
||||
@ -128,8 +131,7 @@ represented by a rather large data structure.
|
||||
int iTelnet;
|
||||
int iOutput;
|
||||
int iFiles;
|
||||
int (*write)(struct __SConnection *pCon,
|
||||
char *pMessage, int iCode);
|
||||
writeFunc write;
|
||||
mkChannel *pDataSock;
|
||||
char *pDataComp;
|
||||
int iDataPort;
|
||||
@ -141,6 +143,7 @@ represented by a rather large data structure.
|
||||
int iDummy;
|
||||
int iGrab;
|
||||
int iErrCode;
|
||||
int parameterChange;
|
||||
SicsInterp *pSics;
|
||||
|
||||
/* a FIFO */
|
||||
@ -148,9 +151,15 @@ represented by a rather large data structure.
|
||||
|
||||
/* callback registry */
|
||||
int iList;
|
||||
|
||||
|
||||
/* Tasking Stuff */
|
||||
int iEnd;
|
||||
/* for keeping track of the login
|
||||
process on a non telnet connection.
|
||||
Should only be used in SCTaskFunction
|
||||
*/
|
||||
int iLogin;
|
||||
time_t conStart;
|
||||
}SConnection;
|
||||
@}
|
||||
|
||||
@ -202,6 +211,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
|
||||
@ -230,6 +243,11 @@ The interface to this data structure is defined by the following functions:
|
||||
int SCSendOK(SConnection *self);
|
||||
int SCnoSock(SConnection *pCon);
|
||||
int SCWriteUUencoded(SConnection *pCon, char *pName, void *iData, int iLen);
|
||||
int SCWriteZipped(SConnection *pCon, char *pName, void *pData, int iDataLen);
|
||||
writeFunc SCGetWriteFunc(SConnection *pCon);
|
||||
void SCSetWriteFunc(SConnection *pCon, writeFunc x);
|
||||
int SCOnlySockWrite(SConnection *self, char *buffer, int iOut);
|
||||
int SCNotWrite(SConnection *self, char *buffer, int iOut);
|
||||
/************************* CallBack *********************************** */
|
||||
int SCRegister(SConnection *pCon, SicsInterp *pSics,
|
||||
void *pInter, long lID);
|
||||
@ -237,19 +255,20 @@ The interface to this data structure is defined by the following functions:
|
||||
/******************************* Error **************************************/
|
||||
void SCSetInterrupt(SConnection *self, int eCode);
|
||||
int SCGetInterrupt(SConnection *self);
|
||||
void SCSetError(SConnection *pCon, int iCode);
|
||||
int SCGetError(SConnection *pCon);
|
||||
/****************************** Macro ***************************************/
|
||||
int SCinMacro(SConnection *pCon);
|
||||
int SCsetMacro(SConnection *pCon, int iMode);
|
||||
|
||||
/************************** parameters changed ? **************************/
|
||||
void SCparChange(SConnection *pCon);
|
||||
/* *************************** Info *************************************** */
|
||||
int SCGetRights(SConnection *self);
|
||||
int SCSetRights(SConnection *pCon, int iNew);
|
||||
int SCMatchRights(SConnection *pCon, int iCode);
|
||||
int SCGetOutClass(SConnection *self);
|
||||
int SCGetGrab(SConnection *pCon);
|
||||
|
||||
/********************* simulation mode ************************************/
|
||||
void SCSetSimMode(SConnection *pCon, int value);
|
||||
int SCinSimMode(SConnection *pCon);
|
||||
/* **************************** Invocation ******************************** */
|
||||
int SCInvoke(SConnection *self,SicsInterp *pInter,char *pCommand);
|
||||
|
||||
@ -293,6 +312,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
|
||||
@ -304,11 +337,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.
|
||||
@ -319,6 +352,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.
|
||||
@ -336,6 +371,8 @@ logfiles and into the commandlog.
|
||||
|
||||
Mark Koennecke, September 1997
|
||||
|
||||
Mark Koennecke, Aprl 2003
|
||||
|
||||
copyright: see copyright.h
|
||||
----------------------------------------------------------------------------*/
|
||||
#ifndef SICSCONNECT
|
||||
|
Reference in New Issue
Block a user