#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_json_lib.h"
#include "gnunet_reclaim_lib.h"
#include "gnunet_reclaim_service.h"
#include "json_reclaim.h"
Go to the source code of this file.
Functions | |
static int | parse_attr (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
Parse given JSON object to a claim. More... | |
static void | clean_attr (void *cls, struct GNUNET_JSON_Specification *spec) |
Cleanup data left from parsing RSA public key. More... | |
struct GNUNET_JSON_Specification | GNUNET_RECLAIM_JSON_spec_attribute (struct GNUNET_RECLAIM_Attribute **attr) |
JSON Specification for Reclaim claims. More... | |
static int | parse_ticket (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
Parse given JSON object to a ticket. More... | |
static void | clean_ticket (void *cls, struct GNUNET_JSON_Specification *spec) |
Cleanup data left from parsing RSA public key. More... | |
struct GNUNET_JSON_Specification | GNUNET_RECLAIM_JSON_spec_ticket (struct GNUNET_RECLAIM_Ticket **ticket) |
JSON Specification for Reclaim tickets. More... | |
static int | parse_credential (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) |
Parse given JSON object to a credential claim. More... | |
static void | clean_credential (void *cls, struct GNUNET_JSON_Specification *spec) |
Cleanup data left from parsing RSA public key. More... | |
struct GNUNET_JSON_Specification | GNUNET_RECLAIM_JSON_spec_credential (struct GNUNET_RECLAIM_Credential **cred) |
JSON Specification for credential claims. More... | |
|
static |
Parse given JSON object to a claim.
cls | closure, NULL |
root | the json object representing data |
spec | where to write the data |
Definition at line 42 of file json_reclaim.c.
References GNUNET_RECLAIM_Attribute::credential, data, data_size, GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_log, GNUNET_OK, GNUNET_RECLAIM_attribute_new(), GNUNET_RECLAIM_attribute_string_to_value(), GNUNET_RECLAIM_attribute_typename_to_number(), GNUNET_STRINGS_string_to_data(), GNUNET_SYSERR, GNUNET_RECLAIM_Attribute::id, GNUNET_JSON_Specification::ptr, type, and type_str.
Referenced by GNUNET_RECLAIM_JSON_spec_attribute().
|
static |
Cleanup data left from parsing RSA public key.
cls | closure, NULL | |
[out] | spec | where to free the data |
Definition at line 126 of file json_reclaim.c.
References GNUNET_free, and GNUNET_JSON_Specification::ptr.
Referenced by GNUNET_RECLAIM_JSON_spec_attribute().
struct GNUNET_JSON_Specification GNUNET_RECLAIM_JSON_spec_attribute | ( | struct GNUNET_RECLAIM_Attribute ** | attr | ) |
JSON Specification for Reclaim claims.
ticket | struct of GNUNET_RECLAIM_Attribute to fill |
Definition at line 146 of file json_reclaim.c.
References clean_attr(), parse_attr(), and ret.
Referenced by add_attribute_cont().
|
static |
Parse given JSON object to a ticket.
cls | closure, NULL |
root | the json object representing data |
spec | where to write the data |
Definition at line 170 of file json_reclaim.c.
References GNUNET_RECLAIM_Ticket::gns_name, GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_log, GNUNET_new, GNUNET_OK, GNUNET_SYSERR, GNUNET_JSON_Specification::ptr, and ticket.
Referenced by GNUNET_RECLAIM_JSON_spec_ticket().
|
static |
Cleanup data left from parsing RSA public key.
cls | closure, NULL | |
[out] | spec | where to free the data |
Definition at line 210 of file json_reclaim.c.
References GNUNET_free, GNUNET_JSON_Specification::ptr, and ticket.
Referenced by GNUNET_RECLAIM_JSON_spec_ticket().
struct GNUNET_JSON_Specification GNUNET_RECLAIM_JSON_spec_ticket | ( | struct GNUNET_RECLAIM_Ticket ** | ticket | ) |
JSON Specification for Reclaim tickets.
ticket | struct of GNUNET_RECLAIM_Ticket to fill |
Definition at line 230 of file json_reclaim.c.
References clean_ticket(), parse_ticket(), ret, and ticket.
Referenced by consume_ticket_cont(), and revoke_ticket_cont().
|
static |
Parse given JSON object to a credential claim.
cls | closure, NULL |
root | the json object representing data |
spec | where to write the data |
Definition at line 254 of file json_reclaim.c.
References cred, data, data_size, GNUNET_assert, GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_log, GNUNET_OK, GNUNET_RECLAIM_credential_new(), GNUNET_RECLAIM_credential_string_to_value(), GNUNET_RECLAIM_credential_typename_to_number(), GNUNET_strdup, GNUNET_STRINGS_string_to_data(), GNUNET_SYSERR, GNUNET_JSON_Specification::ptr, type, and type_str.
Referenced by GNUNET_RECLAIM_JSON_spec_credential().
|
static |
Cleanup data left from parsing RSA public key.
cls | closure, NULL | |
[out] | spec | where to free the data |
Definition at line 334 of file json_reclaim.c.
References GNUNET_free, and GNUNET_JSON_Specification::ptr.
Referenced by GNUNET_RECLAIM_JSON_spec_credential().
struct GNUNET_JSON_Specification GNUNET_RECLAIM_JSON_spec_credential | ( | struct GNUNET_RECLAIM_Credential ** | cred | ) |
JSON Specification for credential claims.
JSON Specification for credentials.
attr | struct of GNUNET_RECLAIM_Credential to fill |
Definition at line 354 of file json_reclaim.c.
References clean_credential(), cred, parse_credential(), and ret.
Referenced by add_credential_cont().