diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2010-02-01 21:23:59 +0100 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2010-02-19 18:04:37 +0100 |
commit | be7c4f5806a29298988601f9bac5a4ebab6c000c (patch) | |
tree | d6f7a07643b8e8f2509da2b563cb27ca56fe0572 /ares_set_nameservers.3 | |
parent | 228e2c0a62faaedaf98a9dad10095f0980a07dfc (diff) | |
download | c-ares-master.tar.gz c-ares-master.tar.xz c-ares-master.zip |
This patch allows the use of IPv6 addresses for nameserves in both
/etc/resolv.conf and by using the ares_set_nameservers() API.
Diffstat (limited to 'ares_set_nameservers.3')
-rw-r--r-- | ares_set_nameservers.3 | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/ares_set_nameservers.3 b/ares_set_nameservers.3 new file mode 100644 index 0000000..9795c98 --- /dev/null +++ b/ares_set_nameservers.3 @@ -0,0 +1,68 @@ +.TH ARES_SET_NAMESERVERS 3 "12 Feb 2010" +.SH NAME +ares_set_nameservers - Set nameservers +.SH SYNOPSIS +.nf +.B #include <ares.h> +.PP +.B int ares_set_nameservers(ares_channel \fIchannel\fP, + struct ares_addr *\fIservers\fP, + int \fInum_servers\fP) +.PP +.B cc file.c -lcares +.fi +.SH DESCRIPTION +.PP +This function sets nameservers for the given ares channel handle. +The array +.I servers +contains the addresses of nameservers, the length of the array +is stored in the +.I num_servers +parameter. +Contrary to initializing nameservers with +.B ares_init_options +this function can be used to set IPv6 nameservers. + +The structure +.I ares_addr +contains the following fields: +.sp +.in +4n +.nf +struct ares_addr { + int family; + union { + struct in_addr addr4; + struct in6_addr addr6; + } addr; +}; +.fi +.in + +Two shortcuts for accessing members of the union +.I addr +are defined: +.sp +.in +4n +.nf +#define addrV4 addr.addr4 +#define addrV6 addr.addr6 +.fi +.in +.PP +.SH RETURN VALUES +.B ares_set_nameservers +can return any of the following values: +.TP 15 +.B ARES_SUCCESS +The response was successfully parsed. +.TP 15 +.B ARES_ENOMEM +Memory was exhausted. +.SH SEE ALSO +.BR ares_init_options (3) +.SH AUTHOR +Written by Jakub Hrozek <jhrozek@redhat.com>, +on behalf of Red Hat, Inc http://www.redhat.com + |