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 *attr)
 Callback used to notify the client of attribute results. More...
 
typedef void(* GNUNET_RECLAIM_AttributeTicketResult) (void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, const struct GNUNET_RECLAIM_Attribute *attr, const struct GNUNET_RECLAIM_Attestation *attestation)
 Callback used to notify the client of attribute results. More...
 
typedef void(* GNUNET_RECLAIM_AttestationResult) (void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, const struct GNUNET_RECLAIM_Attestation *attestation)
 Callback used to notify the client of attestation 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 *attr, const struct GNUNET_TIME_Relative *exp_interval, GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls)
 Store an attribute. More...
 
struct GNUNET_RECLAIM_OperationGNUNET_RECLAIM_attestation_store (struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, const struct GNUNET_RECLAIM_Attestation *attestation, const struct GNUNET_TIME_Relative *exp_interval, GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls)
 Store an attestation. More...
 
struct GNUNET_RECLAIM_OperationGNUNET_RECLAIM_attribute_delete (struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, const struct GNUNET_RECLAIM_Attribute *attr, GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls)
 Delete an attribute. More...
 
struct GNUNET_RECLAIM_OperationGNUNET_RECLAIM_attestation_delete (struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, const struct GNUNET_RECLAIM_Attestation *attr, GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls)
 Delete an attestation. 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_AttestationIteratorGNUNET_RECLAIM_get_attestations_start (struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, GNUNET_RECLAIM_AttestationResult proc, void *proc_cls, GNUNET_SCHEDULER_TaskCallback finish_cb, void *finish_cb_cls)
 List all attestations for a local identity. More...
 
void GNUNET_RECLAIM_get_attestations_next (struct GNUNET_RECLAIM_AttestationIterator *ait)
 Calls the record processor specified in #GNUNET_RECLAIM_get_attestation_start for the next record. More...
 
void GNUNET_RECLAIM_get_attestations_stop (struct GNUNET_RECLAIM_AttestationIterator *ait)
 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_AttributeList *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_AttributeTicketResult 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 *attr)

Callback used to notify the client of attribute results.

Parameters
clsThe callback closure
identityThe identity authoritative over the attributes
attrThe attribute
attestationThe attestation for the attribute (may be NULL)

Definition at line 118 of file gnunet_reclaim_service.h.

◆ GNUNET_RECLAIM_AttributeTicketResult

typedef void(* GNUNET_RECLAIM_AttributeTicketResult) (void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, const struct GNUNET_RECLAIM_Attribute *attr, const struct GNUNET_RECLAIM_Attestation *attestation)

Callback used to notify the client of attribute results.

Parameters
clsThe callback closure
identityThe identity authoritative over the attributes
attrThe attribute
attestationThe attestation for the attribute (may be NULL)

Definition at line 130 of file gnunet_reclaim_service.h.

◆ GNUNET_RECLAIM_AttestationResult

typedef void(* GNUNET_RECLAIM_AttestationResult) (void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, const struct GNUNET_RECLAIM_Attestation *attestation)

Callback used to notify the client of attestation results.

Parameters
clsThe callback closure
identityThe identity authoritative over the attributes
attestationThe attestation
attributesthe parsed attributes

Definition at line 144 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 1026 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_attestation_cont(), add_attribute_cont(), code_redirect(), consume_ticket_cont(), delete_attestation_cont(), delete_attribute_cont(), list_attestation_cont(), list_attribute_cont(), list_tickets_cont(), revoke_ticket_cont(), run(), and userinfo_endpoint().

1027 {
1028  struct GNUNET_RECLAIM_Handle *h;
1029 
1030  h = GNUNET_new (struct GNUNET_RECLAIM_Handle);
1031  h->cfg = cfg;
1032  reconnect (h);
1033  if (NULL == h->mq)
1034  {
1035  GNUNET_free (h);
1036  return NULL;
1037  }
1038  return h;
1039 }
Handle to the service.
Definition: reclaim_api.c:312
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:977
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:387
const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration to use.
Definition: reclaim_api.c:317
#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 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 1097 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().

1104 {
1105  struct GNUNET_RECLAIM_Operation *op;
1106  struct AttributeStoreMessage *sam;
1107  size_t attr_len;
1108 
1109  op = GNUNET_new (struct GNUNET_RECLAIM_Operation);
1110  op->h = h;
1111  op->as_cb = cont;
1112  op->cls = cont_cls;
1113  op->r_id = h->r_id_gen++;
1116  op->env = GNUNET_MQ_msg_extra (sam,
1117  attr_len,
1119  sam->identity = *pkey;
1120  sam->id = htonl (op->r_id);
1121  sam->exp = GNUNET_htonll (exp_interval->rel_value_us);
1122 
1123  GNUNET_RECLAIM_attribute_serialize (attr, (char *) &sam[1]);
1124 
1125  sam->attr_len = htons (attr_len);
1126  if (NULL != h->mq)
1127  GNUNET_MQ_send_copy (h->mq, op->env);
1128  return op;
1129 }
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:107
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
size_t GNUNET_RECLAIM_attribute_serialize(const struct GNUNET_RECLAIM_Attribute *attr, char *result)
Serialize an attribute.
Use to store an identity attribute.
Definition: reclaim.h:40
size_t GNUNET_RECLAIM_attribute_serialize_get_size(const struct GNUNET_RECLAIM_Attribute *attr)
Get required size for serialization buffer.
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:387
#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:337
struct GNUNET_MQ_Envelope * env
Envelope with the message for this queue entry.
Definition: reclaim_api.c:97
uint32_t r_id_gen
Request Id generator.
Definition: reclaim_api.c:392
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:36
struct GNUNET_RECLAIM_Operation * op_head
Head of active operations.
Definition: reclaim_api.c:332
#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:437
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:102
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_RECLAIM_attestation_store()

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

Store an attestation.

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

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

Definition at line 1189 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_ATTESTATION_STORE, GNUNET_MQ_msg_extra, GNUNET_MQ_send_copy(), GNUNET_new, GNUNET_RECLAIM_attestation_serialize(), GNUNET_RECLAIM_attestation_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_attestation_cont(), and attest_iter_finished().

1196 {
1197  struct GNUNET_RECLAIM_Operation *op;
1198  struct AttributeStoreMessage *sam;
1199  size_t attr_len;
1200 
1201  op = GNUNET_new (struct GNUNET_RECLAIM_Operation);
1202  op->h = h;
1203  op->as_cb = cont;
1204  op->cls = cont_cls;
1205  op->r_id = h->r_id_gen++;
1208  op->env = GNUNET_MQ_msg_extra (sam,
1209  attr_len,
1211  sam->identity = *pkey;
1212  sam->id = htonl (op->r_id);
1213  sam->exp = GNUNET_htonll (exp_interval->rel_value_us);
1214 
1215  GNUNET_RECLAIM_attestation_serialize (attr, (char *) &sam[1]);
1216 
1217  sam->attr_len = htons (attr_len);
1218  if (NULL != h->mq)
1219  GNUNET_MQ_send_copy (h->mq, op->env);
1220  return op;
1221 }
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:107
GNUNET_RECLAIM_ContinuationWithStatus as_cb
Continuation to invoke after attribute store call.
Definition: reclaim_api.c:67
size_t GNUNET_RECLAIM_attestation_serialize(const struct GNUNET_RECLAIM_Attestation *attestation, char *result)
Serialize an attestation.
#define GNUNET_MESSAGE_TYPE_RECLAIM_ATTESTATION_STORE
#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:387
#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:337
struct GNUNET_MQ_Envelope * env
Envelope with the message for this queue entry.
Definition: reclaim_api.c:97
uint32_t r_id_gen
Request Id generator.
Definition: reclaim_api.c:392
uint32_t attr_len
The length of the attribute.
Definition: reclaim.h:55
size_t GNUNET_RECLAIM_attestation_serialize_get_size(const struct GNUNET_RECLAIM_Attestation *attestation)
Get required size for serialization buffer.
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:36
struct GNUNET_RECLAIM_Operation * op_head
Head of active operations.
Definition: reclaim_api.c:332
#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:437
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:102
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 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 1144 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().

1150 {
1151  struct GNUNET_RECLAIM_Operation *op;
1152  struct AttributeDeleteMessage *dam;
1153  size_t attr_len;
1154 
1155  op = GNUNET_new (struct GNUNET_RECLAIM_Operation);
1156  op->h = h;
1157  op->as_cb = cont;
1158  op->cls = cont_cls;
1159  op->r_id = h->r_id_gen++;
1162  op->env = GNUNET_MQ_msg_extra (dam,
1163  attr_len,
1165  dam->identity = *pkey;
1166  dam->id = htonl (op->r_id);
1167  GNUNET_RECLAIM_attribute_serialize (attr, (char *) &dam[1]);
1168 
1169  dam->attr_len = htons (attr_len);
1170  if (NULL != h->mq)
1171  GNUNET_MQ_send_copy (h->mq, op->env);
1172  return op;
1173 }
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:107
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
size_t GNUNET_RECLAIM_attribute_serialize(const struct GNUNET_RECLAIM_Attribute *attr, char *result)
Serialize an attribute.
size_t GNUNET_RECLAIM_attribute_serialize_get_size(const struct GNUNET_RECLAIM_Attribute *attr)
Get required size for serialization buffer.
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:387
#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:337
struct GNUNET_MQ_Envelope * env
Envelope with the message for this queue entry.
Definition: reclaim_api.c:97
uint32_t r_id_gen
Request Id generator.
Definition: reclaim_api.c:392
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:332
#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:437
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:102
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_RECLAIM_attestation_delete()

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

Delete an attestation.

Tickets used to share this attestation are updated accordingly.

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

Definition at line 1236 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_ATTESTATION_DELETE, GNUNET_MQ_msg_extra, GNUNET_MQ_send_copy(), GNUNET_new, GNUNET_RECLAIM_attestation_serialize(), GNUNET_RECLAIM_attestation_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_attestation_cont().

1242 {
1243  struct GNUNET_RECLAIM_Operation *op;
1244  struct AttributeDeleteMessage *dam;
1245  size_t attr_len;
1246 
1247  op = GNUNET_new (struct GNUNET_RECLAIM_Operation);
1248  op->h = h;
1249  op->as_cb = cont;
1250  op->cls = cont_cls;
1251  op->r_id = h->r_id_gen++;
1254  op->env = GNUNET_MQ_msg_extra (dam,
1255  attr_len,
1257  dam->identity = *pkey;
1258  dam->id = htonl (op->r_id);
1259  GNUNET_RECLAIM_attestation_serialize (attr, (char *) &dam[1]);
1260 
1261  dam->attr_len = htons (attr_len);
1262  if (NULL != h->mq)
1263  GNUNET_MQ_send_copy (h->mq, op->env);
1264  return op;
1265 }
#define GNUNET_MESSAGE_TYPE_RECLAIM_ATTESTATION_DELETE
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:107
GNUNET_RECLAIM_ContinuationWithStatus as_cb
Continuation to invoke after attribute store call.
Definition: reclaim_api.c:67
size_t GNUNET_RECLAIM_attestation_serialize(const struct GNUNET_RECLAIM_Attestation *attestation, char *result)
Serialize an attestation.
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:387
#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:337
struct GNUNET_MQ_Envelope * env
Envelope with the message for this queue entry.
Definition: reclaim_api.c:97
uint32_t r_id_gen
Request Id generator.
Definition: reclaim_api.c:392
size_t GNUNET_RECLAIM_attestation_serialize_get_size(const struct GNUNET_RECLAIM_Attestation *attestation)
Get required size for serialization buffer.
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:332
#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:437
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:144
uint32_t r_id
request id
Definition: reclaim_api.c:102
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 1293 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 attest_iter_finished(), code_redirect(), and list_attribute_cont().

1302 {
1304  struct GNUNET_MQ_Envelope *env;
1306  uint32_t rid;
1307 
1308  rid = h->r_id_gen++;
1310  it->h = h;
1311  it->error_cb = error_cb;
1312  it->error_cb_cls = error_cb_cls;
1313  it->finish_cb = finish_cb;
1314  it->finish_cb_cls = finish_cb_cls;
1315  it->proc = proc;
1316  it->proc_cls = proc_cls;
1317  it->r_id = rid;
1318  it->identity = *identity;
1320  env =
1322  msg->id = htonl (rid);
1323  msg->identity = *identity;
1324  if (NULL == h->mq)
1325  it->env = env;
1326  else
1327  GNUNET_MQ_send (h->mq, env);
1328  return it;
1329 }
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
Start a attribute iteration for the given identity.
Definition: reclaim.h:200
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:202
GNUNET_SCHEDULER_TaskCallback error_cb
Function to call on errors.
Definition: reclaim_api.c:217
GNUNET_RECLAIM_AttributeResult proc
The continuation to call with the results.
Definition: reclaim_api.c:207
struct GNUNET_RECLAIM_AttributeIterator * it_tail
Tail of active iterations.
Definition: reclaim_api.c:347
void * proc_cls
Closure for proc.
Definition: reclaim_api.c:212
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:387
Handle for a attribute iterator operation.
Definition: reclaim_api.c:177
uint32_t r_id
The operation id this zone iteration operation has.
Definition: reclaim_api.c:238
uint32_t r_id_gen
Request Id generator.
Definition: reclaim_api.c:392
struct GNUNET_CRYPTO_EcdsaPrivateKey identity
Identity.
Definition: reclaim.h:215
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:210
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:233
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:228
struct GNUNET_RECLAIM_AttributeIterator * it_head
Head of active iterations.
Definition: reclaim_api.c:342
void * error_cb_cls
Closure for error_cb.
Definition: reclaim_api.c:222
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:192
GNUNET_SCHEDULER_TaskCallback finish_cb
Function to call on completion.
Definition: reclaim_api.c:197
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 1339 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().

1340 {
1341  struct GNUNET_RECLAIM_Handle *h = it->h;
1343  struct GNUNET_MQ_Envelope *env;
1344 
1345  env =
1347  msg->id = htonl (it->r_id);
1348  GNUNET_MQ_send (h->mq, env);
1349 }
Handle to the service.
Definition: reclaim_api.c:312
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:387
uint32_t r_id
The operation id this zone iteration operation has.
Definition: reclaim_api.c:238
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:232
Ask for next result of attribute iteration for the given operation.
Definition: reclaim.h:222
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:192
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 1360 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().

1361 {
1362  struct GNUNET_RECLAIM_Handle *h = it->h;
1363  struct GNUNET_MQ_Envelope *env;
1365 
1366  if (NULL != h->mq)
1367  {
1368  env =
1370  msg->id = htonl (it->r_id);
1371  GNUNET_MQ_send (h->mq, env);
1372  }
1373  free_it (it);
1374 }
Handle to the service.
Definition: reclaim_api.c:312
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
Stop attribute iteration for the given operation.
Definition: reclaim.h:295
#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:387
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:305
uint32_t r_id
The operation id this zone iteration operation has.
Definition: reclaim_api.c:238
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:450
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:192
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_RECLAIM_get_attestations_start()

struct GNUNET_RECLAIM_AttestationIterator* GNUNET_RECLAIM_get_attestations_start ( struct GNUNET_RECLAIM_Handle h,
const struct GNUNET_CRYPTO_EcdsaPrivateKey identity,
GNUNET_SCHEDULER_TaskCallback  error_cb,
void *  error_cb_cls,
GNUNET_RECLAIM_AttestationResult  proc,
void *  proc_cls,
GNUNET_SCHEDULER_TaskCallback  finish_cb,
void *  finish_cb_cls 
)

List all attestations for a local identity.

This MUST lock the struct GNUNET_RECLAIM_Handle for any other calls than GNUNET_RECLAIM_get_attestations_next() and GNUNET_RECLAIM_get_attestations_stop. proc will be called once immediately, and then again after GNUNET_RECLAIM_get_attestations_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 attestation
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 1402 of file reclaim_api.c.

References GNUNET_RECLAIM_Handle::ait_head, GNUNET_RECLAIM_Handle::ait_tail, GNUNET_RECLAIM_Operation::env, GNUNET_RECLAIM_AttestationIterator::env, GNUNET_RECLAIM_AttestationIterator::error_cb, error_cb(), GNUNET_RECLAIM_AttestationIterator::error_cb_cls, GNUNET_RECLAIM_AttestationIterator::finish_cb, GNUNET_RECLAIM_AttestationIterator::finish_cb_cls, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_MESSAGE_TYPE_RECLAIM_ATTESTATION_ITERATION_START, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_new, GNUNET_RECLAIM_Operation::h, GNUNET_RECLAIM_AttestationIterator::h, AttestationIterationStartMessage::id, identity, AttestationIterationStartMessage::identity, GNUNET_RECLAIM_AttestationIterator::identity, GNUNET_RECLAIM_Handle::mq, GNUNET_RECLAIM_Operation::msg, GNUNET_RECLAIM_AttestationIterator::proc, GNUNET_RECLAIM_AttestationIterator::proc_cls, GNUNET_RECLAIM_AttestationIterator::r_id, and GNUNET_RECLAIM_Handle::r_id_gen.

Referenced by list_attestation_cont(), oidc_attr_collect_finished_cb(), and start_process().

1411 {
1413  struct GNUNET_MQ_Envelope *env;
1415  uint32_t rid;
1416 
1417  rid = h->r_id_gen++;
1419  ait->h = h;
1420  ait->error_cb = error_cb;
1421  ait->error_cb_cls = error_cb_cls;
1422  ait->finish_cb = finish_cb;
1423  ait->finish_cb_cls = finish_cb_cls;
1424  ait->proc = proc;
1425  ait->proc_cls = proc_cls;
1426  ait->r_id = rid;
1427  ait->identity = *identity;
1429  env =
1430  GNUNET_MQ_msg (msg,
1432  msg->id = htonl (rid);
1433  msg->identity = *identity;
1434  if (NULL == h->mq)
1435  ait->env = env;
1436  else
1437  GNUNET_MQ_send (h->mq, env);
1438  return ait;
1439 }
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
GNUNET_SCHEDULER_TaskCallback finish_cb
Function to call on completion.
Definition: reclaim_api.c:264
struct GNUNET_CRYPTO_EcdsaPrivateKey identity
Identity.
Definition: reclaim.h:254
static void error_cb(void *cls)
Function called if lookup fails.
Definition: gnunet-abd.c:485
struct GNUNET_MQ_Envelope * env
Envelope of the message to send to the service, if not yet sent.
Definition: reclaim_api.c:295
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:249
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
Definition: gnunet_mq_lib.h:67
#define GNUNET_MESSAGE_TYPE_RECLAIM_ATTESTATION_ITERATION_START
#define GNUNET_new(type)
Allocate a struct or union of the given type.
uint32_t r_id
The operation id this zone iteration operation has.
Definition: reclaim_api.c:305
Start a attestation iteration for the given identity.
Definition: reclaim.h:239
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
void * finish_cb_cls
Closure for finish_cb.
Definition: reclaim_api.c:269
struct GNUNET_RECLAIM_Handle * h
Main handle to access the service.
Definition: reclaim_api.c:259
struct GNUNET_RECLAIM_AttestationIterator * ait_head
Head of active iterations.
Definition: reclaim_api.c:352
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:387
GNUNET_SCHEDULER_TaskCallback error_cb
Function to call on errors.
Definition: reclaim_api.c:284
uint32_t r_id_gen
Request Id generator.
Definition: reclaim_api.c:392
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.
Handle for a attestation iterator operation.
Definition: reclaim_api.c:244
void * error_cb_cls
Closure for error_cb.
Definition: reclaim_api.c:289
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_AttestationIterator * ait_tail
Tail of active iterations.
Definition: reclaim_api.c:357
GNUNET_RECLAIM_AttestationResult proc
The continuation to call with the results.
Definition: reclaim_api.c:274
struct GNUNET_CRYPTO_EcdsaPrivateKey identity
Private key of the zone.
Definition: reclaim_api.c:300
void * proc_cls
Closure for proc.
Definition: reclaim_api.c:279
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_RECLAIM_get_attestations_next()

void GNUNET_RECLAIM_get_attestations_next ( struct GNUNET_RECLAIM_AttestationIterator ait)

Calls the record processor specified in #GNUNET_RECLAIM_get_attestation_start for the next record.

Parameters
itthe iterator

Definition at line 1449 of file reclaim_api.c.

References GNUNET_RECLAIM_Operation::env, GNUNET_MESSAGE_TYPE_RECLAIM_ATTESTATION_ITERATION_NEXT, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_RECLAIM_Operation::h, GNUNET_RECLAIM_AttestationIterator::h, AttestationIterationNextMessage::id, GNUNET_RECLAIM_Handle::mq, GNUNET_RECLAIM_Operation::msg, and GNUNET_RECLAIM_AttestationIterator::r_id.

Referenced by attest_collect(), attest_iter_cb(), and oidc_attest_collect().

1451 {
1452  struct GNUNET_RECLAIM_Handle *h = ait->h;
1454  struct GNUNET_MQ_Envelope *env;
1455 
1456  env =
1458  msg->id = htonl (ait->r_id);
1459  GNUNET_MQ_send (h->mq, env);
1460 }
Handle to the service.
Definition: reclaim_api.c:312
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
#define GNUNET_MESSAGE_TYPE_RECLAIM_ATTESTATION_ITERATION_NEXT
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:271
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
Definition: gnunet_mq_lib.h:67
uint32_t r_id
The operation id this zone iteration operation has.
Definition: reclaim_api.c:305
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
struct GNUNET_RECLAIM_Handle * h
Main handle to access the service.
Definition: reclaim_api.c:259
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:387
struct GNUNET_MQ_Envelope * env
Definition: 005.c:1
Ask for next result of attestation iteration for the given operation.
Definition: reclaim.h:261
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_get_attestations_stop()

void GNUNET_RECLAIM_get_attestations_stop ( struct GNUNET_RECLAIM_AttestationIterator ait)

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 1471 of file reclaim_api.c.

References GNUNET_RECLAIM_Operation::env, free_ait(), GNUNET_MESSAGE_TYPE_RECLAIM_ATTESTATION_ITERATION_STOP, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_RECLAIM_Operation::h, GNUNET_RECLAIM_AttestationIterator::h, AttestationIterationStopMessage::id, GNUNET_RECLAIM_Handle::mq, GNUNET_RECLAIM_Operation::msg, and GNUNET_RECLAIM_AttestationIterator::r_id.

Referenced by cleanup_handle(), and do_cleanup().

1473 {
1474  struct GNUNET_RECLAIM_Handle *h = ait->h;
1475  struct GNUNET_MQ_Envelope *env;
1477 
1478  if (NULL != h->mq)
1479  {
1480  env =
1481  GNUNET_MQ_msg (msg,
1483  msg->id = htonl (ait->r_id);
1484  GNUNET_MQ_send (h->mq, env);
1485  }
1486  free_ait (ait);
1487 }
Handle to the service.
Definition: reclaim_api.c:312
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
#define GNUNET_MESSAGE_TYPE_RECLAIM_ATTESTATION_ITERATION_STOP
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
Definition: gnunet_mq_lib.h:67
uint32_t r_id
The operation id this zone iteration operation has.
Definition: reclaim_api.c:305
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
struct GNUNET_RECLAIM_Handle * h
Main handle to access the service.
Definition: reclaim_api.c:259
Stop attestation iteration for the given operation.
Definition: reclaim.h:278
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:387
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:288
static void free_ait(struct GNUNET_RECLAIM_AttestationIterator *ait)
Free it.
Definition: reclaim_api.c:467
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_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_AttributeList 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 1504 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(), oidc_attest_collect_finished_cb(), and oidc_attr_collect_finished_cb().

1511 {
1512  struct GNUNET_RECLAIM_Operation *op;
1513  struct IssueTicketMessage *tim;
1514  size_t attr_len;
1515 
1516  fprintf (stderr, "Issuing ticket\n");
1517  op = GNUNET_new (struct GNUNET_RECLAIM_Operation);
1518  op->h = h;
1519  op->tr_cb = cb;
1520  op->cls = cb_cls;
1521  op->r_id = h->r_id_gen++;
1524  op->env = GNUNET_MQ_msg_extra (tim,
1525  attr_len,
1527  tim->identity = *iss;
1528  tim->rp = *rp;
1529  tim->id = htonl (op->r_id);
1530 
1531  GNUNET_RECLAIM_attribute_list_serialize (attrs, (char *) &tim[1]);
1532 
1533  tim->attr_len = htons (attr_len);
1534  if (NULL != h->mq)
1535  GNUNET_MQ_send_copy (h->mq, op->env);
1536  return op;
1537 }
#define GNUNET_MESSAGE_TYPE_RECLAIM_ISSUE_TICKET
struct GNUNET_CRYPTO_EcdsaPublicKey rp
Requesting party.
Definition: reclaim.h:387
struct GNUNET_RECLAIM_Handle * h
Main handle.
Definition: reclaim_api.c:46
void * cls
Closure for cont or cb.
Definition: reclaim_api.c:107
#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:382
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:387
#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:337
struct GNUNET_MQ_Envelope * env
Envelope with the message for this queue entry.
Definition: reclaim_api.c:97
uint32_t r_id_gen
Request Id generator.
Definition: reclaim_api.c:392
Ticket issue message.
Definition: reclaim.h:367
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:377
uint32_t attr_len
length of serialized attribute list
Definition: reclaim.h:392
size_t GNUNET_RECLAIM_attribute_list_serialize(const struct GNUNET_RECLAIM_AttributeList *attrs, char *result)
Serialize an attribute list.
GNUNET_RECLAIM_TicketCallback tr_cb
Ticket result callback.
Definition: reclaim_api.c:92
struct GNUNET_RECLAIM_Operation * op_head
Head of active operations.
Definition: reclaim_api.c:332
#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:437
size_t GNUNET_RECLAIM_attribute_list_serialize_get_size(const struct GNUNET_RECLAIM_AttributeList *attrs)
Get required size for serialization buffer.
static char * rp
Relying party.
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:144
uint32_t r_id
request id
Definition: reclaim_api.c:102
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 1692 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().

1698 {
1699  struct GNUNET_RECLAIM_Operation *op;
1700  struct RevokeTicketMessage *msg;
1701  uint32_t rid;
1702 
1703  rid = h->r_id_gen++;
1704  op = GNUNET_new (struct GNUNET_RECLAIM_Operation);
1705  op->h = h;
1706  op->rvk_cb = cb;
1707  op->cls = cb_cls;
1708  op->r_id = rid;
1711  msg->id = htonl (rid);
1712  msg->identity = *identity;
1713  msg->ticket = *ticket;
1714  if (NULL != h->mq)
1715  {
1716  GNUNET_MQ_send (h->mq, op->env);
1717  op->env = NULL;
1718  }
1719  return op;
1720 }
struct GNUNET_CRYPTO_EcdsaPrivateKey identity
Identity.
Definition: reclaim.h:415
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:107
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:410
#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:387
GNUNET_RECLAIM_ContinuationWithStatus rvk_cb
Revocation result callback.
Definition: reclaim_api.c:87
struct GNUNET_RECLAIM_Operation * op_tail
Tail of active operations.
Definition: reclaim_api.c:337
struct GNUNET_RECLAIM_Ticket ticket
The ticket to revoke.
Definition: reclaim.h:425
struct GNUNET_MQ_Envelope * env
Envelope with the message for this queue entry.
Definition: reclaim_api.c:97
uint32_t r_id_gen
Request Id generator.
Definition: reclaim_api.c:392
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:332
#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:400
#define GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET
uint32_t r_id
request id
Definition: reclaim_api.c:102
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_AttributeTicketResult  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 1553 of file reclaim_api.c.

References GNUNET_RECLAIM_Operation::atr_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().

1559 {
1560  struct GNUNET_RECLAIM_Operation *op;
1561  struct ConsumeTicketMessage *ctm;
1562 
1563  op = GNUNET_new (struct GNUNET_RECLAIM_Operation);
1564  op->h = h;
1565  op->atr_cb = cb;
1566  op->cls = cb_cls;
1567  op->r_id = h->r_id_gen++;
1570  ctm->identity = *identity;
1571  ctm->id = htonl (op->r_id);
1572  ctm->ticket = *ticket;
1573  if (NULL != h->mq)
1574  GNUNET_MQ_send_copy (h->mq, op->env);
1575  return op;
1576 }
struct GNUNET_RECLAIM_Handle * h
Main handle.
Definition: reclaim_api.c:46
void * cls
Closure for cont or cb.
Definition: reclaim_api.c:107
Ticket consume message.
Definition: reclaim.h:474
GNUNET_RECLAIM_AttributeTicketResult atr_cb
Attribute result callback.
Definition: reclaim_api.c:77
#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:387
struct GNUNET_RECLAIM_Operation * op_tail
Tail of active operations.
Definition: reclaim_api.c:337
struct GNUNET_CRYPTO_EcdsaPrivateKey identity
Identity.
Definition: reclaim.h:489
struct GNUNET_MQ_Envelope * env
Envelope with the message for this queue entry.
Definition: reclaim_api.c:97
uint32_t r_id_gen
Request Id generator.
Definition: reclaim_api.c:392
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:494
struct GNUNET_RECLAIM_Operation * op_head
Head of active operations.
Definition: reclaim_api.c:332
#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:437
#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:484
uint32_t r_id
request id
Definition: reclaim_api.c:102
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 1597 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().

1606 {
1607  struct GNUNET_RECLAIM_TicketIterator *it;
1608  struct GNUNET_MQ_Envelope *env;
1610  uint32_t rid;
1611 
1612  rid = h->r_id_gen++;
1614  it->h = h;
1615  it->error_cb = error_cb;
1616  it->error_cb_cls = error_cb_cls;
1617  it->finish_cb = finish_cb;
1618  it->finish_cb_cls = finish_cb_cls;
1619  it->tr_cb = proc;
1620  it->cls = proc_cls;
1621  it->r_id = rid;
1624  msg->id = htonl (rid);
1625  msg->identity = *identity;
1626  if (NULL == h->mq)
1627  it->env = env;
1628  else
1629  GNUNET_MQ_send (h->mq, env);
1630  return it;
1631 }
struct GNUNET_RECLAIM_TicketIterator * ticket_it_tail
Tail of active iterations.
Definition: reclaim_api.c:367
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
struct GNUNET_CRYPTO_EcdsaPrivateKey identity
Identity.
Definition: reclaim.h:326
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:139
#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:129
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:387
struct GNUNET_MQ_Envelope * env
Envelope of the message to send to the service, if not yet sent.
Definition: reclaim_api.c:165
void * error_cb_cls
Closure for error_cb.
Definition: reclaim_api.c:159
uint32_t r_id_gen
Request Id generator.
Definition: reclaim_api.c:392
uint32_t r_id
The operation id this zone iteration operation has.
Definition: reclaim_api.c:170
void * cls
Closure for tr_cb.
Definition: reclaim_api.c:149
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:154
GNUNET_RECLAIM_TicketCallback tr_cb
The continuation to call with the results.
Definition: reclaim_api.c:144
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:321
Start a ticket iteration for the given identity.
Definition: reclaim.h:311
Handle for a ticket iterator operation.
Definition: reclaim_api.c:114
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:134
struct GNUNET_RECLAIM_TicketIterator * ticket_it_head
Head of active iterations.
Definition: reclaim_api.c:362
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 1641 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().

1642 {
1643  struct GNUNET_RECLAIM_Handle *h = it->h;
1645  struct GNUNET_MQ_Envelope *env;
1646 
1648  msg->id = htonl (it->r_id);
1649  GNUNET_MQ_send (h->mq, env);
1650 }
Handle to the service.
Definition: reclaim_api.c:312
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:129
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:333
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:343
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:387
uint32_t r_id
The operation id this zone iteration operation has.
Definition: reclaim_api.c:170
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 1661 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().

1662 {
1663  struct GNUNET_RECLAIM_Handle *h = it->h;
1664  struct GNUNET_MQ_Envelope *env;
1666 
1667  if (NULL != h->mq)
1668  {
1669  env =
1671  msg->id = htonl (it->r_id);
1672  GNUNET_MQ_send (h->mq, env);
1673  }
1674  GNUNET_free (it);
1675 }
Handle to the service.
Definition: reclaim_api.c:312
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:129
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:387
Stop ticket iteration for the given operation.
Definition: reclaim.h:350
uint32_t r_id
The operation id this zone iteration operation has.
Definition: reclaim_api.c:170
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:360
#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 1066 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().

1067 {
1068  GNUNET_assert (NULL != h);
1069  if (NULL != h->mq)
1070  {
1071  GNUNET_MQ_destroy (h->mq);
1072  h->mq = NULL;
1073  }
1074  if (NULL != h->reconnect_task)
1075  {
1077  h->reconnect_task = NULL;
1078  }
1079  GNUNET_assert (NULL == h->op_head);
1080  GNUNET_free (h);
1081 }
struct GNUNET_SCHEDULER_Task * reconnect_task
Task doing exponential back-off trying to reconnect.
Definition: reclaim_api.c:377
#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:387
struct GNUNET_RECLAIM_Operation * op_head
Head of active operations.
Definition: reclaim_api.c:332
void GNUNET_MQ_destroy(struct GNUNET_MQ_Handle *mq)
Destroy the message queue.
Definition: mq.c:831
#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:974
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 1051 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().

1052 {
1053  struct GNUNET_RECLAIM_Handle *h = op->h;
1054 
1056  free_op (op);
1057 }
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
Handle to the service.
Definition: reclaim_api.c:312
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:337
struct GNUNET_RECLAIM_Operation * op_head
Head of active operations.
Definition: reclaim_api.c:332
static void free_op(struct GNUNET_RECLAIM_Operation *op)
Free op.
Definition: reclaim_api.c:484
Here is the call graph for this function:
Here is the caller graph for this function: