![]() |
GNUnet
0.16.x
|
GNUnet MESSENGER service. More...
Go to the source code of this file.
Functions | |
static void | callback_update_ego (void *cls, struct GNUNET_IDENTITY_Ego *ego, void **ctx, const char *identifier) |
void | init_ego_store (struct GNUNET_MESSENGER_EgoStore *store, const struct GNUNET_CONFIGURATION_Handle *config) |
Initializes an EGO-store as fully empty. More... | |
static int | iterate_destroy_egos (void *cls, const struct GNUNET_HashCode *key, void *value) |
void | clear_ego_store (struct GNUNET_MESSENGER_EgoStore *store) |
Clears an EGO-store, wipes its content and deallocates its memory. More... | |
static int | iterate_create_ego (void *cls, const struct GNUNET_HashCode *key, void *value) |
static void | callback_ego_create (void *cls, const struct GNUNET_IDENTITY_PrivateKey *key, const char *emsg) |
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... | |
static void | callback_ego_lookup (void *cls, struct GNUNET_IDENTITY_Ego *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. More... | |
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. 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... | |
static void | callback_ego_rename (void *cls, const char *emsg) |
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... | |
static void | callback_ego_delete (void *cls, const char *emsg) |
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... | |
GNUnet MESSENGER service.
Definition in file gnunet-service-messenger_ego_store.c.
|
static |
Definition at line 31 of file gnunet-service-messenger_ego_store.c.
References ctx, delete_store_ego(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_IDENTITY_ego_get_private_key(), GNUNET_log, and update_store_ego().
Referenced by 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.
[out] | store | EGO-store |
[in] | config | Configuration handle |
Definition at line 54 of file gnunet-service-messenger_ego_store.c.
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().
|
static |
Definition at line 72 of file gnunet-service-messenger_ego_store.c.
References GNUNET_free, GNUNET_YES, and value.
Referenced by clear_ego_store().
void clear_ego_store | ( | struct GNUNET_MESSENGER_EgoStore * | store | ) |
Clears an EGO-store, wipes its content and deallocates its memory.
[in/out] | store EGO-store |
Definition at line 82 of file gnunet-service-messenger_ego_store.c.
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().
|
static |
Definition at line 130 of file gnunet-service-messenger_ego_store.c.
References GNUNET_YES, handle, set_handle_ego(), and value.
Referenced by callback_ego_create().
|
static |
Definition at line 140 of file gnunet-service-messenger_ego_store.c.
References GNUNET_MESSENGER_EgoOperation::cls, GNUNET_assert, GNUNET_CONTAINER_DLL_remove, GNUNET_CONTAINER_multihashmap_get_multiple(), GNUNET_CRYPTO_hash(), GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_log, GNUNET_MESSENGER_EgoStore::handles, GNUNET_MESSENGER_EgoOperation::identifier, iterate_create_ego(), key, GNUNET_MESSENGER_EgoStore::op_end, GNUNET_MESSENGER_EgoStore::op_start, GNUNET_MESSENGER_EgoOperation::store, and update_store_ego().
Referenced by 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.
[in/out] | store EGO-store | |
[in] | identifier | Identifier string |
Definition at line 170 of file gnunet-service-messenger_ego_store.c.
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().
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
[in/out] | store EGO-store | |
[in] | identifier | Identifier string |
[in/out] | handle Handle |
Definition at line 197 of file gnunet-service-messenger_ego_store.c.
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().
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
[in/out] | store EGO-store | |
[in] | identifier | Identifier string |
[in/out] | handle Handle |
Definition at line 217 of file gnunet-service-messenger_ego_store.c.
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_handle().
|
static |
Definition at line 236 of file gnunet-service-messenger_ego_store.c.
References GNUNET_MESSENGER_EgoLookup::cb, GNUNET_MESSENGER_EgoLookup::cls, delete_store_ego(), GNUNET_MESSENGER_EgoStore::egos, GNUNET_assert, GNUNET_CONTAINER_DLL_remove, GNUNET_CONTAINER_multihashmap_get(), GNUNET_CRYPTO_hash(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_IDENTITY_ego_get_private_key(), GNUNET_log, GNUNET_MESSENGER_EgoLookup::identifier, GNUNET_MESSENGER_EgoStore::lu_end, GNUNET_MESSENGER_EgoStore::lu_start, GNUNET_MESSENGER_EgoLookup::store, and update_store_ego().
Referenced by 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.
[in/out] | store EGO-store | |
[in] | identifier | Identifier string |
[in] | lookup | Lookup callback (non-NULL) |
[in] | cls | Closure |
Definition at line 276 of file gnunet-service-messenger_ego_store.c.
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_handle_name(), setup_handle_name(), and update_handle().
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.
[in/out] | store EGO-store | |
[in] | identifier | Identifier string |
[in] | key | Private EGO key |
Definition at line 306 of file gnunet-service-messenger_ego_store.c.
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().
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.
[in/out] | store EGO-store | |
[in] | identifier | Identifier string |
Definition at line 334 of file gnunet-service-messenger_ego_store.c.
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().
|
static |
Definition at line 362 of file gnunet-service-messenger_ego_store.c.
References GNUNET_MESSENGER_EgoOperation::cls, GNUNET_MESSENGER_EgoStore::egos, GNUNET_assert, GNUNET_CONTAINER_DLL_remove, GNUNET_CONTAINER_multihashmap_get(), GNUNET_CONTAINER_multihashmap_put(), GNUNET_CONTAINER_multihashmap_remove(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST, GNUNET_CRYPTO_hash(), GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_log, GNUNET_YES, GNUNET_MESSENGER_EgoOperation::identifier, GNUNET_MESSENGER_EgoStore::op_end, GNUNET_MESSENGER_EgoStore::op_start, and GNUNET_MESSENGER_EgoOperation::store.
Referenced by 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.
[in/out] | store EGO-store | |
[in] | old_identifier | Old identifier string |
[in] | new_identifier | New identifier string |
Definition at line 401 of file gnunet-service-messenger_ego_store.c.
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().
|
static |
Definition at line 428 of file gnunet-service-messenger_ego_store.c.
References GNUNET_MESSENGER_EgoOperation::cls, create_store_ego(), GNUNET_assert, GNUNET_CONTAINER_DLL_remove, GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_log, GNUNET_MESSENGER_EgoOperation::identifier, GNUNET_MESSENGER_EgoStore::op_end, GNUNET_MESSENGER_EgoStore::op_start, and GNUNET_MESSENGER_EgoOperation::store.
Referenced by 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.
[in/out] | store EGO-store | |
[in] | identifier | Identifier string |
Definition at line 447 of file gnunet-service-messenger_ego_store.c.
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().