functions to generate specifciations for JSON parsing More...
Go to the source code of this file.
Functions | |
| struct GNUNET_JSON_Specification | GNUNET_JSON_spec_end () |
| End of a parser specification. | |
| static enum GNUNET_CRYPTO_BlindSignatureAlgorithm | string_to_cipher (const char *cipher_s) |
| Convert string value to numeric cipher value. | |
| static enum GNUNET_GenericReturnValue | parse_fixed_data (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
| Parse given JSON object to fixed size data. | |
| struct GNUNET_JSON_Specification | GNUNET_JSON_spec_fixed (const char *name, void *obj, size_t size) |
| Variable size object (in network byte order, encoded using Crockford Base32hex encoding). | |
| static enum GNUNET_GenericReturnValue | parse_fixed64_data (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
| Parse given JSON object to fixed size data. | |
| struct GNUNET_JSON_Specification | GNUNET_JSON_spec_fixed64 (const char *name, void *obj, size_t size) |
| Variable size object (in network byte order, encoded using base64 encoding). | |
| static enum GNUNET_GenericReturnValue | parse_variable_data (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
| Parse given JSON object to variable size data. | |
| static void | clean_variable_data (void *cls, struct GNUNET_JSON_Specification *spec) |
| Cleanup data left from parsing variable size data. | |
| struct GNUNET_JSON_Specification | GNUNET_JSON_spec_varsize (const char *name, void **obj, size_t *size) |
| Variable size object (in network byte order, encoded using Crockford Base32hex encoding). | |
| static enum GNUNET_GenericReturnValue | parse_string (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
| Parse given JSON object to string. | |
| struct GNUNET_JSON_Specification | GNUNET_JSON_spec_string (const char *name, const char **strptr) |
| The expected field stores a string. | |
| static enum GNUNET_GenericReturnValue | parse_string_copy (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
| Parse given JSON object to string, and make a copy. | |
| struct GNUNET_JSON_Specification | GNUNET_JSON_spec_string_copy (const char *name, char **strptr) |
| The expected field stores a string. | |
| static enum GNUNET_GenericReturnValue | parse_json (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
| Parse given JSON object to a JSON object. | |
| static void | clean_json (void *cls, struct GNUNET_JSON_Specification *spec) |
| Cleanup data left from parsing JSON object. | |
| struct GNUNET_JSON_Specification | GNUNET_JSON_spec_json (const char *name, json_t **jsonp) |
| JSON object or array. | |
| static enum GNUNET_GenericReturnValue | parse_object_const (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
| Parse given JSON object to a JSON object. | |
| struct GNUNET_JSON_Specification | GNUNET_JSON_spec_object_const (const char *name, const json_t **jsonp) |
| JSON object, reference counter not incremented. | |
| static enum GNUNET_GenericReturnValue | parse_object_copy (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
| Parse given JSON object to a JSON object and increment the reference counter. | |
| struct GNUNET_JSON_Specification | GNUNET_JSON_spec_object_copy (const char *name, json_t **jsonp) |
| JSON object, reference counter not incremented. | |
| static enum GNUNET_GenericReturnValue | parse_array_const (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
| Parse given JSON to a JSON array. | |
| struct GNUNET_JSON_Specification | GNUNET_JSON_spec_array_const (const char *name, const json_t **jsonp) |
| JSON array, reference counter not incremented. | |
| static enum GNUNET_GenericReturnValue | parse_array_copy (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
| Parse given JSON to a JSON array and increment the reference counter. | |
| struct GNUNET_JSON_Specification | GNUNET_JSON_spec_array_copy (const char *name, json_t **jsonp) |
| JSON array, reference counter not incremented. | |
| static enum GNUNET_GenericReturnValue | parse_bool (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
| Parse given JSON object to a bool. | |
| struct GNUNET_JSON_Specification | GNUNET_JSON_spec_bool (const char *name, bool *b) |
| boolean. | |
| static enum GNUNET_GenericReturnValue | parse_double (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
| Parse given JSON object to a double. | |
| struct GNUNET_JSON_Specification | GNUNET_JSON_spec_double (const char *name, double *f) |
| double. | |
| static enum GNUNET_GenericReturnValue | parse_u8 (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
| Parse given JSON object to a uint8_t. | |
| struct GNUNET_JSON_Specification | GNUNET_JSON_spec_uint8 (const char *name, uint8_t *u8) |
| 8-bit integer. | |
| static enum GNUNET_GenericReturnValue | parse_u16 (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
| Parse given JSON object to a uint16_t. | |
| struct GNUNET_JSON_Specification | GNUNET_JSON_spec_uint16 (const char *name, uint16_t *u16) |
| 16-bit integer. | |
| static enum GNUNET_GenericReturnValue | parse_u32 (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
| Parse given JSON object to a uint32_t. | |
| struct GNUNET_JSON_Specification | GNUNET_JSON_spec_uint32 (const char *name, uint32_t *u32) |
| 32-bit integer. | |
| static enum GNUNET_GenericReturnValue | parse_ui (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
| Parse given JSON object to an unsigned int. | |
| struct GNUNET_JSON_Specification | GNUNET_JSON_spec_uint (const char *name, unsigned int *ui) |
| Unsigned integer. | |
| static enum GNUNET_GenericReturnValue | parse_ull (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
| Parse given JSON object to an unsigned long long. | |
| struct GNUNET_JSON_Specification | GNUNET_JSON_spec_ull (const char *name, unsigned long long *ull) |
| Unsigned long long. | |
| static enum GNUNET_GenericReturnValue | parse_u64 (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
| Parse given JSON object to a uint64_t. | |
| struct GNUNET_JSON_Specification | GNUNET_JSON_spec_uint64 (const char *name, uint64_t *u64) |
| 64-bit integer. | |
| static enum GNUNET_GenericReturnValue | parse_i16 (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
| Parse given JSON object to a int16_t. | |
| struct GNUNET_JSON_Specification | GNUNET_JSON_spec_int16 (const char *name, int16_t *i16) |
| 16-bit signed integer. | |
| static enum GNUNET_GenericReturnValue | parse_i64 (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
| Parse given JSON object to a int64_t. | |
| struct GNUNET_JSON_Specification | GNUNET_JSON_spec_int64 (const char *name, int64_t *i64) |
| 64-bit signed integer. | |
| static enum GNUNET_GenericReturnValue | parse_timestamp (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
| Parse given JSON object to a timestamp. | |
| struct GNUNET_JSON_Specification | GNUNET_JSON_spec_timestamp (const char *name, struct GNUNET_TIME_Timestamp *t) |
| Timestamp. | |
| static enum GNUNET_GenericReturnValue | parse_timestamp_nbo (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
| Parse given JSON object to absolute time. | |
| struct GNUNET_JSON_Specification | GNUNET_JSON_spec_timestamp_nbo (const char *name, struct GNUNET_TIME_TimestampNBO *at) |
| Timestamp in network byte order. | |
| static enum GNUNET_GenericReturnValue | parse_rel_time (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
| Parse given JSON object to relative time. | |
| struct GNUNET_JSON_Specification | GNUNET_JSON_spec_relative_time (const char *name, struct GNUNET_TIME_Relative *rt) |
| Relative time. | |
| static enum GNUNET_GenericReturnValue | parse_rsa_public_key (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
| Parse given JSON object to RSA public key. | |
| static void | clean_rsa_public_key (void *cls, struct GNUNET_JSON_Specification *spec) |
| Cleanup data left from parsing RSA public key. | |
| struct GNUNET_JSON_Specification | GNUNET_JSON_spec_rsa_public_key (const char *name, struct GNUNET_CRYPTO_RsaPublicKey **pk) |
| Specification for parsing an RSA public key. | |
| static enum GNUNET_GenericReturnValue | parse_rsa_signature (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
| Parse given JSON object to RSA signature. | |
| static void | clean_rsa_signature (void *cls, struct GNUNET_JSON_Specification *spec) |
| Cleanup data left from parsing RSA signature. | |
| struct GNUNET_JSON_Specification | GNUNET_JSON_spec_rsa_signature (const char *name, struct GNUNET_CRYPTO_RsaSignature **sig) |
| Specification for parsing an RSA signature. | |
| static enum GNUNET_GenericReturnValue | parse_boolean (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
| Parse given JSON object to an int as a boolean. | |
| struct GNUNET_JSON_Specification | GNUNET_JSON_spec_boolean (const char *name, int *boolean) |
| Boolean (true mapped to GNUNET_YES, false mapped to GNUNET_NO). | |
| static enum GNUNET_GenericReturnValue | parse_blinded_message (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
| Parse given JSON object to a blinded message. | |
| static void | clean_blinded_message (void *cls, struct GNUNET_JSON_Specification *spec) |
| Cleanup data left from parsing blinded message. | |
| struct GNUNET_JSON_Specification | GNUNET_JSON_spec_blinded_message (const char *name, struct GNUNET_CRYPTO_BlindedMessage **msg) |
| Specification for parsing a blinded message. | |
| static enum GNUNET_GenericReturnValue | parse_blinded_sig (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
| Parse given JSON object to a blinded signature. | |
| static void | clean_blinded_sig (void *cls, struct GNUNET_JSON_Specification *spec) |
| Cleanup data left from parsing blinded sig. | |
| struct GNUNET_JSON_Specification | GNUNET_JSON_spec_blinded_signature (const char *field, struct GNUNET_CRYPTO_BlindedSignature **b_sig) |
| Specification for parsing a blinded signature. | |
| static enum GNUNET_GenericReturnValue | parse_unblinded_sig (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
| Parse given JSON object to unblinded signature. | |
| static void | clean_unblinded_sig (void *cls, struct GNUNET_JSON_Specification *spec) |
| Cleanup data left from parsing unblinded signature. | |
| struct GNUNET_JSON_Specification | GNUNET_JSON_spec_unblinded_signature (const char *field, struct GNUNET_CRYPTO_UnblindedSignature **ub_sig) |
| Specification for parsing an unblinded signature. | |
functions to generate specifciations for JSON parsing
Definition in file json_helper.c.
| struct GNUNET_JSON_Specification GNUNET_JSON_spec_end | ( | void | ) |
End of a parser specification.
Definition at line 33 of file json_helper.c.
References GNUNET_JSON_Specification::parser, and ret.
Referenced by add_attribute_cont(), add_credential_cont(), bulk_tx_start(), consume_ticket_cont(), namestore_add_or_update(), parse_blinded_message(), parse_blinded_sig(), parse_unblinded_sig(), and revoke_ticket_cont().
|
static |
Convert string value to numeric cipher value.
| cipher_s | input string |
Definition at line 50 of file json_helper.c.
References GNUNET_CRYPTO_BSA_CS, GNUNET_CRYPTO_BSA_INVALID, and GNUNET_CRYPTO_BSA_RSA.
Referenced by parse_blinded_message(), parse_blinded_sig(), and parse_unblinded_sig().
|
static |
Parse given JSON object to fixed size data.
| cls | closure, NULL | |
| root | the json object representing data | |
| [out] | spec | where to write the data |
Definition at line 75 of file json_helper.c.
References enc, GNUNET_JSON_Specification::field, GNUNET_break_op, GNUNET_ERROR_TYPE_WARNING, GNUNET_log, GNUNET_OK, GNUNET_STRINGS_string_to_data(), GNUNET_SYSERR, GNUNET_JSON_Specification::ptr, GNUNET_JSON_Specification::ptr_size, and SIZE_MAX.
Referenced by GNUNET_JSON_spec_fixed().
| struct GNUNET_JSON_Specification GNUNET_JSON_spec_fixed | ( | const char * | name, |
| void * | obj, | ||
| size_t | size | ||
| ) |
Variable size object (in network byte order, encoded using Crockford Base32hex encoding).
| name | name of the JSON field | |
| [out] | obj | pointer where to write the data, must have size bytes |
| size | number of bytes expected in obj |
Definition at line 115 of file json_helper.c.
References name, parse_fixed_data(), GNUNET_JSON_Specification::parser, ret, and size.
|
static |
Parse given JSON object to fixed size data.
| cls | closure, NULL | |
| root | the json object representing data | |
| [out] | spec | where to write the data |
Definition at line 139 of file json_helper.c.
References enc, GNUNET_JSON_Specification::field, GNUNET_break_op, GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_log, GNUNET_OK, GNUNET_STRINGS_base64_decode(), GNUNET_SYSERR, GNUNET_JSON_Specification::ptr, and GNUNET_JSON_Specification::ptr_size.
Referenced by GNUNET_JSON_spec_fixed64().
| struct GNUNET_JSON_Specification GNUNET_JSON_spec_fixed64 | ( | const char * | name, |
| void * | obj, | ||
| size_t | size | ||
| ) |
Variable size object (in network byte order, encoded using base64 encoding).
| name | name of the JSON field | |
| [out] | obj | pointer where to write the data, must have size bytes |
| size | number of bytes expected in obj |
Definition at line 176 of file json_helper.c.
References name, parse_fixed64_data(), GNUNET_JSON_Specification::parser, ret, and size.
|
static |
Parse given JSON object to variable size data.
| cls | closure, NULL | |
| root | the json object representing data | |
| [out] | spec | where to write the data |
Definition at line 200 of file json_helper.c.
References data, GNUNET_break_op, GNUNET_OK, GNUNET_STRINGS_string_to_data_alloc(), GNUNET_SYSERR, GNUNET_JSON_Specification::ptr, size, and GNUNET_JSON_Specification::size_ptr.
Referenced by GNUNET_JSON_spec_varsize().
|
static |
Cleanup data left from parsing variable size data.
| cls | closure, NULL | |
| [out] | spec | where to free the data |
Definition at line 236 of file json_helper.c.
References GNUNET_JSON_Specification::cls, GNUNET_free, GNUNET_JSON_Specification::ptr, and GNUNET_JSON_Specification::size_ptr.
Referenced by GNUNET_JSON_spec_varsize().
| struct GNUNET_JSON_Specification GNUNET_JSON_spec_varsize | ( | const char * | name, |
| void ** | obj, | ||
| size_t * | size | ||
| ) |
Variable size object (in network byte order, encoded using Crockford Base32hex encoding).
| name | name of the JSON field | |
| [out] | obj | pointer where to write the data, will be allocated |
| [out] | size | where to store the number of bytes allocated for obj |
Definition at line 250 of file json_helper.c.
References clean_variable_data(), name, parse_variable_data(), GNUNET_JSON_Specification::parser, ret, and size.
Referenced by parse_blinded_message().
|
static |
Parse given JSON object to string.
| cls | closure, NULL | |
| root | the json object representing data | |
| [out] | spec | where to write the data |
Definition at line 277 of file json_helper.c.
References GNUNET_JSON_Specification::cls, GNUNET_break_op, GNUNET_OK, GNUNET_SYSERR, and GNUNET_JSON_Specification::ptr.
Referenced by GNUNET_JSON_spec_string().
| struct GNUNET_JSON_Specification GNUNET_JSON_spec_string | ( | const char * | name, |
| const char ** | strptr | ||
| ) |
The expected field stores a string.
| name | name of the JSON field |
| strptr | where to store a pointer to the field |
Definition at line 296 of file json_helper.c.
References name, parse_string(), GNUNET_JSON_Specification::parser, and ret.
Referenced by consume_ticket_cont(), parse_blinded_message(), parse_blinded_sig(), and parse_unblinded_sig().
|
static |
Parse given JSON object to string, and make a copy.
| cls | closure, NULL | |
| root | the json object representing data | |
| [out] | spec | where to write the data |
Definition at line 319 of file json_helper.c.
References GNUNET_JSON_Specification::cls, GNUNET_break_op, GNUNET_OK, GNUNET_strdup, GNUNET_SYSERR, and GNUNET_JSON_Specification::ptr.
Referenced by GNUNET_JSON_spec_string_copy().
| struct GNUNET_JSON_Specification GNUNET_JSON_spec_string_copy | ( | const char * | name, |
| char ** | strptr | ||
| ) |
The expected field stores a string.
| name | name of the JSON field |
| strptr | where to store a pointer to the field |
Definition at line 338 of file json_helper.c.
References name, parse_string_copy(), GNUNET_JSON_Specification::parser, and ret.
|
static |
Parse given JSON object to a JSON object.
(Yes, trivial.)
| cls | closure, NULL | |
| root | the json object representing data | |
| [out] | spec | where to write the data |
Definition at line 361 of file json_helper.c.
References GNUNET_break_op, GNUNET_OK, GNUNET_SYSERR, and GNUNET_JSON_Specification::ptr.
Referenced by GNUNET_JSON_spec_json().
|
static |
Cleanup data left from parsing JSON object.
| cls | closure, NULL | |
| [out] | spec | where to free the data |
Definition at line 382 of file json_helper.c.
References GNUNET_JSON_Specification::ptr.
Referenced by GNUNET_JSON_spec_array_copy(), GNUNET_JSON_spec_json(), and GNUNET_JSON_spec_object_copy().
| struct GNUNET_JSON_Specification GNUNET_JSON_spec_json | ( | const char * | name, |
| json_t ** | jsonp | ||
| ) |
JSON object or array.
Reference counter is incremented.
| name | name of the JSON field | |
| [out] | jsonp | where to store the JSON found under name |
Definition at line 396 of file json_helper.c.
References clean_json(), name, parse_json(), GNUNET_JSON_Specification::parser, and ret.
|
static |
Parse given JSON object to a JSON object.
| cls | closure, NULL | |
| root | the json object representing data | |
| [out] | spec | where to write the data |
Definition at line 420 of file json_helper.c.
References GNUNET_break_op, GNUNET_OK, GNUNET_SYSERR, and GNUNET_JSON_Specification::ptr.
Referenced by GNUNET_JSON_spec_object_const().
| struct GNUNET_JSON_Specification GNUNET_JSON_spec_object_const | ( | const char * | name, |
| const json_t ** | jsonp | ||
| ) |
JSON object, reference counter not incremented.
| name | name of the JSON field | |
| [out] | jsonp | where to store the JSON found under name |
Definition at line 437 of file json_helper.c.
References name, parse_object_const(), GNUNET_JSON_Specification::parser, and ret.
|
static |
Parse given JSON object to a JSON object and increment the reference counter.
| cls | closure, NULL | |
| root | the json object representing data | |
| [out] | spec | where to write the data |
Definition at line 460 of file json_helper.c.
References GNUNET_break_op, GNUNET_OK, GNUNET_SYSERR, and GNUNET_JSON_Specification::ptr.
Referenced by GNUNET_JSON_spec_object_copy().
| struct GNUNET_JSON_Specification GNUNET_JSON_spec_object_copy | ( | const char * | name, |
| json_t ** | jsonp | ||
| ) |
JSON object, reference counter not incremented.
| name | name of the JSON field | |
| [out] | jsonp | where to store the JSON found under name |
Definition at line 477 of file json_helper.c.
References clean_json(), name, parse_object_copy(), GNUNET_JSON_Specification::parser, and ret.
|
static |
Parse given JSON to a JSON array.
| cls | closure, NULL | |
| root | the json object representing data | |
| [out] | spec | where to write the data |
Definition at line 501 of file json_helper.c.
References GNUNET_break_op, GNUNET_OK, GNUNET_SYSERR, and GNUNET_JSON_Specification::ptr.
Referenced by GNUNET_JSON_spec_array_const().
| struct GNUNET_JSON_Specification GNUNET_JSON_spec_array_const | ( | const char * | name, |
| const json_t ** | jsonp | ||
| ) |
JSON array, reference counter not incremented.
| name | name of the JSON field | |
| [out] | jsonp | where to store the JSON found under name |
Definition at line 518 of file json_helper.c.
References name, parse_array_const(), GNUNET_JSON_Specification::parser, and ret.
|
static |
Parse given JSON to a JSON array and increment the reference counter.
| cls | closure, NULL | |
| root | the json object representing data | |
| [out] | spec | where to write the data |
Definition at line 541 of file json_helper.c.
References GNUNET_break_op, GNUNET_OK, GNUNET_SYSERR, and GNUNET_JSON_Specification::ptr.
Referenced by GNUNET_JSON_spec_array_copy().
| struct GNUNET_JSON_Specification GNUNET_JSON_spec_array_copy | ( | const char * | name, |
| json_t ** | jsonp | ||
| ) |
JSON array, reference counter not incremented.
| name | name of the JSON field | |
| [out] | jsonp | where to store the JSON found under name |
Definition at line 558 of file json_helper.c.
References clean_json(), name, parse_array_copy(), GNUNET_JSON_Specification::parser, and ret.
|
static |
Parse given JSON object to a bool.
| cls | closure, NULL | |
| root | the json object representing data | |
| [out] | spec | where to write the data |
Definition at line 582 of file json_helper.c.
References GNUNET_break_op, GNUNET_OK, GNUNET_SYSERR, and GNUNET_JSON_Specification::ptr.
Referenced by GNUNET_JSON_spec_bool().
| struct GNUNET_JSON_Specification GNUNET_JSON_spec_bool | ( | const char * | name, |
| bool * | b | ||
| ) |
boolean.
| name | name of the JSON field | |
| [out] | b | where to store the boolean found under name |
Definition at line 604 of file json_helper.c.
References name, parse_bool(), GNUNET_JSON_Specification::parser, and ret.
|
static |
Parse given JSON object to a double.
| cls | closure, NULL | |
| root | the json object representing data | |
| [out] | spec | where to write the data |
Definition at line 627 of file json_helper.c.
References GNUNET_break_op, GNUNET_OK, GNUNET_SYSERR, and GNUNET_JSON_Specification::ptr.
Referenced by GNUNET_JSON_spec_double().
| struct GNUNET_JSON_Specification GNUNET_JSON_spec_double | ( | const char * | name, |
| double * | f | ||
| ) |
double.
| name | name of the JSON field | |
| [out] | f | where to store the double found under name |
Definition at line 644 of file json_helper.c.
References name, parse_double(), GNUNET_JSON_Specification::parser, and ret.
|
static |
Parse given JSON object to a uint8_t.
| cls | closure, NULL | |
| root | the json object representing data | |
| [out] | spec | where to write the data |
Definition at line 667 of file json_helper.c.
References GNUNET_break_op, GNUNET_OK, GNUNET_SYSERR, and GNUNET_JSON_Specification::ptr.
Referenced by GNUNET_JSON_spec_uint8().
| struct GNUNET_JSON_Specification GNUNET_JSON_spec_uint8 | ( | const char * | name, |
| uint8_t * | u8 | ||
| ) |
8-bit integer.
| name | name of the JSON field | |
| [out] | u8 | where to store the integer found under name |
Definition at line 691 of file json_helper.c.
References name, parse_u8(), GNUNET_JSON_Specification::parser, and ret.
|
static |
Parse given JSON object to a uint16_t.
| cls | closure, NULL | |
| root | the json object representing data | |
| [out] | spec | where to write the data |
Definition at line 714 of file json_helper.c.
References GNUNET_break_op, GNUNET_OK, GNUNET_SYSERR, and GNUNET_JSON_Specification::ptr.
Referenced by GNUNET_JSON_spec_uint16().
| struct GNUNET_JSON_Specification GNUNET_JSON_spec_uint16 | ( | const char * | name, |
| uint16_t * | u16 | ||
| ) |
16-bit integer.
| name | name of the JSON field | |
| [out] | u16 | where to store the integer found under name |
Definition at line 738 of file json_helper.c.
References name, parse_u16(), GNUNET_JSON_Specification::parser, and ret.
|
static |
Parse given JSON object to a uint32_t.
| cls | closure, NULL | |
| root | the json object representing data | |
| [out] | spec | where to write the data |
Definition at line 761 of file json_helper.c.
References GNUNET_break_op, GNUNET_OK, GNUNET_SYSERR, and GNUNET_JSON_Specification::ptr.
Referenced by GNUNET_JSON_spec_uint32().
| struct GNUNET_JSON_Specification GNUNET_JSON_spec_uint32 | ( | const char * | name, |
| uint32_t * | u32 | ||
| ) |
32-bit integer.
| name | name of the JSON field | |
| [out] | u32 | where to store the integer found under name |
Definition at line 785 of file json_helper.c.
References name, parse_u32(), GNUNET_JSON_Specification::parser, and ret.
Referenced by parse_blinded_sig().
|
static |
Parse given JSON object to an unsigned int.
| cls | closure, NULL | |
| root | the json object representing data | |
| [out] | spec | where to write the data |
Definition at line 808 of file json_helper.c.
References GNUNET_break_op, GNUNET_OK, GNUNET_SYSERR, and GNUNET_JSON_Specification::ptr.
Referenced by GNUNET_JSON_spec_uint().
| struct GNUNET_JSON_Specification GNUNET_JSON_spec_uint | ( | const char * | name, |
| unsigned int * | ui | ||
| ) |
Unsigned integer.
| name | name of the JSON field | |
| [out] | ui | where to store the integer found under name |
Definition at line 832 of file json_helper.c.
References name, parse_ui(), GNUNET_JSON_Specification::parser, and ret.
|
static |
Parse given JSON object to an unsigned long long.
| cls | closure, NULL | |
| root | the json object representing data | |
| [out] | spec | where to write the data |
Definition at line 855 of file json_helper.c.
References GNUNET_break_op, GNUNET_OK, GNUNET_SYSERR, and GNUNET_JSON_Specification::ptr.
Referenced by GNUNET_JSON_spec_ull().
| struct GNUNET_JSON_Specification GNUNET_JSON_spec_ull | ( | const char * | name, |
| unsigned long long * | ull | ||
| ) |
Unsigned long long.
| name | name of the JSON field | |
| [out] | ull | where to store the unsigned long long found under name |
Definition at line 879 of file json_helper.c.
References name, parse_ull(), GNUNET_JSON_Specification::parser, and ret.
|
static |
Parse given JSON object to a uint64_t.
| cls | closure, NULL | |
| root | the json object representing data | |
| [out] | spec | where to write the data |
Definition at line 902 of file json_helper.c.
References GNUNET_break_op, GNUNET_OK, GNUNET_SYSERR, and GNUNET_JSON_Specification::ptr.
Referenced by GNUNET_JSON_spec_uint64().
| struct GNUNET_JSON_Specification GNUNET_JSON_spec_uint64 | ( | const char * | name, |
| uint64_t * | u64 | ||
| ) |
64-bit integer.
| name | name of the JSON field | |
| [out] | u64 | where to store the integer found under name |
Definition at line 921 of file json_helper.c.
References name, parse_u64(), GNUNET_JSON_Specification::parser, and ret.
|
static |
Parse given JSON object to a int16_t.
| cls | closure, NULL | |
| root | the json object representing data | |
| [out] | spec | where to write the data |
Definition at line 944 of file json_helper.c.
References GNUNET_break_op, GNUNET_OK, GNUNET_SYSERR, and GNUNET_JSON_Specification::ptr.
Referenced by GNUNET_JSON_spec_int16().
| struct GNUNET_JSON_Specification GNUNET_JSON_spec_int16 | ( | const char * | name, |
| int16_t * | i16 | ||
| ) |
16-bit signed integer.
| name | name of the JSON field | |
| [out] | i16 | where to store the integer found under name |
Definition at line 969 of file json_helper.c.
References name, parse_i16(), GNUNET_JSON_Specification::parser, and ret.
|
static |
Parse given JSON object to a int64_t.
| cls | closure, NULL | |
| root | the json object representing data | |
| [out] | spec | where to write the data |
Definition at line 992 of file json_helper.c.
References GNUNET_break_op, GNUNET_OK, GNUNET_SYSERR, and GNUNET_JSON_Specification::ptr.
Referenced by GNUNET_JSON_spec_int64().
| struct GNUNET_JSON_Specification GNUNET_JSON_spec_int64 | ( | const char * | name, |
| int64_t * | i64 | ||
| ) |
64-bit signed integer.
| name | name of the JSON field | |
| [out] | i64 | where to store the integer found under name |
Definition at line 1011 of file json_helper.c.
References name, parse_i64(), GNUNET_JSON_Specification::parser, and ret.
|
static |
Parse given JSON object to a timestamp.
| cls | closure, NULL | |
| root | the json object representing data | |
| [out] | spec | where to write the data |
Definition at line 1036 of file json_helper.c.
References GNUNET_TIME_Timestamp::abs_time, GNUNET_TIME_Absolute::abs_value_us, GNUNET_break_op, GNUNET_OK, GNUNET_SYSERR, GNUNET_TIME_UNIT_FOREVER_ABS, GNUNET_TIME_UNIT_SECONDS, and GNUNET_JSON_Specification::ptr.
Referenced by GNUNET_JSON_spec_timestamp(), and parse_timestamp_nbo().
| struct GNUNET_JSON_Specification GNUNET_JSON_spec_timestamp | ( | const char * | name, |
| struct GNUNET_TIME_Timestamp * | t | ||
| ) |
Timestamp.
| name | name of the JSON field | |
| [out] | t | at where to store the absolute time found under name |
Definition at line 1087 of file json_helper.c.
References name, parse_timestamp(), GNUNET_JSON_Specification::parser, ret, and t.
|
static |
Parse given JSON object to absolute time.
| cls | closure, NULL | |
| root | the json object representing data | |
| [out] | spec | where to write the data |
Definition at line 1110 of file json_helper.c.
References GNUNET_OK, GNUNET_SYSERR, GNUNET_TIME_timestamp_hton(), parse_timestamp(), GNUNET_JSON_Specification::parser, and GNUNET_JSON_Specification::ptr.
Referenced by GNUNET_JSON_spec_timestamp_nbo().
| struct GNUNET_JSON_Specification GNUNET_JSON_spec_timestamp_nbo | ( | const char * | name, |
| struct GNUNET_TIME_TimestampNBO * | tn | ||
| ) |
Timestamp in network byte order.
| name | name of the JSON field | |
| [out] | tn | where to store the absolute time found under name |
Definition at line 1132 of file json_helper.c.
References name, parse_timestamp_nbo(), GNUNET_JSON_Specification::parser, and ret.
|
static |
Parse given JSON object to relative time.
| cls | closure, NULL | |
| root | the json object representing data | |
| [out] | spec | where to write the data |
Definition at line 1155 of file json_helper.c.
References GNUNET_break_op, GNUNET_OK, GNUNET_SYSERR, GNUNET_TIME_UNIT_FOREVER_REL, GNUNET_JSON_Specification::ptr, and GNUNET_TIME_Relative::rel_value_us.
Referenced by GNUNET_JSON_spec_relative_time().
| struct GNUNET_JSON_Specification GNUNET_JSON_spec_relative_time | ( | const char * | name, |
| struct GNUNET_TIME_Relative * | rt | ||
| ) |
Relative time.
| name | name of the JSON field | |
| [out] | rt | where to store the relative time found under name |
Definition at line 1202 of file json_helper.c.
References name, parse_rel_time(), GNUNET_JSON_Specification::parser, and ret.
|
static |
Parse given JSON object to RSA public key.
| cls | closure, NULL | |
| root | the json object representing data | |
| [out] | spec | where to write the data |
Definition at line 1225 of file json_helper.c.
References enc, GNUNET_break_op, GNUNET_CRYPTO_rsa_public_key_decode(), GNUNET_free, GNUNET_malloc, GNUNET_OK, GNUNET_STRINGS_string_to_data(), GNUNET_SYSERR, pk, and GNUNET_JSON_Specification::ptr.
Referenced by GNUNET_JSON_spec_rsa_public_key().
|
static |
Cleanup data left from parsing RSA public key.
| cls | closure, NULL | |
| [out] | spec | where to free the data |
Definition at line 1272 of file json_helper.c.
References GNUNET_CRYPTO_rsa_public_key_free(), pk, and GNUNET_JSON_Specification::ptr.
Referenced by GNUNET_JSON_spec_rsa_public_key().
| struct GNUNET_JSON_Specification GNUNET_JSON_spec_rsa_public_key | ( | const char * | name, |
| struct GNUNET_CRYPTO_RsaPublicKey ** | pk | ||
| ) |
Specification for parsing an RSA public key.
| name | name of the JSON field |
| pk | where to store the RSA key found under name |
Definition at line 1286 of file json_helper.c.
References clean_rsa_public_key(), name, parse_rsa_public_key(), GNUNET_JSON_Specification::parser, pk, and ret.
|
static |
Parse given JSON object to RSA signature.
| cls | closure, NULL | |
| root | the json object representing data | |
| [out] | spec | where to write the data |
Definition at line 1310 of file json_helper.c.
References GNUNET_break_op, GNUNET_CRYPTO_rsa_signature_decode(), GNUNET_free, GNUNET_malloc, GNUNET_OK, GNUNET_STRINGS_string_to_data(), GNUNET_SYSERR, GNUNET_JSON_Specification::ptr, res, and size.
Referenced by GNUNET_JSON_spec_rsa_signature().
|
static |
Cleanup data left from parsing RSA signature.
| cls | closure, NULL | |
| [out] | spec | where to free the data |
Definition at line 1357 of file json_helper.c.
References GNUNET_CRYPTO_rsa_signature_free(), and GNUNET_JSON_Specification::ptr.
Referenced by GNUNET_JSON_spec_rsa_signature().
| struct GNUNET_JSON_Specification GNUNET_JSON_spec_rsa_signature | ( | const char * | name, |
| struct GNUNET_CRYPTO_RsaSignature ** | sig | ||
| ) |
Specification for parsing an RSA signature.
| name | name of the JSON field |
| sig | where to store the RSA signature found under name |
Definition at line 1371 of file json_helper.c.
References clean_rsa_signature(), name, parse_rsa_signature(), GNUNET_JSON_Specification::parser, and ret.
Referenced by parse_blinded_sig(), and parse_unblinded_sig().
|
static |
Parse given JSON object to an int as a boolean.
| cls | closure, NULL | |
| root | the json object representing data | |
| [out] | spec | where to write the data |
Definition at line 1398 of file json_helper.c.
References GNUNET_break_op, GNUNET_NO, GNUNET_OK, GNUNET_SYSERR, GNUNET_YES, and GNUNET_JSON_Specification::ptr.
Referenced by GNUNET_JSON_spec_boolean().
| struct GNUNET_JSON_Specification GNUNET_JSON_spec_boolean | ( | const char * | name, |
| int * | boolean | ||
| ) |
Boolean (true mapped to GNUNET_YES, false mapped to GNUNET_NO).
| name | name of the JSON field | |
| [out] | boolean | where to store the boolean found under name |
Definition at line 1415 of file json_helper.c.
References name, parse_boolean(), GNUNET_JSON_Specification::parser, and ret.
|
static |
Parse given JSON object to a blinded message.
| cls | closure, NULL | |
| root | the json object representing data | |
| [out] | spec | where to write the data |
Definition at line 1438 of file json_helper.c.
References GNUNET_CRYPTO_RsaBlindedMessage::blinded_msg, GNUNET_CRYPTO_RsaBlindedMessage::blinded_msg_size, GNUNET_CRYPTO_CsBlindedMessage::c, GNUNET_CRYPTO_BlindedMessage::cipher, GNUNET_JSON_Specification::cls, GNUNET_CRYPTO_BlindedMessage::cs_blinded_message, GNUNET_CRYPTO_BlindedMessage::details, GNUNET_break_op, GNUNET_CRYPTO_BSA_CS, GNUNET_CRYPTO_BSA_INVALID, GNUNET_CRYPTO_BSA_RSA, GNUNET_free, GNUNET_JSON_parse(), GNUNET_JSON_spec_end(), GNUNET_JSON_spec_fixed_auto, GNUNET_JSON_spec_string(), GNUNET_JSON_spec_varsize(), GNUNET_new, GNUNET_OK, GNUNET_SYSERR, GNUNET_CRYPTO_CsBlindedMessage::nonce, GNUNET_JSON_Specification::ptr, GNUNET_CRYPTO_BlindedMessage::rc, GNUNET_CRYPTO_BlindedMessage::rsa_blinded_message, and string_to_cipher().
Referenced by GNUNET_JSON_spec_blinded_message().
|
static |
Cleanup data left from parsing blinded message.
| cls | closure, NULL | |
| [out] | spec | where to free the data |
Definition at line 1537 of file json_helper.c.
References GNUNET_CRYPTO_blinded_message_decref(), and GNUNET_JSON_Specification::ptr.
Referenced by GNUNET_JSON_spec_blinded_message().
| struct GNUNET_JSON_Specification GNUNET_JSON_spec_blinded_message | ( | const char * | name, |
| struct GNUNET_CRYPTO_BlindedMessage ** | msg | ||
| ) |
Specification for parsing a blinded message.
| name | name of the JSON field |
| sig | where to store the blinded message found under name |
Definition at line 1552 of file json_helper.c.
References clean_blinded_message(), msg, name, parse_blinded_message(), GNUNET_JSON_Specification::parser, and ret.
|
static |
Parse given JSON object to a blinded signature.
| cls | closure, NULL | |
| root | the json object representing data | |
| [out] | spec | where to write the data |
Definition at line 1579 of file json_helper.c.
References GNUNET_CRYPTO_CsBlindSignature::b, GNUNET_CRYPTO_BlindedSignature::blinded_cs_answer, GNUNET_CRYPTO_BlindedSignature::blinded_rsa_signature, GNUNET_CRYPTO_BlindedSignature::cipher, GNUNET_JSON_Specification::cls, GNUNET_CRYPTO_BlindedSignature::details, GNUNET_break_op, GNUNET_CRYPTO_BSA_CS, GNUNET_CRYPTO_BSA_INVALID, GNUNET_CRYPTO_BSA_RSA, GNUNET_free, GNUNET_JSON_parse(), GNUNET_JSON_spec_end(), GNUNET_JSON_spec_fixed_auto, GNUNET_JSON_spec_rsa_signature(), GNUNET_JSON_spec_string(), GNUNET_JSON_spec_uint32(), GNUNET_new, GNUNET_OK, GNUNET_SYSERR, GNUNET_JSON_Specification::ptr, GNUNET_CRYPTO_BlindedSignature::rc, and string_to_cipher().
Referenced by GNUNET_JSON_spec_blinded_signature().
|
static |
Cleanup data left from parsing blinded sig.
| cls | closure, NULL | |
| [out] | spec | where to free the data |
Definition at line 1671 of file json_helper.c.
References GNUNET_CRYPTO_blinded_sig_decref(), and GNUNET_JSON_Specification::ptr.
Referenced by GNUNET_JSON_spec_blinded_signature().
| struct GNUNET_JSON_Specification GNUNET_JSON_spec_blinded_signature | ( | const char * | field, |
| struct GNUNET_CRYPTO_BlindedSignature ** | b_sig | ||
| ) |
Specification for parsing a blinded signature.
| name | name of the JSON field |
| sig | where to store the blinded signature found under name |
Definition at line 1687 of file json_helper.c.
References clean_blinded_sig(), GNUNET_JSON_Specification::field, parse_blinded_sig(), GNUNET_JSON_Specification::parser, and ret.
|
static |
Parse given JSON object to unblinded signature.
| cls | closure, NULL | |
| root | the json object representing data | |
| [out] | spec | where to write the data |
Definition at line 1712 of file json_helper.c.
References GNUNET_CRYPTO_UnblindedSignature::cipher, GNUNET_JSON_Specification::cls, GNUNET_CRYPTO_UnblindedSignature::cs_signature, GNUNET_CRYPTO_UnblindedSignature::details, GNUNET_break_op, GNUNET_CRYPTO_BSA_CS, GNUNET_CRYPTO_BSA_INVALID, GNUNET_CRYPTO_BSA_RSA, GNUNET_free, GNUNET_JSON_parse(), GNUNET_JSON_spec_end(), GNUNET_JSON_spec_fixed_auto, GNUNET_JSON_spec_rsa_signature(), GNUNET_JSON_spec_string(), GNUNET_new, GNUNET_OK, GNUNET_SYSERR, GNUNET_JSON_Specification::ptr, GNUNET_CRYPTO_UnblindedSignature::rc, GNUNET_CRYPTO_UnblindedSignature::rsa_signature, and string_to_cipher().
Referenced by GNUNET_JSON_spec_unblinded_signature().
|
static |
Cleanup data left from parsing unblinded signature.
| cls | closure, NULL | |
| [out] | spec | where to free the data |
Definition at line 1805 of file json_helper.c.
References GNUNET_CRYPTO_unblinded_sig_decref(), and GNUNET_JSON_Specification::ptr.
Referenced by GNUNET_JSON_spec_unblinded_signature().
| struct GNUNET_JSON_Specification GNUNET_JSON_spec_unblinded_signature | ( | const char * | field, |
| struct GNUNET_CRYPTO_UnblindedSignature ** | ub_sig | ||
| ) |
Specification for parsing an unblinded signature.
| name | name of the JSON field |
| sig | where to store the unblinded signature found under name |
Definition at line 1820 of file json_helper.c.
References clean_unblinded_sig(), GNUNET_JSON_Specification::field, parse_unblinded_sig(), GNUNET_JSON_Specification::parser, and ret.