GNUnet 0.21.1
gnunet-service-reclaim_tickets.h File Reference
#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_CRYPTO_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_CRYPTO_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_CRYPTO_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_CRYPTO_PrivateKey *identity, const struct GNUNET_RECLAIM_AttributeList *attrs, const struct GNUNET_CRYPTO_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_CRYPTO_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...
 

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

913{
915 char *label;
916
918 rvk->cb = cb;
919 rvk->cb_cls = cb_cls;
920 rvk->identity = *identity;
921 rvk->ticket = *ticket;
925 sizeof(ticket->rnd));
926 GNUNET_assert (NULL != label);
928 identity,
929 label,
931 rvk,
933 rvk);
934 GNUNET_free (label);
935 return rvk;
936}
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_CRYPTO_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_CRYPTO_key_get_public(const struct GNUNET_CRYPTO_PrivateKey *privkey, struct GNUNET_CRYPTO_PublicKey *key)
Retrieves the public key representation of a private key.
Definition: crypto_pkey.c:602
#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_CRYPTO_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_CRYPTO_PublicKey identity
The ticket issuer (= the user)
Ticket revocation request handle.
struct GNUNET_RECLAIM_Ticket ticket
Ticket to issue.
RECLAIM_TICKETS_RevokeCallback cb
Callback.
struct GNUNET_CRYPTO_PrivateKey identity
Issuer Key.
struct GNUNET_NAMESTORE_QueueEntry * ns_qe
QueueEntry.

References RECLAIM_TICKETS_RevokeHandle::cb, RECLAIM_TICKETS_RevokeHandle::cb_cls, GNUNET_assert, GNUNET_CRYPTO_key_get_public(), GNUNET_free, 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 945 of file gnunet-service-reclaim_tickets.c.

946{
947 GNUNET_assert (NULL != rh);
948 cleanup_rvk (rh);
949}
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_CRYPTO_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 1181 of file gnunet-service-reclaim_tickets.c.

1185{
1187 char *label;
1188
1190
1191 cth->identity = *id;
1195 cth->ticket = *ticket;
1196 cth->cb = cb;
1197 cth->cb_cls = cb_cls;
1198 label =
1200 sizeof(cth->ticket.rnd));
1203 "Looking for AuthZ info under %s in %s\n",
1204 label, str);
1205 GNUNET_free (str);
1207 cth->lookup_request =
1209 label,
1210 &cth->ticket.identity,
1214 cth);
1215 GNUNET_free (label);
1216 return cth;
1217}
static struct GNUNET_IDENTITY_Handle * id
Handle to IDENTITY.
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_CRYPTO_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:421
@ GNUNET_GNS_LO_DEFAULT
Defaults, look in cache, then in DHT.
#define GNUNET_log(kind,...)
char * GNUNET_CRYPTO_public_key_to_string(const struct GNUNET_CRYPTO_PublicKey *key)
Creates a (Base32) string representation of the public key.
Definition: crypto_pkey.c:551
@ GNUNET_ERROR_TYPE_DEBUG
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get(void)
Get the current time.
Definition: time.c:111
#define GNUNET_GNSRECORD_TYPE_RECLAIM_ATTRIBUTE_REF
for reclaim records
A list of GNUNET_RECLAIM_Attribute structures.
A list of GNUNET_RECLAIM_Presentation structures.
RECLAIM_TICKETS_ConsumeCallback cb
Callback.
struct GNUNET_GNS_LookupRequest * lookup_request
LookupRequest.
struct GNUNET_CRYPTO_PublicKey identity_pub
Audience Key.
struct GNUNET_TIME_Absolute lookup_start_time
Lookup time.
struct GNUNET_RECLAIM_AttributeList * attrs
Attributes.
struct GNUNET_RECLAIM_Ticket ticket
Ticket.
struct GNUNET_CRYPTO_PrivateKey identity
Audience Key.
struct GNUNET_RECLAIM_PresentationList * presentations
Presentations.

