/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
 * Copyright (c) 2016-2019, Regents of the University of California,
 *                          Colorado State University,
 *                          University Pierre & Marie Curie, Sorbonne University.
 *
 * This file is part of ndn-tools (Named Data Networking Essential Tools).
 * See AUTHORS.md for complete list of ndn-tools authors and contributors.
 *
 * ndn-tools 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.
 *
 * ndn-tools 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
 * ndn-tools, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
 *
 * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
 *
 * @author Andrea Tosatto
 * @author Davide Pesavento
 */

#ifndef NDN_TOOLS_CHUNKS_CATCHUNKS_OPTIONS_HPP
#define NDN_TOOLS_CHUNKS_CATCHUNKS_OPTIONS_HPP

#include "core/common.hpp"

namespace ndn {
namespace chunks {

struct Options : noncopyable
{
  // Common options
  time::milliseconds interestLifetime = DEFAULT_INTEREST_LIFETIME;
  int maxRetriesOnTimeoutOrNack = 15;
  bool mustBeFresh = false;
  bool isQuiet = false;
  bool isVerbose = false;

  // Fixed pipeline options
  size_t maxPipelineSize = 1;

  // Adaptive pipeline common options
  double initCwnd = 1.0;        ///< initial congestion window size
  double initSsthresh = std::numeric_limits<double>::max(); ///< initial slow start threshold
  time::milliseconds rtoCheckInterval{10}; ///< interval for checking retransmission timer
  bool ignoreCongMarks = false; ///< disable window decrease after receiving congestion mark
  bool disableCwa = false;      ///< disable conservative window adaptation

  // AIMD pipeline options
  double aiStep = 1.0;          ///< AIMD additive increase step (in segments)
  double mdCoef = 0.5;          ///< AIMD multiplicative decrease factor
  bool resetCwndToInit = false; ///< reduce cwnd to initCwnd when loss event occurs

  // Cubic pipeline options
  double cubicBeta = 0.7;       ///< cubic multiplicative decrease factor
  bool enableFastConv = false;  ///< use cubic fast convergence
};

} // namespace chunks
} // namespace ndn

#endif // NDN_TOOLS_CHUNKS_CATCHUNKS_OPTIONS_HPP
