nfd::face::NetworkInterfacePredicate Class Referencefinal

Represents a predicate to accept or reject a ndn::net::NetworkInterface. More...

#include <daemon/face/network-predicate.hpp>

+ Inheritance diagram for nfd::face::NetworkInterfacePredicate:
+ Collaboration diagram for nfd::face::NetworkInterfacePredicate:

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 ndn::net::NetworkInterface &netif) 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
 

Detailed Description

Represents a predicate to accept or reject a ndn::net::NetworkInterface.

The predicate consists of a whitelist and a blacklist. Whitelist and blacklist can contain, in no particular order, interface names (e.g., ifname eth0), MAC addresses (e.g., ether 85:3b:4d:d3:5f:c2), IPv4 and IPv6 subnets (e.g., subnet 192.0.2.0/24 or subnet 2001:db8:2::/64), or a wildcard (*) that matches all interfaces. A ndn::net::NetworkInterface is accepted if it matches any entry in the whitelist and none of the entries in the blacklist.

Definition at line 116 of file network-predicate.hpp.

Member Function Documentation

◆ assign()

void nfd::face::NetworkPredicateBase::assign ( std::initializer_list< std::pair< std::string, std::string >>  whitelist,
std::initializer_list< std::pair< std::string, std::string >>  blacklist 
)
inherited

Definition at line 113 of file network-predicate.cpp.

◆ clear()

void nfd::face::NetworkPredicateBase::clear ( )
inherited

Set the whitelist to "*" and clear the blacklist.

Definition at line 42 of file network-predicate.cpp.

◆ operator()()

bool nfd::face::NetworkInterfacePredicate::operator() ( const ndn::net::NetworkInterface &  netif) const

Definition at line 191 of file network-predicate.cpp.

◆ parseBlacklist()

void nfd::face::NetworkPredicateBase::parseBlacklist ( const boost::property_tree::ptree &  list)
inherited

Definition at line 107 of file network-predicate.cpp.

◆ parseWhitelist()

void nfd::face::NetworkPredicateBase::parseWhitelist ( const boost::property_tree::ptree &  list)
inherited

Definition at line 101 of file network-predicate.cpp.

Member Data Documentation

◆ m_blacklist

std::set<std::string> nfd::face::NetworkPredicateBase::m_blacklist
protectedinherited

Definition at line 103 of file network-predicate.hpp.

◆ m_whitelist

std::set<std::string> nfd::face::NetworkPredicateBase::m_whitelist
protectedinherited

Definition at line 102 of file network-predicate.hpp.