network-interface-predicate.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26 #ifndef NFD_CORE_NETWORK_INTERFACE_PREDICATE_HPP
27 #define NFD_CORE_NETWORK_INTERFACE_PREDICATE_HPP
28 
29 #include "common.hpp"
30 
31 namespace nfd {
32 
33 class NetworkInterfaceInfo;
34 
45 {
46 public:
48 
52  void
53  clear();
54 
55  void
56  parseWhitelist(const boost::property_tree::ptree& list);
57 
58  void
59  parseBlacklist(const boost::property_tree::ptree& list);
60 
61  bool
62  operator()(const NetworkInterfaceInfo& netif) const;
63 
64  bool
65  operator==(const NetworkInterfacePredicate& other) const;
66 
67  bool
69  {
70  return !this->operator==(other);
71  }
72 
73 private:
74  std::set<std::string> m_whitelist;
75  std::set<std::string> m_blacklist;
76 };
77 
78 } // namespace nfd
79 
80 #endif // NFD_CORE_NETWORK_INTERFACE_PREDICATE_HPP
void parseWhitelist(const boost::property_tree::ptree &list)
contains information about a network interface
bool operator==(const NetworkInterfacePredicate &other) const
bool operator()(const NetworkInterfaceInfo &netif) const
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
void parseBlacklist(const boost::property_tree::ptree &list)
void clear()
Set the whitelist to "*" and clear the blacklist.
Represents a predicate to accept or reject a NetworkInterfaceInfo.
bool operator!=(const NetworkInterfacePredicate &other) const