-/*
- * \brief Initializes my finger table, knowing the id of a node already in the system.
- * \param node the current node
- * \param known_id id of a node already in the system
- */
-/*
-static void initialize_finger_table(node_t node, int known_id)
-{
- int my_id = node->id;
- int i;
- int pow = 1; // 2^i
-
- INFO0("Initializing my finger table...");
-
- // ask known_id who is my immediate successor
- node->fingers[0].id = remote_find_successor(node, known_id, my_id + 1);
- node->fingers[0].mailbox = get_mailbox(node->fingers[0].id);
-
- // find all other fingers
- for (i = 0; i < NB_BITS - 1; i++) {
-
- pow = pow << 1; // equivalent to pow = pow * 2
- if (is_in_interval(my_id + pow, my_id, node->fingers[i].id - 1)) {
- // I already have the info for this finger
- node->fingers[i + 1].id = node->fingers[i].id;
- }
- else {
- // I don't have the info, ask the only guy I know
- node->fingers[i + 1].id = remote_find_successor(node, known_id, my_id + pow);
- }
- node->fingers[i + 1].mailbox = get_mailbox(node->fingers[i + 1].id);
- }
-
- node->pred_id = find_predecessor(node, node->id);
- node->pred_mailbox = get_mailbox(node->pred_id);
-
- INFO0("Finger table initialized!");
- print_finger_table(node);
-}
-*/
-
-/**
- * \brief Notifies some nodes that the current node may have became their finger.
- * \param node the current node, which has just joined the system
- */
-/*
-static void notify_predecessors(node_t node)
-{
- int i, pred_id;
- int pow = 1;
- for (i = 0; i < NB_BITS; i++) {
- // find the closest node whose finger #i can be me
- pred_id = find_predecessor(node, node->id - pow + 1); // note: no "+1" in the article!
- if (pred_id != node->id) {
- remote_update_finger_table(node, pred_id, node->id, i);
- }
- pow = pow << 1; // pow = pow * 2
- }
-}
-*/
-
-/**
- * \brief Tells the current node that a node may have became its new finger.
- * \param node the current node
- * \param candidate_id id of the node that may be a new finger of the current node
- * \param finger_index index of the finger to update
- */
-/*
-static void update_finger_table(node_t node, int candidate_id, int finger_index)
-{
- int pow = 1;
- int i;
- for (i = 0; i < finger_index; i++) {
- pow = pow << 1;
- }
-
- // if (is_in_interval(candidate_id, node->id + pow, node->fingers[finger_index].id - 1)) {
- if (is_in_interval(candidate_id, node->id, node->fingers[finger_index].id - 1)) {
-// INFO3("Candidate %d is between %d and %d!", candidate_id, node->id + pow, node->fingers[finger_index].id - 1);
- // candidate_id is my new finger
- set_finger(node, finger_index, candidate_id);
- print_finger_table(node);
-
- if (node->pred_id != node->id) { // FIXME: is this necessary?
- // my predecessor may be concerned too
- remote_update_finger_table(node, node->pred_id, candidate_id, finger_index);
- }
- }
-}
-*/
-
-/**
- * \brief Tells a remote node that a node may have became its new finger.
- * \param ask_to_id id of the remote node to update
- * \param candidate_id id of the node that may be a new finger of the remote node
- * \param finger_index index of the finger to update
- */
-/*
-static void remote_update_finger_table(node_t node, int ask_to_id, int candidate_id, int finger_index)
-{
- task_data_t req_data = xbt_new0(s_task_data_t, 1);
- req_data->request_id = candidate_id;
- req_data->request_finger = finger_index;
- req_data->issuer_host_name = MSG_host_get_name(MSG_host_self());
-
- // send a "Update Finger" request to ask_to_id
- INFO3("Sending an 'Update Finger' request to %d: his finger #%d may be %d now", ask_to_id, finger_index, candidate_id);
- m_task_t task = MSG_task_create("Update Finger", COMP_SIZE, COMM_SIZE, req_data);
- char* mailbox = get_mailbox(ask_to_id);
- msg_comm_t comm = MSG_task_isend(task, mailbox);
- xbt_dynar_push(node->comms, &comm);
- xbt_free(mailbox);
-}
-*/
-