- exception ndn.types.InterestCanceled
Raised when an Interest is cancelled due to the loss of connection to NFD.
A very large packet may cause NFD shutting down the connection. More specifically,
The face is shutdown.
All pending Interests are cancelled with this exception.
- exception ndn.types.InterestNack(reason)
Raised when receiving a NetworkNack.
reason (int) – reason for Nack.
- exception ndn.types.InterestTimeout
Raised when an Interest times out.
- exception ndn.types.NetworkError
Raised when trying to send a packet before connecting to NFD.
An OnInterest callback function for a route.
- class ndn.types.ValidResult(value)
Validation result returned by a validator. Most of them are designed for the union checker, which chains multiple checkers in order. For NDNApp (v2), only PASS and ALLOW_BYPASS are considered as True.
- ALLOW_BYPASS = 2
The validator allows bypassing all following checkers. Succeed immediately.
- FAIL = -2
Negative. The validation fails and the packet should be discarded. Abort.
- PASS = 1
Affirmative. Passes the current check. Continue.
- SILENCE = 0
The validator does not handle this type of packet and thus cannot decide. Continue.
- TIMEOUT = -1
The validation process exceeds the Interest deadline. Abort.
- exception ndn.types.ValidationFailure(name, meta_info, content, sig_ptrs, result=ValidResult.FAIL)
Raised when failing to validate a Data packet.
Generate a random nonce.
a random 32-bit unsigned integer.
Generate a random 64-bit nonce.
a random 64-bit unsigned integer.
Generate a timestamp number.
the time in milliseconds since the epoch as an integer