Copyright © 2001 - 2007 SILC Project
SILC Project Website
SILC Toolkit Reference Manual
Index

SILC Toolkit Reference Manual
SILC Crypto Library
    Introduction to SILC RNG
    SILC RNG Interface
    SILC Cipher API
    SILC PKCS API
    SILC Public Key API
    SILC PKCS #1 API
    SILC Hash Interface
    SILC HMAC Interface
SILC Core Library
    SILC Authentication Interface
    SILC Message Interface
    SILC Channel Interface
    SILC Command Interface
    SILC Notify Interface
    SILC Status Types
    SILC Modes
    SILC ID Interface
    SILC Argument Interface
    SILC Attributes Interface
    Packet Engine Interface
    SILC Public Key Payload Interface
SILC Key Exchange Library
    SILC SKE Interface
    SILC Connection Authentication Interface
SILC VCard Library
    SILC VCard Interface
SILC Math Library
    SILC MP Interface
    SILC Math Interface
SILC Client Library
    Using SILC Client Library Tutorial
    Arguments for command_reply Client Operation
    SilcStatus Error Arguments in command_reply Client Operation
    Arguments for notify Client Operation
    Unicode and UTF-8 Strings in Client Library
    Client Library Interface Reference
    Client Entry Interface Reference
SILC ASN.1 Library
    SILC ASN.1 Interface
    SILC BER interface
SILC HTTP Library
    SILC HTTP Server Interface
    SILC HTTP PHP Translator
SILC Utility Library
    Basic Types and Definitions
    Data Buffer Interface
    Data Buffer Format Interface
    Hash Table Interface
    Memory Allocation Interface
    Data Stack (memory pool) Interface
    Finite State Machine Interface
    Thread Interface
    Mutual Exclusion Lock Interface
    Condition Variable Interface
    Atomic Operations Interface
    Network (TCP and UDP) Interface
    Scheduler Interface
    Asynchronous Operation Interface
    Abstract Stream Interface
    Socket Stream Interface
    File Descriptor Stream Interface
    File Utility Functions
    String Utility Interface
    Snprintf Interface
    UTF-8 String Interface
    Stringprep Interface
    Utility Functions
    List Interface
    Dynamic List Interface
    MIME Interface
    Time Utility Functions
    Logging Interface
    Config File Interface
SILC Key Repository Library
    SILC SKR Interface
SILC Application Utility Library
    SILC Application Utilities
    SILC ID Cache Interface
SILC SFTP Library
    SILC SFTP Interface
    SFTP Filesystems Interface

Resource Links
SILC Project Website
SILC Protocol Documentation
SILC White Paper
SILC FAQs





Structure SilcClientOperations

NAME

    typedef struct { ... } SilcClientOperations;

DESCRIPTION

    SILC Client Operations. These must be implemented by the application.
    The Client library may call any of these routines at any time.  The
    routines are used to deliver certain information to the application
    or from the application to the client library.

