GNUnet MESSENGER service. More...
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_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... | |
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... | |
GNUnet MESSENGER service.
Definition in file gnunet-service-messenger_ego_store.h.
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.
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 55 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().
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 83 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().
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 175 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 202 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 222 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_srv_handle().
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 281 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_srv_handle_name(), setup_srv_handle_name(), and update_srv_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 311 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 339 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().
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 410 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().
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 460 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().