/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
 * Copyright (c) 2014-2016, Regents of the University of California,
 *                          Arizona Board of Regents,
 *                          Colorado State University,
 *                          University Pierre & Marie Curie, Sorbonne University,
 *                          Washington University in St. Louis,
 *                          Beijing Institute of Technology,
 *                          The University of Memphis
 *
 * This file is part of NFD (Named Data Networking Forwarding Daemon).
 * See AUTHORS.md for complete list of NFD authors and contributors.
 *
 * NFD is free software: you can redistribute it and/or modify it under the terms
 * of the GNU General Public License as published by the Free Software Foundation,
 * either version 3 of the License, or (at your option) any later version.
 *
 * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 * PURPOSE.  See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef NFD_CORE_NETWORK_INTERFACE_PREDICATE_HPP
#define NFD_CORE_NETWORK_INTERFACE_PREDICATE_HPP

#include "common.hpp"

namespace nfd {

class NetworkInterfaceInfo;

/**
 * \brief Represents a predicate to accept or reject a NetworkInterfaceInfo.
 *
 * 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), subnets (e.g., subnet 192.0.2.0/24) or a wildcard (*) that matches
 * all interfaces. A NetworkInterfaceInfo is accepted if it matches any entry in the whitelist and none
 * of the entries in the blacklist.
 */

class NetworkInterfacePredicate
{
public:
  NetworkInterfacePredicate();

  /**
   * \brief Set the whitelist to "*" and clear the blacklist
   */
  void
  clear();

  void
  parseWhitelist(const boost::property_tree::ptree& list);

  void
  parseBlacklist(const boost::property_tree::ptree& list);

  bool
  operator()(const NetworkInterfaceInfo& nic) const;

private:
  std::set<std::string> m_whitelist;
  std::set<std::string> m_blacklist;
};

} // namespace nfd

#endif // NFD_CORE_NETWORK_INTERFACE_PREDICATE_HPP
