Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
Teng Liang | 0296074 | 2017-10-24 00:36:45 -0700 | [diff] [blame] | 2 | /* |
Teng Liang | 8b6eda9 | 2018-01-25 20:41:54 -0700 | [diff] [blame] | 3 | * Copyright (c) 2013-2018 Regents of the University of California. |
Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 4 | * |
| 5 | * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions). |
| 6 | * |
| 7 | * ndn-cxx library is free software: you can redistribute it and/or modify it under the |
| 8 | * terms of the GNU Lesser General Public License as published by the Free Software |
| 9 | * Foundation, either version 3 of the License, or (at your option) any later version. |
| 10 | * |
| 11 | * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY |
| 12 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A |
| 13 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. |
| 14 | * |
| 15 | * You should have received copies of the GNU General Public License and GNU Lesser |
| 16 | * General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see |
| 17 | * <http://www.gnu.org/licenses/>. |
| 18 | * |
| 19 | * See AUTHORS.md for complete list of ndn-cxx authors and contributors. |
| 20 | */ |
| 21 | |
| 22 | #ifndef NDN_CXX_LP_FIELDS_HPP |
| 23 | #define NDN_CXX_LP_FIELDS_HPP |
| 24 | |
Alexander Afanasyev | e387423 | 2017-03-26 16:58:59 -0500 | [diff] [blame] | 25 | #include "field-decl.hpp" |
Junxiao Shi | 4b46998 | 2015-12-03 18:20:19 +0000 | [diff] [blame] | 26 | |
Junxiao Shi | 4b46998 | 2015-12-03 18:20:19 +0000 | [diff] [blame] | 27 | #include "cache-policy.hpp" |
| 28 | #include "nack-header.hpp" |
Teng Liang | e3ecad7 | 2018-08-28 21:12:53 -0700 | [diff] [blame^] | 29 | #include "prefix-announcement-header.hpp" |
Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 30 | |
| 31 | #include <boost/mpl/set.hpp> |
| 32 | |
| 33 | namespace ndn { |
| 34 | namespace lp { |
| 35 | |
Alexander Afanasyev | e387423 | 2017-03-26 16:58:59 -0500 | [diff] [blame] | 36 | typedef FieldDecl<field_location_tags::Header, |
| 37 | Sequence, |
| 38 | tlv::Sequence> SequenceField; |
Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 39 | BOOST_CONCEPT_ASSERT((Field<SequenceField>)); |
| 40 | |
Alexander Afanasyev | e387423 | 2017-03-26 16:58:59 -0500 | [diff] [blame] | 41 | typedef FieldDecl<field_location_tags::Header, |
| 42 | uint64_t, |
Junxiao Shi | 974b81a | 2018-04-21 01:37:03 +0000 | [diff] [blame] | 43 | tlv::FragIndex, |
| 44 | false, |
| 45 | NonNegativeIntegerTag, |
| 46 | NonNegativeIntegerTag> FragIndexField; |
Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 47 | BOOST_CONCEPT_ASSERT((Field<FragIndexField>)); |
| 48 | |
Alexander Afanasyev | e387423 | 2017-03-26 16:58:59 -0500 | [diff] [blame] | 49 | typedef FieldDecl<field_location_tags::Header, |
| 50 | uint64_t, |
Junxiao Shi | 974b81a | 2018-04-21 01:37:03 +0000 | [diff] [blame] | 51 | tlv::FragCount, |
| 52 | false, |
| 53 | NonNegativeIntegerTag, |
| 54 | NonNegativeIntegerTag> FragCountField; |
Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 55 | BOOST_CONCEPT_ASSERT((Field<FragCountField>)); |
| 56 | |
Alexander Afanasyev | e387423 | 2017-03-26 16:58:59 -0500 | [diff] [blame] | 57 | typedef FieldDecl<field_location_tags::Header, |
| 58 | NackHeader, |
| 59 | tlv::Nack> NackField; |
Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 60 | BOOST_CONCEPT_ASSERT((Field<NackField>)); |
| 61 | |
Alexander Afanasyev | e387423 | 2017-03-26 16:58:59 -0500 | [diff] [blame] | 62 | typedef FieldDecl<field_location_tags::Header, |
| 63 | uint64_t, |
Junxiao Shi | 974b81a | 2018-04-21 01:37:03 +0000 | [diff] [blame] | 64 | tlv::NextHopFaceId, |
| 65 | false, |
| 66 | NonNegativeIntegerTag, |
| 67 | NonNegativeIntegerTag> NextHopFaceIdField; |
Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 68 | BOOST_CONCEPT_ASSERT((Field<NextHopFaceIdField>)); |
| 69 | |
Alexander Afanasyev | e387423 | 2017-03-26 16:58:59 -0500 | [diff] [blame] | 70 | typedef FieldDecl<field_location_tags::Header, |
| 71 | CachePolicy, |
| 72 | tlv::CachePolicy> CachePolicyField; |
Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 73 | BOOST_CONCEPT_ASSERT((Field<CachePolicyField>)); |
| 74 | |
Alexander Afanasyev | e387423 | 2017-03-26 16:58:59 -0500 | [diff] [blame] | 75 | typedef FieldDecl<field_location_tags::Header, |
| 76 | uint64_t, |
Junxiao Shi | 974b81a | 2018-04-21 01:37:03 +0000 | [diff] [blame] | 77 | tlv::IncomingFaceId, |
| 78 | false, |
| 79 | NonNegativeIntegerTag, |
| 80 | NonNegativeIntegerTag> IncomingFaceIdField; |
Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 81 | BOOST_CONCEPT_ASSERT((Field<IncomingFaceIdField>)); |
| 82 | |
Alexander Afanasyev | e387423 | 2017-03-26 16:58:59 -0500 | [diff] [blame] | 83 | typedef FieldDecl<field_location_tags::Header, |
| 84 | uint64_t, |
Junxiao Shi | 974b81a | 2018-04-21 01:37:03 +0000 | [diff] [blame] | 85 | tlv::CongestionMark, |
| 86 | false, |
| 87 | NonNegativeIntegerTag, |
| 88 | NonNegativeIntegerTag> CongestionMarkField; |
Eric Newberry | 4d261b6 | 2016-11-10 13:40:09 -0700 | [diff] [blame] | 89 | BOOST_CONCEPT_ASSERT((Field<CongestionMarkField>)); |
| 90 | |
Alexander Afanasyev | e387423 | 2017-03-26 16:58:59 -0500 | [diff] [blame] | 91 | typedef FieldDecl<field_location_tags::Header, |
| 92 | Sequence, |
| 93 | tlv::Ack, |
| 94 | true> AckField; |
Eric Newberry | 5fade68 | 2017-01-21 22:35:47 -0700 | [diff] [blame] | 95 | BOOST_CONCEPT_ASSERT((Field<AckField>)); |
| 96 | |
Alexander Afanasyev | e387423 | 2017-03-26 16:58:59 -0500 | [diff] [blame] | 97 | typedef FieldDecl<field_location_tags::Header, |
| 98 | Sequence, |
| 99 | tlv::TxSequence> TxSequenceField; |
Eric Newberry | 1de6be6 | 2017-04-03 22:58:41 -0700 | [diff] [blame] | 100 | BOOST_CONCEPT_ASSERT((Field<TxSequenceField>)); |
| 101 | |
Teng Liang | 0296074 | 2017-10-24 00:36:45 -0700 | [diff] [blame] | 102 | typedef FieldDecl<field_location_tags::Header, |
| 103 | EmptyValue, |
| 104 | tlv::NonDiscovery> NonDiscoveryField; |
| 105 | BOOST_CONCEPT_ASSERT((Field<NonDiscoveryField>)); |
| 106 | |
Teng Liang | 8b6eda9 | 2018-01-25 20:41:54 -0700 | [diff] [blame] | 107 | typedef FieldDecl<field_location_tags::Header, |
Teng Liang | e3ecad7 | 2018-08-28 21:12:53 -0700 | [diff] [blame^] | 108 | PrefixAnnouncementHeader, |
Teng Liang | 8b6eda9 | 2018-01-25 20:41:54 -0700 | [diff] [blame] | 109 | tlv::PrefixAnnouncement> PrefixAnnouncementField; |
| 110 | BOOST_CONCEPT_ASSERT((Field<PrefixAnnouncementField>)); |
Junxiao Shi | 974b81a | 2018-04-21 01:37:03 +0000 | [diff] [blame] | 111 | |
| 112 | /** \brief Declare the Fragment field. |
| 113 | * |
| 114 | * The fragment (i.e. payload) is the bytes between two provided iterators. During encoding, |
| 115 | * these bytes are copied from the Buffer into the LpPacket. |
Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 116 | */ |
Alexander Afanasyev | e387423 | 2017-03-26 16:58:59 -0500 | [diff] [blame] | 117 | typedef FieldDecl<field_location_tags::Fragment, |
| 118 | std::pair<Buffer::const_iterator, Buffer::const_iterator>, |
| 119 | tlv::Fragment> FragmentField; |
Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 120 | BOOST_CONCEPT_ASSERT((Field<FragmentField>)); |
| 121 | |
Junxiao Shi | 974b81a | 2018-04-21 01:37:03 +0000 | [diff] [blame] | 122 | /** \brief Set of all field declarations. |
Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 123 | */ |
| 124 | typedef boost::mpl::set< |
| 125 | FragmentField, |
| 126 | SequenceField, |
| 127 | FragIndexField, |
| 128 | FragCountField, |
| 129 | NackField, |
| 130 | NextHopFaceIdField, |
| 131 | CachePolicyField, |
Eric Newberry | 4d261b6 | 2016-11-10 13:40:09 -0700 | [diff] [blame] | 132 | IncomingFaceIdField, |
Eric Newberry | 5fade68 | 2017-01-21 22:35:47 -0700 | [diff] [blame] | 133 | CongestionMarkField, |
Eric Newberry | 1de6be6 | 2017-04-03 22:58:41 -0700 | [diff] [blame] | 134 | AckField, |
Teng Liang | 0296074 | 2017-10-24 00:36:45 -0700 | [diff] [blame] | 135 | TxSequenceField, |
Teng Liang | 8b6eda9 | 2018-01-25 20:41:54 -0700 | [diff] [blame] | 136 | NonDiscoveryField, |
| 137 | PrefixAnnouncementField |
Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 138 | > FieldSet; |
| 139 | |
| 140 | } // namespace lp |
| 141 | } // namespace ndn |
| 142 | |
Junxiao Shi | 4b46998 | 2015-12-03 18:20:19 +0000 | [diff] [blame] | 143 | #endif // NDN_CXX_LP_FIELDS_HPP |