]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/acl/Ip.h
2 * Copyright (C) 1996-2014 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 This should perhapse be stored as a CIDR range now instead of a full IP mask. */
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
) {}
51 explicit ACLIP(const ACLFlag flgs
[]) : ACL(flgs
), data(NULL
) {}
55 typedef Splay
<acl_ip_data
*> IPSplay
;
57 virtual char const *typeString() const = 0;
59 // virtual bool isProxyAuth() const {return true;}
60 virtual int match(ACLChecklist
*checklist
) = 0;
61 virtual SBufList
dump() const;
62 virtual bool empty () const;
66 int match(Ip::Address
&);
71 #endif /* SQUID_ACLIP_H */