Ip.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2023 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
21public:
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
39private:
40
41 static bool DecodeMask(const char *asc, Ip::Address &mask, int string_format_type);
42};
43
44class ACLIP : public ACL
45{
46public:
47 void *operator new(size_t);
48 void operator delete(void *);
49
50 ACLIP() : data(nullptr) {}
51 ~ACLIP() override;
52
54
55 char const *typeString() const override = 0;
56 void parse() override;
57 // virtual bool isProxyAuth() const {return true;}
58 int match(ACLChecklist *checklist) override = 0;
59 SBufList dump() const override;
60 bool empty () const override;
61
62protected:
63
64 int match(const Ip::Address &);
66
67};
68
69#endif /* SQUID_ACLIP_H */
70
Definition: Ip.h:45
ACLIP()
Definition: Ip.h:50
SBufList dump() const override
Definition: Ip.cc:510
Splay< acl_ip_data * > IPSplay
Definition: Ip.h:53
char const * typeString() const override=0
void parse() override
parses node representation in squid.conf; dies on failures
Definition: Ip.cc:475
~ACLIP() override
Definition: Ip.cc:494
bool empty() const override
Definition: Ip.cc:518
IPSplay * data
Definition: Ip.h:65
int match(ACLChecklist *checklist) override=0
Matches the actual data in checklist against this ACL.
Definition: Acl.h:46
Definition: SBuf.h:94
Definition: splay.h:50
Definition: Ip.h:18
Ip::Address mask
Definition: Ip.h:35
acl_ip_data()
Definition: Ip.cc:542
MEMPROXY_CLASS(acl_ip_data)
SBuf toSBuf() const
Definition: Ip.cc:72
static bool DecodeMask(const char *asc, Ip::Address &mask, int string_format_type)
Definition: Ip.cc:156
static int NetworkCompare(acl_ip_data *const &a, acl_ip_data *const &b)
Definition: Ip.cc:121
Ip::Address addr1
Definition: Ip.h:31
static acl_ip_data * FactoryParse(char const *)
Definition: Ip.cc:209
void toStr(char *buf, int len) const
Definition: Ip.cc:41
acl_ip_data * next
Definition: Ip.h:37
Ip::Address addr2
Definition: Ip.h:33
std::list< SBuf > SBufList
Definition: forward.h:23
int const char size_t
Definition: stub_liblog.cc:83

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors