GNUnet 0.22.2
gnunet-messenger.c
Go to the documentation of this file.
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2020--2024 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 */
26#include <stdio.h>
27#include <unistd.h>
28
31#include "gnunet_util_lib.h"
32
35
36uint64_t waiting;
37
41
47static void
48delay_shutdown (void *cls)
49{
50 read_task = NULL;
51
52 if (waiting)
53 return;
54
56}
57
58
59static void
60idle (void *cls);
61
72static void
73on_message (void *cls,
74 struct GNUNET_MESSENGER_Room *room,
75 const struct GNUNET_MESSENGER_Contact *sender,
76 const struct GNUNET_MESSENGER_Contact *recipient,
77 const struct GNUNET_MESSENGER_Message *message,
78 const struct GNUNET_HashCode *hash,
80{
81 uint64_t waited;
82 const char *sender_name;
83 const char *recipient_name;
84
85 waited = waiting;
86
87 if (GNUNET_YES == talk_mode)
88 {
90 {
92 {
93 waiting = waiting > message->body.talk.length?
94 waiting - message->body.talk.length : 0;
95 }
96 else if ((GNUNET_YES != silence_flag) &&
97 (0 < write (1, message->body.talk.data,
98 message->body.talk.length)))
99 {
100 fflush (stdout);
101 }
102 }
103
104 goto skip_printing;
105 }
106 else if (GNUNET_YES == silence_flag)
107 goto skip_printing;
108
109 sender_name = GNUNET_MESSENGER_contact_get_name (sender);
110 recipient_name = GNUNET_MESSENGER_contact_get_name (recipient);
111
112 if (! sender_name)
113 sender_name = "anonymous";
114
115 if (! recipient_name)
116 recipient_name = "anonymous";
117
118 printf ("[%s ->", GNUNET_h2s (&(message->header.previous)));
119 printf (" %s]", GNUNET_h2s (hash));
120 printf ("[%s] ", GNUNET_sh2s (&(message->header.sender_id)));
121
123 printf ("*( '%s' ) ", recipient_name);
124
125 switch (message->header.kind)
126 {
128 {
129 printf ("* '%s' joins the room!\n", sender_name);
130 break;
131 }
133 {
134 printf ("* '%s' leaves the room!\n", sender_name);
135 break;
136 }
138 {
139 printf ("* '%s' gets renamed to '%s'\n", sender_name,
140 message->body.name.name);
141 break;
142 }
144 {
145 printf ("* '%s' updates key!\n", sender_name);
146 break;
147 }
149 {
150 printf ("* '%s' opens the room on: %s\n", sender_name,
151 GNUNET_i2s_full (&(message->body.peer.peer)));
152 break;
153 }
155 {
156 printf ("* '%s' changes id to: %s\n", sender_name,
157 GNUNET_sh2s (&(message->body.id.id)));
158 break;
159 }
161 {
162 printf ("* '%s' misses peer: %s\n", sender_name,
163 GNUNET_i2s_full (&(message->body.miss.peer)));
164 break;
165 }
167 {
168 printf ("* '%s' merges: ", sender_name);
169 printf ("[%s ->", GNUNET_h2s (&(message->body.merge.previous)));
170 printf (" %s]\n", GNUNET_h2s (hash));
171 break;
172 }
174 {
175 printf ("* '%s' requests: [%s]\n", sender_name,
176 GNUNET_h2s (&(message->body.request.hash)));
177 break;
178 }
180 {
181 printf ("* '%s' invites to chat on: %s %s\n", sender_name,
182 GNUNET_i2s_full (&(message->body.invite.door)),
183 GNUNET_h2s_full (&(message->body.invite.key)));
184 break;
185 }
187 {
188 uint16_t len;
189
190 if (message->body.text.text)
191 len = strlen (message->body.text.text) + 1;
192 else
193 len = 0;
194
195 if (flags & GNUNET_MESSENGER_FLAG_SENT)
196 {
197 waiting = waiting > len? waiting - len : 0;
198
199 printf (">");
200 }
201 else
202 printf ("<");
203
204 if (message->body.text.text)
205 printf (" '%s' says: \"%s\"\n", sender_name,
206 message->body.text.text);
207 else
208 printf (" '%s' mumbles\n", sender_name);
209 break;
210 }
212 {
213 if (flags & GNUNET_MESSENGER_FLAG_SENT)
214 printf (">");
215 else
216 printf ("<");
217
218 printf (" '%s' shares: \"%s\"\n%s\n", sender_name,
219 message->body.file.name, message->body.file.uri);
220 break;
221 }
223 {
224 if (flags & GNUNET_MESSENGER_FLAG_SENT)
225 printf (">");
226 else
227 printf ("<");
228
229 printf (" '%s' whispers\n", sender_name);
230 break;
231 }
233 {
234 printf ("* '%s' deletes: [%s]\n", sender_name,
235 GNUNET_h2s (&(message->body.deletion.hash)));
236 break;
237 }
239 {
240 printf ("* '%s' updates connection details: %u, %x\n",
241 sender_name,
242 message->body.connection.amount,
243 message->body.connection.flags);
244 break;
245 }
247 {
248 printf ("* '%s' provides ticket: %s\n", sender_name,
249 message->body.ticket.identifier);
250 break;
251 }
253 {
254 if (flags & GNUNET_MESSENGER_FLAG_SENT)
255 printf (">");
256 else
257 printf ("<");
258
259 if (message->body.tag.tag)
260 printf (" '%s' tags [%s] with: \"%s\"\n", sender_name,
261 GNUNET_h2s (&(message->body.tag.hash)),
262 message->body.tag.tag);
263 else
264 printf (" '%s' blocks [%s]\n", sender_name,
265 GNUNET_h2s (&(message->body.tag.hash)));
266 break;
267 }
269 {
270 printf ("* '%s' subscribes: %s\n", sender_name,
271 GNUNET_sh2s (&(message->body.subscribe.discourse)));
272 break;
273 }
275 {
276 printf ("* '%s' talks %u bytes in: %s\n", sender_name,
277 message->body.talk.length,
278 GNUNET_sh2s (&(message->body.talk.discourse)));
279 break;
280 }
281 default:
282 {
283 printf ("~ message: %s\n",
285 break;
286 }
287 }
288
289skip_printing:
290 if ((! read_task) && (! waiting) && (waited))
293 delay_shutdown, NULL);
294
295 if ((GNUNET_MESSENGER_KIND_JOIN == message->header.kind) &&
297 {
299 const char *name;
300
301 if (! read_task)
304 idle, room);
305
307
308 if (! name)
309 return;
310
312 response.body.name.name = GNUNET_strdup (name);
313
315
316 GNUNET_free (response.body.name.name);
317
318 if (GNUNET_YES != talk_mode)
319 return;
320
322 response.body.subscribe.flags =
324 response.body.subscribe.time =
326
327 memset (&(response.body.subscribe.discourse), 0,
328 sizeof(response.body.subscribe.discourse));
329
331 }
332}
333
334
336
342static void
343shutdown_hook (void *cls)
344{
345 struct GNUNET_MESSENGER_Room *room;
346
347 GNUNET_assert (cls);
348
349 room = cls;
350
351 if (read_task)
353
354 if (room)
356
357 if (messenger)
359
360 if (ego_lookup)
362}
363
364
365static void
366listen_stdio (void *cls);
367
368#define MAX_BUFFER_SIZE 57345
369
370static int
372 struct GNUNET_MESSENGER_Room *room,
373 const struct GNUNET_MESSENGER_Contact *contact)
374{
375 struct GNUNET_MESSENGER_Message *message;
376
377 GNUNET_assert ((cls) && (room) && (contact));
378
379 message = cls;
380
382 GNUNET_MESSENGER_send_message (room, message, contact);
383
384 return GNUNET_YES;
385}
386
387
389
395static void
396read_stdio (void *cls)
397{
398 struct GNUNET_MESSENGER_Room *room;
399 struct GNUNET_MESSENGER_Message message;
400 char buffer[MAX_BUFFER_SIZE];
401 ssize_t length;
402
403 GNUNET_assert (cls);
404
405 room = cls;
406 read_task = NULL;
407
408 length = read (0, buffer, MAX_BUFFER_SIZE - 1);
409
410 if ((length <= 0) || (length >= MAX_BUFFER_SIZE))
411 {
412 delay_shutdown (NULL);
413 return;
414 }
415
416 waiting += length;
417
418 if (GNUNET_YES == talk_mode)
419 {
421 message.body.talk.length = length;
422 message.body.talk.data = buffer;
423
424 memset (&(message.body.talk.discourse), 0,
425 sizeof(message.body.talk.discourse));
426 }
427 else
428 {
429 if (buffer[length - 1] == '\n')
430 buffer[length - 1] = '\0';
431 else
432 buffer[length] = '\0';
433
435 message.body.text.text = buffer;
436 }
437
440 &message);
441 else
442 GNUNET_MESSENGER_send_message (room, &message, NULL);
443
445}
446
447
453static void
454listen_stdio (void *cls)
455{
456 struct GNUNET_NETWORK_FDSet *rs;
457
458 read_task = NULL;
459
462
465 NULL, &read_stdio, cls);
466
468}
469
470
476static void
477idle (void *cls)
478{
479 struct GNUNET_MESSENGER_Room *room;
480
481 GNUNET_assert (cls);
482
483 room = cls;
484
485 if ((GNUNET_YES != talk_mode) ||
487 printf ("* You joined the room.\n");
488
490}
491
492
496
498
505static void
506on_identity (void *cls,
508{
509 struct GNUNET_HashCode key;
510 struct GNUNET_MESSENGER_Room *room;
511 struct GNUNET_PeerIdentity door_peer;
512 struct GNUNET_PeerIdentity *door;
513 const char *name;
514
515 memset (&key, 0, sizeof(key));
516
517 if (room_key)
519
520 door = NULL;
521
522 if ((door_id) &&
524 strlen (
525 door_id),
526 &(door_peer.
527 public_key))))
528 door = &door_peer;
529
530 if ((GNUNET_YES == talk_mode) ||
532 goto skip_welcome;
533
535
536 if (! name)
537 name = "anonymous";
538
539 printf ("* Welcome to the messenger, '%s'!\n", name);
540
541skip_welcome:
542 if (door)
543 {
544 if ((GNUNET_YES != talk_mode) ||
546 printf ("* You try to entry a room...\n");
547
549 }
550 else
551 {
552 if ((GNUNET_YES != talk_mode) ||
554 printf ("* You try to open a room...\n");
555
557 }
558
560
562
563 waiting = 0;
564
565 if (! room)
567 else
568 read_task = NULL;
569}
570
571
572static void
573on_ego_lookup (void *cls,
574 struct GNUNET_IDENTITY_Ego *ego)
575{
576 const struct GNUNET_CRYPTO_PrivateKey *key;
577
578 ego_lookup = NULL;
579
580 key = ego ? GNUNET_IDENTITY_ego_get_private_key (ego) : NULL;
581
583 NULL);
584
585 on_identity (NULL, messenger);
586}
587
588
597static void
598run (void *cls,
599 char *const *args,
600 const char *cfgfile,
601 const struct GNUNET_CONFIGURATION_Handle *cfg)
602{
603 config = cfg;
604
605 if (ego_name)
606 {
608 NULL);
609 messenger = NULL;
610 }
611 else
612 {
613 ego_lookup = NULL;
614 messenger = GNUNET_MESSENGER_connect (cfg, NULL, NULL, &on_message, NULL);
615 }
616
618
619 if (messenger)
620 on_identity (NULL, messenger);
621}
622
623
631int
632main (int argc,
633 char **argv)
634{
635 const char *description =
636 "Open and connect to rooms using the MESSENGER to chat.";
637
639 GNUNET_GETOPT_option_string ('d', "door", "PEERIDENTITY",
640 "peer identity to entry into the room",
641 &door_id),
642 GNUNET_GETOPT_option_string ('e', "ego", "IDENTITY",
643 "identity to use for messaging",
644 &ego_name),
645 GNUNET_GETOPT_option_string ('r', "room", "ROOMKEY",
646 "key of the room to connect to",
647 &room_key),
648 GNUNET_GETOPT_option_flag ('p', "private", "flag to enable private mode",
649 &private_mode),
650 GNUNET_GETOPT_option_flag ('s', "silence",
651 "flag to silence all others to send only",
652 &silence_flag),
653 GNUNET_GETOPT_option_flag ('t', "talk", "flag to enable talk mode",
654 &talk_mode),
656 };
657
658 return (GNUNET_OK ==
660 argc,
661 argv,
662 "gnunet-messenger\0",
664 &run,
665 NULL) ? EXIT_SUCCESS : EXIT_FAILURE);
666}
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_OPTION_END
Definition: 002.c:13
struct GNUNET_GETOPT_CommandLineOption options[]
Definition: 002.c:5
#define gettext_noop(String)
Definition: gettext.h:74
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
Definition: gnunet-arm.c:108
static struct MHD_Response * response
Our canonical response.
struct GNUNET_HashCode key
The key used in the DHT.
static void on_identity(void *cls, struct GNUNET_MESSENGER_Handle *handle)
Function called when an identity is retrieved.
static void listen_stdio(void *cls)
Wait for input on STDIO and send it out over the ch.
static void delay_shutdown(void *cls)
Delay forced shutdown by input to wait for data processing.
int talk_mode
uint64_t waiting
int main(int argc, char **argv)
The main function to obtain messenger information.
static void idle(void *cls)
Initial task to startup application.
static void read_stdio(void *cls)
Task run in stdio mode, after some data is available at stdin.
struct GNUNET_MESSENGER_Handle * messenger
char * door_id
char * ego_name
struct GNUNET_IDENTITY_EgoLookup * ego_lookup
struct GNUNET_SCHEDULER_Task * read_task
int private_mode
const struct GNUNET_CONFIGURATION_Handle * config
static int iterate_send_private_message(void *cls, struct GNUNET_MESSENGER_Room *room, const struct GNUNET_MESSENGER_Contact *contact)
struct GNUNET_SCHEDULER_Task * shutdown_task
char * room_key
int silence_flag
static void run(void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg)
Main function that will be run by the scheduler.
#define MAX_BUFFER_SIZE
static void on_ego_lookup(void *cls, struct GNUNET_IDENTITY_Ego *ego)
static void shutdown_hook(void *cls)
Task to shut down this application.
static void on_message(void *cls, struct GNUNET_MESSENGER_Room *room, const struct GNUNET_MESSENGER_Contact *sender, const struct GNUNET_MESSENGER_Contact *recipient, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash, enum GNUNET_MESSENGER_MessageFlags flags)
Function called whenever a message is received or sent.
static char * name
Name (label) of the records to list.
static struct GNUNET_VPN_Handle * handle
Handle to vpn service.
Definition: gnunet-vpn.c:35
Identity service; implements identity management for GNUnet.
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_flag(char shortName, const char *name, const char *description, int *val)
Allow user to specify a flag (which internally means setting an integer to 1/GNUNET_YES/GNUNET_OK.
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_string(char shortName, const char *name, const char *argumentHelp, const char *description, char **str)
Allow user to specify a string.
void GNUNET_CRYPTO_hash(const void *block, size_t size, struct GNUNET_HashCode *ret)
Compute hash of a given block.
Definition: crypto_hash.c:41
const struct GNUNET_CRYPTO_PrivateKey * GNUNET_IDENTITY_ego_get_private_key(const struct GNUNET_IDENTITY_Ego *ego)
Obtain the ECC key associated with a ego.
Definition: identity_api.c:517
struct GNUNET_IDENTITY_EgoLookup * GNUNET_IDENTITY_ego_lookup(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *name, GNUNET_IDENTITY_EgoCallback cb, void *cb_cls)
Lookup an ego by name.
void GNUNET_IDENTITY_ego_lookup_cancel(struct GNUNET_IDENTITY_EgoLookup *el)
Abort ego lookup attempt.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_eddsa_public_key_from_string(const char *enc, size_t enclen, struct GNUNET_CRYPTO_EddsaPublicKey *pub)
Convert a string representing a public key to a public key.
Definition: crypto_ecc.c:361
@ GNUNET_SCHEDULER_PRIORITY_IDLE
Run when otherwise idle.
@ GNUNET_SCHEDULER_PRIORITY_DEFAULT
Run with the default priority (normal P2P operations).
@ GNUNET_OK
@ GNUNET_YES
const char * GNUNET_h2s_full(const struct GNUNET_HashCode *hc)
Convert a hash value to a string (for printing debug messages).
#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_i2s_full(const struct GNUNET_PeerIdentity *pid)
Convert a peer identity 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).
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
#define GNUNET_free(ptr)
Wrapper around free.
struct GNUNET_MESSENGER_Room * GNUNET_MESSENGER_open_room(struct GNUNET_MESSENGER_Handle *handle, const struct GNUNET_HashCode *key)
Open a room to send and receive messages.
int GNUNET_MESSENGER_iterate_members(struct GNUNET_MESSENGER_Room *room, GNUNET_MESSENGER_MemberCallback callback, void *cls)
Iterates through all members of a given room and calls a selected callback for each of them with a pr...
const char * GNUNET_MESSENGER_name_of_kind(enum GNUNET_MESSENGER_MessageKind kind)
Get the name of a message kind.
Definition: messenger_api.c:44
GNUNET_MESSENGER_MessageFlags
Enum for the different supported flags used by message handling.
const char * GNUNET_MESSENGER_contact_get_name(const struct GNUNET_MESSENGER_Contact *contact)
Get the name used by the contact.
struct GNUNET_MESSENGER_Handle * GNUNET_MESSENGER_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *name, const struct GNUNET_CRYPTO_PrivateKey *key, GNUNET_MESSENGER_MessageCallback msg_callback, void *msg_cls)
Set up a handle for the messenger related functions and connects to all necessary services.
struct GNUNET_MESSENGER_Room * GNUNET_MESSENGER_enter_room(struct GNUNET_MESSENGER_Handle *handle, const struct GNUNET_PeerIdentity *door, const struct GNUNET_HashCode *key)
Enter a room to send and receive messages through a door opened using GNUNET_MESSENGER_open_room.
const struct GNUNET_CRYPTO_PublicKey * GNUNET_MESSENGER_contact_get_key(const struct GNUNET_MESSENGER_Contact *contact)
Get the public key used by the contact or NULL if the anonymous key was used.
void GNUNET_MESSENGER_disconnect(struct GNUNET_MESSENGER_Handle *handle)
Disconnect all of the messengers used services and clears up its used memory.
const char * GNUNET_MESSENGER_get_name(const struct GNUNET_MESSENGER_Handle *handle)
Get the name (if specified, otherwise NULL) used by the messenger.
void GNUNET_MESSENGER_close_room(struct GNUNET_MESSENGER_Room *room)
Close a room which was entered, opened or both in various order and variety.
void GNUNET_MESSENGER_send_message(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_MESSENGER_Contact *contact)
Send a message into a room.
@ GNUNET_MESSENGER_KIND_MISS
The miss kind.
@ GNUNET_MESSENGER_KIND_INVITE
The invite kind.
@ GNUNET_MESSENGER_KIND_PRIVATE
The private kind.
@ GNUNET_MESSENGER_KIND_TAG
The tag kind.
@ GNUNET_MESSENGER_KIND_FILE
The file kind.
@ GNUNET_MESSENGER_KIND_REQUEST
The request kind.
@ GNUNET_MESSENGER_KIND_NAME
The name kind.
@ GNUNET_MESSENGER_KIND_LEAVE
The leave kind.
@ GNUNET_MESSENGER_KIND_SUBSCRIBE
The subscribe kind.
@ GNUNET_MESSENGER_KIND_TALK
The talk kind.
@ GNUNET_MESSENGER_KIND_PEER
The peer kind.
@ GNUNET_MESSENGER_KIND_KEY
The key kind.
@ GNUNET_MESSENGER_KIND_TEXT
The text kind.
@ GNUNET_MESSENGER_KIND_JOIN
The join kind.
@ GNUNET_MESSENGER_KIND_DELETE
The delete kind.
@ GNUNET_MESSENGER_KIND_CONNECTION
The connection kind.
@ GNUNET_MESSENGER_KIND_TICKET
The ticket kind.
@ GNUNET_MESSENGER_KIND_MERGE
The merge kind.
@ GNUNET_MESSENGER_KIND_ID
The id kind.
@ GNUNET_MESSENGER_FLAG_PRIVATE
The private flag.
@ GNUNET_MESSENGER_FLAG_SENT
The sent flag.
@ GNUNET_MESSENGER_FLAG_SUBSCRIPTION_KEEP_ALIVE
The keep alive flag.
void GNUNET_NETWORK_fdset_destroy(struct GNUNET_NETWORK_FDSet *fds)
Releases the associated memory of an fd set.
Definition: network.c:1185
struct GNUNET_NETWORK_FDSet * GNUNET_NETWORK_fdset_create(void)
Creates an fd set.
Definition: network.c:1169
void GNUNET_NETWORK_fdset_set_native(struct GNUNET_NETWORK_FDSet *to, int nfd)
Set a native fd in a set.
Definition: network.c:1058
const struct GNUNET_OS_ProjectData * GNUNET_OS_project_data_gnunet(void)
Return default project data used by 'libgnunetutil' for GNUnet.
enum GNUNET_GenericReturnValue GNUNET_PROGRAM_run(const struct GNUNET_OS_ProjectData *pd, int argc, char *const *argv, const char *binaryName, const char *binaryHelp, const struct GNUNET_GETOPT_CommandLineOption *options, GNUNET_PROGRAM_Main task, void *task_cls)
Run a standard GNUnet command startup sequence (initialize loggers and configuration,...
Definition: program.c:407
void GNUNET_SCHEDULER_shutdown(void)
Request the shutdown of a scheduler.
Definition: scheduler.c:567
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_select(enum GNUNET_SCHEDULER_Priority prio, struct GNUNET_TIME_Relative delay, const struct GNUNET_NETWORK_FDSet *rs, const struct GNUNET_NETWORK_FDSet *ws, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified delay or when any of the specified file descriptor set...
Definition: scheduler.c:1835
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
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_now(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run as soon as possible.
Definition: scheduler.c:1304
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:1231
#define GNUNET_TIME_UNIT_FOREVER_REL
Constant used to specify "forever".
struct GNUNET_TIME_Relative GNUNET_TIME_relative_get_second_(void)
Return relative time of 1s.
Definition: time.c:169
struct GNUNET_TIME_RelativeNBO GNUNET_TIME_relative_hton(struct GNUNET_TIME_Relative a)
Convert relative time to network byte order.
Definition: time.c:620
A private key for an identity as per LSD0001.
Definition of a command line option.
const char * description
Help text for the option (description)
A 512-bit hashcode.
Handle for ego lookup.
Handle for an ego.
Definition: identity.h:37
struct GNUNET_MESSENGER_MessageConnection connection
struct GNUNET_MESSENGER_MessageSubscribe subscribe
struct GNUNET_MESSENGER_MessageText text
struct GNUNET_MESSENGER_MessageRequest request
struct GNUNET_MESSENGER_MessageMerge merge
struct GNUNET_MESSENGER_MessageId id
struct GNUNET_MESSENGER_MessageName name
struct GNUNET_MESSENGER_MessageTalk talk
struct GNUNET_MESSENGER_MessageFile file
struct GNUNET_MESSENGER_MessageTag tag
struct GNUNET_MESSENGER_MessageInvite invite
struct GNUNET_MESSENGER_MessageMiss miss
struct GNUNET_MESSENGER_MessagePeer peer
struct GNUNET_MESSENGER_MessageDelete deletion
struct GNUNET_MESSENGER_MessageTicket ticket
uint32_t amount
The amount of connections of a peer.
uint32_t flags
The flags about the connections of a peer.
struct GNUNET_HashCode hash
The hash of the message to delete.
char * uri
The uri of the encrypted file.
char name[NAME_MAX]
The name of the original file.
struct GNUNET_HashCode previous
The hash of the previous message from the senders perspective.
enum GNUNET_MESSENGER_MessageKind kind
The kind of the message.
struct GNUNET_ShortHashCode sender_id
The senders id inside of the room the message was sent in.
struct GNUNET_ShortHashCode id
The new id which will replace the senders id in a room.
struct GNUNET_HashCode key
The hash identifying the port of the room.
struct GNUNET_PeerIdentity door
The peer identity of an open door to a room.
struct GNUNET_HashCode previous
The hash of a second previous message.
struct GNUNET_PeerIdentity peer
The peer identity of a disconnected door to a room.
char * name
The new name which replaces the current senders name.
struct GNUNET_PeerIdentity peer
The peer identity of the sender opening a room.
struct GNUNET_HashCode hash
The hash of the requested message.
struct GNUNET_ShortHashCode discourse
The hash of the discourse to subscribe.
struct GNUNET_HashCode hash
The hash of the message to tag.
uint16_t length
The length of the talk message data.
char * data
The data of the talk message.
struct GNUNET_ShortHashCode discourse
The hash of the discourse to talk.
char * text
The containing text.
char * identifier
The identifier of a ticket.
struct GNUNET_MESSENGER_MessageHeader header
Header.
struct GNUNET_MESSENGER_MessageBody body
Body.
collection of IO descriptors
The identity of the host (wraps the signing key of the peer).
struct GNUNET_CRYPTO_EddsaPublicKey public_key
Entry in list of pending tasks.
Definition: scheduler.c:136