/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
 * Copyright (c) 2014-2017,  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& netif) const;

  bool
  operator==(const NetworkInterfacePredicate& other) const;

  bool
  operator!=(const NetworkInterfacePredicate& other) const
  {
    return !this->operator==(other);
  }

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

} // namespace nfd

#endif // NFD_CORE_NETWORK_INTERFACE_PREDICATE_HPP
