Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 | /** |
Eric Newberry | 5fade68 | 2017-01-21 22:35:47 -0700 | [diff] [blame] | 3 | * Copyright (c) 2013-2017 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 | |
| 27 | #include "sequence.hpp" |
| 28 | #include "cache-policy.hpp" |
| 29 | #include "nack-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, |
| 43 | tlv::FragIndex> FragIndexField; |
Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 44 | BOOST_CONCEPT_ASSERT((Field<FragIndexField>)); |
| 45 | |
Alexander Afanasyev | e387423 | 2017-03-26 16:58:59 -0500 | [diff] [blame] | 46 | typedef FieldDecl<field_location_tags::Header, |
| 47 | uint64_t, |
| 48 | tlv::FragCount> FragCountField; |
Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 49 | BOOST_CONCEPT_ASSERT((Field<FragCountField>)); |
| 50 | |
Alexander Afanasyev | e387423 | 2017-03-26 16:58:59 -0500 | [diff] [blame] | 51 | typedef FieldDecl<field_location_tags::Header, |
| 52 | NackHeader, |
| 53 | tlv::Nack> NackField; |
Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 54 | BOOST_CONCEPT_ASSERT((Field<NackField>)); |
| 55 | |
Alexander Afanasyev | e387423 | 2017-03-26 16:58:59 -0500 | [diff] [blame] | 56 | typedef FieldDecl<field_location_tags::Header, |
| 57 | uint64_t, |
| 58 | tlv::NextHopFaceId> NextHopFaceIdField; |
Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 59 | BOOST_CONCEPT_ASSERT((Field<NextHopFaceIdField>)); |
| 60 | |
Alexander Afanasyev | e387423 | 2017-03-26 16:58:59 -0500 | [diff] [blame] | 61 | typedef FieldDecl<field_location_tags::Header, |
| 62 | CachePolicy, |
| 63 | tlv::CachePolicy> CachePolicyField; |
Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 64 | BOOST_CONCEPT_ASSERT((Field<CachePolicyField>)); |
| 65 | |
Alexander Afanasyev | e387423 | 2017-03-26 16:58:59 -0500 | [diff] [blame] | 66 | typedef FieldDecl<field_location_tags::Header, |
| 67 | uint64_t, |
| 68 | tlv::IncomingFaceId> IncomingFaceIdField; |
Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 69 | BOOST_CONCEPT_ASSERT((Field<IncomingFaceIdField>)); |
| 70 | |
Alexander Afanasyev | e387423 | 2017-03-26 16:58:59 -0500 | [diff] [blame] | 71 | typedef FieldDecl<field_location_tags::Header, |
| 72 | uint64_t, |
| 73 | tlv::CongestionMark> CongestionMarkField; |
Eric Newberry | 4d261b6 | 2016-11-10 13:40:09 -0700 | [diff] [blame] | 74 | BOOST_CONCEPT_ASSERT((Field<CongestionMarkField>)); |
| 75 | |
Alexander Afanasyev | e387423 | 2017-03-26 16:58:59 -0500 | [diff] [blame] | 76 | typedef FieldDecl<field_location_tags::Header, |
| 77 | Sequence, |
| 78 | tlv::Ack, |
| 79 | true> AckField; |
Eric Newberry | 5fade68 | 2017-01-21 22:35:47 -0700 | [diff] [blame] | 80 | BOOST_CONCEPT_ASSERT((Field<AckField>)); |
| 81 | |
Alexander Afanasyev | e387423 | 2017-03-26 16:58:59 -0500 | [diff] [blame] | 82 | typedef FieldDecl<field_location_tags::Header, |
| 83 | Sequence, |
| 84 | tlv::TxSequence> TxSequenceField; |
Eric Newberry | 1de6be6 | 2017-04-03 22:58:41 -0700 | [diff] [blame] | 85 | BOOST_CONCEPT_ASSERT((Field<TxSequenceField>)); |
| 86 | |
Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 87 | /** |
| 88 | * The value of the wire encoded field is the data between the provided iterators. During |
| 89 | * encoding, the data is copied from the Buffer into the wire buffer. |
| 90 | */ |
Alexander Afanasyev | e387423 | 2017-03-26 16:58:59 -0500 | [diff] [blame] | 91 | typedef FieldDecl<field_location_tags::Fragment, |
| 92 | std::pair<Buffer::const_iterator, Buffer::const_iterator>, |
| 93 | tlv::Fragment> FragmentField; |
Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 94 | BOOST_CONCEPT_ASSERT((Field<FragmentField>)); |
| 95 | |
| 96 | /** |
| 97 | * \brief set of all field declarations |
| 98 | */ |
| 99 | typedef boost::mpl::set< |
| 100 | FragmentField, |
| 101 | SequenceField, |
| 102 | FragIndexField, |
| 103 | FragCountField, |
| 104 | NackField, |
| 105 | NextHopFaceIdField, |
| 106 | CachePolicyField, |
Eric Newberry | 4d261b6 | 2016-11-10 13:40:09 -0700 | [diff] [blame] | 107 | IncomingFaceIdField, |
Eric Newberry | 5fade68 | 2017-01-21 22:35:47 -0700 | [diff] [blame] | 108 | CongestionMarkField, |
Eric Newberry | 1de6be6 | 2017-04-03 22:58:41 -0700 | [diff] [blame] | 109 | AckField, |
| 110 | TxSequenceField |
Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 111 | > FieldSet; |
| 112 | |
| 113 | } // namespace lp |
| 114 | } // namespace ndn |
| 115 | |
Junxiao Shi | 4b46998 | 2015-12-03 18:20:19 +0000 | [diff] [blame] | 116 | #endif // NDN_CXX_LP_FIELDS_HPP |