*
* SYNOPSIS
*
- * int silc_client_start_key_exchange(SilcClient client,
- * SilcClientConnection conn,
- * int fd);
+ * void silc_client_start_key_exchange(SilcClient client,
+ * SilcClientConnection conn,
+ * int fd);
*
* DESCRIPTION
*
* if the key exchange could not be started.
*
***/
-bool silc_client_start_key_exchange(SilcClient client,
+void silc_client_start_key_exchange(SilcClient client,
SilcClientConnection conn,
int fd);
*
* SYNOPSIS
*
- * typedef void (*SilcGetClientCallback)(SilcClient client,
- * SilcClientConnection conn,
- * SilcClientEntry *clients,
- * uint32 clients_count,
- * void *context);
+ * typedef void (*SilcGetChannelCallback)(SilcClient client,
+ * SilcClientConnection conn,
+ * SilcChannelEntry *channels,
+ * uint32 channels_count,
+ * void *context);
*
* DESCRIPTION
*
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();
+ * SilcClientCommandContext silc_client_command_alloc(void);
*
* DESCRIPTION
*
* context.
*
***/
-SilcClientCommandContext silc_client_command_alloc();
+SilcClientCommandContext silc_client_command_alloc(void);
/****f* silcclient/SilcClientAPI/silc_client_command_free
*
*
* SYNOPSIS
*
- * SilcClientCommand *silc_client_command_find(const char *name);
+ * SilcClientCommand silc_client_command_find(SilcClient client,
+ * const char *name);
*
* DESCRIPTION
*
* command is not found. See the `command.[ch]' for the command list.
*
***/
-SilcClientCommand *silc_client_command_find(const char *name);
+SilcClientCommand silc_client_command_find(SilcClient client,
+ const char *name);
-/****f* silcclient/SilcClientAPI/silc_client_send_command
+/****f* silcclient/SilcClientAPI/silc_client_command_call
*
* SYNOPSIS
*
- * void silc_client_send_command(SilcClient client,
- * SilcClientConnection conn,
- * SilcCommand command, uint16 ident,
- * uint32 argc, ...);
+ * void silc_client_command_call(SilcClientCommand command);
*
* DESCRIPTION
*
- * Generic function to send any command. The arguments must be sent already
- * encoded into correct form and in correct order.
+ * 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_send_command(SilcClient client, SilcClientConnection conn,
- SilcCommand command, uint16 ident,
- uint32 argc, ...);
+void silc_client_command_call(SilcClientCommand command,
+ SilcClientCommandContext cmd);
-/****f* silcclient/SilcClientAPI/SilcClientPendingDestructor
+/****f* silcclient/SilcClientAPI/silc_client_command_send
*
* SYNOPSIS
*
- * typedef void (*SilcClientPendingDestructor)(void *context);
+ * void silc_client_command_send(SilcClient client,
+ * SilcClientConnection conn,
+ * SilcCommand command, uint16 ident,
+ * uint32 argc, ...);
*
* DESCRIPTION
*
- * Pending Command callback destructor. This is called after calling the
- * pending callback or if error occurs while processing the pending command.
- * If error occurs then the callback won't be called at all, and only this
- * destructor is called. The `context' is the context given for the function
- * silc_client_command_pending.
+ * 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.
*
***/
-typedef void (*SilcClientPendingDestructor)(void *context);
+void silc_client_command_send(SilcClient client, SilcClientConnection conn,
+ SilcCommand command, uint16 ident,
+ uint32 argc, ...);
/****f* silcclient/SilcClientAPI/silc_client_command_pending
*
* void silc_client_command_pending(SilcClientConnection conn,
* SilcCommand reply_cmd,
* uint16 ident,
- * SilcClientPendingDestructor destructor,
* SilcCommandCb callback,
* void *context);
*
*
* 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
+ * 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,
uint16 ident,
- SilcClientPendingDestructor destructor,
SilcCommandCb callback,
void *context);
SILC_CLIENT_FILE_ALREADY_STARTED,
SILC_CLIENT_FILE_NO_SUCH_FILE,
SILC_CLIENT_FILE_PERMISSION_DENIED,
+ SILC_CLIENT_FILE_KEY_AGREEMENT_FAILED,
} SilcClientFileError;
/***/
*
* SYNOPSIS
*
- * uint32 silc_client_file_send(SilcClient client,
- * SilcClientConnection conn,
- * SilcClientFileMonitor monitor,
- * void *monitor_context,
- * const char *local_ip,
- * uint32 local_port,
- * SilcClientEntry client_entry,
- * const char *filepath);
+ * SilcClientFileError
+ * silc_client_file_send(SilcClient client,
+ * SilcClientConnection conn,
+ * SilcClientFileMonitor monitor,
+ * void *monitor_context,
+ * const char *local_ip,
+ * uint32 local_port,
+ * SilcClientEntry client_entry,
+ * const char *filepath);
+ * uint32 *session_id);
*
* DESCRIPTION
*
* the file. The `monitor' callback will be called to monitor the
* transmission of the file.
*
- * This returns a file session ID for the file transmission. It can
- * be used to close the session (and abort the file transmission) by
- * calling the silc_client_file_close function. The session ID is
- * also returned in the `monitor' callback. This returns 0 if the
- * file indicated by the `filepath' is being transmitted to the remote
- * client indicated by the `client_entry', already.
+ * This returns a file session ID for the file transmission to the
+ * `session_id' pointer.. It can be used to close the session (and
+ * abort the file transmission) by calling the silc_client_file_close
+ * function. The session ID is also returned in the `monitor' callback.
*
* If the `local_ip' is provided then this will try to bind the
* listener for key exchange protocol to that IP. If `local_port' is
* session.
*
***/
-uint32 silc_client_file_send(SilcClient client,
- SilcClientConnection conn,
- SilcClientFileMonitor monitor,
- void *monitor_context,
- const char *local_ip,
- uint32 local_port,
- SilcClientEntry client_entry,
- const char *filepath);
+SilcClientFileError
+silc_client_file_send(SilcClient client,
+ SilcClientConnection conn,
+ SilcClientFileMonitor monitor,
+ void *monitor_context,
+ const char *local_ip,
+ uint32 local_port,
+ SilcClientEntry client_entry,
+ const char *filepath,
+ uint32 *session_id);
/****f* silcclient/SilcClientAPI/silc_client_file_receive
*