]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/acl/ProtocolData.cc
36efd5c1010b1a794f56745566b6ffd1d85d1a58
2 * Copyright (C) 1996-2025 The Squid Software Foundation and contributors
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.
9 /* DEBUG: section 28 Access Control */
12 #include "acl/Checklist.h"
13 #include "acl/ProtocolData.h"
14 #include "ConfigParser.h"
15 #include "debug/Stream.h"
18 ACLProtocolData::~ACLProtocolData()
24 ACLProtocolData::match(AnyP::ProtocolType toFind
)
26 for (auto itr
= values
.begin(); itr
!= values
.end(); ++itr
) {
28 // tune the list for LRU ordering
30 values
.push_front(toFind
);
38 ACLProtocolData::dump() const
41 for (std::list
<AnyP::ProtocolType
>::const_iterator itr
= values
.begin(); itr
!= values
.end(); ++itr
) {
42 sl
.push_back(SBuf(AnyP::ProtocolType_str
[*itr
]));
49 ACLProtocolData::parse()
51 while (char *t
= ConfigParser::strtokFile()) {
52 int p
= AnyP::PROTO_NONE
;
53 for (; p
< AnyP::PROTO_UNKNOWN
; ++p
) {
54 if (strcasecmp(t
, AnyP::ProtocolType_str
[p
]) == 0) {
55 values
.push_back(static_cast<AnyP::ProtocolType
>(p
));
59 if (p
== AnyP::PROTO_UNKNOWN
) {
60 debugs(28, DBG_IMPORTANT
, "WARNING: Ignoring unknown protocol '" << t
<< "' in the ACL");
61 // XXX: store the text pattern of this protocol name for live comparisons