|
14181
|
1 /**
|
|
|
2 * @file dnsquery.h DNS query API
|
|
|
3 * @ingroup core
|
|
|
4 *
|
|
|
5 * gaim
|
|
|
6 *
|
|
|
7 * Gaim is the legal property of its developers, whose names are too numerous
|
|
|
8 * to list here. Please refer to the COPYRIGHT file distributed with this
|
|
|
9 * source distribution.
|
|
|
10 *
|
|
|
11 * This program is free software; you can redistribute it and/or modify
|
|
|
12 * it under the terms of the GNU General Public License as published by
|
|
|
13 * the Free Software Foundation; either version 2 of the License, or
|
|
|
14 * (at your option) any later version.
|
|
|
15 *
|
|
|
16 * This program is distributed in the hope that it will be useful,
|
|
|
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
19 * GNU General Public License for more details.
|
|
|
20 *
|
|
|
21 * You should have received a copy of the GNU General Public License
|
|
|
22 * along with this program; if not, write to the Free Software
|
|
|
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
24 */
|
|
|
25 #ifndef _GAIM_DNSQUERY_H_
|
|
|
26 #define _GAIM_DNSQUERY_H_
|
|
|
27
|
|
|
28 #include <glib.h>
|
|
|
29 #include "eventloop.h"
|
|
|
30
|
|
|
31 /**
|
|
|
32 * The "hosts" parameter is a linked list containing pairs of
|
|
|
33 * one size_t addrlen and one struct sockaddr *addr.
|
|
|
34 */
|
|
|
35 typedef void (*GaimProxyDnsConnectFunction)(GSList *hosts, gpointer data, const char *error_message);
|
|
|
36
|
|
|
37
|
|
|
38 #include "account.h"
|
|
|
39
|
|
|
40 #ifdef __cplusplus
|
|
|
41 extern "C" {
|
|
|
42 #endif
|
|
|
43
|
|
|
44 /**************************************************************************/
|
|
|
45 /** @name DNS query API */
|
|
|
46 /**************************************************************************/
|
|
|
47 /*@{*/
|
|
|
48
|
|
|
49 /**
|
|
|
50 * Do an async dns query
|
|
|
51 *
|
|
|
52 * @param hostname The hostname to resolve
|
|
|
53 * @param port A portnumber which is stored in the struct sockaddr
|
|
|
54 * @param callback Callback to call after resolving
|
|
|
55 * @param data Extra data for the callback function
|
|
|
56 *
|
|
|
57 * @return Zero indicates the connection is pending. Any other value indicates failure.
|
|
|
58 */
|
|
|
59 int gaim_gethostbyname_async(const char *hostname, int port, GaimProxyDnsConnectFunction callback, gpointer data);
|
|
|
60
|
|
|
61 /*@}*/
|
|
|
62
|
|
|
63 #ifdef __cplusplus
|
|
|
64 }
|
|
|
65 #endif
|
|
|
66
|
|
|
67 #endif /* _GAIM_DNSQUERY_H_ */
|