pidgin 2.14.14dev
dnssrv.h
Go to the documentation of this file.
1
5/* purple
6 *
7 * Copyright (C) 2005, Thomas Butter <butter@uni-mannheim.de>
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; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
22 */
23
24#ifndef _PURPLE_DNSSRV_H
25#define _PURPLE_DNSSRV_H
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31typedef struct _PurpleSrvTxtQueryData PurpleSrvTxtQueryData;
34
35/* For compatibility, should be removed for 3.0.0
36 */
37typedef struct _PurpleSrvTxtQueryData PurpleSrvQueryData;
38
39#include <glib.h>
40
41enum PurpleDnsType {
42 PurpleDnsTypeTxt = 16,
43 PurpleDnsTypeSrv = 33
44};
45
47 char hostname[256];
48 int port;
49 int weight;
50 int pref;
51};
52
54 char *content;
55};
56
57typedef void (*PurpleSrvTxtQueryResolvedCallback) (PurpleSrvTxtQueryData *query_data, GList *records);
58typedef void (*PurpleSrvTxtQueryFailedCallback) (PurpleSrvTxtQueryData *query_data, const gchar *error_message);
59
66typedef struct
67{
71 gboolean (*resolve)(PurpleSrvTxtQueryData *query_data,
72 PurpleSrvTxtQueryResolvedCallback resolved_cb,
73 PurpleSrvTxtQueryFailedCallback failed_cb);
74
79 void (*destroy)(PurpleSrvTxtQueryData *query_data);
80
81 void (*_purple_reserved1)(void);
82 void (*_purple_reserved2)(void);
83 void (*_purple_reserved3)(void);
84 void (*_purple_reserved4)(void);
86
93typedef void (*PurpleSrvCallback)(PurpleSrvResponse *resp, int results, gpointer data);
94
101typedef void (*PurpleTxtCallback)(GList *responses, gpointer data);
102
115PurpleSrvTxtQueryData *purple_srv_resolve_account(PurpleAccount *account, const char *protocol, const char *transport, const char *domain, PurpleSrvCallback cb, gpointer extradata);
116
117#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_DNSSRV_C_)
129PurpleSrvTxtQueryData *purple_srv_resolve(const char *protocol, const char *transport, const char *domain, PurpleSrvCallback cb, gpointer extradata);
130#endif
131
139void purple_srv_cancel(PurpleSrvTxtQueryData *query_data);
140
152PurpleSrvTxtQueryData *purple_txt_resolve_account(PurpleAccount *account, const char *owner, const char *domain, PurpleTxtCallback cb, gpointer extradata);
153
154#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_DNSSRV_C_)
167PurpleSrvTxtQueryData *purple_txt_resolve(const char *owner, const char *domain, PurpleTxtCallback cb, gpointer extradata);
168#endif
169
178void purple_txt_cancel(PurpleSrvTxtQueryData *query_data);
179
188
196
203void purple_srv_txt_query_destroy(PurpleSrvTxtQueryData *query_data);
204
213
221
228char *purple_srv_txt_query_get_query(PurpleSrvTxtQueryData *query_data);
229
236int purple_srv_txt_query_get_type(PurpleSrvTxtQueryData *query_data);
237
238#ifdef __cplusplus
239}
240#endif
241
242#endif /* _PURPLE_DNSSRV_H */
const gchar * purple_txt_response_get_content(PurpleTxtResponse *response)
Get the value of the current TXT record.
void(* PurpleSrvCallback)(PurpleSrvResponse *resp, int results, gpointer data)
Definition: dnssrv.h:93
PurpleSrvTxtQueryData * purple_txt_resolve(const char *owner, const char *domain, PurpleTxtCallback cb, gpointer extradata)
Queries an TXT record.
PurpleSrvTxtQueryData * purple_srv_resolve(const char *protocol, const char *transport, const char *domain, PurpleSrvCallback cb, gpointer extradata)
Queries an SRV record.
char * purple_srv_txt_query_get_query(PurpleSrvTxtQueryData *query_data)
Get the query from a PurpleDnsQueryData.
PurpleSrvTxtQueryData * purple_txt_resolve_account(PurpleAccount *account, const char *owner, const char *domain, PurpleTxtCallback cb, gpointer extradata)
Queries an TXT record.
void purple_txt_response_destroy(PurpleTxtResponse *response)
Destroy a TXT DNS response object.
void purple_srv_cancel(PurpleSrvTxtQueryData *query_data)
Cancel an SRV or DNS query.
void purple_txt_cancel(PurpleSrvTxtQueryData *query_data)
Cancel an TXT DNS query.
void(* PurpleTxtCallback)(GList *responses, gpointer data)
Callback that returns the data retrieved from a DNS TXT lookup.
Definition: dnssrv.h:101
PurpleSrvTxtQueryData * purple_srv_resolve_account(PurpleAccount *account, const char *protocol, const char *transport, const char *domain, PurpleSrvCallback cb, gpointer extradata)
Queries an SRV record.
PurpleSrvTxtQueryUiOps * purple_srv_txt_query_get_ui_ops(void)
Returns the UI operations structure to be used when doing a SRV/TXT resolve.
int purple_srv_txt_query_get_type(PurpleSrvTxtQueryData *query_data)
Get the type from a PurpleDnsQueryData (TXT or SRV)
void purple_srv_txt_query_set_ui_ops(PurpleSrvTxtQueryUiOps *ops)
Sets the UI operations structure to be used when doing a SRV/TXT resolve.
void purple_srv_txt_query_destroy(PurpleSrvTxtQueryData *query_data)
Cancel a SRV/TXT query and destroy the associated data structure.
SRV Request UI operations; UIs should implement this if they want to do SRV lookups themselves,...
Definition: dnssrv.h:67
Structure representing an account.
Definition: account.h:170