]> git.ipfire.org Git - thirdparty/squid.git/blame - src/auth/AclMaxUserIp.h
Maintenance: automate header guards 2/3 (#1655)
[thirdparty/squid.git] / src / auth / AclMaxUserIp.h
CommitLineData
5dee515e 1/*
b8ae064d 2 * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
5dee515e 3 *
bbc27441
AJ
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.
5dee515e 7 */
8
ff9d9458
FC
9#ifndef SQUID_SRC_AUTH_ACLMAXUSERIP_H
10#define SQUID_SRC_AUTH_ACLMAXUSERIP_H
63be0a78 11
2f1431ea
AJ
12#if USE_AUTH
13
922513e5 14#include "acl/Node.h"
a33a428a 15#include "auth/UserRequest.h"
5dee515e 16
922513e5 17class ACLMaxUserIP : public Acl::Node
62e76326 18{
b001e822 19 MEMPROXY_CLASS(ACLMaxUserIP);
b0dd28ba 20
741c2986 21public:
4eac3407 22 explicit ACLMaxUserIP(char const *theClass);
b0dd28ba 23
337b9aa4
AR
24 char const *typeString() const override;
25 const Acl::Options &options() override;
26 void parse() override;
27 int match(ACLChecklist *cl) override;
28 SBufList dump() const override;
29 bool empty() const override;
30 bool valid() const override;
31 bool requiresRequest() const override {return true;}
b0dd28ba 32
d295d770 33 int getMaximum() const {return maximum;}
34
b0dd28ba 35private:
d6d0eb11 36 int match(Auth::UserRequest::Pointer auth_user_request, Ip::Address const &src_addr);
4eac3407
CT
37
38public:
39 Acl::BooleanOptionValue beStrict; ///< Enforce "one user, one device" policy?
40
41private:
b0dd28ba 42 char const *class_;
4b0f5de8 43 int maximum;
b0dd28ba 44};
5dee515e 45
2f1431ea 46#endif /* USE_AUTH */
ff9d9458 47#endif /* SQUID_SRC_AUTH_ACLMAXUSERIP_H */
f53969cc 48