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 1064 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 libgnunet_plugin_rest_openid_connect_init(), libgnunet_plugin_rest_reclaim_init(), and run().

1065 {
1066  struct GNUNET_RECLAIM_Handle *h;
1067 
1068  h = GNUNET_new (struct GNUNET_RECLAIM_Handle);
1069  h->cfg = cfg;
1070  reconnect (h);
1071  if (NULL == h->mq)
1072  {
1073  GNUNET_free (h);
1074  return NULL;
1075  }
1076  return h;
1077 }
Handle to the service.
Definition: reclaim_api.c:317
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:1015
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:392
const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration to use.
Definition: reclaim_api.c:322
#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_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 1135 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().

1142 {
1143  struct GNUNET_RECLAIM_Operation *op;
1144  struct AttributeStoreMessage *sam;
1145  size_t attr_len;
1146 
1147  op = GNUNET_new (struct GNUNET_RECLAIM_Operation);
1148  op->h = h;
1149  op->as_cb = cont;
1150  op->cls = cont_cls;
1151  op->r_id = h->r_id_gen++;
1154  op->env = GNUNET_MQ_msg_extra (sam,
1155  attr_len,
1157  sam->identity = *pkey;
1158  sam->id = htonl (op->r_id);
1159  sam->exp = GNUNET_htonll (exp_interval->rel_value_us);
1160 
1161  GNUNET_RECLAIM_attribute_serialize (attr, (char *) &sam[1]);
1162 
1163  sam->attr_len = htons (attr_len);
1164  if (NULL != h->mq)
1165  GNUNET_MQ_send_copy (h->mq, op->env);
1166  return op;
1167 }
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:112
GNUNET_RECLAIM_ContinuationWithStatus as_cb
Continuation to invoke after attribute store call.
Definition: reclaim_api.c:67
#define GNUNET_new(type)
Allocate a struct or union of the given type.
Handle for an operation with the service.
Definition: reclaim_api.c:41
size_t GNUNET_RECLAIM_attribute_serialize(const struct GNUNET_RECLAIM_Attribute *attr, char *result)
Serialize an attribute.
Use to store an identity attribute.
Definition: reclaim.h:40
size_t GNUNET_RECLAIM_attribute_serialize_get_size(const struct GNUNET_RECLAIM_Attribute *attr)
Get required size for serialization buffer.
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:392
#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:342
struct GNUNET_MQ_Envelope * env
Envelope with the message for this queue entry.
Definition: reclaim_api.c:102
uint32_t r_id_gen
Request Id generator.
Definition: reclaim_api.c:397
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:337
#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
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:107
struct GNUNET_IDENTITY_PrivateKey identity
Identity.
Definition: reclaim.h:65
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 1227 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_CREDENTIAL_STORE, GNUNET_MQ_msg_extra, GNUNET_MQ_send_copy(), GNUNET_new, GNUNET_RECLAIM_credential_serialize(), GNUNET_RECLAIM_credential_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_credential_cont(), and cred_iter_finished().

1234 {
1235  struct GNUNET_RECLAIM_Operation *op;
1236  struct AttributeStoreMessage *sam;
1237  size_t attr_len;
1238 
1239  op = GNUNET_new (struct GNUNET_RECLAIM_Operation);
1240  op->h = h;
1241  op->as_cb = cont;
1242  op->cls = cont_cls;
1243  op->r_id = h->r_id_gen++;
1246  op->env = GNUNET_MQ_msg_extra (sam,
1247  attr_len,
1249  sam->identity = *pkey;
1250  sam->id = htonl (op->r_id);
1251  sam->exp = GNUNET_htonll (exp_interval->rel_value_us);
1252 
1253  GNUNET_RECLAIM_credential_serialize (attr, (char *) &sam[1]);
1254 
1255  sam->attr_len = htons (attr_len);
1256  if (NULL != h->mq)
1257  GNUNET_MQ_send_copy (h->mq, op->env);
1258  return op;
1259 }
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:112
GNUNET_RECLAIM_ContinuationWithStatus as_cb
Continuation to invoke after attribute store call.
Definition: reclaim_api.c:67
size_t GNUNET_RECLAIM_credential_serialize_get_size(const struct GNUNET_RECLAIM_Credential *credential)
Get required size for serialization buffer.
#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:392
#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:342
struct GNUNET_MQ_Envelope * env
Envelope with the message for this queue entry.
Definition: reclaim_api.c:102
uint32_t r_id_gen
Request Id generator.
Definition: reclaim_api.c:397
uint32_t attr_len
The length of the attribute.
Definition: reclaim.h:55
size_t GNUNET_RECLAIM_credential_serialize(const struct GNUNET_RECLAIM_Credential *credential, char *result)
Serialize an credential.
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:337
#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
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:144
#define GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_STORE
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:107
struct GNUNET_IDENTITY_PrivateKey identity
Identity.
Definition: reclaim.h:65
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 1182 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().

1188 {
1189  struct GNUNET_RECLAIM_Operation *op;
1190  struct AttributeDeleteMessage *dam;
1191  size_t attr_len;
1192 
1193  op = GNUNET_new (struct GNUNET_RECLAIM_Operation);
1194  op->h = h;
1195  op->as_cb = cont;
1196  op->cls = cont_cls;
1197  op->r_id = h->r_id_gen++;
1200  op->env = GNUNET_MQ_msg_extra (dam,
1201  attr_len,
1203  dam->identity = *pkey;
1204  dam->id = htonl (op->r_id);
1205  GNUNET_RECLAIM_attribute_serialize (attr, (char *) &dam[1]);
1206 
1207  dam->attr_len = htons (attr_len);
1208  if (NULL != h->mq)
1209  GNUNET_MQ_send_copy (h->mq, op->env);
1210  return op;
1211 }
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:112
GNUNET_RECLAIM_ContinuationWithStatus as_cb
Continuation to invoke after attribute store call.
Definition: reclaim_api.c:67
Use to delete an identity attribute.
Definition: reclaim.h:74
#define GNUNET_new(type)
Allocate a struct or union of the given type.
uint32_t attr_len
The length of the attribute.
Definition: reclaim.h:89
Handle for an operation with the service.
Definition: reclaim_api.c:41
size_t GNUNET_RECLAIM_attribute_serialize(const struct GNUNET_RECLAIM_Attribute *attr, char *result)
Serialize an attribute.
size_t GNUNET_RECLAIM_attribute_serialize_get_size(const struct GNUNET_RECLAIM_Attribute *attr)
Get required size for serialization buffer.
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:392
#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:342
struct GNUNET_MQ_Envelope * env
Envelope with the message for this queue entry.
Definition: reclaim_api.c:102
uint32_t r_id_gen
Request Id generator.
Definition: reclaim_api.c:397
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:337
#define GNUNET_CONTAINER_DLL_insert_tail(head, tail, element)
Insert an element at the tail of a DLL.
struct GNUNET_IDENTITY_PrivateKey identity
Identity.
Definition: reclaim.h:94
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
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:107
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 1274 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_CREDENTIAL_DELETE, GNUNET_MQ_msg_extra, GNUNET_MQ_send_copy(), GNUNET_new, GNUNET_RECLAIM_credential_serialize(), GNUNET_RECLAIM_credential_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_credential_cont().

1280 {
1281  struct GNUNET_RECLAIM_Operation *op;
1282  struct AttributeDeleteMessage *dam;
1283  size_t attr_len;
1284 
1285  op = GNUNET_new (struct GNUNET_RECLAIM_Operation);
1286  op->h = h;
1287  op->as_cb = cont;
1288  op->cls = cont_cls;
1289  op->r_id = h->r_id_gen++;
1292  op->env = GNUNET_MQ_msg_extra (dam,
1293  attr_len,
1295  dam->identity = *pkey;
1296  dam->id = htonl (op->r_id);
1297  GNUNET_RECLAIM_credential_serialize (attr, (char *) &dam[1]);
1298 
1299  dam->attr_len = htons (attr_len);
1300  if (NULL != h->mq)
1301  GNUNET_MQ_send_copy (h->mq, op->env);
1302  return op;
1303 }
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:112
GNUNET_RECLAIM_ContinuationWithStatus as_cb
Continuation to invoke after attribute store call.
Definition: reclaim_api.c:67
size_t GNUNET_RECLAIM_credential_serialize_get_size(const struct GNUNET_RECLAIM_Credential *credential)
Get required size for serialization buffer.
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:392
#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:342
struct GNUNET_MQ_Envelope * env
Envelope with the message for this queue entry.
Definition: reclaim_api.c:102
#define GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_DELETE
uint32_t r_id_gen
Request Id generator.
Definition: reclaim_api.c:397
size_t GNUNET_RECLAIM_credential_serialize(const struct GNUNET_RECLAIM_Credential *credential, char *result)
Serialize an credential.
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:337
#define GNUNET_CONTAINER_DLL_insert_tail(head, tail, element)
Insert an element at the tail of a DLL.
struct GNUNET_IDENTITY_PrivateKey identity
Identity.
Definition: reclaim.h:94
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
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:144
uint32_t r_id
request id
Definition: reclaim_api.c:107
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 1331 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(), cred_iter_finished(), and list_attribute_cont().

1340 {
1342  struct GNUNET_MQ_Envelope *env;
1344  uint32_t rid;
1345 
1346  rid = h->r_id_gen++;
1348  it->h = h;
1349  it->error_cb = error_cb;
1350  it->error_cb_cls = error_cb_cls;
1351  it->finish_cb = finish_cb;
1352  it->finish_cb_cls = finish_cb_cls;
1353  it->proc = proc;
1354  it->proc_cls = proc_cls;
1355  it->r_id = rid;
1356  it->identity = *identity;
1358  env =
1360  msg->id = htonl (rid);
1361  msg->identity = *identity;
1362  if (NULL == h->mq)
1363  it->env = env;
1364  else
1365  GNUNET_MQ_send (h->mq, env);
1366  return it;
1367 }
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
Start a attribute iteration for the given identity.
Definition: reclaim.h:200
static void error_cb(void *cls)
Function called if lookup fails.
Definition: gnunet-abd.c:485
struct GNUNET_IDENTITY_PrivateKey identity
Private key of the zone.
Definition: reclaim_api.c:238
#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:207
GNUNET_SCHEDULER_TaskCallback error_cb
Function to call on errors.
Definition: reclaim_api.c:222
GNUNET_RECLAIM_AttributeResult proc
The continuation to call with the results.
Definition: reclaim_api.c:212
struct GNUNET_RECLAIM_AttributeIterator * it_tail
Tail of active iterations.
Definition: reclaim_api.c:352
void * proc_cls
Closure for proc.
Definition: reclaim_api.c:217
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:392
Handle for a attribute iterator operation.
Definition: reclaim_api.c:182
uint32_t r_id
The operation id this zone iteration operation has.
Definition: reclaim_api.c:243
struct GNUNET_IDENTITY_PrivateKey identity
Identity.
Definition: reclaim.h:215
uint32_t r_id_gen
Request Id generator.
Definition: reclaim_api.c:397
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:210
static struct GNUNET_IDENTITY_Handle * identity
Which namespace do we publish to? NULL if we do not publish to a namespace.
struct GNUNET_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:233
struct GNUNET_RECLAIM_AttributeIterator * it_head
Head of active iterations.
Definition: reclaim_api.c:347
void * error_cb_cls
Closure for error_cb.
Definition: reclaim_api.c:227
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
struct GNUNET_RECLAIM_Handle * h
Main handle to access the service.
Definition: reclaim_api.c:197
GNUNET_SCHEDULER_TaskCallback finish_cb
Function to call on completion.
Definition: reclaim_api.c:202
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 1377 of file reclaim_api.c.

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

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

1378 {
1379  struct GNUNET_RECLAIM_Handle *h = it->h;
1381  struct GNUNET_MQ_Envelope *env;
1382 
1383  env =
1385  msg->id = htonl (it->r_id);
1386  GNUNET_MQ_send (h->mq, env);
1387 }
Handle to the service.
Definition: reclaim_api.c:317
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:392
uint32_t r_id
The operation id this zone iteration operation has.
Definition: reclaim_api.c:243
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:232
Ask for next result of attribute iteration for the given operation.
Definition: reclaim.h:222
struct GNUNET_MQ_Envelope * env
Definition: 005.c:1
#define GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_NEXT
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
Definition: mq.c:355
struct GNUNET_RECLAIM_Handle * h
Main handle to access the service.
Definition: reclaim_api.c:197
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_RECLAIM_get_attributes_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 1398 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().

1399 {
1400  struct GNUNET_RECLAIM_Handle *h = it->h;
1401  struct GNUNET_MQ_Envelope *env;
1403 
1404  if (NULL != h->mq)
1405  {
1406  env =
1408  msg->id = htonl (it->r_id);
1409  GNUNET_MQ_send (h->mq, env);
1410  }
1411  free_it (it);
1412 }
Handle to the service.
Definition: reclaim_api.c:317
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
Stop attribute iteration for the given operation.
Definition: reclaim.h:295
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
Definition: gnunet_mq_lib.h:67
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:392
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:305
uint32_t r_id
The operation id this zone iteration operation has.
Definition: reclaim_api.c:243
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:455
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
struct GNUNET_RECLAIM_Handle * h
Main handle to access the service.
Definition: reclaim_api.c:197
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 1440 of file reclaim_api.c.

References GNUNET_RECLAIM_Handle::ait_head, GNUNET_RECLAIM_Handle::ait_tail, GNUNET_RECLAIM_Operation::env, GNUNET_RECLAIM_CredentialIterator::env, GNUNET_RECLAIM_CredentialIterator::error_cb, 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, GNUNET_RECLAIM_Operation::h, GNUNET_RECLAIM_CredentialIterator::h, CredentialIterationStartMessage::id, identity, CredentialIterationStartMessage::identity, GNUNET_RECLAIM_CredentialIterator::identity, GNUNET_RECLAIM_Handle::mq, GNUNET_RECLAIM_Operation::msg, GNUNET_RECLAIM_CredentialIterator::proc, GNUNET_RECLAIM_CredentialIterator::proc_cls, GNUNET_RECLAIM_CredentialIterator::r_id, and GNUNET_RECLAIM_Handle::r_id_gen.

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

1449 {
1451  struct GNUNET_MQ_Envelope *env;
1453  uint32_t rid;
1454 
1455  rid = h->r_id_gen++;
1457  ait->h = h;
1458  ait->error_cb = error_cb;
1459  ait->error_cb_cls = error_cb_cls;
1460  ait->finish_cb = finish_cb;
1461  ait->finish_cb_cls = finish_cb_cls;
1462  ait->proc = proc;
1463  ait->proc_cls = proc_cls;
1464  ait->r_id = rid;
1465  ait->identity = *identity;
1467  env =
1468  GNUNET_MQ_msg (msg,
1470  msg->id = htonl (rid);
1471  msg->identity = *identity;
1472  if (NULL == h->mq)
1473  ait->env = env;
1474  else
1475  GNUNET_MQ_send (h->mq, env);
1476  return ait;
1477 }
uint32_t r_id
The operation id this zone iteration operation has.
Definition: reclaim_api.c:310
struct GNUNET_RECLAIM_CredentialIterator * ait_tail
Tail of active iterations.
Definition: reclaim_api.c:362
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
static void error_cb(void *cls)
Function called if lookup fails.
Definition: gnunet-abd.c:485
void * error_cb_cls
Closure for error_cb.
Definition: reclaim_api.c:294
struct GNUNET_MQ_Envelope * env
Envelope of the message to send to the service, if not yet sent.
Definition: reclaim_api.c:300
#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_IDENTITY_PrivateKey identity
Private key of the zone.
Definition: reclaim_api.c:305
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:392
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
uint32_t r_id_gen
Request Id generator.
Definition: reclaim_api.c:397
static struct GNUNET_IDENTITY_Handle * identity
Which namespace do we publish to? NULL if we do not publish to a namespace.
#define GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_ITERATION_START
struct GNUNET_MQ_Envelope * env
Definition: 005.c:1
Start a credential iteration for the given identity.
Definition: reclaim.h:239
#define GNUNET_CONTAINER_DLL_insert_tail(head, tail, element)
Insert an element at the tail of a DLL.
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:249
struct GNUNET_RECLAIM_Handle * h
Main handle to access the service.
Definition: reclaim_api.c:264
void * finish_cb_cls
Closure for finish_cb.
Definition: reclaim_api.c:274
GNUNET_SCHEDULER_TaskCallback finish_cb
Function to call on completion.
Definition: reclaim_api.c:269
struct GNUNET_RECLAIM_CredentialIterator * ait_head
Head of active iterations.
Definition: reclaim_api.c:357
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
struct GNUNET_IDENTITY_PrivateKey identity
Identity.
Definition: reclaim.h:254
Handle for a credential iterator operation.
Definition: reclaim_api.c:249
GNUNET_SCHEDULER_TaskCallback error_cb
Function to call on errors.
Definition: reclaim_api.c:289
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 1487 of file reclaim_api.c.

References GNUNET_RECLAIM_Operation::env, GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_ITERATION_NEXT, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_RECLAIM_Operation::h, GNUNET_RECLAIM_CredentialIterator::h, CredentialIterationNextMessage::id, GNUNET_RECLAIM_Handle::mq, GNUNET_RECLAIM_Operation::msg, and GNUNET_RECLAIM_CredentialIterator::r_id.

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

1489 {
1490  struct GNUNET_RECLAIM_Handle *h = ait->h;
1492  struct GNUNET_MQ_Envelope *env;
1493 
1494  env =
1496  msg->id = htonl (ait->r_id);
1497  GNUNET_MQ_send (h->mq, env);
1498 }
uint32_t r_id
The operation id this zone iteration operation has.
Definition: reclaim_api.c:310
Handle to the service.
Definition: reclaim_api.c:317
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:271
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
Definition: gnunet_mq_lib.h:67
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
#define GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_ITERATION_NEXT
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:392
struct GNUNET_MQ_Envelope * env
Definition: 005.c:1
Ask for next result of credential iteration for the given operation.
Definition: reclaim.h:261
struct GNUNET_RECLAIM_Handle * h
Main handle to access the service.
Definition: reclaim_api.c:264
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
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 1509 of file reclaim_api.c.

References GNUNET_RECLAIM_Operation::env, free_ait(), GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_ITERATION_STOP, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_RECLAIM_Operation::h, GNUNET_RECLAIM_CredentialIterator::h, CredentialIterationStopMessage::id, GNUNET_RECLAIM_Handle::mq, GNUNET_RECLAIM_Operation::msg, and GNUNET_RECLAIM_CredentialIterator::r_id.

Referenced by cleanup_handle(), and do_cleanup().

1511 {
1512  struct GNUNET_RECLAIM_Handle *h = ait->h;
1513  struct GNUNET_MQ_Envelope *env;
1515 
1516  if (NULL != h->mq)
1517  {
1518  env =
1519  GNUNET_MQ_msg (msg,
1521  msg->id = htonl (ait->r_id);
1522  GNUNET_MQ_send (h->mq, env);
1523  }
1524  free_ait (ait);
1525 }
uint32_t r_id
The operation id this zone iteration operation has.
Definition: reclaim_api.c:310
Handle to the service.
Definition: reclaim_api.c:317
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:288
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
Stop credential iteration for the given operation.
Definition: reclaim.h:278
#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:392
struct GNUNET_MQ_Envelope * env
Definition: 005.c:1
struct GNUNET_RECLAIM_Handle * h
Main handle to access the service.
Definition: reclaim_api.c:264
static void free_ait(struct GNUNET_RECLAIM_CredentialIterator *ait)
Free it.
Definition: reclaim_api.c:472
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_MESSAGE_TYPE_RECLAIM_CREDENTIAL_ITERATION_STOP
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 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 1542 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::ti_cb.

Referenced by iter_finished(), and oidc_cred_collect_finished_cb().

1549 {
1550  struct GNUNET_RECLAIM_Operation *op;
1551  struct IssueTicketMessage *tim;
1552  size_t attr_len;
1553 
1554  fprintf (stderr, "Issuing ticket\n");
1555  op = GNUNET_new (struct GNUNET_RECLAIM_Operation);
1556  op->h = h;
1557  op->ti_cb = cb;
1558  op->cls = cb_cls;
1559  op->r_id = h->r_id_gen++;
1562  op->env = GNUNET_MQ_msg_extra (tim,
1563  attr_len,
1565  tim->identity = *iss;
1566  tim->rp = *rp;
1567  tim->id = htonl (op->r_id);
1568 
1569  GNUNET_RECLAIM_attribute_list_serialize (attrs, (char *) &tim[1]);
1570 
1571  tim->attr_len = htons (attr_len);
1572  if (NULL != h->mq)
1573  GNUNET_MQ_send_copy (h->mq, op->env);
1574  return op;
1575 }
#define GNUNET_MESSAGE_TYPE_RECLAIM_ISSUE_TICKET
struct GNUNET_RECLAIM_Handle * h
Main handle.
Definition: reclaim_api.c:46
void * cls
Closure for cont or cb.
Definition: reclaim_api.c:112
struct GNUNET_IDENTITY_PrivateKey identity
Identity.
Definition: reclaim.h:382
#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
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:392
#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:342
struct GNUNET_MQ_Envelope * env
Envelope with the message for this queue entry.
Definition: reclaim_api.c:102
uint32_t r_id_gen
Request Id generator.
Definition: reclaim_api.c:397
Ticket issue message.
Definition: reclaim.h:367
GNUNET_RECLAIM_IssueTicketCallback ti_cb
Ticket issue result callback.
Definition: reclaim_api.c:97
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:377
uint32_t attr_len
length of serialized attribute list
Definition: reclaim.h:392
size_t GNUNET_RECLAIM_attribute_list_serialize(const struct GNUNET_RECLAIM_AttributeList *attrs, char *result)
Serialize an attribute list.
struct GNUNET_RECLAIM_Operation * op_head
Head of active operations.
Definition: reclaim_api.c:337
#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
size_t GNUNET_RECLAIM_attribute_list_serialize_get_size(const struct GNUNET_RECLAIM_AttributeList *attrs)
Get required size for serialization buffer.
static char * rp
Relying party.
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:144
struct GNUNET_IDENTITY_PublicKey rp
Requesting party.
Definition: reclaim.h:387
uint32_t r_id
request id
Definition: reclaim_api.c:107
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 1732 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().

1738 {
1739  struct GNUNET_RECLAIM_Operation *op;
1740  struct RevokeTicketMessage *msg;
1741  uint32_t rid;
1742 
1743  rid = h->r_id_gen++;
1744  op = GNUNET_new (struct GNUNET_RECLAIM_Operation);
1745  op->h = h;
1746  op->rvk_cb = cb;
1747  op->cls = cb_cls;
1748  op->r_id = rid;
1751  msg->id = htonl (rid);
1752  msg->identity = *identity;
1753  msg->ticket = *ticket;
1754  if (NULL != h->mq)
1755  {
1756  GNUNET_MQ_send (h->mq, op->env);
1757  op->env = NULL;
1758  }
1759  return op;
1760 }
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:112
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:410
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
Definition: gnunet_mq_lib.h:67
#define GNUNET_new(type)
Allocate a struct or union of the given type.
Handle for an operation with the service.
Definition: reclaim_api.c:41
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
static struct GNUNET_RECLAIM_Ticket ticket
Ticket to consume.
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:392
GNUNET_RECLAIM_ContinuationWithStatus rvk_cb
Revocation result callback.
Definition: reclaim_api.c:87
struct GNUNET_RECLAIM_Operation * op_tail
Tail of active operations.
Definition: reclaim_api.c:342
struct GNUNET_RECLAIM_Ticket ticket
The ticket to revoke.
Definition: reclaim.h:425
struct GNUNET_MQ_Envelope * env
Envelope with the message for this queue entry.
Definition: reclaim_api.c:102
uint32_t r_id_gen
Request Id generator.
Definition: reclaim_api.c:397
static struct GNUNET_IDENTITY_Handle * identity
Which namespace do we publish to? NULL if we do not publish to a namespace.
struct GNUNET_IDENTITY_PrivateKey identity
Identity.
Definition: reclaim.h:415
struct GNUNET_RECLAIM_Operation * op_head
Head of active operations.
Definition: reclaim_api.c:337
#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:355
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:144
Ticket revoke message.
Definition: reclaim.h:400
#define GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET
uint32_t r_id
request id
Definition: reclaim_api.c:107
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 1591 of file reclaim_api.c.

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

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

1597 {
1598  struct GNUNET_RECLAIM_Operation *op;
1599  struct ConsumeTicketMessage *ctm;
1600 
1601  op = GNUNET_new (struct GNUNET_RECLAIM_Operation);
1602  op->h = h;
1603  op->atr_cb = cb;
1604  op->cls = cb_cls;
1605  op->r_id = h->r_id_gen++;
1608  ctm->identity = *identity;
1609  ctm->id = htonl (op->r_id);
1610  ctm->ticket = *ticket;
1611  if (NULL != h->mq)
1612  GNUNET_MQ_send_copy (h->mq, op->env);
1613  else
1614  reconnect (h);
1615  return op;
1616 }
struct GNUNET_RECLAIM_Handle * h
Main handle.
Definition: reclaim_api.c:46
void * cls
Closure for cont or cb.
Definition: reclaim_api.c:112
Ticket consume message.
Definition: reclaim.h:481
struct GNUNET_IDENTITY_PrivateKey identity
Identity.
Definition: reclaim.h:496
GNUNET_RECLAIM_AttributeTicketResult atr_cb
Attribute result callback.
Definition: reclaim_api.c:77
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
Definition: gnunet_mq_lib.h:67
#define GNUNET_new(type)
Allocate a struct or union of the given type.
Handle for an operation with the service.
Definition: reclaim_api.c:41
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
static void reconnect(struct GNUNET_RECLAIM_Handle *h)
Try again to connect to the service.
Definition: reclaim_api.c:1015
static struct GNUNET_RECLAIM_Ticket ticket
Ticket to consume.
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:392
struct GNUNET_RECLAIM_Operation * op_tail
Tail of active operations.
Definition: reclaim_api.c:342
struct GNUNET_MQ_Envelope * env
Envelope with the message for this queue entry.
Definition: reclaim_api.c:102
uint32_t r_id_gen
Request Id generator.
Definition: reclaim_api.c:397
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:501
struct GNUNET_RECLAIM_Operation * op_head
Head of active operations.
Definition: reclaim_api.c:337
#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_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:491
uint32_t r_id
request id
Definition: reclaim_api.c:107
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 1637 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().

1646 {
1647  struct GNUNET_RECLAIM_TicketIterator *it;
1648  struct GNUNET_MQ_Envelope *env;
1650  uint32_t rid;
1651 
1652  rid = h->r_id_gen++;
1654  it->h = h;
1655  it->error_cb = error_cb;
1656  it->error_cb_cls = error_cb_cls;
1657  it->finish_cb = finish_cb;
1658  it->finish_cb_cls = finish_cb_cls;
1659  it->tr_cb = proc;
1660  it->cls = proc_cls;
1661  it->r_id = rid;
1664  msg->id = htonl (rid);
1665  msg->identity = *identity;
1666  if (NULL == h->mq)
1667  it->env = env;
1668  else
1669  GNUNET_MQ_send (h->mq, env);
1670  return it;
1671 }
struct GNUNET_RECLAIM_TicketIterator * ticket_it_tail
Tail of active iterations.
Definition: reclaim_api.c:372
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
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:144
#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:134
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:392
struct GNUNET_MQ_Envelope * env
Envelope of the message to send to the service, if not yet sent.
Definition: reclaim_api.c:170
void * error_cb_cls
Closure for error_cb.
Definition: reclaim_api.c:164
uint32_t r_id_gen
Request Id generator.
Definition: reclaim_api.c:397
uint32_t r_id
The operation id this zone iteration operation has.
Definition: reclaim_api.c:175
void * cls
Closure for tr_cb.
Definition: reclaim_api.c:154
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.
struct GNUNET_IDENTITY_PrivateKey identity
Identity.
Definition: reclaim.h:326
#define GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_START
GNUNET_SCHEDULER_TaskCallback error_cb
Function to call on errors.
Definition: reclaim_api.c:159
GNUNET_RECLAIM_TicketCallback tr_cb
The continuation to call with the results.
Definition: reclaim_api.c:149
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:321
Start a ticket iteration for the given identity.
Definition: reclaim.h:311
Handle for a ticket iterator operation.
Definition: reclaim_api.c:119
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
GNUNET_SCHEDULER_TaskCallback finish_cb
Function to call on completion.
Definition: reclaim_api.c:139
struct GNUNET_RECLAIM_TicketIterator * ticket_it_head
Head of active iterations.
Definition: reclaim_api.c:367
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 1681 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().

1682 {
1683  struct GNUNET_RECLAIM_Handle *h = it->h;
1685  struct GNUNET_MQ_Envelope *env;
1686 
1688  msg->id = htonl (it->r_id);
1689  GNUNET_MQ_send (h->mq, env);
1690 }
Handle to the service.
Definition: reclaim_api.c:317
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:134
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
Ask for next result of ticket iteration for the given operation.
Definition: reclaim.h:333
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:343
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
Definition: reclaim_api.c:392
uint32_t r_id
The operation id this zone iteration operation has.
Definition: reclaim_api.c:175
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:355
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 1701 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().

1702 {
1703  struct GNUNET_RECLAIM_Handle *h = it->h;
1704  struct GNUNET_MQ_Envelope *env;
1706 
1707  if (NULL != h->mq)
1708  {
1709  env =
1711  msg->id = htonl (it->r_id);
1712  GNUNET_MQ_send (h->mq, env);
1713  }
1714  GNUNET_free (it);
1715 }
Handle to the service.
Definition: reclaim_api.c:317
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:134
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:392
Stop ticket iteration for the given operation.
Definition: reclaim.h:350
uint32_t r_id
The operation id this zone iteration operation has.
Definition: reclaim_api.c:175
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:355
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:360
#define GNUNET_free(ptr)
Wrapper around free.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_RECLAIM_disconnect()

void GNUNET_RECLAIM_disconnect ( struct GNUNET_RECLAIM_Handle h)

Disconnect from identity provider service.

Parameters
hidentity provider service to disconnect

Disconnect from identity provider service.

Parameters
hhandle to destroy

Definition at line 1104 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 do_cleanup(), libgnunet_plugin_rest_openid_connect_done(), and libgnunet_plugin_rest_reclaim_done().

1105 {
1106  GNUNET_assert (NULL != h);
1107  if (NULL != h->mq)
1108  {
1109  GNUNET_MQ_destroy (h->mq);
1110  h->mq = NULL;
1111  }
1112  if (NULL != h->reconnect_task)
1113  {
1115  h->reconnect_task = NULL;
1116  }
1117  GNUNET_assert (NULL == h->op_head);
1118  GNUNET_free (h);
1119 }
struct GNUNET_SCHEDULER_Task * reconnect_task
Task doing exponential back-off trying to reconnect.
Definition: reclaim_api.c:382
#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:392
struct GNUNET_RECLAIM_Operation * op_head
Head of active operations.
Definition: reclaim_api.c:337
void GNUNET_MQ_destroy(struct GNUNET_MQ_Handle *mq)
Destroy the message queue.
Definition: mq.c:837
#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:972
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 1089 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 cleanup_handle(), and do_cleanup().

1090 {
1091  struct GNUNET_RECLAIM_Handle *h = op->h;
1092 
1094  free_op (op);
1095 }
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
Handle to the service.
Definition: reclaim_api.c:317
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:342
struct GNUNET_RECLAIM_Operation * op_head
Head of active operations.
Definition: reclaim_api.c:337
static void free_op(struct GNUNET_RECLAIM_Operation *op)
Free op.
Definition: reclaim_api.c:489
Here is the call graph for this function:
Here is the caller graph for this function: