diff options
author | Martin Schanzenbach <schanzen@gnunet.org> | 2022-02-05 00:50:38 +0100 |
---|---|---|
committer | Martin Schanzenbach <schanzen@gnunet.org> | 2022-02-05 15:38:39 +0100 |
commit | ee865f851ca4b173da8d00e87a0ad446efc8037e (patch) | |
tree | 92a627afa5799d78df0fd5b09a711ca3b89a8b6b /src/include | |
parent | 65f9e37ce036acdfab29b25b9b6f69de1b126962 (diff) | |
download | gnunet-ee865f851ca4b173da8d00e87a0ad446efc8037e.tar.gz gnunet-ee865f851ca4b173da8d00e87a0ad446efc8037e.zip |
GNS: Implement Tombstone logic
GNS: Namestore zonemaster record store processing
ZONEMASTER: Do not publish records if tombstone expires in the future
NAMESTORE: Purge old tombstones.
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_gnsrecord_lib.h | 15 | ||||
-rw-r--r-- | src/include/gnunet_namestore_service.h | 33 |
2 files changed, 48 insertions, 0 deletions
diff --git a/src/include/gnunet_gnsrecord_lib.h b/src/include/gnunet_gnsrecord_lib.h index 2b2bd4952..7d30055fc 100644 --- a/src/include/gnunet_gnsrecord_lib.h +++ b/src/include/gnunet_gnsrecord_lib.h | |||
@@ -299,6 +299,21 @@ struct GNUNET_GNSRECORD_ReverseRecord | |||
299 | /* followed by the name the delegator uses to refer to our namespace */ | 299 | /* followed by the name the delegator uses to refer to our namespace */ |
300 | }; | 300 | }; |
301 | 301 | ||
302 | |||
303 | /** | ||
304 | * Tombstone record. | ||
305 | * In case of deletion of all resource records under a label, the implementation | ||
306 | * MUST keep track of the last absolute expiration time of the last published | ||
307 | * resource block. Implementations MAY use a PADDING record as a tombstone that | ||
308 | * preserves the last absolute expiration time, but then MUST take care to not | ||
309 | * publish a block with just a PADDING record. When new records are added under | ||
310 | * this label later, the implementation MUST ensure that the expiration times | ||
311 | * are after the last published block. | ||
312 | */ | ||
313 | struct GNUNET_GNSRECORD_TombstoneRecord | ||
314 | { | ||
315 | struct GNUNET_TIME_AbsoluteNBO time_of_death; | ||
316 | }; | ||
302 | GNUNET_NETWORK_STRUCT_END | 317 | GNUNET_NETWORK_STRUCT_END |
303 | 318 | ||
304 | 319 | ||
diff --git a/src/include/gnunet_namestore_service.h b/src/include/gnunet_namestore_service.h index 2482b97a5..7db5e9d9e 100644 --- a/src/include/gnunet_namestore_service.h +++ b/src/include/gnunet_namestore_service.h | |||
@@ -134,6 +134,39 @@ GNUNET_NAMESTORE_records_store (struct GNUNET_NAMESTORE_Handle *h, | |||
134 | GNUNET_NAMESTORE_ContinuationWithStatus cont, | 134 | GNUNET_NAMESTORE_ContinuationWithStatus cont, |
135 | void *cont_cls); | 135 | void *cont_cls); |
136 | 136 | ||
137 | /** | ||
138 | * Store an item in the namestore. If the item is already present, | ||
139 | * it is replaced with the new record. Use an empty array to | ||
140 | * remove all records under the given name. | ||
141 | * | ||
142 | * The continuation is called after the value has been stored in the | ||
143 | * database. Monitors may be notified asynchronously (basically with | ||
144 | * a buffer). However, if any monitor is consistently too slow to | ||
145 | * keep up with the changes, calling @a cont will be delayed until the | ||
146 | * monitors do keep up. | ||
147 | * | ||
148 | * @param h handle to the namestore | ||
149 | * @param pkey private key of the zone | ||
150 | * @param label name that is being mapped | ||
151 | * @param rd_count number of records in the 'rd' array | ||
152 | * @param rd array of records with data to store | ||
153 | * @param is_zonemaster update tombstones, do not process monitors | ||
154 | * @param cont continuation to call when done | ||
155 | * @param cont_cls closure for @a cont | ||
156 | * @return handle to abort the request | ||
157 | */ | ||
158 | struct GNUNET_NAMESTORE_QueueEntry * | ||
159 | GNUNET_NAMESTORE_records_store_ (struct GNUNET_NAMESTORE_Handle *h, | ||
160 | const struct GNUNET_IDENTITY_PrivateKey *pkey, | ||
161 | const char *label, | ||
162 | unsigned int rd_count, | ||
163 | const struct GNUNET_GNSRECORD_Data *rd, | ||
164 | int is_zonemaster, | ||
165 | GNUNET_NAMESTORE_ContinuationWithStatus cont, | ||
166 | void *cont_cls); | ||
167 | |||
168 | |||
169 | |||
137 | 170 | ||
138 | /** | 171 | /** |
139 | * Process a record that was stored in the namestore. | 172 | * Process a record that was stored in the namestore. |