References RECLAIM_TICKETS_ConsumeHandle::attrs, RECLAIM_TICKETS_ConsumeHandle::cb, RECLAIM_TICKETS_ConsumeHandle::cb_cls, gns, GNUNET_CRYPTO_key_get_public(), GNUNET_CRYPTO_public_key_to_string(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_GNS_LO_DEFAULT, GNUNET_GNS_lookup(), GNUNET_GNSRECORD_TYPE_RECLAIM_ATTRIBUTE_REF, 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 1226 of file gnunet-service-reclaim_tickets.c.

1227{
1228 cleanup_cth (cth);
1229 return;
1230}
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_CRYPTO_PrivateKey identity,
const struct GNUNET_RECLAIM_AttributeList attrs,
const struct GNUNET_CRYPTO_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 1651 of file gnunet-service-reclaim_tickets.c.

1656{
1657 struct TicketIssueHandle *tih;
1658
1659 tih = GNUNET_new (struct TicketIssueHandle);
1660 tih->cb = cb;
1661 tih->cb_cls = cb_cls;
1664 tih->identity = *identity;
1665 tih->ticket.audience = *audience;
1666
1667 // First check whether the ticket has already been issued
1668 tih->ns_it =
1670 &tih->identity,
1672 tih,
1674 tih,
1676 tih);
1677}
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_cb(void *cls, const struct GNUNET_CRYPTO_PrivateKey *zone, const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd)
Iterator over records.
static void filter_tickets_error_cb(void *cls)
Namestore error on issue.
struct GNUNET_NAMESTORE_ZoneIterator * GNUNET_NAMESTORE_zone_iteration_start(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_CRYPTO_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_CRYPTO_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_CRYPTO_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 1780 of file gnunet-service-reclaim_tickets.c.

1781{
1783}
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 1792 of file gnunet-service-reclaim_tickets.c.

1793{
1795 cleanup_iter (iter);
1796}
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_CRYPTO_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 1808 of file gnunet-service-reclaim_tickets.c.

1812{
1813 struct RECLAIM_TICKETS_Iterator *iter;
1814
1815 iter = GNUNET_new (struct RECLAIM_TICKETS_Iterator);
1816 iter->cb = cb;
1817 iter->cb_cls = cb_cls;
1818 iter->ns_it =
1820 identity,
1822 iter,
1824 iter,
1826 iter);
1827 return iter;
1828}
static void collect_tickets_finished_cb(void *cls)
Signal ticket iteration has finished.
static void collect_tickets_error_cb(void *cls)
Cancel ticket iteration on namestore error.
static void collect_tickets_cb(void *cls, const struct GNUNET_CRYPTO_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...
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 1838 of file gnunet-service-reclaim_tickets.c.

1839{
1840 // Get ticket expiration time (relative) from config
1841 if (GNUNET_OK ==
1843 "reclaim",
1844 "TICKET_REFRESH_INTERVAL",
1846 {
1848 "Configured refresh interval for tickets: %s\n",
1850 GNUNET_YES));
1851 }
1852 else
1853 {
1855 }
1856 // Connect to identity and namestore services
1858 if (NULL == nsh)
1859 {
1861 "error connecting to namestore");
1862 return GNUNET_SYSERR;
1863 }
1864 gns = GNUNET_GNS_connect (c);
1865 if (NULL == gns)
1866 {
1867 GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "error connecting to gns");
1868 return GNUNET_SYSERR;
1869 }
1870 stats = GNUNET_STATISTICS_create ("reclaim", c);
1871 return GNUNET_OK;
1872}
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:267
@ 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: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 1880 of file gnunet-service-reclaim_tickets.c.

1881{
1882 if (NULL != nsh)
1884 nsh = NULL;
1885 if (NULL != gns)
1887 gns = NULL;
1888 if (NULL != stats)
1889 {
1891 stats = NULL;
1892 }
1893}
void GNUNET_GNS_disconnect(struct GNUNET_GNS_Handle *handle)
Shutdown connection with the GNS service.
Definition: gns_api.c:289
@ 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: