GNUnet  0.20.0
gnunet-service-reclaim_tickets.h File Reference

reclaim tickets More...

#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_constants.h"
#include "gnunet_gns_service.h"
#include "gnunet_gnsrecord_lib.h"
#include "gnunet_protocols.h"
#include "gnunet_reclaim_lib.h"
#include "gnunet_reclaim_service.h"
#include "gnunet_signatures.h"
#include "gnunet_statistics_service.h"
#include "reclaim.h"
Include dependency graph for gnunet-service-reclaim_tickets.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  TicketRecordsEntry
 List of tickets. More...
 

Typedefs

typedef void(* RECLAIM_TICKETS_TicketIter) (void *cls, struct GNUNET_RECLAIM_Ticket *ticket)
 Continuation called with ticket. More...
 
typedef void(* RECLAIM_TICKETS_TicketResult) (void *cls, struct GNUNET_RECLAIM_Ticket *ticket, struct GNUNET_RECLAIM_PresentationList *presentations, int32_t success, const char *emsg)
 Continuation called with ticket. More...
 
typedef void(* RECLAIM_TICKETS_ConsumeCallback) (void *cls, const struct GNUNET_IDENTITY_PublicKey *identity, const struct GNUNET_RECLAIM_AttributeList *attributes, const struct GNUNET_RECLAIM_PresentationList *presentations, int32_t success, const char *emsg)
 Consume callback. More...
 
typedef void(* RECLAIM_TICKETS_RevokeCallback) (void *cls, int32_t success)
 Revocation callback. More...
 

Functions

struct RECLAIM_TICKETS_RevokeHandleRECLAIM_TICKETS_revoke (const struct GNUNET_RECLAIM_Ticket *ticket, const struct GNUNET_IDENTITY_PrivateKey *identity, RECLAIM_TICKETS_RevokeCallback cb, void *cb_cls)
 Revoke a ticket. More...
 
void RECLAIM_TICKETS_revoke_cancel (struct RECLAIM_TICKETS_RevokeHandle *rh)
 Cancel a revocation. More...
 
struct RECLAIM_TICKETS_ConsumeHandleRECLAIM_TICKETS_consume (const struct GNUNET_IDENTITY_PrivateKey *id, const struct GNUNET_RECLAIM_Ticket *ticket, RECLAIM_TICKETS_ConsumeCallback cb, void *cb_cls)
 Consume a ticket. More...
 
void RECLAIM_TICKETS_consume_cancel (struct RECLAIM_TICKETS_ConsumeHandle *cth)
 Cancel a consume operation. More...
 
void RECLAIM_TICKETS_issue (const struct GNUNET_IDENTITY_PrivateKey *identity, const struct GNUNET_RECLAIM_AttributeList *attrs, const struct GNUNET_IDENTITY_PublicKey *audience, RECLAIM_TICKETS_TicketResult cb, void *cb_cls)
 Issue a new reclaim ticket, thereby authorizing the audience to access the set of provided attributes. More...
 
void RECLAIM_TICKETS_iteration_next (struct RECLAIM_TICKETS_Iterator *iter)
 Continue ticket iteration. More...
 
void RECLAIM_TICKETS_iteration_stop (struct RECLAIM_TICKETS_Iterator *iter)
 Stop a running ticket iteration. More...
 
struct RECLAIM_TICKETS_IteratorRECLAIM_TICKETS_iteration_start (const struct GNUNET_IDENTITY_PrivateKey *identity, RECLAIM_TICKETS_TicketIter cb, void *cb_cls)
 Iterate over all tickets issued by an identity. More...
 
int RECLAIM_TICKETS_init (const struct GNUNET_CONFIGURATION_Handle *c)
 Initialize tickets component. More...
 
void RECLAIM_TICKETS_deinit (void)
 Close handles and clean up. More...
 

Detailed Description

reclaim tickets

Author
Martin Schanzenbach

Definition in file gnunet-service-reclaim_tickets.h.

Typedef Documentation

◆ RECLAIM_TICKETS_TicketIter

typedef void(* RECLAIM_TICKETS_TicketIter) (void *cls, struct GNUNET_RECLAIM_Ticket *ticket)

Continuation called with ticket.

Parameters
clsclosure
ticketthe ticket

Definition at line 106 of file gnunet-service-reclaim_tickets.h.

◆ RECLAIM_TICKETS_TicketResult

typedef void(* RECLAIM_TICKETS_TicketResult) (void *cls, struct GNUNET_RECLAIM_Ticket *ticket, struct GNUNET_RECLAIM_PresentationList *presentations, int32_t success, const char *emsg)

Continuation called with ticket.

Parameters
clsclosure
ticketthe ticket
presentationsnew presentations for ticket (NULL on error)
successGNUNET_SYSERR on failure (including timeout/queue drop/failure to validate) GNUNET_OK on success
emsgNULL on success, otherwise an error message

Definition at line 121 of file gnunet-service-reclaim_tickets.h.

◆ RECLAIM_TICKETS_ConsumeCallback

typedef void(* RECLAIM_TICKETS_ConsumeCallback) (void *cls, const struct GNUNET_IDENTITY_PublicKey *identity, const struct GNUNET_RECLAIM_AttributeList *attributes, const struct GNUNET_RECLAIM_PresentationList *presentations, int32_t success, const char *emsg)

Consume callback.

Parameters
clsclosure
identitythe issuer of the ticket/attributes
attributesattribute list retrieved through ticket
presentationsattribute presentations (may be NULL)
successGNUNET_OK on success
emsgerror message (NULL on success)

Definition at line 139 of file gnunet-service-reclaim_tickets.h.

◆ RECLAIM_TICKETS_RevokeCallback

typedef void(* RECLAIM_TICKETS_RevokeCallback) (void *cls, int32_t success)

Revocation callback.

Parameters
clsclosure
successGNUNET_OK on success

Definition at line 154 of file gnunet-service-reclaim_tickets.h.

Function Documentation

◆ RECLAIM_TICKETS_revoke()

struct RECLAIM_TICKETS_RevokeHandle* RECLAIM_TICKETS_revoke ( const struct GNUNET_RECLAIM_Ticket ticket,
const struct GNUNET_IDENTITY_PrivateKey identity,
RECLAIM_TICKETS_RevokeCallback  cb,
void *  cb_cls 
)

Revoke a ticket.

We start by looking up attribute references in order to change attribute IDs.

Parameters
ticketticket to revoke
identityprivate key of issuer
cbrevocation status callback
cb_clscallback closure
Returns
handle to the operation

Get shared attributes

Definition at line 910 of file gnunet-service-reclaim_tickets.c.

914 {
915  struct RECLAIM_TICKETS_RevokeHandle *rvk;
916  char *label;
917 
919  rvk->cb = cb;
920  rvk->cb_cls = cb_cls;
921  rvk->identity = *identity;
922  rvk->ticket = *ticket;
926  sizeof(ticket->rnd));
927  GNUNET_assert (NULL != label);
929  identity,
930  label,
932  rvk,
934  rvk);
935  GNUNET_free (label);
936  return rvk;
937 }
static struct GNUNET_IDENTITY_Handle * identity
Which namespace do we publish to? NULL if we do not publish to a namespace.
static struct GNUNET_RECLAIM_Ticket ticket
Ticket to consume.
static void revoke_attrs_cb(void *cls, const struct GNUNET_IDENTITY_PrivateKey *zone, const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd)
We found the attribute references.
static struct GNUNET_NAMESTORE_Handle * nsh
static void rvk_attrs_err_cb(void *cls)
Failed to query namestore.
enum GNUNET_GenericReturnValue GNUNET_IDENTITY_key_get_public(const struct GNUNET_IDENTITY_PrivateKey *privkey, struct GNUNET_IDENTITY_PublicKey *key)
Retrieves the public key representation of a private key.
Definition: identity_api.c:179
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_free(ptr)
Wrapper around free.
struct GNUNET_NAMESTORE_QueueEntry * GNUNET_NAMESTORE_records_lookup(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_IDENTITY_PrivateKey *pkey, const char *label, GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, GNUNET_NAMESTORE_RecordMonitor rm, void *rm_cls)
Lookup an item in the namestore.
char * GNUNET_STRINGS_data_to_string_alloc(const void *buf, size_t size)
Return the base32crockford encoding of the given buffer.
Definition: strings.c:763
struct GNUNET_RECLAIM_Identifier rnd
The ticket random identifier.
struct GNUNET_IDENTITY_PublicKey identity
The ticket issuer (= the user)
Ticket revocation request handle.
struct GNUNET_RECLAIM_Ticket ticket
Ticket to issue.
struct GNUNET_IDENTITY_PrivateKey identity
Issuer Key.
RECLAIM_TICKETS_RevokeCallback cb
Callback.
struct GNUNET_NAMESTORE_QueueEntry * ns_qe
QueueEntry.

