- * void
- * silc_client_get_channel_by_id_resolve(SilcClient client,
- * SilcClientConnection conn,
- * SilcChannelID *channel_id,
- * SilcGetClientCallback completion,
- * void *context);
- *
- * DESCRIPTION
- *
- * Finds channel entry by the channel name. Returns the entry or NULL
- * if it was not found.
- *
- ***/
-SilcChannelEntry silc_client_get_channel_by_id(SilcClient client,
- SilcClientConnection conn,
- SilcChannelID *channel_id);
-
-/****f* silcclient/SilcClientAPI/silc_client_get_channel_by_id_resolve
- *
- * SYNOPSIS
- *
- * void
- * silc_client_get_channel_by_id_resolve(SilcClient client,
- * SilcClientConnection conn,
- * SilcChannelID *channel_id,
- * SilcGetClientCallback completion,
- * void *context);
- *
- * DESCRIPTION
- *
- * Resolves the channel information (its name mainly) from the server
- * by the `channel_id'. Use this only if you know that you do not have
- * the entry cached locally.
- *
- ***/
-void silc_client_get_channel_by_id_resolve(SilcClient client,
- SilcClientConnection conn,
- SilcChannelID *channel_id,
- SilcGetChannelCallback completion,
- void *context);
-
-/****f* silcclient/SilcClientAPI/silc_client_del_channel
- *
- * SYNOPSIS
- *
- * bool silc_client_del_channel(SilcClient client,
- * SilcClientConnection conn,
- * SilcChannelEntry channel)
- *
- * DESCRIPTION
- *
- * Removes channel from local cache by the channel entry indicated by
- * the `channel'. Returns TRUE if the deletion were successful.
- *
- ***/
-bool silc_client_del_channel(SilcClient client, SilcClientConnection conn,
- SilcChannelEntry channel);
-
-/****f* silcclient/SilcClientAPI/silc_client_get_server
- *
- * SYNOPSIS
- *
- * SilcServerEntry silc_client_get_server(SilcClient client,
- * SilcClientConnection conn,
- * char *server_name)
- *
- * DESCRIPTION
- *
- * Finds entry for server by the server name. Returns the entry or NULL
- * if the entry was not found.
- *
- ***/
-SilcServerEntry silc_client_get_server(SilcClient client,
- SilcClientConnection conn,
- char *server_name);
-
-/****f* silcclient/SilcClientAPI/silc_client_get_server_by_id
- *
- * SYNOPSIS
- *
- * SilcServerEntry silc_client_get_server_by_id(SilcClient client,
- * SilcClientConnection conn,
- * SilcServerID *server_id);
- *
- * DESCRIPTION
- *
- * Finds entry for server by the server ID. Returns the entry or NULL
- * if the entry was not found.
- *
- ***/
-SilcServerEntry silc_client_get_server_by_id(SilcClient client,
- SilcClientConnection conn,
- SilcServerID *server_id);
-
-/****f* silcclient/SilcClientAPI/silc_client_del_server
- *
- * SYNOPSIS
- *
- * bool silc_client_del_server(SilcClient client, SilcClientConnection conn,
- * SilcServerEntry server);
- *
- * DESCRIPTION
- *
- * Removes server from local cache by the server entry indicated by
- * the `server'. Returns TRUE if the deletion were successful.
- *
- ***/
-bool silc_client_del_server(SilcClient client, SilcClientConnection conn,
- SilcServerEntry server);
-
-/****f* silcclient/SilcClientAPI/silc_client_on_channel
- *
- * SYNOPSIS
- *
- * SilcChannelUser silc_client_on_channel(SilcChannelEntry channel,
- * SilcClientEntry client_entry);
- *
- * DESCRIPTION
- *
- * Returns the ChannelUser entry if the `client_entry' is joined on the
- * channel indicated by the `channel'. NULL if client is not joined on
- * the channel.
- *
- ***/
-SilcChannelUser silc_client_on_channel(SilcChannelEntry channel,
- SilcClientEntry client_entry);
-
-/* Command management (command.c) */
-
-/****f* silcclient/SilcClientAPI/silc_client_command_alloc
- *
- * SYNOPSIS
- *
- * SilcClientCommandContext silc_client_command_alloc(void);
- *
- * DESCRIPTION
- *
- * Allocate Command Context. The context is defined in `command.h' file.
- * The context is used by the library commands and applications should use
- * it as well. However, application may choose to use some own context
- * for its local commands. All library commands, however, must use this
- * context.
- *
- ***/
-SilcClientCommandContext silc_client_command_alloc(void);
-
-/****f* silcclient/SilcClientAPI/silc_client_command_free
- *
- * SYNOPSIS
- *
- * void silc_client_command_free(SilcClientCommandContext ctx);
- *
- * DESCRIPTION
- *
- * Free command context and its internals. If the contex was duplicated
- * with silc_client_command_dup this may not actually free the data,
- * instead it will decrease the reference counter of the context. The
- * context will be freed when the reference counter hits zero.
- *
- ***/
-void silc_client_command_free(SilcClientCommandContext ctx);
-
-/****f* silcclient/SilcClientAPI/silc_client_command_dup
- *
- * SYNOPSIS
- *
- * SilcClientCommandContext
- * silc_client_command_dup(SilcClientCommandContext ctx);
- *
- * DESCRIPTION
- *
- * Duplicate Command Context by adding reference counter. The context won't
- * be free'd untill it hits zero.
- *
- ***/
-SilcClientCommandContext silc_client_command_dup(SilcClientCommandContext ctx);
-
-/****f* silcclient/SilcClientAPI/silc_client_command_find
- *
- * SYNOPSIS
- *
- * SilcClientCommand silc_client_command_find(SilcClient client,
- * const char *name);
- *
- * DESCRIPTION
- *
- * Finds and returns a pointer to the command list. Return NULL if the
- * command is not found. See the `command.[ch]' for the command list.
- * Command names are not case-sensitive.
- *
- ***/
-SilcClientCommand silc_client_command_find(SilcClient client,
- const char *name);
-
-/****f* silcclient/SilcClientAPI/silc_client_command_call
- *
- * SYNOPSIS
- *
- * void silc_client_command_call(SilcClientCommand command);
- *
- * DESCRIPTION
- *
- * Calls the command (executes it). Application can call this after
- * it has allocated the SilcClientCommandContext with the function
- * silc_client_command_alloc and found the command from the client
- * library by calling silc_client_command_find. This will execute
- * the command.
- *
- * Application can call the command function directly too if it
- * wishes to do so. See the command.h for details of the
- * SilcClientCommand structure.
- *
- ***/
-void silc_client_command_call(SilcClientCommand command,
- SilcClientCommandContext cmd);
-
-/****f* silcclient/SilcClientAPI/silc_client_command_send
- *
- * SYNOPSIS
- *
- * void silc_client_command_send(SilcClient client,
- * SilcClientConnection conn,
- * SilcCommand command, SilcUInt16 ident,
- * SilcUInt32 argc, ...);
- *
- * DESCRIPTION
- *
- * Generic function to send any command. The arguments must be sent already
- * encoded into correct form and in correct order. If application wants
- * to perform the commands by itself, it can do so and send the data
- * directly to the server using this function. If application is using
- * the silc_client_command_call, this function is usually not used.
- *
- ***/
-void silc_client_command_send(SilcClient client, SilcClientConnection conn,
- SilcCommand command, SilcUInt16 ident,
- SilcUInt32 argc, ...);
-
-/****f* silcclient/SilcClientAPI/silc_client_command_pending
- *
- * SYNOPSIS
- *
- * void silc_client_command_pending(SilcClientConnection conn,
- * SilcCommand reply_cmd,
- * SilcUInt16 ident,
- * SilcCommandCb callback,
- * void *context);
- *
- * DESCRIPTION
- *
- * Add new pending command to be executed when reply to a command has been
- * received. The `reply_cmd' is the command that will call the `callback'
- * with `context' when reply has been received. If `ident' is non-zero
- * the `callback' will be executed when received reply with command
- * identifier `ident'.
- *
- * Note that the application is notified about the received command
- * reply through the `command_reply' client operation before calling
- * the `callback` pending command callback.
- *
- ***/
-void silc_client_command_pending(SilcClientConnection conn,
- SilcCommand reply_cmd,
- SilcUInt16 ident,
- SilcCommandCb callback,
- void *context);
-
-
-/* Private Message key management (client_prvmsg.c) */
-
-/****f* silcclient/SilcClientAPI/silc_client_add_private_message_key
- *
- * SYNOPSIS
- *
- * int silc_client_add_private_message_key(SilcClient client,
- * SilcClientConnection conn,
- * SilcClientEntry client_entry,
- * char *cipher,
- * unsigned char *key,
- * SilcUInt32 key_len,
- * bool generate_key,
- * bool responder);
- *
- * DESCRIPTION
- *
- * Adds private message key to the client library. The key will be used to
- * encrypt all private message between the client and the remote client
- * indicated by the `client_entry'. If the `key' is NULL and the boolean
- * value `generate_key' is TRUE the library will generate random key.
- * The `key' maybe for example pre-shared-key, passphrase or similar.
- * The `cipher' MAY be provided but SHOULD be NULL to assure that the
- * requirements of the SILC protocol are met. The API, however, allows
- * to allocate any cipher.
- *
- * If `responder' is TRUE then the sending and receiving keys will be
- * set according the client being the receiver of the private key. If
- * FALSE the client is being the sender (or negotiator) of the private
- * key.
- *
- * It is not necessary to set key for normal private message usage. If the
- * key is not set then the private messages are encrypted using normal
- * session keys. Setting the private key, however, increases the security.
- *
- * Returns FALSE if the key is already set for the `client_entry', TRUE
- * otherwise.
- *
- ***/
-int silc_client_add_private_message_key(SilcClient client,
- SilcClientConnection conn,
- SilcClientEntry client_entry,
- char *cipher,
- unsigned char *key,
- SilcUInt32 key_len,
- bool generate_key,
- bool responder);
-
-/****f* silcclient/SilcClientAPI/silc_client_add_private_message_key_ske
- *
- * SYNOPSIS
- *
- * int silc_client_add_private_message_key_ske(SilcClient client,
- * SilcClientConnection conn,
- * SilcClientEntry client_entry,
- * char *cipher,
- * SilcSKEKeyMaterial *key);
- *
- * DESCRIPTION
- *
- * Same as silc_client_add_private_message_key but takes the key material
- * from the SKE key material structure. This structure is received if
- * the application uses the silc_client_send_key_agreement to negotiate
- * the key material. The `cipher' SHOULD be provided as it is negotiated
- * also in the SKE protocol.
- *
- ***/
-int silc_client_add_private_message_key_ske(SilcClient client,
- SilcClientConnection conn,
- SilcClientEntry client_entry,
- char *cipher,
- SilcSKEKeyMaterial *key,
- bool responder);
-
-/****f* silcclient/SilcClientAPI/silc_client_send_private_message_key
- *
- * SYNOPSIS
- *
- * int silc_client_send_private_message_key(SilcClient client,
- * SilcClientConnection conn,
- * SilcClientEntry client_entry,
- * int force_send);
- *
- * DESCRIPTION
- *
- * Sends private message key payload to the remote client indicated by
- * the `client_entry'. If the `force_send' is TRUE the packet is sent
- * immediately. Returns FALSE if error occurs, TRUE otherwise. The
- * application should call this function after setting the key to the
- * client.
- *
- * Note that the key sent using this function is sent to the remote client
- * through the SILC network. The packet is protected using normal session
- * keys.
- *
- ***/
-int silc_client_send_private_message_key(SilcClient client,
- SilcClientConnection conn,
- SilcClientEntry client_entry,
- int force_send);
-
-/****f* silcclient/SilcClientAPI/silc_client_del_private_message_key
- *
- * SYNOPSIS
- *
- * int silc_client_del_private_message_key(SilcClient client,
- * SilcClientConnection conn,
- * SilcClientEntry client_entry);