diff options
author | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2017-05-18 13:12:49 +0200 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2017-05-18 13:12:49 +0200 |
commit | 315cdad26814aa1d5e35ee7c75cfa32058a04bf2 (patch) | |
tree | a2965f8a9f865239376b09a77e456565f23307df /src/credential/plugin_gnsrecord_credential.c | |
parent | 56e4af789bcffac72eecacbec7156597a4b1c5b7 (diff) | |
download | gnunet-315cdad26814aa1d5e35ee7c75cfa32058a04bf2.tar.gz gnunet-315cdad26814aa1d5e35ee7c75cfa32058a04bf2.zip |
-add policy record type
Diffstat (limited to 'src/credential/plugin_gnsrecord_credential.c')
-rw-r--r-- | src/credential/plugin_gnsrecord_credential.c | 11 |
1 files changed, 11 insertions, 0 deletions
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, | |||
125 | GNUNET_free (cred); | 125 | GNUNET_free (cred); |
126 | return cred_str; | 126 | return cred_str; |
127 | } | 127 | } |
128 | case GNUNET_GNSRECORD_TYPE_POLICY: | ||
129 | { | ||
130 | return GNUNET_strdup (data); | ||
131 | } | ||
128 | default: | 132 | default: |
129 | return NULL; | 133 | return NULL; |
130 | } | 134 | } |
@@ -242,6 +246,12 @@ credential_string_to_value (void *cls, | |||
242 | (char**)data); | 246 | (char**)data); |
243 | return GNUNET_OK; | 247 | return GNUNET_OK; |
244 | } | 248 | } |
249 | case GNUNET_GNSRECORD_TYPE_POLICY: | ||
250 | { | ||
251 | *data_size = strlen (s); | ||
252 | *data = GNUNET_strdup (s); | ||
253 | return GNUNET_OK; | ||
254 | } | ||
245 | default: | 255 | default: |
246 | return GNUNET_SYSERR; | 256 | return GNUNET_SYSERR; |
247 | } | 257 | } |
@@ -258,6 +268,7 @@ static struct { | |||
258 | } name_map[] = { | 268 | } name_map[] = { |
259 | { "CRED", GNUNET_GNSRECORD_TYPE_CREDENTIAL }, | 269 | { "CRED", GNUNET_GNSRECORD_TYPE_CREDENTIAL }, |
260 | { "ATTR", GNUNET_GNSRECORD_TYPE_ATTRIBUTE }, | 270 | { "ATTR", GNUNET_GNSRECORD_TYPE_ATTRIBUTE }, |
271 | { "POLICY", GNUNET_GNSRECORD_TYPE_POLICY }, | ||
261 | { NULL, UINT32_MAX } | 272 | { NULL, UINT32_MAX } |
262 | }; | 273 | }; |
263 | 274 | ||