RequestHeaderStrategy.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2019 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_ACLREQUESTHEADERSTRATEGY_H
10 #define SQUID_ACLREQUESTHEADERSTRATEGY_H
11 #include "acl/Acl.h"
12 #include "acl/Data.h"
13 #include "acl/FilledChecklist.h"
14 #include "acl/Strategy.h"
15 #include "HttpRequest.h"
16 
17 template <Http::HdrType header>
18 class ACLRequestHeaderStrategy : public ACLStrategy<char const *>
19 {
20 
21 public:
22  virtual int match (ACLData<char const *> * &, ACLFilledChecklist *);
23  virtual bool requiresRequest() const {return true;}
24 };
25 
26 template <Http::HdrType header>
27 int
29 {
30  char const *theHeader = checklist->request->header.getStr(header);
31 
32  if (NULL == theHeader)
33  return 0;
34 
35  return data->match(theHeader);
36 }
37 
38 #endif /* SQUID_REQUESTHEADERSTRATEGY_H */
39 
virtual bool match(M)=0
virtual bool requiresRequest() const
Configured ACL parameter(s) (e.g., domain names in dstdomain ACL).
Definition: Data.h:17
void const char HLPCB void * data
Definition: stub_helper.cc:16
const char * getStr(Http::HdrType id) const
Definition: HttpHeader.cc:1181
HttpHeader header
Definition: Message.h:75
HttpRequest * request
virtual int match(ACLData< char const *> *&, ACLFilledChecklist *)
A matching algorithm.
Definition: Strategy.h:21
#define NULL
Definition: types.h:166

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors