/**
* Record type for local ticket references
*/
-#define GNUNET_GNSRECORD_TYPE_RECLAIM_TICKETREF 65545
+#define GNUNET_GNSRECORD_TYPE_RECLAIM_TICKET 65545
/**
* 65546 reserved
* @param data_size number of bytes in @a data
* @return NULL on error, otherwise human-readable representation of the value
*/
-char *GNUNET_GNSRECORD_value_to_string (uint32_t type, const void *data,
- size_t data_size);
+char *
+GNUNET_GNSRECORD_value_to_string (uint32_t type, const void *data,
+ size_t data_size);
/**
* @param data_size set to number of bytes in @a data
* @return #GNUNET_OK on success
*/
-int GNUNET_GNSRECORD_string_to_value (uint32_t type, const char *s, void **data,
- size_t *data_size);
+int
+GNUNET_GNSRECORD_string_to_value (uint32_t type, const char *s, void **data,
+ size_t *data_size);
/**
* @param dns_typename name to convert
* @return corresponding number, UINT32_MAX on error
*/
-uint32_t GNUNET_GNSRECORD_typename_to_number (const char *dns_typename);
+uint32_t
+GNUNET_GNSRECORD_typename_to_number (const char *dns_typename);
/**
* @param type number of a type to convert
* @return corresponding typestring, NULL on error
*/
-const char *GNUNET_GNSRECORD_number_to_typename (uint32_t type);
+const char *
+GNUNET_GNSRECORD_number_to_typename (uint32_t type);
/* convenience APIs for serializing / deserializing GNS records */
* @param dest where to put the data
* @return #GNUNET_OK on success, #GNUNET_SYSERR on error
*/
-int GNUNET_GNSRECORD_records_deserialize (size_t len, const char *src,
- unsigned int rd_count,
- struct GNUNET_GNSRECORD_Data *dest);
+int
+GNUNET_GNSRECORD_records_deserialize (size_t len, const char *src,
+ unsigned int rd_count,
+ struct GNUNET_GNSRECORD_Data *dest);
/* ******* general APIs relating to blocks, records and labels ******** */
* @return #GNUNET_YES if the record is expired,
* #GNUNET_NO if not
*/
-int GNUNET_GNSRECORD_is_expired (const struct GNUNET_GNSRECORD_Data *rd);
+int
+GNUNET_GNSRECORD_is_expired (const struct GNUNET_GNSRECORD_Data *rd);
/**
* @param src source string
* @return converted result
*/
-char *GNUNET_GNSRECORD_string_to_lowercase (const char *src);
+char *
+GNUNET_GNSRECORD_string_to_lowercase (const char *src);
/**
* @return string form; will be overwritten by next call to
* #GNUNET_GNSRECORD_z2s.
*/
-const char *GNUNET_GNSRECORD_z2s (const struct GNUNET_CRYPTO_EcdsaPublicKey *z);
+const char *
+GNUNET_GNSRECORD_z2s (const struct GNUNET_CRYPTO_EcdsaPublicKey *z);
/**
* @param pkey set to a public key on the eliptic curve
* @return #GNUNET_SYSERR if @a zkey has the wrong syntax
*/
-int GNUNET_GNSRECORD_zkey_to_pkey (const char *zkey,
- struct GNUNET_CRYPTO_EcdsaPublicKey *pkey);
+int
+GNUNET_GNSRECORD_zkey_to_pkey (const char *zkey,
+ struct GNUNET_CRYPTO_EcdsaPublicKey *pkey);
/**
* @param label label of the record
* @param query hash to use for the query
*/
-void GNUNET_GNSRECORD_query_from_private_key (
+void
+GNUNET_GNSRECORD_query_from_private_key (
const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, const char *label,
struct GNUNET_HashCode *query);
* @param label label of the record
* @param query hash to use for the query
*/
-void GNUNET_GNSRECORD_query_from_public_key (
+void
+GNUNET_GNSRECORD_query_from_public_key (
const struct GNUNET_CRYPTO_EcdsaPublicKey *pub, const char *label,
struct GNUNET_HashCode *query);
* @param rd record data
* @param rd_count number of records in @a rd
*/
-struct GNUNET_GNSRECORD_Block *GNUNET_GNSRECORD_block_create (
- const struct GNUNET_CRYPTO_EcdsaPrivateKey *key,
- struct GNUNET_TIME_Absolute expire, const char *label,
- const struct GNUNET_GNSRECORD_Data *rd, unsigned int rd_count);
+struct GNUNET_GNSRECORD_Block *
+GNUNET_GNSRECORD_block_create (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key,
+ struct GNUNET_TIME_Absolute expire,
+ const char *label,
+ const struct GNUNET_GNSRECORD_Data *rd,
+ unsigned int rd_count);
/**
* @param rd record data
* @param rd_count number of records in @a rd
*/
-struct GNUNET_GNSRECORD_Block *GNUNET_GNSRECORD_block_create2 (
- const struct GNUNET_CRYPTO_EcdsaPrivateKey *key,
- struct GNUNET_TIME_Absolute expire, const char *label,
- const struct GNUNET_GNSRECORD_Data *rd, unsigned int rd_count);
+struct GNUNET_GNSRECORD_Block *
+GNUNET_GNSRECORD_block_create2 (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key,
+ struct GNUNET_TIME_Absolute expire,
+ const char *label,
+ const struct GNUNET_GNSRECORD_Data *rd,
+ unsigned int rd_count);
/**
* @param block block to verify
* @return #GNUNET_OK if the signature is valid
*/
-int GNUNET_GNSRECORD_block_verify (const struct GNUNET_GNSRECORD_Block *block);
+int
+GNUNET_GNSRECORD_block_verify (const struct GNUNET_GNSRECORD_Block *block);
/**
* @return #GNUNET_OK on success, #GNUNET_SYSERR if the block was
* not well-formed
*/
-int GNUNET_GNSRECORD_block_decrypt (
+int
+GNUNET_GNSRECORD_block_decrypt (
const struct GNUNET_GNSRECORD_Block *block,
const struct GNUNET_CRYPTO_EcdsaPublicKey *zone_key, const char *label,
GNUNET_GNSRECORD_RecordCallback proc, void *proc_cls);
* @param b another record
* @return #GNUNET_YES if the records are equal, or #GNUNET_NO if not.
*/
-int GNUNET_GNSRECORD_records_cmp (const struct GNUNET_GNSRECORD_Data *a,
- const struct GNUNET_GNSRECORD_Data *b);
+int
+GNUNET_GNSRECORD_records_cmp (const struct GNUNET_GNSRECORD_Data *a,
+ const struct GNUNET_GNSRECORD_Data *b);
/**
* @param rd array of records
* @return absolute expiration time
*/
-struct GNUNET_TIME_Absolute GNUNET_GNSRECORD_record_get_expiration_time (
+struct GNUNET_TIME_Absolute
+GNUNET_GNSRECORD_record_get_expiration_time (
unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd);
*/
struct GNUNET_RECLAIM_ATTRIBUTE_Claim *claim;
-static void do_cleanup (void *cls)
+static void
+do_cleanup (void *cls)
{
cleanup_task = NULL;
if (NULL != timeout)
GNUNET_free (attr_list);
}
-static void ticket_issue_cb (void *cls,
- const struct GNUNET_RECLAIM_Ticket *ticket)
+static void
+ticket_issue_cb (void *cls, const struct GNUNET_RECLAIM_Ticket *ticket)
{
char *ticket_str;
reclaim_op = NULL;
cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
}
-static void store_attr_cont (void *cls, int32_t success, const char *emsg)
+static void
+store_attr_cont (void *cls, int32_t success, const char *emsg)
{
reclaim_op = NULL;
if (GNUNET_SYSERR == success) {
cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
}
-static void process_attrs (void *cls,
- const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
- const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr)
+static void
+process_attrs (void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
+ const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr)
{
char *value_str;
const char *attr_type;
attr_type, attr->version, attr->id);
}
-static void ticket_iter_err (void *cls)
+static void
+ticket_iter_err (void *cls)
{
ticket_iterator = NULL;
fprintf (stderr, "Failed to iterate over tickets\n");
cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
}
-static void ticket_iter_fin (void *cls)
+static void
+ticket_iter_fin (void *cls)
{
ticket_iterator = NULL;
cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
}
-static void ticket_iter (void *cls, const struct GNUNET_RECLAIM_Ticket *ticket)
+static void
+ticket_iter (void *cls, const struct GNUNET_RECLAIM_Ticket *ticket)
{
- fprintf (stdout, "Found ticket\n");
+ char *aud;
+ char *ref;
+
+ aud = GNUNET_STRINGS_data_to_string_alloc (
+ &ticket->audience, sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey));
+ ref = GNUNET_STRINGS_data_to_string_alloc (&ticket->rnd, sizeof (uint64_t));
+
+ fprintf (stdout, "Ticket ID: %s | Audience: %s\n", ref, aud);
GNUNET_RECLAIM_ticket_iteration_next (ticket_iterator);
}
-static void iter_error (void *cls)
+static void
+iter_error (void *cls)
{
attr_iterator = NULL;
fprintf (stderr, "Failed to iterate over attributes\n");
cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
}
-static void timeout_task (void *cls)
+static void
+timeout_task (void *cls)
{
timeout = NULL;
ret = 1;
cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
}
-static void process_rvk (void *cls, int success, const char *msg)
+static void
+process_rvk (void *cls, int success, const char *msg)
{
reclaim_op = NULL;
if (GNUNET_OK != success) {
cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
}
-static void iter_finished (void *cls)
+static void
+iter_finished (void *cls)
{
char *data;
size_t data_size;
cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
}
-static void iter_cb (void *cls,
- const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
- const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr)
+static void
+iter_cb (void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
+ const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr)
{
struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry *le;
char *attrs_tmp;
GNUNET_RECLAIM_get_attributes_next (attr_iterator);
}
-static void start_process ()
+static void
+start_process ()
{
if (NULL == pkey) {
fprintf (stderr, "Ego %s not found\n", ego_name);
static int init = GNUNET_YES;
-static void ego_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego, void **ctx,
- const char *name)
+static void
+ego_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego, void **ctx,
+ const char *name)
{
if (NULL == name) {
if (GNUNET_YES == init) {
}
-static void run (void *cls, char *const *args, const char *cfgfile,
- const struct GNUNET_CONFIGURATION_Handle *c)
+static void
+run (void *cls, char *const *args, const char *cfgfile,
+ const struct GNUNET_CONFIGURATION_Handle *c)
{
ret = 0;
if (NULL == ego_name) {
}
-int main (int argc, char *const argv[])
+int
+main (int argc, char *const argv[])
{
exp_interval = GNUNET_TIME_UNIT_HOURS;
struct GNUNET_GETOPT_CommandLineOption options[] = {
} else {
env = GNUNET_MQ_msg_extra (trm, sizeof (struct GNUNET_RECLAIM_Ticket),
GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_RESULT);
+ memcpy (&trm[1], ticket, sizeof (struct GNUNET_RECLAIM_Ticket));
}
trm->id = htonl (ti->r_id);
GNUNET_MQ_send (ti->client->mq, env);
*/
struct GNUNET_NAMESTORE_QueueEntry *ns_qe;
- /**
- * Ticket reference list
- */
- struct TicketReference *ticket_refs_head;
-
- /**
- * Ticket reference list
- */
- struct TicketReference *ticket_refs_tail;
-
- /**
- * Number of references
- */
- uint32_t ticket_ref_num;
-
/**
* Callback
*/
* Ticket iterator
*/
struct RECLAIM_TICKETS_Iterator {
- /**
- * Issuer Key
- */
- struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
-
- /**
- * Issuer pubkey
- */
- struct GNUNET_CRYPTO_EcdsaPublicKey identity_pub;
-
/**
* Namestore queue entry
*/
- struct GNUNET_NAMESTORE_QueueEntry *ns_qe;
+ struct GNUNET_NAMESTORE_ZoneIterator *ns_it;
/**
* Iter callback
* Iter cls
*/
void *cb_cls;
-
- /**
- * Ticket reference list
- */
- struct TicketReference *tickets_head;
-
- /**
- * Ticket reference list
- */
- struct TicketReference *tickets_tail;
};
static void
cleanup_issue_handle (struct TicketIssueHandle *handle)
{
- struct TicketReference *tr;
- struct TicketReference *tr_tmp;
- if (NULL != handle->attrs)
- GNUNET_RECLAIM_ATTRIBUTE_list_destroy (handle->attrs);
if (NULL != handle->ns_qe)
GNUNET_NAMESTORE_cancel (handle->ns_qe);
- for (tr = handle->ticket_refs_head; NULL != tr;) {
- if (NULL != tr->attrs)
- GNUNET_RECLAIM_ATTRIBUTE_list_destroy (tr->attrs);
- tr_tmp = tr;
- tr = tr->next;
- GNUNET_free (tr_tmp);
- }
GNUNET_free (handle);
}
-static void
-store_ticket_refs_cont (void *cls, int32_t success, const char *emsg)
-{
- struct TicketIssueHandle *handle = cls;
- handle->ns_qe = NULL;
- if (GNUNET_OK != success) {
- handle->cb (handle->cb_cls, NULL, GNUNET_SYSERR,
- "Error storing updated ticket refs in GNS");
- cleanup_issue_handle (handle);
- return;
- }
- handle->cb (handle->cb_cls, &handle->ticket, GNUNET_OK, NULL);
- cleanup_issue_handle (handle);
-}
-
-
-static void
-update_ticket_refs (void *cls)
-{
- struct TicketIssueHandle *handle = cls;
- struct GNUNET_GNSRECORD_Data refs_rd[handle->ticket_ref_num];
- struct TicketReference *tr;
-
- tr = handle->ticket_refs_head;
- for (int i = 0; i < handle->ticket_ref_num; i++) {
- refs_rd[i].data = &tr->ticket;
- refs_rd[i].data_size = sizeof (struct GNUNET_RECLAIM_Ticket);
- refs_rd[i].expiration_time = GNUNET_TIME_UNIT_DAYS.rel_value_us;
- refs_rd[i].record_type = GNUNET_GNSRECORD_TYPE_RECLAIM_TICKETREF;
- refs_rd[i].flags =
- GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION | GNUNET_GNSRECORD_RF_PRIVATE;
- tr = tr->next;
- }
-
- handle->ns_qe = GNUNET_NAMESTORE_records_store (
- nsh, &handle->identity, GNUNET_GNS_EMPTY_LABEL_AT, handle->ticket_ref_num,
- refs_rd, &store_ticket_refs_cont, handle);
-}
-
-
-static void
-ticket_lookup_cb (void *cls, const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
- const char *label, unsigned int rd_count,
- const struct GNUNET_GNSRECORD_Data *rd)
-{
- struct TicketIssueHandle *handle = cls;
- struct TicketReference *tr;
-
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Received tickets from local namestore.\n");
- handle->ns_qe = NULL;
- for (int i = 0; i < rd_count; i++) {
- if (GNUNET_GNSRECORD_TYPE_RECLAIM_TICKETREF != rd[i].record_type)
- continue;
- tr = GNUNET_new (struct TicketReference);
- memcpy (&tr->ticket, rd[i].data, sizeof (struct GNUNET_RECLAIM_Ticket));
- if (0 != memcmp (&tr->ticket.identity, &handle->ticket.identity,
- sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey))) {
- // Not our ticket
- GNUNET_free (tr);
- continue;
- }
- GNUNET_CONTAINER_DLL_insert (handle->ticket_refs_head,
- handle->ticket_refs_tail, tr);
- handle->ticket_ref_num++;
- }
- tr = GNUNET_new (struct TicketReference);
- tr->ticket = handle->ticket;
- tr->attrs = GNUNET_RECLAIM_ATTRIBUTE_list_dup (handle->attrs);
- GNUNET_CONTAINER_DLL_insert (handle->ticket_refs_head,
- handle->ticket_refs_tail, tr);
- handle->ticket_ref_num++;
- GNUNET_SCHEDULER_add_now (&update_ticket_refs, handle);
-}
-
-
-/**
- * TODO maybe we should cleanup the ATTRREFS here?
- */
-static void
-ticket_lookup_error_cb (void *cls)
-{
- struct TicketIssueHandle *handle = cls;
- handle->ns_qe = NULL;
- handle->cb (handle->cb_cls, &handle->ticket, GNUNET_SYSERR,
- "Error checking for ticketsin GNS\n");
- cleanup_issue_handle (handle);
-}
-
static void
store_ticket_issue_cont (void *cls, int32_t success, const char *emsg)
{
"Error storing AuthZ ticket in GNS");
return;
}
- /* First, local references to tickets */
- handle->ns_qe = GNUNET_NAMESTORE_records_lookup (
- nsh, &handle->identity, GNUNET_GNS_EMPTY_LABEL_AT,
- &ticket_lookup_error_cb, handle, &ticket_lookup_cb, handle);
+ handle->cb (handle->cb_cls, &handle->ticket, GNUNET_OK, NULL);
+ cleanup_issue_handle (handle);
}
struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry *le;
struct GNUNET_GNSRECORD_Data *attrs_record;
char *label;
- size_t list_len = 0;
+ size_t list_len = 1;
int i;
for (le = ih->attrs->list_head; NULL != le; le = le->next)
attrs_record[i].flags = GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION;
i++;
}
+ attrs_record[i].data = &ih->ticket;
+ attrs_record[i].data_size = sizeof (struct GNUNET_RECLAIM_Ticket);
+ attrs_record[i].expiration_time = GNUNET_TIME_UNIT_DAYS.rel_value_us;
+ attrs_record[i].record_type = GNUNET_GNSRECORD_TYPE_RECLAIM_TICKET;
+ attrs_record[i].flags =
+ GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION | GNUNET_GNSRECORD_RF_PRIVATE;
label =
GNUNET_STRINGS_data_to_string_alloc (&ih->ticket.rnd, sizeof (uint64_t));
static void
cleanup_iter (struct RECLAIM_TICKETS_Iterator *iter)
{
- struct TicketReference *tr;
- struct TicketReference *tr_tmp;
- if (NULL != iter->ns_qe)
- GNUNET_NAMESTORE_cancel (iter->ns_qe);
- for (tr = iter->tickets_head; NULL != tr;) {
- if (NULL != tr->attrs)
- GNUNET_RECLAIM_ATTRIBUTE_list_destroy (tr->attrs);
- tr_tmp = tr;
- tr = tr->next;
- GNUNET_free (tr_tmp);
- }
+ if (NULL != iter->ns_it)
+ GNUNET_NAMESTORE_zone_iteration_stop (iter->ns_it);
GNUNET_free (iter);
}
-static void
-do_cleanup_iter (void *cls)
-{
- struct RECLAIM_TICKETS_Iterator *iter = cls;
- cleanup_iter (iter);
-}
-
-/**
- * Perform ticket iteration step
- *
- * @param ti ticket iterator to process
- */
-static void
-run_ticket_iteration_round (struct RECLAIM_TICKETS_Iterator *iter)
-{
- struct TicketReference *tr;
- if (NULL == iter->tickets_head) {
- // No more tickets
- iter->cb (iter->cb_cls, NULL);
- GNUNET_SCHEDULER_add_now (&do_cleanup_iter, iter);
- return;
- }
- tr = iter->tickets_head;
- GNUNET_CONTAINER_DLL_remove (iter->tickets_head, iter->tickets_tail, tr);
- iter->cb (iter->cb_cls, &tr->ticket);
- if (NULL != tr->attrs)
- GNUNET_RECLAIM_ATTRIBUTE_list_destroy (tr->attrs);
- GNUNET_free (tr);
-}
static void
collect_tickets_cb (void *cls, const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
const struct GNUNET_GNSRECORD_Data *rd)
{
struct RECLAIM_TICKETS_Iterator *iter = cls;
- struct TicketReference *tr;
- iter->ns_qe = NULL;
for (int i = 0; i < rd_count; i++) {
- if (GNUNET_GNSRECORD_TYPE_RECLAIM_TICKETREF != rd[i].record_type)
+ if (GNUNET_GNSRECORD_TYPE_RECLAIM_TICKET != rd[i].record_type)
continue;
- tr = GNUNET_new (struct TicketReference);
- memcpy (&tr->ticket, rd[i].data, sizeof (struct GNUNET_RECLAIM_Ticket));
- if (0 != memcmp (&tr->ticket.identity, &iter->identity_pub,
- sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey))) {
- // Not our ticket
- GNUNET_free (tr);
- continue;
- }
- GNUNET_CONTAINER_DLL_insert (iter->tickets_head, iter->tickets_tail, tr);
+ iter->cb (iter->cb_cls, (struct GNUNET_RECLAIM_Ticket *)rd[i].data);
+ return;
}
- run_ticket_iteration_round (iter);
+ GNUNET_NAMESTORE_zone_iterator_next (iter->ns_it, 1);
}
+
+static void
+collect_tickets_finished_cb (void *cls)
+{
+ struct RECLAIM_TICKETS_Iterator *iter = cls;
+ iter->ns_it = NULL;
+ iter->cb (iter->cb_cls, NULL);
+ cleanup_iter (iter);
+}
+
+
static void
collect_tickets_error_cb (void *cls)
{
struct RECLAIM_TICKETS_Iterator *iter = cls;
- iter->ns_qe = NULL;
+ iter->ns_it = NULL;
iter->cb (iter->cb_cls, NULL);
cleanup_iter (iter);
}
+
void
RECLAIM_TICKETS_iteration_next (struct RECLAIM_TICKETS_Iterator *iter)
{
- run_ticket_iteration_round (iter);
+ GNUNET_NAMESTORE_zone_iterator_next (iter->ns_it, 1);
}
+
void
RECLAIM_TICKETS_iteration_stop (struct RECLAIM_TICKETS_Iterator *iter)
{
+ GNUNET_NAMESTORE_zone_iteration_stop (iter->ns_it);
cleanup_iter (iter);
}
+
struct RECLAIM_TICKETS_Iterator *
RECLAIM_TICKETS_iteration_start (
const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity,
struct RECLAIM_TICKETS_Iterator *iter;
iter = GNUNET_new (struct RECLAIM_TICKETS_Iterator);
- iter->identity = *identity;
- GNUNET_CRYPTO_ecdsa_key_get_public (identity, &iter->identity_pub);
iter->cb = cb;
iter->cb_cls = cb_cls;
- iter->ns_qe = GNUNET_NAMESTORE_records_lookup (
- nsh, identity, GNUNET_GNS_EMPTY_LABEL_AT, &collect_tickets_error_cb, iter,
- &collect_tickets_cb, iter);
+ iter->ns_it = GNUNET_NAMESTORE_zone_iteration_start (
+ nsh, identity, &collect_tickets_error_cb, iter, &collect_tickets_cb, iter,
+ &collect_tickets_finished_cb, iter);
return iter;
}
* @param data_size number of bytes in @a data
* @return NULL on error, otherwise human-readable representation of the value
*/
-static char *value_to_string (void *cls, uint32_t type, const void *data,
- size_t data_size)
+static char *
+value_to_string (void *cls, uint32_t type, const void *data, size_t data_size)
{
switch (type) {
case GNUNET_GNSRECORD_TYPE_RECLAIM_ATTR:
case GNUNET_GNSRECORD_TYPE_RECLAIM_OIDC_CLIENT:
return GNUNET_strndup (data, data_size);
case GNUNET_GNSRECORD_TYPE_RECLAIM_ATTR_REF:
- case GNUNET_GNSRECORD_TYPE_RECLAIM_TICKETREF:
+ case GNUNET_GNSRECORD_TYPE_RECLAIM_TICKET:
case GNUNET_GNSRECORD_TYPE_RECLAIM_MASTER:
return GNUNET_STRINGS_data_to_string_alloc (data, data_size);
default:
* @param data_size set to number of bytes in @a data
* @return #GNUNET_OK on success
*/
-static int string_to_value (void *cls, uint32_t type, const char *s,
- void **data, size_t *data_size)
+static int
+string_to_value (void *cls, uint32_t type, const char *s, void **data,
+ size_t *data_size)
{
if (NULL == s)
return GNUNET_SYSERR;
return GNUNET_OK;
case GNUNET_GNSRECORD_TYPE_RECLAIM_ATTR_REF:
case GNUNET_GNSRECORD_TYPE_RECLAIM_MASTER:
- case GNUNET_GNSRECORD_TYPE_RECLAIM_TICKETREF:
+ case GNUNET_GNSRECORD_TYPE_RECLAIM_TICKET:
return GNUNET_STRINGS_string_to_data (s, strlen (s), *data, *data_size);
default:
return GNUNET_SYSERR;
{"RECLAIM_MASTER", GNUNET_GNSRECORD_TYPE_RECLAIM_MASTER},
{"RECLAIM_OIDC_CLIENT", GNUNET_GNSRECORD_TYPE_RECLAIM_OIDC_CLIENT},
{"RECLAIM_OIDC_REDIRECT", GNUNET_GNSRECORD_TYPE_RECLAIM_OIDC_REDIRECT},
- {"RECLAIM_TICKETREF", GNUNET_GNSRECORD_TYPE_RECLAIM_TICKETREF},
+ {"RECLAIM_TICKET", GNUNET_GNSRECORD_TYPE_RECLAIM_TICKET},
{NULL, UINT32_MAX}};
* @param dns_typename name to convert
* @return corresponding number, UINT32_MAX on error
*/
-static uint32_t typename_to_number (void *cls, const char *dns_typename)
+static uint32_t
+typename_to_number (void *cls, const char *dns_typename)
{
unsigned int i;
* @param type number of a type to convert
* @return corresponding typestring, NULL on error
*/
-static const char *number_to_typename (void *cls, uint32_t type)
+static const char *
+number_to_typename (void *cls, uint32_t type)
{
unsigned int i;
* @param cls NULL
* @return the exported block API
*/
-void *libgnunet_plugin_gnsrecord_reclaim_init (void *cls)
+void *
+libgnunet_plugin_gnsrecord_reclaim_init (void *cls)
{
struct GNUNET_GNSRECORD_PluginFunctions *api;
* @param cls the return value from #libgnunet_plugin_block_test_init
* @return NULL
*/
-void *libgnunet_plugin_gnsrecord_reclaim_done (void *cls)
+void *
+libgnunet_plugin_gnsrecord_reclaim_done (void *cls)
{
struct GNUNET_GNSRECORD_PluginFunctions *api = cls;