NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
field-info.cpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22
#include "
field-info.hpp
"
23
24
#include <boost/mpl/for_each.hpp>
25
#include <boost/bind.hpp>
26
27
namespace
ndn
{
28
namespace
lp
{
29
namespace
detail {
30
31
struct
ExtractFieldInfo
32
{
33
typedef
void
result_type
;
34
35
template
<
typename
T>
36
void
37
operator()
(
FieldInfo
* info, T)
38
{
39
if
(T::TlvType::value != info->
tlvType
) {
40
return
;
41
}
42
info->
isRecognized
=
true
;
43
info->
canIgnore
=
false
;
44
info->
isRepeatable
= T::IsRepeatable::value;
45
info->
locationSortOrder
= getLocationSortOrder<typename T::FieldLocation>();
46
}
47
};
48
49
FieldInfo::FieldInfo
()
50
: tlvType(0)
51
, isRecognized(false)
52
, canIgnore(false)
53
, isRepeatable(false)
54
, locationSortOrder(
getLocationSortOrder
<field_location_tags::Header>())
55
{
56
}
57
58
FieldInfo::FieldInfo
(uint64_t tlv)
59
:
tlvType
(tlv)
60
,
isRecognized
(false)
61
,
canIgnore
(false)
62
,
isRepeatable
(false)
63
,
locationSortOrder
(
getLocationSortOrder
<field_location_tags::Header>())
64
{
65
boost::mpl::for_each<FieldSet>(boost::bind(
ExtractFieldInfo
(),
this
, _1));
66
if
(!
isRecognized
) {
67
canIgnore
=
tlv::HEADER3_MIN
<=
tlvType
&&
tlvType
<=
tlv::HEADER3_MAX
&&
68
(tlvType & 0x01) == 0x01;
69
}
70
}
71
72
}
// namespace detail
73
}
// namespace lp
74
}
// namespace ndn
ndn::lp::detail::FieldInfo::canIgnore
bool canIgnore
can this unknown field be ignored
Definition:
field-info.hpp:55
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::lp::detail::ExtractFieldInfo::result_type
void result_type
Definition:
field-info.cpp:33
ndn::lp::tlv::HEADER3_MIN
lower bound of 3-octet header field
Definition:
tlv.hpp:60
ndn::lp::detail::getLocationSortOrder
int getLocationSortOrder()
ndn::lp::detail::ExtractFieldInfo
Definition:
field-info.cpp:31
ndn::lp::detail::FieldInfo::isRepeatable
bool isRepeatable
is the field repeatable
Definition:
field-info.hpp:60
ndn::lp::detail::FieldInfo::isRecognized
bool isRecognized
is this field known
Definition:
field-info.hpp:50
ndn::lp::detail::FieldInfo
Definition:
field-info.hpp:33
ndn::lp::detail::ExtractFieldInfo::operator()
void operator()(FieldInfo *info, T)
Definition:
field-info.cpp:37
ndn::lp::detail::FieldInfo::locationSortOrder
int locationSortOrder
sort order of field_location_tag
Definition:
field-info.hpp:65
ndn::lp::detail::FieldInfo::FieldInfo
FieldInfo()
Definition:
field-info.cpp:49
field-info.hpp
ndn::lp
Definition:
cache-policy.cpp:27
ndn::lp::tlv::HEADER3_MAX
upper bound of 3-octet header field
Definition:
tlv.hpp:65
ndn::lp::detail::FieldInfo::tlvType
uint64_t tlvType
TLV-TYPE of the field; 0 if field does not exist.
Definition:
field-info.hpp:45
ndnSIM
ndn-cxx
src
lp
detail
field-info.cpp
Generated on Sat Nov 12 2016 16:02:52 for ndnSIM by
1.8.12