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_IssueTicketCallback) (void *cls, const struct GNUNET_RECLAIM_Ticket *ticket, const struct GNUNET_RECLAIM_PresentationList *presentations)
 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_IDENTITY_PublicKey *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_IDENTITY_PublicKey *identity, const struct GNUNET_RECLAIM_Attribute *attr, const struct GNUNET_RECLAIM_Presentation *presentation)
 Callback used to notify the client of attribute results. More...
 
typedef void(* GNUNET_RECLAIM_CredentialResult) (void *cls, const struct GNUNET_IDENTITY_PublicKey *identity, const struct GNUNET_RECLAIM_Credential *credential)
 Callback used to notify the client of credential 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_IDENTITY_PrivateKey *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_credential_store (struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_IDENTITY_PrivateKey *pkey, const struct GNUNET_RECLAIM_Credential *credential, const struct GNUNET_TIME_Relative *exp_interval, GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls)
 Store a credential. More...
 
struct GNUNET_RECLAIM_OperationGNUNET_RECLAIM_attribute_delete (struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_IDENTITY_PrivateKey *pkey, const struct GNUNET_RECLAIM_Attribute *attr, GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls)
 Delete an attribute. More...
 
struct GNUNET_RECLAIM_OperationGNUNET_RECLAIM_credential_delete (struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_IDENTITY_PrivateKey *pkey, const struct GNUNET_RECLAIM_Credential *cred, GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls)
 Delete a credential. More...
 
struct GNUNET_RECLAIM_AttributeIteratorGNUNET_RECLAIM_get_attributes_start (struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_IDENTITY_PrivateKey *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_CredentialIteratorGNUNET_RECLAIM_get_credentials_start (struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_IDENTITY_PrivateKey *identity, GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, GNUNET_RECLAIM_CredentialResult proc, void *proc_cls, GNUNET_SCHEDULER_TaskCallback finish_cb, void *finish_cb_cls)
 List all credentials for a local identity. More...
 
void GNUNET_RECLAIM_get_credentials_next (struct GNUNET_RECLAIM_CredentialIterator *ait)
 Calls the record processor specified in GNUNET_RECLAIM_get_credentials_start for the next record. More...
 
void GNUNET_RECLAIM_get_credentials_stop (struct GNUNET_RECLAIM_CredentialIterator *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_IDENTITY_PrivateKey *iss, const struct GNUNET_IDENTITY_PublicKey *rp, const struct GNUNET_RECLAIM_AttributeList *attrs, GNUNET_RECLAIM_IssueTicketCallback 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_IDENTITY_PrivateKey *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_IDENTITY_PrivateKey *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_IDENTITY_PrivateKey *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 48 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 retrieve identity attributes

Parameters
clsclosure
ticketthe ticket

Definition at line 95 of file gnunet_reclaim_service.h.

◆ GNUNET_RECLAIM_IssueTicketCallback

typedef void(* GNUNET_RECLAIM_IssueTicketCallback) (void *cls, const struct GNUNET_RECLAIM_Ticket *ticket, const struct GNUNET_RECLAIM_PresentationList *presentations)

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 retrieve identity attributes

Parameters
clsclosure
ticketthe ticket

Definition at line 107 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 121 of file gnunet_reclaim_service.h.

◆ GNUNET_RECLAIM_AttributeResult

typedef void(* GNUNET_RECLAIM_AttributeResult) (void *cls, const struct GNUNET_IDENTITY_PublicKey *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

Definition at line 132 of file gnunet_reclaim_service.h.

◆ GNUNET_RECLAIM_AttributeTicketResult

typedef void(* GNUNET_RECLAIM_AttributeTicketResult) (void *cls, const struct GNUNET_IDENTITY_PublicKey *identity, const struct GNUNET_RECLAIM_Attribute *attr, const struct GNUNET_RECLAIM_Presentation *presentation)

Callback used to notify the client of attribute results.

Parameters
clsThe callback closure
identityThe identity authoritative over the attributes
attrThe attribute
presentationThe presentation for the credential (may be NULL)

Definition at line 144 of file gnunet_reclaim_service.h.

◆ GNUNET_RECLAIM_CredentialResult

typedef void(* GNUNET_RECLAIM_CredentialResult) (void *cls, const struct GNUNET_IDENTITY_PublicKey *identity, const struct GNUNET_RECLAIM_Credential *credential)

Callback used to notify the client of credential results.

Parameters
clsThe callback closure
identityThe identity authoritative over the attributes
credentialThe credential
attributesthe parsed attributes

Definition at line 158 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 1063 of file reclaim_api.c.

1064 {
1065  struct GNUNET_RECLAIM_Handle *h;
1066 
1067  h = GNUNET_new (struct GNUNET_RECLAIM_Handle);
1068  h->cfg = cfg;
1069  reconnect (h);
1070  if (NULL == h->mq)
1071  {
1072  GNUNET_free (h);
1073  return NULL;
1074  }
1075  return h;
1076 }
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
Definition: gnunet-abd.c:36
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_free(ptr)
Wrapper around free.
static void reconnect(struct GNUNET_RECLAIM_Handle *h)
Try again to connect to the service.
Definition: reclaim_api.c:1014
struct GNUNET_MQ_Handle * mq
Our connection to the ARM service.
Definition: arm_api.c:107
const struct GNUNET_CONFIGURATION_Handle * cfg
The configuration that we are using.
Definition: arm_api.c:112
Handle to the service.
Definition: reclaim_api.c:318

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

Referenced by libgnunet_plugin_rest_openid_connect_init(), libgnunet_plugin_rest_reclaim_init(), and run().

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

1141 {
1142  struct GNUNET_RECLAIM_Operation *op;
1143  struct AttributeStoreMessage *sam;
1144  size_t attr_len;
1145 
1147  op->h = h;
1148  op->as_cb = cont;
1149  op->cls = cont_cls;
1150  op->r_id = h->r_id_gen++;
1151  GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, op);
1153  op->env = GNUNET_MQ_msg_extra (sam,
1154  attr_len,
1156  sam->identity = *pkey;
1157  sam->id = htonl (op->r_id);
1159 
1160  GNUNET_RECLAIM_attribute_serialize (attr, (char *) &sam[1]);
1161 
1162  sam->attr_len = htons (attr_len);
1163  if (NULL != h->mq)
1164  GNUNET_MQ_send_copy (h->mq, op->env);
1165  return op;
1166 }
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:144
static char * pkey
Public key of the zone to look in, in ASCII.
static struct GNUNET_TIME_Relative exp_interval
Attribute expiration interval.
uint64_t GNUNET_htonll(uint64_t n)
Convert unsigned 64-bit integer to network byte order.
Definition: common_endian.c:36
#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:443
#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
#define GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_STORE
size_t GNUNET_RECLAIM_attribute_serialize_get_size(const struct GNUNET_RECLAIM_Attribute *attr)
Get required size for serialization buffer.
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:41
uint32_t attr_len
The length of the attribute.
Definition: reclaim.h:55
uint64_t exp
The expiration interval of the attribute.
Definition: reclaim.h:60
struct GNUNET_IDENTITY_PrivateKey identity
Identity.
Definition: reclaim.h:65
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:50
struct GNUNET_ARM_Handle * h
ARM handle.
Definition: arm_api.c:55
Handle for an operation with the service.
Definition: reclaim_api.c:42
uint64_t rel_value_us
The actual value.

References AttributeStoreMessage::attr_len, AttributeStoreMessage::exp, exp_interval, 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_ARM_Operation::h, h, AttributeStoreMessage::id, AttributeStoreMessage::identity, GNUNET_ARM_Handle::mq, op, pkey, and GNUNET_TIME_Relative::rel_value_us.

Referenced by add_attribute_cont(), and iter_finished().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_RECLAIM_credential_store()

struct GNUNET_RECLAIM_Operation* GNUNET_RECLAIM_credential_store ( struct GNUNET_RECLAIM_Handle h,
const struct GNUNET_IDENTITY_PrivateKey pkey,
const struct GNUNET_RECLAIM_Credential attr,
const struct GNUNET_TIME_Relative exp_interval,
GNUNET_RECLAIM_ContinuationWithStatus  cont,
void *  cont_cls 
)

Store a credential.

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

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

Store a credential.

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

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

Definition at line 1226 of file reclaim_api.c.

1233 {
1234  struct GNUNET_RECLAIM_Operation *op;
1235  struct AttributeStoreMessage *sam;
1236  size_t attr_len;
1237 
1239  op->h = h;
1240  op->as_cb = cont;
1241  op->cls = cont_cls;
1242  op->r_id = h->r_id_gen++;
1243  GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, op);
1245  op->env = GNUNET_MQ_msg_extra (sam,
1246  attr_len,
1248  sam->identity = *pkey;
1249  sam->id = htonl (op->r_id);
1251 
1252  GNUNET_RECLAIM_credential_serialize (attr, (char *) &sam[1]);
1253 
1254  sam->attr_len = htons (attr_len);
1255  if (NULL != h->mq)
1256  GNUNET_MQ_send_copy (h->mq, op->env);
1257  return op;
1258 }
#define GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_STORE
size_t GNUNET_RECLAIM_credential_serialize(const struct GNUNET_RECLAIM_Credential *credential, char *result)
Serialize an credential.
size_t GNUNET_RECLAIM_credential_serialize_get_size(const struct GNUNET_RECLAIM_Credential *credential)
Get required size for serialization buffer.

References AttributeStoreMessage::attr_len, AttributeStoreMessage::exp, exp_interval, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_htonll(), GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_STORE, GNUNET_MQ_msg_extra, GNUNET_MQ_send_copy(), GNUNET_new, GNUNET_RECLAIM_credential_serialize(), GNUNET_RECLAIM_credential_serialize_get_size(), GNUNET_ARM_Operation::h, h, AttributeStoreMessage::id, AttributeStoreMessage::identity, GNUNET_ARM_Handle::mq, op, pkey, and GNUNET_TIME_Relative::rel_value_us.

Referenced by add_credential_cont(), and cred_iter_finished().

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

1187 {
1188  struct GNUNET_RECLAIM_Operation *op;
1189  struct AttributeDeleteMessage *dam;
1190  size_t attr_len;
1191 
1193  op->h = h;
1194  op->as_cb = cont;
1195  op->cls = cont_cls;
1196  op->r_id = h->r_id_gen++;
1197  GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, op);
1199  op->env = GNUNET_MQ_msg_extra (dam,
1200  attr_len,
1202  dam->identity = *pkey;
1203  dam->id = htonl (op->r_id);
1204  GNUNET_RECLAIM_attribute_serialize (attr, (char *) &dam[1]);
1205 
1206  dam->attr_len = htons (attr_len);
1207  if (NULL != h->mq)
1208  GNUNET_MQ_send_copy (h->mq, op->env);
1209  return op;
1210 }
#define GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_DELETE
Use to delete an identity attribute.
Definition: reclaim.h:75
uint32_t attr_len
The length of the attribute.
Definition: reclaim.h:89
struct GNUNET_IDENTITY_PrivateKey identity
Identity.
Definition: reclaim.h:94
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:84

References AttributeDeleteMessage::attr_len, 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_ARM_Operation::h, h, AttributeDeleteMessage::id, AttributeDeleteMessage::identity, GNUNET_ARM_Handle::mq, op, and pkey.

Referenced by delete_attribute_cont(), and iter_finished().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_RECLAIM_credential_delete()

struct GNUNET_RECLAIM_Operation* GNUNET_RECLAIM_credential_delete ( struct GNUNET_RECLAIM_Handle h,
const struct GNUNET_IDENTITY_PrivateKey pkey,
const struct GNUNET_RECLAIM_Credential attr,
GNUNET_RECLAIM_ContinuationWithStatus  cont,
void *  cont_cls 
)

Delete a credential.

Tickets used to share use a presentation of this credential are updated accordingly.

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

Delete a credential.

Tickets used to share this credential are updated accordingly.

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

Definition at line 1273 of file reclaim_api.c.

1279 {
1280  struct GNUNET_RECLAIM_Operation *op;
1281  struct AttributeDeleteMessage *dam;
1282  size_t attr_len;
1283 
1285  op->h = h;
1286  op->as_cb = cont;
1287  op->cls = cont_cls;
1288  op->r_id = h->r_id_gen++;
1289  GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, op);
1291  op->env = GNUNET_MQ_msg_extra (dam,
1292  attr_len,
1294  dam->identity = *pkey;
1295  dam->id = htonl (op->r_id);
1296  GNUNET_RECLAIM_credential_serialize (attr, (char *) &dam[1]);
1297 
1298  dam->attr_len = htons (attr_len);
1299  if (NULL != h->mq)
1300  GNUNET_MQ_send_copy (h->mq, op->env);
1301  return op;
1302 }
#define GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_DELETE

References AttributeDeleteMessage::attr_len, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_DELETE, GNUNET_MQ_msg_extra, GNUNET_MQ_send_copy(), GNUNET_new, GNUNET_RECLAIM_credential_serialize(), GNUNET_RECLAIM_credential_serialize_get_size(), GNUNET_ARM_Operation::h, h, AttributeDeleteMessage::id, AttributeDeleteMessage::identity, GNUNET_ARM_Handle::mq, op, and pkey.

Referenced by delete_credential_cont().

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

1339 {
1341  struct GNUNET_MQ_Envelope *env;
1343  uint32_t rid;
1344 
1345  rid = h->r_id_gen++;
1347  it->h = h;
1348  it->error_cb = error_cb;
1349  it->error_cb_cls = error_cb_cls;
1350  it->finish_cb = finish_cb;
1351  it->finish_cb_cls = finish_cb_cls;
1352  it->proc = proc;
1353  it->proc_cls = proc_cls;
1354  it->r_id = rid;
1355  it->identity = *identity;
1356  GNUNET_CONTAINER_DLL_insert_tail (h->it_head, h->it_tail, it);
1357  env =
1359  msg->id = htonl (rid);
1360  msg->identity = *identity;
1361  if (NULL == h->mq)
1362  it->env = env;
1363  else
1364  GNUNET_MQ_send (h->mq, env);
1365  return it;
1366 }
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
struct GNUNET_MQ_Envelope * env
Definition: 005.c:1
static void error_cb(void *cls)
Function called if lookup fails.
Definition: gnunet-abd.c:485
static struct GNUNET_IDENTITY_Handle * identity
Which namespace do we publish to? NULL if we do not publish to a namespace.
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:355
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
Definition: gnunet_mq_lib.h:67
#define GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_START
Start a attribute iteration for the given identity.
Definition: reclaim.h:201
Handle for a attribute iterator operation.
Definition: reclaim_api.c:183
struct GNUNET_RECLAIM_Handle * h
Main handle to access the service.
Definition: reclaim_api.c:197
void * error_cb_cls
Closure for error_cb.
Definition: reclaim_api.c:227
GNUNET_RECLAIM_AttributeResult proc
The continuation to call with the results.
Definition: reclaim_api.c:212
struct GNUNET_IDENTITY_PrivateKey identity
Private key of the zone.
Definition: reclaim_api.c:238
struct GNUNET_MQ_Envelope * env
Envelope of the message to send to the service, if not yet sent.
Definition: reclaim_api.c:233
void * proc_cls
Closure for proc.
Definition: reclaim_api.c:217
GNUNET_SCHEDULER_TaskCallback error_cb
Function to call on errors.
Definition: reclaim_api.c:222
GNUNET_SCHEDULER_TaskCallback finish_cb
Function to call on completion.
Definition: reclaim_api.c:202
uint32_t r_id
The operation id this zone iteration operation has.
Definition: reclaim_api.c:243
void * finish_cb_cls
Closure for finish_cb.
Definition: reclaim_api.c:207

References env, GNUNET_RECLAIM_AttributeIterator::env, error_cb(), GNUNET_RECLAIM_AttributeIterator::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, h, GNUNET_RECLAIM_AttributeIterator::h, identity, GNUNET_RECLAIM_AttributeIterator::identity, GNUNET_ARM_Handle::mq, msg, GNUNET_RECLAIM_AttributeIterator::proc, GNUNET_RECLAIM_AttributeIterator::proc_cls, and GNUNET_RECLAIM_AttributeIterator::r_id.

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

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

1377 {
1378  struct GNUNET_RECLAIM_Handle *h = it->h;
1380  struct GNUNET_MQ_Envelope *env;
1381 
1382  env =
1384  msg->id = htonl (it->r_id);
1385  GNUNET_MQ_send (h->mq, env);
1386 }
#define GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_NEXT
Ask for next result of attribute iteration for the given operation.
Definition: reclaim.h:223

References env, GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_NEXT, GNUNET_MQ_msg, GNUNET_MQ_send(), h, GNUNET_RECLAIM_AttributeIterator::h, GNUNET_ARM_Handle::mq, msg, and GNUNET_RECLAIM_AttributeIterator::r_id.

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

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

1398 {
1399  struct GNUNET_RECLAIM_Handle *h = it->h;
1400  struct GNUNET_MQ_Envelope *env;
1402 
1403  if (NULL != h->mq)
1404  {
1405  env =
1407  msg->id = htonl (it->r_id);
1408  GNUNET_MQ_send (h->mq, env);
1409  }
1410  free_it (it);
1411 }
#define GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_STOP
static void free_it(struct GNUNET_RECLAIM_AttributeIterator *it)
Free it.
Definition: reclaim_api.c:455
Stop attribute iteration for the given operation.
Definition: reclaim.h:296

References env, free_it(), GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_STOP, GNUNET_MQ_msg, GNUNET_MQ_send(), h, GNUNET_RECLAIM_AttributeIterator::h, GNUNET_ARM_Handle::mq, msg, and GNUNET_RECLAIM_AttributeIterator::r_id.

Referenced by cleanup_handle(), and do_cleanup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_RECLAIM_get_credentials_start()

struct GNUNET_RECLAIM_CredentialIterator* GNUNET_RECLAIM_get_credentials_start ( struct GNUNET_RECLAIM_Handle h,
const struct GNUNET_IDENTITY_PrivateKey identity,
GNUNET_SCHEDULER_TaskCallback  error_cb,
void *  error_cb_cls,
GNUNET_RECLAIM_CredentialResult  proc,
void *  proc_cls,
GNUNET_SCHEDULER_TaskCallback  finish_cb,
void *  finish_cb_cls 
)

List all credentials for a local identity.

This MUST lock the struct GNUNET_RECLAIM_Handle for any other calls than GNUNET_RECLAIM_get_credentials_next() and GNUNET_RECLAIM_get_credentials_stop. proc will be called once immediately, and then again after GNUNET_RECLAIM_get_credentials_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 credential
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 1439 of file reclaim_api.c.

1448 {
1450  struct GNUNET_MQ_Envelope *env;
1452  uint32_t rid;
1453 
1454  rid = h->r_id_gen++;
1456  ait->h = h;
1457  ait->error_cb = error_cb;
1458  ait->error_cb_cls = error_cb_cls;
1459  ait->finish_cb = finish_cb;
1460  ait->finish_cb_cls = finish_cb_cls;
1461  ait->proc = proc;
1462  ait->proc_cls = proc_cls;
1463  ait->r_id = rid;
1464  ait->identity = *identity;
1465  GNUNET_CONTAINER_DLL_insert_tail (h->ait_head, h->ait_tail, ait);
1466  env =
1467  GNUNET_MQ_msg (msg,
1469  msg->id = htonl (rid);
1470  msg->identity = *identity;
1471  if (NULL == h->mq)
1472  ait->env = env;
1473  else
1474  GNUNET_MQ_send (h->mq, env);
1475  return ait;
1476 }
#define GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_ITERATION_START
Start a credential iteration for the given identity.
Definition: reclaim.h:240
Handle for a credential iterator operation.
Definition: reclaim_api.c:250
GNUNET_SCHEDULER_TaskCallback error_cb
Function to call on errors.
Definition: reclaim_api.c:289
GNUNET_SCHEDULER_TaskCallback finish_cb
Function to call on completion.
Definition: reclaim_api.c:269
void * proc_cls
Closure for proc.
Definition: reclaim_api.c:284
GNUNET_RECLAIM_CredentialResult proc
The continuation to call with the results.
Definition: reclaim_api.c:279
void * finish_cb_cls
Closure for finish_cb.
Definition: reclaim_api.c:274
uint32_t r_id
The operation id this zone iteration operation has.
Definition: reclaim_api.c:310
struct GNUNET_IDENTITY_PrivateKey identity
Private key of the zone.
Definition: reclaim_api.c:305
struct GNUNET_MQ_Envelope * env
Envelope of the message to send to the service, if not yet sent.
Definition: reclaim_api.c:300
struct GNUNET_RECLAIM_Handle * h
Main handle to access the service.
Definition: reclaim_api.c:264
void * error_cb_cls
Closure for error_cb.
Definition: reclaim_api.c:294

References env, GNUNET_RECLAIM_CredentialIterator::env, error_cb(), GNUNET_RECLAIM_CredentialIterator::error_cb, GNUNET_RECLAIM_CredentialIterator::error_cb_cls, GNUNET_RECLAIM_CredentialIterator::finish_cb, GNUNET_RECLAIM_CredentialIterator::finish_cb_cls, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_ITERATION_START, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_new, h, GNUNET_RECLAIM_CredentialIterator::h, identity, GNUNET_RECLAIM_CredentialIterator::identity, GNUNET_ARM_Handle::mq, msg, GNUNET_RECLAIM_CredentialIterator::proc, GNUNET_RECLAIM_CredentialIterator::proc_cls, and GNUNET_RECLAIM_CredentialIterator::r_id.

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_RECLAIM_get_credentials_next()

void GNUNET_RECLAIM_get_credentials_next ( struct GNUNET_RECLAIM_CredentialIterator ait)

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

Parameters
itthe iterator

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

Parameters
itthe iterator

Definition at line 1486 of file reclaim_api.c.

1488 {
1489  struct GNUNET_RECLAIM_Handle *h = ait->h;
1491  struct GNUNET_MQ_Envelope *env;
1492 
1493  env =
1495  msg->id = htonl (ait->r_id);
1496  GNUNET_MQ_send (h->mq, env);
1497 }
#define GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_ITERATION_NEXT
Ask for next result of credential iteration for the given operation.
Definition: reclaim.h:262

References env, GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_ITERATION_NEXT, GNUNET_MQ_msg, GNUNET_MQ_send(), h, GNUNET_RECLAIM_CredentialIterator::h, GNUNET_ARM_Handle::mq, msg, and GNUNET_RECLAIM_CredentialIterator::r_id.

Referenced by cred_collect(), cred_iter_cb(), and oidc_cred_collect().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_RECLAIM_get_credentials_stop()

void GNUNET_RECLAIM_get_credentials_stop ( struct GNUNET_RECLAIM_CredentialIterator 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 1508 of file reclaim_api.c.

1510 {
1511  struct GNUNET_RECLAIM_Handle *h = ait->h;
1512  struct GNUNET_MQ_Envelope *env;
1514 
1515  if (NULL != h->mq)
1516  {
1517  env =
1518  GNUNET_MQ_msg (msg,
1520  msg->id = htonl (ait->r_id);
1521  GNUNET_MQ_send (h->mq, env);
1522  }
1523  free_ait (ait);
1524 }
#define GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_ITERATION_STOP
static void free_ait(struct GNUNET_RECLAIM_CredentialIterator *ait)
Free it.
Definition: reclaim_api.c:472
Stop credential iteration for the given operation.
Definition: reclaim.h:279

References env, free_ait(), GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_ITERATION_STOP, GNUNET_MQ_msg, GNUNET_MQ_send(), h, GNUNET_RECLAIM_CredentialIterator::h, GNUNET_ARM_Handle::mq, msg, and GNUNET_RECLAIM_CredentialIterator::r_id.

Referenced by cleanup_handle(), and do_cleanup().

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_IDENTITY_PrivateKey iss,
const struct GNUNET_IDENTITY_PublicKey rp,
const struct GNUNET_RECLAIM_AttributeList attrs,
GNUNET_RECLAIM_IssueTicketCallback  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 @GNUNET_RECLAIM_ticket_consume 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 1541 of file reclaim_api.c.

1548 {
1549  struct GNUNET_RECLAIM_Operation *op;
1550  struct IssueTicketMessage *tim;
1551  size_t attr_len;
1552 
1553  fprintf (stderr, "Issuing ticket\n");
1555  op->h = h;
1556  op->ti_cb = cb;
1557  op->cls = cb_cls;
1558  op->r_id = h->r_id_gen++;
1559  GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, op);
1561  op->env = GNUNET_MQ_msg_extra (tim,
1562  attr_len,
1564  tim->identity = *iss;
1565  tim->rp = *rp;
1566  tim->id = htonl (op->r_id);
1567 
1568  GNUNET_RECLAIM_attribute_list_serialize (attrs, (char *) &tim[1]);
1569 
1570  tim->attr_len = htons (attr_len);
1571  if (NULL != h->mq)
1572  GNUNET_MQ_send_copy (h->mq, op->env);
1573  return op;
1574 }
static char * rp
Relying party.
#define GNUNET_MESSAGE_TYPE_RECLAIM_ISSUE_TICKET
size_t GNUNET_RECLAIM_attribute_list_serialize(const struct GNUNET_RECLAIM_AttributeList *attrs, char *result)
Serialize an attribute list.
size_t GNUNET_RECLAIM_attribute_list_serialize_get_size(const struct GNUNET_RECLAIM_AttributeList *attrs)
Get required size for serialization buffer.
Ticket issue message.
Definition: reclaim.h:368
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
struct GNUNET_IDENTITY_PublicKey rp
Requesting party.
Definition: reclaim.h:387
struct GNUNET_IDENTITY_PrivateKey identity
Identity.
Definition: reclaim.h:382

References IssueTicketMessage::attr_len, 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_ARM_Operation::h, h, IssueTicketMessage::id, IssueTicketMessage::identity, GNUNET_ARM_Handle::mq, op, rp, and IssueTicketMessage::rp.

Referenced by iter_finished(), and oidc_cred_collect_finished_cb().

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

1737 {
1738  struct GNUNET_RECLAIM_Operation *op;
1739  struct RevokeTicketMessage *msg;
1740  uint32_t rid;
1741 
1742  rid = h->r_id_gen++;
1744  op->h = h;
1745  op->rvk_cb = cb;
1746  op->cls = cb_cls;
1747  op->r_id = rid;
1748  GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, op);
1750  msg->id = htonl (rid);
1751  msg->identity = *identity;
1752  msg->ticket = *ticket;
1753  if (NULL != h->mq)
1754  {
1755  GNUNET_MQ_send (h->mq, op->env);
1756  op->env = NULL;
1757  }
1758  return op;
1759 }
static struct GNUNET_RECLAIM_Ticket ticket
Ticket to consume.
#define GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET
Ticket revoke message.
Definition: reclaim.h:401

References GNUNET_CONTAINER_DLL_insert_tail, GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_new, GNUNET_ARM_Operation::h, h, identity, GNUNET_ARM_Handle::mq, msg, op, and ticket.

Referenced by iter_finished(), and revoke_ticket_cont().

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

1596 {
1597  struct GNUNET_RECLAIM_Operation *op;
1598  struct ConsumeTicketMessage *ctm;
1599 
1601  op->h = h;
1602  op->atr_cb = cb;
1603  op->cls = cb_cls;
1604  op->r_id = h->r_id_gen++;
1605  GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, op);
1607  ctm->identity = *identity;
1608  ctm->id = htonl (op->r_id);
1609  ctm->ticket = *ticket;
1610  if (NULL != h->mq)
1611  GNUNET_MQ_send_copy (h->mq, op->env);
1612  else
1613  reconnect (h);
1614  return op;
1615 }
#define GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET
Ticket consume message.
Definition: reclaim.h:482
struct GNUNET_RECLAIM_Ticket ticket
The ticket to consume.
Definition: reclaim.h:501
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:491
struct GNUNET_IDENTITY_PrivateKey identity
Identity.
Definition: reclaim.h:496

References GNUNET_CONTAINER_DLL_insert_tail, GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET, GNUNET_MQ_msg, GNUNET_MQ_send_copy(), GNUNET_new, GNUNET_ARM_Operation::h, h, ConsumeTicketMessage::id, identity, ConsumeTicketMessage::identity, GNUNET_ARM_Handle::mq, op, reconnect(), ticket, and ConsumeTicketMessage::ticket.

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

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

1645 {
1646  struct GNUNET_RECLAIM_TicketIterator *it;
1647  struct GNUNET_MQ_Envelope *env;
1649  uint32_t rid;
1650 
1651  rid = h->r_id_gen++;
1653  it->h = h;
1654  it->error_cb = error_cb;
1655  it->error_cb_cls = error_cb_cls;
1656  it->finish_cb = finish_cb;
1657  it->finish_cb_cls = finish_cb_cls;
1658  it->tr_cb = proc;
1659  it->cls = proc_cls;
1660  it->r_id = rid;
1661  GNUNET_CONTAINER_DLL_insert_tail (h->ticket_it_head, h->ticket_it_tail, it);
1663  msg->id = htonl (rid);
1664  msg->identity = *identity;
1665  if (NULL == h->mq)
1666  it->env = env;
1667  else
1668  GNUNET_MQ_send (h->mq, env);
1669  return it;
1670 }
#define GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_START
Handle for a ticket iterator operation.
Definition: reclaim_api.c:120
GNUNET_RECLAIM_TicketCallback tr_cb
The continuation to call with the results.
Definition: reclaim_api.c:149
uint32_t r_id
The operation id this zone iteration operation has.
Definition: reclaim_api.c:175
void * error_cb_cls
Closure for error_cb.
Definition: reclaim_api.c:164
struct GNUNET_RECLAIM_Handle * h
Main handle to access the idp.
Definition: reclaim_api.c:134
GNUNET_SCHEDULER_TaskCallback finish_cb
Function to call on completion.
Definition: reclaim_api.c:139
void * finish_cb_cls
Closure for finish_cb.
Definition: reclaim_api.c:144
struct GNUNET_MQ_Envelope * env
Envelope of the message to send to the service, if not yet sent.
Definition: reclaim_api.c:170
void * cls
Closure for tr_cb.
Definition: reclaim_api.c:154
GNUNET_SCHEDULER_TaskCallback error_cb
Function to call on errors.
Definition: reclaim_api.c:159
Start a ticket iteration for the given identity.
Definition: reclaim.h:312

References GNUNET_RECLAIM_TicketIterator::cls, env, GNUNET_RECLAIM_TicketIterator::env, error_cb(), GNUNET_RECLAIM_TicketIterator::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, h, GNUNET_RECLAIM_TicketIterator::h, identity, GNUNET_ARM_Handle::mq, msg, GNUNET_RECLAIM_TicketIterator::r_id, and GNUNET_RECLAIM_TicketIterator::tr_cb.

Referenced by list_tickets_cont(), and start_process().

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

1681 {
1682  struct GNUNET_RECLAIM_Handle *h = it->h;
1684  struct GNUNET_MQ_Envelope *env;
1685 
1687  msg->id = htonl (it->r_id);
1688  GNUNET_MQ_send (h->mq, env);
1689 }
#define GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_NEXT
Ask for next result of ticket iteration for the given operation.
Definition: reclaim.h:334

References env, GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_NEXT, GNUNET_MQ_msg, GNUNET_MQ_send(), h, GNUNET_RECLAIM_TicketIterator::h, GNUNET_ARM_Handle::mq, msg, and GNUNET_RECLAIM_TicketIterator::r_id.

Referenced by ticket_collect(), and ticket_iter().

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

1701 {
1702  struct GNUNET_RECLAIM_Handle *h = it->h;
1703  struct GNUNET_MQ_Envelope *env;
1705 
1706  if (NULL != h->mq)
1707  {
1708  env =
1710  msg->id = htonl (it->r_id);
1711  GNUNET_MQ_send (h->mq, env);
1712  }
1713  GNUNET_free (it);
1714 }
#define GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_STOP
Stop ticket iteration for the given operation.
Definition: reclaim.h:351

References env, GNUNET_free, GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_STOP, GNUNET_MQ_msg, GNUNET_MQ_send(), h, GNUNET_RECLAIM_TicketIterator::h, GNUNET_ARM_Handle::mq, msg, and GNUNET_RECLAIM_TicketIterator::r_id.

Referenced by cleanup_handle(), and do_cleanup().

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

1104 {
1105  GNUNET_assert (NULL != h);
1106  if (NULL != h->mq)
1107  {
1108  GNUNET_MQ_destroy (h->mq);
1109  h->mq = NULL;
1110  }
1111  if (NULL != h->reconnect_task)
1112  {
1114  h->reconnect_task = NULL;
1115  }
1116  GNUNET_assert (NULL == h->op_head);
1117  GNUNET_free (h);
1118 }
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
void GNUNET_MQ_destroy(struct GNUNET_MQ_Handle *mq)
Destroy the message queue.
Definition: mq.c:837
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
Definition: scheduler.c:972
struct GNUNET_SCHEDULER_Task * reconnect_task
ID of the reconnect task (if any).
Definition: arm_api.c:147

References GNUNET_assert, GNUNET_free, GNUNET_MQ_destroy(), GNUNET_SCHEDULER_cancel(), h, GNUNET_ARM_Handle::mq, and GNUNET_ARM_Handle::reconnect_task.

Referenced by do_cleanup(), libgnunet_plugin_rest_openid_connect_done(), and libgnunet_plugin_rest_reclaim_done().

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

1089 {
1090  struct GNUNET_RECLAIM_Handle *h = op->h;
1091 
1092  GNUNET_CONTAINER_DLL_remove (h->op_head, h->op_tail, op);
1093  free_op (op);
1094 }
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
static void free_op(struct GNUNET_RECLAIM_Operation *op)
Free op.
Definition: reclaim_api.c:489

References free_op(), GNUNET_CONTAINER_DLL_remove, GNUNET_ARM_Operation::h, h, and op.

Referenced by cleanup_handle(), consume_timeout(), and do_cleanup().

Here is the call graph for this function:
Here is the caller graph for this function: