| 1 /** |
1 /** |
| 2 * @file dnssrv.h |
2 * @file dnssrv.h |
| 3 * |
3 * |
| 4 * gaim |
4 * gaim |
| 5 * |
5 * |
| 6 * Copyright (C) 2005, Thomas Butter <butter@uni-mannheim.de> |
6 * Copyright (C) 2005, Thomas Butter <butter@uni-mannheim.de> |
| 7 * |
7 *i |
| 8 * This program is free software; you can redistribute it and/or modify |
8 * This program is free software; you can redistribute it and/or modify |
| 9 * it under the terms of the GNU General Public License as published by |
9 * it under the terms of the GNU General Public License as published by |
| 10 * the Free Software Foundation; either version 2 of the License, or |
10 * the Free Software Foundation; either version 2 of the License, or |
| 11 * (at your option) any later version. |
11 * (at your option) any later version. |
| 12 * |
12 * |
| 22 |
22 |
| 23 #ifndef _GAIM_DNSSRV_H |
23 #ifndef _GAIM_DNSSRV_H |
| 24 #define _GAIM_DNSSRV_H |
24 #define _GAIM_DNSSRV_H |
| 25 |
25 |
| 26 typedef struct _GaimSrvResponse GaimSrvResponse; |
26 typedef struct _GaimSrvResponse GaimSrvResponse; |
| |
27 typedef struct _GaimSrvQueryData GaimSrvQueryData; |
| 27 |
28 |
| 28 struct _GaimSrvResponse { |
29 struct _GaimSrvResponse { |
| 29 char hostname[256]; |
30 char hostname[256]; |
| 30 int port; |
31 int port; |
| 31 int weight; |
32 int weight; |
| 32 int pref; |
33 int pref; |
| 33 }; |
34 }; |
| 34 |
35 |
| 35 typedef void (*GaimSRVCallback)(GaimSrvResponse *resp, int results, gpointer data); |
36 typedef void (*GaimSrvCallback)(GaimSrvResponse *resp, int results, gpointer data); |
| 36 |
37 |
| 37 /** |
38 /** |
| 38 * Queries an SRV record. |
39 * Queries an SRV record. |
| 39 * |
40 * |
| 40 * @param protocol Name of the protocol (e.g. "sip") |
41 * @param protocol Name of the protocol (e.g. "sip") |
| 41 * @param transport Name of the transport ("tcp" or "udp") |
42 * @param transport Name of the transport ("tcp" or "udp") |
| 42 * @param domain Domainname to query (e.g. "blubb.com") |
43 * @param domain Domain name to query (e.g. "blubb.com") |
| 43 * @param cb A callback which will be called with the results |
44 * @param cb A callback which will be called with the results |
| 44 * @param extradata Extra data to be passed to the callback |
45 * @param extradata Extra data to be passed to the callback |
| 45 */ |
46 */ |
| 46 void gaim_srv_resolve(const char *protocol, const char *transport, const char *domain, GaimSRVCallback cb, gpointer extradata); |
47 GaimSrvQueryData *gaim_srv_resolve(const char *protocol, const char *transport, const char *domain, GaimSrvCallback cb, gpointer extradata); |
| |
48 |
| |
49 /** |
| |
50 * Cancel an SRV DNS query. |
| |
51 * |
| |
52 * @param query_data The request to cancel. |
| |
53 */ |
| |
54 void gaim_srv_cancel(GaimSrvQueryData *query_data); |
| 47 |
55 |
| 48 #endif /* _GAIM_DNSSRV_H */ |
56 #endif /* _GAIM_DNSSRV_H */ |