Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix kademlia example which was broken on 32bits archs.
[simgrid.git] / examples / msg / kademlia / kademlia.h
1
2 /* Copyright (c) 2012. The SimGrid Team.
3  * All rights reserved.                                                     */
4
5 /* This program is free software; you can redistribute it and/or modify it
6  * under the terms of the license (GNU LGPL) which comes with this package. */
7 #ifndef _MSG_EXAMPLES_KADEMLIA_H
8 #define _MSG_EXAMPLES_KADEMLIA_H
9 #include "node.h"
10 #include "task.h"
11 //process functions
12 static int node(int argc, char *argv[]);
13 static void main_loop(node_t node, double deadline);
14 //core kademlia functions
15 unsigned int join(node_t node, unsigned int id_known);
16 unsigned int find_node(node_t node, unsigned int id_to_find,
17                        unsigned int count_in_stats);
18 unsigned int ping(node_t node, unsigned int id_to_ping);
19 void random_lookup(node_t node);
20
21 void send_find_node(node_t node, unsigned int id, unsigned int destination);
22 unsigned int send_find_node_to_best(node_t node, answer_t node_list);
23
24 void handle_task(node_t node, msg_task_t task);
25 void handle_find_node(node_t node, task_data_t data);
26 void handle_ping(node_t node, task_data_t data);
27
28
29 #endif                          /* _MSG_EXAMPLES_KADEMLIA_H */