1 /* Copyright (c) 2012-2023. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
7 #ifndef _DHT_KADEMLIA_MESSAGE
8 #define _DHT_KADEMLIA_MESSAGE
11 #include "simgrid/mailbox.h"
12 #include "xbt/sysdep.h"
14 typedef struct s_kademlia_message {
15 unsigned int sender_id; // Id of the guy who sent the task
16 unsigned int destination_id; // Id we are trying to find, if needed.
17 answer_t answer; // Answer to the request made, if needed.
18 sg_mailbox_t answer_to; // mailbox to send the answer to (if not an answer).
19 const char* issuer_host_name; // used for logging
20 } s_kademlia_message_t;
22 typedef s_kademlia_message_t* kademlia_message_t;
23 typedef const s_kademlia_message_t* const_kademlia_message_t;
25 // Task handling functions
26 kademlia_message_t new_message(unsigned int sender_id, unsigned int destination_id, answer_t answer,
27 sg_mailbox_t mailbox, const char* hostname);
28 void free_message(void* message);
29 #endif /* _DHT_KADEMLIA_MESSAGE */