silcclient: auto-negotiation of private message key using SKE over SILCnet
[silc.git] / lib / silcclient / silcclient.h
index 898204a18f46663a571c0c38202d924fb9d3f089..58e43f158c85230ee5f126acb31649d01f56329f 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 2000 - 2007 Pekka Riikonen
+  Copyright (C) 2000 - 2014 Pekka Riikonen
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -232,6 +232,18 @@ struct SilcClientConnectionStruct {
   void *callback_context;             /* Connection context */
   SilcClient client;                  /* Pointer back to SilcClient */
 
+  /* Current say() operation associated context, identifies the client,
+     channel or server the message is related to.  Application can use
+     this information to target the message better. */
+  union {
+    SilcClientEntry client_entry;
+    SilcChannelEntry channel_entry;
+    SilcServerEntry server_entry;
+  };
+  SilcIdType context_type;             /* Defines which pointer is set
+                                          in the union.  If SILC_ID_NONE
+                                          pointer is NULL. */
+
   /* Application specific data.  Application may set here whatever it wants. */
   void *context;
 
@@ -506,7 +518,9 @@ typedef struct SilcClientOperationsStruct {
      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 that `msg' may be. */
+     message `msg'.  A SilcClientEntry, SilcChannelEntry or SilcServerEntry
+     can be associated with the message inside the `conn' by the library,
+     and application may use it to better target the message. */
   void (*say)(SilcClient client, SilcClientConnection conn,
              SilcClientMessageType type, char *msg, ...);
 
@@ -706,6 +720,10 @@ typedef struct SilcClientParamsStruct {
      itself will need to handle that. */
   SilcBool dont_register_crypto_library;
 
+  /* If this is set to TRUE, the silcclient library will not automatically
+     negotiate private message keys using SKE over the SILC network but will
+     use normal session keys to protect private messages. */
+  SilcBool dont_autoneg_prvmsg_keys;
 } SilcClientParams;
 /***/
 
@@ -943,6 +961,10 @@ typedef struct SilcClientConnectionParamsStruct {
      silc_client_attribute_add for more information on attributes. */
   SilcBool ignore_requested_attributes;
 
+  /* User context for SilcClientConnection.  If non-NULL this context is
+     set to the 'context' field in SilcClientConnection when the connection
+     context is created. */
+  void *context;
 } SilcClientConnectionParams;
 /***/
 
@@ -1159,7 +1181,7 @@ void silc_client_close_connection(SilcClient client,
  *
  *    Returns TRUE if the message was sent, and FALSE if error occurred or
  *    the sending is not allowed due to channel modes (like sending is
- *    blocked).  This function is thread safe and private messages can be
+ *    blocked).  This function is thread safe and channel messages can be
  *    sent from multiple threads.
  *
  ***/