GNUnet  0.20.0
gnunet-service-messenger_service.c File Reference

GNUnet MESSENGER service. More...

Include dependency graph for gnunet-service-messenger_service.c:

Go to the source code of this file.

Functions

static void callback_shutdown_service (void *cls)
 
struct GNUNET_MESSENGER_Servicecreate_service (const struct GNUNET_CONFIGURATION_Handle *config, struct GNUNET_SERVICE_Handle *service_handle)
 Creates and allocates a new service using a given config and a GNUnet service handle. More...
 
static int iterate_destroy_rooms (void *cls, const struct GNUNET_HashCode *key, void *value)
 
void destroy_service (struct GNUNET_MESSENGER_Service *service)
 Destroys a service and frees its memory fully. More...
 
struct GNUNET_MESSENGER_EgoStoreget_service_ego_store (struct GNUNET_MESSENGER_Service *service)
 Returns the used EGO-store of a given service. More...
 
struct GNUNET_MESSENGER_ContactStoreget_service_contact_store (struct GNUNET_MESSENGER_Service *service)
 Returns the used contact store of a given service. More...
 
struct GNUNET_MESSENGER_SrvHandleadd_service_handle (struct GNUNET_MESSENGER_Service *service, struct GNUNET_MQ_Handle *mq)
 Creates and adds a new handle to a service using a given message queue. More...
 
void remove_service_handle (struct GNUNET_MESSENGER_Service *service, struct GNUNET_MESSENGER_SrvHandle *handle)
 Removes a handle from a service and destroys it. More...
 
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. More...
 
struct GNUNET_MESSENGER_SrvRoomget_service_room (const struct GNUNET_MESSENGER_Service *service, const struct GNUNET_HashCode *key)
 Returns the room identified by a given key for a service. More...
 
int open_service_room (struct GNUNET_MESSENGER_Service *service, struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_HashCode *key)
 Tries to open a room using a given key for a service by a specific handle. More...
 
int entry_service_room (struct GNUNET_MESSENGER_Service *service, struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_PeerIdentity *door, const struct GNUNET_HashCode *key)
 Tries to enter a room using a given key for a service by a specific handle. More...
 
int close_service_room (struct GNUNET_MESSENGER_Service *service, struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_HashCode *key)
 Tries to close a room using a given key for a service by a specific handle. More...
 
