1ARES_SET_SORTLIST(3) Library Functions Manual ARES_SET_SORTLIST(3)
2
3
4
6 ares_set_sortlist - Initialize an ares_channel sortlist configuration
7
9 #include <ares.h>
10
11 int ares_set_sortlist(ares_channel channel, const char *sortstr)
12
14 The ares_set_sortlist(3) function initializes an address sortlist con‐
15 figuration for the channel data identified by channel, so that ad‐
16 dresses returned by ares_gethostbyname(3) are sorted according to the
17 sortlist. The provided sortstr string that holds a space separated
18 list of IP-address-netmask pairs. The netmask is optional but follows
19 the address after a slash if present. For example,
20 "130.155.160.0/255.255.240.0 130.155.0.0".
21
22 This function replaces any potentially previously configured address
23 sortlist with the ones given in the configuration string.
24
25
27 ares_set_sortlist(3) may return any of the following values:
28
29 ARES_SUCCESS The sortlist configuration was successfully initialized.
30
31 ARES_ENOMEM The process's available memory was exhausted.
32
33 ARES_ENODATA The channel data identified by channel was invalid.
34
35 ARES_ENOTINITIALIZED
36 c-ares library initialization not yet performed.
37
39 ares_init_options(3), ares_dup(3)
40
42 ares_set_sortlist(3) was added in c-ares 1.11.0
43
44
45
46 23 November 2015 ARES_SET_SORTLIST(3)