/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
 * Copyright (c) 2014-2018,  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_DAEMON_FACE_LP_FRAGMENTER_HPP
#define NFD_DAEMON_FACE_LP_FRAGMENTER_HPP

#include "core/common.hpp"
#include "face-log.hpp"

#include <ndn-cxx/lp/packet.hpp>

namespace nfd {
namespace face {

class LinkService;

/** \brief fragments network-layer packets into NDNLPv2 link-layer packets
 *  \sa https://redmine.named-data.net/projects/nfd/wiki/NDNLPv2
 */
class LpFragmenter
{
public:
  /** \brief Options that control the behavior of LpFragmenter
   */
  struct Options
  {
    /** \brief maximum number of fragments in a packet
     */
    size_t nMaxFragments = 400;
  };

  explicit
  LpFragmenter(const Options& options, const LinkService* linkService = nullptr);

  /** \brief set options for fragmenter
   */
  void
  setOptions(const Options& options);

  /** \return LinkService that owns this instance
   *
   *  This is only used for logging, and may be nullptr.
   */
  const LinkService*
  getLinkService() const;

  /** \brief fragments a network-layer packet into link-layer packets
   *  \param packet an LpPacket that contains a network-layer packet;
   *                must have Fragment field, must not have FragIndex and FragCount fields
   *  \param mtu maximum allowable LpPacket size after fragmentation and sequence number assignment
   *  \return whether fragmentation succeeded, fragmented packets without sequence number
   */
  std::tuple<bool, std::vector<lp::Packet>>
  fragmentPacket(const lp::Packet& packet, size_t mtu);

private:
  Options m_options;
  const LinkService* m_linkService;
};

std::ostream&
operator<<(std::ostream& os, const FaceLogHelper<LpFragmenter>& flh);

} // namespace face
} // namespace nfd

#endif // NFD_DAEMON_FACE_LP_FRAGMENTER_HPP
