#include "gnunet_common.h"#include "gnunet_messenger_service.h"#include "gnunet_pils_service.h"#include "gnunet_util_lib.h"#include "messenger_api_message.h"#include "platform.h"#include "gnunet-service-messenger_room.h"#include "gnunet-service-messenger_basement.h"#include "gnunet-service-messenger_member.h"#include "gnunet-service-messenger_member_session.h"#include "gnunet-service-messenger_sender_session.h"#include "gnunet-service-messenger_message_kind.h"#include "gnunet-service-messenger_message_handle.h"#include "gnunet-service-messenger_message_send.h"#include "gnunet-service-messenger_operation.h"#include "gnunet-service-messenger_service.h"#include "gnunet-service-messenger_tunnel.h"#include "messenger_api_util.h"#include <stdint.h>#include <string.h>Go to the source code of this file.
Data Structures | |
| struct | GNUNET_MESSENGER_ClosureSendRoom |
| struct | GNUNET_MESSENGER_MemberSubscriptionIteration |
| struct | GNUNET_MESSENGER_SrvMemberSessionCompletion |
| struct | GNUNET_MESSENGER_MemberUpdate |
Functions | |
| static void | idle_request_room_messages (void *cls) |
| static void | get_room_data_subdir (struct GNUNET_MESSENGER_SrvRoom *room, char **dir) |
| struct GNUNET_MESSENGER_SrvRoom * | create_srv_room (struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_HashCode *key) |
| Creates and allocates a new room for a handle with a given key. | |
| static enum GNUNET_GenericReturnValue | iterate_destroy_tunnels (void *cls, const struct GNUNET_PeerIdentity *key, void *value) |
| static enum GNUNET_GenericReturnValue | iterate_cancel_signature (void *cls, const struct GNUNET_HashCode *key, void *value) |
| static void | close_srv_room (struct GNUNET_MESSENGER_SrvRoom *room) |
| static void | handle_room_messages (struct GNUNET_MESSENGER_SrvRoom *room) |
| void | destroy_srv_room (struct GNUNET_MESSENGER_SrvRoom *room, enum GNUNET_GenericReturnValue deletion) |
| Destroys a room and frees its memory fully. | |
| struct GNUNET_MESSENGER_PeerStore * | get_srv_room_peer_store (struct GNUNET_MESSENGER_SrvRoom *room) |
| Returns the used peer store of a given room. | |
| struct GNUNET_MESSENGER_MemberStore * | get_srv_room_member_store (struct GNUNET_MESSENGER_SrvRoom *room) |
| Returns the used member store of a given room. | |
| struct GNUNET_MESSENGER_MessageStore * | get_srv_room_message_store (struct GNUNET_MESSENGER_SrvRoom *room) |
| Returns the used message store of a given room. | |
| struct GNUNET_MESSENGER_OperationStore * | get_srv_room_operation_store (struct GNUNET_MESSENGER_SrvRoom *room) |
| Returns the used operation store of a given room. | |
| static enum GNUNET_GenericReturnValue | send_room_info (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, struct GNUNET_MESSENGER_SrvTunnel *tunnel) |
| static void * | callback_room_connect (void *cls, struct GNUNET_CADET_Channel *channel, const struct GNUNET_PeerIdentity *source) |
| static enum GNUNET_GenericReturnValue | join_room (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, struct GNUNET_MESSENGER_Member *member, const struct GNUNET_ShortHashCode *id) |
| static enum GNUNET_GenericReturnValue | join_room_locally (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle) |
| enum GNUNET_GenericReturnValue | open_srv_room (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle) |
| Tries to open a room for a given handle. | |
| enum GNUNET_GenericReturnValue | enter_srv_room_at (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_PeerIdentity *door) |
| Connects a tunnel to a hosting peer of a room through a so called door which is represented by a peer identity of a hosting peer. | |
| static void | callback_srv_room_sign_result (void *cls, const struct GNUNET_PeerIdentity *identity, const struct GNUNET_CRYPTO_EddsaSignature *peer_signature) |
| enum GNUNET_GenericReturnValue | sign_srv_room_message (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_Message *message, GNUNET_MESSENGER_SignedCallback callback, void *closure) |
| Packs a message depending on its kind into a newly allocated envelope. | |
| enum GNUNET_GenericReturnValue | update_room_message (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash) |
| void | callback_room_handle_message (struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash) |
| static void | callback_srv_room_message_signed (void *cls, struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_Message *message, struct GNUNET_MQ_Envelope *envelope, const struct GNUNET_HashCode *hash) |
| enum GNUNET_GenericReturnValue | send_srv_room_message (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, struct GNUNET_MESSENGER_Message *message) |
| Sends a message from a given handle into a room. | |
| static enum GNUNET_GenericReturnValue | iterate_send_room_envelope (void *cls, const struct GNUNET_PeerIdentity *key, void *value) |
| void | send_srv_room_envelope (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvTunnel *tunnel, struct GNUNET_MQ_Envelope *envelope, const struct GNUNET_HashCode *hash) |
| Sends an envelope from a message with a given hash excluding a specific tunnel inside of a room. | |
| void | check_srv_room_peer_status (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvTunnel *tunnel) |
| Checks the current state of opening a given room from this peer and re-publishes it if necessary to a selected tunnel or to all connected tunnels if necessary or if the selected tunnel is NULL. | |
| enum GNUNET_GenericReturnValue | merge_srv_room_last_messages (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle) |
| Reduces all current forks inside of the message history of a room to one remaining last message by merging them down. | |
| enum GNUNET_GenericReturnValue | delete_srv_room_message (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvMemberSession *session, const struct GNUNET_HashCode *hash, const struct GNUNET_TIME_Relative delay) |
| Deletes a message from the room with a given hash in a specific delay if the provided member by its session is permitted to do so. | |
| struct GNUNET_CADET_Handle * | get_srv_room_cadet (struct GNUNET_MESSENGER_SrvRoom *room) |
| Returns the CADET handle from a rooms service. | |
| const struct GNUNET_HashCode * | get_srv_room_key (const struct GNUNET_MESSENGER_SrvRoom *room) |
| Returns the shared secret you need to access a room. | |
| const struct GNUNET_MESSENGER_SrvTunnel * | get_srv_room_tunnel (const struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_PeerIdentity *peer) |
| Returns a tunnel inside of a room leading towards a given peer if such a tunnel exists, otherwise NULL. | |
| static enum GNUNET_GenericReturnValue | request_room_message_step (struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_HashCode *hash, const struct GNUNET_MESSENGER_SrvMemberSession *session, GNUNET_MESSENGER_MessageRequestCallback callback, void *cls) |
| enum GNUNET_GenericReturnValue | request_srv_room_message (struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_HashCode *hash, const struct GNUNET_MESSENGER_SrvMemberSession *session, GNUNET_MESSENGER_MessageRequestCallback callback, void *cls) |
| Requests a message from a room identified by a given hash. | |
| void | solve_srv_room_member_collisions (struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_CRYPTO_BlindablePublicKey *public_key, const struct GNUNET_ShortHashCode *member_id, struct GNUNET_TIME_Absolute timestamp) |
| Checks for potential collisions with member ids and solves them changing active handles ids if they use an already used member id (comparing public key and timestamp). | |
| void | rebuild_srv_room_basement_structure (struct GNUNET_MESSENGER_SrvRoom *room) |
| Rebuilds the decentralized structure for a room by ensuring all required connections are made depending on the amount of peers and this peers index in the list of them. | |
| uint32_t | get_srv_room_amount_of_tunnels (const struct GNUNET_MESSENGER_SrvRoom *room) |
| Returns the amount of active tunnels of a given room. | |
| uint32_t | get_srv_room_connection_flags (const struct GNUNET_MESSENGER_SrvRoom *room) |
| Returns connection flags about connection information of a given room and the service managing it. | |
| static enum GNUNET_GenericReturnValue | iterate_member_for_subscription (void *cls, const struct GNUNET_CRYPTO_BlindablePublicKey *public_key, struct GNUNET_MESSENGER_SrvMemberSession *session) |
| void | cleanup_srv_room_discourse_messages (struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_ShortHashCode *discourse) |
| Cleanup discourse messages outside of current subscriptions from a specific discourse of all the members in a given room. | |
| static enum GNUNET_GenericReturnValue | iterate_update_member_sessions (void *cls, const struct GNUNET_CRYPTO_BlindablePublicKey *public_key, struct GNUNET_MESSENGER_SrvMemberSession *session) |
| static void | remove_room_member_session (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvMemberSession *session) |
| void | load_srv_room (struct GNUNET_MESSENGER_SrvRoom *room) |
| Loads the local configuration for a given room of a service which contains the last messages hash and the ruleset for general access of new members. | |
| void | save_srv_room (struct GNUNET_MESSENGER_SrvRoom *room) |
| Saves the configuration for a given room of a service which contains the last messages hash and the ruleset for general access of new members locally. | |
| void | remove_srv_room (struct GNUNET_MESSENGER_SrvRoom *room) |
| Removes the configuration for a given room of a service. | |
|
static |
Definition at line 1135 of file gnunet-service-messenger_room.c.
References get_message_state_merge_hash(), get_srv_room_operation_store(), get_store_operation_type(), GNUNET_assert, GNUNET_is_zero, GNUNET_MESSENGER_IDLE_DELAY, GNUNET_MESSENGER_MERGE_DELAY, GNUNET_MESSENGER_OP_MERGE, GNUNET_MESSENGER_OP_UNKNOWN, GNUNET_SCHEDULER_add_delayed_with_priority(), GNUNET_SCHEDULER_PRIORITY_IDLE, GNUNET_MESSENGER_SrvRoom::idle, idle_request_room_messages(), GNUNET_MESSENGER_SrvRoom::state, and use_store_operation().
Referenced by create_srv_room(), and idle_request_room_messages().
|
static |
Definition at line 53 of file gnunet-service-messenger_room.c.
References dir, GNUNET_MESSENGER_Service::dir, DIR_SEPARATOR, get_srv_room_key(), GNUNET_asprintf(), GNUNET_assert, GNUNET_h2s(), and GNUNET_MESSENGER_SrvRoom::service.
Referenced by create_srv_room(), load_srv_room(), remove_room_member_session(), remove_srv_room(), and save_srv_room().
| struct GNUNET_MESSENGER_SrvRoom * create_srv_room | ( | struct GNUNET_MESSENGER_SrvHandle * | handle, |
| const struct GNUNET_HashCode * | key | ||
| ) |
Creates and allocates a new room for a handle with a given key.
| [in,out] | handle | Handle |
| [in] | key | Key of room |
Definition at line 68 of file gnunet-service-messenger_room.c.
References GNUNET_MESSENGER_SrvRoom::basement, GNUNET_MESSENGER_Service::dir, get_room_data_subdir(), get_srv_room_member_store(), get_srv_room_message_store(), get_srv_room_operation_store(), get_srv_room_peer_store(), GNUNET_assert, GNUNET_CONTAINER_multihashmap_create(), GNUNET_CONTAINER_multipeermap_create(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_h2s(), GNUNET_log, GNUNET_memcpy, GNUNET_new, GNUNET_NO, GNUNET_SCHEDULER_add_with_priority(), GNUNET_SCHEDULER_PRIORITY_IDLE, GNUNET_YES, handle, GNUNET_MESSENGER_SrvRoom::handling, GNUNET_MESSENGER_SrvRoom::host, GNUNET_MESSENGER_SrvRoom::idle, idle_request_room_messages(), init_list_messages(), init_list_tunnels(), init_member_store(), init_message_state(), init_message_store(), init_operation_store(), init_peer_store(), key, GNUNET_MESSENGER_SrvRoom::key, load_srv_room(), GNUNET_MESSENGER_SrvRoom::peer_message, GNUNET_MESSENGER_SrvRoom::port, GNUNET_MESSENGER_SrvRoom::service, GNUNET_MESSENGER_SrvRoom::signatures, GNUNET_MESSENGER_SrvRoom::state, GNUNET_MESSENGER_SrvRoom::sync, and GNUNET_MESSENGER_SrvRoom::tunnels.
Referenced by entry_service_room(), and open_service_room().
|
static |
Definition at line 120 of file gnunet-service-messenger_room.c.
References destroy_tunnel(), GNUNET_assert, GNUNET_YES, and value.
Referenced by destroy_srv_room().
|
static |
Definition at line 136 of file gnunet-service-messenger_room.c.
References destroy_message(), GNUNET_MESSENGER_SrvRoomSignature::envelope, GNUNET_assert, GNUNET_free, GNUNET_PILS_cancel(), GNUNET_YES, GNUNET_MESSENGER_SrvRoomSignature::message, GNUNET_MESSENGER_SrvRoomSignature::operation, and value.
Referenced by destroy_srv_room(), and sign_srv_room_message().
|
static |
Definition at line 480 of file gnunet-service-messenger_room.c.
References create_message_miss(), get_service_peer_identity(), GNUNET_assert, GNUNET_CADET_close_port(), GNUNET_ERROR_TYPE_ERROR, GNUNET_h2s(), GNUNET_log, GNUNET_OK, GNUNET_MESSENGER_SrvRoom::host, GNUNET_MESSENGER_SrvRoom::key, GNUNET_MESSENGER_SrvRoom::peer_message, GNUNET_MESSENGER_SrvRoom::port, send_srv_room_message(), and GNUNET_MESSENGER_SrvRoom::service.
Referenced by destroy_srv_room(), open_srv_room(), and rebuild_srv_room_basement_structure().
|
static |
Definition at line 1320 of file gnunet-service-messenger_room.c.
References get_member_session_of(), get_srv_room_key(), get_srv_room_member_store(), get_srv_room_message_store(), get_srv_room_peer_store(), get_store_member_of(), get_store_message(), get_store_message_epoch(), get_store_peer_of(), GNUNET_CONTAINER_DLL_remove, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_h2s(), GNUNET_log, GNUNET_YES, handle_service_message(), GNUNET_MESSENGER_SrvRoom::handling, GNUNET_MESSENGER_ListMessage::hash, GNUNET_MESSENGER_ListMessages::head, is_peer_message(), key, GNUNET_MESSENGER_SenderSession::member, GNUNET_MESSENGER_SenderSession::peer, GNUNET_MESSENGER_SrvRoom::service, and GNUNET_MESSENGER_ListMessages::tail.
Referenced by callback_room_handle_message(), and destroy_srv_room().
| void destroy_srv_room | ( | struct GNUNET_MESSENGER_SrvRoom * | room, |
| enum GNUNET_GenericReturnValue | deletion | ||
| ) |
Destroys a room and frees its memory fully.
The deletion flag should only be set to GNUNET_YES if the room gets dropped by the service, otherwise GNUNET_NO.
| [in,out] | room | Room |
| [in] | deletion | Flag to indicate context of destruction |
Definition at line 167 of file gnunet-service-messenger_room.c.
References GNUNET_MESSENGER_SrvRoom::basement, clear_list_tunnels(), clear_member_store(), clear_message_state(), clear_message_store(), clear_operation_store(), clear_peer_store(), close_srv_room(), GNUNET_MESSENGER_Service::dir, get_srv_room_member_store(), get_srv_room_message_store(), get_srv_room_operation_store(), get_srv_room_peer_store(), GNUNET_assert, GNUNET_CONTAINER_multihashmap_destroy(), GNUNET_CONTAINER_multihashmap_iterate(), GNUNET_CONTAINER_multipeermap_destroy(), GNUNET_CONTAINER_multipeermap_iterate(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_h2s(), GNUNET_log, GNUNET_SCHEDULER_cancel(), GNUNET_YES, handle_room_messages(), GNUNET_MESSENGER_SrvRoom::idle, iterate_cancel_signature(), iterate_destroy_tunnels(), GNUNET_MESSENGER_SrvRoom::key, GNUNET_MESSENGER_SrvRoom::peer_message, remove_srv_room(), GNUNET_MESSENGER_SrvRoomSignature::room, save_srv_room(), GNUNET_MESSENGER_SrvRoom::service, GNUNET_MESSENGER_SrvRoom::signatures, GNUNET_MESSENGER_SrvRoom::state, and GNUNET_MESSENGER_SrvRoom::tunnels.
Referenced by close_service_room(), entry_service_room(), iterate_destroy_rooms(), and open_service_room().
| struct GNUNET_MESSENGER_PeerStore * get_srv_room_peer_store | ( | struct GNUNET_MESSENGER_SrvRoom * | room | ) |
Returns the used peer store of a given room.
| [in,out] | room | Room |
Definition at line 218 of file gnunet-service-messenger_room.c.
References GNUNET_assert, and GNUNET_MESSENGER_SrvRoom::peer_store.
Referenced by callback_found_message(), callback_room_handle_message(), create_srv_room(), destroy_srv_room(), handle_message_miss(), handle_message_peer(), handle_room_messages(), load_srv_room(), save_srv_room(), and traverse_epoch_session_message().
| struct GNUNET_MESSENGER_MemberStore * get_srv_room_member_store | ( | struct GNUNET_MESSENGER_SrvRoom * | room | ) |
Returns the used member store of a given room.
| [in,out] | room | Room |
Definition at line 227 of file gnunet-service-messenger_room.c.
References GNUNET_assert, GNUNET_MESSENGER_SrvRoom::member_store, and GNUNET_MESSENGER_MemberStore::room.
Referenced by callback_found_message(), callback_room_handle_message(), cleanup_srv_room_discourse_messages(), create_srv_room(), destroy_srv_room(), get_handle_member_session(), handle_get_message(), handle_room_messages(), initialize_service_handle(), join_room_locally(), load_srv_room(), notify_srv_handle_message(), open_srv_room(), recv_message_info(), recv_message_request(), save_srv_room(), send_message_join(), solve_srv_room_member_collisions(), and traverse_epoch_session_message().
| struct GNUNET_MESSENGER_MessageStore * get_srv_room_message_store | ( | struct GNUNET_MESSENGER_SrvRoom * | room | ) |
Returns the used message store of a given room.
| [in,out] | room | Room |
Definition at line 236 of file gnunet-service-messenger_room.c.
References GNUNET_assert, and GNUNET_MESSENGER_SrvRoom::message_store.
Referenced by callback_found_message(), callback_operation(), check_member_session_completion(), check_srv_room_peer_status(), cleanup_srv_room_discourse_messages(), create_srv_room(), delete_srv_room_message(), destroy_srv_room(), forward_about_members(), handle_room_messages(), iterate_epoch_session_members(), iterate_srv_handle_sync_finished(), load_srv_room(), notify_about_members(), recv_message_info(), request_room_message_step(), save_srv_room(), sign_srv_room_message(), traverse_epoch_message(), update_room_message(), update_tunnel_last_message(), and verify_tunnel_message().
| struct GNUNET_MESSENGER_OperationStore * get_srv_room_operation_store | ( | struct GNUNET_MESSENGER_SrvRoom * | room | ) |
Returns the used operation store of a given room.
| [in,out] | room | Room |
Definition at line 245 of file gnunet-service-messenger_room.c.
References GNUNET_assert, GNUNET_MESSENGER_SrvRoom::operation_store, and GNUNET_MESSENGER_OperationStore::room.
Referenced by callback_found_message(), create_srv_room(), delete_srv_room_message(), destroy_srv_room(), idle_request_room_messages(), load_srv_room(), save_srv_room(), send_message_request(), update_room_message(), and update_tunnel_last_message().
|
static |
Definition at line 254 of file gnunet-service-messenger_room.c.
References create_message_info(), GNUNET_NO, handle, is_tunnel_connected(), GNUNET_MESSENGER_OperationStore::room, send_tunnel_message(), and GNUNET_MESSENGER_SrvRoom::service.
Referenced by callback_room_connect().
|
static |
Definition at line 267 of file gnunet-service-messenger_room.c.
References bind_tunnel(), GNUNET_MESSENGER_SrvTunnel::channel, create_tunnel(), delayed_disconnect_channel(), destroy_tunnel(), disconnect_tunnel(), get_srv_room_key(), GNUNET_assert, GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE, GNUNET_CONTAINER_multipeermap_put(), GNUNET_CONTAINER_multipeermap_remove(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_h2s(), GNUNET_i2s(), GNUNET_log, GNUNET_OK, GNUNET_YES, GNUNET_MESSENGER_SrvRoom::host, GNUNET_MESSENGER_SrvTunnel::room, send_room_info(), source, and GNUNET_MESSENGER_SrvRoom::tunnels.
Referenced by open_srv_room().
|
static |
Definition at line 319 of file gnunet-service-messenger_room.c.
References change_srv_handle_member_id(), get_member_id(), get_srv_room_key(), GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_h2s(), GNUNET_log, GNUNET_memcmp, GNUNET_NO, GNUNET_OK, GNUNET_sh2s(), GNUNET_YES, handle, notify_srv_handle_member_id(), and reset.
Referenced by join_room_locally(), and open_srv_room().
|
static |
Definition at line 353 of file gnunet-service-messenger_room.c.
References add_store_member(), get_srv_handle_member_id(), get_srv_room_key(), get_srv_room_member_store(), GNUNET_NO, GNUNET_YES, handle, and join_room().
Referenced by enter_srv_room_at(), and open_srv_room().
| enum GNUNET_GenericReturnValue open_srv_room | ( | struct GNUNET_MESSENGER_SrvRoom * | room, |
| struct GNUNET_MESSENGER_SrvHandle * | handle | ||
| ) |
Tries to open a room for a given handle.
If the room has already been opened, the handle will locally join the room.
Calling this method should result in joining a room and sending a peer message as well for this peer.
If the function returns GNUNET_YES the port for this room is guaranteed to be open for incoming connections.
| [in,out] | room | Room |
| [in,out] | handle | Handle |
Definition at line 372 of file gnunet-service-messenger_room.c.
References add_store_member(), cadet, callback_room_connect(), callback_tunnel_disconnect(), close_srv_room(), convert_messenger_key_to_port(), create_message_peer(), get_srv_handle_member_id(), get_srv_room_cadet(), get_srv_room_key(), get_srv_room_member_store(), GNUNET_assert, GNUNET_CADET_open_port(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_WARNING, GNUNET_h2s(), GNUNET_log, GNUNET_memcpy, GNUNET_MESSAGE_TYPE_CADET_CLI, GNUNET_MQ_handler_end, GNUNET_MQ_hd_var_size, GNUNET_NO, GNUNET_SYSERR, GNUNET_YES, handle, handlers, GNUNET_MESSENGER_SrvRoom::host, join_room(), join_room_locally(), key, port, GNUNET_MESSENGER_SrvRoom::port, send_srv_room_message(), and GNUNET_MESSENGER_SrvRoom::service.
Referenced by open_service_room(), and recv_message_miss().
| enum GNUNET_GenericReturnValue enter_srv_room_at | ( | struct GNUNET_MESSENGER_SrvRoom * | room, |
| struct GNUNET_MESSENGER_SrvHandle * | handle, | ||
| const struct GNUNET_PeerIdentity * | door | ||
| ) |
Connects a tunnel to a hosting peer of a room through a so called door which is represented by a peer identity of a hosting peer.
During the connection the handle will join the room as a member, waiting for an info message from the selected host.
| [in,out] | room | Room |
| [in,out] | handle | Handle |
| [in] | door | Peer identity |
Definition at line 510 of file gnunet-service-messenger_room.c.
References connect_tunnel(), create_tunnel(), destroy_tunnel(), get_service_peer_identity(), GNUNET_assert, GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE, GNUNET_CONTAINER_multipeermap_get(), GNUNET_CONTAINER_multipeermap_put(), GNUNET_CONTAINER_multipeermap_remove(), GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_WARNING, GNUNET_log, GNUNET_memcmp, GNUNET_NO, GNUNET_OK, GNUNET_SYSERR, handle, join_room_locally(), GNUNET_MESSENGER_SrvTunnel::peer, GNUNET_MESSENGER_SrvTunnel::room, GNUNET_MESSENGER_SrvRoom::service, and GNUNET_MESSENGER_SrvRoom::tunnels.
Referenced by callback_tunnel_disconnect(), and entry_service_room().
|
static |
Definition at line 554 of file gnunet-service-messenger_room.c.
References GNUNET_MESSENGER_SrvRoomSignature::callback, GNUNET_MESSENGER_SrvRoomSignature::closure, GNUNET_CRYPTO_BlindableKeySignature::eddsa_signature, encode_message_signature(), GNUNET_MESSENGER_SrvRoomSignature::envelope, GNUNET_assert, GNUNET_CONTAINER_multihashmap_remove(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_h2s(), GNUNET_i2s(), GNUNET_log, GNUNET_memcpy, GNUNET_MQ_env_get_msg(), GNUNET_YES, GNUNET_MESSENGER_SrvRoomSignature::hash, GNUNET_MESSENGER_Message::header, identity, GNUNET_MESSENGER_SrvRoomSignature::message, GNUNET_MESSENGER_SrvRoomSignature::operation, GNUNET_MESSENGER_SrvRoomSignature::room, GNUNET_MESSENGER_MessageHeader::signature, and GNUNET_MessageHeader::size.
Referenced by sign_srv_room_message().
| enum GNUNET_GenericReturnValue sign_srv_room_message | ( | struct GNUNET_MESSENGER_SrvRoom * | room, |
| struct GNUNET_MESSENGER_Message * | message, | ||
| GNUNET_MESSENGER_SignedCallback | callback, | ||
| void * | closure | ||
| ) |
Packs a message depending on its kind into a newly allocated envelope.
It will set the timestamp of the message, the sender id and the previous messages hash automatically before packing. The message will be signed by the peers private key if necessary.
When the message has been signed, the message and the packed envelope are passed into the provided callback which is required.
| [in,out] | room | Room |
| [in,out] | message | Message |
| [in] | callback | Callback of signature |
| [in,out] | closure | Closure |
Definition at line 615 of file gnunet-service-messenger_room.c.
References GNUNET_MESSENGER_Message::body, GNUNET_MESSENGER_SrvRoomSignature::callback, callback_srv_room_sign_result(), GNUNET_MESSENGER_SrvRoomSignature::closure, convert_peer_identity_to_id(), destroy_message(), GNUNET_MESSENGER_SrvRoomSignature::envelope, GNUNET_MESSENGER_MessageMerge::epochs, get_message_state_chain_hash(), get_service_peer_identity(), get_srv_room_message_store(), get_store_message_epoch(), GNUNET_assert, GNUNET_CONTAINER_multihashmap_put(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_h2s(), GNUNET_i2s(), GNUNET_log, GNUNET_memcpy, GNUNET_MESSENGER_KIND_MERGE, GNUNET_MESSENGER_name_of_kind(), GNUNET_MESSENGER_PACK_MODE_ENVELOPE, GNUNET_new, GNUNET_OK, GNUNET_PUBLIC_KEY_TYPE_EDDSA, GNUNET_sh2s(), GNUNET_SYSERR, GNUNET_TIME_absolute_get(), GNUNET_TIME_absolute_get_zero_(), GNUNET_TIME_absolute_hton(), GNUNET_YES, GNUNET_MESSENGER_SrvRoomSignature::hash, GNUNET_MESSENGER_Message::header, identity, is_epoch_message(), is_peer_message(), iterate_cancel_signature(), GNUNET_MESSENGER_MessageHeader::kind, GNUNET_MESSENGER_MessageBody::merge, GNUNET_MESSENGER_SrvRoomSignature::message, GNUNET_MESSENGER_SrvRoomSignature::operation, pack_message(), GNUNET_MESSENGER_Service::pils, GNUNET_MESSENGER_MessageHeader::previous, GNUNET_MESSENGER_MessageMerge::previous, GNUNET_MESSENGER_SrvRoomSignature::room, GNUNET_MESSENGER_MessageHeader::sender_id, GNUNET_MESSENGER_SrvRoom::service, sign_message_by_peer(), GNUNET_MESSENGER_MessageHeader::signature, GNUNET_MESSENGER_SrvRoom::signatures, GNUNET_MESSENGER_SrvRoom::state, GNUNET_MESSENGER_MessageHeader::timestamp, and GNUNET_CRYPTO_BlindableKeySignature::type.
Referenced by send_srv_room_message(), and send_tunnel_message().
| enum GNUNET_GenericReturnValue update_room_message | ( | struct GNUNET_MESSENGER_SrvRoom * | room, |
| struct GNUNET_MESSENGER_Message * | message, | ||
| const struct GNUNET_HashCode * | hash | ||
| ) |
Definition at line 1387 of file gnunet-service-messenger_room.c.
References GNUNET_MESSENGER_Message::body, cancel_store_operation(), contains_store_message(), destroy_message(), get_srv_room_key(), get_srv_room_message_store(), get_srv_room_operation_store(), get_store_operation_type(), GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_h2s(), GNUNET_log, GNUNET_MESSENGER_KIND_INFO, GNUNET_MESSENGER_KIND_MERGE, GNUNET_MESSENGER_KIND_REQUEST, GNUNET_MESSENGER_OP_MERGE, GNUNET_MESSENGER_OP_REQUEST, GNUNET_NO, GNUNET_OK, GNUNET_YES, GNUNET_MESSENGER_Message::header, GNUNET_MESSENGER_MessageHeader::kind, GNUNET_MESSENGER_MessageBody::merge, GNUNET_MESSENGER_MessageHeader::previous, GNUNET_MESSENGER_MessageMerge::previous, put_store_message(), GNUNET_MESSENGER_SrvRoom::state, and update_message_state().
Referenced by callback_srv_room_message_signed(), handle_tunnel_message(), and it_handle_epoch_message_delayed().
| void callback_room_handle_message | ( | struct GNUNET_MESSENGER_SrvRoom * | room, |
| const struct GNUNET_MESSENGER_Message * | message, | ||
| const struct GNUNET_HashCode * | hash | ||
| ) |
Definition at line 1563 of file gnunet-service-messenger_room.c.
References add_to_list_messages(), get_member_session_of(), get_srv_room_member_store(), get_srv_room_peer_store(), get_store_member_of(), get_store_peer_of(), GNUNET_assert, GNUNET_CONTAINER_DLL_remove, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_h2s(), GNUNET_log, GNUNET_MESSENGER_KIND_CONNECTION, GNUNET_MESSENGER_KIND_DELETION, GNUNET_MESSENGER_KIND_ID, GNUNET_MESSENGER_KIND_JOIN, GNUNET_MESSENGER_KIND_KEY, GNUNET_MESSENGER_KIND_LEAVE, GNUNET_MESSENGER_KIND_MISS, GNUNET_MESSENGER_KIND_PEER, GNUNET_MESSENGER_KIND_SUBSCRIBTION, GNUNET_NO, GNUNET_YES, handle_message_connection(), handle_message_delete(), handle_message_id(), handle_message_join(), handle_message_key(), handle_message_leave(), handle_message_miss(), handle_message_peer(), handle_message_subscribe(), handle_room_messages(), GNUNET_MESSENGER_SrvRoom::handling, GNUNET_MESSENGER_MemberUpdate::hash, GNUNET_MESSENGER_ListMessages::head, GNUNET_MESSENGER_MemberUpdate::head, GNUNET_MESSENGER_Message::header, is_peer_message(), iterate_store_members(), iterate_update_member_sessions(), GNUNET_MESSENGER_MessageHeader::kind, GNUNET_MESSENGER_SenderSession::member, GNUNET_MESSENGER_MemberUpdate::message, GNUNET_MESSENGER_SenderSession::peer, remove_room_member_session(), GNUNET_MESSENGER_SrvMemberSessionCompletion::session, and GNUNET_MESSENGER_MemberUpdate::tail.
Referenced by callback_srv_room_message_signed(), and handle_tunnel_message().
|
static |
Definition at line 756 of file gnunet-service-messenger_room.c.
References callback_room_handle_message(), GNUNET_assert, GNUNET_CONTAINER_multihashmap_contains(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_h2s(), GNUNET_log, GNUNET_MESSENGER_KIND_ID, GNUNET_MESSENGER_KIND_JOIN, GNUNET_MESSENGER_KIND_KEY, GNUNET_MESSENGER_KIND_MERGE, GNUNET_MESSENGER_KIND_PEER, GNUNET_MESSENGER_KIND_REQUEST, GNUNET_YES, handle, GNUNET_MESSENGER_Message::header, GNUNET_MESSENGER_SrvRoom::key, GNUNET_MESSENGER_MessageHeader::kind, merge_srv_handle_room_to_sync(), send_message_id(), send_message_join(), send_message_key(), send_message_peer(), send_message_request(), send_srv_room_envelope(), GNUNET_MESSENGER_SrvRoom::sync, and update_room_message().
Referenced by send_srv_room_message().
| enum GNUNET_GenericReturnValue send_srv_room_message | ( | struct GNUNET_MESSENGER_SrvRoom * | room, |
| struct GNUNET_MESSENGER_SrvHandle * | handle, | ||
| struct GNUNET_MESSENGER_Message * | message | ||
| ) |
Sends a message from a given handle into a room.
The hash parameter will be updated with the hash-value resulting from the sent message.
The function handles packing the message automatically and will call linked message-events locally even if the message won't be sent to another peer.
The function returns GNUNET_YES on success, GNUNET_NO if message is null and GNUNET_SYSERR if the message was known already.
| [in,out] | room | Room |
| [in,out] | handle | Handle |
| [in,out] | message | Message |
Definition at line 815 of file gnunet-service-messenger_room.c.
References callback_srv_room_message_signed(), GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_h2s(), GNUNET_log, GNUNET_MESSENGER_name_of_kind(), GNUNET_NO, handle, GNUNET_MESSENGER_Message::header, GNUNET_MESSENGER_SrvRoom::key, GNUNET_MESSENGER_MessageHeader::kind, and sign_srv_room_message().
Referenced by callback_operation(), callback_tunnel_disconnect(), close_service_room(), close_srv_room(), iterate_service_miss_rooms(), iterate_service_update_rooms(), merge_srv_room_last_messages(), open_srv_room(), send_message_peer(), and send_srv_handle_message().
|
static |
Definition at line 846 of file gnunet-service-messenger_room.c.
References GNUNET_MESSENGER_ClosureSendRoom::envelope, GNUNET_MESSENGER_ClosureSendRoom::exclude, get_tunnel_messenger_version(), GNUNET_assert, GNUNET_MESSENGER_VERSION, GNUNET_MQ_env_copy(), GNUNET_YES, GNUNET_MESSENGER_ClosureSendRoom::hash, is_tunnel_connected(), send_tunnel_envelope(), and value.
Referenced by send_srv_room_envelope().
| void send_srv_room_envelope | ( | struct GNUNET_MESSENGER_SrvRoom * | room, |
| struct GNUNET_MESSENGER_SrvTunnel * | tunnel, | ||
| struct GNUNET_MQ_Envelope * | envelope, | ||
| const struct GNUNET_HashCode * | hash | ||
| ) |
Sends an envelope from a message with a given hash excluding a specific tunnel inside of a room.
The function will send copies from the given envelope and frees the original afterwards.
| [in,out] | room | Room |
| [in,out] | tunnel | Tunnel |
| [in,out] | message | Message |
| [in] | hash | Hash of message |
Definition at line 878 of file gnunet-service-messenger_room.c.
References GNUNET_MESSENGER_ClosureSendRoom::envelope, GNUNET_MESSENGER_ClosureSendRoom::exclude, GNUNET_assert, GNUNET_CONTAINER_multipeermap_iterate(), GNUNET_free, GNUNET_MESSENGER_ClosureSendRoom::hash, iterate_send_room_envelope(), and GNUNET_MESSENGER_SrvRoom::tunnels.
Referenced by callback_srv_room_message_signed(), and handle_tunnel_message().
| void check_srv_room_peer_status | ( | struct GNUNET_MESSENGER_SrvRoom * | room, |
| struct GNUNET_MESSENGER_SrvTunnel * | tunnel | ||
| ) |
Checks the current state of opening a given room from this peer and re-publishes it if necessary to a selected tunnel or to all connected tunnels if necessary or if the selected tunnel is NULL.
| [in,out] | room | Room |
| [in,out] | tunnel | Tunnel |
Definition at line 900 of file gnunet-service-messenger_room.c.
References forward_tunnel_message(), get_srv_room_message_store(), get_store_message(), GNUNET_free, and GNUNET_MESSENGER_SrvRoom::peer_message.
Referenced by recv_message_info(), and send_message_join().
| enum GNUNET_GenericReturnValue merge_srv_room_last_messages | ( | struct GNUNET_MESSENGER_SrvRoom * | room, |
| struct GNUNET_MESSENGER_SrvHandle * | handle | ||
| ) |
Reduces all current forks inside of the message history of a room to one remaining last message by merging them down.
All merge messages will be sent from a given handle.
The function will only try to merge one existing fork of the message graph and continue automatically if any active handle inside the room is syncing. Should there be no existing fork in the message graph it returns GNUNET_NO.
| [in,out] | room | Room |
| [in,out] | handle | Handle |
Definition at line 925 of file gnunet-service-messenger_room.c.
References create_message_merge(), get_message_state_merge_hash(), GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_h2s(), GNUNET_is_zero, GNUNET_log, GNUNET_NO, GNUNET_SYSERR, handle, GNUNET_MESSENGER_SrvRoom::key, send_srv_room_message(), and GNUNET_MESSENGER_SrvRoom::state.
Referenced by merge_srv_handle_room_to_sync().
| enum GNUNET_GenericReturnValue delete_srv_room_message | ( | struct GNUNET_MESSENGER_SrvRoom * | room, |
| struct GNUNET_MESSENGER_SrvMemberSession * | session, | ||
| const struct GNUNET_HashCode * | hash, | ||
| const struct GNUNET_TIME_Relative | delay | ||
| ) |
Deletes a message from the room with a given hash in a specific delay if the provided member by its session is permitted to do so.
| [in,out] | room | Room |
| [in,out] | session | Member session |
| [in] | hash | Hash of message |
| [in] | delay | Delay of deletion |
Definition at line 960 of file gnunet-service-messenger_room.c.
References check_member_session_history(), get_member_session_id(), get_srv_room_message_store(), get_srv_room_operation_store(), get_store_message(), GNUNET_assert, GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_WARNING, GNUNET_h2s(), GNUNET_log, GNUNET_memcmp, GNUNET_MESSENGER_OP_DELETE, GNUNET_NO, GNUNET_OK, GNUNET_sh2s(), GNUNET_SYSERR, GNUNET_TIME_relative_get_forever_(), GNUNET_YES, GNUNET_MESSENGER_OperationStore::room, and use_store_operation().
Referenced by handle_message_delete().
| struct GNUNET_CADET_Handle * get_srv_room_cadet | ( | struct GNUNET_MESSENGER_SrvRoom * | room | ) |
Returns the CADET handle from a rooms service.
| [in,out] | room | Room |
Definition at line 1018 of file gnunet-service-messenger_room.c.
References GNUNET_MESSENGER_Service::cadet, GNUNET_assert, and GNUNET_MESSENGER_SrvRoom::service.
Referenced by connect_tunnel(), and open_srv_room().
| const struct GNUNET_HashCode * get_srv_room_key | ( | const struct GNUNET_MESSENGER_SrvRoom * | room | ) |
Returns the shared secret you need to access a room.
| [in] | room | Room |
Definition at line 1027 of file gnunet-service-messenger_room.c.
References GNUNET_assert, and GNUNET_MESSENGER_SrvRoom::key.
Referenced by callback_room_connect(), callback_tunnel_disconnect(), clear_member_store(), clear_operation_store(), connect_tunnel(), find_member_session_in_room(), get_member_store_key(), get_room_data_subdir(), handle_message_join(), handle_message_leave(), handle_room_messages(), handle_service_message(), join_room(), join_room_locally(), notify_srv_handle_member_id(), notify_srv_handle_message(), open_srv_room(), remove_room_member_session(), send_message_id(), solve_srv_room_member_collisions(), and update_room_message().
| const struct GNUNET_MESSENGER_SrvTunnel * get_srv_room_tunnel | ( | const struct GNUNET_MESSENGER_SrvRoom * | room, |
| const struct GNUNET_PeerIdentity * | peer | ||
| ) |
Returns a tunnel inside of a room leading towards a given peer if such a tunnel exists, otherwise NULL.
| [in] | room | Room |
| [in] | peer | Peer identity |
Definition at line 1036 of file gnunet-service-messenger_room.c.
References GNUNET_assert, GNUNET_CONTAINER_multipeermap_get(), GNUNET_MESSENGER_SrvTunnel::peer, GNUNET_MESSENGER_SrvTunnel::room, and GNUNET_MESSENGER_SrvRoom::tunnels.
|
static |
Definition at line 1046 of file gnunet-service-messenger_room.c.
References check_member_session_history(), GNUNET_MESSENGER_MessageLink::first, forward, get_member_session_id(), get_srv_room_message_store(), get_store_message(), get_store_message_link(), GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_WARNING, GNUNET_h2s(), GNUNET_log, GNUNET_NO, GNUNET_sh2s(), GNUNET_YES, is_epoch_message(), GNUNET_MESSENGER_MessageLink::multiple, request_room_message_step(), result, and GNUNET_MESSENGER_MessageLink::second.
Referenced by request_room_message_step(), and request_srv_room_message().
| enum GNUNET_GenericReturnValue request_srv_room_message | ( | struct GNUNET_MESSENGER_SrvRoom * | room, |
| const struct GNUNET_HashCode * | hash, | ||
| const struct GNUNET_MESSENGER_SrvMemberSession * | session, | ||
| GNUNET_MESSENGER_MessageRequestCallback | callback, | ||
| void * | cls | ||
| ) |
Requests a message from a room identified by a given hash.
If the message is found, the selected callback will be called with it and the provided closure. If no matching message is found but it wasn't deleted the selected callback will be called with #NULL as message instead. In case of deletion the next available previous message will be used to call the callback.
It is also possible that the given callback will not be called if the requesting session is not permitted!
| [in,out] | room | Room |
| [in] | hash | Hash of message |
| [in] | callback | Callback to process result |
| [in] | cls | Closure for the callback |
Definition at line 1114 of file gnunet-service-messenger_room.c.
References GNUNET_assert, GNUNET_NO, request_room_message_step(), and result.
Referenced by handle_get_message(), and recv_message_request().
| void solve_srv_room_member_collisions | ( | struct GNUNET_MESSENGER_SrvRoom * | room, |
| const struct GNUNET_CRYPTO_BlindablePublicKey * | public_key, | ||
| const struct GNUNET_ShortHashCode * | member_id, | ||
| struct GNUNET_TIME_Absolute | timestamp | ||
| ) |
Checks for potential collisions with member ids and solves them changing active handles ids if they use an already used member id (comparing public key and timestamp).
| [in,out] | room | Room |
| [in] | public_key | Public key |
| [in] | member_id | Member ID |
| [in] | timestamp | Timestamp |
Definition at line 1167 of file gnunet-service-messenger_room.c.
References generate_free_member_id(), get_member_session(), get_member_session_start(), get_srv_handle_key(), get_srv_handle_member_id(), get_srv_room_key(), get_srv_room_member_store(), get_store_member(), GNUNET_assert, GNUNET_CONTAINER_multihashmap_size(), GNUNET_memcmp, GNUNET_NO, GNUNET_TIME_absolute_get_difference(), GNUNET_TIME_relative_get_zero_(), GNUNET_MESSENGER_ListHandle::handle, GNUNET_MESSENGER_Service::handles, GNUNET_MESSENGER_ListHandles::head, GNUNET_MESSENGER_SrvMemberSession::member, GNUNET_MESSENGER_MemberStore::members, GNUNET_MESSENGER_ListHandle::next, notify_srv_handle_member_id(), pubkey, GNUNET_MESSENGER_SrvMemberSession::public_key, GNUNET_MESSENGER_SrvRoom::service, GNUNET_MESSENGER_Member::sessions, start, and timestamp().
Referenced by handle_message_id(), and handle_message_join().
| void rebuild_srv_room_basement_structure | ( | struct GNUNET_MESSENGER_SrvRoom * | room | ) |
Rebuilds the decentralized structure for a room by ensuring all required connections are made depending on the amount of peers and this peers index in the list of them.
| [in,out] | room | Room |
Definition at line 1232 of file gnunet-service-messenger_room.c.
References GNUNET_MESSENGER_SrvRoom::basement, close_srv_room(), connect_tunnel(), count_of_tunnels(), disconnect_tunnel(), find_list_tunnels(), get_service_peer_identity(), GNUNET_assert, GNUNET_CONTAINER_multipeermap_get(), GNUNET_MESSENGER_FLAG_CONNECTION_AUTO, GNUNET_NO, GNUNET_OK, GNUNET_PEER_resolve(), GNUNET_SYSERR, GNUNET_YES, GNUNET_MESSENGER_ListTunnels::head, GNUNET_MESSENGER_SrvRoom::host, is_srv_handle_routing(), GNUNET_MESSENGER_SrvRoom::key, GNUNET_MESSENGER_Service::min_routers, GNUNET_MESSENGER_ListTunnel::next, GNUNET_MESSENGER_SrvTunnel::peer, GNUNET_MESSENGER_ListTunnel::peer, remove_from_list_tunnels(), required_connection_between(), GNUNET_MESSENGER_SrvTunnel::room, GNUNET_MESSENGER_SrvRoom::service, GNUNET_MESSENGER_SrvRoom::tunnels, and verify_list_tunnels_flag_token().
Referenced by handle_message_miss(), and handle_message_peer().
| uint32_t get_srv_room_amount_of_tunnels | ( | const struct GNUNET_MESSENGER_SrvRoom * | room | ) |
Returns the amount of active tunnels of a given room.
| [in] | room | Room |
Definition at line 1295 of file gnunet-service-messenger_room.c.
References GNUNET_assert, GNUNET_CONTAINER_multipeermap_size(), GNUNET_MESSENGER_SrvTunnel::room, and GNUNET_MESSENGER_SrvRoom::tunnels.
Referenced by create_message_connection().
| uint32_t get_srv_room_connection_flags | ( | const struct GNUNET_MESSENGER_SrvRoom * | room | ) |
Returns connection flags about connection information of a given room and the service managing it.
| [in] | room | Room |
Definition at line 1304 of file gnunet-service-messenger_room.c.
References GNUNET_MESSENGER_Service::auto_routing, GNUNET_assert, GNUNET_MESSENGER_FLAG_CONNECTION_AUTO, GNUNET_MESSENGER_FLAG_CONNECTION_NONE, GNUNET_YES, GNUNET_MESSENGER_SrvTunnel::room, and GNUNET_MESSENGER_SrvRoom::service.
Referenced by create_message_connection().
|
static |
Definition at line 1457 of file gnunet-service-messenger_room.c.
References GNUNET_MESSENGER_MemberSubscriptionIteration::discourse, get_member_subscription(), GNUNET_assert, GNUNET_TIME_absolute_cmp, GNUNET_YES, GNUNET_MESSENGER_SrvMemberSession::member, GNUNET_MESSENGER_Subscription::member, GNUNET_MESSENGER_MemberSubscriptionIteration::start, and GNUNET_MESSENGER_Subscription::start.
Referenced by cleanup_srv_room_discourse_messages().
| void cleanup_srv_room_discourse_messages | ( | struct GNUNET_MESSENGER_SrvRoom * | room, |
| const struct GNUNET_ShortHashCode * | discourse | ||
| ) |
Cleanup discourse messages outside of current subscriptions from a specific discourse of all the members in a given room.
| [in,out] | room | Room |
| [in] | discourse | Hash of discourse |
Definition at line 1484 of file gnunet-service-messenger_room.c.
References cleanup_store_discourse_messages_before(), GNUNET_MESSENGER_MemberSubscriptionIteration::discourse, get_srv_room_member_store(), get_srv_room_message_store(), GNUNET_assert, GNUNET_TIME_absolute_get_forever_(), iterate_member_for_subscription(), iterate_store_members(), and GNUNET_MESSENGER_MemberSubscriptionIteration::start.
Referenced by handle_message_subscribe(), and task_subscription_exit().
|
static |
Definition at line 1527 of file gnunet-service-messenger_room.c.
References GNUNET_assert, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_new, GNUNET_YES, GNUNET_MESSENGER_MemberUpdate::hash, GNUNET_MESSENGER_MemberUpdate::head, is_member_session_completed(), GNUNET_MESSENGER_MemberUpdate::message, GNUNET_MESSENGER_SrvMemberSessionCompletion::session, GNUNET_MESSENGER_MemberUpdate::tail, and update_member_session_history().
Referenced by callback_room_handle_message().
|
static |
Definition at line 1783 of file gnunet-service-messenger_room.c.
References destroy_member_session(), DIR_SEPARATOR, get_member_session_id(), get_member_session_public_key(), get_room_data_subdir(), get_srv_room_key(), GNUNET_asprintf(), GNUNET_assert, GNUNET_CRYPTO_hash(), GNUNET_DISK_directory_remove(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_h2s(), GNUNET_log, GNUNET_sh2s(), GNUNET_MESSENGER_SrvMemberSession::member, and remove_member_session().
Referenced by callback_room_handle_message().
| void load_srv_room | ( | struct GNUNET_MESSENGER_SrvRoom * | room | ) |
Loads the local configuration for a given room of a service which contains the last messages hash and the ruleset for general access of new members.
| [out] | room | Room |
Definition at line 1683 of file gnunet-service-messenger_room.c.
References GNUNET_MESSENGER_SrvRoom::basement, get_room_data_subdir(), get_srv_room_member_store(), get_srv_room_message_store(), get_srv_room_operation_store(), get_srv_room_peer_store(), GNUNET_asprintf(), GNUNET_assert, GNUNET_DISK_directory_test(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_YES, load_list_tunnels(), load_member_store(), load_message_state(), load_message_store(), load_operation_store(), load_peer_store(), move_message_store(), and GNUNET_MESSENGER_SrvRoom::state.
Referenced by create_srv_room().
| void save_srv_room | ( | struct GNUNET_MESSENGER_SrvRoom * | room | ) |
Saves the configuration for a given room of a service which contains the last messages hash and the ruleset for general access of new members locally.
| [in] | room | Room |
Definition at line 1723 of file gnunet-service-messenger_room.c.
References GNUNET_MESSENGER_SrvRoom::basement, get_room_data_subdir(), get_srv_room_member_store(), get_srv_room_message_store(), get_srv_room_operation_store(), get_srv_room_peer_store(), GNUNET_asprintf(), GNUNET_assert, GNUNET_DISK_directory_create(), GNUNET_DISK_directory_test(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_NO, GNUNET_OK, GNUNET_YES, move_message_store(), save_list_tunnels(), save_member_store(), save_message_state(), save_message_store(), save_operation_store(), save_peer_store(), and GNUNET_MESSENGER_SrvRoom::state.
Referenced by destroy_srv_room().
| void remove_srv_room | ( | struct GNUNET_MESSENGER_SrvRoom * | room | ) |
Removes the configuration for a given room of a service.
| [in] | room | Room |
Definition at line 1764 of file gnunet-service-messenger_room.c.
References get_room_data_subdir(), GNUNET_assert, GNUNET_DISK_directory_remove(), GNUNET_DISK_directory_test(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, and GNUNET_YES.
Referenced by destroy_srv_room().