All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Classes | Public Member Functions | List of all members
ndn::ValidationPolicyCommandInterest Class Reference

ValidationPolicyCommandInterest extends ValidationPolicy as a policy for stop-and-wait command Interests. More...

#include <validation-policy-command-interest.hpp>

Inheritance diagram for ndn::ValidationPolicyCommandInterest:
ndn::ValidationPolicy

Classes

class  Options
 

Public Member Functions

 ValidationPolicyCommandInterest (const ptr_lib::shared_ptr< ValidationPolicy > &innerPolicy, const Options &options=Options())
 
virtual void checkPolicy (const Data &data, const ptr_lib::shared_ptr< ValidationState > &state, const ValidationContinuation &continueValidation)
 Check the Data packet against the policy. More...
 
virtual void checkPolicy (const Interest &interest, const ptr_lib::shared_ptr< ValidationState > &state, const ValidationContinuation &continueValidation)
 Check the Interest against the policy. More...
 
void setNowOffsetMilliseconds_ (Milliseconds nowOffsetMilliseconds)
 Set the offset when insertNewRecord() and cleanUp() get the current time, which should only be used for testing. More...
 
- Public Member Functions inherited from ndn::ValidationPolicy
void setInnerPolicy (const ptr_lib::shared_ptr< ValidationPolicy > &innerPolicy)
 Set the inner policy. More...
 
bool hasInnerPolicy () const
 Check if the inner policy is set. More...
 
ValidationPolicygetInnerPolicy ()
 Get the inner policy. More...
 
void setValidator (Validator &validator)
 Set the validator to which this policy is associated. More...
 
virtual void checkCertificatePolicy (const CertificateV2 &certificate, const ptr_lib::shared_ptr< ValidationState > &state, const ValidationContinuation &continueValidation)
 Check the certificate against the policy. More...
 

Additional Inherited Members

- Public Types inherited from ndn::ValidationPolicy
typedef func_lib::function
< void(const
ptr_lib::shared_ptr
< CertificateRequest >
&certificateRequest, const
ptr_lib::shared_ptr
< ValidationState > &state)> 
ValidationContinuation
 
- Static Public Member Functions inherited from ndn::ValidationPolicy
static Name getKeyLocatorName (const Data &data, ValidationState &state)
 Extract the KeyLocator Name from a Data packet. More...
 
static Name getKeyLocatorName (const Interest &interest, ValidationState &state)
 Extract the KeyLocator Name from a signed Interest. More...
 
- Protected Attributes inherited from ndn::ValidationPolicy
friend TestValidator_ConstructorSetValidator_Test
 
Validatorvalidator_
 
ptr_lib::shared_ptr
< ValidationPolicy
innerPolicy_
 

Detailed Description

ValidationPolicyCommandInterest extends ValidationPolicy as a policy for stop-and-wait command Interests.

See: https://redmine.named-data.net/projects/ndn-cxx/wiki/CommandInterest

This policy checks the timestamp field of a stop-and-wait command Interest. Signed Interest validation and Data validation requests are delegated to an inner policy.

Constructor & Destructor Documentation

ndn::ValidationPolicyCommandInterest::ValidationPolicyCommandInterest ( const ptr_lib::shared_ptr< ValidationPolicy > &  innerPolicy,
const Options options = Options() 
)
Parameters
innerPolicya ValidationPolicy for signed Interest signature validation and Data validation. This must not be null.
options(optional) The stop-and-wait command Interest validation options.
Exceptions
std::invalid_argumentif innerPolicy is null.

Member Function Documentation

void ndn::ValidationPolicyCommandInterest::checkPolicy ( const Data data,
const ptr_lib::shared_ptr< ValidationState > &  state,
const ValidationContinuation &  continueValidation 
)
virtual

Check the Data packet against the policy.

Your derived class must implement this. Depending on the implementation of the policy, this check can be done synchronously or asynchronously. The semantics of checkPolicy are as follows: If the packet violates the policy, then the policy should call state.fail() with an appropriate error code and error description. If the packet conforms to the policy and no further key retrievals are necessary, then the policy should call continueValidation(null, state). If the packet conforms to the policy and a key needs to be fetched, then the policy should call continueValidation(<appropriate-key-request-instance>, state).

Parameters
dataThe Data packet to check.
stateThe ValidationState of this validation.
continueValidationThe policy should call continueValidation() as described above.

Implements ndn::ValidationPolicy.

void ndn::ValidationPolicyCommandInterest::checkPolicy ( const Interest interest,
const ptr_lib::shared_ptr< ValidationState > &  state,
const ValidationContinuation &  continueValidation 
)
virtual

Check the Interest against the policy.

Your derived class must implement this. Depending on implementation of the policy, this check can be done synchronously or asynchronously. See the checkPolicy(Data) documentation for the semantics.

Parameters
interestThe Interest packet to check.
stateThe ValidationState of this validation.
continueValidationThe policy should call continueValidation() as described above.

Implements ndn::ValidationPolicy.

void ndn::ValidationPolicyCommandInterest::setNowOffsetMilliseconds_ ( Milliseconds  nowOffsetMilliseconds)
inline

Set the offset when insertNewRecord() and cleanUp() get the current time, which should only be used for testing.

Parameters
nowOffsetMillisecondsThe offset in milliseconds.

The documentation for this class was generated from the following files: