22 #ifndef NDN_SECURITY_COMMAND_INTEREST_VALIDATOR_HPP 23 #define NDN_SECURITY_COMMAND_INTEREST_VALIDATOR_HPP 26 #include <boost/multi_index_container.hpp> 27 #include <boost/multi_index/ordered_index.hpp> 28 #include <boost/multi_index/sequenced_index.hpp> 29 #include <boost/multi_index/key_extractors.hpp> 103 BAD_KEY_LOCATOR_TYPE,
105 TIMESTAMP_OUT_OF_GRACE,
136 std::vector<shared_ptr<ValidationRequest>>& nextSteps)
override;
146 std::vector<shared_ptr<ValidationRequest>>& nextSteps)
override;
153 parseCommandInterest(
const Interest& interest,
Name& keyName, uint64_t& timestamp)
const;
156 checkTimestamp(
const Name& keyName, uint64_t timestamp,
160 unique_ptr<Validator> m_inner;
163 struct LastTimestampRecord
170 typedef boost::multi_index_container<
172 boost::multi_index::indexed_by<
173 boost::multi_index::ordered_unique<
174 boost::multi_index::member<LastTimestampRecord, Name, &LastTimestampRecord::keyName>
176 boost::multi_index::sequenced<>
179 typedef Container::nth_index<0>::type Index;
180 typedef Container::nth_index<1>::type Queue;
182 Container m_container;
194 #endif // NDN_SECURITY_COMMAND_INTEREST_VALIDATOR_HPP function< void(const shared_ptr< const Interest > &, const std::string &)> OnInterestValidationFailed
Callback to report a failed Interest validation.
Copyright (c) 2011-2015 Regents of the University of California.
time::nanoseconds timestampTtl
max lifetime of a last timestamp record
represents an Interest packet
function< void(const shared_ptr< const Data > &, const std::string &)> OnDataValidationFailed
Callback to report a failed Data validation.
std::ostream & operator<<(std::ostream &os, CommandInterestValidator::ErrorCode error)
function< void(const shared_ptr< const Data > &)> OnDataValidated
Callback to report a successful Data validation.
function< void(const shared_ptr< const Interest > &)> OnInterestValidated
Callback to report a successful Interest validation.
CommandInterestValidator(unique_ptr< Validator > inner, const Options &options=Options())
constructor
provides the interfaces for packet validation.
virtual void checkPolicy(const Interest &interest, int nSteps, const OnInterestValidated &accept, const OnInterestValidationFailed &reject, std::vector< shared_ptr< ValidationRequest >> &nextSteps) override
validate command Interest
time::nanoseconds gracePeriod
tolerance of initial timestamp
Name abstraction to represent an absolute name.
ssize_t maxTimestamps
max number of distinct public keys to record last timestamp
a validator for stop-and-wait command Interests