Initial client library rewrite, connects to remote server already.
[silc.git] / lib / silcclient / client.h
1 /*
2
3   client.h
4
5   Author: Pekka Riikonen <priikone@silcnet.org>
6
7   Copyright (C) 1997 - 2006 Pekka Riikonen
8
9   This program is free software; you can redistribute it and/or modify
10   it under the terms of the GNU General Public License as published by
11   the Free Software Foundation; version 2 of the License.
12
13   This program is distributed in the hope that it will be useful,
14   but WITHOUT ANY WARRANTY; without even the implied warranty of
15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16   GNU General Public License for more details.
17
18 */
19
20 #ifndef CLIENT_H
21 #define CLIENT_H
22
23 #ifndef SILCCLIENT_H
24 #error "Do not include this header directly"
25 #endif
26
27 /* Forward declarations */
28 typedef struct SilcClientStruct *SilcClient;
29 typedef struct SilcClientConnectionStruct *SilcClientConnection;
30 typedef struct SilcClientPingStruct SilcClientPing;
31 typedef struct SilcClientAwayStruct SilcClientAway;
32 typedef struct SilcClientKeyAgreementStruct *SilcClientKeyAgreement;
33 typedef struct SilcClientFtpSessionStruct *SilcClientFtpSession;
34 typedef struct SilcClientEntryStruct *SilcClientEntry;
35 typedef struct SilcChannelEntryStruct *SilcChannelEntry;
36 typedef struct SilcServerEntryStruct *SilcServerEntry;
37 typedef struct SilcClientCommandReplyContextStruct
38                                            *SilcClientCommandReplyContext;
39 typedef struct SilcChannelUserStruct *SilcChannelUser;
40 typedef struct SilcClientInternalStruct *SilcClientInternal;
41 typedef struct SilcClientConnectionInternalStruct
42                                            *SilcClientConnectionInternal;
43 typedef struct SilcChannelPrivateKeyStruct *SilcChannelPrivateKey;
44
45
46 /* Internal client entry context */
47 typedef struct SilcClientEntryInternalStruct {
48   SilcCipher send_key;          /* Private message key for sending */
49   SilcCipher receive_key;       /* Private message key for receiving */
50   SilcHmac hmac_send;           /* Private mesage key HMAC for sending */
51   SilcHmac hmac_receive;        /* Private mesage key HMAC for receiving */
52   unsigned char *key;           /* Valid if application provided the key */
53   SilcUInt32 key_len;           /* Key data length */
54   SilcClientKeyAgreement ke;    /* Current key agreement context or NULL */
55
56   /* Flags */
57   unsigned int valid       : 1; /* FALSE if this entry is not valid */
58   unsigned int resolving   : 1; /* TRUE when entry is being resolved */
59   unsigned int generated   : 1; /* TRUE if library generated `key' */
60   unsigned int prv_resp    : 1; /* TRUE if private message key indicator
61                                    has been received (responder). */
62   SilcUInt16 resolve_cmd_ident; /* Command identifier when resolving */
63   SilcAtomic8 refcnt;           /* Reference counter */
64 } SilcClientEntryInternal;
65
66 #endif /* CLIENT_H */