2 .\" Copyright 2010 by Ben Greear <greearb@candelatech.com>
4 .\" Permission to use, copy, modify, and distribute this
5 .\" software and its documentation for any purpose and without
6 .\" fee is hereby granted, provided that the above copyright
7 .\" notice appear in all copies and that both that copyright
8 .\" notice and this permission notice appear in supporting
9 .\" documentation, and that the name of M.I.T. not be used in
10 .\" advertising or publicity pertaining to distribution of the
11 .\" software without specific, written prior permission.
12 .\" M.I.T. makes no representations about the suitability of
13 .\" this software for any purpose. It is provided "as is"
14 .\" without express or implied warranty.
16 .TH ARES_SET_SERVERS 3 "5 March 2010"
18 ares_set_servers \- Initialize an ares_channel name servers configuration
23 .B int ares_set_servers(ares_channel \fIchannel\fP, struct ares_addr_node *\fIservers\fP)
26 The \fBares_set_servers(3)\fP function initializes name servers configuration
27 for the channel data identified by
31 pointer to a linked list of ares_addr_node structs holding name servers
34 The name server linked list pointer argument may be the result of a previous
35 call to \fBares_get_servers(3)\fP or a linked list of ares_addr_node structs
38 This function replaces any potentially previously configured name servers
39 with the ones given in the linked list. So, in order to configure a channel
40 with more than one name server all the desired ones must be specified in a
43 \fBares_set_servers(3)\fP does not take ownership of the linked list argument.
44 The caller is responsible for freeing the linked list when no longer needed.
46 This function is capable of handling IPv4 and IPv6 name server
47 addresses simultaneously, rendering \fBares_init_options(3)\fP with
48 optmask \fBARES_OPT_SERVERS\fP functionally obsolete except for
49 IPv4-only name server usage.
52 .B ares_set_servers(3)
53 may return any of the following values:
56 The name servers configuration was successfuly initialized.
59 The process's available memory was exhausted.
62 The channel data identified by
66 .B ARES_ENOTINITIALIZED
67 c-ares library initialization not yet performed.
69 .BR ares_set_servers_csv (3),
70 .BR ares_get_servers (3),
71 .BR ares_init_options (3),
74 ares_set_servers(3) was added in c-ares 1.7.1
76 Implementation of this function and associated library internals are based
77 on code, comments and feedback provided in November and December of 2008 by
78 Daniel Stenberg, Gregor Jasny, Phil Blundell and Yang Tse, December 2009
79 by Cedric Bail, February 2010 by Jakub Hrozek. On March 2010 Yang Tse
80 shuffled all the bits and this function popped out.
82 Copyright 1998 by the Massachusetts Institute of Technology.
84 Copyright (C) 2008-2010 by Daniel Stenberg