23 #ifndef NDN_VALIDATION_POLICY_COMMAND_INTEREST_HPP
24 #define NDN_VALIDATION_POLICY_COMMAND_INTEREST_HPP
27 #include "validation-policy.hpp"
56 (
Milliseconds gracePeriod = 2 * 60 * 1000.0,
int maxRecords = 1000,
119 (
const ptr_lib::shared_ptr<ValidationPolicy>& innerPolicy,
124 (
const Data& data,
const ptr_lib::shared_ptr<ValidationState>& state,
125 const ValidationContinuation& continueValidation);
129 (
const Interest& interest,
const ptr_lib::shared_ptr<ValidationState>& state,
130 const ValidationContinuation& continueValidation);
140 nowOffsetMilliseconds_ = nowOffsetMilliseconds;
144 class LastTimestampRecord
150 : keyName_(keyName), timestamp_(timestamp), lastRefreshed_(lastRefreshed)
172 (
const Interest& interest,
const ptr_lib::shared_ptr<ValidationState>& state,
184 (
const ptr_lib::shared_ptr<ValidationState>& state,
const Name& keyName,
189 (
const Interest& interest,
const Name& keyName,
198 findByKeyName(
const Name& keyName);
201 std::vector<ptr_lib::shared_ptr<LastTimestampRecord> > container_;
void setNowOffsetMilliseconds_(Milliseconds nowOffsetMilliseconds)
Set the offset when insertNewRecord() and cleanUp() get the current time, which should only be used f...
Definition: validation-policy-command-interest.hpp:138
double Milliseconds
A time interval represented as the number of milliseconds.
Definition: common.hpp:114
Definition: validation-policy-command-interest.hpp:43
ValidationPolicyCommandInterest extends ValidationPolicy as a policy for stop-and-wait command Intere...
Definition: validation-policy-command-interest.hpp:40
ValidationPolicy is an abstract base class that implements a validation policy for Data and Interest ...
Definition: validation-policy.hpp:41
ValidationPolicyCommandInterest(const ptr_lib::shared_ptr< ValidationPolicy > &innerPolicy, const Options &options=Options())
Definition: validation-policy-command-interest.cpp:32
A Name holds an array of Name::Component and represents an NDN name.
Definition: name.hpp:40
An Interest holds a Name and other fields for an interest.
Definition: interest.hpp:43
double MillisecondsSince1970
The calendar time represented as the number of milliseconds since 1/1/1970.
Definition: common.hpp:119
Options(Milliseconds gracePeriod=2 *60 *1000.0, int maxRecords=1000, Milliseconds recordLifetime=3600 *1000.0)
Create a ValidationPolicyCommandInterest::Options with the optional values.
Definition: validation-policy-command-interest.hpp:56
int maxRecords_
maxRecords is the maximum number of distinct public keys of which to record the last timestamp...
Definition: validation-policy-command-interest.hpp:97
Milliseconds recordLifetime_
recordLifetime is the maximum lifetime of a last timestamp record in milliseconds.
Definition: validation-policy-command-interest.hpp:108
Milliseconds gracePeriod_
gracePeriod is the tolerance of the initial timestamp in milliseconds.
Definition: validation-policy-command-interest.hpp:78
virtual void checkPolicy(const Data &data, const ptr_lib::shared_ptr< ValidationState > &state, const ValidationContinuation &continueValidation)
Check the Data packet against the policy.
Definition: validation-policy-command-interest.cpp:48