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> 102 BAD_KEY_LOCATOR_TYPE,
104 TIMESTAMP_OUT_OF_GRACE,
135 std::vector<shared_ptr<ValidationRequest>>& nextSteps)
override;
145 std::vector<shared_ptr<ValidationRequest>>& nextSteps)
override;
152 parseCommandInterest(
const Interest& interest,
Name& keyName, uint64_t& timestamp)
const;
155 checkTimestamp(
const Name& keyName, uint64_t timestamp,
159 unique_ptr<Validator> m_inner;
162 struct LastTimestampRecord
169 typedef boost::multi_index_container<
171 boost::multi_index::indexed_by<
172 boost::multi_index::ordered_unique<
173 boost::multi_index::member<LastTimestampRecord, Name, &LastTimestampRecord::keyName>
175 boost::multi_index::sequenced<>
178 typedef Container::nth_index<0>::type Index;
179 typedef Container::nth_index<1>::type Queue;
181 Container m_container;
193 #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) 2013-2017 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.
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
Represents an absolute name.
ssize_t maxTimestamps
max number of distinct public keys to record last timestamp
a validator for stop-and-wait command Interests
Represents a Data packet.