NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
field-info.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22 #ifndef NDN_CXX_LP_DETAIL_FIELD_INFO_HPP
23 #define NDN_CXX_LP_DETAIL_FIELD_INFO_HPP
24 
25 #include "../../common.hpp"
26 
27 #include "../fields.hpp"
28 
29 namespace ndn {
30 namespace lp {
31 namespace detail {
32 
33 class FieldInfo
34 {
35 public:
36  FieldInfo();
37 
38  explicit
39  FieldInfo(uint64_t tlv);
40 
41 public:
45  uint64_t tlvType;
46 
51 
55  bool canIgnore;
56 
61 
66 };
67 
68 template<typename TAG>
69 inline int
71 
72 template<>
73 inline int
74 getLocationSortOrder<field_location_tags::Header>()
75 {
76  return 1;
77 }
78 
79 template<>
80 inline int
81 getLocationSortOrder<field_location_tags::Fragment>()
82 {
83  return 2;
84 }
85 
86 inline bool
87 compareFieldSortOrder(const FieldInfo& first, const FieldInfo& second)
88 {
89  return (first.locationSortOrder < second.locationSortOrder) ||
90  (first.locationSortOrder == second.locationSortOrder && first.tlvType < second.tlvType);
91 }
92 
93 } // namespace detail
94 } // namespace lp
95 } // namespace ndn
96 
97 #endif // NDN_CXX_LP_DETAIL_FIELD_INFO_HPP
bool canIgnore
can this unknown field be ignored
Definition: field-info.hpp:55
Copyright (c) 2011-2015 Regents of the University of California.
int getLocationSortOrder()
bool isRepeatable
is the field repeatable
Definition: field-info.hpp:60
bool isRecognized
is this field known
Definition: field-info.hpp:50
bool compareFieldSortOrder(const FieldInfo &first, const FieldInfo &second)
Definition: field-info.hpp:87
int locationSortOrder
sort order of field_location_tag
Definition: field-info.hpp:65
uint64_t tlvType
TLV-TYPE of the field; 0 if field does not exist.
Definition: field-info.hpp:45