RECLAIM/OIDC: code cleanup
[oweals/gnunet.git] / src / include / gnunet_json_lib.h
index 1df9a0b5eee2c25df67548f71d8f3981871c318d..640ffa35a66ce6a6d70e61d80b7b66ce5e07c6d3 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2014, 2015, 2016 GNUnet e.V.
 
   GNUnet is free software: you can redistribute it and/or modify it
-  under the terms of the GNU General Public License as published
+  under the terms of the GNU Affero General Public License as published
   by the Free Software Foundation, either version 3 of the License,
   or (at your option) any later version.
 
   WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Affero General Public License for more details.
+  You should have received a copy of the GNU Affero General Public License
+  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+     SPDX-License-Identifier: AGPL3.0-or-later
 */
 /**
  * @file gnunet_json_lib.h
@@ -23,6 +28,7 @@
 #define GNUNET_JSON_LIB_H
 
 #include "gnunet_util_lib.h"
+#include "gnunet_gnsrecord_lib.h"
 #include <jansson.h>
 
 
@@ -315,6 +321,17 @@ GNUNET_JSON_spec_rsa_signature (const char *name,
                                 struct GNUNET_CRYPTO_RsaSignature **sig);
 
 
+
+/**
+ * JSON Specification for GNS Records.
+ *
+ * @param gnsrecord_object struct of GNUNET_GNSRECORD_Data to fill
+ * @return JSON Specification
+ */
+struct GNUNET_JSON_Specification
+GNUNET_JSON_spec_gnsrecord_data (struct GNUNET_GNSRECORD_Data **gnsrecord_object);
+
+
 /* ****************** Generic generator interface ******************* */
 
 
@@ -390,6 +407,16 @@ GNUNET_JSON_from_rsa_public_key (const struct GNUNET_CRYPTO_RsaPublicKey *pk);
 json_t *
 GNUNET_JSON_from_rsa_signature (const struct GNUNET_CRYPTO_RsaSignature *sig);
 
+/**
+ * Convert Gns record to JSON.
+ *
+ * @param rname name of record
+ * @param rd record data
+ * @return corresponding JSON encoding
+ */
+json_t *
+GNUNET_JSON_from_gns_record (const char* rname,
+                               const struct GNUNET_GNSRECORD_Data *rd);
 
 /* ******************* Helpers for MHD upload handling ******************* */
 
@@ -476,7 +503,6 @@ GNUNET_JSON_getopt (char shortName,
                     const char *description,
                     json_t **json);
 
-
 #endif
 
 /* end of gnunet_json_lib.h */