GNUnet  0.17.6
Data Structures | Typedefs | Functions
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 914 of file gnunet-service-reclaim_tickets.c.

918 {
919  struct RECLAIM_TICKETS_RevokeHandle *rvk;
920  char *label;
921 
923  rvk->cb = cb;
924  rvk->cb_cls = cb_cls;
925  rvk->identity = *identity;
926  rvk->ticket = *ticket;
930  sizeof(ticket->rnd));
931  GNUNET_assert (NULL != label);
933  identity,
934  label,
936  rvk,
938  rvk);
939  GNUNET_free (label);
940  return rvk;
941 }
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:175
#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:764
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 950 of file gnunet-service-reclaim_tickets.c.

951 {
952  GNUNET_assert (NULL != rh);
953  cleanup_rvk (rh);
954 }
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 1186 of file gnunet-service-reclaim_tickets.c.

1190 {
1191  struct RECLAIM_TICKETS_ConsumeHandle *cth;
1192  char *label;
1193 
1195 
1196  cth->identity = *id;
1200  cth->ticket = *ticket;
1201  cth->cb = cb;
1202  cth->cb_cls = cb_cls;
1203  label =
1205  sizeof(cth->ticket.rnd));
1207  "Looking for AuthZ info under %s\n",
1208  label);
1210  cth->lookup_request =
1212  label,
1213  &cth->ticket.identity,
1216  &lookup_authz_cb,
1217  cth);
1218  GNUNET_free (label);
1219  return cth;
1220 }
#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:412
@ GNUNET_GNS_LO_DEFAULT
Defaults, look in cache, then in DHT.
#define GNUNET_log(kind,...)
@ GNUNET_ERROR_TYPE_DEBUG
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get(void)
Get the current time.
Definition: time.c:110
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_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 1229 of file gnunet-service-reclaim_tickets.c.

1230 {
1231  cleanup_cth (cth);
1232  return;
1233 }
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 1626 of file gnunet-service-reclaim_tickets.c.

1631 {
1632  struct TicketIssueHandle *tih;
1633 
1634  tih = GNUNET_new (struct TicketIssueHandle);
1635  tih->cb = cb;
1636  tih->cb_cls = cb_cls;
1639  tih->identity = *identity;
1640  tih->ticket.audience = *audience;
1641 
1642  // First check whether the ticket has already been issued
1643  tih->ns_it =
1645  &tih->identity,
1647  tih,
1649  tih,
1651  tih);
1652 }
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 1742 of file gnunet-service-reclaim_tickets.c.

1743 {
1745 }
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 1754 of file gnunet-service-reclaim_tickets.c.

1755 {
1757  cleanup_iter (iter);
1758 }
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 1770 of file gnunet-service-reclaim_tickets.c.

1774 {
1775  struct RECLAIM_TICKETS_Iterator *iter;
1776 
1777  iter = GNUNET_new (struct RECLAIM_TICKETS_Iterator);
1778  iter->cb = cb;
1779  iter->cb_cls = cb_cls;
1780  iter->ns_it =
1782  identity,
1784  iter,
1786  iter,
1788  iter);
1789  return iter;
1790 }
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 i...
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 1800 of file gnunet-service-reclaim_tickets.c.

1801 {
1802  // Get ticket expiration time (relative) from config
1803  if (GNUNET_OK ==
1805  "reclaim",
1806  "TICKET_REFRESH_INTERVAL",
1808  {
1810  "Configured refresh interval for tickets: %s\n",
1812  GNUNET_YES));
1813  }
1814  else
1815  {
1817  }
1818  // Connect to identity and namestore services
1820  if (NULL == nsh)
1821  {
1823  "error connecting to namestore");
1824  return GNUNET_SYSERR;
1825  }
1826  gns = GNUNET_GNS_connect (c);
1827  if (NULL == gns)
1828  {
1829  GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "error connecting to gns");
1830  return GNUNET_SYSERR;
1831  }
1832  stats = GNUNET_STATISTICS_create ("reclaim", c);
1833  return GNUNET_OK;
1834 }
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
Definition: gnunet_common.h:99
@ GNUNET_YES
@ GNUNET_SYSERR
Definition: gnunet_common.h:97
#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:570

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 1842 of file gnunet-service-reclaim_tickets.c.

1843 {
1844  if (NULL != nsh)
1846  nsh = NULL;
1847  if (NULL != gns)
1849  gns = NULL;
1850  if (NULL != stats)
1851  {
1853  stats = NULL;
1854  }
1855 }
void GNUNET_GNS_disconnect(struct GNUNET_GNS_Handle *handle)
Shutdown connection with the GNS service.
Definition: gns_api.c:290
@ GNUNET_NO
Definition: gnunet_common.h:98
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: