Data Structures | Typedefs | Enumerations | Functions
dnssrv.h File Reference
#include <glib.h>

Go to the source code of this file.

Data Structures

struct  _PurpleSrvResponse
struct  _PurpleTxtResponse
struct  PurpleSrvTxtQueryUiOps
 SRV Request UI operations; UIs should implement this if they want to do SRV lookups themselves, rather than relying on the core. More...

Typedefs

typedef struct
_PurpleSrvTxtQueryData 
PurpleSrvTxtQueryData
typedef struct _PurpleSrvResponse PurpleSrvResponse
typedef struct _PurpleTxtResponse PurpleTxtResponse
typedef struct
_PurpleSrvTxtQueryData 
PurpleSrvQueryData
typedef void(* PurpleSrvTxtQueryResolvedCallback )(PurpleSrvTxtQueryData *query_data, GList *records)
typedef void(* PurpleSrvTxtQueryFailedCallback )(PurpleSrvTxtQueryData *query_data, const gchar *error_message)
typedef void(* PurpleSrvCallback )(PurpleSrvResponse *resp, int results, gpointer data)
typedef void(* PurpleTxtCallback )(GList *responses, gpointer data)
 Callback that returns the data retrieved from a DNS TXT lookup.

Enumerations

enum  PurpleDnsType { PurpleDnsTypeTxt = 16, PurpleDnsTypeSrv = 33 }

Functions

PurpleSrvTxtQueryData * purple_srv_resolve_account (PurpleAccount *account, const char *protocol, const char *transport, const char *domain, PurpleSrvCallback cb, gpointer extradata)
 Queries an SRV record.
PurpleSrvTxtQueryData * purple_srv_resolve (const char *protocol, const char *transport, const char *domain, PurpleSrvCallback cb, gpointer extradata)
 Queries an SRV record.
void purple_srv_cancel (PurpleSrvTxtQueryData *query_data)
 Cancel an SRV or DNS query.
PurpleSrvTxtQueryData * purple_txt_resolve_account (PurpleAccount *account, const char *owner, const char *domain, PurpleTxtCallback cb, gpointer extradata)
 Queries an TXT record.
PurpleSrvTxtQueryData * purple_txt_resolve (const char *owner, const char *domain, PurpleTxtCallback cb, gpointer extradata)
 Queries an TXT record.
void purple_txt_cancel (PurpleSrvTxtQueryData *query_data)
 Cancel an TXT DNS query.
const gchar * purple_txt_response_get_content (PurpleTxtResponse *response)
 Get the value of the current TXT record.
void purple_txt_response_destroy (PurpleTxtResponse *response)
 Destroy a TXT DNS response object.
void purple_srv_txt_query_destroy (PurpleSrvTxtQueryData *query_data)
 Cancel a SRV/TXT query and destroy the associated data structure.
void purple_srv_txt_query_set_ui_ops (PurpleSrvTxtQueryUiOps *ops)
 Sets the UI operations structure to be used when doing a SRV/TXT resolve.
PurpleSrvTxtQueryUiOpspurple_srv_txt_query_get_ui_ops (void)
 Returns the UI operations structure to be used when doing a SRV/TXT resolve.
char * purple_srv_txt_query_get_query (PurpleSrvTxtQueryData *query_data)
 Get the query from a PurpleDnsQueryData.
int purple_srv_txt_query_get_type (PurpleSrvTxtQueryData *query_data)
 Get the type from a PurpleDnsQueryData (TXT or SRV)

Detailed Description

Definition in file dnssrv.h.


Typedef Documentation

typedef void(* PurpleSrvCallback)(PurpleSrvResponse *resp, int results, gpointer data)
Parameters:
respAn array of PurpleSrvResponse of size results. The array is sorted based on the order described in the DNS SRV RFC. Users of this API should try each record in resp in order, starting at the beginning.

Definition at line 93 of file dnssrv.h.

typedef void(* PurpleTxtCallback)(GList *responses, gpointer data)

Callback that returns the data retrieved from a DNS TXT lookup.

Parameters:
responsesA GList of PurpleTxtResponse objects.
dataThe extra data passed to purple_txt_resolve.

