GNUnet  0.11.x
Data Structures | Enumerations | Functions
gnunet-service-messenger_room.h File Reference

GNUnet MESSENGER service. More...

#include "platform.h"
#include "gnunet_cadet_service.h"
#include "gnunet_container_lib.h"
#include "gnunet_crypto_lib.h"
#include "gnunet_identity_service.h"
#include "gnunet_mq_lib.h"
#include "gnunet-service-messenger_contact.h"
#include "gnunet_messenger_service.h"
#include "gnunet-service-messenger_basement.h"
#include "gnunet-service-messenger_handle.h"
#include "gnunet-service-messenger_tunnel.h"
#include "gnunet-service-messenger_list_messages.h"
#include "messenger_api_list_tunnels.h"
#include "gnunet-service-messenger_message_store.h"
#include "messenger_api_ego.h"
Include dependency graph for gnunet-service-messenger_room.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  GNUNET_MESSENGER_MemberInfo
 
struct  GNUNET_MESSENGER_SrvRoom
 

Enumerations

enum  GNUNET_MESSENGER_MemberAccess { GNUNET_MESSENGER_MEMBER_ALLOWED = 1, GNUNET_MESSENGER_MEMBER_BLOCKED = 1, GNUNET_MESSENGER_MEMBER_UNKNOWN = 0 }
 

Functions

struct GNUNET_MESSENGER_SrvRoomcreate_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...
 
void destroy_room (struct GNUNET_MESSENGER_SrvRoom *room)
 Destroys a room and frees its memory fully. More...
 
struct GNUNET_MESSENGER_SrvContactget_room_contact (struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_ShortHashCode *id)
 Returns the contact of a member in a room identified by a given id. More...
 
void add_room_contact (struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_ShortHashCode *id, const struct GNUNET_IDENTITY_PublicKey *pubkey)
 Adds a contact from the service to a room under a specific id with a given public key. More...
 
struct GNUNET_MESSENGER_MemberInfoget_room_member_info (struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_ShortHashCode *id)
 Returns the member information of a member in a room identified by a given id. More...
 
struct GNUNET_ShortHashCodegenerate_room_member_id (const struct GNUNET_MESSENGER_SrvRoom *room)
 Tries to generate and allocate a new unique member id checking all current members for possible duplicates. More...
 
const struct GNUNET_ShortHashCodeget_room_host_id (const struct GNUNET_MESSENGER_SrvRoom *room)
 Returns the member id of the member representing the handle currently hosting this room. More...
 
void change_room_host_id (struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_ShortHashCode *unique_id)
 Changes the member id of the member representing the handle currently hosting this room. More...
 
int open_room (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle)
 Tries to open a room for a given handle. More...
 
int entry_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...
 
struct GNUNET_MESSENGER_SrvTunnelfind_room_tunnel_to (struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_ShortHashCode *contact_id)
 Returns a tunnel granting a direct connection to a specific member in a room. More...
 
struct GNUNET_MQ_Envelopepack_room_message (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, struct GNUNET_MESSENGER_Message *message, struct GNUNET_HashCode *hash, int mode)
 Packs a message depending on the selected mode into a newly allocated envelope. More...
 
void send_room_message (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, struct GNUNET_MESSENGER_Message *message, struct GNUNET_HashCode *hash)
 Sends a message from a given handle into a room. More...
 
void send_room_message_ext (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, struct GNUNET_MESSENGER_Message *message, struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_SrvTunnel *tunnel)
 Sends a message from a given handle into a room excluding one specific tunnel. More...
 
