22 #ifndef NDN_SECURITY_V2_VALIDATION_POLICY_COMMAND_INTEREST_HPP 23 #define NDN_SECURITY_V2_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> 107 checkPolicy(
const Data& data,
const shared_ptr<ValidationState>& state,
118 std::tuple<bool, Name, uint64_t>
119 parseCommandInterest(
const Interest& interest,
const shared_ptr<ValidationState>& state)
const;
122 checkTimestamp(
const shared_ptr<ValidationState>& state,
123 const Name& keyName, uint64_t timestamp);
126 insertNewRecord(
const Name& keyName, uint64_t timestamp);
131 struct LastTimestampRecord
138 using Container = boost::multi_index_container<
140 boost::multi_index::indexed_by<
141 boost::multi_index::ordered_unique<
142 boost::multi_index::member<LastTimestampRecord, Name, &LastTimestampRecord::keyName>
144 boost::multi_index::sequenced<>
147 using Index = Container::nth_index<0>::type;
148 using Queue = Container::nth_index<1>::type;
150 Container m_container;
159 #endif // NDN_SECURITY_V2_VALIDATION_POLICY_COMMAND_INTEREST_HPP time::nanoseconds gracePeriod
tolerance of initial timestamp
Copyright (c) 2011-2015 Regents of the University of California.
Represents an Interest packet.
void checkPolicy(const Data &data, const shared_ptr< ValidationState > &state, const ValidationContinuation &continueValidation) override
Check data against the policy.
Abstraction that implements validation policy for Data and Interest packets.
Validation policy for stop-and-wait command Interests.
std::function< void(const shared_ptr< CertificateRequest > &certRequest, const shared_ptr< ValidationState > &state)> ValidationContinuation
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
Represents a Data packet.
ValidationPolicyCommandInterest(unique_ptr< ValidationPolicy > inner, const Options &options={})
constructor