Loading...
Searching...
No Matches
dnssrv.h
Go to the documentation of this file.
/* purple
*
* Copyright (C) 2005, Thomas Butter <butter@uni-mannheim.de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/
#ifndef _PURPLE_DNSSRV_H
#define _PURPLE_DNSSRV_H
#ifdef __cplusplus
extern "C" {
#endif
typedef struct _PurpleSrvTxtQueryData PurpleSrvTxtQueryData;
typedef struct _PurpleSrvResponse PurpleSrvResponse;
typedef struct _PurpleTxtResponse PurpleTxtResponse;
/* For compatibility, should be removed for 3.0.0
*/
typedef struct _PurpleSrvTxtQueryData PurpleSrvQueryData;
#include <glib.h>
enum PurpleDnsType {
PurpleDnsTypeTxt = 16,
PurpleDnsTypeSrv = 33
};
struct _PurpleSrvResponse {
char hostname[256];
int port;
int weight;
int pref;
};
struct _PurpleTxtResponse {
char *content;
};
typedef void (*PurpleSrvTxtQueryResolvedCallback) (PurpleSrvTxtQueryData *query_data, GList *records);
typedef void (*PurpleSrvTxtQueryFailedCallback) (PurpleSrvTxtQueryData *query_data, const gchar *error_message);
typedef struct
{
gboolean (*resolve)(PurpleSrvTxtQueryData *query_data,
PurpleSrvTxtQueryResolvedCallback resolved_cb,
PurpleSrvTxtQueryFailedCallback failed_cb);
void (*destroy)(PurpleSrvTxtQueryData *query_data);
void (*_purple_reserved1)(void);
void (*_purple_reserved2)(void);
void (*_purple_reserved3)(void);
void (*_purple_reserved4)(void);
} PurpleSrvTxtQueryUiOps;
typedef void (*PurpleSrvCallback)(PurpleSrvResponse *resp, int results, gpointer data);
typedef void (*PurpleTxtCallback)(GList *responses, gpointer data);
PurpleSrvTxtQueryData *purple_srv_resolve_account(PurpleAccount *account, const char *protocol, const char *transport, const char *domain, PurpleSrvCallback cb, gpointer extradata);
#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_DNSSRV_C_)
PurpleSrvTxtQueryData *purple_srv_resolve(const char *protocol, const char *transport, const char *domain, PurpleSrvCallback cb, gpointer extradata);
#endif
void purple_srv_cancel(PurpleSrvTxtQueryData *query_data);
PurpleSrvTxtQueryData *purple_txt_resolve_account(PurpleAccount *account, const char *owner, const char *domain, PurpleTxtCallback cb, gpointer extradata);
#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_DNSSRV_C_)
PurpleSrvTxtQueryData *purple_txt_resolve(const char *owner, const char *domain, PurpleTxtCallback cb, gpointer extradata);
#endif
void purple_txt_cancel(PurpleSrvTxtQueryData *query_data);
const gchar *purple_txt_response_get_content(PurpleTxtResponse *response);
void purple_txt_response_destroy(PurpleTxtResponse *response);
void purple_srv_txt_query_destroy(PurpleSrvTxtQueryData *query_data);
void purple_srv_txt_query_set_ui_ops(PurpleSrvTxtQueryUiOps *ops);
PurpleSrvTxtQueryUiOps *purple_srv_txt_query_get_ui_ops(void);
char *purple_srv_txt_query_get_query(PurpleSrvTxtQueryData *query_data);
int purple_srv_txt_query_get_type(PurpleSrvTxtQueryData *query_data);
#ifdef __cplusplus
}
#endif
#endif /* _PURPLE_DNSSRV_H */
PurpleAccount
struct _PurpleAccount PurpleAccount
Structure representing an account.
Definition account.h:38
purple_txt_response_get_content
const gchar * purple_txt_response_get_content(PurpleTxtResponse *response)
Get the value of the current TXT record.
PurpleSrvCallback
void(* PurpleSrvCallback)(PurpleSrvResponse *resp, int results, gpointer data)
Definition dnssrv.h:93
purple_txt_resolve
PurpleSrvTxtQueryData * purple_txt_resolve(const char *owner, const char *domain, PurpleTxtCallback cb, gpointer extradata)
Queries an TXT record.
purple_srv_resolve
PurpleSrvTxtQueryData * purple_srv_resolve(const char *protocol, const char *transport, const char *domain, PurpleSrvCallback cb, gpointer extradata)
Queries an SRV record.
purple_srv_txt_query_get_query
char * purple_srv_txt_query_get_query(PurpleSrvTxtQueryData *query_data)
Get the query from a PurpleDnsQueryData.
purple_txt_resolve_account
PurpleSrvTxtQueryData * purple_txt_resolve_account(PurpleAccount *account, const char *owner, const char *domain, PurpleTxtCallback cb, gpointer extradata)
Queries an TXT record.
purple_txt_response_destroy
void purple_txt_response_destroy(PurpleTxtResponse *response)
Destroy a TXT DNS response object.
purple_srv_cancel
void purple_srv_cancel(PurpleSrvTxtQueryData *query_data)
Cancel an SRV or DNS query.
purple_txt_cancel
void purple_txt_cancel(PurpleSrvTxtQueryData *query_data)
Cancel an TXT DNS query.
PurpleTxtCallback
void(* PurpleTxtCallback)(GList *responses, gpointer data)
Callback that returns the data retrieved from a DNS TXT lookup.
Definition dnssrv.h:101
purple_srv_resolve_account
PurpleSrvTxtQueryData * purple_srv_resolve_account(PurpleAccount *account, const char *protocol, const char *transport, const char *domain, PurpleSrvCallback cb, gpointer extradata)
Queries an SRV record.
purple_srv_txt_query_get_ui_ops
PurpleSrvTxtQueryUiOps * purple_srv_txt_query_get_ui_ops(void)
Returns the UI operations structure to be used when doing a SRV/TXT resolve.
purple_srv_txt_query_get_type
int purple_srv_txt_query_get_type(PurpleSrvTxtQueryData *query_data)
Get the type from a PurpleDnsQueryData (TXT or SRV).
purple_srv_txt_query_set_ui_ops
void purple_srv_txt_query_set_ui_ops(PurpleSrvTxtQueryUiOps *ops)
Sets the UI operations structure to be used when doing a SRV/TXT resolve.
purple_srv_txt_query_destroy
void purple_srv_txt_query_destroy(PurpleSrvTxtQueryData *query_data)
Cancel a SRV/TXT query and destroy the associated data structure.
PurpleSrvTxtQueryUiOps
SRV Request UI operations; UIs should implement this if they want to do SRV lookups themselves,...
Definition dnssrv.h:67
PurpleSrvTxtQueryUiOps::resolve
gboolean(* resolve)(PurpleSrvTxtQueryData *query_data, PurpleSrvTxtQueryResolvedCallback resolved_cb, PurpleSrvTxtQueryFailedCallback failed_cb)
If implemented, return TRUE if the UI takes responsibility for SRV queries.
Definition dnssrv.h:71
PurpleSrvTxtQueryUiOps::destroy
void(* destroy)(PurpleSrvTxtQueryData *query_data)
Called just before query_data is freed; this should cancel any further use of query_data the UI would...
Definition dnssrv.h:79
_PurpleSrvResponse
Definition dnssrv.h:46
_PurpleTxtResponse
Definition dnssrv.h:53