SOURCE
    typedef struct SilcClientOperationsStruct {
      /* Message sent to the application by library. `conn' associates the
         message to a specific connection.  `conn', however, may be NULL.
         The `type' indicates the type of the message sent by the library.
         The application can for example filter the message according the
         type.  The variable argument list is arguments to the formatted
         message `msg'.  A SilcClientEntry, SilcChannelEntry or SilcServerEntry
         can be associated with the message inside the SilcClientConnection
         by the library, and application may use it to better target the
         message. */
      void (*say)(SilcClient client, SilcClientConnection conn,
                  SilcClientMessageType type, char *msg, ...);
    
      /* Message for a channel. The `sender' is the sender of the message
         The `channel' is the channel. The `message' is the message.  Note
         that `message' maybe NULL.  The `flags' indicates message flags
         and it is used to determine how the message can be interpreted
         (like it may tell the message is multimedia message).  The `payload'
         may be used to retrieve all the details of the message. */
      void (*channel_message)(SilcClient client, SilcClientConnection conn,
                              SilcClientEntry sender, SilcChannelEntry channel,
                              SilcMessagePayload payload,
                              SilcChannelPrivateKey key, SilcMessageFlags flags,
                              const unsigned char *message,
                              SilcUInt32 message_len);
    
      /* Private message to the client. The `sender' is the sender of the
         message. The message is `message'and maybe NULL.  The `flags'
         indicates message flags  and it is used to determine how the message
         can be interpreted (like it may tell the message is multimedia
         message).  The `payload' may be used to retrieve all the details of
         the message. */
      void (*private_message)(SilcClient client, SilcClientConnection conn,
                              SilcClientEntry sender, SilcMessagePayload payload,
                              SilcMessageFlags flags, const unsigned char *message,
                              SilcUInt32 message_len);
    
      /* Notify message to the client.  The arguments are notify `type' specific.
         See separate documentation in the Toolkit Reference Manual for the notify
         arguments. */
      void (*notify)(SilcClient client, SilcClientConnection conn,
                     SilcNotifyType type, ...);
    
      /* Command handler. This function is called always after application has
         called a command.  It will be called to indicate that the command
         was processed.  It will also be called if error occurs while processing
         the command.  The `success' indicates whether the command was sent
         or if error occurred.  The `status' indicates the actual error.
         The `argc' and `argv' are the command line arguments sent to the
         command by application.  Note that, this is not reply to the command
         from server, this is merely and indication to application that the
         command was processed. */
      void (*command)(SilcClient client, SilcClientConnection conn,
                      SilcBool success, SilcCommand command, SilcStatus status,
                      SilcUInt32 argc, unsigned char **argv);
    
      /* Command reply handler.  Delivers a reply to command that was sent
         earlier.  The `conn' is the associated client connection.  The `command'
         indicates the command reply type.  If the `status' other than
         SILC_STATUS_OK an error occurred.  In this case the `error' will indicate
         the error.  It is possible to receive list of command replies and list
         of errors.  In this case the `status' will indicate it is an list entry
         (the `status' is SILC_STATUS_LIST_START, SILC_STATUS_LIST_ITEM and/or
         SILC_STATUS_LIST_END).
    
         The arguments received in `ap' are command specific.  See a separate
         documentation in the Toolkit Reference Manual for the command reply
         arguments. */
      void (*command_reply)(SilcClient client, SilcClientConnection conn,
                            SilcCommand command, SilcStatus status,
                            SilcStatus error, va_list ap);
    
      /* Find authentication method and authentication data by hostname and
         port. The hostname may be IP address as well. The `auth_method' is
         the authentication method the remote connection requires.  It is
         however possible that remote accepts also some other authentication
         method.  Application should use the method that may have been
         configured for this connection.  If none has been configured it should
         use the required `auth_method'.  If the `auth_method' is
         SILC_AUTH_NONE, server does not require any authentication or the
         required authentication method is not known.  The `completion'
         callback must be called to deliver the chosen authentication method
         and data. The `conn' may be NULL. */
      void (*get_auth_method)(SilcClient client, SilcClientConnection conn,
                              char *hostname, SilcUInt16 port,
                              SilcAuthMethod auth_method,
                              SilcGetAuthMeth completion, void *context);
    
      /* Called to verify received public key. The `conn_type' indicates which
         entity (server or client) has sent the public key. If user decides to
         trust the key the application may save the key as trusted public key for
         later use. The `completion' must be called after the public key has
         been verified.  A SilcClientEntry or SilcServerEntry can be associated
         with this request inside the SilcClientConnection by the library, and
         application may use it to better target the verification request. */
      void (*verify_public_key)(SilcClient client, SilcClientConnection conn,
                                SilcConnectionType conn_type,
                                SilcPublicKey public_key,
                                SilcVerifyPublicKey completion, void *context);
    
      /* Ask from end user a passphrase or a password. The passphrase is
         returned to the library by calling the `completion' callback with
         the `context'. The returned passphrase SHOULD be in UTF-8 encoded,
         if not then the library will attempt to encode. */
      void (*ask_passphrase)(SilcClient client, SilcClientConnection conn,
                             SilcAskPassphrase completion, void *context);
    
      /* Called to indicate that incoming key agreement request has been
         received.  If the application wants to perform key agreement it may
         call silc_client_perform_key_agreement to initiate key agreement or
         silc_client_send_key_agreement to provide connection point to the
         remote client in case the `hostname' is NULL.  If key agreement is
         not desired this request can be ignored.  The `protocol' is either
         value 0 for TCP or value 1 for UDP. */
      void (*key_agreement)(SilcClient client, SilcClientConnection conn,
                            SilcClientEntry client_entry,
                            const char *hostname, SilcUInt16 protocol,
                            SilcUInt16 port);
    
      /* Notifies application that file transfer protocol session is being
         requested by the remote client indicated by the `client_entry' from
         the `hostname' and `port'. The `session_id' is the file transfer
         session and it can be used to either accept or reject the file
         transfer request, by calling the silc_client_file_receive or
         silc_client_file_close, respectively. */
      void (*ftp)(SilcClient client, SilcClientConnection conn,
                  SilcClientEntry client_entry, SilcUInt32 session_id,
                  const char *hostname, SilcUInt16 port);
    } SilcClientOperations;





Client Library Interface
SilcClientConnectionStatus
SilcClientRunning
SilcClientStopped
SilcClientConnectCallback
SilcClient
SilcClientConnection
SilcChannelUser
SilcClientStats
SilcKeyAgreementStatus
SilcKeyAgreementCallback
SilcPrivateMessageKeys
SilcChannelPrivateKey
SilcAskPassphrase
SilcVerifyPublicKey
SilcGetAuthMeth
SilcClientMessageType
SilcClientOperations
SilcClientParams
silc_client_alloc
silc_client_free
silc_client_init
silc_client_run
silc_client_run_one
silc_client_stop
SilcClientConnectionParams
silc_client_connect_to_server
silc_client_connect_to_client
silc_client_key_exchange
silc_client_close_connection
silc_client_send_channel_message
silc_client_send_private_message
silc_client_private_message_wait_init
silc_client_private_message_wait_uninit
silc_client_private_message_wait
silc_client_on_channel
silc_client_command_call
SilcClientCommandReply
silc_client_command_send
silc_client_command_pending
silc_client_add_private_message_key
silc_client_add_private_message_key_ske
silc_client_del_private_message_key
silc_client_list_private_message_keys
silc_client_free_private_message_keys
silc_client_private_message_key_is_set
silc_client_add_channel_private_key
silc_client_del_channel_private_keys
silc_client_del_channel_private_key
silc_client_list_channel_private_keys
silc_client_current_channel_private_key
silc_client_send_key_agreement
silc_client_perform_key_agreement
silc_client_perform_key_agreement_stream
silc_client_abort_key_agreement
silc_client_set_away_message
SilcClientMonitorStatus
SilcClientFileError
SilcClientFileMonitor
SilcClientFileName
SilcClientFileAskName
silc_client_file_send
silc_client_file_receive
silc_client_file_close
silc_client_attribute_add
silc_client_attribute_del
silc_client_attributes_get
silc_client_attributes_request
silc_client_nickname_format
silc_client_nickname_parse




Copyright © 2001 - 2007 SILC Project
SILC Project Website
SILC Toolkit Reference Manual
Index