uint32 key_len;
} *SilcServerChannelRekey;
+/* Generic rekey context for connections */
+typedef struct {
+ /* Current sending encryption key, provided for re-key. The `pfs'
+ is TRUE if the Perfect Forward Secrecy is performed in re-key. */
+ unsigned char *send_enc_key;
+ uint32 enc_key_len;
+ int ske_group;
+ bool pfs;
+ uint32 timeout;
+ void *context;
+} *SilcServerRekey;
+
/*
Generic ID list data structure.
SilcCipher send_key;
SilcCipher receive_key;
+ /* Re-key context */
+ SilcServerRekey rekey;
+
/* Hash selected in the SKE protocol, NULL if not needed at all */
SilcHash hash;
- /* HMAC and raw key data */
- SilcHmac hmac;
- unsigned char *hmac_key;
- uint32 hmac_key_len;
+ /* HMAC */
+ SilcHmac hmac_send;
+ SilcHmac hmac_receive;
- /* public key */
+ /* Public key */
SilcPublicKey public_key;
long last_receive; /* Time last received data */
long last_sent; /* Time last sent data */
- unsigned char registered; /* Boolean whether connection is registered */
+ bool registered; /* Boolean whether connection is registered */
} *SilcIDListData, SilcIDListDataStruct;
/*
Logical name of the server. There is no limit of the length of the
server name. This is usually the same name as defined in DNS.
- int server_type
+ uint8 server_type
Type of the server. SILC_SERVER or SILC_ROUTER are the possible
choices for this.
SilcIDListDataStruct data;
char *server_name;
- int server_type;
+ uint8 server_type;
SilcServerID *id;
char *server_info;
char *motd;
This entry used only by the SilcChannelEntry object and it holds
information about current clients (ie. users) on channel. Following
- short description of the fields:
+ short description of the fields:
SilcClientEntry client
SilcClientEntry we have this here for fast access to the channel when
used by SilcClientEntry.
- struct SilcChannelClientEntryStruct *client_list
- struct SilcChannelClientEntryStruct *channel_list
-
- List member pointers. This structure is used by channel entry and
- client entry thus we must have separate list member pointers for
- them since we are using same entry for both lists (the entry is not
- duplicated). SilcList requires this.
-
*/
typedef struct SilcChannelClientEntryStruct {
SilcClientEntry client;
uint32 mode;
SilcChannelEntry channel;
- struct SilcChannelClientEntryStruct *client_list;
- struct SilcChannelClientEntryStruct *channel_list;
} *SilcChannelClientEntry;
/*
Generic data structure to hold data common to all ID entries.
+ unsigned char *nickname
+
+ The nickname of the client.
+
+ char *servername
+
+ The name of the server where the client is from. MAy be NULL.
+
char username
Client's usename. This is defined in the following manner:
nickname. Nickname is not relevant information that would need to be
saved as plain.
- int mode
+ uint32 mode
Client's mode. Client maybe for example server operator or
router operator (SILC operator).
not allow any command to be exeucted more than once in about
2 seconds. This is result of normal time().
- char fast_command
+ uint8 fast_command
Counter to check command bursts. By default, up to 5 commands
are allowed before limiting the execution. See command flags
cell this client is coming from. This is used to route messages to
this client.
- SilcList channels
+ SilcHashTable channels;
- List of channels this client has joined.
+ All the channels this client has joined. The context saved in the
+ hash table shares memory with the channel entrys `user_list' hash
+ table.
void *connection
SilcIDListDataStruct data;
unsigned char *nickname;
+ char *servername;
char *username;
char *userinfo;
SilcClientID *id;
- int mode;
+ uint32 mode;
long last_command;
- char fast_command;
+ uint8 fast_command;
/* Pointer to the router */
SilcServerEntry router;
- /* List of channels client has joined to */
- SilcList channels;
+ /* All channels this client has joined */
+ SilcHashTable channels;
/* Connection data */
void *connection;
ID of the channel. This includes all the information SILC will ever
need.
- int global_users
+ bool global_users
Boolean value to tell whether there are users outside this server
on this channel. This is set to TRUE if router sends message to
if the method is SILC_AUTH_PASSWORD. If it is SILC_AUTH_PUBLIC_KEY
then the `founder_passwd' is NULL.
+ SilcHashTable user_list
+
+ All users joined on this channel. Note that the context saved to
+ this entry shares memory with the client entrys `channels' hash
+ table.
+
SilcServerEntry router
This is a pointer to the server list. This is the router server
char *channel_name;
uint32 mode;
SilcChannelID *id;
- int global_users;
+ bool global_users;
char *topic;
char *cipher;
char *hmac_name;
char *invite_list;
char *ban_list;
- /* List of users on channel */
- SilcList user_list;
+ /* All users on this channel */
+ SilcHashTable user_list;
/* Pointer to the router */
SilcServerEntry router;
SilcServerID *new_id);
int silc_idlist_del_server(SilcIDList id_list, SilcServerEntry entry);
SilcClientEntry
-silc_idlist_add_client(SilcIDList id_list, unsigned char *nickname,
- uint32 nickname_len, char *username,
+silc_idlist_add_client(SilcIDList id_list, char *nickname, char *username,
char *userinfo, SilcClientID *id,
SilcServerEntry router, void *connection);
int silc_idlist_del_client(SilcIDList id_list, SilcClientEntry entry);
SilcClientEntry **clients,
uint32 *clients_count);
SilcClientEntry
-silc_idlist_find_client_by_hash(SilcIDList id_list, char *nickname,
- SilcHash md5hash, SilcIDCacheEntry *ret_entry);
-SilcClientEntry
silc_idlist_find_client_by_id(SilcIDList id_list, SilcClientID *id,
SilcIDCacheEntry *ret_entry);
SilcClientEntry