5 Author: Pekka Riikonen <priikone@silcnet.org>
7 Copyright (C) 2006 - 2007 Pekka Riikonen
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.
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.
20 #ifndef SILCCLIENT_ENTRY_H
21 #define SILCCLIENT_ENTRY_H
24 #error "Do not include this header directly, include silcclient.h instead"
27 /****s* silcclient/SilcClientAPI/SilcClientEntry
31 * typedef struct SilcClientEntryStruct { ... } *SilcClientEntry;
35 * This structure represents a client or a user in the SILC network.
36 * The local user has this structure also and it can be accessed from
37 * SilcClientConnection structure. All other users in the SILC network
38 * that are accessed using the Client Library routines will have their
39 * own SilcClientEntry structure. For example, when finding users by
40 * their nickname the Client Library returns this structure back to
41 * the application. All strings in the structure are UTF-8 encoded.
43 * Application may store its own pointer into the context pointer in
48 * If application wants to store nickname or any of the other strings
49 * it should always duplicated them.
51 * None of the string arrays are set if the first character is '\0'.
52 * All string arrays are always NULL terminated.
54 * If application stores the SilcClientEntry it must always take
55 * a reference of it by calling silc_client_ref_client function. The
56 * reference must be released after it is not needed anymore by calling
57 * silc_client_unref_client function.
61 struct SilcClientEntryStruct {
62 char nickname[128 + 1]; /* Nickname */
63 char username[128 + 1]; /* Username */
64 char hostname[256 + 1]; /* Hostname */
65 char server [256 + 1]; /* SILC server name */
66 char *realname; /* Realname (userinfo) */
67 char *nickname_normalized; /* Normalized nickname */
69 SilcClientID id; /* The Client ID */
70 SilcUInt32 mode; /* User mode in SILC, see SilcUserMode */
71 SilcPublicKey public_key; /* User's public key, may be NULL */
72 SilcHashTable channels; /* Channels client has joined */
73 SilcDList attrs; /* Requested Attributes (maybe NULL) */
74 unsigned char fingerprint[20]; /* SHA-1 fingerprint of the public key */
76 void *context; /* Application specific context */
77 SilcClientEntryInternal internal;
81 /****s* silcclient/SilcClientAPI/SilcChannelEntry
85 * typedef struct SilcChannelEntryStruct { ... } *SilcChannelEntry;
89 * This structure represents a channel in the SILC network. All
90 * channels that the client are aware of or have joined in will be
91 * represented as SilcChannelEntry. The structure includes information
92 * about the channel. All strings in the structure are UTF-8 encoded.
94 * Application may store its own pointer into the context pointer in
99 * If application stores the SilcChannelEntry it must always take
100 * a reference of it by calling silc_client_ref_channel function. The
101 * reference must be released after it is not needed anymore by calling
102 * silc_client_unref_channel function.
106 struct SilcChannelEntryStruct {
107 char *channel_name; /* Channel name */
108 char *topic; /* Current topic, may be NULL */
109 SilcPublicKey founder_key; /* Founder key, may be NULL */
110 SilcDList channel_pubkeys; /* Channel public keys, may be NULL */
111 SilcChannelID id; /* Channel ID */
112 SilcUInt32 mode; /* Channel mode, ChannelModes. */
113 SilcUInt32 user_limit; /* User limit on channel */
114 SilcHashTable user_list; /* Joined users. Key to hash table is
115 SilcClientEntry, context is
118 void *context; /* Application specific context */
119 SilcChannelEntryInternal internal;
123 /****s* silcclient/SilcClientAPI/SilcServerEntry
127 * typedef struct SilcServerEntryStruct { ... } *SilcServerEntry;
131 * This structure represents a server in the SILC network. All servers
132 * that the client is aware of and have for example resolved with
133 * SILC_COMMAND_INFO command have their on SilcServerEntry structure.
134 * Server's public key is present only if it has been retrieved using
135 * SILC_COMMAND_GETKEY command. All strings in the structure are UTF-8
138 * Application may store its own pointer into the context pointer in
143 * If application stores the SilcServerEntry it must always take
144 * a reference of it by calling silc_client_ref_server function. The
145 * reference must be released after it is not needed anymore by calling
146 * silc_client_unref_server function.
150 struct SilcServerEntryStruct {
151 /* General information */
152 char *server_name; /* Server name */
153 char *server_info; /* Server info */
154 SilcServerID id; /* Server ID */
155 SilcPublicKey public_key; /* Server public key, may be NULL */
157 void *context; /* Application specific context */
158 SilcServerEntryInternal internal;
162 /* SilcClientEntry routines */
164 /****f* silcclient/SilcClientAPI/SilcGetClientCallback
168 * typedef void (*SilcGetClientCallback)(SilcClient client,
169 * SilcClientConnection conn,
176 * Callback function given to various client search functions. The
177 * found entries are allocated into the `clients' list. The list must
178 * not be freed by the receiver, the library will free it later. If the
179 * `clients' is NULL, no such clients exist in the SILC network, and
180 * the `status' will include the error. Each entry in the `clients'
181 * is SilcClientEntry.
185 * If the application stores any of the SilcClientEntry pointers from
186 * the `clients' list it must reference it with silc_client_ref_client
189 * Application must not free the returned `clients' list.
192 typedef void (*SilcGetClientCallback)(SilcClient client,
193 SilcClientConnection conn,
198 /****f* silcclient/SilcClientAPI/silc_client_lock_client
202 * void silc_client_lock_client(SilcClientEntry client_entry);
206 * Acquires lock for the client entry indicate by `client_entry'. When
207 * application wants to access `client_entry' it must lock the entry
208 * before reading any data from the `client_entry'. The lock must be
209 * unlocked with silc_client_unlock_client.
213 * The entry must be unlocked before calling any Client Library API
214 * functions where the entry is given as argument, unless otherwise stated.
216 * The entry should not be locked for long periods of time. For example,
217 * it is not appropriate to hold the lock while waiting user interface to
218 * be drawn. The appropriate way is to read the data and duplicate it if
219 * necessary, unlock the entry, then draw on the user interface.
221 * This function is not needed if application is not multithreaded.
224 void silc_client_lock_client(SilcClientEntry client_entry);
226 /****f* silcclient/SilcClientAPI/silc_client_unlock_client
230 * void silc_client_unlock_client(SilcClientEntry client_entry);
234 * Releases the lock acquired with silc_client_lock_client.
237 void silc_client_unlock_client(SilcClientEntry client_entry);
239 /****f* silcclient/SilcClientAPI/silc_client_ref_client
244 * silc_client_ref_client(SilcClient client,
245 * SilcClientConnection conn,
246 * SilcClientEntry client_entry);
250 * Takes a reference of the client entry indicated by `client_entry'
251 * The reference must be released by calling silc_client_unref_client
252 * after it is not needed anymore. Returns `client_entry'.
255 SilcClientEntry silc_client_ref_client(SilcClient client,
256 SilcClientConnection conn,
257 SilcClientEntry client_entry);
259 /****f* silcclient/SilcClientAPI/silc_client_unref_client
263 * void silc_client_unref_client(SilcClient client,
264 * SilcClientConnection conn,
265 * SilcClientEntry client_entry);
269 * Releases the client entry reference indicated by `client_entry'.
272 void silc_client_unref_client(SilcClient client, SilcClientConnection conn,
273 SilcClientEntry client_entry);
275 /****f* silcclient/SilcClientAPI/silc_client_list_free
279 * void silc_client_list_free(SilcClient client,
280 * SilcClientConnection conn,
281 * SilcDList client_list);
285 * Free's client entry list that has been returned by various library
289 void silc_client_list_free(SilcClient client, SilcClientConnection conn,
290 SilcDList client_list);
292 /****f* silcclient/SilcClientAPI/silc_client_get_clients
296 * SilcUInt16 silc_client_get_clients(SilcClient client,
297 * SilcClientConnection conn,
298 * const char *nickname,
299 * const char *server,
300 * SilcGetClientCallback completion,
305 * Finds client entry or entries by the `nickname' and `server'. The
306 * completion callback will be called when the client entries has been
307 * found. After the server returns the client information it is cached
308 * and can be accesses locally at a later time. The resolving is done
309 * with IDENTIFY command. The `server' may be NULL. Returns 0 on
310 * error and the command identifier used with the command otherwise.
314 * This function is always asynchronous and resolves the client
315 * information from the server. Thus, if you already know the client
316 * information then use the silc_client_get_client_by_id function to
317 * get the client entry since this function may be very slow and should
318 * be used only to initially get the client entries.
320 * This function resolves only the relevant information (user's nickname
321 * and username). It does not resolve for example user's real name,
322 * joined channel list or other information. To resolve all the details
323 * use silc_client_get_clients_whois instead.
326 SilcUInt16 silc_client_get_clients(SilcClient client,
327 SilcClientConnection conn,
328 const char *nickname,
330 SilcGetClientCallback completion,
333 /****f* silcclient/SilcClientAPI/silc_client_get_clients_whois
338 * silc_client_get_clients_whois(SilcClient client,
339 * SilcClientConnection conn,
340 * const char *nickname,
341 * const char *server,
342 * SilcBuffer attributes,
343 * SilcGetClientCallback completion,
348 * Finds client entry or entries by the `nickname' and `server'. The
349 * completion callback will be called when the client entries has been
350 * found. After the server returns the client information it is cached
351 * and can be accesses locally at a later time. The resolving is done
352 * with WHOIS command. The `server' may be NULL. Returns 0 on error,
353 * and the command identifier used with the command otherwise.
355 * If the `attributes' is non-NULL then the buffer includes Requested
356 * Attributes which can be used to fetch very detailed information
357 * about the user. If it is NULL then only normal WHOIS query is
358 * made (for more information about attributes see SilcAttribute).
359 * Caller may create the `attributes' with silc_client_attributes_request
364 * The resolving is done with WHOIS command. For this reason this
365 * command may take a long time because it resolves detailed user
369 SilcUInt16 silc_client_get_clients_whois(SilcClient client,
370 SilcClientConnection conn,
371 const char *nickname,
373 SilcBuffer attributes,
374 SilcGetClientCallback completion,
377 /****f* silcclient/SilcClientAPI/silc_client_get_clients_local
381 * SilcDList silc_client_get_clients_local(SilcClient client,
382 * SilcClientConnection conn,
383 * const char *nickname,
384 * const char *format);
388 * Same as silc_client_get_clients function but does not resolve anything
389 * from the server. This checks local cache and returns all matching
390 * clients from the local cache. If none was found this returns NULL.
391 * The `nickname' is the real nickname of the client, and the `format'
392 * is the formatted nickname to find exact match from multiple found
393 * entries. The format must be same as given in the SilcClientParams
394 * structure to the client library. If the `format' is NULL all found
395 * clients by `nickname' are returned. The caller must free the
396 * returned list by silc_client_list_free function.
400 * If the application stores any of the SilcClientEntry pointers from
401 * the returned list it must reference it with silc_client_ref_client
404 * Application must free the returned list with silc_client_list_free
408 SilcDList silc_client_get_clients_local(SilcClient client,
409 SilcClientConnection conn,
410 const char *nickname,
413 /****f* silcclient/SilcClientAPI/silc_client_get_clients_by_channel
417 * void silc_client_get_clients_by_channel(SilcClient client,
418 * SilcClientConnection conn,
419 * SilcChannelEntry channel,
420 * SilcGetClientCallback completion,
425 * Gets client entries by the channel indicated by `channel'. Thus,
426 * it resovles the users currently on that channel. If all users are
427 * already resolved this returns the users from the channel. If the
428 * users are resolved only partially this resolves the complete user
429 * information. If no users are resolved on this channel at all, this
430 * calls USERS command to resolve all users on the channel. The `completion'
431 * will be called after the entries are available. When server returns
432 * the client information it will be cached and can be accessed locally
435 * This function can be used for example in SILC_COMMAND_JOIN command
436 * reply handling in application to resolve users on that channel. It
437 * also can be used after calling silc_client_get_channel_resolve to
438 * resolve users on that channel.
442 * The resolving is done with WHOIS command. For this reason this
443 * command may take a long time because it resolves detailed user
447 void silc_client_get_clients_by_channel(SilcClient client,
448 SilcClientConnection conn,
449 SilcChannelEntry channel,
450 SilcGetClientCallback completion,
453 /****f* silcclient/SilcClientAPI/silc_client_get_clients_by_list
458 * silc_client_get_clients_by_list(SilcClient client,
459 * SilcClientConnection conn,
460 * SilcUInt32 list_count,
461 * SilcBuffer client_id_list,
462 * SilcGetClientCallback completion,
467 * Gets client entries by the list of client ID's `client_id_list'. This
468 * always resolves those client ID's it doesn't know about from the server.
469 * The `client_id_list' is a list of ID Payloads added one after other.
470 * JOIN command reply and USERS command reply for example returns this sort
471 * of list. The `completion' will be called after the entries are available.
472 * When server returns the client information it will be cached and can be
473 * accessed locally at a later time. The resolving is done with WHOIS
476 * Returns command identifier for the resolving. It can be used to attach
477 * a pending command to it, if needed. Returns 0 when no resolving was
478 * done or wasn't needed (completion is called before this returns).
482 * If even after resolving some Client ID in the `client_id_list' is
483 * unknown it will be ignored and error is not returned.
486 SilcUInt16 silc_client_get_clients_by_list(SilcClient client,
487 SilcClientConnection conn,
488 SilcUInt32 list_count,
489 SilcBuffer client_id_list,
490 SilcGetClientCallback completion,
493 /****f* silcclient/SilcClientAPI/silc_client_get_client_by_id
497 * SilcClientEntry silc_client_get_client_by_id(SilcClient client,
498 * SilcClientConnection conn,
499 * SilcClientID *client_id);
503 * Find client entry by the client's ID. Returns the entry or NULL
504 * if the entry was not found. This checks the local cache and does
505 * not resolve anything from server.
509 * The returned SilcClientEntry has been referenced by the library and
510 * the caller must call silc_client_unref_client after the entry is not
514 SilcClientEntry silc_client_get_client_by_id(SilcClient client,
515 SilcClientConnection conn,
516 SilcClientID *client_id);
518 /****f* silcclient/SilcClientAPI/silc_client_get_client_by_id_resolve
523 * silc_client_get_client_by_id_resolve(SilcClient client,
524 * SilcClientConnection conn,
525 * SilcClientID *client_id,
526 * SilcBuffer attributes,
527 * SilcGetClientCallback completion,
532 * Same as silc_client_get_client_by_id but will always resolve the
533 * information from the server. Use this only if you know that you
534 * do not have the entry and the only thing you know about the client
535 * is its ID. When server returns the client information it will be
536 * cache and can be accessed locally at a later time. The resolving
537 * is done by sending WHOIS command.
539 * Returns command identifier for the resolving. It can be used to attach
540 * a pending command to it, if needed. Returns 0 on error.
542 * If the `attributes' is non-NULL then the buffer includes Requested
543 * Attributes which can be used to fetch very detailed information
544 * about the user. If it is NULL then only normal WHOIS query is
545 * made (for more information about attributes see SilcAttribute).
546 * Caller may create the `attributes' with silc_client_attributes_request
551 silc_client_get_client_by_id_resolve(SilcClient client,
552 SilcClientConnection conn,
553 SilcClientID *client_id,
554 SilcBuffer attributes,
555 SilcGetClientCallback completion,
558 /* SilcChannelEntry routines */
560 /****f* silcclient/SilcClientAPI/SilcGetChannelCallback
564 * typedef void (*SilcGetChannelCallback)(SilcClient client,
565 * SilcClientConnection conn,
567 * SilcDList channels,
572 * Callback function given to various channel resolving functions.
573 * The found entries are included in the `channels' list and each entry
574 * in the list is SilcChannelEntry. If `channels' is NULL then no such
575 * channel exist in the network and the `status' will indicate the error.
579 * If the application stores any of the SilcChannelEntry pointers from
580 * the `channels' list it must reference it with silc_client_ref_channel
583 * Application must not free the returned `channels' list.
586 typedef void (*SilcGetChannelCallback)(SilcClient client,
587 SilcClientConnection conn,
592 /****f* silcclient/SilcClientAPI/silc_client_lock_channel
596 * void silc_client_lock_channel(SilcChannelEntry channel_entry);
600 * Acquires lock for the channel entry indicate by `channel_entry'. When
601 * application wants to access `channel_entry' it must lock the entry
602 * before reading any data from the `channel_entry'. The lock must be
603 * unlocked with silc_client_unlock_channel.
607 * The entry must be unlocked before calling any Client Library API
608 * functions where the entry is given as argument, unless otherwise stated.
610 * The entry should not be locked for long periods of time. For example,
611 * it is not appropriate to hold the lock while waiting user interface to
612 * be drawn. The appropriate way is to read the data and duplicate it if
613 * necessary, unlock the entry, then draw on the user interface.
615 * This function is not needed if application is not multithreaded.
618 void silc_client_lock_channel(SilcChannelEntry channel_entry);
620 /****f* silcclient/SilcClientAPI/silc_client_unlock_channel
624 * void silc_client_unlock_channel(SilcChannelEntry channel_entry);
628 * Releases the lock acquired with silc_client_lock_channel.
631 void silc_client_unlock_channel(SilcChannelEntry channel_entry);
633 /****f* silcclient/SilcClientAPI/silc_client_ref_channel
638 * silc_client_ref_channel(SilcClient client,
639 * SilcClientConnection conn,
640 * SilcChannelEntry channel_entry);
644 * Takes a reference of the channel entry indicated by `channel_entry'
645 * The reference must be released by calling silc_client_unref_channel
646 * after it is not needed anymore. Returns `channel_entry'.
649 SilcChannelEntry silc_client_ref_channel(SilcClient client,
650 SilcClientConnection conn,
651 SilcChannelEntry channel_entry);
653 /****f* silcclient/SilcClientAPI/silc_client_unref_channel
657 * void silc_client_unref_channel(SilcClient client,
658 * SilcClientConnection conn,
659 * SilcChannelEntry channel_entry);
663 * Releases the channel entry reference indicated by `channel_entry'.
666 void silc_client_unref_channel(SilcClient client, SilcClientConnection conn,
667 SilcChannelEntry channel_entry);
669 /****f* silcclient/SilcClientAPI/silc_client_list_free_channel
673 * void silc_client_list_free_channel(SilcClient client,
674 * SilcClientConnection conn,
675 * SilcDList channel_list);
679 * Free's channel entry list that has been returned by various library
683 void silc_client_list_free_channels(SilcClient client,
684 SilcClientConnection conn,
685 SilcDList channel_list);
687 /****f* silcclient/SilcClientAPI/silc_client_get_channel
691 * SilcChannelEntry silc_client_get_channel(SilcClient client,
692 * SilcClientConnection conn,
693 * char *channel_name);
697 * Finds entry for channel by the channel name. Returns the entry or NULL
698 * if the entry was not found. It is found only if the client is joined
699 * to the channel. Use silc_client_get_channel_resolve or
700 * silc_client_get_channel_by_id_resolve to resolve channel that client
705 * The returned SilcChannelEntry has been referenced by the library and
706 * the caller must call silc_client_unref_channel after the entry is not
710 SilcChannelEntry silc_client_get_channel(SilcClient client,
711 SilcClientConnection conn,
714 /****f* silcclient/SilcClientAPI/silc_client_get_channel_resolve
718 * void silc_client_get_channel_resolve(SilcClient client,
719 * SilcClientConnection conn,
720 * char *channel_name,
721 * SilcGetChannelCallback completion,
726 * Resolves entry for channel by the channel name from the server.
727 * The resolving is done with IDENTIFY command. Note that users on
728 * the channel are not resolved at the same time. Use for example
729 * silc_client_get_clients_by_channel to resolve all users on a channel.
732 void silc_client_get_channel_resolve(SilcClient client,
733 SilcClientConnection conn,
735 SilcGetChannelCallback completion,
738 /****f* silcclient/SilcClientAPI/silc_client_get_channel_by_id
743 * silc_client_get_channel_by_id(SilcClient client,
744 * SilcClientConnection conn,
745 * SilcChannelID *channel_id);
749 * Finds channel entry by the channel ID. Returns the entry or NULL
750 * if the entry was not found. This checks the local cache and does
751 * not resolve anything from server.
755 * The returned SilcChannelEntry has been referenced by the library and
756 * the caller must call silc_client_unref_channel after the entry is not
760 SilcChannelEntry silc_client_get_channel_by_id(SilcClient client,
761 SilcClientConnection conn,
762 SilcChannelID *channel_id);
764 /****f* silcclient/SilcClientAPI/silc_client_get_channel_by_id_resolve
769 * silc_client_get_channel_by_id_resolve(SilcClient client,
770 * SilcClientConnection conn,
771 * SilcChannelID *channel_id,
772 * SilcGetClientCallback completion,
777 * Resolves the channel information (its name mainly) from the server
778 * by the `channel_id'. Use this only if you know that you do not have
779 * the entry cached locally. The resolving is done with IDENTIFY command.
781 * Returns command identifier for the resolving. It can be used to attach
782 * a pending command to it, if needed. Returns 0 on error.
784 * Note that users on the channel are not resolved at the same time.
785 * Use for example silc_client_get_clients_by_channel to resolve all
786 * users on a channel.
790 silc_client_get_channel_by_id_resolve(SilcClient client,
791 SilcClientConnection conn,
792 SilcChannelID *channel_id,
793 SilcGetChannelCallback completion,
796 /* SilcServerEntry routines */
798 /****f* silcclient/SilcClientAPI/SilcGetServerCallback
802 * typedef void (*SilcGetServerCallback)(SilcClient client,
803 * SilcClientConnection conn,
810 * Callback function given to various server resolving functions.
811 * The found entries are included in the `servers' list and each entry
812 * in the list is SilcServerEntry. If `server' is NULL then no such
813 * server exist in the network and the `status' will indicate the error.
817 * If the application stores any of the SilcServerEntry pointers from
818 * the `server' list it must reference it with silc_client_ref_server
821 * Application must not free the returned `server' list.
824 typedef void (*SilcGetServerCallback)(SilcClient client,
825 SilcClientConnection conn,
830 /****f* silcclient/SilcClientAPI/silc_client_lock_server
834 * void silc_client_lock_server(SilcServerEntry server_entry);
838 * Acquires lock for the server entry indicate by `server_entry'. When
839 * application wants to access `server_entry' it must lock the entry
840 * before reading any data from the `server_entry'. The lock must be
841 * unlocked with silc_client_unlock_server.
845 * The entry must be unlocked before calling any Client Library API
846 * functions where the entry is given as argument, unless otherwise stated.
848 * The entry should not be locked for long periods of time. For example,
849 * it is not appropriate to hold the lock while waiting user interface to
850 * be drawn. The appropriate way is to read the data and duplicate it if
851 * necessary, unlock the entry, then draw on the user interface.
853 * This function is not needed if application is not multithreaded.
856 void silc_client_lock_server(SilcServerEntry server_entry);
858 /****f* silcclient/SilcClientAPI/silc_client_unlock_server
862 * void silc_client_unlock_server(SilcServerEntry server_entry);
866 * Releases the lock acquired with silc_client_lock_server.
869 void silc_client_unlock_server(SilcServerEntry server_entry);
871 /****f* silcclient/SilcClientAPI/silc_client_ref_server
876 * silc_client_ref_server(SilcClient client,
877 * SilcClientConnection conn,
878 * SilcServerEntry server_entry);
882 * Takes a reference of the server entry indicated by `server_entry'
883 * The reference must be released by calling silc_client_unref_server
884 * after it is not needed anymore. Returns `server_entry'.
887 SilcServerEntry silc_client_ref_server(SilcClient client,
888 SilcClientConnection conn,
889 SilcServerEntry server_entry);
891 /****f* silcclient/SilcClientAPI/silc_client_unref_server
895 * void silc_client_unref_server(SilcClient client,
896 * SilcClientConnection conn,
897 * SilcServerEntry server_entry);
901 * Releases the server entry reference indicated by `server_entry'.
904 void silc_client_unref_server(SilcClient client, SilcClientConnection conn,
905 SilcServerEntry server_entry);
907 /****f* silcclient/SilcClientAPI/silc_client_list_free_server
911 * void silc_client_list_free_server(SilcClient client,
912 * SilcClientConnection conn,
913 * SilcDList server_list);
917 * Free's server entry list that has been returned by various library
921 void silc_client_list_free_servers(SilcClient client,
922 SilcClientConnection conn,
923 SilcDList server_list);
925 /****f* silcclient/SilcClientAPI/silc_client_get_server
929 * SilcServerEntry silc_client_get_server(SilcClient client,
930 * SilcClientConnection conn,
935 * Finds entry for server by the server name. Returns the entry or NULL
936 * if the entry was not found.
939 SilcServerEntry silc_client_get_server(SilcClient client,
940 SilcClientConnection conn,
943 /****f* silcclient/SilcClientAPI/silc_client_get_server_by_id
947 * SilcServerEntry silc_client_get_server_by_id(SilcClient client,
948 * SilcClientConnection conn,
949 * SilcServerID *server_id);
953 * Finds entry for server by the server ID. Returns the entry or NULL
954 * if the entry was not found.
957 SilcServerEntry silc_client_get_server_by_id(SilcClient client,
958 SilcClientConnection conn,
959 SilcServerID *server_id);
961 /****f* silcclient/SilcClientAPI/silc_client_get_server_by_id_resolve
966 * silc_client_get_server_by_id_resolve(SilcClient client,
967 * SilcClientConnection conn,
968 * SilcServerID *server_id,
969 * SilcGetServerCallback completion,
974 * Resolves the server information by the `server_id'. The resolved
975 * server is returned into the `completion' callback.
977 * Returns command identifier for the resolving. It can be used to attach
978 * a pending command to it, if needed. Returns 0 on error.
982 silc_client_get_server_by_id_resolve(SilcClient client,
983 SilcClientConnection conn,
984 SilcServerID *server_id,
985 SilcGetServerCallback completion,
988 #endif /* SILCCLIENT_ENTRY_H */