]> git.ipfire.org Git - thirdparty/squid.git/blob - src/acl/Random.h
Boilerplate: update copyright blurbs on src/
[thirdparty/squid.git] / src / acl / Random.h
1 /*
2 * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
3 *
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.
7 */
8
9 #ifndef SQUID_ACL_RANDOM_H
10 #define SQUID_ACL_RANDOM_H
11
12 #include "acl/Acl.h"
13 #include "acl/Checklist.h"
14
15 /// \ingroup ACLAPI
16 class ACLRandom : public ACL
17 {
18
19 public:
20 MEMPROXY_CLASS(ACLRandom);
21
22 ACLRandom(char const *);
23 ACLRandom(ACLRandom const &);
24 ~ACLRandom();
25 ACLRandom&operator=(ACLRandom const &);
26
27 virtual ACL *clone()const;
28 virtual char const *typeString() const;
29 virtual void parse();
30 virtual int match(ACLChecklist *checklist);
31 virtual SBufList dump() const;
32 virtual bool empty () const;
33 virtual bool valid() const;
34
35 protected:
36 static Prototype RegistryProtoype;
37 static ACLRandom RegistryEntry_;
38 double data; // value to be exceeded before this ACL will match
39 char pattern[256]; // pattern from config file. Used to generate 'data'
40 char const *class_;
41 };
42
43 MEMPROXY_CLASS_INLINE(ACLRandom);
44
45 #endif /* SQUID_ACL_RANDOM_H */