14std::optional<AnyP::Host>
23std::optional<AnyP::Host>
27 debugs(23, 3,
"rejecting empty name");
38 debugs(83, 3,
"rejecting ASCII NUL character in " << rawName);
48std::optional<AnyP::Host>
52 debugs(23, 3,
"rejecting wildcard in " << rawName);
55 return ParseDomainName(rawName);
58std::optional<AnyP::Host>
61 const static SBuf wildcardLabel(
"*.");
64 debugs(23, 3,
"rejecting excessive wildcards in " << rawName);
71 debugs(23, 3,
"rejecting unsupported wildcard in " << rawName);
76 return ParseDomainName(rawName);
82 if (
const auto ip = host.
ip()) {
84 (void)ip->toStr(buf,
sizeof(buf));
101 bool addBrackets =
false;
102 if (
const auto ip = hostWrapper.
host.
ip())
103 addBrackets = ip->isIPv6();
107 os << hostWrapper.
host;
#define Assure(condition)
either a domain name (as defined in DNS RFC 1034) or an IP address
static std::optional< Host > ParseIp(const Ip::Address &)
converts an already parsed IP address to a Host object
static std::optional< Host > ParseSimpleDomainName(const SBuf &)
auto domainName() const
stored domain name (if any)
static std::optional< Host > ParseWildDomainName(const SBuf &)
static std::optional< Host > ParseDomainName(const SBuf &)
common parts of FromSimpleDomain() and FromWildDomain()
static const size_type npos
size_type find(char c, size_type startPos=0) const
bool startsWith(const SBuf &S, const SBufCaseSensitive isCaseSensitive=caseSensitive) const
#define debugs(SECTION, LEVEL, CONTENT)
#define MAX_IPSTRLEN
Length of buffer that needs to be allocated to old a null-terminated IP-string.
std::ostream & operator<<(std::ostream &, const Host &)