GNUnet  0.11.x
Data Structures | Macros | Typedefs | Functions
service

Data Structures

struct  GNUNET_RECLAIM_Ticket
 The authorization ticket. More...
 

Macros

#define GNUNET_RECLAIM_VERSION   0x00000001
 Version number of the re:claimID API. More...
 

Typedefs

typedef void(* GNUNET_RECLAIM_TicketCallback) (void *cls, const struct GNUNET_RECLAIM_Ticket *ticket)
 Method called when a token has been issued. More...
 
typedef void(* GNUNET_RECLAIM_ContinuationWithStatus) (void *cls, int32_t success, const char *emsg)
 Continuation called to notify client about result of the operation. More...
 
typedef void(* GNUNET_RECLAIM_AttributeResult) (void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr)
 Callback used to notify the client of attribute results. More...
 

Functions

struct GNUNET_RECLAIM_HandleGNUNET_RECLAIM_connect (const struct GNUNET_CONFIGURATION_Handle *cfg)
 Connect to the re:claimID service. More...
 
struct GNUNET_RECLAIM_OperationGNUNET_RECLAIM_attribute_store (struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr, const struct GNUNET_TIME_Relative *exp_interval, GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls)
 Store an attribute. More...
 
struct GNUNET_RECLAIM_OperationGNUNET_RECLAIM_attribute_delete (struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr, GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls)
 Delete an attribute. More...
 
struct GNUNET_RECLAIM_AttributeIteratorGNUNET_RECLAIM_get_attributes_start (struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, GNUNET_RECLAIM_AttributeResult proc, void *proc_cls, GNUNET_SCHEDULER_TaskCallback finish_cb, void *finish_cb_cls)
 List all attributes for a local identity. More...
 
void GNUNET_RECLAIM_get_attributes_next (struct GNUNET_RECLAIM_AttributeIterator *it)
 Calls the record processor specified in GNUNET_RECLAIM_get_attributes_start for the next record. More...
 
void GNUNET_RECLAIM_get_attributes_stop (struct GNUNET_RECLAIM_AttributeIterator *it)
 Stops iteration and releases the handle for further calls. More...
 
struct GNUNET_RECLAIM_OperationGNUNET_RECLAIM_ticket_issue (struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *iss, const struct GNUNET_CRYPTO_EcdsaPublicKey *rp, const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs, GNUNET_RECLAIM_TicketCallback cb, void *cb_cls)
 Issues a ticket to a relying party. More...
 
struct GNUNET_RECLAIM_OperationGNUNET_RECLAIM_ticket_revoke (struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, const struct GNUNET_RECLAIM_Ticket *ticket, GNUNET_RECLAIM_ContinuationWithStatus cb, void *cb_cls)
 Revoked an issued ticket. More...
 
struct GNUNET_RECLAIM_OperationGNUNET_RECLAIM_ticket_consume (struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, const struct GNUNET_RECLAIM_Ticket *ticket, GNUNET_RECLAIM_AttributeResult cb, void *cb_cls)
 Consumes an issued ticket. More...
 
struct GNUNET_RECLAIM_TicketIteratorGNUNET_RECLAIM_ticket_iteration_start (struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, GNUNET_RECLAIM_TicketCallback proc, void *proc_cls, GNUNET_SCHEDULER_TaskCallback finish_cb, void *finish_cb_cls)
 Lists all tickets that have been issued to remote identites (relying parties) More...
 
void GNUNET_RECLAIM_ticket_iteration_next (struct GNUNET_RECLAIM_TicketIterator *it)
 Calls the ticket processor specified in GNUNET_RECLAIM_ticket_iteration_start for the next record. More...
 
void GNUNET_RECLAIM_ticket_iteration_stop (struct GNUNET_RECLAIM_TicketIterator *it)
 Stops iteration and releases the handle for further calls. More...
 
void GNUNET_RECLAIM_disconnect (struct GNUNET_RECLAIM_Handle *h)
 Disconnect from identity provider service. More...
 
void GNUNET_RECLAIM_cancel (struct GNUNET_RECLAIM_Operation *op)
 Cancel an identity provider operation. More...
 

Detailed Description

Macro Definition Documentation

◆ GNUNET_RECLAIM_VERSION

#define GNUNET_RECLAIM_VERSION   0x00000001

Version number of the re:claimID API.

Definition at line 47 of file gnunet_reclaim_service.h.

Typedef Documentation

◆ GNUNET_RECLAIM_TicketCallback

typedef void(* GNUNET_RECLAIM_TicketCallback) (void *cls, const struct GNUNET_RECLAIM_Ticket *ticket)

Method called when a token has been issued.

On success returns a ticket that can be given to a relying party in order for it retrive identity attributes

Parameters
clsclosure
ticketthe ticket

Definition at line 94 of file gnunet_reclaim_service.h.

◆ GNUNET_RECLAIM_ContinuationWithStatus

typedef void(* GNUNET_RECLAIM_ContinuationWithStatus) (void *cls, int32_t success, const char *emsg)

Continuation called to notify client about result of the operation.

Parameters
clsThe callback closure
successGNUNET_SYSERR on failure
emsgNULL on success, otherwise an error message

Definition at line 106 of file gnunet_reclaim_service.h.

◆ GNUNET_RECLAIM_AttributeResult

typedef void(* GNUNET_RECLAIM_AttributeResult) (void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr)

Callback used to notify the client of attribute results.

Parameters
clsThe callback closure
identityThe identity authoritative over the attributes
attrThe attribute

Definition at line 118 of file gnunet_reclaim_service.h.

Function Documentation

◆ GNUNET_RECLAIM_connect()

struct GNUNET_RECLAIM_Handle* GNUNET_RECLAIM_connect ( const struct GNUNET_CONFIGURATION_Handle cfg)

Connect to the re:claimID service.

Parameters
cfgConfiguration to contact the re:claimID service.
Returns
handle to communicate with the service

Connect to the re:claimID service.

Parameters
cfgthe configuration to use
Returns
handle to use

Definition at line 779 of file reclaim_api.c.

References cfg, GNUNET_RECLAIM_Handle::cfg, GNUNET_free, GNUNET_new, GNUNET_RECLAIM_Operation::h, GNUNET_RECLAIM_Handle::mq, and reconnect().

Referenced by add_attribute_cont(), code_redirect(), consume_ticket_cont(), delete_attribute_cont(), list_attribute_cont(), list_tickets_cont(), revoke_ticket_cont(), run(), and userinfo_endpoint().

780 {
781  struct GNUNET_RECLAIM_Handle *h;
782 
783  h = GNUNET_new (struct GNUNET_RECLAIM_Handle);
784  h->cfg = cfg;
785  reconnect (h);
786  if (NULL == h->mq)
787  {
788  GNUNET_free (h);
789  return NULL;
790  }
791  return h;
792 }
Handle to the service.
Definition: reclaim_api.c:235
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
Definition: gnunet-abd.c:36
#define GNUNET_new(type)
Allocate a struct or union of the given type.
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
static void reconnect(struct GNUNET_RECLAIM_Handle *h)
Try again to connect to the service.
Definition: reclaim_api.c:734
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:300
const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration to use.
Definition: reclaim_api.c:240
#define GNUNET_free(ptr)
Wrapper around free.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_RECLAIM_attribute_store()

struct GNUNET_RECLAIM_Operation* GNUNET_RECLAIM_attribute_store ( struct GNUNET_RECLAIM_Handle h,
const struct GNUNET_CRYPTO_EcdsaPrivateKey pkey,
const struct GNUNET_RECLAIM_ATTRIBUTE_Claim attr,
const struct GNUNET_TIME_Relative exp_interval,
GNUNET_RECLAIM_ContinuationWithStatus  cont,
void *  cont_cls 
)

Store an attribute.

If the attribute is already present, it is replaced with the new attribute.

Parameters
hhandle to the reclaim service
pkeyPrivate key of the identity to add an attribute to
attrThe attribute
exp_intervalThe relative expiration interval for the attribute
contContinuation to call when done
cont_clsClosure for cont
Returns
handle Used to to abort the request

If the attribute is already present, it is replaced with the new attribute.

Parameters
hhandle to the re:claimID service
pkeyprivate key of the identity
attrthe attribute value
exp_intervalthe relative expiration interval for the attribute
contcontinuation to call when done
cont_clsclosure for cont
Returns
handle to abort the request

Definition at line 850 of file reclaim_api.c.

References GNUNET_RECLAIM_Operation::as_cb, AttributeStoreMessage::attr_len, GNUNET_RECLAIM_Operation::cls, GNUNET_RECLAIM_Operation::env, AttributeStoreMessage::exp, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_htonll(), GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_STORE, GNUNET_MQ_msg_extra, GNUNET_MQ_send_copy(), GNUNET_new, GNUNET_RECLAIM_ATTRIBUTE_serialize(), GNUNET_RECLAIM_ATTRIBUTE_serialize_get_size(), GNUNET_RECLAIM_Operation::h, AttributeStoreMessage::id, AttributeStoreMessage::identity, GNUNET_RECLAIM_Handle::mq, op, GNUNET_RECLAIM_Handle::op_head, GNUNET_RECLAIM_Handle::op_tail, pkey, GNUNET_RECLAIM_Operation::r_id, GNUNET_RECLAIM_Handle::r_id_gen, and GNUNET_TIME_Relative::rel_value_us.

Referenced by add_attribute_cont(), and iter_finished().

857 {
859  struct AttributeStoreMessage *sam;
860  size_t attr_len;
861 
862  op = GNUNET_new (struct GNUNET_RECLAIM_Operation);
863  op->h = h;
864  op->as_cb = cont;
865  op->cls = cont_cls;
866  op->r_id = h->r_id_gen++;
869  op->env = GNUNET_MQ_msg_extra (sam,
870  attr_len,
872  sam->identity = *pkey;
873  sam->id = htonl (op->r_id);
874  sam->exp = GNUNET_htonll (exp_interval->rel_value_us);
875 
876  GNUNET_RECLAIM_ATTRIBUTE_serialize (attr, (char *) &sam[1]);
877 
878  sam->attr_len = htons (attr_len);
879  if (NULL != h->mq)
880  GNUNET_MQ_send_copy (h->mq, op->env);
881  return op;
882 }
struct GNUNET_CRYPTO_EcdsaPrivateKey identity
Identity.
Definition: reclaim.h:65
struct GNUNET_RECLAIM_Handle * h
Main handle.
Definition: reclaim_api.c:46
uint64_t rel_value_us
The actual value.
static char * pkey
Public key of the zone to look in, in ASCII.
void * cls
Closure for cont or cb.
Definition: reclaim_api.c:97
GNUNET_RECLAIM_ContinuationWithStatus as_cb
Continuation to invoke after attribute store call.
Definition: reclaim_api.c:67
#define GNUNET_new(type)
Allocate a struct or union of the given type.
Handle for an operation with the service.
Definition: reclaim_api.c:41
Use to store an identity attribute.
Definition: reclaim.h:40
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:300
#define GNUNET_MQ_msg_extra(mvar, esize, type)
Allocate an envelope, with extra space allocated after the space needed by the message struct...
Definition: gnunet_mq_lib.h:52
struct GNUNET_RECLAIM_Operation * op_tail
Tail of active operations.
Definition: reclaim_api.c:260
struct GNUNET_MQ_Envelope * env
Envelope with the message for this queue entry.
Definition: reclaim_api.c:87
uint32_t r_id_gen
Request Id generator.
Definition: reclaim_api.c:305
uint32_t attr_len
The length of the attribute.
Definition: reclaim.h:55
#define GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_STORE
uint64_t exp
The expiration interval of the attribute.
Definition: reclaim.h:60
uint64_t GNUNET_htonll(uint64_t n)
Convert unsigned 64-bit integer to network byte order.
Definition: common_endian.c:35
struct GNUNET_RECLAIM_Operation * op_head
Head of active operations.
Definition: reclaim_api.c:255
#define GNUNET_CONTAINER_DLL_insert_tail(head, tail, element)
Insert an element at the tail of a DLL.
size_t GNUNET_RECLAIM_ATTRIBUTE_serialize_get_size(const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr)
Get required size for serialization buffer.
void GNUNET_MQ_send_copy(struct GNUNET_MQ_Handle *mq, const struct GNUNET_MQ_Envelope *ev)
Send a copy of a message with the given message queue.
Definition: mq.c:432
size_t GNUNET_RECLAIM_ATTRIBUTE_serialize(const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr, char *result)
Serialize an attribute.
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:144
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:50
uint32_t r_id
request id
Definition: reclaim_api.c:92
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_RECLAIM_attribute_delete()

struct GNUNET_RECLAIM_Operation* GNUNET_RECLAIM_attribute_delete ( struct GNUNET_RECLAIM_Handle h,
const struct GNUNET_CRYPTO_EcdsaPrivateKey pkey,
const struct GNUNET_RECLAIM_ATTRIBUTE_Claim attr,
GNUNET_RECLAIM_ContinuationWithStatus  cont,
void *  cont_cls 
)

Delete an attribute.

Tickets used to share this attribute are updated accordingly.

Parameters
hhandle to the re:claimID service
pkeyPrivate key of the identity to add an attribute to
attrThe attribute
contContinuation to call when done
cont_clsClosure for cont
Returns
handle Used to to abort the request

Definition at line 897 of file reclaim_api.c.

References GNUNET_RECLAIM_Operation::as_cb, AttributeDeleteMessage::attr_len, GNUNET_RECLAIM_Operation::cls, GNUNET_RECLAIM_Operation::env, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_DELETE, GNUNET_MQ_msg_extra, GNUNET_MQ_send_copy(), GNUNET_new, GNUNET_RECLAIM_ATTRIBUTE_serialize(), GNUNET_RECLAIM_ATTRIBUTE_serialize_get_size(), GNUNET_RECLAIM_Operation::h, AttributeDeleteMessage::id, AttributeDeleteMessage::identity, GNUNET_RECLAIM_Handle::mq, op, GNUNET_RECLAIM_Handle::op_head, GNUNET_RECLAIM_Handle::op_tail, pkey, GNUNET_RECLAIM_Operation::r_id, and GNUNET_RECLAIM_Handle::r_id_gen.

Referenced by delete_attribute_cont(), and iter_finished().

903 {
905  struct AttributeDeleteMessage *dam;
906  size_t attr_len;
907 
908  op = GNUNET_new (struct GNUNET_RECLAIM_Operation);
909  op->h = h;
910  op->as_cb = cont;
911  op->cls = cont_cls;
912  op->r_id = h->r_id_gen++;
915  op->env = GNUNET_MQ_msg_extra (dam,
916  attr_len,
918  dam->identity = *pkey;
919  dam->id = htonl (op->r_id);
920  GNUNET_RECLAIM_ATTRIBUTE_serialize (attr, (char *) &dam[1]);
921 
922  dam->attr_len = htons (attr_len);
923  if (NULL != h->mq)
924  GNUNET_MQ_send_copy (h->mq, op->env);
925  return op;
926 }
struct GNUNET_RECLAIM_Handle * h
Main handle.
Definition: reclaim_api.c:46
static char * pkey
Public key of the zone to look in, in ASCII.
void * cls
Closure for cont or cb.
Definition: reclaim_api.c:97
GNUNET_RECLAIM_ContinuationWithStatus as_cb
Continuation to invoke after attribute store call.
Definition: reclaim_api.c:67
struct GNUNET_CRYPTO_EcdsaPrivateKey identity
Identity.
Definition: reclaim.h:94
Use to delete an identity attribute.
Definition: reclaim.h:74
#define GNUNET_new(type)
Allocate a struct or union of the given type.
uint32_t attr_len
The length of the attribute.
Definition: reclaim.h:89
Handle for an operation with the service.
Definition: reclaim_api.c:41
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:300
#define GNUNET_MQ_msg_extra(mvar, esize, type)
Allocate an envelope, with extra space allocated after the space needed by the message struct...
Definition: gnunet_mq_lib.h:52
struct GNUNET_RECLAIM_Operation * op_tail
Tail of active operations.
Definition: reclaim_api.c:260
struct GNUNET_MQ_Envelope * env
Envelope with the message for this queue entry.
Definition: reclaim_api.c:87
uint32_t r_id_gen
Request Id generator.
Definition: reclaim_api.c:305
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:84
struct GNUNET_RECLAIM_Operation * op_head
Head of active operations.
Definition: reclaim_api.c:255
#define GNUNET_CONTAINER_DLL_insert_tail(head, tail, element)
Insert an element at the tail of a DLL.
size_t GNUNET_RECLAIM_ATTRIBUTE_serialize_get_size(const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr)
Get required size for serialization buffer.
void GNUNET_MQ_send_copy(struct GNUNET_MQ_Handle *mq, const struct GNUNET_MQ_Envelope *ev)
Send a copy of a message with the given message queue.
Definition: mq.c:432
size_t GNUNET_RECLAIM_ATTRIBUTE_serialize(const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr, char *result)
Serialize an attribute.
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:144
#define GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_DELETE
uint32_t r_id
request id
Definition: reclaim_api.c:92
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_RECLAIM_get_attributes_start()

struct GNUNET_RECLAIM_AttributeIterator* GNUNET_RECLAIM_get_attributes_start ( struct GNUNET_RECLAIM_Handle h,
const struct GNUNET_CRYPTO_EcdsaPrivateKey identity,
GNUNET_SCHEDULER_TaskCallback  error_cb,
void *  error_cb_cls,
GNUNET_RECLAIM_AttributeResult  proc,
void *  proc_cls,
GNUNET_SCHEDULER_TaskCallback  finish_cb,
void *  finish_cb_cls 
)

List all attributes for a local identity.

This MUST lock the struct GNUNET_RECLAIM_Handle for any other calls than GNUNET_RECLAIM_get_attributes_next() and GNUNET_RECLAIM_get_attributes_stop. proc will be called once immediately, and then again after GNUNET_RECLAIM_get_attributes_next() is invoked.

On error (disconnect), error_cb will be invoked. On normal completion, finish_cb proc will be invoked.

Parameters
hHandle to the re:claimID service
identityIdentity to iterate over
error_cbFunction to call on error (i.e. disconnect), the handle is afterwards invalid
error_cb_clsClosure for error_cb
procFunction to call on each attribute
proc_clsClosure for proc
finish_cbFunction to call on completion the handle is afterwards invalid
finish_cb_clsClosure for finish_cb
Returns
an iterator Handle to use for iteration

Definition at line 954 of file reclaim_api.c.

References GNUNET_RECLAIM_Operation::env, GNUNET_RECLAIM_AttributeIterator::env, GNUNET_RECLAIM_AttributeIterator::error_cb, error_cb(), GNUNET_RECLAIM_AttributeIterator::error_cb_cls, GNUNET_RECLAIM_AttributeIterator::finish_cb, GNUNET_RECLAIM_AttributeIterator::finish_cb_cls, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_START, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_new, GNUNET_RECLAIM_Operation::h, GNUNET_RECLAIM_AttributeIterator::h, AttributeIterationStartMessage::id, identity, AttributeIterationStartMessage::identity, GNUNET_RECLAIM_AttributeIterator::identity, GNUNET_RECLAIM_Handle::it_head, GNUNET_RECLAIM_Handle::it_tail, GNUNET_RECLAIM_Handle::mq, GNUNET_RECLAIM_Operation::msg, GNUNET_RECLAIM_AttributeIterator::proc, GNUNET_RECLAIM_AttributeIterator::proc_cls, GNUNET_RECLAIM_AttributeIterator::r_id, and GNUNET_RECLAIM_Handle::r_id_gen.

Referenced by code_redirect(), list_attribute_cont(), and start_process().

963 {
965  struct GNUNET_MQ_Envelope *env;
967  uint32_t rid;
968 
969  rid = h->r_id_gen++;
971  it->h = h;
972  it->error_cb = error_cb;
973  it->error_cb_cls = error_cb_cls;
974  it->finish_cb = finish_cb;
975  it->finish_cb_cls = finish_cb_cls;
976  it->proc = proc;
977  it->proc_cls = proc_cls;
978  it->r_id = rid;
979  it->identity = *identity;
981  env =
983  msg->id = htonl (rid);
984  msg->identity = *identity;
985  if (NULL == h->mq)
986  it->env = env;
987  else
988  GNUNET_MQ_send (h->mq, env);
989  return it;
990 }
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
Start a attribute iteration for the given identity.
Definition: reclaim.h:160
static void error_cb(void *cls)
Function called if lookup fails.
Definition: gnunet-abd.c:485
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
Definition: gnunet_mq_lib.h:67
#define GNUNET_new(type)
Allocate a struct or union of the given type.
void * finish_cb_cls
Closure for finish_cb.
Definition: reclaim_api.c:192
GNUNET_SCHEDULER_TaskCallback error_cb
Function to call on errors.
Definition: reclaim_api.c:207
GNUNET_RECLAIM_AttributeResult proc
The continuation to call with the results.
Definition: reclaim_api.c:197
struct GNUNET_RECLAIM_AttributeIterator * it_tail
Tail of active iterations.
Definition: reclaim_api.c:270
void * proc_cls
Closure for proc.
Definition: reclaim_api.c:202
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:300
Handle for a attribute iterator operation.
Definition: reclaim_api.c:167
uint32_t r_id
The operation id this zone iteration operation has.
Definition: reclaim_api.c:228
uint32_t r_id_gen
Request Id generator.
Definition: reclaim_api.c:305
struct GNUNET_CRYPTO_EcdsaPrivateKey identity
Identity.
Definition: reclaim.h:175
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:170
static struct GNUNET_IDENTITY_Handle * identity
Which namespace do we publish to? NULL if we do not publish to a namespace.
struct GNUNET_CRYPTO_EcdsaPrivateKey identity
Private key of the zone.
Definition: reclaim_api.c:223
struct GNUNET_MQ_Envelope * env
Definition: 005.c:1
#define GNUNET_CONTAINER_DLL_insert_tail(head, tail, element)
Insert an element at the tail of a DLL.
#define GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_START
struct GNUNET_MQ_Envelope * env
Envelope of the message to send to the service, if not yet sent.
Definition: reclaim_api.c:218
struct GNUNET_RECLAIM_AttributeIterator * it_head
Head of active iterations.
Definition: reclaim_api.c:265
void * error_cb_cls
Closure for error_cb.
Definition: reclaim_api.c:212
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
Definition: mq.c:353
struct GNUNET_RECLAIM_Handle * h
Main handle to access the service.
Definition: reclaim_api.c:182
GNUNET_SCHEDULER_TaskCallback finish_cb
Function to call on completion.
Definition: reclaim_api.c:187
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_RECLAIM_get_attributes_next()

void GNUNET_RECLAIM_get_attributes_next ( struct GNUNET_RECLAIM_AttributeIterator it)

Calls the record processor specified in GNUNET_RECLAIM_get_attributes_start for the next record.

Parameters
itThe iterator
itthe iterator

Definition at line 1000 of file reclaim_api.c.

References GNUNET_RECLAIM_Operation::env, GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_NEXT, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_RECLAIM_Operation::h, GNUNET_RECLAIM_AttributeIterator::h, AttributeIterationNextMessage::id, GNUNET_RECLAIM_Handle::mq, GNUNET_RECLAIM_Operation::msg, and GNUNET_RECLAIM_AttributeIterator::r_id.

Referenced by attr_collect(), iter_cb(), and oidc_attr_collect().

1001 {
1002  struct GNUNET_RECLAIM_Handle *h = it->h;
1004  struct GNUNET_MQ_Envelope *env;
1005 
1006  env =
1008  msg->id = htonl (it->r_id);
1009  GNUNET_MQ_send (h->mq, env);
1010 }
Handle to the service.
Definition: reclaim_api.c:235
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
Definition: gnunet_mq_lib.h:67
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:300
uint32_t r_id
The operation id this zone iteration operation has.
Definition: reclaim_api.c:228
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:192
Ask for next result of attribute iteration for the given operation.
Definition: reclaim.h:182
struct GNUNET_MQ_Envelope * env
Definition: 005.c:1
#define GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_NEXT
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
Definition: mq.c:353
struct GNUNET_RECLAIM_Handle * h
Main handle to access the service.
Definition: reclaim_api.c:182
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_RECLAIM_get_attributes_stop()

void GNUNET_RECLAIM_get_attributes_stop ( struct GNUNET_RECLAIM_AttributeIterator it)

Stops iteration and releases the handle for further calls.

Must be called on any iteration that has not yet completed prior to calling GNUNET_RECLAIM_disconnect.

Parameters
itthe iterator

Definition at line 1021 of file reclaim_api.c.

References GNUNET_RECLAIM_Operation::env, free_it(), GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_STOP, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_RECLAIM_Operation::h, GNUNET_RECLAIM_AttributeIterator::h, AttributeIterationStopMessage::id, GNUNET_RECLAIM_Handle::mq, GNUNET_RECLAIM_Operation::msg, and GNUNET_RECLAIM_AttributeIterator::r_id.

Referenced by cleanup_handle(), and do_cleanup().

1022 {
1023  struct GNUNET_RECLAIM_Handle *h = it->h;
1024  struct GNUNET_MQ_Envelope *env;
1026 
1027  if (NULL != h->mq)
1028  {
1029  env =
1031  msg->id = htonl (it->r_id);
1032  GNUNET_MQ_send (h->mq, env);
1033  }
1034  free_it (it);
1035 }
Handle to the service.
Definition: reclaim_api.c:235
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
Stop attribute iteration for the given operation.
Definition: reclaim.h:199
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
Definition: gnunet_mq_lib.h:67
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:300
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:209
uint32_t r_id
The operation id this zone iteration operation has.
Definition: reclaim_api.c:228
struct GNUNET_MQ_Envelope * env
Definition: 005.c:1
#define GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_STOP
static void free_it(struct GNUNET_RECLAIM_AttributeIterator *it)
Free it.
Definition: reclaim_api.c:363
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
Definition: mq.c:353
struct GNUNET_RECLAIM_Handle * h
Main handle to access the service.
Definition: reclaim_api.c:182
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_RECLAIM_ticket_issue()

struct GNUNET_RECLAIM_Operation* GNUNET_RECLAIM_ticket_issue ( struct GNUNET_RECLAIM_Handle h,
const struct GNUNET_CRYPTO_EcdsaPrivateKey iss,
const struct GNUNET_CRYPTO_EcdsaPublicKey rp,
const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList attrs,
GNUNET_RECLAIM_TicketCallback  cb,
void *  cb_cls 
)

Issues a ticket to a relying party.

The identity may use GNUNET_RECLAIM_ticket_consume to consume the ticket and retrieve the attributes specified in the attribute list.

Parameters
hthe identity provider to use
issthe issuing identity (= the user)
rpthe subject of the ticket (= the relying party)
attrsthe attributes that the relying party is given access to
cbthe callback
cb_clsthe callback closure
Returns
handle to abort the operation

Issues a ticket to a relying party.

The identity may use to consume the ticket and retrieve the attributes specified in the attribute list.

Parameters
hthe reclaim to use
issthe issuing identity (= the user)
rpthe subject of the ticket (= the relying party)
attrsthe attributes that the relying party is given access to
cbthe callback
cb_clsthe callback closure
Returns
handle to abort the operation

Definition at line 1052 of file reclaim_api.c.

References IssueTicketMessage::attr_len, GNUNET_RECLAIM_Operation::cls, GNUNET_RECLAIM_Operation::env, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_MESSAGE_TYPE_RECLAIM_ISSUE_TICKET, GNUNET_MQ_msg_extra, GNUNET_MQ_send_copy(), GNUNET_new, GNUNET_RECLAIM_ATTRIBUTE_list_serialize(), GNUNET_RECLAIM_ATTRIBUTE_list_serialize_get_size(), GNUNET_RECLAIM_Operation::h, IssueTicketMessage::id, IssueTicketMessage::identity, GNUNET_RECLAIM_Handle::mq, op, GNUNET_RECLAIM_Handle::op_head, GNUNET_RECLAIM_Handle::op_tail, GNUNET_RECLAIM_Operation::r_id, GNUNET_RECLAIM_Handle::r_id_gen, rp, IssueTicketMessage::rp, and GNUNET_RECLAIM_Operation::tr_cb.

Referenced by iter_finished(), and oidc_collect_finished_cb().

1059 {
1060  struct GNUNET_RECLAIM_Operation *op;
1061  struct IssueTicketMessage *tim;
1062  size_t attr_len;
1063 
1064  fprintf (stderr, "Issuing ticket\n");
1065  op = GNUNET_new (struct GNUNET_RECLAIM_Operation);
1066  op->h = h;
1067  op->tr_cb = cb;
1068  op->cls = cb_cls;
1069  op->r_id = h->r_id_gen++;
1072  op->env = GNUNET_MQ_msg_extra (tim,
1073  attr_len,
1075  tim->identity = *iss;
1076  tim->rp = *rp;
1077  tim->id = htonl (op->r_id);
1078 
1079  GNUNET_RECLAIM_ATTRIBUTE_list_serialize (attrs, (char *) &tim[1]);
1080 
1081  tim->attr_len = htons (attr_len);
1082  if (NULL != h->mq)
1083  GNUNET_MQ_send_copy (h->mq, op->env);
1084  return op;
1085 }
#define GNUNET_MESSAGE_TYPE_RECLAIM_ISSUE_TICKET
struct GNUNET_CRYPTO_EcdsaPublicKey rp
Requesting party.
Definition: reclaim.h:291
struct GNUNET_RECLAIM_Handle * h
Main handle.
Definition: reclaim_api.c:46
void * cls
Closure for cont or cb.
Definition: reclaim_api.c:97
#define GNUNET_new(type)
Allocate a struct or union of the given type.
Handle for an operation with the service.
Definition: reclaim_api.c:41
struct GNUNET_CRYPTO_EcdsaPrivateKey identity
Identity.
Definition: reclaim.h:286
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:300
#define GNUNET_MQ_msg_extra(mvar, esize, type)
Allocate an envelope, with extra space allocated after the space needed by the message struct...
Definition: gnunet_mq_lib.h:52
struct GNUNET_RECLAIM_Operation * op_tail
Tail of active operations.
Definition: reclaim_api.c:260
struct GNUNET_MQ_Envelope * env
Envelope with the message for this queue entry.
Definition: reclaim_api.c:87
uint32_t r_id_gen
Request Id generator.
Definition: reclaim_api.c:305
Ticket issue message.
Definition: reclaim.h:271
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:281
uint32_t attr_len
length of serialized attribute list
Definition: reclaim.h:296
GNUNET_RECLAIM_TicketCallback tr_cb
Ticket result callback.
Definition: reclaim_api.c:82
struct GNUNET_RECLAIM_Operation * op_head
Head of active operations.
Definition: reclaim_api.c:255
#define GNUNET_CONTAINER_DLL_insert_tail(head, tail, element)
Insert an element at the tail of a DLL.
void GNUNET_MQ_send_copy(struct GNUNET_MQ_Handle *mq, const struct GNUNET_MQ_Envelope *ev)
Send a copy of a message with the given message queue.
Definition: mq.c:432
static char * rp
Relying party.
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:144
size_t GNUNET_RECLAIM_ATTRIBUTE_list_serialize_get_size(const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs)
Get required size for serialization buffer.
size_t GNUNET_RECLAIM_ATTRIBUTE_list_serialize(const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs, char *result)
Serialize an attribute list.
uint32_t r_id
request id
Definition: reclaim_api.c:92
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_RECLAIM_ticket_revoke()

struct GNUNET_RECLAIM_Operation* GNUNET_RECLAIM_ticket_revoke ( struct GNUNET_RECLAIM_Handle h,
const struct GNUNET_CRYPTO_EcdsaPrivateKey identity,
const struct GNUNET_RECLAIM_Ticket ticket,
GNUNET_RECLAIM_ContinuationWithStatus  cb,
void *  cb_cls 
)

Revoked an issued ticket.

The relying party will be unable to retrieve attributes. Other issued tickets remain unaffected. This includes tickets issued to other relying parties as well as to other tickets issued to the audience specified in this ticket.

Parameters
hthe identity provider to use
identitythe issuing identity
ticketthe ticket to revoke
cbthe callback
cb_clsthe callback closure
Returns
handle to abort the operation

Definition at line 1240 of file reclaim_api.c.

References GNUNET_RECLAIM_Operation::cls, GNUNET_RECLAIM_Operation::env, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_new, GNUNET_RECLAIM_Operation::h, RevokeTicketMessage::id, identity, RevokeTicketMessage::identity, GNUNET_RECLAIM_Handle::mq, GNUNET_RECLAIM_Operation::msg, op, GNUNET_RECLAIM_Handle::op_head, GNUNET_RECLAIM_Handle::op_tail, GNUNET_RECLAIM_Operation::r_id, GNUNET_RECLAIM_Handle::r_id_gen, GNUNET_RECLAIM_Operation::rvk_cb, ticket, and RevokeTicketMessage::ticket.

Referenced by iter_finished(), and revoke_ticket_cont().

1246 {
1247  struct GNUNET_RECLAIM_Operation *op;
1248  struct RevokeTicketMessage *msg;
1249  uint32_t rid;
1250 
1251  rid = h->r_id_gen++;
1252  op = GNUNET_new (struct GNUNET_RECLAIM_Operation);
1253  op->h = h;
1254  op->rvk_cb = cb;
1255  op->cls = cb_cls;
1256  op->r_id = rid;
1259  msg->id = htonl (rid);
1260  msg->identity = *identity;
1261  msg->ticket = *ticket;
1262  if (NULL != h->mq)
1263  {
1264  GNUNET_MQ_send (h->mq, op->env);
1265  op->env = NULL;
1266  }
1267  return op;
1268 }
struct GNUNET_CRYPTO_EcdsaPrivateKey identity
Identity.
Definition: reclaim.h:319
struct GNUNET_RECLAIM_Handle * h
Main handle.
Definition: reclaim_api.c:46
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
void * cls
Closure for cont or cb.
Definition: reclaim_api.c:97
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:314
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
Definition: gnunet_mq_lib.h:67
#define GNUNET_new(type)
Allocate a struct or union of the given type.
Handle for an operation with the service.
Definition: reclaim_api.c:41
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
static struct GNUNET_RECLAIM_Ticket ticket
Ticket to consume.
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:300
GNUNET_RECLAIM_ContinuationWithStatus rvk_cb
Revocation result callback.
Definition: reclaim_api.c:77
struct GNUNET_RECLAIM_Operation * op_tail
Tail of active operations.
Definition: reclaim_api.c:260
struct GNUNET_RECLAIM_Ticket ticket
The ticket to revoke.
Definition: reclaim.h:329
struct GNUNET_MQ_Envelope * env
Envelope with the message for this queue entry.
Definition: reclaim_api.c:87
uint32_t r_id_gen
Request Id generator.
Definition: reclaim_api.c:305
static struct GNUNET_IDENTITY_Handle * identity
Which namespace do we publish to? NULL if we do not publish to a namespace.
struct GNUNET_RECLAIM_Operation * op_head
Head of active operations.
Definition: reclaim_api.c:255
#define GNUNET_CONTAINER_DLL_insert_tail(head, tail, element)
Insert an element at the tail of a DLL.
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
Definition: mq.c:353
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:144
Ticket revoke message.
Definition: reclaim.h:304
#define GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET
uint32_t r_id
request id
Definition: reclaim_api.c:92
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_RECLAIM_ticket_consume()

struct GNUNET_RECLAIM_Operation* GNUNET_RECLAIM_ticket_consume ( struct GNUNET_RECLAIM_Handle h,
const struct GNUNET_CRYPTO_EcdsaPrivateKey identity,
const struct GNUNET_RECLAIM_Ticket ticket,
GNUNET_RECLAIM_AttributeResult  cb,
void *  cb_cls 
)

Consumes an issued ticket.

The ticket is used to retrieve identity information from the issuer

Parameters
hthe identity provider to use
identitythe identity that is the subject of the issued ticket (the relying party)
ticketthe issued ticket to consume
cbthe callback to call
cb_clsthe callback closure
Returns
handle to abort the operation

The ticket is persisted and used to retrieve identity information from the issuer

Parameters
hthe reclaim to use
identitythe identity that is the subject of the issued ticket (the relying party)
ticketthe issued ticket to consume
cbthe callback to call
cb_clsthe callback closure
Returns
handle to abort the operation

Definition at line 1101 of file reclaim_api.c.

References GNUNET_RECLAIM_Operation::ar_cb, GNUNET_RECLAIM_Operation::cls, GNUNET_RECLAIM_Operation::env, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET, GNUNET_MQ_msg, GNUNET_MQ_send_copy(), GNUNET_new, GNUNET_RECLAIM_Operation::h, ConsumeTicketMessage::id, identity, ConsumeTicketMessage::identity, GNUNET_RECLAIM_Handle::mq, op, GNUNET_RECLAIM_Handle::op_head, GNUNET_RECLAIM_Handle::op_tail, GNUNET_RECLAIM_Operation::r_id, GNUNET_RECLAIM_Handle::r_id_gen, ticket, and ConsumeTicketMessage::ticket.

Referenced by consume_ticket_cont(), iter_finished(), and userinfo_endpoint().

1107 {
1108  struct GNUNET_RECLAIM_Operation *op;
1109  struct ConsumeTicketMessage *ctm;
1110 
1111  op = GNUNET_new (struct GNUNET_RECLAIM_Operation);
1112  op->h = h;
1113  op->ar_cb = cb;
1114  op->cls = cb_cls;
1115  op->r_id = h->r_id_gen++;
1118  ctm->identity = *identity;
1119  ctm->id = htonl (op->r_id);
1120  ctm->ticket = *ticket;
1121  if (NULL != h->mq)
1122  GNUNET_MQ_send_copy (h->mq, op->env);
1123  return op;
1124 }
struct GNUNET_RECLAIM_Handle * h
Main handle.
Definition: reclaim_api.c:46
void * cls
Closure for cont or cb.
Definition: reclaim_api.c:97
Ticket consume message.
Definition: reclaim.h:378
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
Definition: gnunet_mq_lib.h:67
#define GNUNET_new(type)
Allocate a struct or union of the given type.
Handle for an operation with the service.
Definition: reclaim_api.c:41
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
static struct GNUNET_RECLAIM_Ticket ticket
Ticket to consume.
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:300
struct GNUNET_RECLAIM_Operation * op_tail
Tail of active operations.
Definition: reclaim_api.c:260
struct GNUNET_CRYPTO_EcdsaPrivateKey identity
Identity.
Definition: reclaim.h:393
struct GNUNET_MQ_Envelope * env
Envelope with the message for this queue entry.
Definition: reclaim_api.c:87
uint32_t r_id_gen
Request Id generator.
Definition: reclaim_api.c:305
static struct GNUNET_IDENTITY_Handle * identity
Which namespace do we publish to? NULL if we do not publish to a namespace.
struct GNUNET_RECLAIM_Ticket ticket
The ticket to consume.
Definition: reclaim.h:398
struct GNUNET_RECLAIM_Operation * op_head
Head of active operations.
Definition: reclaim_api.c:255
#define GNUNET_CONTAINER_DLL_insert_tail(head, tail, element)
Insert an element at the tail of a DLL.
GNUNET_RECLAIM_AttributeResult ar_cb
Attribute result callback.
Definition: reclaim_api.c:72
void GNUNET_MQ_send_copy(struct GNUNET_MQ_Handle *mq, const struct GNUNET_MQ_Envelope *ev)
Send a copy of a message with the given message queue.
Definition: mq.c:432
#define GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:144
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:388
uint32_t r_id
request id
Definition: reclaim_api.c:92
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_RECLAIM_ticket_iteration_start()

struct GNUNET_RECLAIM_TicketIterator* GNUNET_RECLAIM_ticket_iteration_start ( struct GNUNET_RECLAIM_Handle h,
const struct GNUNET_CRYPTO_EcdsaPrivateKey identity,
GNUNET_SCHEDULER_TaskCallback  error_cb,
void *  error_cb_cls,
GNUNET_RECLAIM_TicketCallback  proc,
void *  proc_cls,
GNUNET_SCHEDULER_TaskCallback  finish_cb,
void *  finish_cb_cls 
)

Lists all tickets that have been issued to remote identites (relying parties)

Parameters
hthe identity provider to use
identitythe issuing identity
error_cbfunction to call on error (i.e. disconnect), the handle is afterwards invalid
error_cb_clsclosure for error_cb
procfunction to call on each ticket; it will be called repeatedly with a value (if available)
proc_clsclosure for proc
finish_cbfunction to call on completion the handle is afterwards invalid
finish_cb_clsclosure for finish_cb
Returns
an iterator handle to use for iteration
Parameters
hthe reclaim to use
identitythe issuing identity
error_cbfunction to call on error (i.e. disconnect), the handle is afterwards invalid
error_cb_clsclosure for error_cb
procfunction to call on each ticket; it will be called repeatedly with a value (if available)
proc_clsclosure for proc
finish_cbfunction to call on completion the handle is afterwards invalid
finish_cb_clsclosure for finish_cb
Returns
an iterator handle to use for iteration

Definition at line 1145 of file reclaim_api.c.

References GNUNET_RECLAIM_TicketIterator::cls, GNUNET_RECLAIM_Operation::env, GNUNET_RECLAIM_TicketIterator::env, GNUNET_RECLAIM_TicketIterator::error_cb, error_cb(), GNUNET_RECLAIM_TicketIterator::error_cb_cls, GNUNET_RECLAIM_TicketIterator::finish_cb, GNUNET_RECLAIM_TicketIterator::finish_cb_cls, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_START, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_new, GNUNET_RECLAIM_Operation::h, GNUNET_RECLAIM_TicketIterator::h, TicketIterationStartMessage::id, identity, TicketIterationStartMessage::identity, GNUNET_RECLAIM_Handle::mq, GNUNET_RECLAIM_Operation::msg, GNUNET_RECLAIM_TicketIterator::r_id, GNUNET_RECLAIM_Handle::r_id_gen, GNUNET_RECLAIM_Handle::ticket_it_head, GNUNET_RECLAIM_Handle::ticket_it_tail, and GNUNET_RECLAIM_TicketIterator::tr_cb.

Referenced by list_tickets_cont(), and start_process().

1154 {
1155  struct GNUNET_RECLAIM_TicketIterator *it;
1156  struct GNUNET_MQ_Envelope *env;
1158  uint32_t rid;
1159 
1160  rid = h->r_id_gen++;
1162  it->h = h;
1163  it->error_cb = error_cb;
1164  it->error_cb_cls = error_cb_cls;
1165  it->finish_cb = finish_cb;
1166  it->finish_cb_cls = finish_cb_cls;
1167  it->tr_cb = proc;
1168  it->cls = proc_cls;
1169  it->r_id = rid;
1172  msg->id = htonl (rid);
1173  msg->identity = *identity;
1174  if (NULL == h->mq)
1175  it->env = env;
1176  else
1177  GNUNET_MQ_send (h->mq, env);
1178  return it;
1179 }
struct GNUNET_RECLAIM_TicketIterator * ticket_it_tail
Tail of active iterations.
Definition: reclaim_api.c:280
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
struct GNUNET_CRYPTO_EcdsaPrivateKey identity
Identity.
Definition: reclaim.h:230
static void error_cb(void *cls)
Function called if lookup fails.
Definition: gnunet-abd.c:485
void * finish_cb_cls
Closure for finish_cb.
Definition: reclaim_api.c:129
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
Definition: gnunet_mq_lib.h:67
#define GNUNET_new(type)
Allocate a struct or union of the given type.
struct GNUNET_RECLAIM_Handle * h
Main handle to access the idp.
Definition: reclaim_api.c:119
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:300
struct GNUNET_MQ_Envelope * env
Envelope of the message to send to the service, if not yet sent.
Definition: reclaim_api.c:155
void * error_cb_cls
Closure for error_cb.
Definition: reclaim_api.c:149
uint32_t r_id_gen
Request Id generator.
Definition: reclaim_api.c:305
uint32_t r_id
The operation id this zone iteration operation has.
Definition: reclaim_api.c:160
void * cls
Closure for tr_cb.
Definition: reclaim_api.c:139
static struct GNUNET_IDENTITY_Handle * identity
Which namespace do we publish to? NULL if we do not publish to a namespace.
struct GNUNET_MQ_Envelope * env
Definition: 005.c:1
#define GNUNET_CONTAINER_DLL_insert_tail(head, tail, element)
Insert an element at the tail of a DLL.
#define GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_START
GNUNET_SCHEDULER_TaskCallback error_cb
Function to call on errors.
Definition: reclaim_api.c:144
GNUNET_RECLAIM_TicketCallback tr_cb
The continuation to call with the results.
Definition: reclaim_api.c:134
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:225
Start a ticket iteration for the given identity.
Definition: reclaim.h:215
Handle for a ticket iterator operation.
Definition: reclaim_api.c:104
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
Definition: mq.c:353
GNUNET_SCHEDULER_TaskCallback finish_cb
Function to call on completion.
Definition: reclaim_api.c:124
struct GNUNET_RECLAIM_TicketIterator * ticket_it_head
Head of active iterations.
Definition: reclaim_api.c:275
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_RECLAIM_ticket_iteration_next()

void GNUNET_RECLAIM_ticket_iteration_next ( struct GNUNET_RECLAIM_TicketIterator it)

Calls the ticket processor specified in GNUNET_RECLAIM_ticket_iteration_start for the next record.

Parameters
itthe iterator

Definition at line 1189 of file reclaim_api.c.

References GNUNET_RECLAIM_Operation::env, GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_NEXT, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_RECLAIM_Operation::h, GNUNET_RECLAIM_TicketIterator::h, TicketIterationNextMessage::id, GNUNET_RECLAIM_Handle::mq, GNUNET_RECLAIM_Operation::msg, and GNUNET_RECLAIM_TicketIterator::r_id.

Referenced by ticket_collect(), and ticket_iter().

1190 {
1191  struct GNUNET_RECLAIM_Handle *h = it->h;
1193  struct GNUNET_MQ_Envelope *env;
1194 
1196  msg->id = htonl (it->r_id);
1197  GNUNET_MQ_send (h->mq, env);
1198 }
Handle to the service.
Definition: reclaim_api.c:235
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
Definition: gnunet_mq_lib.h:67
#define GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_NEXT
struct GNUNET_RECLAIM_Handle * h
Main handle to access the idp.
Definition: reclaim_api.c:119
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
Ask for next result of ticket iteration for the given operation.
Definition: reclaim.h:237
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:247
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:300
uint32_t r_id
The operation id this zone iteration operation has.
Definition: reclaim_api.c:160
struct GNUNET_MQ_Envelope * env
Definition: 005.c:1
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
Definition: mq.c:353
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_RECLAIM_ticket_iteration_stop()

void GNUNET_RECLAIM_ticket_iteration_stop ( struct GNUNET_RECLAIM_TicketIterator it)

Stops iteration and releases the handle for further calls.

Must be called on any iteration that has not yet completed prior to calling GNUNET_RECLAIM_disconnect.

Parameters
itthe iterator

Definition at line 1209 of file reclaim_api.c.

References GNUNET_RECLAIM_Operation::env, GNUNET_free, GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_STOP, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_RECLAIM_Operation::h, GNUNET_RECLAIM_TicketIterator::h, TicketIterationStopMessage::id, GNUNET_RECLAIM_Handle::mq, GNUNET_RECLAIM_Operation::msg, and GNUNET_RECLAIM_TicketIterator::r_id.

Referenced by cleanup_handle(), and do_cleanup().

1210 {
1211  struct GNUNET_RECLAIM_Handle *h = it->h;
1212  struct GNUNET_MQ_Envelope *env;
1214 
1215  if (NULL != h->mq)
1216  {
1217  env =
1219  msg->id = htonl (it->r_id);
1220  GNUNET_MQ_send (h->mq, env);
1221  }
1222  GNUNET_free (it);
1223 }
Handle to the service.
Definition: reclaim_api.c:235
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
Definition: gnunet_mq_lib.h:67
struct GNUNET_RECLAIM_Handle * h
Main handle to access the idp.
Definition: reclaim_api.c:119
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:300
Stop ticket iteration for the given operation.
Definition: reclaim.h:254
uint32_t r_id
The operation id this zone iteration operation has.
Definition: reclaim_api.c:160
struct GNUNET_MQ_Envelope * env
Definition: 005.c:1
#define GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_STOP
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
Definition: mq.c:353
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:264
#define GNUNET_free(ptr)
Wrapper around free.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_RECLAIM_disconnect()

void GNUNET_RECLAIM_disconnect ( struct GNUNET_RECLAIM_Handle h)

Disconnect from identity provider service.

Parameters
hidentity provider service to disconnect

Disconnect from identity provider service.

Parameters
hhandle to destroy

Definition at line 819 of file reclaim_api.c.

References GNUNET_assert, GNUNET_free, GNUNET_MQ_destroy(), GNUNET_SCHEDULER_cancel(), GNUNET_RECLAIM_Handle::mq, GNUNET_RECLAIM_Handle::op_head, and GNUNET_RECLAIM_Handle::reconnect_task.

Referenced by cleanup_handle(), and do_cleanup().

820 {
821  GNUNET_assert (NULL != h);
822  if (NULL != h->mq)
823  {
824  GNUNET_MQ_destroy (h->mq);
825  h->mq = NULL;
826  }
827  if (NULL != h->reconnect_task)
828  {
830  h->reconnect_task = NULL;
831  }
832  GNUNET_assert (NULL == h->op_head);
833  GNUNET_free (h);
834 }
struct GNUNET_SCHEDULER_Task * reconnect_task
Task doing exponential back-off trying to reconnect.
Definition: reclaim_api.c:290
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:300
struct GNUNET_RECLAIM_Operation * op_head
Head of active operations.
Definition: reclaim_api.c:255
void GNUNET_MQ_destroy(struct GNUNET_MQ_Handle *mq)
Destroy the message queue.
Definition: mq.c:824
#define GNUNET_free(ptr)
Wrapper around free.
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
Definition: scheduler.c:966
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_RECLAIM_cancel()

void GNUNET_RECLAIM_cancel ( struct GNUNET_RECLAIM_Operation op)

Cancel an identity provider operation.

Note that the operation MAY still be executed; this merely cancels the continuation; if the request was already transmitted, the service may still choose to complete the operation.

Parameters
opoperation to cancel

Cancel an identity provider operation.

Note that the operation MAY still be executed; this merely cancels the continuation; if the request was already transmitted, the service may still choose to complete the operation.

Parameters
opoperation to cancel

Definition at line 804 of file reclaim_api.c.

References free_op(), GNUNET_CONTAINER_DLL_remove, GNUNET_RECLAIM_Operation::h, GNUNET_RECLAIM_Handle::op_head, and GNUNET_RECLAIM_Handle::op_tail.

Referenced by do_cleanup().

805 {
806  struct GNUNET_RECLAIM_Handle *h = op->h;
807 
809  free_op (op);
810 }
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
Handle to the service.
Definition: reclaim_api.c:235
struct GNUNET_RECLAIM_Handle * h
Main handle.
Definition: reclaim_api.c:46
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
struct GNUNET_RECLAIM_Operation * op_tail
Tail of active operations.
Definition: reclaim_api.c:260
struct GNUNET_RECLAIM_Operation * op_head
Head of active operations.
Definition: reclaim_api.c:255
static void free_op(struct GNUNET_RECLAIM_Operation *op)
Free op.
Definition: reclaim_api.c:380
Here is the call graph for this function:
Here is the caller graph for this function: