new Options(gracePeriodOrOptions, maxRecords, recordLifetime)
Create a ValidationPolicyCommandInterest.Options with the values.
Parameters:
Name | Type | Description |
---|---|---|
gracePeriodOrOptions |
number | ValidationPolicyCommandInterest.Options | (optional) The tolerance of the initial timestamp in milliseconds. (However, if this is another ValidationPolicyCommandInterest.Options, then copy values from it.) If omitted, use a grace period of 2 minutes. A stop-and-wait command Interest is considered "initial" if the validator has not recorded the last timestamp from the same public key, or when such knowledge has been erased. For an initial command Interest, its timestamp is compared to the current system clock, and the command Interest is rejected if the absolute difference is greater than the grace interval. The grace period should be positive. Setting this option to 0 or negative causes the validator to require exactly the same timestamp as the system clock, which most likely rejects all command Interests. |
maxRecords |
number | (optional) The maximum number of distinct public keys of which to record the last timestamp. If omitted, use 1000. The validator records the last timestamps for every public key. For a subsequent command Interest using the same public key, its timestamp is compared to the last timestamp from that public key, and the command Interest is rejected if its timestamp is less than or equal to the recorded timestamp. This option limits the number of distinct public keys being tracked. If the limit is exceeded, then the oldest record is deleted. Setting max records to -1 allows tracking unlimited public keys. Setting max records to 0 disables using last timestamp records and causes every command Interest to be processed as initial. |
recordLifetime |
number | (optional) The maximum lifetime of a last timestamp record in milliseconds. If omitted, use 1 hour. A last timestamp record expires and can be deleted if it has not been refreshed within the record lifetime. Setting the record lifetime to 0 or negative makes last timestamp records expire immediately and causes every command Interest to be processed as initial. |