Definition at line 101 of file dnssrv.h.


Function Documentation

void purple_srv_cancel ( PurpleSrvTxtQueryData *  query_data)

Cancel an SRV or DNS query.

Parameters:
query_dataThe request to cancel.
PurpleSrvTxtQueryData* purple_srv_resolve ( const char *  protocol,
const char *  transport,
const char *  domain,
PurpleSrvCallback  cb,
gpointer  extradata 
)

Queries an SRV record.

Parameters:
protocolName of the protocol (e.g. "sip")
transportName of the transport ("tcp" or "udp")
domainDomain name to query (e.g. "blubb.com")
cbA callback which will be called with the results
extradataExtra data to be passed to the callback
Deprecated:
Use purple_srv_resolve_account instead
PurpleSrvTxtQueryData* purple_srv_resolve_account ( PurpleAccount account,
const char *  protocol,
const char *  transport,
const char *  domain,
PurpleSrvCallback  cb,
gpointer  extradata 
)

Queries an SRV record.

Parameters:
accountthe account that the query is being done for (or NULL)
protocolName of the protocol (e.g. "sip")
transportName of the transport ("tcp" or "udp")
domainDomain name to query (e.g. "blubb.com")
cbA callback which will be called with the results
extradataExtra data to be passed to the callback
Since:
2.8.0
void purple_srv_txt_query_destroy ( PurpleSrvTxtQueryData *  query_data)

Cancel a SRV/TXT query and destroy the associated data structure.

Parameters:
query_dataThe SRV/TXT query to cancel. This data structure is freed by this function.
char* purple_srv_txt_query_get_query ( PurpleSrvTxtQueryData *  query_data)

Get the query from a PurpleDnsQueryData.

Parameters:
query_dataThe SRV/TXT query
Returns:
The query.
int purple_srv_txt_query_get_type ( PurpleSrvTxtQueryData *  query_data)

Get the type from a PurpleDnsQueryData (TXT or SRV)

Parameters:
query_dataThe query
Returns:
The query.
PurpleSrvTxtQueryUiOps* purple_srv_txt_query_get_ui_ops ( void  )

Returns the UI operations structure to be used when doing a SRV/TXT resolve.

Returns:
The UI operations structure.
void purple_srv_txt_query_set_ui_ops ( PurpleSrvTxtQueryUiOps ops)

Sets the UI operations structure to be used when doing a SRV/TXT resolve.

The UI operations need only be set if the UI wants to handle the resolve itself; otherwise, leave it as NULL.

Parameters:
opsThe UI operations structure.
void purple_txt_cancel ( PurpleSrvTxtQueryData *  query_data)

Cancel an TXT DNS query.

Parameters:
query_dataThe request to cancel.
Since:
2.6.0
PurpleSrvTxtQueryData* purple_txt_resolve ( const char *  owner,
const char *  domain,
PurpleTxtCallback  cb,
gpointer  extradata 
)

Queries an TXT record.

Parameters:
ownerName of the protocol (e.g. "_xmppconnect")
domainDomain name to query (e.g. "blubb.com")
cbA callback which will be called with the results
extradataExtra data to be passed to the callback
Deprecated:
Use purple_txt_resolve_account instead
Since:
2.6.0
PurpleSrvTxtQueryData* purple_txt_resolve_account ( PurpleAccount account,
const char *  owner,
const char *  domain,
PurpleTxtCallback  cb,
gpointer  extradata 
)

Queries an TXT record.

Parameters:
accountthe account that the query is being done for (or NULL)
ownerName of the protocol (e.g. "_xmppconnect")
domainDomain name to query (e.g. "blubb.com")
cbA callback which will be called with the results
extradataExtra data to be passed to the callback
Since:
2.8.0
void purple_txt_response_destroy ( PurpleTxtResponse response)

Destroy a TXT DNS response object.

Parameters:
responseThe PurpleTxtResponse to destroy.
Since:
2.6.0
const gchar* purple_txt_response_get_content ( PurpleTxtResponse response)

Get the value of the current TXT record.

Parameters:
responseThe TXT response record
Returns:
The value of the current TXT record.
Since:
2.6.0