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