#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"
Go to the source code of this file.
Data Structures | |
struct | GNUNET_MESSENGER_ClosureSendRoom |
struct | GNUNET_MESSENGER_MemberSessionCompletion |
struct | GNUNET_MESSENGER_MemberUpdate |
Functions | |
static void | idle_request_room_messages (void *cls) |
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. More... | |
static enum GNUNET_GenericReturnValue | iterate_destroy_tunnels (void *cls, const struct GNUNET_PeerIdentity *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. More... | |
struct GNUNET_MESSENGER_PeerStore * | get_srv_room_peer_store (struct GNUNET_MESSENGER_SrvRoom *room) |
Returns the used peer store of a given room. More... | |
struct GNUNET_MESSENGER_MemberStore * | get_srv_room_member_store (struct GNUNET_MESSENGER_SrvRoom *room) |
Returns the used member store of a given room. More... | |
struct GNUNET_MESSENGER_MessageStore * | get_srv_room_message_store (struct GNUNET_MESSENGER_SrvRoom *room) |
Returns the used message store of a given room. More... | |
struct GNUNET_MESSENGER_OperationStore * | get_srv_room_operation_store (struct GNUNET_MESSENGER_SrvRoom *room) |
Returns the used operation store of a given room. More... | |
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 | check_tunnel_message (void *cls, const struct GNUNET_MessageHeader *header) |
void | handle_tunnel_message (void *cls, const struct GNUNET_MessageHeader *header) |
void | callback_tunnel_disconnect (void *cls, const struct GNUNET_CADET_Channel *channel) |
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. More... | |
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. More... | |
static void | sign_srv_room_message_by_peer (const void *cls, struct GNUNET_MESSENGER_Message *message, uint16_t length, char *buffer, const struct GNUNET_HashCode *hash) |
struct GNUNET_MQ_Envelope * | pack_srv_room_message (const struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_MESSENGER_SrvHandle *handle, struct GNUNET_MESSENGER_Message *message, struct GNUNET_HashCode *hash, enum GNUNET_MESSENGER_PackMode mode) |
Packs a message depending on the selected mode into a newly allocated envelope. More... | |
static enum GNUNET_GenericReturnValue | iterate_send_room_message (void *cls, const struct GNUNET_PeerIdentity *key, void *value) |
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) |
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. More... | |
void | forward_srv_room_message (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvTunnel *tunnel, struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash) |
Forwards a message with a given hash to a specific tunnel inside of a room. More... | |
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. More... | |
void | 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. More... | |
void | callback_room_deletion (struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_HashCode *hash) |
void | callback_room_merge (struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_HashCode *hash) |
enum GNUNET_GenericReturnValue | delete_srv_room_message (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_MemberSession *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. More... | |
struct GNUNET_CADET_Handle * | get_srv_room_cadet (struct GNUNET_MESSENGER_SrvRoom *room) |
Returns the CADET handle from a rooms service. More... | |
const struct GNUNET_HashCode * | get_srv_room_key (const struct GNUNET_MESSENGER_SrvRoom *room) |
Returns the shared secret you need to access a room. More... | |
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. More... | |
static enum GNUNET_GenericReturnValue | request_room_message_step (struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_HashCode *hash, const struct GNUNET_MESSENGER_MemberSession *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_MemberSession *session, GNUNET_MESSENGER_MessageRequestCallback callback, void *cls) |
Requests a message from a room identified by a given hash. More... | |
void | callback_room_disconnect (struct GNUNET_MESSENGER_SrvRoom *room, void *cls) |
enum GNUNET_GenericReturnValue | callback_verify_room_message (struct GNUNET_MESSENGER_SrvRoom *room, void *cls, struct GNUNET_MESSENGER_Message *message, struct GNUNET_HashCode *hash) |
void | solve_srv_room_member_collisions (struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_CRYPTO_PublicKey *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). More... | |
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. More... | |
uint32_t | get_srv_room_amount_of_tunnels (const struct GNUNET_MESSENGER_SrvRoom *room) |
Returns the amount of active tunnels of a given room. More... | |
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. More... | |
static enum GNUNET_GenericReturnValue | iterate_update_member_sessions (void *cls, const struct GNUNET_CRYPTO_PublicKey *public_key, struct GNUNET_MESSENGER_MemberSession *session) |
static void | remove_room_member_session (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_MemberSession *session) |
static void | get_room_data_subdir (struct GNUNET_MESSENGER_SrvRoom *room, char **dir) |
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. More... | |
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. More... | |
void | remove_srv_room (struct GNUNET_MESSENGER_SrvRoom *room) |
Removes the configuration for a given room of a service. More... | |
|
static |
Definition at line 943 of file gnunet-service-messenger_room.c.
References get_message_state_merge_hash(), get_srv_room_operation_store(), get_store_operation_type(), 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_OperationStore::room, GNUNET_MESSENGER_SrvRoom::state, and use_store_operation().
Referenced by create_srv_room(), and idle_request_room_messages().
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 46 of file gnunet-service-messenger_room.c.
References GNUNET_MESSENGER_SrvRoom::basement, 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_multipeermap_create(), GNUNET_memcpy, GNUNET_new, GNUNET_NO, GNUNET_SCHEDULER_add_with_priority(), GNUNET_SCHEDULER_PRIORITY_IDLE, 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::state, and GNUNET_MESSENGER_SrvRoom::tunnels.
Referenced by entry_service_room(), and open_service_room().
|
static |
Definition at line 86 of file gnunet-service-messenger_room.c.
References destroy_tunnel(), GNUNET_YES, and value.
Referenced by destroy_srv_room().
|
static |
Definition at line 370 of file gnunet-service-messenger_room.c.
References create_message_miss(), get_service_peer_identity(), GNUNET_assert, GNUNET_CADET_close_port(), GNUNET_OK, GNUNET_MESSENGER_SrvRoom::host, 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 1111 of file gnunet-service-messenger_room.c.
References get_member_session_of(), get_srv_room_member_store(), get_srv_room_message_store(), get_srv_room_peer_store(), get_store_member_of(), get_store_message(), get_store_peer_of(), GNUNET_CONTAINER_DLL_remove, GNUNET_free, GNUNET_YES, handle_service_message(), GNUNET_MESSENGER_SrvRoom::handling, GNUNET_MESSENGER_ListMessage::hash, GNUNET_MESSENGER_ListMessages::head, is_peer_message(), GNUNET_MESSENGER_SenderSession::member, GNUNET_MESSENGER_SenderSession::peer, GNUNET_MESSENGER_MemberStore::room, 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 103 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_multipeermap_destroy(), GNUNET_CONTAINER_multipeermap_iterate(), GNUNET_free, GNUNET_SCHEDULER_cancel(), GNUNET_YES, handle_room_messages(), GNUNET_MESSENGER_SrvRoom::idle, iterate_destroy_tunnels(), GNUNET_MESSENGER_SrvRoom::peer_message, remove_srv_room(), GNUNET_MESSENGER_SrvTunnel::room, save_srv_room(), GNUNET_MESSENGER_SrvRoom::service, 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 146 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(), and save_srv_room().
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 155 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(), 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(), open_srv_room(), recv_message_info(), recv_message_request(), save_srv_room(), send_message_join(), and solve_srv_room_member_collisions().
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 164 of file gnunet-service-messenger_room.c.
References GNUNET_assert, and GNUNET_MESSENGER_SrvRoom::message_store.
Referenced by callback_room_deletion(), callback_verify_room_message(), check_member_session_completion(), check_srv_room_peer_status(), create_srv_room(), delete_srv_room_message(), destroy_srv_room(), forward_about_members(), handle_room_messages(), load_srv_room(), notify_about_members(), recv_message_info(), request_room_message_step(), save_srv_room(), update_room_message(), and update_tunnel_last_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 173 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 182 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 195 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_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE, GNUNET_CONTAINER_multipeermap_put(), GNUNET_CONTAINER_multipeermap_remove(), GNUNET_ERROR_TYPE_INFO, 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 238 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(), reset, and GNUNET_MESSENGER_SrvTunnel::room.
Referenced by join_room_locally(), and open_srv_room().
|
static |
Definition at line 267 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, join_room(), and GNUNET_MESSENGER_MemberStore::room.
Referenced by enter_srv_room_at(), and open_srv_room().
enum GNUNET_GenericReturnValue check_tunnel_message | ( | void * | cls, |
const struct GNUNET_MessageHeader * | header | ||
) |
Definition at line 118 of file gnunet-service-messenger_tunnel.c.
References callback_verify_room_message(), decode_message(), get_message_kind_size(), GNUNET_ERROR_TYPE_WARNING, GNUNET_log, GNUNET_MESSENGER_KIND_UNKNOWN, GNUNET_SYSERR, GNUNET_YES, hash_message(), GNUNET_MESSENGER_SrvTunnel::room, and GNUNET_MessageHeader::size.
void handle_tunnel_message | ( | void * | cls, |
const struct GNUNET_MessageHeader * | header | ||
) |
Definition at line 189 of file gnunet-service-messenger_tunnel.c.
References callback_room_handle_message(), GNUNET_MESSENGER_SrvTunnel::channel, cleanup_message(), copy_message(), decode_message(), forward_srv_room_message(), GNUNET_CADET_receive_done(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_MESSENGER_KIND_INFO, GNUNET_MESSENGER_KIND_MISS, GNUNET_MESSENGER_KIND_PEER, GNUNET_MESSENGER_KIND_REQUEST, GNUNET_MESSENGER_name_of_kind(), GNUNET_YES, hash_message(), GNUNET_MESSENGER_Message::header, GNUNET_MESSENGER_MessageHeader::kind, recv_message_info(), recv_message_miss(), recv_message_peer(), recv_message_request(), GNUNET_MESSENGER_SrvTunnel::room, GNUNET_MessageHeader::size, update_room_message(), and update_tunnel_last_message().
void callback_tunnel_disconnect | ( | void * | cls, |
const struct GNUNET_CADET_Channel * | channel | ||
) |
Definition at line 97 of file gnunet-service-messenger_tunnel.c.
References callback_room_disconnect(), GNUNET_MESSENGER_SrvTunnel::channel, and GNUNET_MESSENGER_SrvTunnel::room.
Referenced by connect_tunnel(), 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 299 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_INFO, GNUNET_ERROR_TYPE_WARNING, GNUNET_h2s(), GNUNET_log, GNUNET_MESSAGE_TYPE_CADET_CLI, GNUNET_MQ_handler_end, GNUNET_MQ_hd_var_size, GNUNET_NO, GNUNET_YES, handle, handlers, GNUNET_MESSENGER_SrvRoom::host, join_room(), join_room_locally(), key, port, GNUNET_MESSENGER_SrvRoom::port, GNUNET_MESSENGER_MemberStore::room, 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 388 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::room, GNUNET_MESSENGER_SrvRoom::service, and GNUNET_MESSENGER_SrvRoom::tunnels.
Referenced by callback_room_disconnect(), and entry_service_room().
|
static |
Definition at line 432 of file gnunet-service-messenger_room.c.
References GNUNET_assert, handle, and sign_message_by_peer().
Referenced by pack_srv_room_message().
struct GNUNET_MQ_Envelope * pack_srv_room_message | ( | const struct GNUNET_MESSENGER_SrvRoom * | room, |
const struct GNUNET_MESSENGER_SrvHandle * | handle, | ||
struct GNUNET_MESSENGER_Message * | message, | ||
struct GNUNET_HashCode * | hash, | ||
enum GNUNET_MESSENGER_PackMode | mode | ||
) |
Packs a message depending on the selected mode 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 handles private key.
If the optional hash parameter is a valid pointer, its value will be overridden by the signed messages hash.
If mode is set to GNUNET_MESSENGER_PACK_MODE_ENVELOPE, the function returns a valid envelope to send through a message queue, otherwise NULL.
[in] | room | Room |
[in] | handle | Handle |
[in,out] | message | Message |
[out] | hash | Hash of message |
[in] | mode | Packing mode |
Definition at line 447 of file gnunet-service-messenger_room.c.
References convert_peer_identity_to_id(), get_message_state_chain_hash(), get_service_peer_identity(), GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_OK, GNUNET_PUBLIC_KEY_TYPE_EDDSA, GNUNET_sh2s(), GNUNET_TIME_absolute_get(), GNUNET_TIME_absolute_hton(), GNUNET_YES, handle, GNUNET_MESSENGER_Message::header, is_peer_message(), mode, pack_message(), GNUNET_MESSENGER_MessageHeader::previous, GNUNET_MESSENGER_MessageHeader::sender_id, sign_srv_room_message_by_peer(), GNUNET_MESSENGER_MessageHeader::signature, GNUNET_MESSENGER_SrvRoom::state, GNUNET_MESSENGER_MessageHeader::timestamp, and GNUNET_CRYPTO_Signature::type.
Referenced by iterate_send_room_message(), send_srv_room_message(), and send_tunnel_message().
|
static |
Definition at line 489 of file gnunet-service-messenger_room.c.
References env, GNUNET_MESSENGER_ClosureSendRoom::exclude, get_tunnel_messenger_version(), GNUNET_MESSENGER_PACK_MODE_ENVELOPE, GNUNET_MESSENGER_VERSION, GNUNET_NO, GNUNET_YES, GNUNET_MESSENGER_ClosureSendRoom::handle, GNUNET_MESSENGER_ClosureSendRoom::hash, is_tunnel_connected(), GNUNET_MESSENGER_ClosureSendRoom::message, pack_message(), pack_srv_room_message(), GNUNET_MESSENGER_ClosureSendRoom::packed, GNUNET_MESSENGER_ClosureSendRoom::room, send_tunnel_envelope(), and value.
Referenced by forward_srv_room_message(), and send_srv_room_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 1166 of file gnunet-service-messenger_room.c.
References GNUNET_MESSENGER_Message::body, cancel_store_operation(), destroy_message(), get_srv_room_key(), get_srv_room_message_store(), get_srv_room_operation_store(), get_store_message(), 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_OperationStore::room, GNUNET_MESSENGER_SrvRoom::state, and update_message_state().
Referenced by handle_tunnel_message(), and send_srv_room_message().
void callback_room_handle_message | ( | struct GNUNET_MESSENGER_SrvRoom * | room, |
const struct GNUNET_MESSENGER_Message * | message, | ||
const struct GNUNET_HashCode * | hash | ||
) |
Definition at line 1271 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_DELETE, 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_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_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_MemberStore::room, GNUNET_MESSENGER_MemberSessionCompletion::session, and GNUNET_MESSENGER_MemberUpdate::tail.
Referenced by handle_tunnel_message(), and 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 537 of file gnunet-service-messenger_room.c.
References callback_room_handle_message(), GNUNET_MESSENGER_ClosureSendRoom::exclude, GNUNET_assert, GNUNET_CONTAINER_multipeermap_iterate(), 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_PEER, GNUNET_MESSENGER_KIND_REQUEST, GNUNET_MESSENGER_name_of_kind(), GNUNET_MESSENGER_PACK_MODE_UNKNOWN, GNUNET_NO, GNUNET_SYSERR, GNUNET_YES, handle, GNUNET_MESSENGER_ClosureSendRoom::handle, GNUNET_MESSENGER_ClosureSendRoom::hash, GNUNET_MESSENGER_Message::header, iterate_send_room_message(), GNUNET_MESSENGER_SrvRoom::key, GNUNET_MESSENGER_MessageHeader::kind, GNUNET_MESSENGER_ClosureSendRoom::message, pack_srv_room_message(), GNUNET_MESSENGER_ClosureSendRoom::packed, GNUNET_MESSENGER_ClosureSendRoom::room, send_message_id(), send_message_join(), send_message_key(), send_message_peer(), send_message_request(), GNUNET_MESSENGER_SrvRoom::tunnels, and update_room_message().
Referenced by callback_room_disconnect(), callback_room_merge(), close_service_room(), close_srv_room(), merge_srv_room_last_messages(), open_srv_room(), send_message_peer(), and send_srv_handle_message().
void forward_srv_room_message | ( | struct GNUNET_MESSENGER_SrvRoom * | room, |
struct GNUNET_MESSENGER_SrvTunnel * | tunnel, | ||
struct GNUNET_MESSENGER_Message * | message, | ||
const struct GNUNET_HashCode * | hash | ||
) |
Forwards a message with a given hash to a specific tunnel inside of a room.
[in,out] | room | Room |
[in,out] | tunnel | Tunnel |
[in,out] | message | Message |
[in] | hash | Hash of message |
Definition at line 604 of file gnunet-service-messenger_room.c.
References GNUNET_MESSENGER_ClosureSendRoom::exclude, GNUNET_assert, GNUNET_CONTAINER_multipeermap_iterate(), GNUNET_memcpy, GNUNET_YES, GNUNET_MESSENGER_ClosureSendRoom::handle, GNUNET_MESSENGER_ClosureSendRoom::hash, iterate_send_room_message(), GNUNET_MESSENGER_ClosureSendRoom::message, GNUNET_MESSENGER_ClosureSendRoom::packed, GNUNET_MESSENGER_ClosureSendRoom::room, and GNUNET_MESSENGER_SrvRoom::tunnels.
Referenced by 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 632 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().
void 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.
[in,out] | room | Room |
[in,out] | handle | Handle |
Definition at line 657 of file gnunet-service-messenger_room.c.
References create_message_merge(), get_message_state_merge_hash(), GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_h2s(), GNUNET_log, handle, GNUNET_MESSENGER_SrvRoom::key, send_srv_room_message(), and GNUNET_MESSENGER_SrvRoom::state.
Referenced by sync_srv_handle_messages().
void callback_room_deletion | ( | struct GNUNET_MESSENGER_SrvRoom * | room, |
const struct GNUNET_HashCode * | hash | ||
) |
Definition at line 683 of file gnunet-service-messenger_room.c.
References delete_store_message(), get_srv_room_message_store(), GNUNET_ERROR_TYPE_WARNING, GNUNET_h2s(), GNUNET_log, and GNUNET_OK.
Referenced by callback_store_operation().
void callback_room_merge | ( | struct GNUNET_MESSENGER_SrvRoom * | room, |
const struct GNUNET_HashCode * | hash | ||
) |
Definition at line 697 of file gnunet-service-messenger_room.c.
References create_message_merge(), GNUNET_MESSENGER_SrvRoom::host, and send_srv_room_message().
Referenced by callback_store_operation().
enum GNUNET_GenericReturnValue delete_srv_room_message | ( | struct GNUNET_MESSENGER_SrvRoom * | room, |
struct GNUNET_MESSENGER_MemberSession * | 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 708 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_INFO, 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 760 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 769 of file gnunet-service-messenger_room.c.
References GNUNET_assert, and GNUNET_MESSENGER_SrvRoom::key.
Referenced by callback_room_connect(), 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(), 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 778 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 788 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_ERROR_TYPE_INFO, GNUNET_ERROR_TYPE_WARNING, GNUNET_h2s(), GNUNET_log, GNUNET_NO, GNUNET_sh2s(), GNUNET_YES, 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_MemberSession * | 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 845 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 callback_room_disconnect | ( | struct GNUNET_MESSENGER_SrvRoom * | room, |
void * | cls | ||
) |
Definition at line 864 of file gnunet-service-messenger_room.c.
References GNUNET_MESSENGER_Service::auto_connecting, GNUNET_MESSENGER_SrvRoom::basement, contains_list_tunnels(), create_message_miss(), enter_srv_room_at(), find_list_tunnels_alternate(), get_tunnel_peer_identity(), GNUNET_CONTAINER_multipeermap_contains(), GNUNET_CONTAINER_multipeermap_remove(), GNUNET_CONTAINER_multipeermap_size(), GNUNET_NO, GNUNET_PEER_resolve(), GNUNET_YES, GNUNET_MESSENGER_SrvRoom::host, identity, GNUNET_MESSENGER_ListTunnel::peer, GNUNET_MESSENGER_SrvTunnel::room, send_srv_room_message(), GNUNET_MESSENGER_SrvRoom::service, and GNUNET_MESSENGER_SrvRoom::tunnels.
Referenced by callback_tunnel_disconnect().
enum GNUNET_GenericReturnValue callback_verify_room_message | ( | struct GNUNET_MESSENGER_SrvRoom * | room, |
void * | cls, | ||
struct GNUNET_MESSENGER_Message * | message, | ||
struct GNUNET_HashCode * | hash | ||
) |
Definition at line 901 of file gnunet-service-messenger_room.c.
References get_srv_room_message_store(), get_store_message(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_WARNING, GNUNET_log, GNUNET_MESSENGER_KIND_UNKNOWN, GNUNET_MESSENGER_name_of_kind(), GNUNET_OK, GNUNET_SYSERR, GNUNET_TIME_absolute_get_difference(), GNUNET_TIME_absolute_ntoh(), GNUNET_TIME_relative_get_zero_(), GNUNET_MESSENGER_Message::header, GNUNET_MESSENGER_MessageHeader::kind, GNUNET_MESSENGER_MessageHeader::previous, and GNUNET_MESSENGER_MessageHeader::timestamp.
Referenced by check_tunnel_message().
void solve_srv_room_member_collisions | ( | struct GNUNET_MESSENGER_SrvRoom * | room, |
const struct GNUNET_CRYPTO_PublicKey * | 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 974 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_MemberSession::member, GNUNET_MESSENGER_MemberStore::members, GNUNET_MESSENGER_ListHandle::next, notify_srv_handle_member_id(), pubkey, GNUNET_MESSENGER_MemberStore::room, GNUNET_MESSENGER_SrvRoom::service, GNUNET_MESSENGER_Member::sessions, and start.
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 1028 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 1088 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 1097 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 1242 of file gnunet-service-messenger_room.c.
References GNUNET_CONTAINER_DLL_insert_tail, GNUNET_new, GNUNET_YES, GNUNET_MESSENGER_MemberUpdate::hash, GNUNET_MESSENGER_MemberUpdate::head, is_member_session_completed(), GNUNET_MESSENGER_MemberUpdate::message, GNUNET_MESSENGER_MemberSessionCompletion::session, GNUNET_MESSENGER_MemberUpdate::tail, and update_member_session_history().
Referenced by callback_room_handle_message().
|
static |
Definition at line 1483 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_MemberSession::member, remove_member_session(), and GNUNET_MESSENGER_MemberSessionCompletion::session.
Referenced by callback_room_handle_message().
|
static |
Definition at line 1380 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 load_srv_room(), remove_room_member_session(), remove_srv_room(), and save_srv_room().
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 1392 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(), 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 1428 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, 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 1465 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().