Represents a predicate to accept or reject an IP address. More...
#include <daemon/face/network-predicate.hpp>
Public Member Functions | |
void | assign (std::initializer_list< std::pair< std::string, std::string >> whitelist, std::initializer_list< std::pair< std::string, std::string >> blacklist) |
void | clear () |
Set the whitelist to "*" and clear the blacklist. More... | |
bool | operator() (const boost::asio::ip::address &address) const |
void | parseBlacklist (const boost::property_tree::ptree &list) |
void | parseWhitelist (const boost::property_tree::ptree &list) |
Protected Attributes | |
std::set< std::string > | m_blacklist |
std::set< std::string > | m_whitelist |
Represents a predicate to accept or reject an IP address.
The predicate consists of a whitelist and a blacklist. Whitelist and blacklist can contain, in no particular order, IPv4 and IPv6 subnets (e.g., subnet 192.0.2.0/24
or subnet 2001:db8:2::/64
) or a wildcard (*
) that matches all IP addresses. An IP address is accepted if it matches any entry in the whitelist and none of the entries in the blacklist.
Definition at line 138 of file network-predicate.hpp.
|
inherited |
Definition at line 113 of file network-predicate.cpp.
|
inherited |
Set the whitelist to "*" and clear the blacklist.
Definition at line 42 of file network-predicate.cpp.
bool nfd::face::IpAddressPredicate::operator() | ( | const boost::asio::ip::address & | address | ) | const |
Definition at line 214 of file network-predicate.cpp.
|
inherited |
Definition at line 107 of file network-predicate.cpp.
|
inherited |
Definition at line 101 of file network-predicate.cpp.
|
protectedinherited |
Definition at line 103 of file network-predicate.hpp.
|
protectedinherited |
Definition at line 102 of file network-predicate.hpp.