diff options
Diffstat (limited to 'src/include/gnunet_json_lib.h')
-rw-r--r-- | src/include/gnunet_json_lib.h | 45 |
1 files changed, 34 insertions, 11 deletions
diff --git a/src/include/gnunet_json_lib.h b/src/include/gnunet_json_lib.h index 49120982a..781d5698b 100644 --- a/src/include/gnunet_json_lib.h +++ b/src/include/gnunet_json_lib.h | |||
@@ -2,16 +2,18 @@ | |||
2 | This file is part of GNUnet | 2 | This file is part of GNUnet |
3 | Copyright (C) 2014, 2015, 2016 GNUnet e.V. | 3 | Copyright (C) 2014, 2015, 2016 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify it under the | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | terms of the GNU General Public License as published by the Free Software | 6 | under the terms of the GNU Affero General Public License as published |
7 | Foundation; either version 3, or (at your option) any later version. | 7 | by the Free Software Foundation, either version 3 of the License, |
8 | 8 | or (at your option) any later version. | |
9 | GNUnet is distributed in the hope that it will be useful, but WITHOUT ANY | 9 | |
10 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR | 10 | GNUnet is distributed in the hope that it will be useful, but |
11 | A PARTICULAR PURPOSE. See the GNU General Public License for more details. | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | You should have received a copy of the GNU General Public License along with | 13 | Affero General Public License for more details. |
14 | GNUnet; see the file COPYING. If not, If not, see <http://www.gnu.org/licenses/> | 14 | |
15 | You should have received a copy of the GNU Affero General Public License | ||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | 17 | */ |
16 | /** | 18 | /** |
17 | * @file gnunet_json_lib.h | 19 | * @file gnunet_json_lib.h |
@@ -24,6 +26,7 @@ | |||
24 | #define GNUNET_JSON_LIB_H | 26 | #define GNUNET_JSON_LIB_H |
25 | 27 | ||
26 | #include "gnunet_util_lib.h" | 28 | #include "gnunet_util_lib.h" |
29 | #include "gnunet_gnsrecord_lib.h" | ||
27 | #include <jansson.h> | 30 | #include <jansson.h> |
28 | 31 | ||
29 | 32 | ||
@@ -316,6 +319,17 @@ GNUNET_JSON_spec_rsa_signature (const char *name, | |||
316 | struct GNUNET_CRYPTO_RsaSignature **sig); | 319 | struct GNUNET_CRYPTO_RsaSignature **sig); |
317 | 320 | ||
318 | 321 | ||
322 | |||
323 | /** | ||
324 | * JSON Specification for GNS Records. | ||
325 | * | ||
326 | * @param gnsrecord_object struct of GNUNET_GNSRECORD_Data to fill | ||
327 | * @return JSON Specification | ||
328 | */ | ||
329 | struct GNUNET_JSON_Specification | ||
330 | GNUNET_JSON_spec_gnsrecord_data (struct GNUNET_GNSRECORD_Data **gnsrecord_object); | ||
331 | |||
332 | |||
319 | /* ****************** Generic generator interface ******************* */ | 333 | /* ****************** Generic generator interface ******************* */ |
320 | 334 | ||
321 | 335 | ||
@@ -391,6 +405,16 @@ GNUNET_JSON_from_rsa_public_key (const struct GNUNET_CRYPTO_RsaPublicKey *pk); | |||
391 | json_t * | 405 | json_t * |
392 | GNUNET_JSON_from_rsa_signature (const struct GNUNET_CRYPTO_RsaSignature *sig); | 406 | GNUNET_JSON_from_rsa_signature (const struct GNUNET_CRYPTO_RsaSignature *sig); |
393 | 407 | ||
408 | /** | ||
409 | * Convert Gns record to JSON. | ||
410 | * | ||
411 | * @param rname name of record | ||
412 | * @param rd record data | ||
413 | * @return corresponding JSON encoding | ||
414 | */ | ||
415 | json_t * | ||
416 | GNUNET_JSON_from_gns_record (const char* rname, | ||
417 | const struct GNUNET_GNSRECORD_Data *rd); | ||
394 | 418 | ||
395 | /* ******************* Helpers for MHD upload handling ******************* */ | 419 | /* ******************* Helpers for MHD upload handling ******************* */ |
396 | 420 | ||
@@ -477,7 +501,6 @@ GNUNET_JSON_getopt (char shortName, | |||
477 | const char *description, | 501 | const char *description, |
478 | json_t **json); | 502 | json_t **json); |
479 | 503 | ||
480 | |||
481 | #endif | 504 | #endif |
482 | 505 | ||
483 | /* end of gnunet_json_lib.h */ | 506 | /* end of gnunet_json_lib.h */ |