Commit 70e51d02 authored by Pekka Pessi's avatar Pekka Pessi
Browse files

sres: documented SRES_OPTIONS.

darcs-hash:20061207085558-65a35-8f559d6d4212590ee90803aaf4ac1eb61d5cac5c.gz
parent b618a231
......@@ -186,11 +186,13 @@ union sres_record
sres_naptr_record_t sr_naptr[1]; /**< NAPTR record */
};
/** Protocol family classes. */
enum sres_class {
sres_class_in = 1, /**< Internet (@b IN) */
sres_class_any = 255 /**< Any class */
};
/** Query types. */
enum sres_qtypes {
sres_type_a = 1, /**< IPv4 address (#sres_a_record). */
sres_type_ns = 2, /**< Authoritative server. */
......
......@@ -620,8 +620,8 @@ sres_resolver_t *sres_resolver_copy(sres_resolver_t *res)
*
* @par Environment Variables
* - LOCALDOMAIN overrides @c domain or @c search directives
* - RES_OPTIONS overrides values of @a options in resolv.conf
* - SRES_OPTIONS overrides values of @a options in resolv.conf, RES_OPTIONS,
* - #RES_OPTIONS overrides values of @a options in resolv.conf
* - #SRES_OPTIONS overrides values of @a options in resolv.conf, #RES_OPTIONS,
* and @a options, ... list given as argument for this function
*
* @return A pointer to a newly created sres resolver object, or NULL upon
......@@ -1079,7 +1079,7 @@ sres_search(sres_resolver_t *res,
* IPv4 (AF_INET) or IPv6 (AF_INET6) address.
*
* If the #SRES_OPTIONS environment variable, #RES_OPTIONS environment
* variable or an "options" entry in resolv.conf file contains an option
* variable, or an "options" entry in resolv.conf file contains an option
* "ip6-dotint", the IPv6 addresses are resolved using suffix ".ip6.int"
* instead of the standard ".ip6.arpa" suffix.
*
......@@ -2196,6 +2196,42 @@ int sres_parse_config(sres_config_t *c, FILE *f)
return i;
}
/**Environment variable containing options for Sofia resolver. The options
* recognized by Sofia resolver are as follows:
* - debug turn on debugging (no effect)
* - ndots:<i>n</i> when searching, try first to query name as absolute
* domain if it contains at least <i>n</i> dots
* - timeout:<i>secs</i> timeout in seconds
* - attempts:<i>n</i> fail after <i>n</i> retries
* - rotate use round robin selection of nameservers
* - no-check-names do not check names for invalid characters
* - inet6 (no effect)
* - ip6-dotint IPv6 addresses are resolved using suffix ".ip6.int"
* instead of the standard ".ip6.arpa" suffix
* - ip6-bytestring (no effect)
* The following option is a Sofia-specific extension:
* - no-edns0 do not try to use EDNS0 extension (@RFC2671)
*
* The same options can be listed in @b options directive in resolv.conf, or
* in #RES_OPTIONS environment variable. Note that options given in
* #SRES_OPTIONS override those specified in #RES_OPTIONS which in turn
* override options specified in the @b options directive of resolve.conf.
*
* The meaning of an option can be reversed with prefix "no-".
*
* @sa Manual page for resolv.conf, #RES_OPTIONS.
*/
extern char const SRES_OPTIONS[];
/**Environment variable containing resolver options. This environment
* variable is also used by standard BIND resolver.
*
* @sa Manual page for resolv.conf, #SRES_OPTIONS.
*/
extern char const RES_OPTIONS[];
/* Parse options line or #SRES_OPTIONS or #RES_OPTIONS environment variable. */
static int
sres_parse_options(sres_config_t *c, char const *value)
{
......
......@@ -3,12 +3,15 @@
@section sresolv_meta Module Information
The Sofia @b sresolv module consists of an asynchronous DNS resolver with
EDNS extensions. The interface to library is declared in <sofia-sip/sresolv.h>.
EDNS extensions. The interface to library using #su_root_t is declared in
<sofia-sip/sresolv.h>.
An alternative interface is defined by <sofia-resolv/sres.h>,
<sofia-resolv/sres_record.h>, <sofia-resolv/sres_async.h>, and
<sofia-resolv/sres_cache.h>.
@sa @RFC1034, @RFC1035, @RFC1886, @RFC2671, @RFC2782, @RFC2915
@CONTACT Pekka Pessi <Pekka.Pessi@nokia.com>
@STATUS @SofiaSIP Core library
......@@ -19,11 +22,28 @@ An alternative interface is defined by <sofia-resolv/sres.h>,
The policy for caching non-authoritave entries should be solved.
@section sresolv_overview Using Sofia Resolver
@section sresolv_overview Why Sofia Resolver?
The generally available open source DNS libraries are either synchronous,
that is, they block the thread making the query or they resolve only host
names. As SIP protocol uses NAPTR and SRV records in addition ot the usual A
or AAAA records, these DNS libraries are inadequate for a SIP application.
Sofia resolver uses the usual configuration for DNS. In Unix-based systems,
the DNS configuration is stored in the file /etc/resolv.conf, on Windows, it
is available through the registry. Sofia resolvers reloads the configuration
when it detect that it has been changed.
In addition to the configuration files, the environment variables
#SRES_OPTIONS and #RES_OPTIONS can be used to change the behaviour of the
resolver.
@section sresolv_interfaces Using Sofia Resolver
The sresolv works usually asynchronously, in other words, it sends a query
to DNS server and returns immediately to the caller. When the query is
completed, sresolv signals application through a callback function.
Sofia resolver works usually asynchronously, in other words, it generates a
a query, sends it to DNS server and returns immediately to the caller. When
a response is received and the query is completed, sresolv signals
application through a callback function.
The application can either explicitly poll(2) or select(2) on file
descriptors used by resolver and call the driver functions, or it can use
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment