c_ares_sys/
constants.rs

1use crate::ffi::ares_socket_t;
2use std::os::raw::c_int;
3
4// Library initialization flags
5pub const ARES_LIB_INIT_NONE: c_int = 0;
6pub const ARES_LIB_INIT_WIN32: c_int = 1;
7pub const ARES_LIB_INIT_ALL: c_int = ARES_LIB_INIT_WIN32;
8
9// Flag values
10pub const ARES_FLAG_USEVC: c_int = 1;
11pub const ARES_FLAG_PRIMARY: c_int = 1 << 1;
12pub const ARES_FLAG_IGNTC: c_int = 1 << 2;
13pub const ARES_FLAG_NORECURSE: c_int = 1 << 3;
14pub const ARES_FLAG_STAYOPEN: c_int = 1 << 4;
15pub const ARES_FLAG_NOSEARCH: c_int = 1 << 5;
16pub const ARES_FLAG_NOALIASES: c_int = 1 << 6;
17pub const ARES_FLAG_NOCHECKRESP: c_int = 1 << 7;
18pub const ARES_FLAG_EDNS: c_int = 1 << 8;
19pub const ARES_FLAG_NO_DFLT_SVR: c_int = 1 << 9;
20#[allow(non_upper_case_globals)]
21pub const ARES_FLAG_DNS0x20: c_int = 1 << 10;
22
23// Option mask values
24pub const ARES_OPT_FLAGS: c_int = 1;
25pub const ARES_OPT_TIMEOUT: c_int = 1 << 1;
26pub const ARES_OPT_TRIES: c_int = 1 << 2;
27pub const ARES_OPT_NDOTS: c_int = 1 << 3;
28pub const ARES_OPT_UDP_PORT: c_int = 1 << 4;
29pub const ARES_OPT_TCP_PORT: c_int = 1 << 5;
30pub const ARES_OPT_SERVERS: c_int = 1 << 6;
31pub const ARES_OPT_DOMAINS: c_int = 1 << 7;
32pub const ARES_OPT_LOOKUPS: c_int = 1 << 8;
33pub const ARES_OPT_SOCK_STATE_CB: c_int = 1 << 9;
34pub const ARES_OPT_SORTLIST: c_int = 1 << 10;
35pub const ARES_OPT_SOCK_SNDBUF: c_int = 1 << 11;
36pub const ARES_OPT_SOCK_RCVBUF: c_int = 1 << 12;
37pub const ARES_OPT_TIMEOUTMS: c_int = 1 << 13;
38pub const ARES_OPT_ROTATE: c_int = 1 << 14;
39pub const ARES_OPT_EDNSPSZ: c_int = 1 << 15;
40pub const ARES_OPT_NOROTATE: c_int = 1 << 16;
41pub const ARES_OPT_RESOLVCONF: c_int = 1 << 17;
42pub const ARES_OPT_HOSTS_FILE: c_int = 1 << 18;
43pub const ARES_OPT_UDP_MAX_QUERIES: c_int = 1 << 19;
44pub const ARES_OPT_MAXTIMEOUTMS: c_int = 1 << 20;
45pub const ARES_OPT_QUERY_CACHE: c_int = 1 << 21;
46pub const ARES_OPT_EVENT_THREAD: c_int = 1 << 22;
47pub const ARES_OPT_SERVER_FAILOVER: c_int = 1 << 23;
48
49// Flags for nameinfo queries
50pub const ARES_NI_NOFQDN: c_int = 1;
51pub const ARES_NI_NUMERICHOST: c_int = 1 << 1;
52pub const ARES_NI_NAMEREQD: c_int = 1 << 2;
53pub const ARES_NI_NUMERICSERV: c_int = 1 << 3;
54pub const ARES_NI_DGRAM: c_int = 1 << 4;
55pub const ARES_NI_TCP: c_int = 0;
56pub const ARES_NI_UDP: c_int = ARES_NI_DGRAM;
57pub const ARES_NI_SCTP: c_int = 1 << 5;
58pub const ARES_NI_DCCP: c_int = 1 << 6;
59pub const ARES_NI_NUMERICSCOPE: c_int = 1 << 7;
60pub const ARES_NI_LOOKUPHOST: c_int = 1 << 8;
61pub const ARES_NI_LOOKUPSERVICE: c_int = 1 << 9;
62pub const ARES_NI_IDN: c_int = 1 << 10;
63pub const ARES_NI_IDN_ALLOW_UNASSIGNED: c_int = 1 << 11;
64pub const ARES_NI_IDN_USE_STD3_ASCII_RULES: c_int = 1 << 12;
65
66// Server state callback flag values
67pub const ARES_SERV_STATE_UDP: c_int = 1;
68pub const ARES_SERV_STATE_TCP: c_int = 1 << 1;
69
70// A non-existent file descriptor
71#[cfg(windows)]
72pub const ARES_SOCKET_BAD: ares_socket_t = !0;
73#[cfg(unix)]
74pub const ARES_SOCKET_BAD: ares_socket_t = -1;
75
76// ares_getsock() can return info about this many sockets
77pub const ARES_GETSOCK_MAXNUM: usize = 16;