blob: bd3c7cb7b972fce9ce95fb6523b7790408f111fe [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>));
Spyridon Mastorakise1ae0962016-12-06 15:21:44 -080097
98typedef FieldDecl<field_location_tags::Header,
99 uint64_t,
100 tlv::HopCountTag> HopCountTagField;
101BOOST_CONCEPT_ASSERT((Field<HopCountTagField>));
102
Eric Newberry261dbc22015-07-22 23:18:18 -0700103/**
104 * The value of the wire encoded field is the data between the provided iterators. During
105 * encoding, the data is copied from the Buffer into the wire buffer.
106 */
Alexander Afanasyeve3874232017-03-26 16:58:59 -0500107typedef FieldDecl<field_location_tags::Fragment,
108 std::pair<Buffer::const_iterator, Buffer::const_iterator>,
109 tlv::Fragment> FragmentField;
Eric Newberry261dbc22015-07-22 23:18:18 -0700110BOOST_CONCEPT_ASSERT((Field<FragmentField>));
111
112/**
113 * \brief set of all field declarations
114 */
115typedef boost::mpl::set<
116 FragmentField,
117 SequenceField,
118 FragIndexField,
119 FragCountField,
120 NackField,
121 NextHopFaceIdField,
122 CachePolicyField,
Eric Newberry4d261b62016-11-10 13:40:09 -0700123 IncomingFaceIdField,
Eric Newberry5fade682017-01-21 22:35:47 -0700124 CongestionMarkField,
Eric Newberry1de6be62017-04-03 22:58:41 -0700125 AckField,
Teng Liang02960742017-10-24 00:36:45 -0700126 TxSequenceField,
Teng Liang8b6eda92018-01-25 20:41:54 -0700127 NonDiscoveryField,
Spyridon Mastorakise1ae0962016-12-06 15:21:44 -0800128 PrefixAnnouncementField,
129 HopCountTagField
Eric Newberry261dbc22015-07-22 23:18:18 -0700130 > FieldSet;
131
132} // namespace lp
133} // namespace ndn
134
Junxiao Shi4b469982015-12-03 18:20:19 +0000135#endif // NDN_CXX_LP_FIELDS_HPP