Files
sics/doc/programmer/proto.tex

64 lines
2.7 KiB
TeX

\chapter{The SICS Server Client Protocol}
The SICS server actually listens for connections on two sockets, each
implementing a different protocoll. The first type of connection
implements the telnet protocoll. The second type uses a plain socket
and has the advantage that binary data can be transferred.
\section{Connecting using Telnet}
The SICS server implements the most primitive telnet server possible
and does not support any of the fancy options possible with
telnet. Using the telnet protocoll involves:
\begin{itemize}
\item Open a socket connection to SICS's telnet port
\item Send a login word followed by a username and a password. The
login word is set in SICS initialization file as the SicsOption
TelWord.
\item On success a welcome message is printed, otherwise SICS
terminates the connection.
\item Now commands can be sent, but watch for the telnet protocoll
specification in the telnet RFC.
\end{itemize}
\section{Connection using a plain Connection}
This protocoll involves:
\begin{itemize}
\item Open a socket connection to SICS's plain port
\item Send a username and a password.
\item On success OK is printed, otherwise SICS
terminates the connection.
\item Now commands can be sent as strings terminated with a newline.
\end{itemize}
For a list of possible commands consult the
user documentation.
\section{Issuing Interrupts}
In some cases a user might want to stop the operation of the server. In
order to do this the client must send an interrupt to the SICS server. There
are two ways to do this: through the normal connection socket and through
the a special UDP message to the server. Let us first discuss the first
method, which uses the normal command socket for sending an interrupt.
In order to send an interrupt through the normal command socket a special
message must be sent, consisting of a special command string. The command
string is again all ASCII. The first part of this command string must read:
INT1712, followed by a number denoting the interrupt. The meaning of these
numbers is resolved in file interrupt.h. For example, the string 'INT1712 2'
will abort the current scan. The presence of an interrupt string will be
checked for already by the network reader. This means that such interrupts
will even be honored when the client connection is waiting for some hardware
to finish its job and would not accept normal commands. \label{prot1}
The SICS server also checks a special TCP/IP port for UDP messages which
denote an interrupt. In order to send an interrupt through this channel, a
UDP connection to the SICS servers UDP port must be opened. Then an special
ASCII string of the form: {\bf SICSINT num} must be sent. num must be
replaced by the number of the interrupt to issue. Again interrupt codes are
resolved in file interrupt.h.