References RECLAIM_TICKETS_RevokeHandle::cb, RECLAIM_TICKETS_RevokeHandle::cb_cls, GNUNET_assert, GNUNET_free, GNUNET_IDENTITY_key_get_public(), GNUNET_NAMESTORE_records_lookup(), GNUNET_new, GNUNET_STRINGS_data_to_string_alloc(), identity, GNUNET_RECLAIM_Ticket::identity, RECLAIM_TICKETS_RevokeHandle::identity, RECLAIM_TICKETS_RevokeHandle::ns_qe, nsh, revoke_attrs_cb(), GNUNET_RECLAIM_Ticket::rnd, rvk_attrs_err_cb(), ticket, and RECLAIM_TICKETS_RevokeHandle::ticket.

Referenced by handle_revoke_ticket_message().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RECLAIM_TICKETS_revoke_cancel()

void RECLAIM_TICKETS_revoke_cancel ( struct RECLAIM_TICKETS_RevokeHandle rh)

Cancel a revocation.

Parameters
rhhandle to the operation

Definition at line 946 of file gnunet-service-reclaim_tickets.c.

947 {
948  GNUNET_assert (NULL != rh);
949  cleanup_rvk (rh);
950 }
static void cleanup_rvk(struct RECLAIM_TICKETS_RevokeHandle *rh)
Cleanup revoke handle.

References cleanup_rvk(), and GNUNET_assert.

Referenced by cleanup_client().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RECLAIM_TICKETS_consume()

struct RECLAIM_TICKETS_ConsumeHandle* RECLAIM_TICKETS_consume ( const struct GNUNET_IDENTITY_PrivateKey id,
const struct GNUNET_RECLAIM_Ticket ticket,
RECLAIM_TICKETS_ConsumeCallback  cb,
void *  cb_cls 
)

Consume a ticket.

We first looking attribute references under the label ticket.rnd in GNS.

Parameters
idthe audience of the ticket
ticketthe ticket to consume
cbcallback to call with attributes of ticket
cb_clscallback closure
Returns
handle to the operation

Definition at line 1182 of file gnunet-service-reclaim_tickets.c.

1186 {
1187  struct RECLAIM_TICKETS_ConsumeHandle *cth;
1188  char *label;
1189 
1191 
1192  cth->identity = *id;
1196  cth->ticket = *ticket;
1197  cth->cb = cb;
1198  cth->cb_cls = cb_cls;
1199  label =
1201  sizeof(cth->ticket.rnd));
1204  "Looking for AuthZ info under %s in %s\n",
1205  label, str);
1206  GNUNET_free (str);
1208  cth->lookup_request =
1210  label,
1211  &cth->ticket.identity,
1214  &lookup_authz_cb,
1215  cth);
1216  GNUNET_free (label);
1217  return cth;
1218 }
#define GNUNET_GNSRECORD_TYPE_RECLAIM_ATTRIBUTE_REF
for reclaim records
static struct GNUNET_IDENTITY_Handle * id
Handle to identity service.
static struct GNUNET_GNS_Handle * gns
static void lookup_authz_cb(void *cls, uint32_t rd_count, const struct GNUNET_GNSRECORD_Data *rd)
GNS result with attribute references.
struct GNUNET_GNS_LookupRequest * GNUNET_GNS_lookup(struct GNUNET_GNS_Handle *handle, const char *name, const struct GNUNET_IDENTITY_PublicKey *zone, uint32_t type, enum GNUNET_GNS_LocalOptions options, GNUNET_GNS_LookupResultProcessor proc, void *proc_cls)
Perform an asynchronous lookup operation on the GNS.
Definition: gns_api.c:422
@ GNUNET_GNS_LO_DEFAULT
Defaults, look in cache, then in DHT.
char * GNUNET_IDENTITY_public_key_to_string(const struct GNUNET_IDENTITY_PublicKey *key)
Creates a (Base32) string representation of the public key.
#define GNUNET_log(kind,...)
@ GNUNET_ERROR_TYPE_DEBUG
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get(void)
Get the current time.
Definition: time.c:111
A list of GNUNET_RECLAIM_Attribute structures.
A list of GNUNET_RECLAIM_Presentation structures.
RECLAIM_TICKETS_ConsumeCallback cb
Callback.
struct GNUNET_IDENTITY_PublicKey identity_pub
Audience Key.
struct GNUNET_GNS_LookupRequest * lookup_request
LookupRequest.
struct GNUNET_TIME_Absolute lookup_start_time
Lookup time.
struct GNUNET_RECLAIM_AttributeList * attrs
Attributes.
struct GNUNET_RECLAIM_Ticket ticket
Ticket.
struct GNUNET_RECLAIM_PresentationList * presentations
Presentations.
struct GNUNET_IDENTITY_PrivateKey identity
Audience Key.

References RECLAIM_TICKETS_ConsumeHandle::attrs, RECLAIM_TICKETS_ConsumeHandle::cb, RECLAIM_TICKETS_ConsumeHandle::cb_cls, gns, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_GNS_LO_DEFAULT, GNUNET_GNS_lookup(), GNUNET_GNSRECORD_TYPE_RECLAIM_ATTRIBUTE_REF, GNUNET_IDENTITY_key_get_public(), GNUNET_IDENTITY_public_key_to_string(), GNUNET_log, GNUNET_new, GNUNET_STRINGS_data_to_string_alloc(), GNUNET_TIME_absolute_get(), id, GNUNET_RECLAIM_Ticket::identity, RECLAIM_TICKETS_ConsumeHandle::identity, RECLAIM_TICKETS_ConsumeHandle::identity_pub, lookup_authz_cb(), RECLAIM_TICKETS_ConsumeHandle::lookup_request, RECLAIM_TICKETS_ConsumeHandle::lookup_start_time, RECLAIM_TICKETS_ConsumeHandle::presentations, GNUNET_RECLAIM_Ticket::rnd, ticket, and RECLAIM_TICKETS_ConsumeHandle::ticket.

Referenced by handle_consume_ticket_message().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RECLAIM_TICKETS_consume_cancel()

void RECLAIM_TICKETS_consume_cancel ( struct RECLAIM_TICKETS_ConsumeHandle cth)

Cancel a consume operation.

Parameters
cththe operation to cancel

Definition at line 1227 of file gnunet-service-reclaim_tickets.c.

1228 {
1229  cleanup_cth (cth);
1230  return;
1231 }
static void cleanup_cth(struct RECLAIM_TICKETS_ConsumeHandle *cth)
Cleanup ticket consume handle.

References cleanup_cth().

Referenced by cleanup_client().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RECLAIM_TICKETS_issue()

void RECLAIM_TICKETS_issue ( const struct GNUNET_IDENTITY_PrivateKey identity,
const struct GNUNET_RECLAIM_AttributeList attrs,
const struct GNUNET_IDENTITY_PublicKey audience,
RECLAIM_TICKETS_TicketResult  cb,
void *  cb_cls 
)

Issue a new reclaim ticket, thereby authorizing the audience to access the set of provided attributes.

Parameters
identitythe issuer
attrsthe attributes to share
audiencethe audience to share the attributes with
cbthe callback to call with the ticket result
cb_clsthe callback closure FIXME: Return handle??

Definition at line 1652 of file gnunet-service-reclaim_tickets.c.

1657 {
1658  struct TicketIssueHandle *tih;
1659 
1660  tih = GNUNET_new (struct TicketIssueHandle);
1661  tih->cb = cb;
1662  tih->cb_cls = cb_cls;
1665  tih->identity = *identity;
1666  tih->ticket.audience = *audience;
1667 
1668  // First check whether the ticket has already been issued
1669  tih->ns_it =
1671  &tih->identity,
1673  tih,
1675  tih,
1677  tih);
1678 }
static void filter_tickets_finished_cb(void *cls)
Done iterating over tickets and we apparently did not find an existing, matching ticket.
static void filter_tickets_error_cb(void *cls)
Namestore error on issue.
static void filter_tickets_cb(void *cls, const struct GNUNET_IDENTITY_PrivateKey *zone, const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd)
Iterator over records.
struct GNUNET_NAMESTORE_ZoneIterator * GNUNET_NAMESTORE_zone_iteration_start(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_IDENTITY_PrivateKey *zone, GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, GNUNET_NAMESTORE_RecordMonitor proc, void *proc_cls, GNUNET_SCHEDULER_TaskCallback finish_cb, void *finish_cb_cls)
struct GNUNET_RECLAIM_AttributeList * GNUNET_RECLAIM_attribute_list_dup(const struct GNUNET_RECLAIM_AttributeList *attrs)
Make a (deep) copy of a claim list.
struct GNUNET_IDENTITY_PublicKey audience
The ticket audience (= relying party)
Ticket issue request handle.
struct GNUNET_RECLAIM_AttributeList * attrs
Attributes to issue.
struct GNUNET_NAMESTORE_ZoneIterator * ns_it
Namestore Iterator.
struct GNUNET_RECLAIM_PresentationList * presentations
Presentations to add.
RECLAIM_TICKETS_TicketResult cb
Callback.
struct GNUNET_IDENTITY_PrivateKey identity
Issuer Key.
struct GNUNET_RECLAIM_Ticket ticket
Ticket to issue.

