From: Schanzenbach, Martin Date: Thu, 18 May 2017 11:12:49 +0000 (+0200) Subject: -add policy record type X-Git-Tag: gnunet-0.11.0rc0~24^2~88 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=315cdad26814aa1d5e35ee7c75cfa32058a04bf2;p=oweals%2Fgnunet.git -add policy record type --- diff --git a/src/credential/plugin_gnsrecord_credential.c b/src/credential/plugin_gnsrecord_credential.c index 5c3c03832..1011664cd 100644 --- a/src/credential/plugin_gnsrecord_credential.c +++ b/src/credential/plugin_gnsrecord_credential.c @@ -125,6 +125,10 @@ credential_value_to_string (void *cls, GNUNET_free (cred); return cred_str; } + case GNUNET_GNSRECORD_TYPE_POLICY: + { + return GNUNET_strdup (data); + } default: return NULL; } @@ -242,6 +246,12 @@ credential_string_to_value (void *cls, (char**)data); return GNUNET_OK; } + case GNUNET_GNSRECORD_TYPE_POLICY: + { + *data_size = strlen (s); + *data = GNUNET_strdup (s); + return GNUNET_OK; + } default: return GNUNET_SYSERR; } @@ -258,6 +268,7 @@ static struct { } name_map[] = { { "CRED", GNUNET_GNSRECORD_TYPE_CREDENTIAL }, { "ATTR", GNUNET_GNSRECORD_TYPE_ATTRIBUTE }, + { "POLICY", GNUNET_GNSRECORD_TYPE_POLICY }, { NULL, UINT32_MAX } }; diff --git a/src/include/gnunet_gnsrecord_lib.h b/src/include/gnunet_gnsrecord_lib.h index 4f96d50d5..e33d52819 100644 --- a/src/include/gnunet_gnsrecord_lib.h +++ b/src/include/gnunet_gnsrecord_lib.h @@ -114,9 +114,9 @@ extern "C" #define GNUNET_GNSRECORD_TYPE_CREDENTIAL 65547 /** - * Record type for reverse lookups + * Record type for policies */ -#define GNUNET_GNSRECORD_TYPE_REVERSE 65548 +#define GNUNET_GNSRECORD_TYPE_POLICY 65548 /** * Record type for reverse lookups