void forward_room_message (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvTunnel *tunnel, const 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 merge_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...
 
struct GNUNET_CADET_Handleget_room_cadet (struct GNUNET_MESSENGER_SrvRoom *room)
 Returns the CADET handle from a rooms service. More...
 
struct GNUNET_HashCodeget_room_key (struct GNUNET_MESSENGER_SrvRoom *room)
 Returns the shared secret you need to access a room. More...
 
const struct GNUNET_MESSENGER_SrvTunnelget_room_tunnel (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...
 
const struct GNUNET_MESSENGER_Messageget_room_message (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_HashCode *hash, int request)
 Returns a message from a room identified by a given hash. More...
 
void update_room_last_messages (struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
 Updates the last messages of a room by replacing them if the previous hash of a given message matches with one of the latest messages. More...
 
void switch_room_member_id (struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_ShortHashCode *old_id, const struct GNUNET_ShortHashCode *new_id, const struct GNUNET_HashCode *hash)
 Changes an id of a current member from an old id to a new one and adds optionally the hash of an id message to the members information. More...
 
void rebuild_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...
 
void handle_room_messages (struct GNUNET_MESSENGER_SrvRoom *room)
 Handles all queued up messages of a room to handle in correct order. More...
 

Detailed Description

GNUnet MESSENGER service.

Author
Tobias Frisch

Definition in file gnunet-service-messenger_room.h.

Enumeration Type Documentation

◆ GNUNET_MESSENGER_MemberAccess

Enumerator
GNUNET_MESSENGER_MEMBER_ALLOWED 
GNUNET_MESSENGER_MEMBER_BLOCKED 
GNUNET_MESSENGER_MEMBER_UNKNOWN 

Definition at line 49 of file gnunet-service-messenger_room.h.

Function Documentation

◆ create_room()

struct GNUNET_MESSENGER_SrvRoom* create_room ( struct GNUNET_MESSENGER_SrvHandle handle,
const struct GNUNET_HashCode key 
)

Creates and allocates a new room for a handle with a given key.

Parameters
handleHandle
keyKey of room
Returns
New room

Definition at line 37 of file gnunet-service-messenger_room.c.

References GNUNET_MESSENGER_SrvRoom::basement, GNUNET_MESSENGER_Service::dir, GNUNET_assert, GNUNET_CONTAINER_multihashmap_create(), GNUNET_CONTAINER_multipeermap_create(), GNUNET_CONTAINER_multishortmap_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_message_store(), GNUNET_MESSENGER_SrvRoom::key, GNUNET_MESSENGER_SrvRoom::last_messages, load_service_room_and_messages(), GNUNET_MESSENGER_SrvRoom::member_infos, GNUNET_MESSENGER_SrvRoom::members, GNUNET_MESSENGER_SrvRoom::peer_message, GNUNET_MESSENGER_SrvRoom::port, GNUNET_MESSENGER_SrvRoom::requested, GNUNET_MESSENGER_SrvHandle::service, GNUNET_MESSENGER_SrvRoom::service, GNUNET_MESSENGER_SrvRoom::store, GNUNET_MESSENGER_SrvRoom::strict_access, and GNUNET_MESSENGER_SrvRoom::tunnels.

Referenced by entry_service_room(), GNUNET_MESSENGER_entry_room(), GNUNET_MESSENGER_open_room(), and open_service_room().

38 {
39  GNUNET_assert((handle) && (key));
40 
42 
43  room->service = handle->service;
44  room->host = handle;
45  room->port = NULL;
46 
47  GNUNET_memcpy(&(room->key), key, sizeof(struct GNUNET_HashCode));
48 
52 
53  init_message_store (&(room->store));
55 
56  init_list_tunnels (&(room->basement));
58 
59  room->peer_message = NULL;
60 
61  init_list_messages (&(room->handling));
62  room->idle = NULL;
63 
64  room->strict_access = GNUNET_NO;
65 
66  if (room->service->dir)
68 
70 
71  return room;
72 }
static void idle_request_room_messages(void *cls)
struct GNUNET_MESSENGER_Service * service
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
void load_service_room_and_messages(struct GNUNET_MESSENGER_Service *service, struct GNUNET_MESSENGER_SrvRoom *room)
Loads the local configuration for a given room of a service which contains the last messages hash and...
#define GNUNET_new(type)
Allocate a struct or union of the given type.
struct GNUNET_CADET_Port * port
struct GNUNET_CONTAINER_MultiShortmap * member_infos
struct GNUNET_CONTAINER_MultiPeerMap * GNUNET_CONTAINER_multipeermap_create(unsigned int len, int do_not_copy_keys)
Create a multi peer map (hash map for public keys of peers).
struct GNUNET_SCHEDULER_Task * idle
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_with_priority(enum GNUNET_SCHEDULER_Priority prio, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified priority.
Definition: scheduler.c:1223
void init_list_messages(struct GNUNET_MESSENGER_ListMessages *messages)
Initializes list of message hashes as empty list.
struct GNUNET_MESSENGER_ListMessages last_messages
struct GNUNET_MESSENGER_Service * service
struct GNUNET_HashCode * peer_message
static struct GNUNET_DNS_Handle * handle
Handle to transport service.
struct GNUNET_CONTAINER_MultiShortmap * GNUNET_CONTAINER_multishortmap_create(unsigned int len, int do_not_copy_keys)
Create a multi peer map (hash map for public keys of peers).
struct GNUNET_MESSENGER_ListMessages handling
A 512-bit hashcode.
Run when otherwise idle.
struct GNUNET_CONTAINER_MultiShortmap * members
struct GNUNET_MESSENGER_SrvHandle * host
void init_list_tunnels(struct GNUNET_MESSENGER_ListTunnels *tunnels)
Initializes list of tunnels peer identities as empty list.
struct GNUNET_MESSENGER_ListTunnels basement
struct GNUNET_CONTAINER_MultiHashMap * GNUNET_CONTAINER_multihashmap_create(unsigned int len, int do_not_copy_keys)
Create a multi hash map.
void init_message_store(struct GNUNET_MESSENGER_MessageStore *store)
Initializes a message store as fully empty.
struct GNUNET_CONTAINER_MultiHashMap * requested
struct GNUNET_CONTAINER_MultiPeerMap * tunnels
struct GNUNET_MESSENGER_MessageStore store
Here is the call graph for this function:
Here is the caller graph for this function:

◆ destroy_room()

void destroy_room ( struct GNUNET_MESSENGER_SrvRoom room)

Destroys a room and frees its memory fully.

Parameters
roomRoom

Definition at line 112 of file gnunet-service-messenger_room.c.

References GNUNET_MESSENGER_SrvRoom::basement, clear_list_messages(), clear_list_tunnels(), clear_message_store(), GNUNET_MESSENGER_Service::dir, GNUNET_assert, GNUNET_CADET_close_port(), GNUNET_CONTAINER_multihashmap_destroy(), GNUNET_CONTAINER_multipeermap_destroy(), GNUNET_CONTAINER_multipeermap_iterate(), GNUNET_CONTAINER_multishortmap_destroy(), GNUNET_CONTAINER_multishortmap_iterate(), GNUNET_free, GNUNET_SCHEDULER_cancel(), handle_room_messages(), GNUNET_MESSENGER_SrvRoom::host, GNUNET_MESSENGER_SrvRoom::idle, iterate_clear_members(), iterate_destroy_member_infos(), iterate_destroy_tunnels(), GNUNET_MESSENGER_SrvRoom::last_messages, GNUNET_MESSENGER_SrvRoom::member_infos, GNUNET_MESSENGER_SrvRoom::members, merge_room_last_messages(), GNUNET_MESSENGER_SrvRoom::peer_message, GNUNET_MESSENGER_SrvRoom::port, GNUNET_MESSENGER_SrvRoom::requested, save_service_room_and_messages(), GNUNET_MESSENGER_SrvRoom::service, GNUNET_MESSENGER_SrvRoom::store, and GNUNET_MESSENGER_SrvRoom::tunnels.

Referenced by close_handle_room(), close_service_room(), entry_service_room(), GNUNET_MESSENGER_entry_room(), GNUNET_MESSENGER_open_room(), iterate_destroy_room(), iterate_destroy_rooms(), and open_service_room().

113 {
114  GNUNET_assert(room);
115 
116  if (room->idle)
117  {
119 
120  room->idle = NULL;
121  }
122 
123  if (room->port)
125 
126  merge_room_last_messages (room, room->host);
127 
129  NULL);
130 
131  handle_room_messages (room);
132 
133  if (room->service->dir)
135 
138 
139  clear_message_store (&(room->store));
140 
142 
146 
147  clear_list_tunnels (&(room->basement));
149 
150  if (room->peer_message)
151  GNUNET_free(room->peer_message);
152 
153  GNUNET_free(room);
154 }
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
static int iterate_clear_members(void *cls, const struct GNUNET_ShortHashCode *key, void *value)
void handle_room_messages(struct GNUNET_MESSENGER_SrvRoom *room)
Handles all queued up messages of a room to handle in correct order.
struct GNUNET_CADET_Port * port
struct GNUNET_CONTAINER_MultiShortmap * member_infos
static int iterate_destroy_tunnels(void *cls, const struct GNUNET_PeerIdentity *key, void *value)
void save_service_room_and_messages(struct GNUNET_MESSENGER_Service *service, struct GNUNET_MESSENGER_SrvRoom *room)
Saves the configuration for a given room of a service which contains the last messages hash and the r...
void GNUNET_CONTAINER_multipeermap_destroy(struct GNUNET_CONTAINER_MultiPeerMap *map)
Destroy a hash map.
struct GNUNET_SCHEDULER_Task * idle
struct GNUNET_MESSENGER_ListMessages last_messages
struct GNUNET_MESSENGER_Service * service
int GNUNET_CONTAINER_multishortmap_iterate(struct GNUNET_CONTAINER_MultiShortmap *map, GNUNET_CONTAINER_ShortmapIterator it, void *it_cls)
Iterate over all entries in the map.
struct GNUNET_HashCode * peer_message
void GNUNET_CONTAINER_multihashmap_destroy(struct GNUNET_CONTAINER_MultiHashMap *map)
Destroy a hash map.
void merge_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 me...
void clear_list_tunnels(struct GNUNET_MESSENGER_ListTunnels *tunnels)
Clears the list of tunnels peer identities.
struct GNUNET_CONTAINER_MultiShortmap * members
struct GNUNET_MESSENGER_SrvHandle * host
void clear_list_messages(struct GNUNET_MESSENGER_ListMessages *messages)
Clears the list of message hashes.
void GNUNET_CONTAINER_multishortmap_destroy(struct GNUNET_CONTAINER_MultiShortmap *map)
Destroy a hash map.
int GNUNET_CONTAINER_multipeermap_iterate(struct GNUNET_CONTAINER_MultiPeerMap *map, GNUNET_CONTAINER_PeerMapIterator it, void *it_cls)
Iterate over all entries in the map.
struct GNUNET_MESSENGER_ListTunnels basement
void GNUNET_CADET_close_port(struct GNUNET_CADET_Port *p)
Close a port opened with GNUNET_CADET_open_port().
Definition: cadet_api.c:808
struct GNUNET_CONTAINER_MultiHashMap * requested
struct GNUNET_CONTAINER_MultiPeerMap * tunnels
static int iterate_destroy_member_infos(void *cls, const struct GNUNET_ShortHashCode *key, void *value)
struct GNUNET_MESSENGER_MessageStore store
#define GNUNET_free(ptr)
Wrapper around free.
void clear_message_store(struct GNUNET_MESSENGER_MessageStore *store)
Clears a message store, wipes its content and deallocates its memory.
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
Definition: scheduler.c:972
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_room_contact()

struct GNUNET_MESSENGER_SrvContact* get_room_contact ( struct GNUNET_MESSENGER_SrvRoom room,
const struct GNUNET_ShortHashCode id 
)

Returns the contact of a member in a room identified by a given id.

If the room does not contain a member with the given id, NULL gets returned.

Parameters
roomRoom
idMember id
Returns
Contact or NULL

Definition at line 157 of file gnunet-service-messenger_room.c.

References GNUNET_assert, GNUNET_CONTAINER_multishortmap_get(), and GNUNET_MESSENGER_SrvRoom::members.

Referenced by handle_message_join(), handle_message_key(), and handle_message_name().

158 {
159  GNUNET_assert((room) && (room->members));
160 
161  return GNUNET_CONTAINER_multishortmap_get (room->members, id);
162 }
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
struct GNUNET_CONTAINER_MultiShortmap * members
void * GNUNET_CONTAINER_multishortmap_get(const struct GNUNET_CONTAINER_MultiShortmap *map, const struct GNUNET_ShortHashCode *key)
Given a key find a value in the map matching the key.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_room_contact()

void add_room_contact ( struct GNUNET_MESSENGER_SrvRoom room,
const struct GNUNET_ShortHashCode id,
const struct GNUNET_IDENTITY_PublicKey pubkey 
)

Adds a contact from the service to a room under a specific id with a given public key.

Parameters
roomRoom
idMember id
pubkeyPublic key of EGO

Definition at line 165 of file gnunet-service-messenger_room.c.

References get_service_contact_by_pubkey(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST, GNUNET_CONTAINER_multishortmap_put(), GNUNET_OK, increase_contact_rc(), GNUNET_MESSENGER_SrvRoom::members, and GNUNET_MESSENGER_SrvRoom::service.

Referenced by handle_message_join().

167 {
168  struct GNUNET_MESSENGER_SrvContact *contact = get_service_contact_by_pubkey (room->service, pubkey);
169 
170  if (GNUNET_OK == GNUNET_CONTAINER_multishortmap_put (room->members, id, contact,
172  increase_contact_rc (contact);
173 }
void increase_contact_rc(struct GNUNET_MESSENGER_SrvContact *contact)
Increases the reference counter of a given contact which is zero as default.
struct GNUNET_MESSENGER_Service * service
, ' bother checking if a value already exists (faster than GNUNET_CONTAINER_MULTIHASHMAPOPTION_...
int GNUNET_CONTAINER_multishortmap_put(struct GNUNET_CONTAINER_MultiShortmap *map, const struct GNUNET_ShortHashCode *key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt)
Store a key-value pair in the map.
struct GNUNET_CONTAINER_MultiShortmap * members
struct GNUNET_MESSENGER_SrvContact * get_service_contact_by_pubkey(struct GNUNET_MESSENGER_Service *service, const struct GNUNET_IDENTITY_PublicKey *pubkey)
Returns a contact of a service identified by a given public key.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_room_member_info()

struct GNUNET_MESSENGER_MemberInfo* get_room_member_info ( struct GNUNET_MESSENGER_SrvRoom room,
const struct GNUNET_ShortHashCode id 
)

Returns the member information of a member in a room identified by a given id.

If the room does not contain a member with the given id, NULL gets returned.

Parameters
roomRoom
idMember id
Returns
Member information or NULL

Definition at line 176 of file gnunet-service-messenger_room.c.

References GNUNET_assert, GNUNET_CONTAINER_multishortmap_get(), and GNUNET_MESSENGER_SrvRoom::member_infos.

Referenced by handle_message_id(), handle_message_join(), handle_message_key(), handle_message_leave(), and handle_message_name().

177 {
178  GNUNET_assert((room) && (room->member_infos));
179 
181 }
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
struct GNUNET_CONTAINER_MultiShortmap * member_infos
void * GNUNET_CONTAINER_multishortmap_get(const struct GNUNET_CONTAINER_MultiShortmap *map, const struct GNUNET_ShortHashCode *key)
Given a key find a value in the map matching the key.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ generate_room_member_id()

struct GNUNET_ShortHashCode* generate_room_member_id ( const struct GNUNET_MESSENGER_SrvRoom room)

Tries to generate and allocate a new unique member id checking all current members for possible duplicates.

If the function fails, NULL gets returned.

Parameters
roomRoom
Returns
New member id or NULL

Definition at line 184 of file gnunet-service-messenger_room.c.

References generate_free_member_id(), GNUNET_assert, GNUNET_free, GNUNET_new, GNUNET_YES, and GNUNET_MESSENGER_SrvRoom::members.

Referenced by generate_service_new_member_id().

185 {
186  struct GNUNET_ShortHashCode *unique_id = GNUNET_new(struct GNUNET_ShortHashCode);
187 
188  GNUNET_assert(room);
189 
190  if (GNUNET_YES == generate_free_member_id (unique_id, room->members))
191  return unique_id;
192  else
193  {
194  GNUNET_free(unique_id);
195  return NULL;
196  }
197 }
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
A 256-bit hashcode.
struct GNUNET_CONTAINER_MultiShortmap * members
int generate_free_member_id(struct GNUNET_ShortHashCode *id, const struct GNUNET_CONTAINER_MultiShortmap *members)
Tries to generate an unused member id and store it into the id parameter.
#define GNUNET_free(ptr)
Wrapper around free.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_room_host_id()

const struct GNUNET_ShortHashCode* get_room_host_id ( const struct GNUNET_MESSENGER_SrvRoom room)

Returns the member id of the member representing the handle currently hosting this room.

Parameters
roomRoom
Returns
Host member id or NULL

Definition at line 200 of file gnunet-service-messenger_room.c.

References get_handle_member_id(), GNUNET_assert, GNUNET_MESSENGER_SrvRoom::host, and GNUNET_MESSENGER_SrvRoom::key.

Referenced by recv_message_info(), and recv_message_join().

201 {
202  GNUNET_assert(room);
203 
204  return get_handle_member_id (room->host, &(room->key));
205 }
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
struct GNUNET_MESSENGER_SrvHandle * host
const struct GNUNET_ShortHashCode * get_handle_member_id(const struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_HashCode *key)
Returns the member id of a given handle in a specific room.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ change_room_host_id()

void change_room_host_id ( struct GNUNET_MESSENGER_SrvRoom room,
const struct GNUNET_ShortHashCode unique_id 
)

Changes the member id of the member representing the handle currently hosting this room.

Parameters
roomRoom
unique_idUnique member id

Definition at line 208 of file gnunet-service-messenger_room.c.

References change_handle_member_id(), GNUNET_assert, GNUNET_MESSENGER_SrvRoom::host, and GNUNET_MESSENGER_SrvRoom::key.

Referenced by recv_message_info().

209 {
210  GNUNET_assert(room);
211 
212  change_handle_member_id (room->host, &(room->key), unique_id);
213 }
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
void change_handle_member_id(struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_HashCode *key, const struct GNUNET_ShortHashCode *unique_id)
Changes the member id of a given handle in a specific room to match a unique_id.
struct GNUNET_MESSENGER_SrvHandle * host
Here is the call graph for this function:
Here is the caller graph for this function:

◆ open_room()

int open_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 guranteed to be open for incoming connections.

Parameters
roomRoom
handleHandle
Returns
GNUNET_YES on success, GNUNET_NO on failure.

Definition at line 374 of file gnunet-service-messenger_room.c.

References cadet, callback_room_connect(), callback_tunnel_disconnect(), create_message_peer(), destroy_message(), get_handle_member_id(), get_room_cadet(), get_room_key(), GNUNET_CADET_close_port(), GNUNET_CADET_open_port(), GNUNET_CONTAINER_multishortmap_get(), GNUNET_ERROR_TYPE_WARNING, GNUNET_log, GNUNET_MESSAGE_TYPE_CADET_CLI, GNUNET_MQ_handler_end, GNUNET_MQ_hd_var_size, GNUNET_NO, GNUNET_YES, join_room(), join_room_locally(), key, GNUNET_MESSENGER_SrvRoom::key, GNUNET_MESSENGER_SrvRoom::member_infos, GNUNET_MESSENGER_SrvRoom::port, send_room_message(), and GNUNET_MESSENGER_SrvRoom::service.

Referenced by open_service_room().

375 {
376  if (room->port)
377  return join_room_locally (room, handle);
378 
379  struct GNUNET_CADET_Handle *cadet = get_room_cadet (room);
380  struct GNUNET_HashCode *key = get_room_key (room);
381 
383  struct GNUNET_MessageHeader, NULL),
385 
386  room->port = GNUNET_CADET_open_port (cadet, key, callback_room_connect, room, NULL,
387  callback_tunnel_disconnect, handlers);
388 
389  const struct GNUNET_ShortHashCode *member_id = get_handle_member_id (handle, &(room->key));
390 
392 
393  if ((!info) && (GNUNET_NO == join_room (room, handle, member_id)) && (room->port))
394  {
395  GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "You could not join the room, therefore it keeps closed!\n");
396 
398  room->port = NULL;
399 
400  return GNUNET_NO;
401  }
402 
403  struct GNUNET_MESSENGER_Message *message = create_message_peer (room->service);
404 
405  if (message)
406  {
407  struct GNUNET_HashCode hash;
408 
409  send_room_message (room, handle, message, &hash);
410  destroy_message (message);
411  }
412 
413  return (room->port ? GNUNET_YES : GNUNET_NO);
414 }
static struct GNUNET_CADET_Handle * cadet
Handle for cadet.
void destroy_message(struct GNUNET_MESSENGER_Message *message)
Destroys a message and frees its memory fully.
struct GNUNET_HashCode * get_room_key(struct GNUNET_MESSENGER_SrvRoom *room)
Returns the shared secret you need to access a room.
Opaque handle to the service.
Definition: cadet_api.c:38
static void * callback_room_connect(void *cls, struct GNUNET_CADET_Channel *channel, const struct GNUNET_PeerIdentity *source)
static int join_room(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_ShortHashCode *member_id)
#define GNUNET_MESSAGE_TYPE_CADET_CLI
Traffic (net-cat style) used by the Command Line Interface.
struct GNUNET_CADET_Port * port
struct GNUNET_CONTAINER_MultiShortmap * member_infos
struct GNUNET_CADET_Handle * get_room_cadet(struct GNUNET_MESSENGER_SrvRoom *room)
Returns the CADET handle from a rooms service.
A 256-bit hashcode.
struct GNUNET_CADET_Port * GNUNET_CADET_open_port(struct GNUNET_CADET_Handle *h, const struct GNUNET_HashCode *port, GNUNET_CADET_ConnectEventHandler connects, void *connects_cls, GNUNET_CADET_WindowSizeEventHandler window_changes, GNUNET_CADET_DisconnectEventHandler disconnects, const struct GNUNET_MQ_MessageHandler *handlers)
Open a port to receive incomming MQ-based channels.
Definition: cadet_api.c:970
struct GNUNET_MESSENGER_Service * service
static struct GNUNET_CADET_MessageHandler handlers[]
Handlers, for diverse services.
#define GNUNET_MQ_hd_var_size(name, code, str, ctx)
A 512-bit hashcode.
Message handler for a specific message type.
struct GNUNET_HashCode key
The key used in the DHT.
void callback_tunnel_disconnect(void *cls, const struct GNUNET_CADET_Channel *channel)
void send_room_message(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, struct GNUNET_MESSENGER_Message *message, struct GNUNET_HashCode *hash)
Sends a message from a given handle into a room.
struct GNUNET_MESSENGER_Message * create_message_peer(const struct GNUNET_MESSENGER_Service *service)
Creates and allocates a new peer message containing a services peer identity.
void * GNUNET_CONTAINER_multishortmap_get(const struct GNUNET_CONTAINER_MultiShortmap *map, const struct GNUNET_ShortHashCode *key)
Given a key find a value in the map matching the key.
#define GNUNET_log(kind,...)
Header for all communications.
const struct GNUNET_ShortHashCode * get_handle_member_id(const struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_HashCode *key)
Returns the member id of a given handle in a specific room.
void GNUNET_CADET_close_port(struct GNUNET_CADET_Port *p)
Close a port opened with GNUNET_CADET_open_port().
Definition: cadet_api.c:808
#define GNUNET_MQ_handler_end()
End-marker for the handlers array.
static int join_room_locally(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ entry_room_at()

int entry_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.

Parameters
roomRoom
handleHandle
doorPeer identity
Returns
GNUNET_YES on success, GNUNET_NO on failure.

Definition at line 417 of file gnunet-service-messenger_room.c.

References GNUNET_MESSENGER_Message::body, connect_tunnel(), create_tunnel(), destroy_tunnel(), get_room_message(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST, GNUNET_CONTAINER_multipeermap_get(), GNUNET_CONTAINER_multipeermap_put(), GNUNET_ERROR_TYPE_WARNING, GNUNET_log, GNUNET_memcmp, GNUNET_NO, GNUNET_OK, GNUNET_YES, join_room_locally(), msg, GNUNET_MESSENGER_MessagePeer::peer, GNUNET_MESSENGER_MessageBody::peer, GNUNET_MESSENGER_SrvRoom::peer_message, and GNUNET_MESSENGER_SrvRoom::tunnels.

Referenced by entry_service_room().

419 {
420  if (room->peer_message)
421  {
422  const struct GNUNET_MESSENGER_Message *msg = get_room_message (room, handle, room->peer_message, GNUNET_NO);
423 
424  if (0 == GNUNET_memcmp(&(msg->body.peer.peer), door))
425  return join_room_locally (room, handle);
426  }
427 
429 
430  if (tunnel)
431  {
432  switch (connect_tunnel (tunnel))
433  {
434  case GNUNET_YES:
435  return GNUNET_YES;
436  case GNUNET_NO:
437  return join_room_locally (room, handle);
438  default:
439  return GNUNET_NO;
440  }
441  }
442 
443  tunnel = create_tunnel (room, door);
444 
445  if ((GNUNET_YES == connect_tunnel (tunnel)) &&
446  (GNUNET_OK == GNUNET_CONTAINER_multipeermap_put (room->tunnels, door, tunnel,
448  return GNUNET_YES;
449  else
450  {
451  GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "You could not connect to that door!\n");
452 
453  destroy_tunnel (tunnel);
454  return GNUNET_NO;
455  }
456 }
struct GNUNET_PeerIdentity peer
The peer identity of the sender opening a room.
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
int connect_tunnel(struct GNUNET_MESSENGER_SrvTunnel *tunnel)
Tries to connect a tunnel by creating a new CADET channel and binding it.
static void destroy_tunnel(void *cls)
This tunnel is no longer used, destroy it.
, ' bother checking if a value already exists (faster than GNUNET_CONTAINER_MULTIHASHMAPOPTION_...
struct GNUNET_HashCode * peer_message
struct GNUNET_MESSENGER_MessageBody body
Body.
struct GNUNET_MESSENGER_SrvTunnel * create_tunnel(struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_PeerIdentity *door)
Creates and allocates a tunnel of a room to a specific peer identity.
struct GNUNET_MESSENGER_MessagePeer peer
#define GNUNET_memcmp(a, b)
Compare memory in a and b, where both must be of the same pointer type.
const struct GNUNET_MESSENGER_Message * get_room_message(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_HashCode *hash, int request)
Returns a message from a room identified by a given hash.
int GNUNET_CONTAINER_multipeermap_put(struct GNUNET_CONTAINER_MultiPeerMap *map, const struct GNUNET_PeerIdentity *key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt)
Store a key-value pair in the map.
void * GNUNET_CONTAINER_multipeermap_get(const struct GNUNET_CONTAINER_MultiPeerMap *map, const struct GNUNET_PeerIdentity *key)
Given a key find a value in the map matching the key.
#define GNUNET_log(kind,...)
struct GNUNET_CONTAINER_MultiPeerMap * tunnels
static int join_room_locally(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ find_room_tunnel_to()

struct GNUNET_MESSENGER_SrvTunnel* find_room_tunnel_to ( struct GNUNET_MESSENGER_SrvRoom room,
const struct GNUNET_ShortHashCode contact_id 
)

Returns a tunnel granting a direct connection to a specific member in a room.

The member gets identified by an id. If no tunnel has been linked to the selected id, NULL gets returned.

Parameters
roomRoom
contact_idMember id
Returns
Tunnel to the member or NULL

Definition at line 480 of file gnunet-service-messenger_room.c.

References GNUNET_CONTAINER_multipeermap_iterate(), iterate_find_tunnel(), GNUNET_MESSENGER_SrvTunnelFinder::needle, GNUNET_MESSENGER_SrvTunnelFinder::tunnel, and GNUNET_MESSENGER_SrvRoom::tunnels.

Referenced by recv_message_join().

481 {
482  struct GNUNET_MESSENGER_SrvTunnelFinder finder;
483 
484  finder.needle = contact_id;
485  finder.tunnel = NULL;
486 
488 
489  return finder.tunnel;
490 }
const struct GNUNET_ShortHashCode * needle
int GNUNET_CONTAINER_multipeermap_iterate(struct GNUNET_CONTAINER_MultiPeerMap *map, GNUNET_CONTAINER_PeerMapIterator it, void *it_cls)
Iterate over all entries in the map.
static int iterate_find_tunnel(void *cls, const struct GNUNET_PeerIdentity *peer, void *value)
struct GNUNET_CONTAINER_MultiPeerMap * tunnels
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pack_room_message()

struct GNUNET_MQ_Envelope* pack_room_message ( struct GNUNET_MESSENGER_SrvRoom room,
struct GNUNET_MESSENGER_SrvHandle handle,
struct GNUNET_MESSENGER_Message message,
struct GNUNET_HashCode hash,
int  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 EGO.

If the optional hash parameter is a valid pointer, its value will be overriden 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.

Parameters
roomRoom
handleHandle
messageMessage
[out]hashHash of message
modePacking mode
Returns
New envelope or NULL

Definition at line 493 of file gnunet-service-messenger_room.c.

References get_handle_ego(), get_handle_member_id(), GNUNET_assert, GNUNET_memcpy, GNUNET_TIME_absolute_get(), GNUNET_TIME_absolute_hton(), GNUNET_MESSENGER_ListMessage::hash, GNUNET_MESSENGER_ListMessages::head, GNUNET_MESSENGER_Message::header, GNUNET_MESSENGER_SrvRoom::key, GNUNET_MESSENGER_SrvRoom::last_messages, pack_message(), GNUNET_MESSENGER_MessageHeader::previous, GNUNET_MESSENGER_MessageHeader::sender_id, and GNUNET_MESSENGER_MessageHeader::timestamp.

Referenced by iterate_send_room_message(), send_room_message(), send_room_message_ext(), and send_tunnel_message().

495 {
497 
498  const struct GNUNET_ShortHashCode *id = get_handle_member_id (handle, &(room->key));
499 
500  GNUNET_assert(id);
501 
502  GNUNET_memcpy(&(message->header.sender_id), id, sizeof(struct GNUNET_ShortHashCode));
503 
504  if (room->last_messages.head)
505  GNUNET_memcpy(&(message->header.previous), &(room->last_messages.head->hash), sizeof(struct GNUNET_HashCode));
506  else
507  memset (&(message->header.previous), 0, sizeof(struct GNUNET_HashCode));
508 
509  return pack_message (message, hash, get_handle_ego (handle), mode);
510 }
struct GNUNET_MESSENGER_MessageHeader header
Header.
struct GNUNET_ShortHashCode sender_id
The senders id inside of the room the message was sent in.
struct GNUNET_TIME_AbsoluteNBO timestamp
The timestamp of the message.
struct GNUNET_MESSENGER_Ego * get_handle_ego(struct GNUNET_MESSENGER_SrvHandle *handle)
Returns the EGO used by a given handle.
struct GNUNET_MESSENGER_ListMessage * head
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
static enum @8 mode
Should we do a PUT (mode = 0) or GET (mode = 1);.
A 256-bit hashcode.
struct GNUNET_MQ_Envelope * pack_message(struct GNUNET_MESSENGER_Message *message, struct GNUNET_HashCode *hash, const struct GNUNET_MESSENGER_Ego *ego, int mode)
Encodes the message to pack it into a newly allocated envelope if mode is equal to GNUNET_MESSENGER_P...
struct GNUNET_MESSENGER_ListMessages last_messages
A 512-bit hashcode.
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get(void)
Get the current time.
Definition: time.c:118
struct GNUNET_HashCode previous
The hash of the previous message from the senders perspective.
const struct GNUNET_ShortHashCode * get_handle_member_id(const struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_HashCode *key)
Returns the member id of a given handle in a specific room.
struct GNUNET_TIME_AbsoluteNBO GNUNET_TIME_absolute_hton(struct GNUNET_TIME_Absolute a)
Convert absolute time to network byte order.
Definition: time.c:657
Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_room_message()

void send_room_message ( struct GNUNET_MESSENGER_SrvRoom room,
struct GNUNET_MESSENGER_SrvHandle handle,
struct GNUNET_MESSENGER_Message message,
struct GNUNET_HashCode hash 
)

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.

Parameters
roomRoom
handleHandle
messageMessage
[out]hashHash of message

Definition at line 565 of file gnunet-service-messenger_room.c.

References callback_room_sent(), copy_message(), GNUNET_MESSENGER_ClosureSendRoom::exclude, GNUNET_CONTAINER_multipeermap_iterate(), GNUNET_MESSENGER_PACK_MODE_UNKNOWN, GNUNET_NO, handle, GNUNET_MESSENGER_ClosureSendRoom::handle, GNUNET_MESSENGER_ClosureSendRoom::hash, iterate_send_room_message(), GNUNET_MESSENGER_ClosureSendRoom::message, pack_room_message(), GNUNET_MESSENGER_ClosureSendRoom::packed, GNUNET_MESSENGER_ClosureSendRoom::room, and GNUNET_MESSENGER_SrvRoom::tunnels.

Referenced by callback_room_disconnect(), close_service_room(), get_room_message(), join_room(), merge_room_last_messages(), open_room(), and send_handle_message().

567 {
568  struct GNUNET_MESSENGER_ClosureSendRoom closure;
569 
570  closure.room = room;
571  closure.handle = handle;
572  closure.exclude = NULL;
573  closure.message = message;
574  closure.hash = hash;
575  closure.packed = GNUNET_NO;
576 
578 
579  if ((GNUNET_NO == closure.packed) && (closure.message == message))
580  {
581  pack_room_message (room, handle, message, hash,
583 
584  callback_room_sent (room, handle, NULL, copy_message (message), hash);
585  }
586 }
static int iterate_send_room_message(void *cls, const struct GNUNET_PeerIdentity *key, void *value)
void callback_room_sent(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, void *cls, struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
#define GNUNET_MESSENGER_PACK_MODE_UNKNOWN
struct GNUNET_MESSENGER_SrvRoom * room
static struct GNUNET_DNS_Handle * handle
Handle to transport service.
struct GNUNET_MESSENGER_Message * message
struct GNUNET_MESSENGER_Message * copy_message(const struct GNUNET_MESSENGER_Message *message)
Creates and allocates a copy of a given message.
int GNUNET_CONTAINER_multipeermap_iterate(struct GNUNET_CONTAINER_MultiPeerMap *map, GNUNET_CONTAINER_PeerMapIterator it, void *it_cls)
Iterate over all entries in the map.
struct GNUNET_MQ_Envelope * pack_room_message(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, struct GNUNET_MESSENGER_Message *message, struct GNUNET_HashCode *hash, int mode)
Packs a message depending on the selected mode into a newly allocated envelope.
struct GNUNET_CONTAINER_MultiPeerMap * tunnels
Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_room_message_ext()

void send_room_message_ext ( struct GNUNET_MESSENGER_SrvRoom room,
struct GNUNET_MESSENGER_SrvHandle handle,
struct GNUNET_MESSENGER_Message message,
struct GNUNET_HashCode hash,
struct GNUNET_MESSENGER_SrvTunnel tunnel 
)

Sends a message from a given handle into a room excluding one specific tunnel.

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.

Parameters
roomRoom
handleHandle
messageMessage
[out]hashHash of message
tunnelTunnel

Definition at line 589 of file gnunet-service-messenger_room.c.

References callback_room_sent(), copy_message(), GNUNET_MESSENGER_ClosureSendRoom::exclude, GNUNET_CONTAINER_multipeermap_iterate(), GNUNET_MESSENGER_PACK_MODE_UNKNOWN, GNUNET_NO, handle, GNUNET_MESSENGER_ClosureSendRoom::handle, GNUNET_MESSENGER_ClosureSendRoom::hash, iterate_send_room_message(), GNUNET_MESSENGER_ClosureSendRoom::message, pack_room_message(), GNUNET_MESSENGER_ClosureSendRoom::packed, GNUNET_MESSENGER_ClosureSendRoom::room, GNUNET_MESSENGER_SrvTunnelFinder::tunnel, and GNUNET_MESSENGER_SrvRoom::tunnels.

Referenced by recv_message_info().

592 {
593  struct GNUNET_MESSENGER_ClosureSendRoom closure;
594 
595  closure.room = room;
596  closure.handle = handle;
597  closure.exclude = tunnel;
598  closure.message = message;
599  closure.hash = hash;
600  closure.packed = GNUNET_NO;
601 
603 
604  if ((GNUNET_NO == closure.packed) && (closure.message == message))
605  {
606  pack_room_message (room, handle, message, hash,
608 
609  callback_room_sent (room, handle, NULL, copy_message (message), hash);
610  }
611 }
static int iterate_send_room_message(void *cls, const struct GNUNET_PeerIdentity *key, void *value)
void callback_room_sent(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, void *cls, struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
#define GNUNET_MESSENGER_PACK_MODE_UNKNOWN
struct GNUNET_MESSENGER_SrvRoom * room
static struct GNUNET_DNS_Handle * handle
Handle to transport service.
struct GNUNET_MESSENGER_Message * message
struct GNUNET_MESSENGER_Message * copy_message(const struct GNUNET_MESSENGER_Message *message)
Creates and allocates a copy of a given message.
int GNUNET_CONTAINER_multipeermap_iterate(struct GNUNET_CONTAINER_MultiPeerMap *map, GNUNET_CONTAINER_PeerMapIterator it, void *it_cls)
Iterate over all entries in the map.
struct GNUNET_MQ_Envelope * pack_room_message(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, struct GNUNET_MESSENGER_Message *message, struct GNUNET_HashCode *hash, int mode)
Packs a message depending on the selected mode into a newly allocated envelope.
struct GNUNET_CONTAINER_MultiPeerMap * tunnels
Here is the call graph for this function:
Here is the caller graph for this function:

◆ forward_room_message()

void forward_room_message ( struct GNUNET_MESSENGER_SrvRoom room,
struct GNUNET_MESSENGER_SrvTunnel tunnel,
const 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.

Parameters
roomRoom
tunnelTunnel
messageMessage
hashHash of message

Definition at line 614 of file gnunet-service-messenger_room.c.

References copy_message(), GNUNET_MESSENGER_ClosureSendRoom::exclude, 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, GNUNET_MESSENGER_SrvTunnelFinder::tunnel, and GNUNET_MESSENGER_SrvRoom::tunnels.

Referenced by callback_room_recv().

616 {
617  struct GNUNET_MESSENGER_ClosureSendRoom closure;
618  struct GNUNET_HashCode message_hash;
619 
620  GNUNET_memcpy(&message_hash, hash, sizeof(struct GNUNET_HashCode));
621 
622  closure.room = room;
623  closure.handle = NULL;
624  closure.exclude = tunnel;
625  closure.message = copy_message (message);
626  closure.hash = &message_hash;
627  closure.packed = GNUNET_YES;
628 
630 }
static int iterate_send_room_message(void *cls, const struct GNUNET_PeerIdentity *key, void *value)
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
A 512-bit hashcode.
struct GNUNET_MESSENGER_Message * copy_message(const struct GNUNET_MESSENGER_Message *message)
Creates and allocates a copy of a given message.
int GNUNET_CONTAINER_multipeermap_iterate(struct GNUNET_CONTAINER_MultiPeerMap *map, GNUNET_CONTAINER_PeerMapIterator it, void *it_cls)
Iterate over all entries in the map.
struct GNUNET_CONTAINER_MultiPeerMap * tunnels
Here is the call graph for this function:
Here is the caller graph for this function:

◆ merge_room_last_messages()

void merge_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.

Parameters
roomRoom
handleHandle

Definition at line 633 of file gnunet-service-messenger_room.c.

References create_message_merge(), destroy_message(), GNUNET_CONTAINER_DLL_remove, GNUNET_MESSENGER_ListMessage::hash, GNUNET_MESSENGER_ListMessages::head, GNUNET_MESSENGER_SrvRoom::last_messages, GNUNET_MESSENGER_ListMessage::prev, send_room_message(), and GNUNET_MESSENGER_ListMessages::tail.

Referenced by destroy_room(), idle_request_room_messages(), and send_room_info().

634 {
635  if (!handle)
636  return;
637 
638  if (!room->last_messages.head)
639  return;
640 
641  while (room->last_messages.head != room->last_messages.tail)
642  {
643  struct GNUNET_MESSENGER_ListMessage *element = room->last_messages.tail;
644 
645  struct GNUNET_MESSENGER_Message *message = create_message_merge (&(element->hash));
646 
647  if (message)
648  {
649  struct GNUNET_HashCode hash;
650 
651  send_room_message (room, handle, message, &hash);
652  destroy_message (message);
653  }
654 
655  if (element->prev)
657  }
658 }
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
void destroy_message(struct GNUNET_MESSENGER_Message *message)
Destroys a message and frees its memory fully.
struct GNUNET_MESSENGER_ListMessage * head
struct GNUNET_MESSENGER_ListMessage * prev
struct GNUNET_MESSENGER_ListMessages last_messages
struct GNUNET_MESSENGER_Message * create_message_merge(const struct GNUNET_HashCode *previous)
Creates and allocates a new merge message containing the hash of a second previous message besides th...
A 512-bit hashcode.
struct GNUNET_MESSENGER_ListMessage * tail
void send_room_message(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, struct GNUNET_MESSENGER_Message *message, struct GNUNET_HashCode *hash)
Sends a message from a given handle into a room.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_room_cadet()

struct GNUNET_CADET_Handle* get_room_cadet ( struct GNUNET_MESSENGER_SrvRoom room)

Returns the CADET handle from a rooms service.

Parameters
roomRoom
Returns
CADET handle

Definition at line 661 of file gnunet-service-messenger_room.c.

References GNUNET_MESSENGER_Service::cadet, and GNUNET_MESSENGER_SrvRoom::service.

Referenced by connect_tunnel(), and open_room().

662 {
663  return room->service->cadet;
664 }
struct GNUNET_CADET_Handle * cadet
struct GNUNET_MESSENGER_Service * service
Here is the caller graph for this function:

◆ get_room_key()

struct GNUNET_HashCode* get_room_key ( struct GNUNET_MESSENGER_SrvRoom room)

Returns the shared secret you need to access a room.

Parameters
roomRoom
Returns
Shared secret

Definition at line 667 of file gnunet-service-messenger_room.c.

References GNUNET_MESSENGER_SrvRoom::key.

Referenced by connect_tunnel(), join_room(), and open_room().

668 {
669  return &(room->key);
670 }
Here is the caller graph for this function:

◆ get_room_tunnel()

const struct GNUNET_MESSENGER_SrvTunnel* get_room_tunnel ( 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.

Parameters
roomRoom
peerPeer identity
Returns
Tunnel or NULL

Definition at line 673 of file gnunet-service-messenger_room.c.

References GNUNET_CONTAINER_multipeermap_get(), and GNUNET_MESSENGER_SrvRoom::tunnels.

674 {
675  return GNUNET_CONTAINER_multipeermap_get (room->tunnels, peer);
676 }
void * GNUNET_CONTAINER_multipeermap_get(const struct GNUNET_CONTAINER_MultiPeerMap *map, const struct GNUNET_PeerIdentity *key)
Given a key find a value in the map matching the key.
struct GNUNET_CONTAINER_MultiPeerMap * tunnels
Here is the call graph for this function:

◆ get_room_message()

const struct GNUNET_MESSENGER_Message* get_room_message ( struct GNUNET_MESSENGER_SrvRoom room,
struct GNUNET_MESSENGER_SrvHandle handle,
const struct GNUNET_HashCode hash,
int  request 
)

Returns a message from a room identified by a given hash.

If no matching message is found and request is set to GNUNET_YES, the handle will request the missing message automatically.

The function uses the optimized check for a message via its hash from the message store.

See also
contains_store_message()

If a message is missing independent of the following request, NULL gets returned instead of the matching message.

Parameters
roomRoom
handleHandle
hashHash of message
requestFlag to request a message
Returns
Message or NULL

Definition at line 679 of file gnunet-service-messenger_room.c.

References create_message_request(), destroy_message(), get_store_message(), GNUNET_CONTAINER_multihashmap_contains(), GNUNET_CONTAINER_multihashmap_put(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST, GNUNET_NO, GNUNET_OK, GNUNET_YES, GNUNET_MESSENGER_SrvRoom::requested, send_room_message(), and GNUNET_MESSENGER_SrvRoom::store.

Referenced by callback_room_sent(), entry_room_at(), GNUNET_MESSENGER_get_message(), handle_get_message(), handle_room_messages(), iterate_send_member_infos(), load_service_room_and_messages(), recv_message_join(), recv_message_request(), search_room_for_message(), and send_message_join().

681 {
682  const struct GNUNET_MESSENGER_Message *message = get_store_message (&(room->store), hash);
683 
684  if ((message) || (!handle) || (GNUNET_YES != request)
686  return message;
687 
688  struct GNUNET_MESSENGER_Message *request_msg = create_message_request (hash);
689 
690  if (request_msg)
691  {
693  {
694  struct GNUNET_HashCode request_hash;
695 
696  send_room_message (room, handle, request_msg, &request_hash);
697  }
698 
699  destroy_message (request_msg);
700  }
701 
702  return message;
703 }
void destroy_message(struct GNUNET_MESSENGER_Message *message)
Destroys a message and frees its memory fully.
static struct GNUNET_VPN_RedirectionRequest * request
Opaque redirection request handle.
Definition: gnunet-vpn.c:41
int GNUNET_CONTAINER_multihashmap_contains(const struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key)
Check if the map contains any value under the given key (including values that are NULL)...
, ' bother checking if a value already exists (faster than GNUNET_CONTAINER_MULTIHASHMAPOPTION_...
struct GNUNET_MESSENGER_Message * create_message_request(const struct GNUNET_HashCode *hash)
Creates and allocates a new request message containing the hash of a missing message.
A 512-bit hashcode.
const struct GNUNET_MESSENGER_Message * get_store_message(struct GNUNET_MESSENGER_MessageStore *store, const struct GNUNET_HashCode *hash)
Returns the message from a message store matching a given hash.
void send_room_message(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, struct GNUNET_MESSENGER_Message *message, struct GNUNET_HashCode *hash)
Sends a message from a given handle into a room.
int GNUNET_CONTAINER_multihashmap_put(struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt)
Store a key-value pair in the map.
struct GNUNET_CONTAINER_MultiHashMap * requested
struct GNUNET_MESSENGER_MessageStore store
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_room_last_messages()

void update_room_last_messages ( struct GNUNET_MESSENGER_SrvRoom room,
const struct GNUNET_MESSENGER_Message message,
const struct GNUNET_HashCode hash 
)

Updates the last messages of a room by replacing them if the previous hash of a given message matches with one of the latest messages.

Parameters
roomRoom
messageMessage
hashHash of message

Definition at line 805 of file gnunet-service-messenger_room.c.

References add_to_list_messages(), GNUNET_MESSENGER_Message::body, GNUNET_CONTAINER_DLL_remove, GNUNET_CONTAINER_multihashmap_contains(), GNUNET_CONTAINER_multihashmap_remove_all(), GNUNET_CRYPTO_hash_cmp(), GNUNET_memcpy, GNUNET_MESSENGER_KIND_MERGE, GNUNET_YES, GNUNET_MESSENGER_ListMessage::hash, GNUNET_MESSENGER_ListMessages::head, GNUNET_MESSENGER_Message::header, GNUNET_MESSENGER_MessageHeader::kind, GNUNET_MESSENGER_SrvRoom::last_messages, GNUNET_MESSENGER_MessageBody::merge, GNUNET_MESSENGER_ListMessage::next, GNUNET_MESSENGER_MessageMerge::previous, GNUNET_MESSENGER_MessageHeader::previous, GNUNET_MESSENGER_SrvRoom::requested, and GNUNET_MESSENGER_ListMessages::tail.

Referenced by callback_room_recv(), callback_room_sent(), and load_service_room_and_messages().

807 {
808  struct GNUNET_MESSENGER_ListMessage *element = room->last_messages.head;
809  struct GNUNET_MESSENGER_ListMessage *merging = NULL;
810 
811  if (GNUNET_MESSENGER_KIND_MERGE == message->header.kind)
812  {
813  merging = room->last_messages.head;
814 
815  while (merging)
816  {
817  if (0 == GNUNET_CRYPTO_hash_cmp (&(merging->hash), &(message->body.merge.previous)))
818  break;
819 
820  merging = merging->next;
821  }
822 
823  if (merging)
824  element = merging->next;
825  }
826 
827  while (element)
828  {
829  if (0 == GNUNET_CRYPTO_hash_cmp (&(element->hash), &(message->header.previous)))
830  break;
831 
832  element = element->next;
833  }
834 
835  if ((merging) && (!element))
836  {
837  element = merging;
838  merging = NULL;
839  }
840 
841  if (element)
842  {
843  GNUNET_memcpy(&(element->hash), hash, sizeof(struct GNUNET_HashCode));
844 
845  if (merging)
847  }
848  else
849  add_to_list_messages (&(room->last_messages), hash);
850 
853 }
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
struct GNUNET_MESSENGER_MessageHeader header
Header.
struct GNUNET_MESSENGER_ListMessage * next
struct GNUNET_MESSENGER_ListMessage * head
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
int GNUNET_CONTAINER_multihashmap_remove_all(struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key)
Remove all entries for the given key from the map.
int GNUNET_CONTAINER_multihashmap_contains(const struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key)
Check if the map contains any value under the given key (including values that are NULL)...
struct GNUNET_MESSENGER_ListMessages last_messages
struct GNUNET_HashCode previous
The hash of a second previous message.
void add_to_list_messages(struct GNUNET_MESSENGER_ListMessages *messages, const struct GNUNET_HashCode *hash)
Adds a specific hash from a message to the end of the list.
struct GNUNET_MESSENGER_MessageBody body
Body.
struct GNUNET_MESSENGER_MessageMerge merge
A 512-bit hashcode.
struct GNUNET_HashCode previous
The hash of the previous message from the senders perspective.
struct GNUNET_MESSENGER_ListMessage * tail
int GNUNET_CRYPTO_hash_cmp(const struct GNUNET_HashCode *h1, const struct GNUNET_HashCode *h2)
Compare function for HashCodes, producing a total ordering of all hashcodes.
Definition: crypto_hash.c:311
struct GNUNET_CONTAINER_MultiHashMap * requested
enum GNUNET_MESSENGER_MessageKind kind
The kind of the message.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ switch_room_member_id()

void switch_room_member_id ( struct GNUNET_MESSENGER_SrvRoom room,
const struct GNUNET_ShortHashCode old_id,
const struct GNUNET_ShortHashCode new_id,
const struct GNUNET_HashCode hash 
)

Changes an id of a current member from an old id to a new one and adds optionally the hash of an id message to the members information.

Parameters
roomRoom
old_idOld member id
new_idNew member id
hashHash of id message

Definition at line 856 of file gnunet-service-messenger_room.c.

References add_to_list_messages(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST, GNUNET_CONTAINER_multishortmap_get(), GNUNET_CONTAINER_multishortmap_put(), GNUNET_CONTAINER_multishortmap_remove(), GNUNET_YES, GNUNET_MESSENGER_SrvRoom::member_infos, GNUNET_MESSENGER_SrvRoom::members, and GNUNET_MESSENGER_MemberInfo::session_messages.

Referenced by handle_message_id(), and recv_message_info().

858 {
860 
861  if ((contact) && (GNUNET_YES == GNUNET_CONTAINER_multishortmap_remove (room->members, old_id, contact)))
862  GNUNET_CONTAINER_multishortmap_put (room->members, new_id, contact,
864 
866 
867  if ((!info) || (GNUNET_YES != GNUNET_CONTAINER_multishortmap_remove (room->member_infos, old_id, contact))
868  || (GNUNET_YES != GNUNET_CONTAINER_multishortmap_put (room->member_infos, new_id, contact,
870  return;
871 
872  if (hash)
873  add_to_list_messages (&(info->session_messages), hash);
874 }
int GNUNET_CONTAINER_multishortmap_remove(struct GNUNET_CONTAINER_MultiShortmap *map, const struct GNUNET_ShortHashCode *key, const void *value)
Remove the given key-value pair from the map.
struct GNUNET_CONTAINER_MultiShortmap * member_infos
, ' bother checking if a value already exists (faster than GNUNET_CONTAINER_MULTIHASHMAPOPTION_...
void add_to_list_messages(struct GNUNET_MESSENGER_ListMessages *messages, const struct GNUNET_HashCode *hash)
Adds a specific hash from a message to the end of the list.
int GNUNET_CONTAINER_multishortmap_put(struct GNUNET_CONTAINER_MultiShortmap *map, const struct GNUNET_ShortHashCode *key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt)
Store a key-value pair in the map.
struct GNUNET_CONTAINER_MultiShortmap * members
void * GNUNET_CONTAINER_multishortmap_get(const struct GNUNET_CONTAINER_MultiShortmap *map, const struct GNUNET_ShortHashCode *key)
Given a key find a value in the map matching the key.
struct GNUNET_MESSENGER_ListMessages session_messages
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rebuild_room_basement_structure()

void rebuild_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.

Parameters
roomRoom

Definition at line 877 of file gnunet-service-messenger_room.c.

References GNUNET_MESSENGER_SrvRoom::basement, connect_tunnel(), count_of_tunnels(), disconnect_tunnel(), find_list_tunnels(), get_service_peer_identity(), GNUNET_CONTAINER_multipeermap_get(), GNUNET_OK, GNUNET_PEER_resolve(), GNUNET_SYSERR, GNUNET_YES, GNUNET_MESSENGER_ListTunnels::head, GNUNET_MESSENGER_ListTunnel::next, GNUNET_MESSENGER_ListTunnel::peer, remove_from_list_tunnels(), required_connection_between(), GNUNET_MESSENGER_SrvRoom::service, GNUNET_MESSENGER_SrvTunnelFinder::tunnel, and GNUNET_MESSENGER_SrvRoom::tunnels.

Referenced by handle_message_miss(), and handle_message_peer().

878 {
879  struct GNUNET_PeerIdentity peer;
880  size_t src;
881 
882  if ((GNUNET_OK != get_service_peer_identity (room->service, &peer)) || (!find_list_tunnels (&(room->basement), &peer,
883  &src)))
884  return;
885 
886  size_t count = count_of_tunnels (&(room->basement));
887 
888  struct GNUNET_MESSENGER_ListTunnel *element = room->basement.head;
889  struct GNUNET_MESSENGER_SrvTunnel *tunnel;
890 
891  size_t dst = 0;
892 
893  while (element)
894  {
895  GNUNET_PEER_resolve (element->peer, &peer);
896 
898 
899  if (!tunnel)
900  {
901  element = remove_from_list_tunnels (&(room->basement), element);
902  continue;
903  }
904 
905  if (GNUNET_YES == required_connection_between (count, src, dst))
906  {
907  if (GNUNET_SYSERR == connect_tunnel (tunnel))
908  {
909  element = remove_from_list_tunnels (&(room->basement), element);
910  continue;
911  }
912  }
913  else
914  disconnect_tunnel (tunnel);
915 
916  element = element->next;
917  dst++;
918  }
919 }
int get_service_peer_identity(const struct GNUNET_MESSENGER_Service *service, struct GNUNET_PeerIdentity *peer)
Tries to write the peer identity of the peer running a service on to the peer parameter.
struct GNUNET_MESSENGER_ListTunnel * head
int connect_tunnel(struct GNUNET_MESSENGER_SrvTunnel *tunnel)
Tries to connect a tunnel by creating a new CADET channel and binding it.
struct GNUNET_MESSENGER_ListTunnel * next
void GNUNET_PEER_resolve(GNUNET_PEER_Id id, struct GNUNET_PeerIdentity *pid)
Convert an interned PID to a normal peer identity.
Definition: peer.c:225
int required_connection_between(size_t count, size_t src, size_t dst)
Returns GNUNET_YES or GNUNET_NO to determine if the peers of index src and index dst should be connec...
struct GNUNET_MESSENGER_Service * service
size_t count_of_tunnels(const struct GNUNET_MESSENGER_ListTunnels *tunnels)
Returns the count of peers in a list (typically from the basement of a room).
struct GNUNET_TESTBED_Peer * peer
The peer associated with this model.
The identity of the host (wraps the signing key of the peer).
struct GNUNET_MESSENGER_ListTunnels basement
void * GNUNET_CONTAINER_multipeermap_get(const struct GNUNET_CONTAINER_MultiPeerMap *map, const struct GNUNET_PeerIdentity *key)
Given a key find a value in the map matching the key.
void disconnect_tunnel(struct GNUNET_MESSENGER_SrvTunnel *tunnel)
Disconnects and unbinds a channel from a tunnel.
struct GNUNET_MESSENGER_ListTunnel * find_list_tunnels(struct GNUNET_MESSENGER_ListTunnels *tunnels, const struct GNUNET_PeerIdentity *peer, size_t *index)
Searches linearly through the list of tunnels peer identities for matching a specific peer identity a...
struct GNUNET_CONTAINER_MultiPeerMap * tunnels
struct GNUNET_MESSENGER_ListTunnel * remove_from_list_tunnels(struct GNUNET_MESSENGER_ListTunnels *tunnels, struct GNUNET_MESSENGER_ListTunnel *element)
Removes a specific element from the list of tunnels peer identities and returns the next element in t...
Here is the call graph for this function:
Here is the caller graph for this function:

◆ handle_room_messages()

void handle_room_messages ( struct GNUNET_MESSENGER_SrvRoom room)

Handles all queued up messages of a room to handle in correct order.

Parameters
roomRoom

Definition at line 922 of file gnunet-service-messenger_room.c.

References get_room_message(), GNUNET_CONTAINER_DLL_remove, GNUNET_free, GNUNET_NO, handle_service_message(), GNUNET_MESSENGER_SrvRoom::handling, GNUNET_MESSENGER_ListMessage::hash, GNUNET_MESSENGER_ListMessages::head, GNUNET_MESSENGER_SrvRoom::host, msg, GNUNET_MESSENGER_SrvRoom::service, and GNUNET_MESSENGER_ListMessages::tail.

Referenced by callback_room_recv(), callback_room_sent(), and destroy_room().

923 {
924  while (room->handling.head)
925  {
926  struct GNUNET_MESSENGER_ListMessage *element = room->handling.head;
927 
928  const struct GNUNET_MESSENGER_Message *msg = get_room_message (room, room->host, &(element->hash), GNUNET_NO);
929 
930  if (msg)
931  handle_service_message (room->service, room, msg, &(element->hash));
932 
933  GNUNET_CONTAINER_DLL_remove(room->handling.head, room->handling.tail, element);
934  GNUNET_free(element);
935  }
936 }
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
struct GNUNET_MESSENGER_ListMessage * head
struct GNUNET_MESSENGER_Service * service
struct GNUNET_MESSENGER_ListMessages handling
struct GNUNET_MESSENGER_SrvHandle * host
struct GNUNET_MESSENGER_ListMessage * tail
const struct GNUNET_MESSENGER_Message * get_room_message(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_HashCode *hash, int request)
Returns a message from a room identified by a given hash.
#define GNUNET_free(ptr)
Wrapper around free.
void handle_service_message(struct GNUNET_MESSENGER_Service *service, struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Sends a received or sent message with a given hash to each handle of a service which is currently mem...
Here is the call graph for this function:
Here is the caller graph for this function: