Created SILC Client Libary by moving stuff from silc/ directory.
[silc.git] / lib / silcclient / idlist.h
1 /*
2
3   idlist.h
4
5   Author: Pekka Riikonen <priikone@poseidon.pspt.fi>
6
7   Copyright (C) 1997 - 2000 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; either version 2 of the License, or
12   (at your option) any later version.
13   
14   This program is distributed in the hope that it will be useful,
15   but WITHOUT ANY WARRANTY; without even the implied warranty of
16   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17   GNU General Public License for more details.
18
19 */
20
21 #ifndef IDLIST_H
22 #define IDLIST_H
23
24 /* Client entry context. When client receives information about new client
25    (it receives its ID, for example, by IDENTIFY request) we create new
26    client entry. This entry also includes the private message keys if
27    they are used. */
28 typedef struct SilcClientEntryStruct {
29   char *nickname;
30   char *server;
31   unsigned int num;
32   SilcClientID *id;
33
34   /* Keys, these are defined if private message key has been defined 
35      with the remote client. */
36   SilcCipher send_key;
37   SilcCipher receive_key;
38 } SilcClientEntryObject;
39
40 typedef SilcClientEntryObject *SilcClientEntry;
41
42 /* Channel entry context. This is allocate for every channel client has
43    joined to. This includes for example the channel specific keys */
44 /* XXX channel_key is the server generated key. Later this context must 
45    include the channel private key. */
46 typedef struct SilcChannelEntryStruct {
47   char *channel_name;
48   SilcChannelID *id;
49   unsigned int mode;
50   int on_channel;
51
52   /* Channel keys */
53   SilcCipher channel_key;
54   unsigned char *key;
55   unsigned int key_len;
56   unsigned char iv[SILC_CIPHER_MAX_IV_SIZE];
57 } SilcChannelEntryObject;
58
59 typedef SilcChannelEntryObject *SilcChannelEntry;
60
61 /* Prototypes */
62
63 SilcClientEntry silc_idlist_get_client(SilcClient client,
64                                        SilcClientConnection conn,
65                                        char *nickname,
66                                        char *server,
67                                        unsigned int num);
68 SilcChannelEntry silc_idlist_get_channel(SilcClient client,
69                                          SilcClientConnection conn,
70                                          char *channel);
71
72 #endif