GNUnet debian-0.24.3-23-g589b01d60
gnunet-service-messenger_service.c
Go to the documentation of this file.
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2020--2025 GNUnet e.V.
4
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 SPDX-License-Identifier: AGPL3.0-or-later
19 */
27
30
31#include "gnunet_common.h"
32#include "messenger_api_util.h"
33
34static void
36{
38
39 service = cls;
40
41 if (service)
42 {
43 service->shutdown = NULL;
44
46 }
47}
48
49
52 struct GNUNET_SERVICE_Handle *service_handle)
53{
55
56 GNUNET_assert ((config) && (service_handle));
57
58 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Create new service!\n");
59
61
62 service->config = config;
63 service->service = service_handle;
64
66 service);
67
68 service->peer = NULL;
69 service->dir = NULL;
70
73 "MESSENGER_DIR",
74 &(service->dir)))
75 {
76 if (service->dir)
77 GNUNET_free (service->dir);
78
79 service->dir = NULL;
80 }
81 else
82 {
85 !=
87 {
88 GNUNET_free (service->dir);
89
90 service->dir = NULL;
91 }
92 }
93
95 service->config,
97 "MESSENGER_AUTO_CONNECTING");
98
100 service->config,
102 "MESSENGER_AUTO_ROUTING");
103
105 service->config,
107 "MESSENGER_GROUP_KEYS");
108
110 service->config,
112 "MESSENGER_LOCAL_REQUEST");
113
116 "MESSENGER_MIN_ROUTERS",
117 &(service->min_routers
118 )))
119 service->min_routers = 0;
120
121 service->cadet = GNUNET_CADET_connect (service->config);
123 service->config);
124
125 init_list_handles (&(service->handles));
126
128
130
131 return service;
132}
133
134
137 const struct GNUNET_HashCode *key,
138 void *value)
139{
140 struct GNUNET_MESSENGER_SrvRoom *room;
141
143
144 room = value;
145
147 return GNUNET_YES;
148}
149
150
151void
153{
155
156 if (service->shutdown)
157 {
159 service->shutdown = NULL;
160 }
161
162 clear_list_handles (&(service->handles));
163
165 NULL);
167
169
170 if (service->cadet)
171 {
173 service->cadet = NULL;
174 }
175
176 if (service->statistics)
177 {
179 GNUNET_YES);
180 service->statistics = NULL;
181 }
182
183 if (service->dir)
184 {
185 GNUNET_free (service->dir);
186 service->dir = NULL;
187 }
188
189 if (service->peer)
190 {
191 GNUNET_free (service->peer);
192 service->peer = NULL;
193 }
194
196 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Free service!\n");
197
199}
200
201
204{
206
207 return &(service->contact_store);
208}
209
210
213 struct GNUNET_MQ_Handle *mq)
214{
216
217 GNUNET_assert ((service) && (mq));
218
220
221 if (handle)
222 {
223 add_list_handle (&(service->handles), handle);
225 "# handles connected",
226 1,
227 GNUNET_NO);
228 }
229
230 return handle;
231}
232
233
234void
237{
239
240 if (! handle)
241 return;
242
243 if (GNUNET_YES == remove_list_handle (&(service->handles), handle))
244 {
247 "# handles connected",
248 -1,
249 GNUNET_NO);
250 }
251}
252
253
256 struct GNUNET_PeerIdentity *peer)
257{
259
260 GNUNET_assert ((service) && (peer));
261
262 if (service->peer)
263 {
264 GNUNET_memcpy (peer, service->peer, sizeof(struct GNUNET_PeerIdentity));
265 return GNUNET_OK;
266 }
267
269
270 if (GNUNET_OK != result)
271 return result;
272
273 if (! service->peer)
274 service->peer = GNUNET_new (struct GNUNET_PeerIdentity);
275
276 GNUNET_memcpy (service->peer, peer, sizeof(struct GNUNET_PeerIdentity));
277 return result;
278}
279
280
283 const struct GNUNET_HashCode *key)
284{
285 GNUNET_assert ((service) && (key));
286
288}
289
290
292{
296};
297
300 const struct GNUNET_CRYPTO_PublicKey *public_key,
301 struct GNUNET_MESSENGER_MemberSession *session)
302{
304 const struct GNUNET_ShortHashCode *id;
305
306 GNUNET_assert ((cls) && (session));
307
308 init = cls;
309
310 if (! public_key)
311 return GNUNET_YES;
312
313 {
314 const struct GNUNET_CRYPTO_PublicKey *pubkey;
315 pubkey = get_srv_handle_key (init->handle);
316
317 if (0 != GNUNET_memcmp (pubkey, public_key))
318 return GNUNET_YES;
319 }
320
321 id = get_member_session_id (session);
322
323 if (! id)
324 {
325 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Initialitation: Missing member id!");
326 return GNUNET_NO;
327 }
328
330 "Initialitation: Matching member found (%s)!\n",
331 GNUNET_sh2s (id));
332
334 return GNUNET_NO;
335}
336
337
338static void
340 struct GNUNET_MESSENGER_SrvRoom *room)
341{
342 struct GNUNET_MESSENGER_MemberStore *store;
343 const struct GNUNET_CRYPTO_PublicKey *pubkey;
344
345 GNUNET_assert ((handle) && (room));
346
347 store = get_srv_room_member_store (room);
348 if (! store)
349 return;
350
352 if ((! pubkey) || (0 == GNUNET_memcmp (pubkey, get_anonymous_public_key ())))
353 return;
354
356 "Initialize member id of handle via matching member in room!\n");
357
358 {
360 init.handle = handle;
361 init.room = room;
362 init.pubkey = pubkey;
363
365 }
366}
367
368
372 const struct GNUNET_HashCode *key)
373{
374 struct GNUNET_MESSENGER_SrvRoom *room;
376
377 GNUNET_assert ((service) && (handle) && (key));
378
379 room = get_service_room (service, key);
380
381 if (room)
382 {
384 result = open_srv_room (room, handle);
385
386 if (GNUNET_YES == result)
388 "# room openings",
389 1,
390 GNUNET_NO);
391 return result;
392 }
393
394 room = create_srv_room (handle, key);
396
397 if ((GNUNET_YES == open_srv_room (room, handle)) &&
399 key, room,
401 {
403 "# room openings",
404 1,
405 GNUNET_NO);
406 GNUNET_STATISTICS_set (service->statistics,
407 "# rooms active",
409 GNUNET_NO);
410 return GNUNET_YES;
411 }
412
414 return GNUNET_NO;
415}
416
417
421 const struct GNUNET_PeerIdentity *door,
422 const struct GNUNET_HashCode *key)
423{
424 struct GNUNET_MESSENGER_SrvRoom *room;
425
426 GNUNET_assert ((service) && (handle) && (door) && (key));
427
428 room = get_service_room (service, key);
429
430 if (room)
431 {
433
434 if (GNUNET_YES == enter_srv_room_at (room, handle, door))
435 {
437 "# room entries",
438 1,
439 GNUNET_NO);
440 return GNUNET_YES;
441 }
442 else
443 return GNUNET_NO;
444 }
445
446 room = create_srv_room (handle, key);
448
449 if ((GNUNET_YES == enter_srv_room_at (room, handle, door)) &&
451 key, room,
453 {
455 "# room entries",
456 1,
457 GNUNET_NO);
458 GNUNET_STATISTICS_set (service->statistics,
459 "# rooms active",
461 GNUNET_NO);
462 return GNUNET_YES;
463 }
464 else
465 {
467 return GNUNET_NO;
468 }
469
470}
471
472
476 const struct GNUNET_HashCode *key,
477 enum GNUNET_GenericReturnValue deletion)
478{
479 struct GNUNET_MESSENGER_SrvRoom *room;
480 struct GNUNET_MESSENGER_SrvHandle *member_handle;
481
482 GNUNET_assert ((service) && (handle) && (key));
483
484 room = get_service_room (service, key);
485
486 if (! room)
487 return GNUNET_NO;
488
489 {
490 struct GNUNET_ShortHashCode *id;
491 id = (struct GNUNET_ShortHashCode*) (
493
494 GNUNET_assert (id);
495
497 key, id))
498 return GNUNET_NO;
499
500 GNUNET_free (id);
501 }
502
503 member_handle = (struct GNUNET_MESSENGER_SrvHandle*) (
504 find_list_handle_by_member (&(service->handles), key));
505
506 if (! member_handle)
507 {
509 room))
510 {
511 destroy_srv_room (room, deletion);
513 "# room closings",
514 1,
515 GNUNET_NO);
516 GNUNET_STATISTICS_set (service->statistics,
517 "# rooms active",
519 ,
520 GNUNET_NO);
521 return GNUNET_YES;
522 }
523 else
524 return GNUNET_NO;
525 }
526
527 if (room->host == handle)
528 {
529 struct GNUNET_MESSENGER_Message *message;
530
531 room->host = member_handle;
532
533 if (! room->peer_message)
534 goto skip_connection_message;
535
536 message = create_message_connection (room);
537
538 if (! message)
540 "Sending connection message failed: %s\n",
541 GNUNET_h2s (&(room->key)));
542 else
543 send_srv_room_message (room, room->host, message);
544 }
545
546skip_connection_message:
548 "# room closings",
549 1,
550 GNUNET_NO);
551
552 return GNUNET_YES;
553}
554
555
556void
558 struct GNUNET_MESSENGER_SrvRoom *room,
559 const struct GNUNET_MESSENGER_SenderSession *session,
560 const struct GNUNET_MESSENGER_Message *message,
561 const struct GNUNET_HashCode *hash,
562 const struct GNUNET_HashCode *epoch,
563 enum GNUNET_GenericReturnValue recent)
564{
565 struct GNUNET_MESSENGER_ListHandle *element;
566
567 GNUNET_assert ((service) && (room) && (session) && (message) && (hash) && (
568 epoch));
569
571 "Notify active clients about message: %s (%s)\n",
573 message->header.kind));
574
575 for (element = service->handles.head; element; element = element->next)
576 {
577 if (! get_srv_handle_member_id (element->handle,
578 get_srv_room_key (room)))
579 continue;
580
581 notify_srv_handle_message (element->handle, room, session, message, hash,
582 epoch, recent);
583 }
584
586 "# message notifications",
587 1,
588 GNUNET_NO);
589}
struct GNUNET_MQ_Handle * mq
Definition: 003.c:5
static char * init
Set to the name of a service to start.
Definition: gnunet-arm.c:73
struct GNUNET_HashCode key
The key used in the DHT.
const struct GNUNET_CONFIGURATION_Handle * config
static struct GNUNET_CRYPTO_PublicKey pubkey
Public key of the zone to look in.
static struct GNUNET_IDENTITY_Handle * id
Handle to IDENTITY.
static char * value
Value of the record to add/remove.
static int result
Global testing status.
static struct GNUNET_SERVICE_Handle * service
Handle to our service instance.
void notify_srv_handle_message(struct GNUNET_MESSENGER_SrvHandle *handle, struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_MESSENGER_SenderSession *session, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash, const struct GNUNET_HashCode *epoch, enum GNUNET_GenericReturnValue recent)
Notifies the handle that a new message was received or sent.
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).
enum GNUNET_GenericReturnValue change_srv_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 and returns GNUNET_OK...
const struct GNUNET_CRYPTO_PublicKey * get_srv_handle_key(const struct GNUNET_MESSENGER_SrvHandle *handle)
Returns the public key of a given handle.
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.
void destroy_srv_handle(struct GNUNET_MESSENGER_SrvHandle *handle)
Destroys a handle and frees its memory fully.
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...
void add_list_handle(struct GNUNET_MESSENGER_ListHandles *handles, struct GNUNET_MESSENGER_SrvHandle *handle)
Adds a specific handle to the end of the list.
void init_list_handles(struct GNUNET_MESSENGER_ListHandles *handles)
Initializes list of handles as empty list.
enum GNUNET_GenericReturnValue 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...
void clear_list_handles(struct GNUNET_MESSENGER_ListHandles *handles)
Destroys remaining handles and clears the list.
const struct GNUNET_ShortHashCode * get_member_session_id(const struct GNUNET_MESSENGER_MemberSession *session)
Returns the member id of a given member session.
int iterate_store_members(struct GNUNET_MESSENGER_MemberStore *store, GNUNET_MESSENGER_MemberIteratorCallback it, void *cls)
Iterate through all member sessions currently connected to the members of the given member store and ...
struct GNUNET_MESSENGER_Message * create_message_connection(const struct GNUNET_MESSENGER_SrvRoom *room)
Creates and allocates a new connection message containing the amount of the peer's connections in a g...
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.
enum GNUNET_GenericReturnValue enter_srv_room_at(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_PeerIdentity *door)
Connects a tunnel to a hosting peer of a room through a so called door which is represented by a peer...
enum GNUNET_GenericReturnValue open_srv_room(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle)
Tries to open a room for a given handle.
void destroy_srv_room(struct GNUNET_MESSENGER_SrvRoom *room, enum GNUNET_GenericReturnValue deletion)
Destroys a room and frees its memory fully.
enum GNUNET_GenericReturnValue send_srv_room_message(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, struct GNUNET_MESSENGER_Message *message)
Sends a message from a given handle into a room.
const struct GNUNET_HashCode * get_srv_room_key(const struct GNUNET_MESSENGER_SrvRoom *room)
Returns the shared secret you need to access a room.
struct GNUNET_MESSENGER_MemberStore * get_srv_room_member_store(struct GNUNET_MESSENGER_SrvRoom *room)
Returns the used member store of a given room.
void remove_service_handle(struct GNUNET_MESSENGER_Service *service, struct GNUNET_MESSENGER_SrvHandle *handle)
Removes a handle from a service and destroys it.
enum GNUNET_GenericReturnValue get_service_peer_identity(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_ContactStore * get_service_contact_store(struct GNUNET_MESSENGER_Service *service)
Returns the used contact store of a given service.
void destroy_service(struct GNUNET_MESSENGER_Service *service)
Destroys a service and frees its memory fully.
static void initialize_service_handle(struct GNUNET_MESSENGER_SrvHandle *handle, struct GNUNET_MESSENGER_SrvRoom *room)
enum GNUNET_GenericReturnValue 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.
enum GNUNET_GenericReturnValue close_service_room(struct GNUNET_MESSENGER_Service *service, struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_HashCode *key, enum GNUNET_GenericReturnValue deletion)
Tries to close a room using a given key for a service by a specific handle.
static void callback_shutdown_service(void *cls)
static enum GNUNET_GenericReturnValue find_member_session_in_room(void *cls, const struct GNUNET_CRYPTO_PublicKey *public_key, struct GNUNET_MESSENGER_MemberSession *session)
void handle_service_message(struct GNUNET_MESSENGER_Service *service, struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_MESSENGER_SenderSession *session, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash, const struct GNUNET_HashCode *epoch, enum GNUNET_GenericReturnValue recent)
Sends a received or sent message with a given hash to each handle of a service which is currently mem...
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.
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.
static enum GNUNET_GenericReturnValue iterate_destroy_rooms(void *cls, const struct GNUNET_HashCode *key, void *value)
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.
enum GNUNET_GenericReturnValue 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.
static struct GNUNET_VPN_Handle * handle
Handle to vpn service.
Definition: gnunet-vpn.c:35
commonly used definitions; globals in this file are exempt from the rule that the module name ("commo...
struct GNUNET_CADET_Handle * GNUNET_CADET_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the MQ-based cadet service.
Definition: cadet_api.c:897
void GNUNET_CADET_disconnect(struct GNUNET_CADET_Handle *handle)
Disconnect from the cadet service.
Definition: cadet_api.c:777
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_CONFIGURATION_get_value_number(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, unsigned long long *number)
Get a configuration value that should be a number.
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_value_yesno(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option)
Get a configuration value that should be in a set of "YES" or "NO".
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.
enum GNUNET_GenericReturnValue GNUNET_DISK_directory_test(const char *fil, int is_readable)
Test if fil is a directory and listable.
Definition: disk.c:454
enum GNUNET_GenericReturnValue GNUNET_DISK_directory_create(const char *dir)
Implementation of "mkdir -p".
Definition: disk.c:547
int 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_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.
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.
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.
unsigned int GNUNET_CONTAINER_multihashmap_size(const struct GNUNET_CONTAINER_MultiHashMap *map)
Get the number of key-value pairs in the map.
void GNUNET_CONTAINER_multihashmap_destroy(struct GNUNET_CONTAINER_MultiHashMap *map)
Destroy a hash map.
struct GNUNET_CONTAINER_MultiHashMap * GNUNET_CONTAINER_multihashmap_create(unsigned int len, int do_not_copy_keys)
Create a multi hash map.
@ GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST
, ' bother checking if a value already exists (faster than GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE...
#define GNUNET_log(kind,...)
#define GNUNET_memcmp(a, b)
Compare memory in a and b, where both must be of the same pointer type.
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
GNUNET_GenericReturnValue
Named constants for return values.
@ GNUNET_OK
@ GNUNET_YES
@ GNUNET_NO
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
const char * GNUNET_sh2s(const struct GNUNET_ShortHashCode *shc)
Convert a short hash value to a string (for printing debug messages).
const char * GNUNET_h2s(const struct GNUNET_HashCode *hc)
Convert a hash value to a string (for printing debug messages).
@ GNUNET_ERROR_TYPE_ERROR
@ GNUNET_ERROR_TYPE_DEBUG
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_free(ptr)
Wrapper around free.
const char * GNUNET_MESSENGER_name_of_kind(enum GNUNET_MESSENGER_MessageKind kind)
Get the name of a message kind.
Definition: messenger_api.c:46
#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:1339
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
Definition: scheduler.c:980
void GNUNET_SERVICE_shutdown(struct GNUNET_SERVICE_Handle *sh)
Explicitly stops the service.
Definition: service.c:2511
struct GNUNET_STATISTICS_Handle * GNUNET_STATISTICS_create(const char *subsystem, const struct GNUNET_CONFIGURATION_Handle *cfg)
Get handle for the statistics service.
void GNUNET_STATISTICS_set(struct GNUNET_STATISTICS_Handle *handle, const char *name, uint64_t value, int make_persistent)
Set statistic value for the peer.
void GNUNET_STATISTICS_update(struct GNUNET_STATISTICS_Handle *handle, const char *name, int64_t delta, int make_persistent)
Set statistic value for the peer.
void GNUNET_STATISTICS_destroy(struct GNUNET_STATISTICS_Handle *h, int sync_first)
Destroy a handle (free all state associated with it).
void clear_contact_store(struct GNUNET_MESSENGER_ContactStore *store)
Clears a contact store, wipes its content and deallocates its memory.
void init_contact_store(struct GNUNET_MESSENGER_ContactStore *store)
Initializes a contact store as fully empty.
const struct GNUNET_CRYPTO_PublicKey * get_anonymous_public_key(void)
Returns the public identity key of GNUNET_IDENTITY_ego_get_anonymous() without recalculating it every...
An identity key as per LSD0001.
A 512-bit hashcode.
struct GNUNET_MESSENGER_ListHandle * next
struct GNUNET_MESSENGER_SrvHandle * handle
enum GNUNET_MESSENGER_MessageKind kind
The kind of the message.
struct GNUNET_MESSENGER_MessageHeader header
Header.
struct GNUNET_HashCode * peer_message
struct GNUNET_MESSENGER_SrvHandle * host
Handle to a message queue.
Definition: mq.c:87
The identity of the host (wraps the signing key of the peer).
Handle to a service.
Definition: service.c:116
A 256-bit hashcode.
struct GNUNET_MESSENGER_SrvHandle * handle
const struct GNUNET_CRYPTO_PublicKey * pubkey
struct GNUNET_MESSENGER_SrvRoom * room