/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
 * Copyright (c) 2014, Regents of the University of California.
 *
 * This file is part of NDNS (Named Data Networking Domain Name Service).
 * See AUTHORS.md for complete list of NDNS authors and contributors.
 *
 * NDNS 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.
 *
 * NDNS 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
 * NDNS, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef NDNS_NDNS_LABEL_HPP
#define NDNS_NDNS_LABEL_HPP

#include "ndns-enum.hpp"

#include <ndn-cxx/name.hpp>
#include <ndn-cxx/interest.hpp>

#include <string>

namespace ndn {
namespace ndns {
namespace label {


/**
 * @brief NDNS iterative query type
 */

const name::Component NDNS_ITERATIVE_QUERY("NDNS");

/**
 * @brief NDNS recursive query type
 */
const name::Component NDNS_RECURSIVE_QUERY("NDNS-R");

/**
 * @brief NDNS ID-CERT query type
 */
const name::Component NDNS_CERT_QUERY("KEY");

/////////////////////////////////////////////

/**
 * @brief label of forwarding hint
 * @todo not support forwarding hint yet, for future use
 */
const name::Component FORWARDING_HINT_LABEL("\xF0.");

/**
 * @brief label of update message, located at the last component in Interest name
 */
const name::Component NDNS_UPDATE_LABEL("UPDATE");


//////////////////////////////////////////////

/**
 * @brief NS resource record type
 */
const name::Component NS_RR_TYPE("NS");

/**
 * @brief ID-CERT resource record type
 */
const name::Component CERT_RR_TYPE("ID-CERT");

/**
 * @brief TXT resource record type
 */
const name::Component TXT_RR_TYPE("TXT");


//////////////////////////////////////////

/**
 * @brief result of Matching. version only works when matching a Interest Name
 */
struct MatchResult
{
  Name rrLabel;
  name::Component rrType;
  name::Component version;
};

/**
 * @brief match the Interest (NDNS query, NDNS update) name
 *
 * @param[in] interest Interest to parse
 * @param[in] hint Forwarding hint that is part of the Interest
 *            (only the length will be taken into account)
 * @param[in] zone Zone that the Interest is related to
 *            (only the length will be taken into account)
 * @param[out] result The matching result
 * @return true if match succeeds, or false
 */
bool
matchName(const Interest& interest,
          const Name& hint, const Name& zone,
          MatchResult& result);

/**
 * @brief match the Data (NDNS query response, NDNS update response) name
 *
 * @param[in] data Data to parse
 * @param[in] hint Forwarding hint that is part of the Data
 *            (only the length will be taken into account)
 * @param[in] zone Zone that the Data is related to
 *            (only the length will be taken into account)
 * @param[out] result The matching result
 * @return true if match succeeds, or false
 */
bool
matchName(const Data& data,
          const Name& hint, const Name& zone,
          MatchResult& result);


} // namespace label
} // namespace ndns
} // namespace ndn

#endif // NDNS_NDNS_LABEL_HPP
