diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-06-19 21:59:30 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-06-19 21:59:30 +0000 |
commit | 5c9791cbb128494bcaf1544c3e89195e4007207c (patch) | |
tree | 86c9ba0a140c34efbe7462cfa25a167a84f0a211 /src/include/gnunet_namestore_service.h | |
parent | 0970f98adb25e2ec8076ddf61b3437b5003af0b2 (diff) | |
download | gnunet-5c9791cbb128494bcaf1544c3e89195e4007207c.tar.gz gnunet-5c9791cbb128494bcaf1544c3e89195e4007207c.zip |
-towards enabling relative expiration times in namestore
Diffstat (limited to 'src/include/gnunet_namestore_service.h')
-rw-r--r-- | src/include/gnunet_namestore_service.h | 39 |
1 files changed, 29 insertions, 10 deletions
diff --git a/src/include/gnunet_namestore_service.h b/src/include/gnunet_namestore_service.h index 05e4fbf06..f8a830dd7 100644 --- a/src/include/gnunet_namestore_service.h +++ b/src/include/gnunet_namestore_service.h | |||
@@ -25,8 +25,6 @@ | |||
25 | * | 25 | * |
26 | * Other functions we might want: | 26 | * Other functions we might want: |
27 | * - enumerate all known zones | 27 | * - enumerate all known zones |
28 | * - convenience function to gather record and the full affilliated stree | ||
29 | * in one shot | ||
30 | */ | 28 | */ |
31 | 29 | ||
32 | #ifndef GNUNET_NAMESTORE_SERVICE_H | 30 | #ifndef GNUNET_NAMESTORE_SERVICE_H |
@@ -159,7 +157,13 @@ enum GNUNET_NAMESTORE_RecordFlags | |||
159 | * This record was added by the system | 157 | * This record was added by the system |
160 | * and is pending user confimation | 158 | * and is pending user confimation |
161 | */ | 159 | */ |
162 | GNUNET_NAMESTORE_RF_PENDING = 4 | 160 | GNUNET_NAMESTORE_RF_PENDING = 4, |
161 | |||
162 | /** | ||
163 | * This expiration time of the record is a relative | ||
164 | * time (not an absolute time). | ||
165 | */ | ||
166 | GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION = 8 | ||
163 | 167 | ||
164 | }; | 168 | }; |
165 | 169 | ||
@@ -176,9 +180,10 @@ struct GNUNET_NAMESTORE_RecordData | |||
176 | const void *data; | 180 | const void *data; |
177 | 181 | ||
178 | /** | 182 | /** |
179 | * Expiration time for the DNS record. | 183 | * Expiration time for the DNS record. Can be relative |
184 | * or absolute, depending on 'flags'. | ||
180 | */ | 185 | */ |
181 | struct GNUNET_TIME_Absolute expiration; | 186 | uint64_t expiration_time; |
182 | 187 | ||
183 | /** | 188 | /** |
184 | * Number of bytes in 'data'. | 189 | * Number of bytes in 'data'. |
@@ -232,7 +237,7 @@ GNUNET_NAMESTORE_record_put (struct GNUNET_NAMESTORE_Handle *h, | |||
232 | * to validate signatures received from the network. | 237 | * to validate signatures received from the network. |
233 | * | 238 | * |
234 | * @param public_key public key of the zone | 239 | * @param public_key public key of the zone |
235 | * @param expire block expiration | 240 | * @param freshness time set for block expiration |
236 | * @param name name that is being mapped (at most 255 characters long) | 241 | * @param name name that is being mapped (at most 255 characters long) |
237 | * @param rd_count number of entries in 'rd' array | 242 | * @param rd_count number of entries in 'rd' array |
238 | * @param rd array of records with data to store | 243 | * @param rd array of records with data to store |
@@ -299,7 +304,7 @@ GNUNET_NAMESTORE_record_remove (struct GNUNET_NAMESTORE_Handle *h, | |||
299 | * | 304 | * |
300 | * @param cls closure | 305 | * @param cls closure |
301 | * @param zone_key public key of the zone | 306 | * @param zone_key public key of the zone |
302 | * @param expire when does the corresponding block in the DHT expire (until | 307 | * @param freshness when does the corresponding block in the DHT expire (until |
303 | * when should we never do a DHT lookup for the same name again)?; | 308 | * when should we never do a DHT lookup for the same name again)?; |
304 | * GNUNET_TIME_UNIT_ZERO_ABS if there are no records of any type in the namestore, | 309 | * GNUNET_TIME_UNIT_ZERO_ABS if there are no records of any type in the namestore, |
305 | * or the expiration time of the block in the namestore (even if there are zero | 310 | * or the expiration time of the block in the namestore (even if there are zero |
@@ -364,9 +369,23 @@ GNUNET_NAMESTORE_zone_to_name (struct GNUNET_NAMESTORE_Handle *h, | |||
364 | 369 | ||
365 | /** | 370 | /** |
366 | * Starts a new zone iteration (used to periodically PUT all of our | 371 | * Starts a new zone iteration (used to periodically PUT all of our |
367 | * records into our DHT). "proc" will be called once | 372 | * records into our DHT). "proc" will be called once immediately, and |
368 | * immediately, and then again after | 373 | * then again after "GNUNET_NAMESTORE_zone_iterator_next" is invoked. |
369 | * "GNUNET_NAMESTORE_zone_iterator_next" is invoked. | 374 | * |
375 | * By specifying a 'zone' of NULL and setting 'GNUNET_NAMESTORE_RF_AUTHORITY' | ||
376 | * in 'must_have_flags', we can iterate over all records for which we are | ||
377 | * the authority. In this case, the 'GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION' | ||
378 | * bit in 'must_have_flags' has a special meaning: | ||
379 | * | ||
380 | * 0) If the bit is clear, all relative expriation times are converted to | ||
381 | * absolute expiration times. This is useful for performing DHT PUT | ||
382 | * operations (and zone transfers) of our zone. | ||
383 | * 1) if it is set, it means that relative expiration times should be | ||
384 | * preserved when returned (this is useful for the zone editor user | ||
385 | * interface). | ||
386 | * | ||
387 | * Note that not all queries against this interface are equally performant | ||
388 | * as for some combinations no efficient index may exist. | ||
370 | * | 389 | * |
371 | * @param h handle to the namestore | 390 | * @param h handle to the namestore |
372 | * @param zone zone to access, NULL for all zones | 391 | * @param zone zone to access, NULL for all zones |