/*
- * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
+ * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
*
* Squid software is distributed under GPLv2+ license and includes
* contributions from numerous individuals and organizations.
#define SQUID_ACLSERVERNAME_H
#include "acl/Acl.h"
-#include "acl/Checklist.h"
-#include "acl/Data.h"
#include "acl/DomainData.h"
-#include "acl/Strategised.h"
+#include "acl/Strategy.h"
class ACLServerNameData : public ACLDomainData {
MEMPROXY_CLASS(ACLServerNameData);
public:
ACLServerNameData() : ACLDomainData() {}
- virtual bool match(const char *);
- virtual ACLData<char const *> *clone() const;
+ bool match(const char *) override;
};
class ACLServerNameStrategy : public ACLStrategy<char const *>
{
public:
- virtual int match (ACLData<MatchType> * &, ACLFilledChecklist *, ACLFlags &);
- static ACLServerNameStrategy *Instance();
- virtual bool requiresRequest() const {return true;}
-
- /**
- * Not implemented to prevent copies of the instance.
- \par
- * Not private to prevent brain dead g+++ warnings about
- * private constructors with no friends
- */
- ACLServerNameStrategy(ACLServerNameStrategy const &);
+ /* ACLStrategy API */
+ int match (ACLData<MatchType> * &, ACLFilledChecklist *) override;
+ bool requiresRequest() const override {return true;}
+ const Acl::Options &options() override;
+ bool valid() const override;
private:
- static ACLServerNameStrategy Instance_;
- ACLServerNameStrategy() {}
-
- ACLServerNameStrategy&operator=(ACLServerNameStrategy const &);
-};
-
-class ACLServerName
-{
-
-private:
- static ACL::Prototype LiteralRegistryProtoype;
- static ACLStrategised<char const *> LiteralRegistryEntry_;
- static ACL::Prototype RegexRegistryProtoype;
- static ACLStrategised<char const *> RegexRegistryEntry_;
+ Acl::BooleanOptionValue useClientRequested; ///< Ignore server-supplied names
+ Acl::BooleanOptionValue useServerProvided; ///< Ignore client-supplied names
+ Acl::BooleanOptionValue useConsensus; ///< Ignore mismatching names
};
#endif /* SQUID_ACLSERVERNAME_H */