#include "gnunet-service-messenger_message_recv.h"
#include "gnunet-service-messenger_basement.h"
#include "gnunet-service-messenger_message_kind.h"
#include "gnunet-service-messenger_operation.h"
Go to the source code of this file.
Functions | |
static void | forward_about_members (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvTunnel *tunnel, struct GNUNET_MESSENGER_MemberSession *session, struct GNUNET_CONTAINER_MultiHashMap *map) |
static enum GNUNET_GenericReturnValue | iterate_forward_members (void *cls, const struct GNUNET_CRYPTO_PublicKey *public_key, struct GNUNET_MESSENGER_MemberSession *session) |
enum GNUNET_GenericReturnValue | recv_message_info (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvTunnel *tunnel, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash) |
Handles a received info message to change the current member id to the one generated by the host connected to. More... | |
enum GNUNET_GenericReturnValue | recv_message_peer (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvTunnel *tunnel, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash) |
Handles a received peer message to link it to its origin tunnel if the peer identity matches. More... | |
enum GNUNET_GenericReturnValue | recv_message_miss (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvTunnel *tunnel, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash) |
Handles a received miss message to react to activity in the basement of a room. More... | |
static void | callback_found_message (void *cls, struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash) |
enum GNUNET_GenericReturnValue | recv_message_request (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvTunnel *tunnel, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash) |
Handles a received request message by checking for the requested message and forwarding it back if the message was found. More... | |
|
static |
Definition at line 33 of file gnunet-service-messenger_message_recv.c.
References forward_about_members(), forward_tunnel_message(), get_srv_room_message_store(), get_store_message(), GNUNET_assert, GNUNET_CONTAINER_multihashmap_contains(), GNUNET_CONTAINER_multihashmap_put(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST, GNUNET_ERROR_TYPE_WARNING, GNUNET_log, GNUNET_OK, GNUNET_YES, GNUNET_MESSENGER_ListMessage::hash, GNUNET_MESSENGER_ListMessages::head, map, GNUNET_MESSENGER_MemberSession::messages, GNUNET_MESSENGER_ListMessage::next, and GNUNET_MESSENGER_MemberSession::prev.
Referenced by forward_about_members(), and iterate_forward_members().
|
static |
Definition at line 74 of file gnunet-service-messenger_message_recv.c.
References forward_about_members(), GNUNET_assert, GNUNET_CONTAINER_multihashmap_create(), GNUNET_CONTAINER_multihashmap_destroy(), GNUNET_NO, GNUNET_YES, is_member_session_completed(), map, and GNUNET_MESSENGER_SrvTunnel::room.
Referenced by recv_message_info().
enum GNUNET_GenericReturnValue recv_message_info | ( | struct GNUNET_MESSENGER_SrvRoom * | room, |
struct GNUNET_MESSENGER_SrvTunnel * | tunnel, | ||
const struct GNUNET_MESSENGER_Message * | message, | ||
const struct GNUNET_HashCode * | hash | ||
) |
Handles a received info message to change the current member id to the one generated by the host connected to.
(all current tunnels will be informed about the id change)
[in,out] | room | Room of the message |
[in,out] | tunnel | Receiving connection |
[in] | message | INFO-Message |
[in] | hash | Hash of the message |
Definition at line 101 of file gnunet-service-messenger_message_recv.c.
References GNUNET_MESSENGER_SrvRoom::basement, GNUNET_MESSENGER_Message::body, check_srv_room_peer_status(), contains_list_tunnels(), create_message_info(), disconnect_tunnel(), forward_tunnel_message(), get_srv_room_member_store(), get_srv_room_message_store(), get_store_message(), get_tunnel_messenger_version(), get_tunnel_peer_identity(), GNUNET_NO, GNUNET_OK, GNUNET_YES, GNUNET_MESSENGER_ListTunnel::hash, GNUNET_MESSENGER_ListTunnels::head, GNUNET_MESSENGER_SrvRoom::host, GNUNET_MESSENGER_MessageBody::info, iterate_forward_members(), iterate_store_members(), msg, GNUNET_MESSENGER_ListTunnel::next, send_tunnel_message(), GNUNET_MESSENGER_SrvRoom::service, and update_tunnel_messenger_version().
Referenced by handle_tunnel_message().
enum GNUNET_GenericReturnValue recv_message_peer | ( | struct GNUNET_MESSENGER_SrvRoom * | room, |
struct GNUNET_MESSENGER_SrvTunnel * | tunnel, | ||
const struct GNUNET_MESSENGER_Message * | message, | ||
const struct GNUNET_HashCode * | hash | ||
) |
Handles a received peer message to link it to its origin tunnel if the peer identity matches.
(the peer message and the member id can potentially be linked to the tunnel)
[in,out] | room | Room of the message |
[in,out] | tunnel | Receiving connection |
[in] | message | PEER-Message |
[in] | hash | Hash of the message |
Definition at line 161 of file gnunet-service-messenger_message_recv.c.
References GNUNET_MESSENGER_SrvRoom::basement, GNUNET_MESSENGER_Message::body, GNUNET_memcmp, GNUNET_memcpy, GNUNET_new, GNUNET_PEER_resolve(), GNUNET_YES, GNUNET_MESSENGER_MessagePeer::peer, GNUNET_MESSENGER_MessageBody::peer, GNUNET_MESSENGER_SrvTunnel::peer, GNUNET_MESSENGER_SrvTunnel::peer_message, and update_to_list_tunnels().
Referenced by handle_tunnel_message().
enum GNUNET_GenericReturnValue recv_message_miss | ( | struct GNUNET_MESSENGER_SrvRoom * | room, |
struct GNUNET_MESSENGER_SrvTunnel * | tunnel, | ||
const struct GNUNET_MESSENGER_Message * | message, | ||
const struct GNUNET_HashCode * | hash | ||
) |
Handles a received miss message to react to activity in the basement of a room.
(the miss message can cause automatic opening of the room)
[in,out] | room | Room of the message |
[in,out] | tunnel | Receiving connection |
[in] | message | MISS-Message |
[in] | hash | Hash of the message |
Definition at line 184 of file gnunet-service-messenger_message_recv.c.
References GNUNET_MESSENGER_SrvRoom::basement, count_of_tunnels(), GNUNET_YES, open_srv_room(), service, and GNUNET_MESSENGER_SrvRoom::service.
Referenced by handle_tunnel_message().
|
static |
Definition at line 202 of file gnunet-service-messenger_message_recv.c.
References forward_tunnel_message(), get_srv_room_operation_store(), GNUNET_assert, GNUNET_MESSENGER_OP_REQUEST, GNUNET_MESSENGER_REQUEST_DELAY, GNUNET_MESSENGER_OperationStore::room, GNUNET_MESSENGER_SrvTunnel::room, and use_store_operation().
Referenced by recv_message_request().
enum GNUNET_GenericReturnValue recv_message_request | ( | struct GNUNET_MESSENGER_SrvRoom * | room, |
struct GNUNET_MESSENGER_SrvTunnel * | tunnel, | ||
const struct GNUNET_MESSENGER_Message * | message, | ||
const struct GNUNET_HashCode * | hash | ||
) |
Handles a received request message by checking for the requested message and forwarding it back if the message was found.
(this can also cause this peer to send a new request instead of only forwarding the received one)
[in,out] | room | Room of the message |
[in,out] | tunnel | Receiving connection |
[in] | message | REQUEST-Message |
[in] | hash | Hash of the message |
Definition at line 236 of file gnunet-service-messenger_message_recv.c.
References GNUNET_MESSENGER_Message::body, callback_found_message(), check_member_session_history(), get_member_session_of(), get_srv_room_member_store(), get_store_member_of(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_h2s(), GNUNET_log, GNUNET_NO, GNUNET_YES, GNUNET_MESSENGER_MessageRequest::hash, GNUNET_MESSENGER_MemberSession::member, GNUNET_MESSENGER_MessageBody::request, and request_srv_room_message().
Referenced by handle_tunnel_message().