{
if ((a->record_type == b->record_type) &&
(a->expiration_time == b->expiration_time) &&
- ((a->flags & GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION)
- == (b->flags & GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION) ) &&
+ ((a->flags & GNUNET_NAMESTORE_RF_RCMP_FLAGS)
+ == (b->flags & GNUNET_NAMESTORE_RF_RCMP_FLAGS) ) &&
(a->data_size == b->data_size) &&
(0 == memcmp (a->data, b->data, a->data_size)))
return GNUNET_YES;
return name_map[i].name;
}
+/**
+ * Test if a given record is expired.
+ *
+ * @return GNUNET_YES if the record is expired,
+ * GNUNET_NO if not
+ */
+int
+GNUNET_NAMESTORE_is_expired (const struct GNUNET_NAMESTORE_RecordData *rd)
+{
+ struct GNUNET_TIME_Absolute at;
+
+ if (0 != (rd->flags & GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION))
+ return GNUNET_NO;
+ at.abs_value = rd->expiration_time;
+ return (0 == GNUNET_TIME_absolute_get_remaining (at).rel_value) ? GNUNET_YES : GNUNET_NO;
+}
/* end of namestore_common.c */