pidgin  2.14.10
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. More...
 

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

Typedef Documentation

◆ PurpleSrvCallback

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.

◆ PurpleTxtCallback

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

◆ purple_srv_cancel()

void purple_srv_cancel ( PurpleSrvTxtQueryData *  query_data)

Cancel an SRV or DNS query.

Parameters
query_dataThe request to cancel.
Deprecated:
Use purple_srv_txt_query_destroy instead

◆ purple_srv_resolve()

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

◆ 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.

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

◆ 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.

Parameters
query_dataThe SRV/TXT query to cancel. This data structure is freed by this function.

◆ purple_srv_txt_query_get_query()

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.

◆ 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)

Parameters
query_dataThe query
Returns
The query.

◆ 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.

Returns
The UI operations structure.

◆ 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.

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.

◆ purple_txt_cancel()

void purple_txt_cancel ( PurpleSrvTxtQueryData *  query_data)

Cancel an TXT DNS query.

Parameters
query_dataThe request to cancel.
Since
2.6.0
Deprecated:
Use purple_srv_txt_query_destroy instead

◆ purple_txt_resolve()

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

◆ 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.

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

◆ purple_txt_response_destroy()

void purple_txt_response_destroy ( PurpleTxtResponse response)

Destroy a TXT DNS response object.

Parameters
responseThe PurpleTxtResponse to destroy.
Since
2.6.0

◆ purple_txt_response_get_content()

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