+ SilcSKE ske;
+ SilcSKEVerifyCbCompletion completion;
+ void *completion_context;
+} *SilcVerifyKeyContext;
+
+/* Command and command reply context used to hold registered commands
+ in the SILC client. */
+typedef struct SilcClientCommandStruct {
+ struct SilcClientCommandStruct *next;
+ SilcCommand cmd; /* Command type */
+ SilcFSMStateCallback command; /* Command function */
+ SilcFSMStateCallback reply; /* Command reply callback */
+ char *name; /* Name of the command (optional) */
+ SilcUInt8 max_args; /* Maximum arguments (optional) */
+} *SilcClientCommand;
+
+/* Command reply callback structure */
+typedef struct SilcClientCommandReplyCallbackStruct {
+ struct SilcClientCommandReplyCallbackStruct *next;
+ SilcClientCommandReply reply; /* Command reply callback */
+ void *context; /* Command reply context */
+ unsigned int do_not_call : 1; /* Set to not call the callback */
+} *SilcClientCommandReplyCallback;
+
+/* Command context given as argument to command state functions. This same
+ context is used when calling, sending and procesing command and command
+ reply. */
+typedef struct SilcClientCommandContextStruct {
+ struct SilcClientCommandContextStruct *next;
+ SilcClientConnection conn; /* Connection */
+ SilcFSMThreadStruct thread; /* FSM thread for command call */
+
+ SilcCommand cmd; /* Command */
+ SilcUInt16 cmd_ident; /* Command identifier */
+ SilcUInt32 argc; /* Number of arguments */
+ unsigned char **argv; /* Arguments, may be NULL */
+ SilcUInt32 *argv_lens; /* Argument lengths, may be NULL */
+ SilcUInt32 *argv_types; /* Argument types, may be NULL */
+
+ SilcList reply_callbacks; /* Command reply callbacks */
+ SilcStatus status; /* Current command reply status */
+ SilcStatus error; /* Current command reply error */
+
+ void *context; /* Context for free use */
+ unsigned int called : 1; /* Set when called by application */
+ unsigned int verbose : 1; /* Verbose with 'say' client operation */
+ unsigned int resolved : 1; /* Set when resolving something */
+} *SilcClientCommandContext;
+
+/* Internal context for the client->internal pointer in the SilcClient. */
+struct SilcClientInternalStruct {
+ SilcFSMStruct fsm; /* Client's FSM */
+ SilcFSMEventStruct wait_event; /* Event signaller */
+ SilcClientOperations *ops; /* Client operations */
+ SilcClientParams *params; /* Client parameters */
+ SilcPacketEngine packet_engine; /* Packet engine */
+ SilcMutex lock; /* Client lock */
+ SilcList commands; /* Registered commands */
+ SilcDList ftp_sessions; /* FTP sessions */
+ char *silc_client_version; /* Version set by application */
+ SilcClientRunning running; /* Running/Stopped callback */
+ void *running_context; /* Context for runnign callback */
+ SilcAtomic32 conns; /* Number of connections in client */
+ SilcUInt16 next_session_id; /* Next FTP session ID */
+
+ /* Events */
+ unsigned int stop : 1; /* Stop client */
+ unsigned int run_callback : 1; /* Call running/stopped callback */
+ unsigned int connection_closed : 1; /* A connection closed */