]>
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"
22 MEMPROXY_CLASS(acl_ip_data
);
23 static acl_ip_data
*FactoryParse(char const *);
24 static int NetworkCompare(acl_ip_data
* const & a
, acl_ip_data
* const &b
);
28 acl_ip_data (Ip::Address
const &, Ip::Address
const &, Ip::Address
const &, acl_ip_data
*);
29 void toStr(char *buf
, int len
) const;
36 Ip::Address mask
; /**< \todo This should perhapse be stored as a CIDR range now instead of a full IP mask. */
38 acl_ip_data
*next
; /**< used for parsing, not for storing */
42 static bool DecodeMask(const char *asc
, Ip::Address
&mask
, int string_format_type
);
45 MEMPROXY_CLASS_INLINE(acl_ip_data
);
48 class ACLIP
: public ACL
52 void *operator new(size_t);
53 void operator delete(void *);
55 ACLIP() : data(NULL
) {}
56 explicit ACLIP(const ACLFlag flgs
[]) : ACL(flgs
), data(NULL
) {}
60 typedef SplayNode
<acl_ip_data
*> IPSplay
;
62 virtual char const *typeString() const = 0;
64 // virtual bool isProxyAuth() const {return true;}
65 virtual int match(ACLChecklist
*checklist
) = 0;
66 virtual SBufList
dump() const;
67 virtual bool empty () const;
71 int match(Ip::Address
&);
75 static void DumpIpListWalkee(acl_ip_data
* const & ip
, void *state
);
78 #endif /* SQUID_ACLIP_H */