]> git.ipfire.org Git - thirdparty/squid.git/blame - src/dns/LookupDetails.h
SourceLayout: shuffle DNS primitives to dns/libdns.la
[thirdparty/squid.git] / src / dns / LookupDetails.h
CommitLineData
3ff65596 1/*
bde978a6 2 * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
bbc27441
AJ
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
3ff65596
AR
7 */
8
bbc27441
AJ
9/* DEBUG: section 78 DNS lookups */
10
4a3b98d7
AJ
11#ifndef SQUID_DNS_LOOKUPDETAILS_H
12#define SQUID_DNS_LOOKUPDETAILS_H
3ff65596 13
3ff65596
AR
14#include "SquidString.h"
15
4a3b98d7
AJ
16namespace Dns
17{
18
3ff65596 19/// encapsulates DNS lookup results
4a3b98d7 20class LookupDetails
3ff65596
AR
21{
22public:
4a3b98d7
AJ
23 LookupDetails() : wait(-1) {} ///< no error, no lookup delay (i.e., no lookup)
24 LookupDetails(const String &anError, int aWait) : error(anError), wait(aWait) {}
3ff65596
AR
25
26 std::ostream &print(std::ostream &os) const;
27
28public:
4a3b98d7 29 String error; ///< error message for unsuccessful lookups; empty otherwise
3ff65596
AR
30 int wait; ///< msecs spent waiting for the lookup (if any) or -1 (if none)
31};
32
4a3b98d7
AJ
33} // namespace Dns
34
35inline std::ostream &
36operator <<(std::ostream &os, const Dns::LookupDetails &dns)
3ff65596
AR
37{
38 return dns.print(os);
39}
40
4a3b98d7 41#endif /* SQUID_DNS_LOOKUPDETAILS_H */
f53969cc 42