1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef netwerk_dns_GetAddrInfo_h
8 #define netwerk_dns_GetAddrInfo_h
14 #define DNSQUERY_AVAILABLE 1
15 #define TTL_AVAILABLE 1
17 #define DNSQUERY_AVAILABLE 0
18 #define TTL_AVAILABLE 0
27 * Look up a host by name. Mostly equivalent to getaddrinfo(host, NULL, ...) of
30 * @param aHost[in] Character string defining the host name of interest
31 * @param aAddressFamily[in] May be AF_INET, AF_INET6, or AF_UNSPEC.
32 * @param aFlags[in] May be either PR_AI_ADDRCONFIG or
33 * PR_AI_ADDRCONFIG | PR_AI_NOCANONNAME. Include PR_AI_NOCANONNAME to
34 * suppress the determination of the canonical name corresponding to
35 * hostname (PR_AI_NOCANONNAME will be ignored if the TTL is retrieved).
36 * @param aAddrInfo[out] Will point to the results of the host lookup, or be
37 * null if the lookup failed.
38 * @param aGetTtl[in] If true, and TTL_AVAILABLE is truthy, the TTL will be
39 * retrieved if DNS provides the answers..
42 GetAddrInfo(const char* aHost
, uint16_t aAddressFamily
, uint16_t aFlags
,
43 const char* aNetworkInterface
, AddrInfo
** aAddrInfo
, bool aGetTtl
);
46 * Initialize the GetAddrInfo module.
48 * GetAddrInfoShutdown() should be called for every time this function is
55 * Shutdown the GetAddrInfo module.
57 * This function should be called for every time GetAddrInfoInit() is called.
58 * An assertion may throw (but is not guarenteed) if this function is called
62 GetAddrInfoShutdown();
65 } // namespace mozilla
67 #endif // netwerk_dns_GetAddrInfo_h