22 #ifndef NDN_CXX_SECURITY_VALIDATION_POLICY_COMMAND_INTEREST_HPP
23 #define NDN_CXX_SECURITY_VALIDATION_POLICY_COMMAND_INTEREST_HPP
27 #include <boost/multi_index_container.hpp>
28 #include <boost/multi_index/ordered_index.hpp>
29 #include <boost/multi_index/sequenced_index.hpp>
30 #include <boost/multi_index/key_extractors.hpp>
109 checkPolicy(
const Data& data,
const shared_ptr<ValidationState>& state,
117 static std::tuple<bool, Name, time::system_clock::TimePoint>
118 parseCommandInterest(
const Interest& interest,
const shared_ptr<ValidationState>& state);
124 checkTimestamp(
const shared_ptr<ValidationState>& state,
133 struct LastTimestampRecord
140 using Container = boost::multi_index_container<
142 boost::multi_index::indexed_by<
143 boost::multi_index::ordered_unique<
144 boost::multi_index::member<LastTimestampRecord, Name, &LastTimestampRecord::keyName>
146 boost::multi_index::sequenced<>
149 using Index = Container::nth_index<0>::type;
150 using Queue = Container::nth_index<1>::type;
152 Container m_container;
Represents a Data packet.
Represents an Interest packet.
Represents an absolute name.
time::nanoseconds recordLifetime
Max lifetime of a last timestamp record.
ssize_t maxRecords
Max number of distinct public keys of which to record the last timestamp.
time::nanoseconds gracePeriod
Tolerance of initial timestamp.
Validation policy for stop-and-wait command Interests.
void checkPolicy(const Data &data, const shared_ptr< ValidationState > &state, const ValidationContinuation &continueValidation) override
Check data against the policy.
ValidationPolicyCommandInterest(unique_ptr< ValidationPolicy > inner, const Options &options={})
Constructor.
Abstraction that implements a validation policy for Interest and Data packets.
std::function< void(const shared_ptr< CertificateRequest > &certRequest, const shared_ptr< ValidationState > &state)> ValidationContinuation
boost::chrono::nanoseconds nanoseconds