| |
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 typedef struct _GaimDnsQueryData GaimDnsQueryData; |
| |
32 |
| |
33 /** |
| |
34 * The "hosts" parameter is a linked list containing pairs of |
| |
35 * one size_t addrlen and one struct sockaddr *addr. |
| |
36 */ |
| |
37 typedef void (*GaimDnsQueryConnectFunction)(GSList *hosts, gpointer data, const char *error_message); |
| |
38 |
| |
39 |
| |
40 #include "account.h" |
| |
41 |
| |
42 #ifdef __cplusplus |
| |
43 extern "C" { |
| |
44 #endif |
| |
45 |
| |
46 /**************************************************************************/ |
| |
47 /** @name DNS query API */ |
| |
48 /**************************************************************************/ |
| |
49 /*@{*/ |
| |
50 |
| |
51 /** |
| |
52 * Do an async dns query |
| |
53 * |
| |
54 * @param hostname The hostname to resolve |
| |
55 * @param port A portnumber which is stored in the struct sockaddr |
| |
56 * @param callback Callback to call after resolving |
| |
57 * @param data Extra data for the callback function |
| |
58 * |
| |
59 * @return NULL if there was an error, otherwise return a reference to |
| |
60 * a data structure that can be used to cancel the pending |
| |
61 * DNS query, if needed. |
| |
62 */ |
| |
63 GaimDnsQueryData *gaim_dnsquery_a(const char *hostname, int port, GaimDnsQueryConnectFunction callback, gpointer data); |
| |
64 |
| |
65 /*@}*/ |
| |
66 |
| |
67 #ifdef __cplusplus |
| |
68 } |
| |
69 #endif |
| |
70 |
| |
71 #endif /* _GAIM_DNSQUERY_H_ */ |