+/****d* silcclient/SilcClientAPI/SilcClientConnectionStatus
+ *
+ * NAME
+ *
+ * typedef enum { ... } SilcClientConnectionStatus
+ *
+ * DESCRIPTION
+ *
+ * This type is returned to the `connect' client operation to indicate
+ * the status of the created connection. It can indicate if it was
+ * successful or whether an error occurred.
+ *
+ * SOURCE
+ */
+typedef enum {
+ SILC_CLIENT_CONN_SUCCESS, /* Successfully connected */
+ SILC_CLIENT_CONN_SUCCESS_RESUME, /* Successfully connected and
+ resumed old detached session */
+ SILC_CLIENT_CONN_DISCONNECTED, /* Remote host disconnected */
+ SILC_CLIENT_CONN_ERROR, /* Error occurred during connecting */
+ SILC_CLIENT_CONN_ERROR_KE, /* Key Exchange failed */
+ SILC_CLIENT_CONN_ERROR_AUTH, /* Authentication failed */
+ SILC_CLIENT_CONN_ERROR_RESUME, /* Resuming failed */
+ SILC_CLIENT_CONN_ERROR_TIMEOUT, /* Timeout during connecting */
+} SilcClientConnectionStatus;
+/***/
+
+/****f* silcclient/SilcClientAPI/SilcClientRunning
+ *
+ * SYNOPSIS
+ *
+ * typedef void (*SilcClientRunning)(SilcClient client, void *context);
+ *
+ * DESCRIPTION
+ *
+ * The callback given as argument to silc_client_init function. Once
+ * this is called the client library is running and application may
+ * start using the Client library API.
+ *
+ ***/
+typedef void (*SilcClientRunning)(SilcClient client, void *context);
+
+/****f* silcclient/SilcClientAPI/SilcClientStopped
+ *
+ * SYNOPSIS
+ *
+ * typedef void (*SilcClientStopped)(SilcClient client, void *context);
+ *
+ * DESCRIPTION
+ *
+ * The callback given as argument to silc_client_stop. Once this is
+ * called the client library has stopped and can be freed by calling
+ * silc_client_free. Note that this won't be called if there are
+ * active connections in the client. Connections must first be closed
+ * by calling silc_client_close_connection or by sending QUIT command to
+ * the server connection.
+ *
+ ***/
+typedef void (*SilcClientStopped)(SilcClient client, void *context);
+
+/****f* silcclient/SilcClientAPI/SilcClientConnectCallback
+ *
+ * SYNOPSIS
+ *
+ * void (*SilcClientConnectCallback)(SilcClient client,
+ * SilcClientConnection conn,
+ * SilcClientConnectionStatus status,
+ * SilcStatus error,
+ * const char *message,
+ * void *context);
+ *
+ * DESCRIPTION
+ *
+ * Connect callbak given as argument to silc_client_connect_to_server,
+ * silc_client_connect_to_client and silc_client_key_exchange functions.
+ * It is called to indicate the status of the connection, indicated
+ * by the `status'. It is called after the connection has been
+ * established to the remote host and when connection is disconnected
+ * by the remote host. The `context' is the context given as argument
+ * to the connecting function. If the `status' is an error the `error'
+ * may indicate more detailed error. If `error' is SILC_STATUS_OK no
+ * detailed error message is available.
+ *
+ * When the `status' is SILC_CLIENT_CONN_DISCONNECTED the `error' will
+ * indicate the reason for disconnection. If the `message' is non-NULL
+ * it delivers error or disconnection message.
+ *
+ * The `conn' is the connection to the remote host. In case error
+ * occurred the `conn' may be NULL, however, in some cases a valid `conn'
+ * is returned even in error. If `conn' is non-NULL the receiver is
+ * responsible of closing the connection with silc_client_close_connection
+ * function, except when SILC_CLINET_CONN_DISCONNECTED or some error
+ * was received. In these cases the library will close the connection.
+ *
+ ***/
+typedef void (*SilcClientConnectCallback)(SilcClient client,
+ SilcClientConnection conn,
+ SilcClientConnectionStatus status,
+ SilcStatus error,
+ const char *message,
+ void *context);
+
+/****s* silcclient/SilcClientAPI/SilcClient
+ *
+ * NAME
+ *
+ * typedef struct SilcClientStruct { ... } *SilcClient
+ *
+ * DESCRIPTION
+ *
+ * This is the actual SILC Client structure which represents one
+ * SILC Client. It is allocated with the silc_client_alloc function
+ * and given as argument to all SILC Client Library functions. It
+ * is initialized with silc_client_init function, and freed with
+ * silc_client_free function.
+ *
+ * This context represents the client. Each connection to remote server
+ * is represented by SilcClientConnection context.
+ *
+ * SOURCE
+ */
+struct SilcClientStruct {
+ char *username; /* Username */
+ char *hostname; /* hostname */
+ char *realname; /* Real name */
+ SilcSchedule schedule; /* Client scheduler */
+ SilcRng rng; /* Random number generator */
+ void *application; /* Application specific context, set with
+ silc_client_alloc. */
+
+ /* Internal data for client library. Application cannot access this. */
+ SilcClientInternal internal;
+};
+/***/
+
+/****s* silcclient/SilcClientAPI/SilcClientConnection
+ *
+ * NAME
+ *
+ * typedef struct SilcClientConnectionStruct { ... }
+ * *SilcClientConnection
+ *
+ * DESCRIPTION
+ *
+ * This structure represents a connection. It is allocated and freed by
+ * the library. It is returned to application in SilcClientConnectCallback.
+ * It includes all the important data for the session such as local
+ * client entry (which includes current nickname), local and remote IDs,
+ * and other information. All strings in the structure are UTF-8 encoded.
+ *
+ * SOURCE
+ */
+struct SilcClientConnectionStruct {
+ SilcClientEntry local_entry; /* Our own Client Entry */
+ SilcClientID *local_id; /* Our current Client ID */
+
+ char *remote_host; /* Remote host name */
+ int remote_port; /* Remote port */
+ SilcID remote_id; /* Remote ID */
+
+ SilcChannelEntry current_channel; /* Current joined channel */
+ SilcPublicKey public_key; /* Public key used in this connection */
+ SilcPrivateKey private_key; /* Private key */
+ SilcPacketStream stream; /* Connection to remote host */
+ SilcConnectionType type; /* Connection type */
+ SilcClientConnectCallback callback; /* Connection callback */
+ void *callback_context; /* Connection context */
+ SilcClient client; /* Pointer back to SilcClient */
+
+ /* Application specific data. Application may set here whatever it wants. */
+ void *context;
+
+ /* Internal data for client library. Application cannot access this. */
+ SilcClientConnectionInternal internal;
+};
+/***/
+
+/****s* silcclient/SilcClientAPI/SilcChannelUser
+ *
+ * NAME
+ *
+ * typedef struct SilcChannelUserStruct { ... } *SilcChannelUser
+ *
+ * DESCRIPTION
+ *
+ * This structure represents a client that has joined to a channel.
+ * It shows the client and the channel and the client's mode (channel
+ * user mode) on the channel.
+ *
+ * SOURCE
+ */
+struct SilcChannelUserStruct {
+ SilcClientEntry client; /* Client joined on channel */
+ SilcUInt32 mode; /* mode, ChannelUserModes */
+ SilcChannelEntry channel; /* The channel user has joined */
+
+ /* Application specific data. Application may set here whatever it wants. */
+ void *context;
+};
+/***/
+
+/****s* silcclient/SilcClientAPI/SilcClientStats
+ *
+ * NAME
+ *
+ * typedef struct { ... } SilcClientStats;
+ *
+ * DESCRIPTION
+ *
+ * This structure holds SILC network statistics returned by the
+ * SILC_COMMAND_STATS command reply to the application.
+ *
+ * SOURCE
+ */
+typedef struct SilcClientStatsStruct {
+ SilcUInt32 starttime; /* SILC server start time */
+ SilcUInt32 uptime; /* SILC server uptime*/
+ SilcUInt32 my_clients; /* Number of clients in the server */
+ SilcUInt32 my_channels; /* Number of channel in the server */
+ SilcUInt32 my_server_ops; /* Number of server operators in the server */
+ SilcUInt32 my_router_ops; /* Number of router operators in the router */
+ SilcUInt32 cell_clients; /* Number of clients in the cell */
+ SilcUInt32 cell_channels; /* Number of channels in the cell */
+ SilcUInt32 cell_servers; /* Number of server in the cell */
+ SilcUInt32 clients; /* All clients in SILC network */
+ SilcUInt32 channels; /* All channels in SILC network */
+ SilcUInt32 servers; /* All servers in SILC network */
+ SilcUInt32 routers; /* All routers in SILC network */
+ SilcUInt32 server_ops; /* All server operators in SILC network */
+ SilcUInt32 router_ops; /* All router operators in SILC network */
+} SilcClientStats;
+/***/
+