+
+/****f* silcclient/SilcClientAPI/SilcConnectionAuthRequest
+ *
+ * SYNOPSIS
+ *
+ * typedef void (*SilcConnectionAuthRequest)(SilcClient client,
+ * SilcClientConnection conn,
+ * SilcAuthMethod auth_meth,
+ * void *context);
+ *
+ * DESCRIPTION
+ *
+ * Connection authentication method request callback. This is called
+ * by the client library after it has received the authentication method
+ * that the application requested by calling the function
+ * silc_client_request_authentication_method.
+ *
+ ***/
+typedef void (*SilcConnectionAuthRequest)(SilcClient client,
+ SilcClientConnection conn,
+ SilcAuthMethod auth_meth,
+ void *context);
+
+/****f* silcclient/SilcClientAPI/silc_client_request_authentication_method
+ *
+ * SYNOPSIS
+ *
+ * void
+ * silc_client_request_authentication_method(SilcClient client,
+ * SilcClientConnection conn,
+ * SilcConnectionAuthRequest
+ * callback,
+ * void *context);
+ *
+ * DESCRIPTION
+ *
+ * This function can be used to request the current authentication method
+ * from the server. This may be called when connecting to the server
+ * and the client library requests the authentication data from the
+ * application. If the application does not know the current authentication
+ * method it can request it from the server using this function.
+ * The `callback' with `context' will be called after the server has
+ * replied back with the current authentication method.
+ *
+ ***/
+void
+silc_client_request_authentication_method(SilcClient client,
+ SilcClientConnection conn,
+ SilcConnectionAuthRequest callback,
+ void *context);
+
+/****d* silcclient/SilcClientAPI/SilcClientMonitorStatus
+ *
+ * NAME
+ *
+ * typedef enum { ... } SilcClientMonitorStatus;
+ *
+ * DESCRIPTION
+ *
+ * File transmission session status types. These will indicate
+ * the status of the file transmission session.
+ *
+ * SOURCE
+ */
+typedef enum {
+ SILC_CLIENT_FILE_MONITOR_KEY_AGREEMENT, /* In key agreemenet phase */
+ SILC_CLIENT_FILE_MONITOR_SEND, /* Sending file */
+ SILC_CLIENT_FILE_MONITOR_RECEIVE, /* Receiving file */
+ SILC_CLIENT_FILE_MONITOR_GET,
+ SILC_CLIENT_FILE_MONITOR_PUT,
+ SILC_CLIENT_FILE_MONITOR_CLOSED, /* Session closed */
+ SILC_CLIENT_FILE_MONITOR_ERROR, /* Error during session */
+} SilcClientMonitorStatus;
+/***/
+
+/****d* silcclient/SilcClientAPI/SilcClientFileError
+ *
+ * NAME
+ *
+ * typedef enum { ... } SilcClientFileError;
+ *
+ * DESCRIPTION
+ *
+ * File transmission error types. These types are returned by
+ * some of the file transmission functions, and by the monitor
+ * callback to indicate error.
+ *
+ * SOURCE
+ */
+typedef enum {
+ SILC_CLIENT_FILE_OK,
+ SILC_CLIENT_FILE_ERROR,
+ SILC_CLIENT_FILE_UNKNOWN_SESSION,
+ SILC_CLIENT_FILE_ALREADY_STARTED,
+ SILC_CLIENT_FILE_NO_SUCH_FILE,
+ SILC_CLIENT_FILE_PERMISSION_DENIED,
+} SilcClientFileError;
+/***/
+
+/****f* silcclient/SilcClientAPI/SilcClientFileMonitor
+ *
+ * SYNOPSIS
+ *
+ * typedef void (*SilcClientFileMonitor)(SilcClient client,
+ * SilcClientConnection conn,
+ * SilcClientMonitorStatus status,
+ * SilcClientFileError error,
+ * uint64 offset,
+ * uint64 filesize,
+ * SilcClientEntry client_entry,
+ * uint32 session_id,
+ * const char *filepath,
+ * void *context);
+ *
+ * DESCRIPTION
+ *
+ * Monitor callback that is called during the file transmission to
+ * monitor the transmission process. The `status' indicates the current
+ * monitoring process. The `error' will indicate the error type
+ * if `status' is SILC_CLIENT_FILE_MONITOR_ERROR. The `offset' is the
+ * currently transmitted amount of total `filesize'. The `client_entry'
+ * indicates the remote client, and the transmission session ID is the
+ * `session_id'. The filename being transmitted is indicated by the
+ * `filepath'.
+ *
+ ***/
+typedef void (*SilcClientFileMonitor)(SilcClient client,
+ SilcClientConnection conn,
+ SilcClientMonitorStatus status,
+ SilcClientFileError error,
+ uint64 offset,
+ uint64 filesize,
+ SilcClientEntry client_entry,
+ uint32 session_id,
+ const char *filepath,
+ void *context);
+
+/****f* silcclient/SilcClientAPI/silc_client_file_send
+ *
+ * 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);
+ *
+ * DESCRIPTION
+ *
+ * Sends a file indicated by the `filepath' to the remote client
+ * indicated by the `client_entry'. This will negotiate a secret key
+ * with the remote client before actually starting the transmission of
+ * 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.
+ *
+ * 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
+ * non-zero that port is used. If `local_ip' is NULL then this will
+ * automatically attempt to bind it to local IP address of the machine.
+ * If that fails then this does not bind to any address and port, and
+ * assume that the remote client will provide the listener for the
+ * key exchange protocol.
+ *
+ * If error will occur during the file transfer process the error
+ * status will be returned in the monitor callback. In this case
+ * the application must call silc_client_file_close to close the
+ * 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);
+
+/****f* silcclient/SilcClientAPI/silc_client_file_receive
+ *
+ * SYNOPSIS
+ *
+ * SilcClientFileError
+ * silc_client_file_receive(SilcClient client,
+ * SilcClientConnection conn,
+ * SilcClientFileMonitor monitor,
+ * void *monitor_context,
+ * uint32 session_id);
+ *
+ * DESCRIPTION
+ *
+ * Receives a file from a client indicated by the `client_entry'. The
+ * `session_id' indicates the file transmission session and it has been
+ * received in the `ftp' client operation function. This will actually
+ * perform the key agreement protocol with the remote client before
+ * actually starting the file transmission. The `monitor' callback
+ * will be called to monitor the transmission.
+ *
+ * If error will occur during the file transfer process the error
+ * status will be returned in the monitor callback. In this case
+ * the application must call silc_client_file_close to close the
+ * session.
+ *
+ ***/
+SilcClientFileError
+silc_client_file_receive(SilcClient client,
+ SilcClientConnection conn,
+ SilcClientFileMonitor monitor,
+ void *monitor_context,
+ uint32 session_id);
+
+/****f* silcclient/SilcClientAPI/silc_client_file_close
+ *
+ * SYNOPSIS
+ *
+ * SilcClientFileError silc_client_file_close(SilcClient client,
+ * SilcClientConnection conn,
+ * uint32 session_id);
+ *
+ * DESCRIPTION
+ *
+ * Closes file transmission session indicated by the `session_id'.
+ * If file transmission is being conducted it will be aborted
+ * automatically. This function is also used to close the session
+ * after successful file transmission. This function can be used
+ * also to reject incoming file transmission request.
+ *
+ ***/
+SilcClientFileError silc_client_file_close(SilcClient client,
+ SilcClientConnection conn,
+ uint32 session_id);
+