9#ifndef SQUID_SRC_HTTPUPGRADEPROTOCOLACCESS_H
10#define SQUID_SRC_HTTPUPGRADEPROTOCOLACCESS_H
22 ProtocolView(
const char *
const start,
const size_t len);
61 template <
typename Visitor>
inline void forEach(
const Visitor &)
const;
94template <
typename Visitor>
99 visitor(namedGuard.protocol, namedGuard.guard);
104template <
typename Visitor>
108 auto seenApplicable =
false;
110 if (offer.
name != namedGuard.proto.name)
112 if (
vAinB(offer, namedGuard.proto) && visitor(namedGuard.protocol, namedGuard.guard))
114 seenApplicable =
true;
116 if (!seenApplicable &&
other)
123 static const auto proto =
new SBuf(
"OTHER");
bool vAinB(const ProtocolView &a, const ProtocolView &b)
std::ostream & operator<<(std::ostream &, const ProtocolView &)
a single configured access rule for an explicitly named protocol
NamedGuard(const NamedGuard &&)=delete
acl_access * guard
configured access rule; never nil
const SBuf protocol
configured protocol name (and version)
const ProtocolView proto
optimization: compiled this->protocol
Allows or blocks HTTP Upgrade protocols (see http_upgrade_request_protocols)
void configureGuard(ConfigParser &)
parses a single allow/deny rule
HttpUpgradeProtocolAccess(HttpUpgradeProtocolAccess &&)=delete
~HttpUpgradeProtocolAccess()
const acl_access * findGuard(const SBuf &proto) const
std::deque< NamedGuard > NamedGuards
maps HTTP Upgrade protocol name/version to the ACLs guarding its usage
acl_access * other
OTHER rules governing unnamed protocols.
static const SBuf & ProtoOther()
pseudonym to specify rules for "all other protocols"
void forEach(const Visitor &) const
iterates over all configured rules, calling the given visitor
void forApplicable(const ProtocolView &, const Visitor &) const
NamedGuards namedGuards
rules governing upgrades to explicitly named protocols
HttpUpgradeProtocolAccess()=default
a reference to a protocol name[/version] string; no 0-termination is assumed
SBuf version
everything after the name, including the slash('/')
SBuf name
everything up to (but excluding) the first slash('/')