GNUnet  0.10.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:238
#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:94
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:303
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
Definition: gnunet-arm.c:104
const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration to use.
Definition: reclaim_api.c:243
#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 849 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().

856 {
858  struct AttributeStoreMessage *sam;
859  size_t attr_len;
860 
861  op = GNUNET_new (struct GNUNET_RECLAIM_Operation);
862  op->h = h;
863  op->as_cb = cont;
864  op->cls = cont_cls;
865  op->r_id = h->r_id_gen++;
868  op->env = GNUNET_MQ_msg_extra (sam,
869  attr_len,
871  sam->identity = *pkey;
872  sam->id = htonl (op->r_id);
873  sam->exp = GNUNET_htonll (exp_interval->rel_value_us);
874 
875  GNUNET_RECLAIM_ATTRIBUTE_serialize (attr, (char *) &sam[1]);
876 
877  sam->attr_len = htons (attr_len);
878  if (NULL != h->mq)
879  GNUNET_MQ_send_copy (h->mq, op->env);
880  return op;
881 }
struct GNUNET_CRYPTO_EcdsaPrivateKey identity
Identity.
Definition: reclaim.h:65
struct GNUNET_RECLAIM_Handle * h
Main handle.
Definition: reclaim_api.c:47
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:98
GNUNET_RECLAIM_ContinuationWithStatus as_cb
Continuation to invoke after attribute store call.
Definition: reclaim_api.c:68
#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:94
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:303
#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:263
struct GNUNET_MQ_Envelope * env
Envelope with the message for this queue entry.
Definition: reclaim_api.c:88
uint32_t r_id_gen
Request Id generator.
Definition: reclaim_api.c:308
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:258
#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:139
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:93
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 896 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().

902 {
904  struct AttributeDeleteMessage *dam;
905  size_t attr_len;
906 
907  op = GNUNET_new (struct GNUNET_RECLAIM_Operation);
908  op->h = h;
909  op->as_cb = cont;
910  op->cls = cont_cls;
911  op->r_id = h->r_id_gen++;
914  op->env = GNUNET_MQ_msg_extra (dam,
915  attr_len,
917  dam->identity = *pkey;
918  dam->id = htonl (op->r_id);
919  GNUNET_RECLAIM_ATTRIBUTE_serialize (attr, (char *) &dam[1]);
920 
921  dam->attr_len = htons (attr_len);
922  if (NULL != h->mq)
923  GNUNET_MQ_send_copy (h->mq, op->env);
924  return op;
925 }
struct GNUNET_RECLAIM_Handle * h
Main handle.
Definition: reclaim_api.c:47
static char * pkey
Public key of the zone to look in, in ASCII.
void * cls
Closure for cont or cb.
Definition: reclaim_api.c:98
GNUNET_RECLAIM_ContinuationWithStatus as_cb
Continuation to invoke after attribute store call.
Definition: reclaim_api.c:68
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:94
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:303
#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:263
struct GNUNET_MQ_Envelope * env
Envelope with the message for this queue entry.
Definition: reclaim_api.c:88
uint32_t r_id_gen
Request Id generator.
Definition: reclaim_api.c:308
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:258
#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:139
#define GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_DELETE
uint32_t r_id
request id
Definition: reclaim_api.c:93
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 953 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().

962 {
964  struct GNUNET_MQ_Envelope *env;
966  uint32_t rid;
967 
968  rid = h->r_id_gen++;
970  it->h = h;
971  it->error_cb = error_cb;
972  it->error_cb_cls = error_cb_cls;
973  it->finish_cb = finish_cb;
974  it->finish_cb_cls = finish_cb_cls;
975  it->proc = proc;
976  it->proc_cls = proc_cls;
977  it->r_id = rid;
978  it->identity = *identity;
980  env =
982  msg->id = htonl (rid);
983  msg->identity = *identity;
984  if (NULL == h->mq)
985  it->env = env;
986  else
987  GNUNET_MQ_send (h->mq, env);
988  return it;
989 }
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
Start a attribute iteration for the given identity.
Definition: reclaim.h:160
#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:195
GNUNET_SCHEDULER_TaskCallback error_cb
Function to call on errors.
Definition: reclaim_api.c:210
static void error_cb(GstBus *bus, GstMessage *msg, GNUNET_gstData *data)
Definition: gnunet_gst.c:311
GNUNET_RECLAIM_AttributeResult proc
The continuation to call with the results.
Definition: reclaim_api.c:200
struct GNUNET_RECLAIM_AttributeIterator * it_tail
Tail of active iterations.
Definition: reclaim_api.c:273
void * proc_cls
Closure for proc.
Definition: reclaim_api.c:205
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:94
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:303
Handle for a attribute iterator operation.
Definition: reclaim_api.c:169
uint32_t r_id
The operation id this zone iteration operation has.
Definition: reclaim_api.c:231
uint32_t r_id_gen
Request Id generator.
Definition: reclaim_api.c:308
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:226
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:221
struct GNUNET_RECLAIM_AttributeIterator * it_head
Head of active iterations.
Definition: reclaim_api.c:268
void * error_cb_cls
Closure for error_cb.
Definition: reclaim_api.c:215
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:185
GNUNET_SCHEDULER_TaskCallback finish_cb
Function to call on completion.
Definition: reclaim_api.c:190
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 999 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().

1000 {
1001  struct GNUNET_RECLAIM_Handle *h = it->h;
1003  struct GNUNET_MQ_Envelope *env;
1004 
1005  env =
1007  msg->id = htonl (it->r_id);
1008  GNUNET_MQ_send (h->mq, env);
1009 }
Handle to the service.
Definition: reclaim_api.c:238
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:94
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:303
uint32_t r_id
The operation id this zone iteration operation has.
Definition: reclaim_api.c:231
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:185
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 1020 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().

1021 {
1022  struct GNUNET_RECLAIM_Handle *h = it->h;
1023  struct GNUNET_MQ_Envelope *env;
1025 
1026  if (NULL != h->mq)
1027  {
1028  env =
1030  msg->id = htonl (it->r_id);
1031  GNUNET_MQ_send (h->mq, env);
1032  }
1033  free_it (it);
1034 }
Handle to the service.
Definition: reclaim_api.c:238
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:94
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:303
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:231
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:366
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:185
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 1051 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().

1058 {
1059  struct GNUNET_RECLAIM_Operation *op;
1060  struct IssueTicketMessage *tim;
1061  size_t attr_len;
1062  fprintf (stderr, "Issuing ticket\n");
1063  op = GNUNET_new (struct GNUNET_RECLAIM_Operation);
1064  op->h = h;
1065  op->tr_cb = cb;
1066  op->cls = cb_cls;
1067  op->r_id = h->r_id_gen++;
1070  op->env = GNUNET_MQ_msg_extra (tim,
1071  attr_len,
1073  tim->identity = *iss;
1074  tim->rp = *rp;
1075  tim->id = htonl (op->r_id);
1076 
1077  GNUNET_RECLAIM_ATTRIBUTE_list_serialize (attrs, (char *) &tim[1]);
1078 
1079  tim->attr_len = htons (attr_len);
1080  if (NULL != h->mq)
1081  GNUNET_MQ_send_copy (h->mq, op->env);
1082  return op;
1083 }
#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:47
void * cls
Closure for cont or cb.
Definition: reclaim_api.c:98
#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:94
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:303
#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:263
struct GNUNET_MQ_Envelope * env
Envelope with the message for this queue entry.
Definition: reclaim_api.c:88
uint32_t r_id_gen
Request Id generator.
Definition: reclaim_api.c:308
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:83
struct GNUNET_RECLAIM_Operation * op_head
Head of active operations.
Definition: reclaim_api.c:258
#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:139
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:93
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 1238 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().

1244 {
1245  struct GNUNET_RECLAIM_Operation *op;
1246  struct RevokeTicketMessage *msg;
1247  uint32_t rid;
1248 
1249  rid = h->r_id_gen++;
1250  op = GNUNET_new (struct GNUNET_RECLAIM_Operation);
1251  op->h = h;
1252  op->rvk_cb = cb;
1253  op->cls = cb_cls;
1254  op->r_id = rid;
1257  msg->id = htonl (rid);
1258  msg->identity = *identity;
1259  msg->ticket = *ticket;
1260  if (NULL != h->mq)
1261  {
1262  GNUNET_MQ_send (h->mq, op->env);
1263  op->env = NULL;
1264  }
1265  return op;
1266 }
struct GNUNET_CRYPTO_EcdsaPrivateKey identity
Identity.
Definition: reclaim.h:319
struct GNUNET_RECLAIM_Handle * h
Main handle.
Definition: reclaim_api.c:47
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
void * cls
Closure for cont or cb.
Definition: reclaim_api.c:98
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:94
static struct GNUNET_RECLAIM_Ticket ticket
Ticket to consume.
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:303
GNUNET_RECLAIM_ContinuationWithStatus rvk_cb
Revocation result callback.
Definition: reclaim_api.c:78
struct GNUNET_RECLAIM_Operation * op_tail
Tail of active operations.
Definition: reclaim_api.c:263
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:88
uint32_t r_id_gen
Request Id generator.
Definition: reclaim_api.c:308
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:258
#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:139
Ticket revoke message.
Definition: reclaim.h:304
#define GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET
uint32_t r_id
request id
Definition: reclaim_api.c:93
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 1099 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().

1105 {
1106  struct GNUNET_RECLAIM_Operation *op;
1107  struct ConsumeTicketMessage *ctm;
1108 
1109  op = GNUNET_new (struct GNUNET_RECLAIM_Operation);
1110  op->h = h;
1111  op->ar_cb = cb;
1112  op->cls = cb_cls;
1113  op->r_id = h->r_id_gen++;
1116  ctm->identity = *identity;
1117  ctm->id = htonl (op->r_id);
1118  ctm->ticket = *ticket;
1119  if (NULL != h->mq)
1120  GNUNET_MQ_send_copy (h->mq, op->env);
1121  return op;
1122 }
struct GNUNET_RECLAIM_Handle * h
Main handle.
Definition: reclaim_api.c:47
void * cls
Closure for cont or cb.
Definition: reclaim_api.c:98
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:94
static struct GNUNET_RECLAIM_Ticket ticket
Ticket to consume.
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:303
struct GNUNET_RECLAIM_Operation * op_tail
Tail of active operations.
Definition: reclaim_api.c:263
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:88
uint32_t r_id_gen
Request Id generator.
Definition: reclaim_api.c:308
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:258
#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:73
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:139
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:93
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 1143 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().

1152 {
1153  struct GNUNET_RECLAIM_TicketIterator *it;
1154  struct GNUNET_MQ_Envelope *env;
1156  uint32_t rid;
1157 
1158  rid = h->r_id_gen++;
1160  it->h = h;
1161  it->error_cb = error_cb;
1162  it->error_cb_cls = error_cb_cls;
1163  it->finish_cb = finish_cb;
1164  it->finish_cb_cls = finish_cb_cls;
1165  it->tr_cb = proc;
1166  it->cls = proc_cls;
1167  it->r_id = rid;
1170  msg->id = htonl (rid);
1171  msg->identity = *identity;
1172  if (NULL == h->mq)
1173  it->env = env;
1174  else
1175  GNUNET_MQ_send (h->mq, env);
1176  return it;
1177 }
struct GNUNET_RECLAIM_TicketIterator * ticket_it_tail
Tail of active iterations.
Definition: reclaim_api.c:283
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
struct GNUNET_CRYPTO_EcdsaPrivateKey identity
Identity.
Definition: reclaim.h:230
void * finish_cb_cls
Closure for finish_cb.
Definition: reclaim_api.c:131
#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.
static void error_cb(GstBus *bus, GstMessage *msg, GNUNET_gstData *data)
Definition: gnunet_gst.c:311
struct GNUNET_RECLAIM_Handle * h
Main handle to access the idp.
Definition: reclaim_api.c:121
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:94
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:303
struct GNUNET_MQ_Envelope * env
Envelope of the message to send to the service, if not yet sent.
Definition: reclaim_api.c:157
void * error_cb_cls
Closure for error_cb.
Definition: reclaim_api.c:151
uint32_t r_id_gen
Request Id generator.
Definition: reclaim_api.c:308
uint32_t r_id
The operation id this zone iteration operation has.
Definition: reclaim_api.c:162
void * cls
Closure for tr_cb.
Definition: reclaim_api.c:141
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:146
GNUNET_RECLAIM_TicketCallback tr_cb
The continuation to call with the results.
Definition: reclaim_api.c:136
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:105
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:126
struct GNUNET_RECLAIM_TicketIterator * ticket_it_head
Head of active iterations.
Definition: reclaim_api.c:278
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 1187 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().

1188 {
1189  struct GNUNET_RECLAIM_Handle *h = it->h;
1191  struct GNUNET_MQ_Envelope *env;
1192 
1194  msg->id = htonl (it->r_id);
1195  GNUNET_MQ_send (h->mq, env);
1196 }
Handle to the service.
Definition: reclaim_api.c:238
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:121
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:94
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:303
uint32_t r_id
The operation id this zone iteration operation has.
Definition: reclaim_api.c:162
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 1207 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().

1208 {
1209  struct GNUNET_RECLAIM_Handle *h = it->h;
1210  struct GNUNET_MQ_Envelope *env;
1212 
1213  if (NULL != h->mq)
1214  {
1215  env =
1217  msg->id = htonl (it->r_id);
1218  GNUNET_MQ_send (h->mq, env);
1219  }
1220  GNUNET_free (it);
1221 }
Handle to the service.
Definition: reclaim_api.c:238
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:121
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:94
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:303
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:162
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:293
#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:303
struct GNUNET_RECLAIM_Operation * op_head
Head of active operations.
Definition: reclaim_api.c:258
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:965
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:238
struct GNUNET_RECLAIM_Handle * h
Main handle.
Definition: reclaim_api.c:47
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:94
struct GNUNET_RECLAIM_Operation * op_tail
Tail of active operations.
Definition: reclaim_api.c:263
struct GNUNET_RECLAIM_Operation * op_head
Head of active operations.
Definition: reclaim_api.c:258
static void free_op(struct GNUNET_RECLAIM_Operation *op)
Free op.
Definition: reclaim_api.c:382
Here is the call graph for this function:
Here is the caller graph for this function: