26 #ifndef NFD_DAEMON_FACE_NETWORK_PREDICATE_HPP 27 #define NFD_DAEMON_FACE_NETWORK_PREDICATE_HPP 31 #include <ndn-cxx/net/network-interface.hpp> 57 assign(std::initializer_list<std::pair<std::string, std::string>> whitelist,
58 std::initializer_list<std::pair<std::string, std::string>> blacklist);
71 isRuleSupported(
const std::string& key) = 0;
74 isRuleValid(
const std::string& key,
const std::string& value) = 0;
77 parseList(std::set<std::string>&
set,
const boost::property_tree::ptree& list,
const std::string& section);
80 parseList(std::set<std::string>&
set, std::initializer_list<std::pair<std::string, std::string>> list);
101 operator()(
const ndn::net::NetworkInterface& netif)
const;
105 isRuleSupported(
const std::string& key)
final;
108 isRuleValid(
const std::string& key,
const std::string& value)
final;
123 operator()(
const boost::asio::ip::address& address)
const;
127 isRuleSupported(
const std::string& key)
final;
130 isRuleValid(
const std::string& key,
const std::string& value)
final;
136 #endif // NFD_DAEMON_FACE_NETWORK_PREDICATE_HPP void parseWhitelist(const boost::property_tree::ptree &list)
void parseBlacklist(const boost::property_tree::ptree &list)
Represents a predicate to accept or reject an IP address.
bool operator==(const NetworkPredicateBase &other) const
#define PUBLIC_WITH_TESTS_ELSE_PROTECTED
std::set< std::string > m_blacklist
std::set< std::string > m_whitelist
bool operator!=(const NetworkPredicateBase &other) const
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
virtual ~NetworkPredicateBase()
Represents a predicate to accept or reject a ndn::net::NetworkInterface.
void clear()
Set the whitelist to "*" and clear the blacklist.
void assign(std::initializer_list< std::pair< std::string, std::string >> whitelist, std::initializer_list< std::pair< std::string, std::string >> blacklist)