SilcProtocolState
NAME
typedef unsigned char SilcProtocolState;
DESCRIPTION
Protocol state definition and the defined protocol states. These
states are the generic states. However, each protocol actually
implements the states. The state after SILC_PROTOCOL_STATE_START
would be state 2 in the application. These states can be easily
used for example inside switch() statement.
EXAMPLE
switch (protocol->state) {
case SILC_PROTOCOL_STATE_START:
protocol_starts_here();
case 2:
...
case 3:
...
case SILC_PROTOCOL_STATE_END:
protocol_ends_here();
case SILC_PROTOCOL_STATE_FAILURE:
remote_end_sent_failure();
case SILC_PROTOCOL_STATE_ERROR:
local_error_during_protocol();
}
SOURCE
typedef unsigned char SilcProtocolState;
/* Protocol states. Do NOT change the values of these states, especially
the START state or you break every protocol. */
#define SILC_PROTOCOL_STATE_UNKNOWN 0
#define SILC_PROTOCOL_STATE_START 1
#define SILC_PROTOCOL_STATE_END 252
#define SILC_PROTOCOL_STATE_FAILURE 253 /* Received failure from remote */
#define SILC_PROTOCOL_STATE_ERROR 254 /* Local error at our end */
|