GNUnet MESSENGER service. More...
#include "platform.h"
#include "gnunet-service-messenger_message_recv.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 int | iterate_forward_members (void *cls, const struct GNUNET_IDENTITY_PublicKey *public_key, struct GNUNET_MESSENGER_MemberSession *session) |
int | 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... | |
int | 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... | |
static void | callback_found_message (void *cls, struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash) |
int | 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... | |
GNUnet MESSENGER service.
Definition in file gnunet-service-messenger_message_recv.c.
|
static |
Definition at line 32 of file gnunet-service-messenger_message_recv.c.
References forward_tunnel_message(), get_srv_room_message_store(), get_store_message(), 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 iterate_forward_members().
|
static |
Definition at line 60 of file gnunet-service-messenger_message_recv.c.
References forward_about_members(), 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().
int 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 78 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(), get_srv_handle_ego(), get_srv_room_member_store(), get_tunnel_messenger_version(), get_tunnel_peer_identity(), GNUNET_NO, GNUNET_OK, GNUNET_YES, GNUNET_MESSENGER_SrvRoom::host, GNUNET_MESSENGER_MessageBody::info, iterate_forward_members(), iterate_store_members(), GNUNET_MESSENGER_MessageInfo::messenger_version, peer, GNUNET_MESSENGER_MemberStore::room, send_tunnel_message(), and update_tunnel_messenger_version().
Referenced by handle_tunnel_message().
int 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 117 of file gnunet-service-messenger_message_recv.c.
References 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, peer, and GNUNET_MESSENGER_SrvTunnel::peer_message.
Referenced by handle_tunnel_message().
|
static |
Definition at line 137 of file gnunet-service-messenger_message_recv.c.
References forward_tunnel_message(), get_srv_room_operation_store(), GNUNET_MESSENGER_OP_REQUEST, GNUNET_MESSENGER_REQUEST_DELAY, GNUNET_MESSENGER_OperationStore::room, and use_store_operation().
Referenced by recv_message_request().
int 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 164 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, request_srv_room_message(), and GNUNET_MESSENGER_MemberStore::room.
Referenced by handle_tunnel_message().