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. More... | |
static enum GNUNET_CRYPTO_BlindSignatureAlgorithm | string_to_cipher (const char *cipher_s) |
Convert string value to numeric cipher value. More... | |
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. More... | |
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). More... | |
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. More... | |
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). More... | |
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. More... | |
static void | clean_variable_data (void *cls, struct GNUNET_JSON_Specification *spec) |
Cleanup data left from parsing variable size data. More... | |
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). More... | |
static enum GNUNET_GenericReturnValue | parse_string (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
Parse given JSON object to string. More... | |
struct GNUNET_JSON_Specification | GNUNET_JSON_spec_string (const char *name, const char **strptr) |
The expected field stores a string. More... | |
static enum GNUNET_GenericReturnValue | parse_json (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
Parse given JSON object to a JSON object. More... | |
static void | clean_json (void *cls, struct GNUNET_JSON_Specification *spec) |
Cleanup data left from parsing JSON object. More... | |
struct GNUNET_JSON_Specification | GNUNET_JSON_spec_json (const char *name, json_t **jsonp) |
JSON object or array. More... | |
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. More... | |
struct GNUNET_JSON_Specification | GNUNET_JSON_spec_object_const (const char *name, const json_t **jsonp) |
JSON object, reference counter not incremented. More... | |
static enum GNUNET_GenericReturnValue | parse_array_const (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
Parse given JSON to a JSON array. More... | |
struct GNUNET_JSON_Specification | GNUNET_JSON_spec_array_const (const char *name, const json_t **jsonp) |
JSON array, reference counter not incremented. More... | |
static enum GNUNET_GenericReturnValue | parse_bool (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
Parse given JSON object to a bool. More... | |
struct GNUNET_JSON_Specification | GNUNET_JSON_spec_bool (const char *name, bool *b) |
boolean. More... | |
static enum GNUNET_GenericReturnValue | parse_double (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
Parse given JSON object to a double. More... | |
struct GNUNET_JSON_Specification | GNUNET_JSON_spec_double (const char *name, double *f) |
double. More... | |
static enum GNUNET_GenericReturnValue | parse_u8 (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
Parse given JSON object to a uint8_t. More... | |
struct GNUNET_JSON_Specification | GNUNET_JSON_spec_uint8 (const char *name, uint8_t *u8) |
8-bit integer. More... | |
static enum GNUNET_GenericReturnValue | parse_u16 (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
Parse given JSON object to a uint16_t. More... | |
struct GNUNET_JSON_Specification | GNUNET_JSON_spec_uint16 (const char *name, uint16_t *u16) |
16-bit integer. More... | |
static enum GNUNET_GenericReturnValue | parse_u32 (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
Parse given JSON object to a uint32_t. More... | |
struct GNUNET_JSON_Specification | GNUNET_JSON_spec_uint32 (const char *name, uint32_t *u32) |
32-bit integer. More... | |
static enum GNUNET_GenericReturnValue | parse_u64 (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
Parse given JSON object to a uint64_t. More... | |
struct GNUNET_JSON_Specification | GNUNET_JSON_spec_uint64 (const char *name, uint64_t *u64) |
64-bit integer. More... | |
static enum GNUNET_GenericReturnValue | parse_i64 (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
Parse given JSON object to a int64_t. More... | |
struct GNUNET_JSON_Specification | GNUNET_JSON_spec_int64 (const char *name, int64_t *i64) |
64-bit signed integer. More... | |
static enum GNUNET_GenericReturnValue | parse_timestamp (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
Parse given JSON object to a timestamp. More... | |
struct GNUNET_JSON_Specification | GNUNET_JSON_spec_timestamp (const char *name, struct GNUNET_TIME_Timestamp *t) |
Timestamp. More... | |
static enum GNUNET_GenericReturnValue | parse_timestamp_nbo (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
Parse given JSON object to absolute time. More... | |
struct GNUNET_JSON_Specification | GNUNET_JSON_spec_timestamp_nbo (const char *name, struct GNUNET_TIME_TimestampNBO *at) |
Timestamp in network byte order. More... | |
static enum GNUNET_GenericReturnValue | parse_rel_time (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
Parse given JSON object to relative time. More... | |
struct GNUNET_JSON_Specification | GNUNET_JSON_spec_relative_time (const char *name, struct GNUNET_TIME_Relative *rt) |
Relative time. More... | |
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. More... | |
static void | clean_rsa_public_key (void *cls, struct GNUNET_JSON_Specification *spec) |
Cleanup data left from parsing RSA public key. More... | |
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. More... | |
static enum GNUNET_GenericReturnValue | parse_rsa_signature (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
Parse given JSON object to RSA signature. More... | |
static void | clean_rsa_signature (void *cls, struct GNUNET_JSON_Specification *spec) |
Cleanup data left from parsing RSA signature. More... | |
struct GNUNET_JSON_Specification | GNUNET_JSON_spec_rsa_signature (const char *name, struct GNUNET_CRYPTO_RsaSignature **sig) |
Specification for parsing an RSA signature. More... | |
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. More... | |
struct GNUNET_JSON_Specification | GNUNET_JSON_spec_boolean (const char *name, int *boolean) |
Boolean (true mapped to GNUNET_YES, false mapped to GNUNET_NO). More... | |
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. More... | |
static void | clean_blinded_message (void *cls, struct GNUNET_JSON_Specification *spec) |
Cleanup data left from parsing blinded message. More... | |
struct GNUNET_JSON_Specification | GNUNET_JSON_spec_blinded_message (const char *name, struct GNUNET_CRYPTO_BlindedMessage **msg) |
Specification for parsing a blinded message. More... | |
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. More... | |
static void | clean_blinded_sig (void *cls, struct GNUNET_JSON_Specification *spec) |
Cleanup data left from parsing blinded sig. More... | |
struct GNUNET_JSON_Specification | GNUNET_JSON_spec_blinded_signature (const char *field, struct GNUNET_CRYPTO_BlindedSignature **b_sig) |
Specification for parsing a blinded signature. More... | |
static enum GNUNET_GenericReturnValue | parse_unblinded_sig (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
Parse given JSON object to unblinded signature. More... | |
static void | clean_unblinded_sig (void *cls, struct GNUNET_JSON_Specification *spec) |
Cleanup data left from parsing unblinded signature. More... | |
struct GNUNET_JSON_Specification | GNUNET_JSON_spec_unblinded_signature (const char *field, struct GNUNET_CRYPTO_UnblindedSignature **ub_sig) |
Specification for parsing an unblinded signature. More... | |
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 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 52 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 77 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 117 of file json_helper.c.
References name, parse_fixed_data(), 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 144 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 181 of file json_helper.c.
References name, parse_fixed64_data(), 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 208 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 244 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 258 of file json_helper.c.
References clean_variable_data(), name, parse_variable_data(), 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 287 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 306 of file json_helper.c.
References name, parse_string(), and ret.
Referenced by consume_ticket_cont(), parse_blinded_message(), parse_blinded_sig(), and parse_unblinded_sig().
|
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 329 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 351 of file json_helper.c.
References GNUNET_JSON_Specification::ptr.
Referenced by GNUNET_JSON_spec_json().
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 365 of file json_helper.c.
References clean_json(), name, parse_json(), 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 392 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 409 of file json_helper.c.
References name, parse_object_const(), 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 435 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 452 of file json_helper.c.
References name, parse_array_const(), 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 478 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 500 of file json_helper.c.
References name, parse_bool(), ret, and GNUNET_JSON_Specification::size_ptr.
|
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 526 of file json_helper.c.
References removetrailingwhitespace::f, 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 543 of file json_helper.c.
References removetrailingwhitespace::f, name, parse_double(), ret, and GNUNET_JSON_Specification::size_ptr.
|
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 569 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 593 of file json_helper.c.
References name, parse_u8(), ret, and GNUNET_JSON_Specification::size_ptr.
|
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 619 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 643 of file json_helper.c.
References name, parse_u16(), ret, and GNUNET_JSON_Specification::size_ptr.
|
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 669 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 693 of file json_helper.c.
References name, parse_u32(), ret, and GNUNET_JSON_Specification::size_ptr.
Referenced by parse_blinded_sig().
|
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 719 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 738 of file json_helper.c.
References name, parse_u64(), ret, and GNUNET_JSON_Specification::size_ptr.
|
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 764 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 783 of file json_helper.c.
References name, parse_i64(), ret, and GNUNET_JSON_Specification::size_ptr.
|
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 811 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 862 of file json_helper.c.
References name, parse_timestamp(), 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 885 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 907 of file json_helper.c.
References name, parse_timestamp_nbo(), 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 930 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 977 of file json_helper.c.
References name, parse_rel_time(), 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 1000 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 1047 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 1061 of file json_helper.c.
References clean_rsa_public_key(), name, parse_rsa_public_key(), 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 1085 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 1132 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 1146 of file json_helper.c.
References clean_rsa_signature(), name, parse_rsa_signature(), 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 1173 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 1190 of file json_helper.c.
References consensus-simulation::int, name, parse_boolean(), ret, and GNUNET_JSON_Specification::size_ptr.
|
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 1216 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 1315 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 1330 of file json_helper.c.
References clean_blinded_message(), msg, name, parse_blinded_message(), 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 1357 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 1449 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 1465 of file json_helper.c.
References clean_blinded_sig(), GNUNET_JSON_Specification::field, parse_blinded_sig(), 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 1490 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 1583 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 1598 of file json_helper.c.
References clean_unblinded_sig(), GNUNET_JSON_Specification::field, parse_unblinded_sig(), and ret.