common and core components of SILC protocol from lib/silccore library and
normal utility routines from lib/silcutil library. The library has been
designed to be complete SILC Client implementation without actual user
-interface. The library provides API for the application which can use
-it to implement generally what ever user interface it wants.
+interface. The library provides the API for the application which it can
+use to implement generally whatever user interface it wants.
-The `ops.h' file defines the function prototypes that application must
+The `silcapi.h' file defines the function prototypes that application must
implement in order to be able to create the user interface with the
-library. The idea is that the application can implement what ever user
-interface routines in the functions and display the data what ever way
+library. The idea is that the application can implement whatever user
+interface routines in the functions and display the data whatever way
it wants. The library is entirely transparent to the user interface and
it does not include any user interface specific issues such as window
handling or item handling on the screen etc. These does not interest
the library.
-
Creating Client
===============
`ops' can be defined for example as follows:
SilcClientOperations ops = {
- say: silc_say,
- channel_message: silc_channel_message,
- private_message: silc_private_message,
- notify: silc_notify,
- command: silc_command,
- command_reply: silc_command_reply,
- connect: silc_connect,
- disconnect: silc_disconnect,
- get_auth_method: silc_get_auth_method,
- verify_server_key: silc_verify_server_key,
- ask_passphrase: silc_ask_passphrase,
+ silc_say,
+ silc_channel_message,
+ silc_private_message,
+ silc_notify,
+ silc_command,
+ silc_command_reply,
+ silc_connect,
+ silc_disconnect,
+ silc_get_auth_method,
+ silc_verify_public_key,
+ silc_ask_passphrase,
+ silc_failure,
+ silc_key_agreement,
};
pointers must be set before calling the initializing function:
client->username
+ client->hostname
client->realname
client->pkcs
client->public_key
which then can be retrieved in the application, thus perhaps associate
the connection with what ever object in the application (window or something
else).
+
+
+Using Own Connecting
+====================
+
+Application might not want to use silc_client_connect_to_server function
+if it wants to perform its own connecting for some reason. In this case
+application must call function silc_client_start_key_exchange after it
+has created the connection by itself. This function starts the key exhange
+protocol between the client and server and the library takes care of
+everything after that.
+
+After connection has been created application must call:
+
+ SilcClientConnection conn;
+
+ /* Add new connection to client */
+ conn = silc_client_add_connection(client, hostname, port, context);
+
+ /* Start key exchange and let the library handle everything
+ after this point on. */
+ silc_client_start_key_exchange(client, conn, sock);
+
+These calls are performed only and only if application did not call
+silc_client_connect_to_server function.