commit 8b0472be26c33243e4867f8fab2a865b0e2084d9
parent 14bf32756ebf311aed2421fd19217e20e538f7b5
Author: Arthur Dewarumez <arthur.dewarumez@etudiant.univ-lille1.fr>
Date: Tue, 28 Apr 2015 09:33:05 +0000
Add some comments in the handler functions.
Diffstat:
1 file changed, 57 insertions(+), 2 deletions(-)
diff --git a/src/dht/gnunet-service-wdht_neighbours.c b/src/dht/gnunet-service-wdht_neighbours.c
@@ -51,6 +51,16 @@
*/
#define FOO_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 2)
+/**
+ * The number of layered ID to use.
+ */
+#define NUMBER_LAYERED_ID 8
+
+/**
+ * Contains all the layered ID.
+ */
+struct GNUNET_PeerIdentity layered_id[NUMBER_LAYERED_ID];
+
GNUNET_NETWORK_STRUCT_BEGIN
@@ -618,6 +628,14 @@ handle_dht_p2p_finger_setup (void *cls,
fsm = (const struct FingerSetupMessage *) message;
+ /*
+ * Steps :
+ * 1 check if the hops_taken is < to log(honest node)
+ * 1.a.1 if true : increments the hops_taken
+ * 1.a.2 send the same structure
+ * 1.b if false : drop the message
+ */
+
return GNUNET_OK;
}
@@ -639,6 +657,13 @@ handle_dht_p2p_finger_setup_response (void *cls,
fsm = (const struct FingerSetupResponseMessage *) message;
+ /*
+ * Steps :
+ * 1 check if we are the correct layer
+ * 1.a if true : add the return value in the db structure
+ * 1.b if true : do nothing
+ */
+
return GNUNET_OK;
}
@@ -660,6 +685,15 @@ handle_dht_p2p_finger_destroy (void *cls,
fdm = (const struct FingerDestroyMessage *) message;
+ /*
+ * Steps :
+ * 1 check if message comme from a trail
+ * 1.a.1 if true: send the destroy message to the rest trail
+ * 1.a.2 clean the trail structure
+ * 1.a.3 did i have to remove the trail and ID from the db structure?
+ * 1.b if false: do nothing
+ */
+
return GNUNET_OK;
}
@@ -681,6 +715,12 @@ handle_dht_p2p_finger_route (void *cls,
frm = (const struct FingerRouteMessage *) message;
/* FIXME: check the size of the message */
+ /*
+ * steps :
+ * 1 find the good trail
+ * 2 send the finger route message
+ */
+
return GNUNET_OK;
}
@@ -743,10 +783,10 @@ handle_dht_p2p_peer_get (void *cls,
pgm = (const struct PeerGetMessage *) message;
- /*
+ /*
* steps :
* 1 extract the result
- * 2 create a peerGetResult struct
+ * 2 save the peer
* 3 send it using the good trail
*
* What do i do when i don't have the key/value?
@@ -772,6 +812,15 @@ handle_dht_p2p_peer_get_result (void *cls,
pgrm = (const struct PeerGetResultMessage *) message;
+ /*
+ * steps :
+ * 1 extract the result
+ * 2 create a peerGetResult struct
+ * 3 send it using the good trail
+ *
+ * What do i do when i don't have the key/value?
+ */
+
return GNUNET_OK;
}
@@ -792,6 +841,12 @@ handle_dht_p2p_peer_put (void *cls,
pgrm = (const struct PeerGetResultMessage *) message;
+ /*
+ * steps :
+ * 1 check the size of the message
+ * 2 use the API to add the value in the "database". Check on the xdht file, how to do it.
+ * 3 Did i a have to return a notification or did i have to return GNUNET_[OK|SYSERR]?
+ */
return GNUNET_OK;
}