c_ares/
flags.rs

1use bitflags::bitflags;
2bitflags!(
3    /// Flags that may be passed when initializing a `Channel`.
4    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
5    pub struct Flags: i32 {
6        /// Always use TCP queries (the "virtual circuit") instead of UDP queries.  Normally, TCP
7        /// is only used if a UDP query yields a truncated result.
8        const USEVC = c_ares_sys::ARES_FLAG_USEVC;
9
10        /// Only query the first server in the list of servers to query.
11        const PRIMARY = c_ares_sys::ARES_FLAG_PRIMARY;
12
13        /// If a truncated response to a UDP query is received, do not fall back to TCP; simply
14        /// continue on with the truncated response.
15        const IGNTC = c_ares_sys::ARES_FLAG_IGNTC;
16
17        /// Do not set the "recursion desired" bit on outgoing queries, so that the name server
18        /// being contacted will not try to fetch the answer from other servers if it doesn't know
19        /// the answer locally.
20        const NORECURSE = c_ares_sys::ARES_FLAG_NORECURSE;
21
22        /// Do not close communications sockets when the number of active queries drops to zero.
23        const STAYOPEN = c_ares_sys::ARES_FLAG_STAYOPEN;
24
25        /// Do not use the default search domains; only query hostnames as-is or as aliases.
26        const NOSEARCH = c_ares_sys::ARES_FLAG_NOSEARCH;
27
28        /// Do not honor the HOSTALIASES environment variable, which normally specifies a file of
29        /// hostname translations.
30        const NOALIASES = c_ares_sys::ARES_FLAG_NOALIASES;
31
32        /// Do not discard responses with the SERVFAIL, NOTIMP, or REFUSED response code or
33        /// responses whose questions don't match the questions in the request. Primarily useful
34        /// for writing clients which might be used to test or debug name servers.
35        const NOCHECKRESP = c_ares_sys::ARES_FLAG_NOCHECKRESP;
36
37        /// Include an EDNS pseudo-resource record (RFC 2671) in generated requests.  As of c-ares
38        /// v1.22, this is on by default if flags are otherwise not set.
39        const EDNS = c_ares_sys::ARES_FLAG_EDNS;
40
41        /// Do not attempt to add a default local named server if there are no other servers
42        /// available.  Instead, fail initialization with ARES_ENOSERVER.
43        const NO_DFLT_SVR = c_ares_sys::ARES_FLAG_NO_DFLT_SVR;
44
45        /// Enable support for DNS 0x20 as per
46        /// https://datatracker.ietf.org/doc/html/draft-vixie-dnsext-dns0x20-00 which adds
47        /// additional entropy to the request by randomizing the case of the query name.
48        const DNS_0X20 = c_ares_sys::ARES_FLAG_DNS0x20;
49    }
50);