From 3d72be07448fd435640c6d0fdc2859601319d07e Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Thu, 3 Feb 2022 18:12:10 +0100 Subject: GNS: Introduce CRITICAL flag. Fixes #7169 --- src/include/gnunet_gnsrecord_lib.h | 9 +++++++++ src/include/gnunet_gnsrecord_plugin.h | 17 +++++++++++++++++ 2 files changed, 26 insertions(+) (limited to 'src/include') diff --git a/src/include/gnunet_gnsrecord_lib.h b/src/include/gnunet_gnsrecord_lib.h index fdbac3cf5..2b2bd4952 100644 --- a/src/include/gnunet_gnsrecord_lib.h +++ b/src/include/gnunet_gnsrecord_lib.h @@ -700,6 +700,15 @@ GNUNET_GNSRECORD_data_from_identity (const struct enum GNUNET_GenericReturnValue GNUNET_GNSRECORD_is_zonekey_type (uint32_t type); +/** + * Check if this type is a critical record. + * + * @param type the type to check + * @return GNUNET_YES if it is critical. + */ +enum GNUNET_GenericReturnValue +GNUNET_GNSRECORD_is_critical (uint32_t type); + #if 0 /* keep Emacsens' auto-indent happy */ { diff --git a/src/include/gnunet_gnsrecord_plugin.h b/src/include/gnunet_gnsrecord_plugin.h index aec22c3af..84b7c3c23 100644 --- a/src/include/gnunet_gnsrecord_plugin.h +++ b/src/include/gnunet_gnsrecord_plugin.h @@ -105,6 +105,18 @@ typedef const char * (*GNUNET_GNSRECORD_NumberToTypenameFunction) (void *cls, uint32_t type); +/** + * Function called to check for critical records. + * + * @param cls closure + * @param type number of a type to check + * @return GNUNET_YES if critical, otherwise GNUNET_NO + */ +typedef enum GNUNET_GenericReturnValue +(*GNUNET_GNSRECORD_IsCriticalFunction) (void *cls, + uint32_t type); + + /** * Each plugin is required to return a pointer to a struct of this @@ -136,6 +148,11 @@ struct GNUNET_GNSRECORD_PluginFunctions * Number to typename. */ GNUNET_GNSRECORD_NumberToTypenameFunction number_to_typename; + + /** + * Is critical. + */ + GNUNET_GNSRECORD_IsCriticalFunction is_critical; }; /** @} */ /* end of group */ -- cgit v1.2.3