]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/acl/Ip.h
2 * Copyright (C) 1996-2020 The Squid Software Foundation and contributors
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.
14 #include "ip/Address.h"
19 MEMPROXY_CLASS(acl_ip_data
);
22 static acl_ip_data
*FactoryParse(char const *);
23 static int NetworkCompare(acl_ip_data
* const & a
, acl_ip_data
* const &b
);
27 acl_ip_data (Ip::Address
const &, Ip::Address
const &, Ip::Address
const &, acl_ip_data
*);
28 void toStr(char *buf
, int len
) const;
35 Ip::Address mask
; // TODO: should use a CIDR range
37 acl_ip_data
*next
; /**< used for parsing, not for storing */
41 static bool DecodeMask(const char *asc
, Ip::Address
&mask
, int string_format_type
);
44 class ACLIP
: public ACL
47 void *operator new(size_t);
48 void operator delete(void *);
50 ACLIP() : data(NULL
) {}
53 typedef Splay
<acl_ip_data
*> IPSplay
;
55 virtual char const *typeString() const = 0;
57 // virtual bool isProxyAuth() const {return true;}
58 virtual int match(ACLChecklist
*checklist
) = 0;
59 virtual SBufList
dump() const;
60 virtual bool empty () const;
64 int match(const Ip::Address
&);
69 #endif /* SQUID_ACLIP_H */