141 lines
4.5 KiB
C++
141 lines
4.5 KiB
C++
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
|
/*
|
|
* Copyright (c) 2013-2023 Regents of the University of California.
|
|
*
|
|
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
|
|
*
|
|
* ndn-cxx library is free software: you can redistribute it and/or modify it under the
|
|
* terms of the GNU Lesser General Public License as published by the Free Software
|
|
* Foundation, either version 3 of the License, or (at your option) any later version.
|
|
*
|
|
* ndn-cxx library 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 Lesser General Public License for more details.
|
|
*
|
|
* You should have received copies of the GNU General Public License and GNU Lesser
|
|
* General Public License along with ndn-cxx, 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.
|
|
*/
|
|
|
|
#ifndef NDN_CXX_LP_FIELDS_HPP
|
|
#define NDN_CXX_LP_FIELDS_HPP
|
|
|
|
#include "ndn-cxx/lp/cache-policy.hpp"
|
|
#include "ndn-cxx/lp/empty-value.hpp"
|
|
#include "ndn-cxx/lp/field.hpp"
|
|
#include "ndn-cxx/lp/field-decl.hpp"
|
|
#include "ndn-cxx/lp/nack-header.hpp"
|
|
#include "ndn-cxx/lp/prefix-announcement-header.hpp"
|
|
#include "ndn-cxx/lp/sequence.hpp"
|
|
#include "ndn-cxx/lp/tlv.hpp"
|
|
|
|
#include <boost/mp11/list.hpp>
|
|
#include <boost/mp11/set.hpp>
|
|
|
|
namespace ndn::lp {
|
|
|
|
/**
|
|
* \brief Declare the Fragment field.
|
|
*
|
|
* The fragment (i.e., payload) is the range of bytes between two provided iterators.
|
|
* During encoding, these bytes are copied from the Buffer into the LpPacket.
|
|
*/
|
|
typedef FieldDecl<field_location_tags::Fragment,
|
|
std::pair<Buffer::const_iterator, Buffer::const_iterator>,
|
|
tlv::Fragment> FragmentField;
|
|
|
|
typedef FieldDecl<field_location_tags::Header,
|
|
Sequence,
|
|
tlv::Sequence> SequenceField;
|
|
|
|
typedef FieldDecl<field_location_tags::Header,
|
|
uint64_t,
|
|
tlv::FragIndex,
|
|
false,
|
|
NonNegativeIntegerTag,
|
|
NonNegativeIntegerTag> FragIndexField;
|
|
|
|
typedef FieldDecl<field_location_tags::Header,
|
|
uint64_t,
|
|
tlv::FragCount,
|
|
false,
|
|
NonNegativeIntegerTag,
|
|
NonNegativeIntegerTag> FragCountField;
|
|
|
|
typedef FieldDecl<field_location_tags::Header,
|
|
std::pair<Buffer::const_iterator, Buffer::const_iterator>,
|
|
tlv::PitToken> PitTokenField;
|
|
|
|
typedef FieldDecl<field_location_tags::Header,
|
|
NackHeader,
|
|
tlv::Nack> NackField;
|
|
|
|
typedef FieldDecl<field_location_tags::Header,
|
|
uint64_t,
|
|
tlv::IncomingFaceId,
|
|
false,
|
|
NonNegativeIntegerTag,
|
|
NonNegativeIntegerTag> IncomingFaceIdField;
|
|
|
|
typedef FieldDecl<field_location_tags::Header,
|
|
uint64_t,
|
|
tlv::NextHopFaceId,
|
|
false,
|
|
NonNegativeIntegerTag,
|
|
NonNegativeIntegerTag> NextHopFaceIdField;
|
|
|
|
typedef FieldDecl<field_location_tags::Header,
|
|
CachePolicy,
|
|
tlv::CachePolicy> CachePolicyField;
|
|
|
|
typedef FieldDecl<field_location_tags::Header,
|
|
uint64_t,
|
|
tlv::CongestionMark,
|
|
false,
|
|
NonNegativeIntegerTag,
|
|
NonNegativeIntegerTag> CongestionMarkField;
|
|
|
|
typedef FieldDecl<field_location_tags::Header,
|
|
Sequence,
|
|
tlv::Ack,
|
|
true> AckField;
|
|
|
|
typedef FieldDecl<field_location_tags::Header,
|
|
Sequence,
|
|
tlv::TxSequence> TxSequenceField;
|
|
|
|
typedef FieldDecl<field_location_tags::Header,
|
|
EmptyValue,
|
|
tlv::NonDiscovery> NonDiscoveryField;
|
|
|
|
typedef FieldDecl<field_location_tags::Header,
|
|
PrefixAnnouncementHeader,
|
|
tlv::PrefixAnnouncement> PrefixAnnouncementField;
|
|
|
|
/**
|
|
* \brief Set of all field declarations.
|
|
*/
|
|
using FieldSet = boost::mp11::mp_list<
|
|
FragmentField,
|
|
SequenceField,
|
|
FragIndexField,
|
|
FragCountField,
|
|
PitTokenField,
|
|
NackField,
|
|
NextHopFaceIdField,
|
|
IncomingFaceIdField,
|
|
CachePolicyField,
|
|
CongestionMarkField,
|
|
AckField,
|
|
TxSequenceField,
|
|
NonDiscoveryField,
|
|
PrefixAnnouncementField
|
|
>;
|
|
static_assert(boost::mp11::mp_is_set<FieldSet>());
|
|
|
|
} // namespace ndn::lp
|
|
|
|
#endif // NDN_CXX_LP_FIELDS_HPP
|