Strophe 0.13
XMPP client library
Data Structures | Enumerations | Functions
resolver.h File Reference

DNS resolver. More...

Data Structures

struct  resolver_srv_rr_t
 

Enumerations

enum  xmpp_domain_state_t { XMPP_DOMAIN_NOT_FOUND , XMPP_DOMAIN_FOUND , XMPP_DOMAIN_ALTDOMAIN }
 

Functions

void resolver_initialize (void)
 
void resolver_shutdown (void)
 
resolver_srv_rr_tresolver_srv_rr_new (xmpp_ctx_t *ctx, const char *host, unsigned short port, unsigned short prio, unsigned short weight)
 
int resolver_srv_lookup_buf (xmpp_ctx_t *ctx, const unsigned char *buf, size_t len, resolver_srv_rr_t **srv_rr_list)
 Perform lookup for RFC1035 message format.
 
int resolver_srv_lookup (xmpp_ctx_t *ctx, const char *service, const char *proto, const char *domain, resolver_srv_rr_t **srv_rr_list)
 Resolve SRV record.
 
void resolver_srv_free (xmpp_ctx_t *ctx, resolver_srv_rr_t *srv_rr_list)
 Release a list returned by resolver_srv_lookup() or resolver_srv_lookup_buf().
 

Detailed Description

DNS resolver.

Enumeration Type Documentation

◆ xmpp_domain_state_t

Enumerator
XMPP_DOMAIN_NOT_FOUND 
XMPP_DOMAIN_FOUND 
XMPP_DOMAIN_ALTDOMAIN 

Function Documentation

◆ resolver_initialize()

void resolver_initialize ( void  )

◆ resolver_shutdown()

void resolver_shutdown ( void  )

◆ resolver_srv_rr_new()

resolver_srv_rr_t * resolver_srv_rr_new ( xmpp_ctx_t *  ctx,
const char *  host,
unsigned short  port,
unsigned short  prio,
unsigned short  weight 
)

◆ resolver_srv_lookup_buf()

int resolver_srv_lookup_buf ( xmpp_ctx_t *  ctx,
const unsigned char *  buf,
size_t  len,
resolver_srv_rr_t **  srv_rr_list 
)

Perform lookup for RFC1035 message format.

This function allocates all elements.

Parameters
ctxa Strophe context object
bufmessage in RFC1035 format
lenlength of the message
srv_rr_listis the result
Returns
XMPP_DOMAIN_FOUND on success or XMPP_DOMAIN_NOT_FOUND on fail

◆ resolver_srv_lookup()

int resolver_srv_lookup ( xmpp_ctx_t *  ctx,
const char *  service,
const char *  proto,
const char *  domain,
resolver_srv_rr_t **  srv_rr_list 
)

Resolve SRV record.

Parameters
ctxa Strophe context object
serviceservice of the SRV record
protoprotocol of the SRV record
domainresolving domain
srv_rr_listis the result
Returns
XMPP_DOMAIN_FOUND on success or XMPP_DOMAIN_NOT_FOUND on fail

◆ resolver_srv_free()

void resolver_srv_free ( xmpp_ctx_t *  ctx,
resolver_srv_rr_t srv_rr_list 
)

Release a list returned by resolver_srv_lookup() or resolver_srv_lookup_buf().

Parameters
ctxa Strophe context object
srv_rr_lista list allocated by lookup functions