21 #ifndef NDN_VALIDITY_PERIOD_H
22 #define NDN_VALIDITY_PERIOD_H
26 #include <ndn-cpp/c/security/validity-period-types.h>
39 self->notBefore = DBL_MAX;
40 self->notAfter = -DBL_MAX;
50 ndn_ValidityPeriod_clear(
self);
62 return !(
self->notBefore == DBL_MAX &&
self->notAfter == -DBL_MAX);
76 ndn_ValidityPeriod_setPeriod
78 ndn_MillisecondsSince1970 notAfter)
81 self->notBefore = round(ceil(round(notBefore) / 1000.0) * 1000.0);
83 self->notAfter = round(floor(round(notAfter) / 1000.0) * 1000.0);
92 ndn_ValidityPeriod_equals
95 return self->notBefore == other->
notBefore &&
107 ndn_ValidityPeriod_isValid
110 return self->notBefore <= time && time <=
self->notAfter;
Copyright (C) 2016-2018 Regents of the University of California.
Definition: validity-period-types.h:34
ndn_MillisecondsSince1970 notAfter
-DBL_MAX for none.
Definition: validity-period-types.h:36
ndn_MillisecondsSince1970 notBefore
DBL_MAX for none.
Definition: validity-period-types.h:35