blob: ce3a834f18fb2aec2018ab636a1a3ce08ac72ae6 [file] [log] [blame]
Eric Newberry261dbc22015-07-22 23:18:18 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
Teng Liang02960742017-10-24 00:36:45 -07002/*
Teng Liang8b6eda92018-01-25 20:41:54 -07003 * Copyright (c) 2013-2018 Regents of the University of California.
Eric Newberry261dbc22015-07-22 23:18:18 -07004 *
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 Afanasyeve3874232017-03-26 16:58:59 -050025#include "field-decl.hpp"
Junxiao Shi4b469982015-12-03 18:20:19 +000026
27#include "sequence.hpp"
28#include "cache-policy.hpp"
29#include "nack-header.hpp"
Teng Liang8b6eda92018-01-25 20:41:54 -070030#include "prefix-announcement.hpp"
Eric Newberry261dbc22015-07-22 23:18:18 -070031
32#include <boost/mpl/set.hpp>
33
34namespace ndn {
35namespace lp {
36
Alexander Afanasyeve3874232017-03-26 16:58:59 -050037typedef FieldDecl<field_location_tags::Header,
38 Sequence,
39 tlv::Sequence> SequenceField;
Eric Newberry261dbc22015-07-22 23:18:18 -070040BOOST_CONCEPT_ASSERT((Field<SequenceField>));
41
Alexander Afanasyeve3874232017-03-26 16:58:59 -050042typedef FieldDecl<field_location_tags::Header,
43 uint64_t,
44 tlv::FragIndex> FragIndexField;
Eric Newberry261dbc22015-07-22 23:18:18 -070045BOOST_CONCEPT_ASSERT((Field<FragIndexField>));
46
Alexander Afanasyeve3874232017-03-26 16:58:59 -050047typedef FieldDecl<field_location_tags::Header,
48 uint64_t,
49 tlv::FragCount> FragCountField;
Eric Newberry261dbc22015-07-22 23:18:18 -070050BOOST_CONCEPT_ASSERT((Field<FragCountField>));
51
Alexander Afanasyeve3874232017-03-26 16:58:59 -050052typedef FieldDecl<field_location_tags::Header,
53 NackHeader,
54 tlv::Nack> NackField;
Eric Newberry261dbc22015-07-22 23:18:18 -070055BOOST_CONCEPT_ASSERT((Field<NackField>));
56
Alexander Afanasyeve3874232017-03-26 16:58:59 -050057typedef FieldDecl<field_location_tags::Header,
58 uint64_t,
59 tlv::NextHopFaceId> NextHopFaceIdField;
Eric Newberry261dbc22015-07-22 23:18:18 -070060BOOST_CONCEPT_ASSERT((Field<NextHopFaceIdField>));
61
Alexander Afanasyeve3874232017-03-26 16:58:59 -050062typedef FieldDecl<field_location_tags::Header,
63 CachePolicy,
64 tlv::CachePolicy> CachePolicyField;
Eric Newberry261dbc22015-07-22 23:18:18 -070065BOOST_CONCEPT_ASSERT((Field<CachePolicyField>));
66
Alexander Afanasyeve3874232017-03-26 16:58:59 -050067typedef FieldDecl<field_location_tags::Header,
68 uint64_t,
69 tlv::IncomingFaceId> IncomingFaceIdField;
Eric Newberry261dbc22015-07-22 23:18:18 -070070BOOST_CONCEPT_ASSERT((Field<IncomingFaceIdField>));
71
Alexander Afanasyeve3874232017-03-26 16:58:59 -050072typedef FieldDecl<field_location_tags::Header,
73 uint64_t,
74 tlv::CongestionMark> CongestionMarkField;
Eric Newberry4d261b62016-11-10 13:40:09 -070075BOOST_CONCEPT_ASSERT((Field<CongestionMarkField>));
76
Alexander Afanasyeve3874232017-03-26 16:58:59 -050077typedef FieldDecl<field_location_tags::Header,
78 Sequence,
79 tlv::Ack,
80 true> AckField;
Eric Newberry5fade682017-01-21 22:35:47 -070081BOOST_CONCEPT_ASSERT((Field<AckField>));
82
Alexander Afanasyeve3874232017-03-26 16:58:59 -050083typedef FieldDecl<field_location_tags::Header,
84 Sequence,
85 tlv::TxSequence> TxSequenceField;
Eric Newberry1de6be62017-04-03 22:58:41 -070086BOOST_CONCEPT_ASSERT((Field<TxSequenceField>));
87
Teng Liang02960742017-10-24 00:36:45 -070088typedef FieldDecl<field_location_tags::Header,
89 EmptyValue,
90 tlv::NonDiscovery> NonDiscoveryField;
91BOOST_CONCEPT_ASSERT((Field<NonDiscoveryField>));
92
Teng Liang8b6eda92018-01-25 20:41:54 -070093typedef FieldDecl<field_location_tags::Header,
94 PrefixAnnouncement,
95 tlv::PrefixAnnouncement> PrefixAnnouncementField;
96BOOST_CONCEPT_ASSERT((Field<PrefixAnnouncementField>));
Eric Newberry261dbc22015-07-22 23:18:18 -070097/**
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 Afanasyeve3874232017-03-26 16:58:59 -0500101typedef FieldDecl<field_location_tags::Fragment,
102 std::pair<Buffer::const_iterator, Buffer::const_iterator>,
103 tlv::Fragment> FragmentField;
Eric Newberry261dbc22015-07-22 23:18:18 -0700104BOOST_CONCEPT_ASSERT((Field<FragmentField>));
105
106/**
107 * \brief set of all field declarations
108 */
109typedef boost::mpl::set<
110 FragmentField,
111 SequenceField,
112 FragIndexField,
113 FragCountField,
114 NackField,
115 NextHopFaceIdField,
116 CachePolicyField,
Eric Newberry4d261b62016-11-10 13:40:09 -0700117 IncomingFaceIdField,
Eric Newberry5fade682017-01-21 22:35:47 -0700118 CongestionMarkField,
Eric Newberry1de6be62017-04-03 22:58:41 -0700119 AckField,
Teng Liang02960742017-10-24 00:36:45 -0700120 TxSequenceField,
Teng Liang8b6eda92018-01-25 20:41:54 -0700121 NonDiscoveryField,
122 PrefixAnnouncementField
Eric Newberry261dbc22015-07-22 23:18:18 -0700123 > FieldSet;
124
125} // namespace lp
126} // namespace ndn
127
Junxiao Shi4b469982015-12-03 18:20:19 +0000128#endif // NDN_CXX_LP_FIELDS_HPP