Merged silc_1_1_branch to trunk.
[silc.git] / apps / silcd / server_query.h
1 /*
2
3   server_query.h
4
5   Author: Pekka Riikonen <priikone@silcnet.org>
6
7   Copyright (C) 2002 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 SERVER_QUERY_H
21 #define SERVER_QUERY_H
22
23 /* Processes query as command.  The `query' is the command that is
24    being processed indicated by the `cmd'.  The `query' can be one of
25    the following: SILC_COMMAND_WHOIS, SILC_COMMAND_WHOWAS or
26    SILC_COMMAND_IDENTIFY.  This function handles the reply sending
27    to the entity who sent this query to us automatically.  Returns
28    TRUE if the query is being processed or FALSE on error. */
29 SilcBool silc_server_query_command(SilcServer server, SilcCommand querycmd,
30                                    SilcServerCommandContext cmd,
31                                    void *old_query);
32
33 /* Find client by the Client ID indicated by the `client_id', and if not
34    found then query it by using WHOIS command.  The client information
35    is also resolved if the cached information is incomplete or if the
36    `always_resolve' is set to TRUE.  The indication whether requested
37    client was being resolved is saved into `resolved'.  If the client
38    is not being resolved its entry is returned by this function.  NULL
39    is returned if client is resolved.  If the client was resovled the
40    caller may attach to the query by using silc_server_command_pending
41    function.  The server->cmd_ident includes the query identifier. */
42 SilcClientEntry silc_server_query_client(SilcServer server,
43                                          const SilcClientID *client_id,
44                                          SilcBool always_resolve,
45                                          SilcBool *resolved);
46
47 #endif /* SERVER_QUERY_H */