|
Squid Web Cache v8/master
|
either a domain name (as defined in DNS RFC 1034) or an IP address More...
#include <Host.h>
Public Member Functions | |
| auto | ip () const |
| auto | domainName () const |
| stored domain name (if any) | |
Static Public Member Functions | |
| 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 &) |
| static std::optional< Host > | ParseWildDomainName (const SBuf &) |
Private Types | |
| using | Storage = std::variant< Ip::Address, Dns::DomainName > |
Private Member Functions | |
| Host (const Storage &raw) | |
Static Private Member Functions | |
| static std::optional< Host > | ParseDomainName (const SBuf &) |
| common parts of FromSimpleDomain() and FromWildDomain() | |
Private Attributes | |
| Storage | raw_ |
| the host we are providing access to | |
|
private |
|
inline |
Definition at line 48 of file Host.h.
References raw_.
Referenced by Ssl::GeneralNameMatcher::match(), and AnyP::operator<<().
|
inline |
stored IPv or IPv6 address (if any)
Ip::Address::isNoAddr() may be true for the returned address. Ip::Address::isAnyAddr() may be true for the returned address.
Definition at line 45 of file Host.h.
References raw_.
Referenced by Ssl::GeneralNameMatcher::match(), AnyP::operator<<(), AnyP::operator<<(), and ParseIp().
|
staticprivate |
Definition at line 24 of file Host.cc.
References debugs, SBuf::find(), SBuf::isEmpty(), and SBuf::npos.
|
static |
Definition at line 15 of file Host.cc.
Referenced by Ssl::ParseAsSimpleDomainNameOrIp(), AnyP::Uri::parsedHost(), and ParseSubjectAltName().
|
static |
Parses input as a literal ASCII domain name (A-labels OK; see RFC 5890). Does not allow wildcards;
Definition at line 49 of file Host.cc.
References debugs, SBuf::find(), and SBuf::npos.
Referenced by Acl::ServerNameCheck::match(), Ssl::ParseAsSimpleDomainNameOrIp(), and AnyP::Uri::parsedHost().
|
static |
Same as ParseSimpleDomainName() but allows the first label to be a wildcard (RFC 9525 Section 6.3).
Definition at line 59 of file Host.cc.
References debugs, SBuf::find(), SBuf::npos, and SBuf::startsWith().
Referenced by ParseSubjectAltName().
|
private |
Definition at line 58 of file Host.h.
Referenced by domainName(), and ip().