More client library rewrites (key agreement, plus other).
[silc.git] / lib / silcclient / client.h
index 59bb12b1c73c971d9147c6a4209eebbb393a8d76..53a5550aaea5b22cfb7aa21109ce54aceaa63331 100644 (file)
 /* Forward declarations */
 typedef struct SilcClientStruct *SilcClient;
 typedef struct SilcClientConnectionStruct *SilcClientConnection;
-typedef struct SilcClientPingStruct SilcClientPing;
-typedef struct SilcClientAwayStruct SilcClientAway;
-typedef struct SilcClientKeyAgreementStruct *SilcClientKeyAgreement;
-typedef struct SilcClientFtpSessionStruct *SilcClientFtpSession;
 typedef struct SilcClientEntryStruct *SilcClientEntry;
 typedef struct SilcChannelEntryStruct *SilcChannelEntry;
 typedef struct SilcServerEntryStruct *SilcServerEntry;
+
+typedef struct SilcClientAwayStruct SilcClientAway;
+typedef struct SilcClientKeyAgreementStruct *SilcClientKeyAgreement;
+typedef struct SilcClientFtpSessionStruct *SilcClientFtpSession;
 typedef struct SilcClientCommandReplyContextStruct
                                            *SilcClientCommandReplyContext;
 typedef struct SilcChannelUserStruct *SilcChannelUser;
@@ -57,10 +57,40 @@ typedef struct SilcClientEntryInternalStruct {
   unsigned int valid       : 1;        /* FALSE if this entry is not valid */
   unsigned int resolving   : 1; /* TRUE when entry is being resolved */
   unsigned int generated   : 1; /* TRUE if library generated `key' */
-  unsigned int prv_resp    : 1; /* TRUE if private message key indicator
-                                  has been received (responder). */
+  unsigned int prv_resp    : 1; /* TRUE if we are responder when using
+                                  private message keys. */
   SilcUInt16 resolve_cmd_ident;        /* Command identifier when resolving */
   SilcAtomic8 refcnt;          /* Reference counter */
 } SilcClientEntryInternal;
 
+/* Internal channel entry context */
+typedef struct SilcChannelEntryInternalStruct {
+  /* SilcChannelEntry status information */
+  SilcDList old_channel_keys;
+  SilcDList old_hmacs;
+
+  /* Channel private keys */
+  SilcDList private_keys;                   /* List of private keys or NULL */
+  SilcChannelPrivateKey curr_key;           /* Current private key */
+
+  /* Channel keys */
+  SilcCipher channel_key;                    /* The channel key */
+  SilcHmac hmac;                            /* Current HMAC */
+  unsigned char iv[SILC_CIPHER_MAX_IV_SIZE]; /* Current IV */
+
+  SilcUInt16 resolve_cmd_ident;                     /* Channel information resolving
+                                               identifier. This is used when
+                                               resolving users, and other
+                                               stuff that relates to the
+                                               channel. Not used for the
+                                               channel resolving itself. */
+  SilcAtomic8 refcnt;                       /* Reference counter */
+} SilcChannelEntryInternal;
+
+/* Internal server entry context */
+typedef struct SilcServerEntryInternalStruct {
+  SilcUInt16 resolve_cmd_ident;                     /* Resolving identifier */
+  SilcAtomic8 refcnt;                       /* Reference counter */
+} SilcServerEntryInternal;
+
 #endif /* CLIENT_H */