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 /****h* silcclient/Client Library Interface
24 * This header file includes the SilcClientEntry, SilcChannelEntry and
25 * SilcServer entry structures and various routines to search, resolve and
26 * handle these structures.
28 * All entries (SilcClientEntry, SilcChannelEntry and SilcServerEntry) are
29 * reference counted. If application wishes to save an entry pointer it must
30 * always first acquire a reference. The reference must be released once the
31 * entry is not needed anymore. If application wants to read any data from
32 * the entry structure it must first lock the entry. This protects access to
33 * the entries in multithreaded environment. If threads are not used, locking
34 * the entries is not needed. They however still must be referenced even
35 * when threads are not used.
39 #ifndef SILCCLIENT_ENTRY_H
40 #define SILCCLIENT_ENTRY_H
43 #error "Do not include this header directly, include silcclient.h instead"
46 /****s* silcclient/SilcClientAPI/SilcClientEntry
50 * typedef struct SilcClientEntryStruct { ... } *SilcClientEntry;
54 * This structure represents a client or a user in the SILC network.
55 * The local user has this structure also and it can be accessed from
56 * SilcClientConnection structure. All other users in the SILC network
57 * that are accessed using the Client Library routines will have their
58 * own SilcClientEntry structure. For example, when finding users by
59 * their nickname the Client Library returns this structure back to
60 * the application. All strings in the structure are UTF-8 encoded.
62 * Application may store its own pointer into the context pointer in
67 * If application wants to store nickname or any of the other strings
68 * it should always duplicated them.
70 * None of the string arrays are set if the first character is '\0'.
71 * All string arrays are always zero ('\0') terminated.
73 * If application stores the SilcClientEntry it must always take
74 * a reference of it by calling silc_client_ref_client function. The
75 * reference must be released after it is not needed anymore by calling
76 * silc_client_unref_client function.
80 struct SilcClientEntryStruct {
81 char nickname[128 + 1]; /* Nickname */
82 char username[128 + 1]; /* Username */
83 char hostname[256 + 1]; /* Hostname */
84 char server [256 + 1]; /* SILC server name */
85 char *realname; /* Realname (userinfo) */
86 char *nickname_normalized; /* Normalized nickname */
88 SilcClientID id; /* The Client ID */
89 SilcUInt32 mode; /* User mode in SILC, see SilcUserMode */
90 SilcPublicKey public_key; /* User's public key, may be NULL */
91 SilcHashTable channels; /* Channels client has joined */
92 SilcDList attrs; /* Requested Attributes (maybe NULL) */
93 unsigned char fingerprint[20]; /* SHA-1 fingerprint of the public key */
95 void *context; /* Application specific context */
96 SilcClientEntryInternal internal;
100 /****s* silcclient/SilcClientAPI/SilcChannelEntry
104 * typedef struct SilcChannelEntryStruct { ... } *SilcChannelEntry;
108 * This structure represents a channel in the SILC network. All
109 * channels that the client are aware of or have joined in will be
110 * represented as SilcChannelEntry. The structure includes information
111 * about the channel. All strings in the structure are UTF-8 encoded.
113 * Application may store its own pointer into the context pointer in
118 * If application stores the SilcChannelEntry it must always take
119 * a reference of it by calling silc_client_ref_channel function. The
120 * reference must be released after it is not needed anymore by calling
121 * silc_client_unref_channel function.
125 struct SilcChannelEntryStruct {
126 char *channel_name; /* Channel name */
127 char *topic; /* Current topic, may be NULL */
128 SilcPublicKey founder_key; /* Founder key, may be NULL */
129 SilcDList channel_pubkeys; /* Channel public keys, may be NULL */
130 SilcChannelID id; /* Channel ID */
131 SilcUInt32 mode; /* Channel mode, ChannelModes. */
132 SilcUInt32 user_limit; /* User limit on channel */
133 SilcHashTable user_list; /* Joined users. Key to hash table is
134 SilcClientEntry, context is
137 void *context; /* Application specific context */
138 SilcChannelEntryInternal internal;
142 /****s* silcclient/SilcClientAPI/SilcServerEntry
146 * typedef struct SilcServerEntryStruct { ... } *SilcServerEntry;
150 * This structure represents a server in the SILC network. All servers
151 * that the client is aware of and have for example resolved with
152 * SILC_COMMAND_INFO command have their on SilcServerEntry structure.
153 * Server's public key is present only if it has been retrieved using
154 * SILC_COMMAND_GETKEY command. All strings in the structure are UTF-8
157 * Application may store its own pointer into the context pointer in
162 * If application stores the SilcServerEntry it must always take
163 * a reference of it by calling silc_client_ref_server function. The
164 * reference must be released after it is not needed anymore by calling
165 * silc_client_unref_server function.
169 struct SilcServerEntryStruct {
170 /* General information */
171 char *server_name; /* Server name */
172 char *server_info; /* Server info */
173 SilcServerID id; /* Server ID */
174 SilcPublicKey public_key; /* Server public key, may be NULL */
176 void *context; /* Application specific context */
177 SilcServerEntryInternal internal;
181 /* SilcClientEntry routines */
183 /****f* silcclient/SilcClientAPI/SilcGetClientCallback
187 * typedef void (*SilcGetClientCallback)(SilcClient client,
188 * SilcClientConnection conn,
195 * Callback function given to various client search functions. The
196 * found entries are allocated into the `clients' list. The list must
197 * not be freed by the receiver, the library will free it later. If the
198 * `clients' is NULL, no such clients exist in the SILC network, and
199 * the `status' will include the error. Each entry in the `clients'
200 * is SilcClientEntry.
204 * If the application stores any of the SilcClientEntry pointers from
205 * the `clients' list it must reference it with silc_client_ref_client
208 * Application must not free the returned `clients' list.
211 typedef void (*SilcGetClientCallback)(SilcClient client,
212 SilcClientConnection conn,
217 /****f* silcclient/SilcClientAPI/silc_client_lock_client
221 * void silc_client_lock_client(SilcClientEntry client_entry);
225 * Acquires lock for the client entry indicate by `client_entry'. When
226 * application wants to access `client_entry' it must lock the entry
227 * before reading any data from the `client_entry'. The lock must be
228 * unlocked with silc_client_unlock_client.
232 * The entry must be unlocked before calling any Client Library API
233 * functions where the entry is given as argument, unless otherwise stated.
235 * The entry should not be locked for long periods of time. For example,
236 * it is not appropriate to hold the lock while waiting user interface to
237 * be drawn. The appropriate way is to read the data and duplicate it if
238 * necessary, unlock the entry, then draw on the user interface.
240 * This function is not needed if application is not multithreaded.
243 void silc_client_lock_client(SilcClientEntry client_entry);
245 /****f* silcclient/SilcClientAPI/silc_client_unlock_client
249 * void silc_client_unlock_client(SilcClientEntry client_entry);
253 * Releases the lock acquired with silc_client_lock_client.
256 void silc_client_unlock_client(SilcClientEntry client_entry);
258 /****f* silcclient/SilcClientAPI/silc_client_ref_client
263 * silc_client_ref_client(SilcClient client,
264 * SilcClientConnection conn,
265 * SilcClientEntry client_entry);
269 * Takes a reference of the client entry indicated by `client_entry'
270 * The reference must be released by calling silc_client_unref_client
271 * after it is not needed anymore. Returns `client_entry'.
274 SilcClientEntry silc_client_ref_client(SilcClient client,
275 SilcClientConnection conn,
276 SilcClientEntry client_entry);
278 /****f* silcclient/SilcClientAPI/silc_client_unref_client
282 * void silc_client_unref_client(SilcClient client,
283 * SilcClientConnection conn,
284 * SilcClientEntry client_entry);
288 * Releases the client entry reference indicated by `client_entry'.
291 void silc_client_unref_client(SilcClient client, SilcClientConnection conn,
292 SilcClientEntry client_entry);
294 /****f* silcclient/SilcClientAPI/silc_client_list_free
298 * void silc_client_list_free(SilcClient client,
299 * SilcClientConnection conn,
300 * SilcDList client_list);
304 * Free's client entry list that has been returned by various library
308 void silc_client_list_free(SilcClient client, SilcClientConnection conn,
309 SilcDList client_list);
311 /****f* silcclient/SilcClientAPI/silc_client_get_clients
315 * SilcUInt16 silc_client_get_clients(SilcClient client,
316 * SilcClientConnection conn,
317 * const char *nickname,
318 * const char *server,
319 * SilcGetClientCallback completion,
324 * Finds client entry or entries by the `nickname' and `server'. The
325 * completion callback will be called when the client entries has been
326 * found. After the server returns the client information it is cached
327 * and can be accesses locally at a later time. The resolving is done
328 * with IDENTIFY command. The `server' may be NULL. The server
329 * associated with the nickname may be in the `nickname' (nick@server).
330 * Returns 0 on error and the command identifier used with the command
335 * This function is always asynchronous and resolves the client
336 * information from the server. Thus, if you already know the client
337 * information then use the silc_client_get_client_by_id function to
338 * get the client entry since this function may be very slow and should
339 * be used only to initially get the client entries.
341 * This function resolves only the relevant information (user's nickname
342 * and username). It does not resolve for example user's real name,
343 * joined channel list or other information. To resolve all the details
344 * use silc_client_get_clients_whois instead.
347 SilcUInt16 silc_client_get_clients(SilcClient client,
348 SilcClientConnection conn,
349 const char *nickname,
351 SilcGetClientCallback completion,
354 /****f* silcclient/SilcClientAPI/silc_client_get_clients_whois
359 * silc_client_get_clients_whois(SilcClient client,
360 * SilcClientConnection conn,
361 * const char *nickname,
362 * const char *server,
363 * SilcBuffer attributes,
364 * SilcGetClientCallback completion,
369 * Finds client entry or entries by the `nickname' and `server'. The
370 * completion callback will be called when the client entries has been
371 * found. After the server returns the client information it is cached
372 * and can be accesses locally at a later time. The resolving is done
373 * with WHOIS command. The `server' may be NULL. The server
374 * associated with the nickname may be in the `nickname' (nick@server).
375 * Returns 0 on error and the command identifier used with the command
378 * If the `attributes' is non-NULL then the buffer includes Requested
379 * Attributes which can be used to fetch very detailed information
380 * about the user. If it is NULL then only normal WHOIS query is
381 * made (for more information about attributes see SilcAttribute).
382 * Caller may create the `attributes' with silc_client_attributes_request
387 * The resolving is done with WHOIS command. For this reason this
388 * command may take a long time because it resolves detailed user
392 SilcUInt16 silc_client_get_clients_whois(SilcClient client,
393 SilcClientConnection conn,
394 const char *nickname,
396 SilcBuffer attributes,
397 SilcGetClientCallback completion,
400 /****f* silcclient/SilcClientAPI/silc_client_get_clients_local
404 * SilcDList silc_client_get_clients_local(SilcClient client,
405 * SilcClientConnection conn,
406 * const char *nickname,
407 * SilcBool return_all);
411 * Same as silc_client_get_clients function but does not resolve anything
412 * from the server. This checks local cache and returns matching clients
413 * from the local cache. If none was found this returns NULL. The
414 * `nickname' is the nickname to find and it may be a formatted nickname
415 * or a base nickname. If the `return_all' is TRUE this call will return
416 * all clients matching the `nickname' base. If it is FALSE this will
417 * return the exact match if `nickname' is a formatted nickname or the
418 * first matching nickname if it is not formatted. The formatted nickname
419 * must of the format specified in SilcClientParams. The caller must free
420 * the returned list by calling silc_client_list_free function.
424 * If the application stores any of the SilcClientEntry pointers from
425 * the returned list it must reference it with silc_client_ref_client
428 * Application must free the returned list with silc_client_list_free
432 SilcDList silc_client_get_clients_local(SilcClient client,
433 SilcClientConnection conn,
434 const char *nickname,
435 SilcBool return_all);
437 /****f* silcclient/SilcClientAPI/silc_client_get_clients_by_channel
441 * void silc_client_get_clients_by_channel(SilcClient client,
442 * SilcClientConnection conn,
443 * SilcChannelEntry channel,
444 * SilcGetClientCallback completion,
449 * Gets client entries by the channel indicated by `channel'. Thus,
450 * it resovles the users currently on that channel. If all users are
451 * already resolved this returns the users from the channel. If the
452 * users are resolved only partially this resolves the complete user
453 * information. If no users are resolved on this channel at all, this
454 * calls USERS command to resolve all users on the channel. The `completion'
455 * will be called after the entries are available. When server returns
456 * the client information it will be cached and can be accessed locally
459 * This function can be used for example in SILC_COMMAND_JOIN command
460 * reply handling in application to resolve users on that channel. It
461 * also can be used after calling silc_client_get_channel_resolve to
462 * resolve users on that channel.
466 * The resolving is done with WHOIS command. For this reason this
467 * command may take a long time because it resolves detailed user
471 void silc_client_get_clients_by_channel(SilcClient client,
472 SilcClientConnection conn,
473 SilcChannelEntry channel,
474 SilcGetClientCallback completion,
477 /****f* silcclient/SilcClientAPI/silc_client_get_client_by_id
481 * SilcClientEntry silc_client_get_client_by_id(SilcClient client,
482 * SilcClientConnection conn,
483 * SilcClientID *client_id);
487 * Find client entry by the client's ID. Returns the entry or NULL
488 * if the entry was not found. This checks the local cache and does
489 * not resolve anything from server.
493 * The returned SilcClientEntry has been referenced by the library and
494 * the caller must call silc_client_unref_client after the entry is not
498 SilcClientEntry silc_client_get_client_by_id(SilcClient client,
499 SilcClientConnection conn,
500 SilcClientID *client_id);
502 /****f* silcclient/SilcClientAPI/silc_client_get_client_by_id_resolve
507 * silc_client_get_client_by_id_resolve(SilcClient client,
508 * SilcClientConnection conn,
509 * SilcClientID *client_id,
510 * SilcBuffer attributes,
511 * SilcGetClientCallback completion,
516 * Same as silc_client_get_client_by_id but will always resolve the
517 * information from the server. Use this only if you know that you
518 * do not have the entry and the only thing you know about the client
519 * is its ID. When server returns the client information it will be
520 * cache and can be accessed locally at a later time. The resolving
521 * is done by sending WHOIS command.
523 * Returns command identifier for the resolving. It can be used to attach
524 * a pending command to it, if needed. Returns 0 on error.
526 * If the `attributes' is non-NULL then the buffer includes Requested
527 * Attributes which can be used to fetch very detailed information
528 * about the user. If it is NULL then only normal WHOIS query is
529 * made (for more information about attributes see SilcAttribute).
530 * Caller may create the `attributes' with silc_client_attributes_request
535 silc_client_get_client_by_id_resolve(SilcClient client,
536 SilcClientConnection conn,
537 SilcClientID *client_id,
538 SilcBuffer attributes,
539 SilcGetClientCallback completion,
542 /* SilcChannelEntry routines */
544 /****f* silcclient/SilcClientAPI/SilcGetChannelCallback
548 * typedef void (*SilcGetChannelCallback)(SilcClient client,
549 * SilcClientConnection conn,
551 * SilcDList channels,
556 * Callback function given to various channel resolving functions.
557 * The found entries are included in the `channels' list and each entry
558 * in the list is SilcChannelEntry. If `channels' is NULL then no such
559 * channel exist in the network and the `status' will indicate the error.
563 * If the application stores any of the SilcChannelEntry pointers from
564 * the `channels' list it must reference it with silc_client_ref_channel
567 * Application must not free the returned `channels' list.
570 typedef void (*SilcGetChannelCallback)(SilcClient client,
571 SilcClientConnection conn,
576 /****f* silcclient/SilcClientAPI/silc_client_lock_channel
580 * void silc_client_lock_channel(SilcChannelEntry channel_entry);
584 * Acquires lock for the channel entry indicate by `channel_entry'. When
585 * application wants to access `channel_entry' it must lock the entry
586 * before reading any data from the `channel_entry'. The lock must be
587 * unlocked with silc_client_unlock_channel.
591 * The entry must be unlocked before calling any Client Library API
592 * functions where the entry is given as argument, unless otherwise stated.
594 * The entry should not be locked for long periods of time. For example,
595 * it is not appropriate to hold the lock while waiting user interface to
596 * be drawn. The appropriate way is to read the data and duplicate it if
597 * necessary, unlock the entry, then draw on the user interface.
599 * This function is not needed if application is not multithreaded.
602 void silc_client_lock_channel(SilcChannelEntry channel_entry);
604 /****f* silcclient/SilcClientAPI/silc_client_unlock_channel
608 * void silc_client_unlock_channel(SilcChannelEntry channel_entry);
612 * Releases the lock acquired with silc_client_lock_channel.
615 void silc_client_unlock_channel(SilcChannelEntry channel_entry);
617 /****f* silcclient/SilcClientAPI/silc_client_ref_channel
622 * silc_client_ref_channel(SilcClient client,
623 * SilcClientConnection conn,
624 * SilcChannelEntry channel_entry);
628 * Takes a reference of the channel entry indicated by `channel_entry'
629 * The reference must be released by calling silc_client_unref_channel
630 * after it is not needed anymore. Returns `channel_entry'.
633 SilcChannelEntry silc_client_ref_channel(SilcClient client,
634 SilcClientConnection conn,
635 SilcChannelEntry channel_entry);
637 /****f* silcclient/SilcClientAPI/silc_client_unref_channel
641 * void silc_client_unref_channel(SilcClient client,
642 * SilcClientConnection conn,
643 * SilcChannelEntry channel_entry);
647 * Releases the channel entry reference indicated by `channel_entry'.
650 void silc_client_unref_channel(SilcClient client, SilcClientConnection conn,
651 SilcChannelEntry channel_entry);
653 /****f* silcclient/SilcClientAPI/silc_client_list_free_channel
657 * void silc_client_list_free_channel(SilcClient client,
658 * SilcClientConnection conn,
659 * SilcDList channel_list);
663 * Free's channel entry list that has been returned by various library
667 void silc_client_list_free_channels(SilcClient client,
668 SilcClientConnection conn,
669 SilcDList channel_list);
671 /****f* silcclient/SilcClientAPI/silc_client_get_channel
675 * SilcChannelEntry silc_client_get_channel(SilcClient client,
676 * SilcClientConnection conn,
677 * char *channel_name);
681 * Finds entry for channel by the channel name. Returns the entry or NULL
682 * if the entry was not found. It is found only if the client is joined
683 * to the channel. Use silc_client_get_channel_resolve or
684 * silc_client_get_channel_by_id_resolve to resolve channel that client
689 * The returned SilcChannelEntry has been referenced by the library and
690 * the caller must call silc_client_unref_channel after the entry is not
694 SilcChannelEntry silc_client_get_channel(SilcClient client,
695 SilcClientConnection conn,
698 /****f* silcclient/SilcClientAPI/silc_client_get_channel_resolve
702 * void silc_client_get_channel_resolve(SilcClient client,
703 * SilcClientConnection conn,
704 * char *channel_name,
705 * SilcGetChannelCallback completion,
710 * Resolves entry for channel by the channel name from the server.
711 * The resolving is done with IDENTIFY command. Note that users on
712 * the channel are not resolved at the same time. Use for example
713 * silc_client_get_clients_by_channel to resolve all users on a channel.
716 void silc_client_get_channel_resolve(SilcClient client,
717 SilcClientConnection conn,
719 SilcGetChannelCallback completion,
722 /****f* silcclient/SilcClientAPI/silc_client_get_channel_by_id
727 * silc_client_get_channel_by_id(SilcClient client,
728 * SilcClientConnection conn,
729 * SilcChannelID *channel_id);
733 * Finds channel entry by the channel ID. Returns the entry or NULL
734 * if the entry was not found. This checks the local cache and does
735 * not resolve anything from server.
739 * The returned SilcChannelEntry has been referenced by the library and
740 * the caller must call silc_client_unref_channel after the entry is not
744 SilcChannelEntry silc_client_get_channel_by_id(SilcClient client,
745 SilcClientConnection conn,
746 SilcChannelID *channel_id);
748 /****f* silcclient/SilcClientAPI/silc_client_get_channel_by_id_resolve
753 * silc_client_get_channel_by_id_resolve(SilcClient client,
754 * SilcClientConnection conn,
755 * SilcChannelID *channel_id,
756 * SilcGetClientCallback completion,
761 * Resolves the channel information (its name mainly) from the server
762 * by the `channel_id'. Use this only if you know that you do not have
763 * the entry cached locally. The resolving is done with IDENTIFY command.
765 * Returns command identifier for the resolving. It can be used to attach
766 * a pending command to it, if needed. Returns 0 on error.
768 * Note that users on the channel are not resolved at the same time.
769 * Use for example silc_client_get_clients_by_channel to resolve all
770 * users on a channel.
774 silc_client_get_channel_by_id_resolve(SilcClient client,
775 SilcClientConnection conn,
776 SilcChannelID *channel_id,
777 SilcGetChannelCallback completion,
780 /* SilcServerEntry routines */
782 /****f* silcclient/SilcClientAPI/SilcGetServerCallback
786 * typedef void (*SilcGetServerCallback)(SilcClient client,
787 * SilcClientConnection conn,
794 * Callback function given to various server resolving functions.
795 * The found entries are included in the `servers' list and each entry
796 * in the list is SilcServerEntry. If `server' is NULL then no such
797 * server exist in the network and the `status' will indicate the error.
801 * If the application stores any of the SilcServerEntry pointers from
802 * the `server' list it must reference it with silc_client_ref_server
805 * Application must not free the returned `server' list.
808 typedef void (*SilcGetServerCallback)(SilcClient client,
809 SilcClientConnection conn,
814 /****f* silcclient/SilcClientAPI/silc_client_lock_server
818 * void silc_client_lock_server(SilcServerEntry server_entry);
822 * Acquires lock for the server entry indicate by `server_entry'. When
823 * application wants to access `server_entry' it must lock the entry
824 * before reading any data from the `server_entry'. The lock must be
825 * unlocked with silc_client_unlock_server.
829 * The entry must be unlocked before calling any Client Library API
830 * functions where the entry is given as argument, unless otherwise stated.
832 * The entry should not be locked for long periods of time. For example,
833 * it is not appropriate to hold the lock while waiting user interface to
834 * be drawn. The appropriate way is to read the data and duplicate it if
835 * necessary, unlock the entry, then draw on the user interface.
837 * This function is not needed if application is not multithreaded.
840 void silc_client_lock_server(SilcServerEntry server_entry);
842 /****f* silcclient/SilcClientAPI/silc_client_unlock_server
846 * void silc_client_unlock_server(SilcServerEntry server_entry);
850 * Releases the lock acquired with silc_client_lock_server.
853 void silc_client_unlock_server(SilcServerEntry server_entry);
855 /****f* silcclient/SilcClientAPI/silc_client_ref_server
860 * silc_client_ref_server(SilcClient client,
861 * SilcClientConnection conn,
862 * SilcServerEntry server_entry);
866 * Takes a reference of the server entry indicated by `server_entry'
867 * The reference must be released by calling silc_client_unref_server
868 * after it is not needed anymore. Returns `server_entry'.
871 SilcServerEntry silc_client_ref_server(SilcClient client,
872 SilcClientConnection conn,
873 SilcServerEntry server_entry);
875 /****f* silcclient/SilcClientAPI/silc_client_unref_server
879 * void silc_client_unref_server(SilcClient client,
880 * SilcClientConnection conn,
881 * SilcServerEntry server_entry);
885 * Releases the server entry reference indicated by `server_entry'.
888 void silc_client_unref_server(SilcClient client, SilcClientConnection conn,
889 SilcServerEntry server_entry);
891 /****f* silcclient/SilcClientAPI/silc_client_list_free_server
895 * void silc_client_list_free_server(SilcClient client,
896 * SilcClientConnection conn,
897 * SilcDList server_list);
901 * Free's server entry list that has been returned by various library
905 void silc_client_list_free_servers(SilcClient client,
906 SilcClientConnection conn,
907 SilcDList server_list);
909 /****f* silcclient/SilcClientAPI/silc_client_get_server
913 * SilcServerEntry silc_client_get_server(SilcClient client,
914 * SilcClientConnection conn,
919 * Finds entry for server by the server name. Returns the entry or NULL
920 * if the entry was not found.
923 SilcServerEntry silc_client_get_server(SilcClient client,
924 SilcClientConnection conn,
927 /****f* silcclient/SilcClientAPI/silc_client_get_server_by_id
931 * SilcServerEntry silc_client_get_server_by_id(SilcClient client,
932 * SilcClientConnection conn,
933 * SilcServerID *server_id);
937 * Finds entry for server by the server ID. Returns the entry or NULL
938 * if the entry was not found.
941 SilcServerEntry silc_client_get_server_by_id(SilcClient client,
942 SilcClientConnection conn,
943 SilcServerID *server_id);
945 /****f* silcclient/SilcClientAPI/silc_client_get_server_by_id_resolve
950 * silc_client_get_server_by_id_resolve(SilcClient client,
951 * SilcClientConnection conn,
952 * SilcServerID *server_id,
953 * SilcGetServerCallback completion,
958 * Resolves the server information by the `server_id'. The resolved
959 * server is returned into the `completion' callback.
961 * Returns command identifier for the resolving. It can be used to attach
962 * a pending command to it, if needed. Returns 0 on error.
966 silc_client_get_server_by_id_resolve(SilcClient client,
967 SilcClientConnection conn,
968 SilcServerID *server_id,
969 SilcGetServerCallback completion,
972 #endif /* SILCCLIENT_ENTRY_H */