void handle_service_message (struct GNUNET_MESSENGER_Service *service, struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_MESSENGER_MemberSession *session, 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 member of a specific room for handling it in the client API. More...
 

Detailed Description

GNUnet MESSENGER service.

Author
Tobias Frisch

Definition in file gnunet-service-messenger_service.c.

Function Documentation

◆ callback_shutdown_service()

static void callback_shutdown_service ( void *  cls)
static

Definition at line 32 of file gnunet-service-messenger_service.c.

33 {
34  struct GNUNET_MESSENGER_Service *service = cls;
35 
36  if (service)
37  {
38  service->shutdown = NULL;
39 
41  }
42 }
static struct GNUNET_SERVICE_Handle * service
Handle to our service instance.
void destroy_service(struct GNUNET_MESSENGER_Service *service)
Destroys a service and frees its memory fully.

References destroy_service(), and service.

Referenced by create_service().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_service()

struct GNUNET_MESSENGER_Service* create_service ( const struct GNUNET_CONFIGURATION_Handle config,
struct GNUNET_SERVICE_Handle service_handle 
)

Creates and allocates a new service using a given config and a GNUnet service handle.

Parameters
[in]configConfiguration
[in,out]service_handleGNUnet service handle
Returns
New service

Definition at line 45 of file gnunet-service-messenger_service.c.

47 {
48  GNUNET_assert((config) && (service_handle));
49 
51 
52  service->config = config;
53  service->service = service_handle;
54 
56 
57  service->dir = NULL;
58 
61  "MESSENGER_DIR", &(service->dir)))
62  {
63  if (service->dir)
64  GNUNET_free(service->dir);
65 
66  service->dir = NULL;
67  }
68  else
69  {
72  {
73  GNUNET_free(service->dir);
74 
75  service->dir = NULL;
76  }
77  }
78 
79  service->cadet = GNUNET_CADET_connect (service->config);
80 
82 
83  init_list_handles (&(service->handles));
84 
86 
88 
89  return service;
90 }
void init_ego_store(struct GNUNET_MESSENGER_EgoStore *store, const struct GNUNET_CONFIGURATION_Handle *config)
Initializes an EGO-store as fully empty.
void init_list_handles(struct GNUNET_MESSENGER_ListHandles *handles)
Initializes list of handles as empty list.
struct GNUNET_MESSENGER_EgoStore * get_service_ego_store(struct GNUNET_MESSENGER_Service *service)
Returns the used EGO-store of a given service.
static void callback_shutdown_service(void *cls)
struct GNUNET_MESSENGER_ContactStore * get_service_contact_store(struct GNUNET_MESSENGER_Service *service)
Returns the used contact store of a given service.
static const struct GNUNET_CONFIGURATION_Handle * config
struct GNUNET_CADET_Handle * GNUNET_CADET_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the MQ-based cadet service.
Definition: cadet_api.c:894
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_value_filename(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, char **value)
Get a configuration value that should be the name of a file or directory.
enum GNUNET_GenericReturnValue GNUNET_DISK_directory_test(const char *fil, int is_readable)
Test if fil is a directory and listable.
Definition: disk.c:403
enum GNUNET_GenericReturnValue GNUNET_DISK_directory_create(const char *dir)
Implementation of "mkdir -p".
Definition: disk.c:496
struct GNUNET_CONTAINER_MultiHashMap * GNUNET_CONTAINER_multihashmap_create(unsigned int len, int do_not_copy_keys)
Create a multi hash map.
@ GNUNET_OK
@ GNUNET_YES
@ GNUNET_NO
#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.
#define GNUNET_free(ptr)
Wrapper around free.
#define GNUNET_MESSENGER_SERVICE_NAME
Identifier of GNUnet MESSENGER Service.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_shutdown(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run on shutdown, that is when a CTRL-C signal is received,...
Definition: scheduler.c:1334
void init_contact_store(struct GNUNET_MESSENGER_ContactStore *store)
Initializes a contact store as fully empty.

References callback_shutdown_service(), config, get_service_contact_store(), get_service_ego_store(), GNUNET_assert, GNUNET_CADET_connect(), GNUNET_CONFIGURATION_get_value_filename(), GNUNET_CONTAINER_multihashmap_create(), GNUNET_DISK_directory_create(), GNUNET_DISK_directory_test(), GNUNET_free, GNUNET_MESSENGER_SERVICE_NAME, GNUNET_new, GNUNET_NO, GNUNET_OK, GNUNET_SCHEDULER_add_shutdown(), GNUNET_YES, init_contact_store(), init_ego_store(), init_list_handles(), and service.

Referenced by run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ iterate_destroy_rooms()

static int iterate_destroy_rooms ( void *  cls,
const struct GNUNET_HashCode key,
void *  value 
)
static

Definition at line 93 of file gnunet-service-messenger_service.c.

96 {
97  struct GNUNET_MESSENGER_SrvRoom *room = value;
99  return GNUNET_YES;
100 }
static char * value
Value of the record to add/remove.
void destroy_srv_room(struct GNUNET_MESSENGER_SrvRoom *room, int deletion)
Destroys a room and frees its memory fully.

References destroy_srv_room(), GNUNET_NO, GNUNET_YES, and value.

Referenced by destroy_service().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ destroy_service()

void destroy_service ( struct GNUNET_MESSENGER_Service service)

Destroys a service and frees its memory fully.

Parameters
[in,out]serviceService

Definition at line 103 of file gnunet-service-messenger_service.c.

104 {
106 
107  if (service->shutdown)
108  {
109  GNUNET_SCHEDULER_cancel (service->shutdown);
110 
111  service->shutdown = NULL;
112  }
113 
115  clear_list_handles (&(service->handles));
116 
119 
121 
122  if (service->cadet)
123  {
125 
126  service->cadet = NULL;
127  }
128 
129  if (service->dir)
130  {
131  GNUNET_free(service->dir);
132 
133  service->dir = NULL;
134  }
135 
136  GNUNET_SERVICE_shutdown (service->service);
137 
139 }
void clear_ego_store(struct GNUNET_MESSENGER_EgoStore *store)
Clears an EGO-store, wipes its content and deallocates its memory.
void clear_list_handles(struct GNUNET_MESSENGER_ListHandles *handles)
Destroys remaining handles and clears the list.
static int iterate_destroy_rooms(void *cls, const struct GNUNET_HashCode *key, void *value)
void GNUNET_CADET_disconnect(struct GNUNET_CADET_Handle *handle)
Disconnect from the cadet service.
Definition: cadet_api.c:774
void GNUNET_CONTAINER_multihashmap_destroy(struct GNUNET_CONTAINER_MultiHashMap *map)
Destroy a hash map.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multihashmap_iterate(struct GNUNET_CONTAINER_MultiHashMap *map, GNUNET_CONTAINER_MultiHashMapIteratorCallback it, void *it_cls)
Iterate over all entries in the map.
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
Definition: scheduler.c:975
void GNUNET_SERVICE_shutdown(struct GNUNET_SERVICE_Handle *sh)
Explicitly stops the service.
Definition: service.c:2389
void clear_contact_store(struct GNUNET_MESSENGER_ContactStore *store)
Clears a contact store, wipes its content and deallocates its memory.

References clear_contact_store(), clear_ego_store(), clear_list_handles(), get_service_contact_store(), get_service_ego_store(), GNUNET_assert, GNUNET_CADET_disconnect(), GNUNET_CONTAINER_multihashmap_destroy(), GNUNET_CONTAINER_multihashmap_iterate(), GNUNET_free, GNUNET_SCHEDULER_cancel(), GNUNET_SERVICE_shutdown(), iterate_destroy_rooms(), and service.

Referenced by callback_shutdown_service().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_service_ego_store()

struct GNUNET_MESSENGER_EgoStore* get_service_ego_store ( struct GNUNET_MESSENGER_Service service)

Returns the used EGO-store of a given service.

Parameters
[in,out]serviceService
Returns
EGO-store

Definition at line 142 of file gnunet-service-messenger_service.c.

143 {
145 
146  return &(service->ego_store);
147 }

References GNUNET_assert, and service.

Referenced by callback_set_handle_name(), callback_update_handle(), create_service(), destroy_service(), destroy_srv_handle(), set_srv_handle_name(), setup_srv_handle_name(), and update_srv_handle().

Here is the caller graph for this function:

◆ get_service_contact_store()

struct GNUNET_MESSENGER_ContactStore* get_service_contact_store ( struct GNUNET_MESSENGER_Service service)

Returns the used contact store of a given service.

Parameters
[in,out]serviceService
Returns
Contact store

Definition at line 150 of file gnunet-service-messenger_service.c.

151 {
153 
154  return &(service->contact_store);
155 }

References GNUNET_assert, and service.

Referenced by create_service(), destroy_service(), and get_member_contact_store().

Here is the caller graph for this function:

◆ add_service_handle()

struct GNUNET_MESSENGER_SrvHandle* add_service_handle ( struct GNUNET_MESSENGER_Service service,
struct GNUNET_MQ_Handle mq 
)

Creates and adds a new handle to a service using a given message queue.

Parameters
[in,out]serviceService
[in,out]mqMessage queue
Returns
New handle

Definition at line 158 of file gnunet-service-messenger_service.c.

160 {
161  GNUNET_assert((service) && (mq));
162 
164 
165  if (handle)
166  {
167  add_list_handle (&(service->handles), handle);
168  }
169 
170  return handle;
171 }
struct GNUNET_MQ_Handle * mq
Definition: 003.c:5
static struct GNUNET_DNS_Handle * handle
Handle to transport service.
struct GNUNET_MESSENGER_SrvHandle * create_srv_handle(struct GNUNET_MESSENGER_Service *service, struct GNUNET_MQ_Handle *mq)
Creates and allocates a new handle related to a service and using a given mq (message queue).
void add_list_handle(struct GNUNET_MESSENGER_ListHandles *handles, struct GNUNET_MESSENGER_SrvHandle *handle)
Adds a specific handle to the end of the list.

References add_list_handle(), create_srv_handle(), GNUNET_assert, handle, mq, and service.

Referenced by callback_client_connect().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ remove_service_handle()

void remove_service_handle ( struct GNUNET_MESSENGER_Service service,
struct GNUNET_MESSENGER_SrvHandle handle 
)

Removes a handle from a service and destroys it.

Parameters
[in,out]serviceService
[in,out]handleHandle

Definition at line 174 of file gnunet-service-messenger_service.c.

176 {
177  GNUNET_assert((service) && (handle));
178 
179  if (!handle)
180  return;
181 
182  if (GNUNET_YES == remove_list_handle (&(service->handles), handle))
184 }
void destroy_srv_handle(struct GNUNET_MESSENGER_SrvHandle *handle)
Destroys a handle and frees its memory fully.
int remove_list_handle(struct GNUNET_MESSENGER_ListHandles *handles, struct GNUNET_MESSENGER_SrvHandle *handle)
Removes the first entry matching with a specific handle from the list of handles and returns GNUNET_Y...

References destroy_srv_handle(), GNUNET_assert, GNUNET_YES, handle, remove_list_handle(), and service.

Referenced by callback_client_disconnect().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_service_peer_identity()

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.

The functions returns GNUNET_OK on success, otherwise GNUNET_SYSERR.

Parameters
[in]serviceService
[out]peerPeer identity
Returns
GNUNET_OK on success, otherwise GNUNET_SYSERR

Definition at line 187 of file gnunet-service-messenger_service.c.

189 {
190  GNUNET_assert((service) && (peer));
191 
192  return GNUNET_CRYPTO_get_peer_identity (service->config, peer);
193 }
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_get_peer_identity(const struct GNUNET_CONFIGURATION_Handle *cfg, struct GNUNET_PeerIdentity *dst)
Retrieve the identity of the host's peer.
struct GNUNET_TESTBED_Peer * peer
The peer associated with this model.

References GNUNET_assert, GNUNET_CRYPTO_get_peer_identity(), peer, and service.

Referenced by create_message_peer(), enter_srv_room_at(), and rebuild_srv_room_basement_structure().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_service_room()

struct GNUNET_MESSENGER_SrvRoom* get_service_room ( const struct GNUNET_MESSENGER_Service service,
const struct GNUNET_HashCode key 
)

Returns the room identified by a given key for a service.

If the service doesn't know any room using the given key, NULL gets returned.

Parameters
[in]serviceService
[in]keyKey of room
Returns
Room or NULL

Definition at line 196 of file gnunet-service-messenger_service.c.

198 {
199  GNUNET_assert((service) && (key));
200 
202 }
struct GNUNET_HashCode key
The key used in the DHT.
void * GNUNET_CONTAINER_multihashmap_get(const struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key)
Given a key find a value in the map matching the key.

References GNUNET_assert, GNUNET_CONTAINER_multihashmap_get(), key, and service.

Referenced by close_service_room(), entry_service_room(), handle_get_message(), open_service_room(), and send_srv_handle_message().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ open_service_room()

int open_service_room ( struct GNUNET_MESSENGER_Service service,
struct GNUNET_MESSENGER_SrvHandle handle,
const struct GNUNET_HashCode key 
)

Tries to open a room using a given key for a service by a specific handle.

The room will be created if necessary. If the function is successful, it returns GNUNET_YES, otherwise GNUNET_NO.

Parameters
[in,out]serviceService
[in,out]handleHandle
[in]keyKey of room
Returns
GNUNET_YES on success, otherwise GNUNET_NO

Definition at line 205 of file gnunet-service-messenger_service.c.

208 {
209  GNUNET_assert((service) && (handle) && (key));
210 
212 
213  if (room)
214  return open_srv_room (room, handle);
215 
216  room = create_srv_room (handle, key);
217 
218  if ((GNUNET_YES == open_srv_room (room, handle)) &&
220  key, room,
222  return GNUNET_YES;
223 
225  return GNUNET_NO;
226 }
int open_srv_room(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle)
Tries to open a room for a given handle.
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.
struct GNUNET_MESSENGER_SrvRoom * get_service_room(const struct GNUNET_MESSENGER_Service *service, const struct GNUNET_HashCode *key)
Returns the room identified by a given key for a service.
enum GNUNET_GenericReturnValue 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.
@ GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST
, ' bother checking if a value already exists (faster than GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE...

References create_srv_room(), destroy_srv_room(), get_service_room(), GNUNET_assert, GNUNET_CONTAINER_multihashmap_put(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST, GNUNET_NO, GNUNET_OK, GNUNET_YES, handle, key, open_srv_room(), and service.

Referenced by open_srv_handle_room().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ entry_service_room()

int entry_service_room ( struct GNUNET_MESSENGER_Service service,
struct GNUNET_MESSENGER_SrvHandle handle,
const struct GNUNET_PeerIdentity door,
const struct GNUNET_HashCode key 
)

Tries to enter a room using a given key for a service by a specific handle.

The room will be created if necessary. If the function is successful, it returns GNUNET_YES, otherwise GNUNET_NO.

The room will be entered through the peer identitied by the peer identity provided as door parameter and a new connection will be made.

Parameters
[in,out]serviceService
[in,out]handleHandle
[in]doorPeer identity
[in]keyKey of room
Returns
GNUNET_YES on success, otherwise GNUNET_NO

Definition at line 229 of file gnunet-service-messenger_service.c.

233 {
234  GNUNET_assert((service) && (handle) && (door) && (key));
235 
237 
238  if (room)
239  {
240  if (GNUNET_YES == enter_srv_room_at (room, handle, door))
241  return GNUNET_YES;
242  else
243  return GNUNET_NO;
244  }
245 
246  room = create_srv_room (handle, key);
247 
248  if ((GNUNET_YES == enter_srv_room_at (room, handle, door)) &&
250  key, room,
252  {
253  return GNUNET_YES;
254  }
255  else
256  {
258  return GNUNET_NO;
259  }
260 
261 }
int 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...

References create_srv_room(), destroy_srv_room(), enter_srv_room_at(), get_service_room(), GNUNET_assert, GNUNET_CONTAINER_multihashmap_put(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST, GNUNET_NO, GNUNET_OK, GNUNET_YES, handle, key, and service.

Referenced by entry_srv_handle_room().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ close_service_room()

int close_service_room ( struct GNUNET_MESSENGER_Service service,
struct GNUNET_MESSENGER_SrvHandle handle,
const struct GNUNET_HashCode key 
)

Tries to close a room using a given key for a service by a specific handle.

The room will be created if necessary. If the function is successful, it returns GNUNET_YES, otherwise GNUNET_NO.

If the specific handle is currently the host of the room for this service, a new handle which is a member will take its place. Otherwise the room will be destroyed for this service.

Parameters
[in,out]serviceService
[in,out]handleHandle
[in]keyKey of room
Returns
GNUNET_YES on success, otherwise GNUNET_NO

Definition at line 264 of file gnunet-service-messenger_service.c.

267 {
268  GNUNET_assert((service) && (handle) && (key));
269 
271 
272  if (!room)
273  return GNUNET_NO;
274 
276 
278 
279  GNUNET_assert(id);
280 
281  if (GNUNET_YES != GNUNET_CONTAINER_multihashmap_remove (handle->member_ids, key, id))
282  return GNUNET_NO;
283 
285  &(service->handles), key);
286 
287  if (!member_handle)
288  {
290  {
292  return GNUNET_YES;
293  }
294  else
295  return GNUNET_NO;
296  }
297 
298  if (room->host == handle)
299  room->host = member_handle;
300 
301  return GNUNET_YES;
302 }
const struct GNUNET_ShortHashCode * get_srv_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_MESSENGER_SrvHandle * find_list_handle_by_member(const struct GNUNET_MESSENGER_ListHandles *handles, const struct GNUNET_HashCode *key)
Searches linearly through the list of handles for members of a specific room which is identified by a...
struct GNUNET_MESSENGER_Message * create_message_leave()
Creates and allocates a new leave message.
int 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.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multihashmap_remove(struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key, const void *value)
Remove the given key-value pair from the map.
struct GNUNET_MESSENGER_SrvHandle * host
A 256-bit hashcode.

References create_message_leave(), destroy_srv_room(), find_list_handle_by_member(), get_service_room(), get_srv_handle_member_id(), GNUNET_assert, GNUNET_CONTAINER_multihashmap_remove(), GNUNET_NO, GNUNET_OK, GNUNET_YES, handle, GNUNET_MESSENGER_SrvRoom::host, key, send_srv_room_message(), and service.

Referenced by close_srv_handle_room().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handle_service_message()

void handle_service_message ( struct GNUNET_MESSENGER_Service service,
struct GNUNET_MESSENGER_SrvRoom room,
const struct GNUNET_MESSENGER_MemberSession session,
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 member of a specific room for handling it in the client API.

Parameters
[in,out]serviceService
[in,out]roomRoom
[in]sessionMember session
[in]messageMessage
[in]hashHash of message

Definition at line 305 of file gnunet-service-messenger_service.c.

310 {
311  GNUNET_assert((service) && (room) && (session) && (message) && (hash));
312 
313  struct GNUNET_MESSENGER_ListHandle *element = service->handles.head;
314 
315  while (element)
316  {
317  notify_srv_handle_message (element->handle, room, session, message, hash);
318  element = element->next;
319  }
320 }
void notify_srv_handle_message(struct GNUNET_MESSENGER_SrvHandle *handle, struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_MESSENGER_MemberSession *session, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Notifies the handle that a new message was received or sent.
struct GNUNET_MESSENGER_ListHandle * next
struct GNUNET_MESSENGER_SrvHandle * handle

References GNUNET_assert, GNUNET_MESSENGER_ListHandle::handle, GNUNET_MESSENGER_ListHandle::next, notify_srv_handle_message(), and service.

Referenced by handle_room_messages().

Here is the call graph for this function:
Here is the caller graph for this function: