diff options
author | Martin Schanzenbach <schanzen@gnunet.org> | 2022-02-03 18:12:10 +0100 |
---|---|---|
committer | Martin Schanzenbach <schanzen@gnunet.org> | 2022-02-03 18:12:10 +0100 |
commit | 3d72be07448fd435640c6d0fdc2859601319d07e (patch) | |
tree | 253ed9212019d08725166300f449645e34c463b1 /src/gnsrecord/gnsrecord.c | |
parent | 3146c65c67b93ce4eb5bf27775167fde65f5e3c4 (diff) | |
download | gnunet-3d72be07448fd435640c6d0fdc2859601319d07e.tar.gz gnunet-3d72be07448fd435640c6d0fdc2859601319d07e.zip |
GNS: Introduce CRITICAL flag. Fixes #7169
Diffstat (limited to 'src/gnsrecord/gnsrecord.c')
-rw-r--r-- | src/gnsrecord/gnsrecord.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/gnsrecord/gnsrecord.c b/src/gnsrecord/gnsrecord.c index e9994a868..52c480ef6 100644 --- a/src/gnsrecord/gnsrecord.c +++ b/src/gnsrecord/gnsrecord.c | |||
@@ -260,4 +260,25 @@ GNUNET_GNSRECORD_number_to_typename (uint32_t type) | |||
260 | } | 260 | } |
261 | 261 | ||
262 | 262 | ||
263 | enum GNUNET_GenericReturnValue | ||
264 | GNUNET_GNSRECORD_is_critical (uint32_t type) | ||
265 | { | ||
266 | struct Plugin *plugin; | ||
267 | |||
268 | if (GNUNET_GNSRECORD_TYPE_ANY == type) | ||
269 | return GNUNET_NO; | ||
270 | init (); | ||
271 | for (unsigned int i = 0; i < num_plugins; i++) | ||
272 | { | ||
273 | plugin = gns_plugins[i]; | ||
274 | if (NULL == plugin->api->is_critical) | ||
275 | continue; | ||
276 | if (GNUNET_NO == plugin->api->is_critical (plugin->api->cls, type)) | ||
277 | continue; | ||
278 | return GNUNET_YES; | ||
279 | } | ||
280 | return GNUNET_NO; | ||
281 | } | ||
282 | |||
283 | |||
263 | /* end of gnsrecord.c */ | 284 | /* end of gnsrecord.c */ |