+/* Get the corresponding state of a node */
+static state_t node_get_state(node_t node) {
+ int i,j;
+ state_t state = xbt_new0(s_state_t,1);
+ state->id = node->id;
+ for (i=0; i<NEIGHBORHOOD_SIZE; i++)
+ state->neighborhood_set[i] = node->neighborhood_set[i];
+
+ for (i=0; i<LEVELS_COUNT; i++)
+ for (j=0; j<LEVEL_SIZE; j++)
+ state->routing_table[i][j] = node->routing_table[i][j];
+
+ for (i=0; i<NAMESPACE_SIZE; i++)
+ state->namespace_set[i] = node->namespace_set[i];
+
+ return state;
+}
+
+/* Print the node id */
+static void print_node_id(node_t node) {
+ int i;
+ printf(" id: %i '%08x' ", node->id, node->id);
+ for (i=0;i<LEVELS_COUNT;i++)
+ printf(" %x", domain(node->id, i));
+ printf("\n");
+}
+
+/* * Print the node neighborhood set */
+static void print_node_neighborood_set(node_t node) {
+ int i;
+ printf(" Neighborhood:\n");
+ for (i=0; i<NEIGHBORHOOD_SIZE; i++)
+ printf(" %08x\n", node->neighborhood_set[i]);
+}
+
+/* Print the routing table */
+static void print_node_routing_table(node_t node) {
+ printf(" routing table:\n");
+ for (int i=0; i<LEVELS_COUNT; i++){
+ printf(" ");
+ for (int j=0; j<LEVEL_SIZE; j++)
+ printf("%08x ", node->routing_table[i][j]);
+ printf("\n");
+ }
+}
+
+/* Print the node namespace set */
+static void print_node_namespace_set(node_t node) {
+ printf(" namespace:\n");
+ for (int i=0; i<NAMESPACE_SIZE; i++)
+ printf(" %08x\n", node->namespace_set[i]);
+ printf("\n");
+}
+
+/* Print the node information */
+static void print_node(node_t node) {
+ printf("Node:\n");
+ print_node_id(node);
+ print_node_neighborood_set(node);
+ print_node_routing_table(node);
+ print_node_namespace_set(node);
+}
+
+/** Handle a given task */