Go to the source code of this file.
Functions | |
void | delayed_disconnect_channel (struct GNUNET_CADET_Channel *channel) |
Starts an urgent task to close a CADET channel asynchronously. More... | |
enum GNUNET_GenericReturnValue | generate_free_member_id (struct GNUNET_ShortHashCode *id, const struct GNUNET_CONTAINER_MultiShortmap *members) |
Tries to generate an unused member id and store it into the id parameter. More... | |
const struct GNUNET_CRYPTO_PrivateKey * | get_anonymous_private_key (void) |
Returns the private identity key of GNUNET_IDENTITY_ego_get_anonymous() without recalculating it every time. More... | |
const struct GNUNET_CRYPTO_PublicKey * | get_anonymous_public_key (void) |
Returns the public identity key of GNUNET_IDENTITY_ego_get_anonymous() without recalculating it every time. More... | |
void | convert_messenger_key_to_port (const struct GNUNET_HashCode *key, struct GNUNET_HashCode *port) |
Converts a Messenger service key of a room to the specific port which gets used for the CADET channels. More... | |
void | convert_peer_identity_to_id (const struct GNUNET_PeerIdentity *identity, struct GNUNET_ShortHashCode *id) |
Converts a peers identity to a short hash code which can be used as id to refer to a peer via sender id as attached in messages. More... | |
void delayed_disconnect_channel | ( | struct GNUNET_CADET_Channel * | channel | ) |
Starts an urgent task to close a CADET channel asynchronously.
[in,out] | channel | Channel |
Definition at line 44 of file messenger_api_util.c.
References callback_close_channel(), GNUNET_assert, GNUNET_SCHEDULER_add_delayed_with_priority(), GNUNET_SCHEDULER_PRIORITY_URGENT, and GNUNET_TIME_relative_get_zero_().
Referenced by bind_tunnel(), callback_room_connect(), and disconnect_tunnel().
enum GNUNET_GenericReturnValue generate_free_member_id | ( | struct GNUNET_ShortHashCode * | id, |
const struct GNUNET_CONTAINER_MultiShortmap * | members | ||
) |
Tries to generate an unused member id and store it into the id parameter.
A map containing all currently used member ids is used to check against.
[out] | id | New member id |
[in] | members | Map of member ids |
Definition at line 55 of file messenger_api_util.c.
References GNUNET_assert, GNUNET_CONTAINER_multishortmap_contains(), GNUNET_CONTAINER_multishortmap_size(), GNUNET_CRYPTO_QUALITY_STRONG, GNUNET_CRYPTO_random_block(), GNUNET_NO, and GNUNET_YES.
Referenced by create_handle_member_id(), create_member(), and solve_srv_room_member_collisions().
const struct GNUNET_CRYPTO_PrivateKey * get_anonymous_private_key | ( | void | ) |
Returns the private identity key of GNUNET_IDENTITY_ego_get_anonymous() without recalculating it every time.
Definition at line 85 of file messenger_api_util.c.
References GNUNET_IDENTITY_ego_get_anonymous(), and GNUNET_IDENTITY_ego_get_private_key().
Referenced by get_handle_key().
const struct GNUNET_CRYPTO_PublicKey * get_anonymous_public_key | ( | void | ) |
Returns the public identity key of GNUNET_IDENTITY_ego_get_anonymous() without recalculating it every time.
Definition at line 94 of file messenger_api_util.c.
References GNUNET_IDENTITY_ego_get_anonymous(), and GNUNET_IDENTITY_ego_get_public_key().
Referenced by get_handle_pubkey(), get_non_anonymous_key(), initialize_service_handle(), and select_store_contact_map().
void convert_messenger_key_to_port | ( | const struct GNUNET_HashCode * | key, |
struct GNUNET_HashCode * | port | ||
) |
Converts a Messenger service key of a room to the specific port which gets used for the CADET channels.
The port includes upper bits of the GNUNET_MESSENGER_VERSION to reduce the chance of incompatible connections.
[in] | key | Messenger service room key |
[out] | port | CADET service port |
Definition at line 110 of file messenger_api_util.c.
References GNUNET_assert, GNUNET_CRYPTO_hash(), GNUNET_CRYPTO_hash_sum(), GNUNET_htole32, GNUNET_MESSENGER_VERSION, key, and port.
Referenced by connect_tunnel(), and open_srv_room().
void convert_peer_identity_to_id | ( | const struct GNUNET_PeerIdentity * | identity, |
struct GNUNET_ShortHashCode * | id | ||
) |
Converts a peers identity to a short hash code which can be used as id to refer to a peer via sender id as attached in messages.
[in] | identity | Peer identity |
[out] | id | Short peer id |
Definition at line 131 of file messenger_api_util.c.
References GNUNET_assert, GNUNET_memcpy, and identity.
Referenced by get_store_peer_of(), load_peer_store(), pack_srv_room_message(), and update_store_peer().