References TicketIssueHandle::attrs, GNUNET_RECLAIM_Ticket::audience, TicketIssueHandle::cb, TicketIssueHandle::cb_cls, filter_tickets_cb(), filter_tickets_error_cb(), filter_tickets_finished_cb(), GNUNET_NAMESTORE_zone_iteration_start(), GNUNET_new, GNUNET_RECLAIM_attribute_list_dup(), identity, TicketIssueHandle::identity, TicketIssueHandle::ns_it, nsh, TicketIssueHandle::presentations, and TicketIssueHandle::ticket.

Referenced by handle_issue_ticket_message().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RECLAIM_TICKETS_iteration_next()

void RECLAIM_TICKETS_iteration_next ( struct RECLAIM_TICKETS_Iterator iter)

Continue ticket iteration.

Parameters
iterthe iteration to continue

Definition at line 1781 of file gnunet-service-reclaim_tickets.c.

1782 {
1784 }
void GNUNET_NAMESTORE_zone_iterator_next(struct GNUNET_NAMESTORE_ZoneIterator *it, uint64_t limit)
Calls the record processor specified in GNUNET_NAMESTORE_zone_iteration_start for the next record.
struct GNUNET_NAMESTORE_ZoneIterator * ns_it
Namestore queue entry.

References GNUNET_NAMESTORE_zone_iterator_next(), and RECLAIM_TICKETS_Iterator::ns_it.

Referenced by handle_ticket_iteration_next().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RECLAIM_TICKETS_iteration_stop()

void RECLAIM_TICKETS_iteration_stop ( struct RECLAIM_TICKETS_Iterator iter)

Stop a running ticket iteration.

Parameters
iteriteration to cancel

Definition at line 1793 of file gnunet-service-reclaim_tickets.c.

1794 {
1796  cleanup_iter (iter);
1797 }
static void cleanup_iter(struct RECLAIM_TICKETS_Iterator *iter)
Cleanup ticket iterator.
void GNUNET_NAMESTORE_zone_iteration_stop(struct GNUNET_NAMESTORE_ZoneIterator *it)
Stops iteration and releases the namestore handle for further calls.

References cleanup_iter(), GNUNET_NAMESTORE_zone_iteration_stop(), and RECLAIM_TICKETS_Iterator::ns_it.

Referenced by cleanup_client(), and handle_ticket_iteration_stop().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RECLAIM_TICKETS_iteration_start()

struct RECLAIM_TICKETS_Iterator* RECLAIM_TICKETS_iteration_start ( const struct GNUNET_IDENTITY_PrivateKey identity,
RECLAIM_TICKETS_TicketIter  cb,
void *  cb_cls 
)

Iterate over all tickets issued by an identity.

Parameters
identitythe issuing identity
cbticket callback function
cb_clscallback closure
Returns
a handle to the iteration

Definition at line 1809 of file gnunet-service-reclaim_tickets.c.

1813 {
1814  struct RECLAIM_TICKETS_Iterator *iter;
1815 
1816  iter = GNUNET_new (struct RECLAIM_TICKETS_Iterator);
1817  iter->cb = cb;
1818  iter->cb_cls = cb_cls;
1819  iter->ns_it =
1821  identity,
1823  iter,
1825  iter,
1827  iter);
1828  return iter;
1829 }
static void collect_tickets_finished_cb(void *cls)
Signal ticket iteration has finished.
static void collect_tickets_cb(void *cls, const struct GNUNET_IDENTITY_PrivateKey *zone, const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd)
Return each record of type GNUNET_GNSRECORD_TYPE_RECLAIM_TICKET to the caller and proceed with the it...
static void collect_tickets_error_cb(void *cls)
Cancel ticket iteration on namestore error.
RECLAIM_TICKETS_TicketIter cb
Iter callback.

References RECLAIM_TICKETS_Iterator::cb, RECLAIM_TICKETS_Iterator::cb_cls, collect_tickets_cb(), collect_tickets_error_cb(), collect_tickets_finished_cb(), GNUNET_NAMESTORE_zone_iteration_start(), GNUNET_new, identity, RECLAIM_TICKETS_Iterator::ns_it, and nsh.

Referenced by handle_ticket_iteration_start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RECLAIM_TICKETS_init()

int RECLAIM_TICKETS_init ( const struct GNUNET_CONFIGURATION_Handle c)

Initialize tickets component.

Parameters
cthe configuration
Returns
GNUNET_SYSERR on error

Definition at line 1839 of file gnunet-service-reclaim_tickets.c.

1840 {
1841  // Get ticket expiration time (relative) from config
1842  if (GNUNET_OK ==
1844  "reclaim",
1845  "TICKET_REFRESH_INTERVAL",
1847  {
1849  "Configured refresh interval for tickets: %s\n",
1851  GNUNET_YES));
1852  }
1853  else
1854  {
1856  }
1857  // Connect to identity and namestore services
1859  if (NULL == nsh)
1860  {
1862  "error connecting to namestore");
1863  return GNUNET_SYSERR;
1864  }
1865  gns = GNUNET_GNS_connect (c);
1866  if (NULL == gns)
1867  {
1868  GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "error connecting to gns");
1869  return GNUNET_SYSERR;
1870  }
1871  stats = GNUNET_STATISTICS_create ("reclaim", c);
1872  return GNUNET_OK;
1873 }
static struct GNUNET_STATISTICS_Handle * stats
#define DEFAULT_TICKET_REFRESH_INTERVAL
FIXME: the default ticket iteration interval should probably be the minimim attribute expiration.
static struct GNUNET_TIME_Relative ticket_refresh_interval
Ticket expiration interval.
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_value_time(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, struct GNUNET_TIME_Relative *time)
Get a configuration value that should be a relative time.
struct GNUNET_GNS_Handle * GNUNET_GNS_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Initialize the connection with the GNS service.
Definition: gns_api.c:268
@ GNUNET_OK
@ GNUNET_YES
@ GNUNET_SYSERR
#define GNUNET_log_strerror(level, cmd)
Log an error message at log-level 'level' that indicates a failure of the command 'cmd' with the mess...
@ GNUNET_ERROR_TYPE_ERROR
struct GNUNET_NAMESTORE_Handle * GNUNET_NAMESTORE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the namestore service.
struct GNUNET_STATISTICS_Handle * GNUNET_STATISTICS_create(const char *subsystem, const struct GNUNET_CONFIGURATION_Handle *cfg)
Get handle for the statistics service.
const char * GNUNET_STRINGS_relative_time_to_string(struct GNUNET_TIME_Relative delta, int do_round)
Give relative time in human-readable fancy format.
Definition: strings.c:569

References DEFAULT_TICKET_REFRESH_INTERVAL, gns, GNUNET_CONFIGURATION_get_value_time(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_GNS_connect(), GNUNET_log, GNUNET_log_strerror, GNUNET_NAMESTORE_connect(), GNUNET_OK, GNUNET_STATISTICS_create(), GNUNET_STRINGS_relative_time_to_string(), GNUNET_SYSERR, GNUNET_YES, nsh, stats, and ticket_refresh_interval.

Referenced by run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RECLAIM_TICKETS_deinit()

void RECLAIM_TICKETS_deinit ( void  )

Close handles and clean up.

FIXME: cancel all pending operations (gns, ns etc)

Definition at line 1881 of file gnunet-service-reclaim_tickets.c.

1882 {
1883  if (NULL != nsh)
1885  nsh = NULL;
1886  if (NULL != gns)
1888  gns = NULL;
1889  if (NULL != stats)
1890  {
1892  stats = NULL;
1893  }
1894 }
void GNUNET_GNS_disconnect(struct GNUNET_GNS_Handle *handle)
Shutdown connection with the GNS service.
Definition: gns_api.c:290
@ GNUNET_NO
void GNUNET_NAMESTORE_disconnect(struct GNUNET_NAMESTORE_Handle *h)
Disconnect from the namestore service (and free associated resources).
void GNUNET_STATISTICS_destroy(struct GNUNET_STATISTICS_Handle *h, int sync_first)
Destroy a handle (free all state associated with it).

References gns, GNUNET_GNS_disconnect(), GNUNET_NAMESTORE_disconnect(), GNUNET_NO, GNUNET_STATISTICS_destroy(), nsh, and stats.

Referenced by cleanup().

Here is the call graph for this function:
Here is the caller graph for this function: