GNUnet  0.20.0
gnunet-service-messenger_ego_store.h File Reference

GNUnet MESSENGER service. More...

#include "platform.h"
#include "gnunet_util_lib.h"
#include "messenger_api_ego.h"
Include dependency graph for gnunet-service-messenger_ego_store.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  GNUNET_MESSENGER_EgoLookup
 
struct  GNUNET_MESSENGER_EgoOperation
 
struct  GNUNET_MESSENGER_EgoStore
 

Typedefs

typedef void(* GNUNET_MESSENGER_EgoLookupCallback) (void *cls, const char *identifier, const struct GNUNET_MESSENGER_Ego *ego)
 

Functions

void init_ego_store (struct GNUNET_MESSENGER_EgoStore *store, const struct GNUNET_CONFIGURATION_Handle *config)
 Initializes an EGO-store as fully empty. More...
 
void clear_ego_store (struct GNUNET_MESSENGER_EgoStore *store)
 Clears an EGO-store, wipes its content and deallocates its memory. More...
 
void create_store_ego (struct GNUNET_MESSENGER_EgoStore *store, const char *identifier)
 Creates a new EGO which will be registered to a store under a specific identifier. More...
 
void bind_store_ego (struct GNUNET_MESSENGER_EgoStore *store, const char *identifier, void *handle)
 Binds an EGO which was registered to a store under a specific identifier to a given handle More...
 
void unbind_store_ego (struct GNUNET_MESSENGER_EgoStore *store, const char *identifier, void *handle)
 Binds an EGO which was registered to a store under a specific identifier to a given handle More...
 
void lookup_store_ego (struct GNUNET_MESSENGER_EgoStore *store, const char *identifier, GNUNET_MESSENGER_EgoLookupCallback lookup, void *cls)
 Lookups an EGO which was registered to a store under a specific identifier. More...
 
struct GNUNET_MESSENGER_Egoupdate_store_ego (struct GNUNET_MESSENGER_EgoStore *store, const char *identifier, const struct GNUNET_IDENTITY_PrivateKey *key)
 Updates the registration of an EGO to a store under a specific identifier with a new key. More...
 
void delete_store_ego (struct GNUNET_MESSENGER_EgoStore *store, const char *identifier)
 Deletes the registration of an EGO in a store under a specific identifier. More...
 
void rename_store_ego (struct GNUNET_MESSENGER_EgoStore *store, const char *old_identifier, const char *new_identifier)
 Updates the location of a registered EGO in a store to a different one under a specific new_identifier replacing its old one. More...
 
void renew_store_ego (struct GNUNET_MESSENGER_EgoStore *store, const char *identifier)
 Replaces the registered EGO in a store under a specific identifier with a newly created one. More...
 

Detailed Description

GNUnet MESSENGER service.

Author
Tobias Frisch

Definition in file gnunet-service-messenger_ego_store.h.

Typedef Documentation

◆ GNUNET_MESSENGER_EgoLookupCallback

typedef void(* GNUNET_MESSENGER_EgoLookupCallback) (void *cls, const char *identifier, const struct GNUNET_MESSENGER_Ego *ego)

Definition at line 37 of file gnunet-service-messenger_ego_store.h.

Function Documentation

◆ init_ego_store()

void init_ego_store ( struct GNUNET_MESSENGER_EgoStore store,
const struct GNUNET_CONFIGURATION_Handle config 
)

Initializes an EGO-store as fully empty.

Parameters
[out]storeEGO-store
[in]configConfiguration handle

Definition at line 55 of file gnunet-service-messenger_ego_store.c.

57 {
58  GNUNET_assert ((store) && (config));
59 
60  store->cfg = config;
64 
65  store->lu_start = NULL;
66  store->lu_end = NULL;
67 
68  store->op_start = NULL;
69  store->op_end = NULL;
70 }
static void callback_update_ego(void *cls, struct GNUNET_IDENTITY_Ego *ego, void **ctx, const char *identifier)
static const struct GNUNET_CONFIGURATION_Handle * config
struct GNUNET_CONTAINER_MultiHashMap * GNUNET_CONTAINER_multihashmap_create(unsigned int len, int do_not_copy_keys)
Create a multi hash map.
struct GNUNET_IDENTITY_Handle * GNUNET_IDENTITY_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_IDENTITY_Callback cb, void *cb_cls)
Connect to the identity service.
Definition: identity_api.c:531
@ GNUNET_NO
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
struct GNUNET_CONTAINER_MultiHashMap * handles
struct GNUNET_MESSENGER_EgoLookup * lu_end
const struct GNUNET_CONFIGURATION_Handle * cfg
struct GNUNET_MESSENGER_EgoLookup * lu_start
struct GNUNET_IDENTITY_Handle * identity
struct GNUNET_CONTAINER_MultiHashMap * egos
struct GNUNET_MESSENGER_EgoOperation * op_end
struct GNUNET_MESSENGER_EgoOperation * op_start

References callback_update_ego(), GNUNET_MESSENGER_EgoStore::cfg, config, GNUNET_MESSENGER_EgoStore::egos, GNUNET_assert, GNUNET_CONTAINER_multihashmap_create(), GNUNET_IDENTITY_connect(), GNUNET_NO, GNUNET_MESSENGER_EgoStore::handles, GNUNET_MESSENGER_EgoStore::identity, GNUNET_MESSENGER_EgoStore::lu_end, GNUNET_MESSENGER_EgoStore::lu_start, GNUNET_MESSENGER_EgoStore::op_end, and GNUNET_MESSENGER_EgoStore::op_start.

Referenced by create_service().

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

◆ clear_ego_store()

void clear_ego_store ( struct GNUNET_MESSENGER_EgoStore store)

Clears an EGO-store, wipes its content and deallocates its memory.

Parameters
[in,out]storeEGO-store

Definition at line 83 of file gnunet-service-messenger_ego_store.c.

84 {
85  GNUNET_assert (store);
86 
88 
89  while (store->op_start)
90  {
91  op = store->op_start;
92 
93  GNUNET_IDENTITY_cancel (op->operation);
95 
96  if (op->identifier)
97  GNUNET_free (op->identifier);
98 
99  GNUNET_free (op);
100  }
101 
102  struct GNUNET_MESSENGER_EgoLookup *lu;
103 
104  while (store->lu_start)
105  {
106  lu = store->lu_start;
107 
110 
111  if (lu->identifier)
112  GNUNET_free(lu->identifier);
113 
114  GNUNET_free (lu);
115  }
116 
119 
121 
122  if (store->identity)
123  {
125 
126  store->identity = NULL;
127  }
128 }
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:144
static int iterate_destroy_egos(void *cls, const struct GNUNET_HashCode *key, void *value)
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
void GNUNET_CONTAINER_multihashmap_destroy(struct GNUNET_CONTAINER_MultiHashMap *map)
Destroy a hash map.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multihashmap_iterate(struct GNUNET_CONTAINER_MultiHashMap *map, GNUNET_CONTAINER_MultiHashMapIteratorCallback it, void *it_cls)
Iterate over all entries in the map.
void GNUNET_IDENTITY_cancel(struct GNUNET_IDENTITY_Operation *op)
Cancel an identity operation.
Definition: identity_api.c:740
void GNUNET_IDENTITY_ego_lookup_cancel(struct GNUNET_IDENTITY_EgoLookup *el)
Abort ego lookup attempt.
void GNUNET_IDENTITY_disconnect(struct GNUNET_IDENTITY_Handle *h)
Disconnect from identity service.
Definition: identity_api.c:757
#define GNUNET_free(ptr)
Wrapper around free.
struct GNUNET_IDENTITY_EgoLookup * lookup
struct GNUNET_MESSENGER_EgoStore * store
struct GNUNET_MESSENGER_EgoStore * store

References GNUNET_MESSENGER_EgoStore::egos, GNUNET_assert, GNUNET_CONTAINER_DLL_remove, GNUNET_CONTAINER_multihashmap_destroy(), GNUNET_CONTAINER_multihashmap_iterate(), GNUNET_free, GNUNET_IDENTITY_cancel(), GNUNET_IDENTITY_disconnect(), GNUNET_IDENTITY_ego_lookup_cancel(), GNUNET_MESSENGER_EgoStore::handles, GNUNET_MESSENGER_EgoLookup::identifier, GNUNET_MESSENGER_EgoStore::identity, iterate_destroy_egos(), GNUNET_MESSENGER_EgoLookup::lookup, GNUNET_MESSENGER_EgoStore::lu_end, GNUNET_MESSENGER_EgoStore::lu_start, op, GNUNET_MESSENGER_EgoStore::op_end, GNUNET_MESSENGER_EgoStore::op_start, GNUNET_MESSENGER_EgoLookup::store, and GNUNET_MESSENGER_EgoOperation::store.

Referenced by destroy_service().

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

◆ create_store_ego()

void create_store_ego ( struct GNUNET_MESSENGER_EgoStore store,
const char *  identifier 
)

Creates a new EGO which will be registered to a store under a specific identifier.

Parameters
[in,out]storeEGO-store
[in]identifierIdentifier string

Definition at line 175 of file gnunet-service-messenger_ego_store.c.

177 {
178  GNUNET_assert ((store) && (identifier));
179 
180  GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Store create ego: %s\n", identifier);
181 
183 
184  element->store = store;
185  element->cls = NULL;
186 
187  element->identifier = GNUNET_strdup (identifier);
188 
189  element->operation = GNUNET_IDENTITY_create (
190  store->identity,
191  identifier,
192  NULL,
195  element
196  );
197 
199 }
static void callback_ego_create(void *cls, const struct GNUNET_IDENTITY_PrivateKey *key, enum GNUNET_ErrorCode ec)
#define GNUNET_CONTAINER_DLL_insert(head, tail, element)
Insert an element at the head of a DLL.
struct GNUNET_IDENTITY_Operation * GNUNET_IDENTITY_create(struct GNUNET_IDENTITY_Handle *h, const char *name, const struct GNUNET_IDENTITY_PrivateKey *privkey, enum GNUNET_IDENTITY_KeyType ktype, GNUNET_IDENTITY_CreateContinuation cont, void *cont_cls)
Create a new ego with the given name.
Definition: identity_api.c:586
@ GNUNET_IDENTITY_TYPE_ECDSA
The identity type.
#define GNUNET_log(kind,...)
@ GNUNET_ERROR_TYPE_DEBUG
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
struct GNUNET_IDENTITY_Operation * operation

References callback_ego_create(), GNUNET_MESSENGER_EgoOperation::cls, GNUNET_assert, GNUNET_CONTAINER_DLL_insert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_IDENTITY_create(), GNUNET_IDENTITY_TYPE_ECDSA, GNUNET_log, GNUNET_new, GNUNET_strdup, GNUNET_MESSENGER_EgoOperation::identifier, GNUNET_MESSENGER_EgoStore::identity, GNUNET_MESSENGER_EgoStore::op_end, GNUNET_MESSENGER_EgoStore::op_start, GNUNET_MESSENGER_EgoOperation::operation, and GNUNET_MESSENGER_EgoOperation::store.

Referenced by callback_ego_delete(), and callback_update_handle().

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

◆ bind_store_ego()

void bind_store_ego ( struct GNUNET_MESSENGER_EgoStore store,
const char *  identifier,
void *  handle 
)

Binds an EGO which was registered to a store under a specific identifier to a given handle

Parameters
[in,out]storeEGO-store
[in]identifierIdentifier string
[in,out]handleHandle

Definition at line 202 of file gnunet-service-messenger_ego_store.c.

205 {
206  GNUNET_assert ((store) && (identifier) && (handle));
207 
208  GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Store bind ego: %s\n", identifier);
209 
210  struct GNUNET_HashCode hash;
211  GNUNET_CRYPTO_hash (identifier, strlen (identifier), &hash);
212 
214  return;
215 
218  GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Putting handle binding to ego store failed!\n");
219 }
static struct GNUNET_DNS_Handle * handle
Handle to transport service.
void GNUNET_CRYPTO_hash(const void *block, size_t size, struct GNUNET_HashCode *ret)
Compute hash of a given block.
Definition: crypto_hash.c:41
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multihashmap_contains_value(const struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key, const void *value)
Check if the map contains the given value under the given key.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multihashmap_put(struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt)
Store a key-value pair in the map.
@ GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE
Allow multiple values with the same key.
@ GNUNET_OK
@ GNUNET_YES
@ GNUNET_ERROR_TYPE_ERROR
A 512-bit hashcode.

References GNUNET_assert, GNUNET_CONTAINER_multihashmap_contains_value(), GNUNET_CONTAINER_multihashmap_put(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE, GNUNET_CRYPTO_hash(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_log, GNUNET_OK, GNUNET_YES, handle, GNUNET_MESSENGER_EgoStore::handles, GNUNET_MESSENGER_EgoOperation::identifier, and GNUNET_MESSENGER_EgoOperation::store.

Referenced by callback_update_handle().

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

◆ unbind_store_ego()

void unbind_store_ego ( struct GNUNET_MESSENGER_EgoStore store,
const char *  identifier,
void *  handle 
)

Binds an EGO which was registered to a store under a specific identifier to a given handle

Parameters
[in,out]storeEGO-store
[in]identifierIdentifier string
[in,out]handleHandle

Definition at line 222 of file gnunet-service-messenger_ego_store.c.

225 {
226  GNUNET_assert ((store) && (identifier) && (handle));
227 
228  GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Store unbind ego: %s\n", identifier);
229 
230  struct GNUNET_HashCode hash;
231  GNUNET_CRYPTO_hash (identifier, strlen (identifier), &hash);
232 
234  return;
235 
237  GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Removing handle binding from ego store failed!\n");
238 }
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multihashmap_remove(struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key, const void *value)
Remove the given key-value pair from the map.

References GNUNET_assert, GNUNET_CONTAINER_multihashmap_contains_value(), GNUNET_CONTAINER_multihashmap_remove(), GNUNET_CRYPTO_hash(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_log, GNUNET_YES, handle, and GNUNET_MESSENGER_EgoStore::handles.

Referenced by destroy_srv_handle().

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

◆ lookup_store_ego()

void lookup_store_ego ( struct GNUNET_MESSENGER_EgoStore store,
const char *  identifier,
GNUNET_MESSENGER_EgoLookupCallback  lookup,
void *  cls 
)

Lookups an EGO which was registered to a store under a specific identifier.

Parameters
[in,out]storeEGO-store
[in]identifierIdentifier string
[in]lookupLookup callback (non-NULL)
[in]clsClosure

Definition at line 281 of file gnunet-service-messenger_ego_store.c.

285 {
286  GNUNET_assert (store);
287 
288  GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Store lookup ego: %s\n", identifier);
289 
290  if (!identifier)
291  {
292  lookup(cls, identifier, NULL);
293  return;
294  }
295 
297 
298  element->store = store;
299 
300  element->cb = lookup;
301  element->cls = cls;
302 
303  element->identifier = GNUNET_strdup (identifier);
304 
306 
308 }
static void callback_ego_lookup(void *cls, struct GNUNET_IDENTITY_Ego *ego)
struct GNUNET_IDENTITY_EgoLookup * GNUNET_IDENTITY_ego_lookup(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *name, GNUNET_IDENTITY_EgoCallback cb, void *cb_cls)
Lookup an ego by name.
GNUNET_MESSENGER_EgoLookupCallback cb

References callback_ego_lookup(), GNUNET_MESSENGER_EgoLookup::cb, GNUNET_MESSENGER_EgoStore::cfg, GNUNET_MESSENGER_EgoLookup::cls, GNUNET_assert, GNUNET_CONTAINER_DLL_insert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_IDENTITY_ego_lookup(), GNUNET_log, GNUNET_new, GNUNET_strdup, GNUNET_MESSENGER_EgoLookup::identifier, GNUNET_MESSENGER_EgoLookup::lookup, GNUNET_MESSENGER_EgoStore::lu_end, GNUNET_MESSENGER_EgoStore::lu_start, and GNUNET_MESSENGER_EgoLookup::store.

Referenced by set_srv_handle_name(), setup_srv_handle_name(), and update_srv_handle().

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

◆ update_store_ego()

struct GNUNET_MESSENGER_Ego* update_store_ego ( struct GNUNET_MESSENGER_EgoStore store,
const char *  identifier,
const struct GNUNET_IDENTITY_PrivateKey key 
)

Updates the registration of an EGO to a store under a specific identifier with a new key.

Parameters
[in,out]storeEGO-store
[in]identifierIdentifier string
[in]keyPrivate EGO key
Returns
Updated EGO

Definition at line 311 of file gnunet-service-messenger_ego_store.c.

314 {
315  GNUNET_assert ((store) && (identifier) && (key));
316 
317  GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Store update ego: %s\n", identifier);
318 
319  struct GNUNET_HashCode hash;
320  GNUNET_CRYPTO_hash (identifier, strlen (identifier), &hash);
321 
322  struct GNUNET_MESSENGER_Ego *ego = GNUNET_CONTAINER_multihashmap_get (store->egos, &hash);
323 
324  if (!ego)
325  {
326  ego = GNUNET_new(struct GNUNET_MESSENGER_Ego);
328  }
329 
330  GNUNET_memcpy(&(ego->priv), key, sizeof(*key));
331 
333  GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Updating invalid ego key failed!\n");
334 
335  return ego;
336 }
struct GNUNET_HashCode key
The key used in the DHT.
void * GNUNET_CONTAINER_multihashmap_get(const struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key)
Given a key find a value in the map matching the key.
@ GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST
, ' bother checking if a value already exists (faster than GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE...
enum GNUNET_GenericReturnValue GNUNET_IDENTITY_key_get_public(const struct GNUNET_IDENTITY_PrivateKey *privkey, struct GNUNET_IDENTITY_PublicKey *key)
Retrieves the public key representation of a private key.
Definition: identity_api.c:179
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
@ GNUNET_ERROR_TYPE_WARNING
struct GNUNET_IDENTITY_PublicKey pub
struct GNUNET_IDENTITY_PrivateKey priv

References GNUNET_MESSENGER_EgoStore::egos, GNUNET_assert, GNUNET_CONTAINER_multihashmap_get(), GNUNET_CONTAINER_multihashmap_put(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST, GNUNET_CRYPTO_hash(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_WARNING, GNUNET_IDENTITY_key_get_public(), GNUNET_log, GNUNET_memcpy, GNUNET_new, GNUNET_OK, key, GNUNET_MESSENGER_Ego::priv, and GNUNET_MESSENGER_Ego::pub.

Referenced by callback_ego_create(), callback_ego_lookup(), and callback_update_ego().

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

◆ delete_store_ego()

void delete_store_ego ( struct GNUNET_MESSENGER_EgoStore store,
const char *  identifier 
)

Deletes the registration of an EGO in a store under a specific identifier.

Parameters
[in,out]storeEGO-store
[in]identifierIdentifier string

Definition at line 339 of file gnunet-service-messenger_ego_store.c.

341 {
342  GNUNET_assert ((store) && (identifier));
343 
344  GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Store delete ego: %s\n", identifier);
345 
346  struct GNUNET_HashCode hash;
347  GNUNET_CRYPTO_hash (identifier, strlen (identifier), &hash);
348 
349  struct GNUNET_MESSENGER_Ego *ego = GNUNET_CONTAINER_multihashmap_get (store->egos, &hash);
350 
351  if (ego)
352  {
353  GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Ego is not stored!\n");
354  return;
355  }
356 
357  if (GNUNET_YES != GNUNET_CONTAINER_multihashmap_remove (store->egos, &hash, ego))
358  {
359  GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Removing ego from store failed!\n");
360  return;
361  }
362 
363  GNUNET_free(ego);
364 }

References GNUNET_MESSENGER_EgoStore::egos, GNUNET_assert, GNUNET_CONTAINER_multihashmap_get(), GNUNET_CONTAINER_multihashmap_remove(), GNUNET_CRYPTO_hash(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_log, and GNUNET_YES.

Referenced by callback_ego_lookup(), and callback_update_ego().

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

◆ rename_store_ego()

void rename_store_ego ( struct GNUNET_MESSENGER_EgoStore store,
const char *  old_identifier,
const char *  new_identifier 
)

Updates the location of a registered EGO in a store to a different one under a specific new_identifier replacing its old one.

Parameters
[in,out]storeEGO-store
[in]old_identifierOld identifier string
[in]new_identifierNew identifier string

Definition at line 410 of file gnunet-service-messenger_ego_store.c.

413 {
414  GNUNET_assert ((store) && (old_identifier) && (new_identifier));
415 
416  GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Store rename ego: %s -> %s\n", old_identifier, new_identifier);
417 
419 
420  element->store = store;
421  element->cls = GNUNET_strdup (new_identifier);
422 
423  element->identifier = GNUNET_strdup (old_identifier);
424 
425  element->operation = GNUNET_IDENTITY_rename (
426  store->identity,
427  old_identifier,
428  new_identifier,
430  element
431  );
432 
434 }
static void callback_ego_rename(void *cls, enum GNUNET_ErrorCode ec)
struct GNUNET_IDENTITY_Operation * GNUNET_IDENTITY_rename(struct GNUNET_IDENTITY_Handle *h, const char *old_name, const char *new_name, GNUNET_IDENTITY_Continuation cb, void *cb_cls)
Renames an existing identity.
Definition: identity_api.c:646

References callback_ego_rename(), GNUNET_MESSENGER_EgoOperation::cls, GNUNET_assert, GNUNET_CONTAINER_DLL_insert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_IDENTITY_rename(), GNUNET_log, GNUNET_new, GNUNET_strdup, GNUNET_MESSENGER_EgoOperation::identifier, GNUNET_MESSENGER_EgoStore::identity, GNUNET_MESSENGER_EgoStore::op_end, GNUNET_MESSENGER_EgoStore::op_start, GNUNET_MESSENGER_EgoOperation::operation, and GNUNET_MESSENGER_EgoOperation::store.

Referenced by callback_set_handle_name().

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

◆ renew_store_ego()

void renew_store_ego ( struct GNUNET_MESSENGER_EgoStore store,
const char *  identifier 
)

Replaces the registered EGO in a store under a specific identifier with a newly created one.

Parameters
[in,out]storeEGO-store
[in]identifierIdentifier string

Definition at line 460 of file gnunet-service-messenger_ego_store.c.

462 {
463  GNUNET_assert ((store) && (identifier));
464 
465  GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Store renew ego: %s\n", identifier);
466 
468 
469  element->store = store;
470  element->cls = NULL;
471 
472  element->identifier = GNUNET_strdup (identifier);
473 
475  store->identity,
476  identifier,
478  element
479  );
480 
482 }
static void callback_ego_delete(void *cls, enum GNUNET_ErrorCode ec)
struct GNUNET_IDENTITY_Operation * GNUNET_IDENTITY_delete(struct GNUNET_IDENTITY_Handle *h, const char *name, GNUNET_IDENTITY_Continuation cb, void *cb_cls)
Delete an existing identity.
Definition: identity_api.c:699

References callback_ego_delete(), GNUNET_MESSENGER_EgoOperation::cls, GNUNET_assert, GNUNET_CONTAINER_DLL_insert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_IDENTITY_delete(), GNUNET_log, GNUNET_new, GNUNET_strdup, GNUNET_MESSENGER_EgoOperation::identifier, GNUNET_MESSENGER_EgoStore::identity, GNUNET_MESSENGER_EgoStore::op_end, GNUNET_MESSENGER_EgoStore::op_start, GNUNET_MESSENGER_EgoOperation::operation, and GNUNET_MESSENGER_EgoOperation::store.

Referenced by callback_update_handle().

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