comparison libgaim/dnssrv.h @ 14308:9ad313800b19

[gaim-migrate @ 16998] Make gaim_srv_resolve cancelable. Please test and let me know of any problems. I was unable to test the WIN32 method for this, since it actually uses Windows stuff. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Wed, 23 Aug 2006 08:02:05 +0000
parents 60b1bc8dbf37
children 500a8f54354e
comparison
equal deleted inserted replaced
14307:7c91ba42b9ba 14308:9ad313800b19
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 */