Ip.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2020 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_ACLIP_H
10 #define SQUID_ACLIP_H
11 
12 #include "acl/Acl.h"
13 #include "acl/Data.h"
14 #include "ip/Address.h"
15 #include "splay.h"
16 
18 {
20 
21 public:
22  static acl_ip_data *FactoryParse(char const *);
23  static int NetworkCompare(acl_ip_data * const & a, acl_ip_data * const &b);
24 
25  acl_ip_data ();
26 
27  acl_ip_data (Ip::Address const &, Ip::Address const &, Ip::Address const &, acl_ip_data *);
28  void toStr(char *buf, int len) const;
29  SBuf toSBuf() const;
30 
32 
34 
35  Ip::Address mask; // TODO: should use a CIDR range
36 
39 private:
40 
41  static bool DecodeMask(const char *asc, Ip::Address &mask, int string_format_type);
42 };
43 
44 class ACLIP : public ACL
45 {
46 public:
47  void *operator new(size_t);
48  void operator delete(void *);
49 
50  ACLIP() : data(NULL) {}
51  ~ACLIP();
52 
54 
55  virtual char const *typeString() const = 0;
56  virtual void parse();
57  // virtual bool isProxyAuth() const {return true;}
58  virtual int match(ACLChecklist *checklist) = 0;
59  virtual SBufList dump() const;
60  virtual bool empty () const;
61 
62 protected:
63 
64  int match(const Ip::Address &);
66 
67 };
68 
69 #endif /* SQUID_ACLIP_H */
70 
virtual int match(ACLChecklist *checklist)=0
Matches the actual data in checklist against this ACL.
IPSplay * data
Definition: Ip.h:65
SBuf toSBuf() const
Definition: Ip.cc:72
std::list< SBuf > SBufList
Definition: forward.h:22
Definition: SBuf.h:86
Ip::Address mask
Definition: Ip.h:35
virtual void parse()
parses node representation in squid.conf; dies on failures
Definition: Ip.cc:475
Ip::Address addr2
Definition: Ip.h:33
static int NetworkCompare(acl_ip_data *const &a, acl_ip_data *const &b)
Definition: Ip.cc:121
int const char size_t
Definition: stub_liblog.cc:86
ACLIP()
Definition: Ip.h:50
void toStr(char *buf, int len) const
Definition: Ip.cc:41
Definition: splay.h:56
virtual const char * typeString() const =0
#define NULL
Definition: types.h:166
Definition: Ip.h:44
virtual bool empty() const
Definition: Ip.cc:518
Ip::Address addr1
Definition: Ip.h:31
Splay< acl_ip_data * > IPSplay
Definition: Ip.h:53
Definition: Acl.h:39
~ACLIP()
Definition: Ip.cc:494
virtual SBufList dump() const
Definition: Ip.cc:510
static bool DecodeMask(const char *asc, Ip::Address &mask, int string_format_type)
Definition: Ip.cc:156
Definition: Ip.h:17
int unsigned int const char *desc STUB void int len
Definition: stub_fd.cc:20
acl_ip_data()
Definition: Ip.cc:542
acl_ip_data * next
Definition: Ip.h:37
void const char * buf
Definition: stub_helper.cc:16
static acl_ip_data * FactoryParse(char const *)
Definition: Ip.cc:209
MEMPROXY_CLASS(acl_ip_data)

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors