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

Data Structures

struct  GNUNET_RECLAIM_Ticket
 The authorization ticket. More...
 

Macros

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

Typedefs

typedef void(* GNUNET_RECLAIM_TicketCallback) (void *cls, const struct GNUNET_RECLAIM_Ticket *ticket)
 Method called when a token has been issued. More...
 
typedef void(* GNUNET_RECLAIM_ContinuationWithStatus) (void *cls, int32_t success, const char *emsg)
 Continuation called to notify client about result of the operation. More...
 
typedef void(* GNUNET_RECLAIM_AttributeResult) (void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr, const struct GNUNET_RECLAIM_ATTESTATION_Claim *attest, const struct GNUNET_RECLAIM_ATTESTATION_REFERENCE *reference)
 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_attestation_store (struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, const struct GNUNET_RECLAIM_ATTESTATION_Claim *attr, 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_Claim *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_Claim *attr, GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls)
 Delete an attestation. More...
 
struct GNUNET_RECLAIM_OperationGNUNET_RECLAIM_attestation_reference_delete (struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, const struct GNUNET_RECLAIM_ATTESTATION_REFERENCE *attr, GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls)
 Delete an attestation reference. 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...
 
struct GNUNET_RECLAIM_OperationGNUNET_RECLAIM_attestation_reference_store (struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, const struct GNUNET_RECLAIM_ATTESTATION_REFERENCE *attr, const struct GNUNET_TIME_Relative *exp_interval, GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls)
 Store an attestation reference. 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, const struct GNUNET_RECLAIM_ATTESTATION_Claim *attest, const struct GNUNET_RECLAIM_ATTESTATION_REFERENCE *reference)

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 1004 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_attestation_ref_cont(), add_attribute_cont(), code_redirect(), consume_ticket_cont(), delete_attestation_cont(), delete_attestation_ref_cont(), delete_attribute_cont(), list_attestation_cont(), list_attribute_cont(), list_reference_cont(), list_tickets_cont(), revoke_ticket_cont(), run(), and userinfo_endpoint().

1005 {
1006  struct GNUNET_RECLAIM_Handle *h;
1007 
1008  h = GNUNET_new (struct GNUNET_RECLAIM_Handle);
1009  h->cfg = cfg;
1010  reconnect (h);
1011  if (NULL == h->mq)
1012  {
1013  GNUNET_free (h);
1014  return NULL;
1015  }
1016  return h;
1017 }
Handle to the service.
Definition: reclaim_api.c:235
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
Definition: gnunet-abd.c:36
#define GNUNET_new(type)
Allocate a struct or union of the given type.
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
static void reconnect(struct GNUNET_RECLAIM_Handle *h)
Try again to connect to the service.
Definition: reclaim_api.c:951
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:300
const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration to use.
Definition: reclaim_api.c:240
#define GNUNET_free(ptr)
Wrapper around free.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_RECLAIM_attribute_store()

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

Store an attribute.

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

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

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

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

Definition at line 1075 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().

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

◆ GNUNET_RECLAIM_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_Claim 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 1166 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().

1173 {
1174  struct GNUNET_RECLAIM_Operation *op;
1175  struct AttributeStoreMessage *sam;
1176  size_t attr_len;
1177 
1178  op = GNUNET_new (struct GNUNET_RECLAIM_Operation);
1179  op->h = h;
1180  op->as_cb = cont;
1181  op->cls = cont_cls;
1182  op->r_id = h->r_id_gen++;
1185  op->env = GNUNET_MQ_msg_extra (sam,
1186  attr_len,
1188  sam->identity = *pkey;
1189  sam->id = htonl (op->r_id);
1190  sam->exp = GNUNET_htonll (exp_interval->rel_value_us);
1191 
1192  GNUNET_RECLAIM_ATTESTATION_serialize (attr, (char *) &sam[1]);
1193 
1194  sam->attr_len = htons (attr_len);
1195  if (NULL != h->mq)
1196  GNUNET_MQ_send_copy (h->mq, op->env);
1197  return op;
1198 }
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.
size_t GNUNET_RECLAIM_ATTESTATION_serialize_get_size(const struct GNUNET_RECLAIM_ATTESTATION_Claim *attr)
Get required size for serialization buffer FIXME:
void * cls
Closure for cont or cb.
Definition: reclaim_api.c:97
GNUNET_RECLAIM_ContinuationWithStatus as_cb
Continuation to invoke after attribute store call.
Definition: reclaim_api.c:67
#define GNUNET_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:300
#define GNUNET_MQ_msg_extra(mvar, esize, type)
Allocate an envelope, with extra space allocated after the space needed by the message struct...
Definition: gnunet_mq_lib.h:52
struct GNUNET_RECLAIM_Operation * op_tail
Tail of active operations.
Definition: reclaim_api.c:260
struct GNUNET_MQ_Envelope * env
Envelope with the message for this queue entry.
Definition: reclaim_api.c:87
uint32_t r_id_gen
Request Id generator.
Definition: reclaim_api.c:305
uint32_t attr_len
The length of the attribute.
Definition: reclaim.h:55
size_t GNUNET_RECLAIM_ATTESTATION_serialize(const struct GNUNET_RECLAIM_ATTESTATION_Claim *attr, char *result)
Serialize an attestation.
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:255
#define GNUNET_CONTAINER_DLL_insert_tail(head, tail, element)
Insert an element at the tail of a DLL.
void GNUNET_MQ_send_copy(struct GNUNET_MQ_Handle *mq, const struct GNUNET_MQ_Envelope *ev)
Send a copy of a message with the given message queue.
Definition: mq.c:432
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:144
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:50
uint32_t r_id
request id
Definition: reclaim_api.c:92
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_RECLAIM_attribute_delete()

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

Delete an attribute.

Tickets used to share this attribute are updated accordingly.

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

Definition at line 1122 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().

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

◆ GNUNET_RECLAIM_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_Claim 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 1212 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().

1218 {
1219  struct GNUNET_RECLAIM_Operation *op;
1220  struct AttributeDeleteMessage *dam;
1221  size_t attr_len;
1222 
1223  op = GNUNET_new (struct GNUNET_RECLAIM_Operation);
1224  op->h = h;
1225  op->as_cb = cont;
1226  op->cls = cont_cls;
1227  op->r_id = h->r_id_gen++;
1230  op->env = GNUNET_MQ_msg_extra (dam,
1231  attr_len,
1233  dam->identity = *pkey;
1234  dam->id = htonl (op->r_id);
1235  GNUNET_RECLAIM_ATTESTATION_serialize (attr, (char *) &dam[1]);
1236 
1237  dam->attr_len = htons (attr_len);
1238  if (NULL != h->mq)
1239  GNUNET_MQ_send_copy (h->mq, op->env);
1240  return op;
1241 }
#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.
size_t GNUNET_RECLAIM_ATTESTATION_serialize_get_size(const struct GNUNET_RECLAIM_ATTESTATION_Claim *attr)
Get required size for serialization buffer FIXME:
void * cls
Closure for cont or cb.
Definition: reclaim_api.c:97
GNUNET_RECLAIM_ContinuationWithStatus as_cb
Continuation to invoke after attribute store call.
Definition: reclaim_api.c:67
struct GNUNET_CRYPTO_EcdsaPrivateKey identity
Identity.
Definition: reclaim.h:94
Use to delete an identity attribute.
Definition: reclaim.h:74
#define GNUNET_new(type)
Allocate a struct or union of the given type.
uint32_t attr_len
The length of the attribute.
Definition: reclaim.h:89
Handle for an operation with the service.
Definition: reclaim_api.c:41
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:300
#define GNUNET_MQ_msg_extra(mvar, esize, type)
Allocate an envelope, with extra space allocated after the space needed by the message struct...
Definition: gnunet_mq_lib.h:52
struct GNUNET_RECLAIM_Operation * op_tail
Tail of active operations.
Definition: reclaim_api.c:260
struct GNUNET_MQ_Envelope * env
Envelope with the message for this queue entry.
Definition: reclaim_api.c:87
uint32_t r_id_gen
Request Id generator.
Definition: reclaim_api.c:305
size_t GNUNET_RECLAIM_ATTESTATION_serialize(const struct GNUNET_RECLAIM_ATTESTATION_Claim *attr, char *result)
Serialize an attestation.
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:84
struct GNUNET_RECLAIM_Operation * op_head
Head of active operations.
Definition: reclaim_api.c:255
#define GNUNET_CONTAINER_DLL_insert_tail(head, tail, element)
Insert an element at the tail of a DLL.
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 struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:144
uint32_t r_id
request id
Definition: reclaim_api.c:92
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_RECLAIM_attestation_reference_delete()

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

Delete an attestation reference.

Tickets used to share this reference are updated accordingly.

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

Definition at line 1301 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_REFERENCE_DELETE, GNUNET_MQ_msg_extra, GNUNET_MQ_send_copy(), GNUNET_new, GNUNET_RECLAIM_ATTESTATION_REF_serialize(), GNUNET_RECLAIM_ATTESTATION_REF_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_ref_cont().

1307 {
1308 
1309  struct GNUNET_RECLAIM_Operation *op;
1310  struct AttributeDeleteMessage *dam;
1311  size_t attr_len;
1312 
1313  op = GNUNET_new (struct GNUNET_RECLAIM_Operation);
1314  op->h = h;
1315  op->as_cb = cont;
1316  op->cls = cont_cls;
1317  op->r_id = h->r_id_gen++;
1320  op->env = GNUNET_MQ_msg_extra (dam,
1321  attr_len,
1323  dam->identity = *pkey;
1324  dam->id = htonl (op->r_id);
1325  GNUNET_RECLAIM_ATTESTATION_REF_serialize (attr, (char *) &dam[1]);
1326 
1327  dam->attr_len = htons (attr_len);
1328  if (NULL != h->mq)
1329  GNUNET_MQ_send_copy (h->mq, op->env);
1330  return op;
1331 }
struct GNUNET_RECLAIM_Handle * h
Main handle.
Definition: reclaim_api.c:46
static char * pkey
Public key of the zone to look in, in ASCII.
void * cls
Closure for cont or cb.
Definition: reclaim_api.c:97
GNUNET_RECLAIM_ContinuationWithStatus as_cb
Continuation to invoke after attribute store call.
Definition: reclaim_api.c:67
struct GNUNET_CRYPTO_EcdsaPrivateKey identity
Identity.
Definition: reclaim.h:94
Use to delete an identity attribute.
Definition: reclaim.h:74
#define GNUNET_new(type)
Allocate a struct or union of the given type.
uint32_t attr_len
The length of the attribute.
Definition: reclaim.h:89
Handle for an operation with the service.
Definition: reclaim_api.c:41
size_t GNUNET_RECLAIM_ATTESTATION_REF_serialize(const struct GNUNET_RECLAIM_ATTESTATION_REFERENCE *attr, char *result)
Serialize a reference.
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:300
#define GNUNET_MQ_msg_extra(mvar, esize, type)
Allocate an envelope, with extra space allocated after the space needed by the message struct...
Definition: gnunet_mq_lib.h:52
struct GNUNET_RECLAIM_Operation * op_tail
Tail of active operations.
Definition: reclaim_api.c:260
#define GNUNET_MESSAGE_TYPE_RECLAIM_REFERENCE_DELETE
Next available: 1500.
struct GNUNET_MQ_Envelope * env
Envelope with the message for this queue entry.
Definition: reclaim_api.c:87
uint32_t r_id_gen
Request Id generator.
Definition: reclaim_api.c:305
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:84
struct GNUNET_RECLAIM_Operation * op_head
Head of active operations.
Definition: reclaim_api.c:255
#define GNUNET_CONTAINER_DLL_insert_tail(head, tail, element)
Insert an element at the tail of a DLL.
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_ATTESTATION_REF_serialize_get_size(const struct GNUNET_RECLAIM_ATTESTATION_REFERENCE *attr)
Get required size for serialization buffer.
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:144
uint32_t r_id
request id
Definition: reclaim_api.c:92
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_RECLAIM_get_attributes_start()

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

List all attributes for a local identity.

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

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

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

Definition at line 1358 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_attestation_cont(), list_attribute_cont(), list_reference_cont(), and start_process().

1367 {
1369  struct GNUNET_MQ_Envelope *env;
1371  uint32_t rid;
1372 
1373  rid = h->r_id_gen++;
1375  it->h = h;
1376  it->error_cb = error_cb;
1377  it->error_cb_cls = error_cb_cls;
1378  it->finish_cb = finish_cb;
1379  it->finish_cb_cls = finish_cb_cls;
1380  it->proc = proc;
1381  it->proc_cls = proc_cls;
1382  it->r_id = rid;
1383  it->identity = *identity;
1385  env =
1387  msg->id = htonl (rid);
1388  msg->identity = *identity;
1389  if (NULL == h->mq)
1390  it->env = env;
1391  else
1392  GNUNET_MQ_send (h->mq, env);
1393  return it;
1394 }
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
Start a attribute iteration for the given identity.
Definition: reclaim.h:199
static void error_cb(void *cls)
Function called if lookup fails.
Definition: gnunet-abd.c:485
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
Definition: gnunet_mq_lib.h:67
#define GNUNET_new(type)
Allocate a struct or union of the given type.
void * finish_cb_cls
Closure for finish_cb.
Definition: reclaim_api.c:192
GNUNET_SCHEDULER_TaskCallback error_cb
Function to call on errors.
Definition: reclaim_api.c:207
GNUNET_RECLAIM_AttributeResult proc
The continuation to call with the results.
Definition: reclaim_api.c:197
struct GNUNET_RECLAIM_AttributeIterator * it_tail
Tail of active iterations.
Definition: reclaim_api.c:270
void * proc_cls
Closure for proc.
Definition: reclaim_api.c:202
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:300
Handle for a attribute iterator operation.
Definition: reclaim_api.c:167
uint32_t r_id
The operation id this zone iteration operation has.
Definition: reclaim_api.c:228
uint32_t r_id_gen
Request Id generator.
Definition: reclaim_api.c:305
struct GNUNET_CRYPTO_EcdsaPrivateKey identity
Identity.
Definition: reclaim.h:214
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:209
static struct GNUNET_IDENTITY_Handle * identity
Which namespace do we publish to? NULL if we do not publish to a namespace.
struct GNUNET_CRYPTO_EcdsaPrivateKey identity
Private key of the zone.
Definition: reclaim_api.c:223
struct GNUNET_MQ_Envelope * env
Definition: 005.c:1
#define GNUNET_CONTAINER_DLL_insert_tail(head, tail, element)
Insert an element at the tail of a DLL.
#define GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_START
struct GNUNET_MQ_Envelope * env
Envelope of the message to send to the service, if not yet sent.
Definition: reclaim_api.c:218
struct GNUNET_RECLAIM_AttributeIterator * it_head
Head of active iterations.
Definition: reclaim_api.c:265
void * error_cb_cls
Closure for error_cb.
Definition: reclaim_api.c:212
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
Definition: mq.c:353
struct GNUNET_RECLAIM_Handle * h
Main handle to access the service.
Definition: reclaim_api.c:182
GNUNET_SCHEDULER_TaskCallback finish_cb
Function to call on completion.
Definition: reclaim_api.c:187
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_RECLAIM_attestation_reference_store()

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

Store an attestation reference.

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

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

Definition at line 1256 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_REFERENCE_STORE, GNUNET_MQ_msg_extra, GNUNET_MQ_send_copy(), GNUNET_new, GNUNET_RECLAIM_ATTESTATION_REF_serialize(), GNUNET_RECLAIM_ATTESTATION_REF_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_ref_cont().

1263 {
1264  struct GNUNET_RECLAIM_Operation *op;
1265  struct AttributeStoreMessage *sam;
1266  size_t attr_len;
1267  op = GNUNET_new (struct GNUNET_RECLAIM_Operation);
1268  op->h = h;
1269  op->as_cb = cont;
1270  op->cls = cont_cls;
1271  op->r_id = h->r_id_gen++;
1274  op->env = GNUNET_MQ_msg_extra (sam,
1275  attr_len,
1277  sam->identity = *pkey;
1278  sam->id = htonl (op->r_id);
1279  sam->exp = GNUNET_htonll (exp_interval->rel_value_us);
1280 
1281  GNUNET_RECLAIM_ATTESTATION_REF_serialize (attr, (char *) &sam[1]);
1282 
1283  sam->attr_len = htons (attr_len);
1284  if (NULL != h->mq)
1285  GNUNET_MQ_send_copy (h->mq, op->env);
1286  return op;
1287 }
struct GNUNET_CRYPTO_EcdsaPrivateKey identity
Identity.
Definition: reclaim.h:65
struct GNUNET_RECLAIM_Handle * h
Main handle.
Definition: reclaim_api.c:46
uint64_t rel_value_us
The actual value.
static char * pkey
Public key of the zone to look in, in ASCII.
void * cls
Closure for cont or cb.
Definition: reclaim_api.c:97
GNUNET_RECLAIM_ContinuationWithStatus as_cb
Continuation to invoke after attribute store call.
Definition: reclaim_api.c:67
#define GNUNET_new(type)
Allocate a struct or union of the given type.
Handle for an operation with the service.
Definition: reclaim_api.c:41
Use to store an identity attribute.
Definition: reclaim.h:40
size_t GNUNET_RECLAIM_ATTESTATION_REF_serialize(const struct GNUNET_RECLAIM_ATTESTATION_REFERENCE *attr, char *result)
Serialize a reference.
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:300
#define GNUNET_MQ_msg_extra(mvar, esize, type)
Allocate an envelope, with extra space allocated after the space needed by the message struct...
Definition: gnunet_mq_lib.h:52
struct GNUNET_RECLAIM_Operation * op_tail
Tail of active operations.
Definition: reclaim_api.c:260
struct GNUNET_MQ_Envelope * env
Envelope with the message for this queue entry.
Definition: reclaim_api.c:87
uint32_t r_id_gen
Request Id generator.
Definition: reclaim_api.c:305
uint32_t attr_len
The length of the attribute.
Definition: reclaim.h:55
#define GNUNET_MESSAGE_TYPE_RECLAIM_REFERENCE_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:255
#define GNUNET_CONTAINER_DLL_insert_tail(head, tail, element)
Insert an element at the tail of a DLL.
void GNUNET_MQ_send_copy(struct GNUNET_MQ_Handle *mq, const struct GNUNET_MQ_Envelope *ev)
Send a copy of a message with the given message queue.
Definition: mq.c:432
size_t GNUNET_RECLAIM_ATTESTATION_REF_serialize_get_size(const struct GNUNET_RECLAIM_ATTESTATION_REFERENCE *attr)
Get required size for serialization buffer.
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:144
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:50
uint32_t r_id
request id
Definition: reclaim_api.c:92
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_RECLAIM_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 1404 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 attest_collect(), attr_collect(), iter_cb(), oidc_attr_collect(), and ref_collect().

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

◆ GNUNET_RECLAIM_get_attributes_stop()

void GNUNET_RECLAIM_get_attributes_stop ( struct GNUNET_RECLAIM_AttributeIterator it)

Stops iteration and releases the handle for further calls.

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

Parameters
itthe iterator

Definition at line 1425 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().

1426 {
1427  struct GNUNET_RECLAIM_Handle *h = it->h;
1428  struct GNUNET_MQ_Envelope *env;
1430 
1431  if (NULL != h->mq)
1432  {
1433  env =
1435  msg->id = htonl (it->r_id);
1436  GNUNET_MQ_send (h->mq, env);
1437  }
1438  free_it (it);
1439 }
Handle to the service.
Definition: reclaim_api.c:235
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
Stop attribute iteration for the given operation.
Definition: reclaim.h:238
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
Definition: gnunet_mq_lib.h:67
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:300
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:248
uint32_t r_id
The operation id this zone iteration operation has.
Definition: reclaim_api.c:228
struct GNUNET_MQ_Envelope * env
Definition: 005.c:1
#define GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_STOP
static void free_it(struct GNUNET_RECLAIM_AttributeIterator *it)
Free it.
Definition: reclaim_api.c:363
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
Definition: mq.c:353
struct GNUNET_RECLAIM_Handle * h
Main handle to access the service.
Definition: reclaim_api.c:182
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_RECLAIM_ticket_issue()

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

Issues a ticket to a relying party.

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

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

Issues a ticket to a relying party.

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

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

Definition at line 1456 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().

1463 {
1464  struct GNUNET_RECLAIM_Operation *op;
1465  struct IssueTicketMessage *tim;
1466  size_t attr_len;
1467 
1468  fprintf (stderr, "Issuing ticket\n");
1469  op = GNUNET_new (struct GNUNET_RECLAIM_Operation);
1470  op->h = h;
1471  op->tr_cb = cb;
1472  op->cls = cb_cls;
1473  op->r_id = h->r_id_gen++;
1476  op->env = GNUNET_MQ_msg_extra (tim,
1477  attr_len,
1479  tim->identity = *iss;
1480  tim->rp = *rp;
1481  tim->id = htonl (op->r_id);
1482 
1483  GNUNET_RECLAIM_ATTRIBUTE_list_serialize (attrs, (char *) &tim[1]);
1484 
1485  tim->attr_len = htons (attr_len);
1486  if (NULL != h->mq)
1487  GNUNET_MQ_send_copy (h->mq, op->env);
1488  return op;
1489 }
#define GNUNET_MESSAGE_TYPE_RECLAIM_ISSUE_TICKET
struct GNUNET_CRYPTO_EcdsaPublicKey rp
Requesting party.
Definition: reclaim.h:330
struct GNUNET_RECLAIM_Handle * h
Main handle.
Definition: reclaim_api.c:46
void * cls
Closure for cont or cb.
Definition: reclaim_api.c:97
#define GNUNET_new(type)
Allocate a struct or union of the given type.
Handle for an operation with the service.
Definition: reclaim_api.c:41
struct GNUNET_CRYPTO_EcdsaPrivateKey identity
Identity.
Definition: reclaim.h:325
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:300
#define GNUNET_MQ_msg_extra(mvar, esize, type)
Allocate an envelope, with extra space allocated after the space needed by the message struct...
Definition: gnunet_mq_lib.h:52
struct GNUNET_RECLAIM_Operation * op_tail
Tail of active operations.
Definition: reclaim_api.c:260
struct GNUNET_MQ_Envelope * env
Envelope with the message for this queue entry.
Definition: reclaim_api.c:87
uint32_t r_id_gen
Request Id generator.
Definition: reclaim_api.c:305
Ticket issue message.
Definition: reclaim.h:310
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:320
uint32_t attr_len
length of serialized attribute list
Definition: reclaim.h:335
GNUNET_RECLAIM_TicketCallback tr_cb
Ticket result callback.
Definition: reclaim_api.c:82
struct GNUNET_RECLAIM_Operation * op_head
Head of active operations.
Definition: reclaim_api.c:255
#define GNUNET_CONTAINER_DLL_insert_tail(head, tail, element)
Insert an element at the tail of a DLL.
void GNUNET_MQ_send_copy(struct GNUNET_MQ_Handle *mq, const struct GNUNET_MQ_Envelope *ev)
Send a copy of a message with the given message queue.
Definition: mq.c:432
static char * rp
Relying party.
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:144
size_t GNUNET_RECLAIM_ATTRIBUTE_list_serialize_get_size(const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs)
Get required size for serialization buffer.
size_t GNUNET_RECLAIM_ATTRIBUTE_list_serialize(const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs, char *result)
Serialize an attribute list.
uint32_t r_id
request id
Definition: reclaim_api.c:92
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_RECLAIM_ticket_revoke()

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

Revoked an issued ticket.

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

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

Definition at line 1644 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().

1650 {
1651  struct GNUNET_RECLAIM_Operation *op;
1652  struct RevokeTicketMessage *msg;
1653  uint32_t rid;
1654 
1655  rid = h->r_id_gen++;
1656  op = GNUNET_new (struct GNUNET_RECLAIM_Operation);
1657  op->h = h;
1658  op->rvk_cb = cb;
1659  op->cls = cb_cls;
1660  op->r_id = rid;
1663  msg->id = htonl (rid);
1664  msg->identity = *identity;
1665  msg->ticket = *ticket;
1666  if (NULL != h->mq)
1667  {
1668  GNUNET_MQ_send (h->mq, op->env);
1669  op->env = NULL;
1670  }
1671  return op;
1672 }
struct GNUNET_CRYPTO_EcdsaPrivateKey identity
Identity.
Definition: reclaim.h:358
struct GNUNET_RECLAIM_Handle * h
Main handle.
Definition: reclaim_api.c:46
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
void * cls
Closure for cont or cb.
Definition: reclaim_api.c:97
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:353
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
Definition: gnunet_mq_lib.h:67
#define GNUNET_new(type)
Allocate a struct or union of the given type.
Handle for an operation with the service.
Definition: reclaim_api.c:41
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
static struct GNUNET_RECLAIM_Ticket ticket
Ticket to consume.
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:300
GNUNET_RECLAIM_ContinuationWithStatus rvk_cb
Revocation result callback.
Definition: reclaim_api.c:77
struct GNUNET_RECLAIM_Operation * op_tail
Tail of active operations.
Definition: reclaim_api.c:260
struct GNUNET_RECLAIM_Ticket ticket
The ticket to revoke.
Definition: reclaim.h:368
struct GNUNET_MQ_Envelope * env
Envelope with the message for this queue entry.
Definition: reclaim_api.c:87
uint32_t r_id_gen
Request Id generator.
Definition: reclaim_api.c:305
static struct GNUNET_IDENTITY_Handle * identity
Which namespace do we publish to? NULL if we do not publish to a namespace.
struct GNUNET_RECLAIM_Operation * op_head
Head of active operations.
Definition: reclaim_api.c:255
#define GNUNET_CONTAINER_DLL_insert_tail(head, tail, element)
Insert an element at the tail of a DLL.
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
Definition: mq.c:353
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:144
Ticket revoke message.
Definition: reclaim.h:343
#define GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET
uint32_t r_id
request id
Definition: reclaim_api.c:92
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_RECLAIM_ticket_consume()

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

Consumes an issued ticket.

The ticket is used to retrieve identity information from the issuer

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

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

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

Definition at line 1505 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().

1511 {
1512  struct GNUNET_RECLAIM_Operation *op;
1513  struct ConsumeTicketMessage *ctm;
1514 
1515  op = GNUNET_new (struct GNUNET_RECLAIM_Operation);
1516  op->h = h;
1517  op->ar_cb = cb;
1518  op->cls = cb_cls;
1519  op->r_id = h->r_id_gen++;
1522  ctm->identity = *identity;
1523  ctm->id = htonl (op->r_id);
1524  ctm->ticket = *ticket;
1525  if (NULL != h->mq)
1526  GNUNET_MQ_send_copy (h->mq, op->env);
1527  return op;
1528 }
struct GNUNET_RECLAIM_Handle * h
Main handle.
Definition: reclaim_api.c:46
void * cls
Closure for cont or cb.
Definition: reclaim_api.c:97
Ticket consume message.
Definition: reclaim.h:417
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
Definition: gnunet_mq_lib.h:67
#define GNUNET_new(type)
Allocate a struct or union of the given type.
Handle for an operation with the service.
Definition: reclaim_api.c:41
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
static struct GNUNET_RECLAIM_Ticket ticket
Ticket to consume.
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:300
struct GNUNET_RECLAIM_Operation * op_tail
Tail of active operations.
Definition: reclaim_api.c:260
struct GNUNET_CRYPTO_EcdsaPrivateKey identity
Identity.
Definition: reclaim.h:432
struct GNUNET_MQ_Envelope * env
Envelope with the message for this queue entry.
Definition: reclaim_api.c:87
uint32_t r_id_gen
Request Id generator.
Definition: reclaim_api.c:305
static struct GNUNET_IDENTITY_Handle * identity
Which namespace do we publish to? NULL if we do not publish to a namespace.
struct GNUNET_RECLAIM_Ticket ticket
The ticket to consume.
Definition: reclaim.h:437
struct GNUNET_RECLAIM_Operation * op_head
Head of active operations.
Definition: reclaim_api.c:255
#define GNUNET_CONTAINER_DLL_insert_tail(head, tail, element)
Insert an element at the tail of a DLL.
GNUNET_RECLAIM_AttributeResult ar_cb
Attribute result callback.
Definition: reclaim_api.c:72
void GNUNET_MQ_send_copy(struct GNUNET_MQ_Handle *mq, const struct GNUNET_MQ_Envelope *ev)
Send a copy of a message with the given message queue.
Definition: mq.c:432
#define GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:144
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:427
uint32_t r_id
request id
Definition: reclaim_api.c:92
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_RECLAIM_ticket_iteration_start()

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

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

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

Definition at line 1549 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().

1558 {
1559  struct GNUNET_RECLAIM_TicketIterator *it;
1560  struct GNUNET_MQ_Envelope *env;
1562  uint32_t rid;
1563 
1564  rid = h->r_id_gen++;
1566  it->h = h;
1567  it->error_cb = error_cb;
1568  it->error_cb_cls = error_cb_cls;
1569  it->finish_cb = finish_cb;
1570  it->finish_cb_cls = finish_cb_cls;
1571  it->tr_cb = proc;
1572  it->cls = proc_cls;
1573  it->r_id = rid;
1576  msg->id = htonl (rid);
1577  msg->identity = *identity;
1578  if (NULL == h->mq)
1579  it->env = env;
1580  else
1581  GNUNET_MQ_send (h->mq, env);
1582  return it;
1583 }
struct GNUNET_RECLAIM_TicketIterator * ticket_it_tail
Tail of active iterations.
Definition: reclaim_api.c:280
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
struct GNUNET_CRYPTO_EcdsaPrivateKey identity
Identity.
Definition: reclaim.h:269
static void error_cb(void *cls)
Function called if lookup fails.
Definition: gnunet-abd.c:485
void * finish_cb_cls
Closure for finish_cb.
Definition: reclaim_api.c:129
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
Definition: gnunet_mq_lib.h:67
#define GNUNET_new(type)
Allocate a struct or union of the given type.
struct GNUNET_RECLAIM_Handle * h
Main handle to access the idp.
Definition: reclaim_api.c:119
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:300
struct GNUNET_MQ_Envelope * env
Envelope of the message to send to the service, if not yet sent.
Definition: reclaim_api.c:155
void * error_cb_cls
Closure for error_cb.
Definition: reclaim_api.c:149
uint32_t r_id_gen
Request Id generator.
Definition: reclaim_api.c:305
uint32_t r_id
The operation id this zone iteration operation has.
Definition: reclaim_api.c:160
void * cls
Closure for tr_cb.
Definition: reclaim_api.c:139
static struct GNUNET_IDENTITY_Handle * identity
Which namespace do we publish to? NULL if we do not publish to a namespace.
struct GNUNET_MQ_Envelope * env
Definition: 005.c:1
#define GNUNET_CONTAINER_DLL_insert_tail(head, tail, element)
Insert an element at the tail of a DLL.
#define GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_START
GNUNET_SCHEDULER_TaskCallback error_cb
Function to call on errors.
Definition: reclaim_api.c:144
GNUNET_RECLAIM_TicketCallback tr_cb
The continuation to call with the results.
Definition: reclaim_api.c:134
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:264
Start a ticket iteration for the given identity.
Definition: reclaim.h:254
Handle for a ticket iterator operation.
Definition: reclaim_api.c:104
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
Definition: mq.c:353
GNUNET_SCHEDULER_TaskCallback finish_cb
Function to call on completion.
Definition: reclaim_api.c:124
struct GNUNET_RECLAIM_TicketIterator * ticket_it_head
Head of active iterations.
Definition: reclaim_api.c:275
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_RECLAIM_ticket_iteration_next()

void GNUNET_RECLAIM_ticket_iteration_next ( struct GNUNET_RECLAIM_TicketIterator it)

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

Parameters
itthe iterator

Definition at line 1593 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().

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

◆ GNUNET_RECLAIM_ticket_iteration_stop()

void GNUNET_RECLAIM_ticket_iteration_stop ( struct GNUNET_RECLAIM_TicketIterator it)

Stops iteration and releases the handle for further calls.

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

Parameters
itthe iterator

Definition at line 1613 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().

1614 {
1615  struct GNUNET_RECLAIM_Handle *h = it->h;
1616  struct GNUNET_MQ_Envelope *env;
1618 
1619  if (NULL != h->mq)
1620  {
1621  env =
1623  msg->id = htonl (it->r_id);
1624  GNUNET_MQ_send (h->mq, env);
1625  }
1626  GNUNET_free (it);
1627 }
Handle to the service.
Definition: reclaim_api.c:235
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
Definition: gnunet_mq_lib.h:67
struct GNUNET_RECLAIM_Handle * h
Main handle to access the idp.
Definition: reclaim_api.c:119
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:300
Stop ticket iteration for the given operation.
Definition: reclaim.h:293
uint32_t r_id
The operation id this zone iteration operation has.
Definition: reclaim_api.c:160
struct GNUNET_MQ_Envelope * env
Definition: 005.c:1
#define GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_STOP
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
Definition: mq.c:353
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:303
#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 1044 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().

1045 {
1046  GNUNET_assert (NULL != h);
1047  if (NULL != h->mq)
1048  {
1049  GNUNET_MQ_destroy (h->mq);
1050  h->mq = NULL;
1051  }
1052  if (NULL != h->reconnect_task)
1053  {
1055  h->reconnect_task = NULL;
1056  }
1057  GNUNET_assert (NULL == h->op_head);
1058  GNUNET_free (h);
1059 }
struct GNUNET_SCHEDULER_Task * reconnect_task
Task doing exponential back-off trying to reconnect.
Definition: reclaim_api.c:290
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:300
struct GNUNET_RECLAIM_Operation * op_head
Head of active operations.
Definition: reclaim_api.c:255
void GNUNET_MQ_destroy(struct GNUNET_MQ_Handle *mq)
Destroy the message queue.
Definition: mq.c:824
#define GNUNET_free(ptr)
Wrapper around free.
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
Definition: scheduler.c:966
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_RECLAIM_cancel()

void GNUNET_RECLAIM_cancel ( struct GNUNET_RECLAIM_Operation op)

Cancel an identity provider operation.

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

Parameters
opoperation to cancel

Cancel an identity provider operation.

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

Parameters
opoperation to cancel

Definition at line 1029 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().

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