stun_dns.c File Reference


Detailed Description

Functins to discover STUN server address using DNS-SRV.

Refs:

Author:
Kai Vehmanen <kai.vehmanen@nokia-email.address.hidden>

#include "config.h"
#include <sofia-sip/stun.h>
#include <sofia-sip/su.h>
#include <sofia-sip/su_alloc.h>
#include <sofia-sip/su_wait.h>
#include <sofia-sip/sresolv.h>
#include "stun_internal.h"

Include dependency graph for stun_dns.c:


Functions

stun_dns_lookup_t * stun_dns_lookup (stun_magic_t *magic, su_root_t *root, stun_dns_lookup_f func, const char *domain)
 Performs a DNS-SRV check for STUN 'stun' (tcp) and 'stun' (udp) services for 'domain'.
void stun_dns_lookup_destroy (stun_dns_lookup_t *self)
 Destroys the 'self' object created by stun_dns_lookup_destroy().
int stun_dns_lookup_udp_addr (stun_dns_lookup_t *self, const char **target, uint16_t *port)
 Fetches the results of a completed STUN DNS-SRV lookup for "_stun._udp" service (RFC3489/3489bis).
int stun_dns_lookup_tcp_addr (stun_dns_lookup_t *self, const char **target, uint16_t *port)
 Fetches the results of a completed STUN DNS-SRV lookup for "_stun._tcp" service (RFC3489).
int stun_dns_lookup_stp_addr (stun_dns_lookup_t *self, const char **target, uint16_t *port)
 Fetches the results of a completed STUN DNS-SRV lookup for "_stun._udp" service (3489bis, "Short-Term Password").

Function Documentation

stun_dns_lookup_t* stun_dns_lookup ( stun_magic_t magic,
su_root_t root,
stun_dns_lookup_f  func,
const char *  domain 
)

Performs a DNS-SRV check for STUN 'stun' (tcp) and 'stun' (udp) services for 'domain'.

The result will be delivered asynchronously in the 'func' callback. 'root' will be used as the event loop.

int stun_dns_lookup_stp_addr ( stun_dns_lookup_t *  self,
const char **  target,
uint16_t *  port 
)

Fetches the results of a completed STUN DNS-SRV lookup for "_stun._udp" service (3489bis, "Short-Term Password").

Parameters:
self context pointer
target location where to stored the 'target' SRV field for stun service
port location where to store port number
Returns:
0 on success, non-zero otherwise

int stun_dns_lookup_tcp_addr ( stun_dns_lookup_t *  self,
const char **  target,
uint16_t *  port 
)

Fetches the results of a completed STUN DNS-SRV lookup for "_stun._tcp" service (RFC3489).

Parameters:
self context pointer
target location where to stored the 'target' SRV field for stun service
port location where to store port number
Returns:
0 on success, non-zero otherwise

int stun_dns_lookup_udp_addr ( stun_dns_lookup_t *  self,
const char **  target,
uint16_t *  port 
)

Fetches the results of a completed STUN DNS-SRV lookup for "_stun._udp" service (RFC3489/3489bis).

Parameters:
self context pointer
target location where to stored the 'target' SRV field for stun service
port location where to store port number
Returns:
0 on success, non-zero otherwise


Sofia-SIP 1.12.4 - Copyright (C) 2006 Nokia Corporation. All rights reserved. Licensed under the terms of the GNU Lesser General Public License.