gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r10774 - gnunet/src/include


From: gnunet
Subject: [GNUnet-SVN] r10774 - gnunet/src/include
Date: Sun, 4 Apr 2010 19:11:37 +0200

Author: nevans
Date: 2010-04-04 19:11:37 +0200 (Sun, 04 Apr 2010)
New Revision: 10774

Modified:
   gnunet/src/include/gnunet_dht_service.h
   gnunet/src/include/gnunet_protocols.h
Log:
forgotten commit

Modified: gnunet/src/include/gnunet_dht_service.h
===================================================================
--- gnunet/src/include/gnunet_dht_service.h     2010-04-04 17:10:58 UTC (rev 
10773)
+++ gnunet/src/include/gnunet_dht_service.h     2010-04-04 17:11:37 UTC (rev 
10774)
@@ -44,6 +44,22 @@
 struct GNUNET_DHT_Handle;
 
 /**
+ * Handle to control a route operation.
+ */
+struct GNUNET_DHT_RouteHandle;
+
+/**
+ * Handle to control a get operation.
+ */
+struct GNUNET_DHT_GetHandle;
+
+/**
+ * Handle to control a find peer operation.
+ */
+struct GNUNET_DHT_FindPeerHandle;
+
+
+/**
  * Iterator called on each result obtained from a generic route
  * operation
  */
@@ -62,7 +78,7 @@
 struct GNUNET_DHT_Handle *
 GNUNET_DHT_connect (struct GNUNET_SCHEDULER_Handle *sched,
                     const struct GNUNET_CONFIGURATION_Handle *cfg,
-                   unsigned int ht_len);
+                    unsigned int ht_len);
 
 
 /**
@@ -105,12 +121,6 @@
 
 
 /**
- * Handle to control a GET operation.
- */
-struct GNUNET_DHT_GetHandle;
-
-
-/**
  * Iterator called on each result obtained for a DHT
  * operation that expects a reply
  *
@@ -131,7 +141,7 @@
 
 
 /**
- * Perform an asynchronous GET operation on the DHT identified.
+ * Perform an asynchronous GET operation on the DHT.
  *
  * @param handle handle to the DHT service
  * @param timeout timeout for this request to be sent to the
@@ -145,15 +155,15 @@
  *
  * @return handle to stop the async get, NULL on error
  */
-struct GNUNET_DHT_RouteHandle *
+struct GNUNET_DHT_GetHandle *
 GNUNET_DHT_get_start (struct GNUNET_DHT_Handle *handle,
                       struct GNUNET_TIME_Relative timeout,
-                     uint32_t type,
-                     const GNUNET_HashCode * key,
-                     GNUNET_DHT_GetIterator iter,
-                     void *iter_cls,
-                     GNUNET_SCHEDULER_Task cont,
-          void *cont_cls);
+                      uint32_t type,
+                      const GNUNET_HashCode * key,
+                      GNUNET_DHT_GetIterator iter,
+                      void *iter_cls,
+                      GNUNET_SCHEDULER_Task cont,
+                      void *cont_cls);
 
 /**
  * Stop async DHT-get.  Frees associated resources.
@@ -161,10 +171,28 @@
  * @param get_handle GET operation to stop.
  */
 void
-GNUNET_DHT_get_stop (struct GNUNET_DHT_RouteHandle *get_handle);
+GNUNET_DHT_get_stop (struct GNUNET_DHT_GetHandle *get_handle, 
GNUNET_SCHEDULER_Task cont, void *cont_cls);
 
 
 /**
+ * Options for routing.
+ */
+enum GNUNET_DHT_RouteOption
+  {
+    /**
+     * Default.  Do nothing special.
+     */
+    GNUNET_DHT_RO_NONE = 0,
+
+    /**
+     * Each peer along the way should look at 'enc' (otherwise
+     * only the k-peers closest to the key should look at it).
+     */
+    GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE = 1
+  };
+
+
+/**
  * Iterator called on each result obtained from a find peer
  * operation
  *
@@ -177,34 +205,46 @@
 
 
 /**
- * Iterator called on each result obtained from a generic route
- * operation
+ * Perform an asynchronous FIND PEER operation on the DHT.
+ *
+ * @param handle handle to the DHT service
+ * @param timeout timeout for this request to be sent to the
+ *        service
+ * @param options routing options for this message
+ * @param message a message to inject at found peers (may be null)
+ * @param key the key to look up
+ * @param iter function to call on each result
+ * @param iter_cls closure for iter
+ * @param cont continuation to call once message sent
+ * @param cont_cls closure for continuation
+ *
+ * @return handle to stop the async get, NULL on error
  */
-typedef void (*GNUNET_DHT_ReplyProcessor)(void *cls,
-                                          const struct GNUNET_MessageHeader 
*reply);
+struct GNUNET_DHT_FindPeerHandle *
+GNUNET_DHT_find_peer_start (struct GNUNET_DHT_Handle *handle,
+                      struct GNUNET_TIME_Relative timeout,
+                      enum GNUNET_DHT_RouteOption options,
+                      struct GNUNET_MessageHeader *message,
+                      const GNUNET_HashCode * key,
+                      GNUNET_DHT_FindPeerProcessor iter,
+                      void *iter_cls,
+                      GNUNET_SCHEDULER_Task cont,
+                      void *cont_cls);
 
-
 /**
- * Options for routing.
+ * Stop async find peer.  Frees associated resources.
+ *
+ * @param find_peer_handle GET operation to stop.
  */
-enum GNUNET_DHT_RouteOption
-  {
-    /**
-     * Default.  Do nothing special.
-     */
-    GNUNET_DHT_RO_NONE = 0,
+void
+GNUNET_DHT_find_peer_stop (struct GNUNET_DHT_FindPeerHandle *find_peer_handle, 
GNUNET_SCHEDULER_Task cont, void *cont_cls);
 
-    /**
-     * Each peer along the way should look at 'enc' (otherwise
-     * only the k-peers closest to the key should look at it).
-     */
-    GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE = 1
-  };
-
 /**
- * Handle to control a route operation.
+ * Iterator called on each result obtained from a generic route
+ * operation
  */
-struct GNUNET_DHT_RouteHandle;
+typedef void (*GNUNET_DHT_ReplyProcessor)(void *cls,
+                                          const struct GNUNET_MessageHeader 
*reply);
 
 /**
  * Perform an asynchronous FIND_PEER operation on the DHT.
@@ -218,7 +258,7 @@
  * @param enc send the encapsulated message to a peer close to the key
  * @param timeout when to abort with an error if we fail to get
  *                a confirmation for the request (when necessary) or how long
- *                to wait for tramission to the service
+ *                to wait for transmission to the service
  * @param iter function to call on each result, NULL if no replies are expected
  * @param iter_cls closure for iter
 
@@ -240,7 +280,7 @@
                        void *cont_cls);
 
 void
-GNUNET_DHT_route_stop (struct GNUNET_DHT_RouteHandle *fph);
+GNUNET_DHT_route_stop (struct GNUNET_DHT_RouteHandle *route_handle, 
GNUNET_SCHEDULER_Task cont, void *cont_cls);
 
 
 #if 0                           /* keep Emacsens' auto-indent happy */

Modified: gnunet/src/include/gnunet_protocols.h
===================================================================
--- gnunet/src/include/gnunet_protocols.h       2010-04-04 17:10:58 UTC (rev 
10773)
+++ gnunet/src/include/gnunet_protocols.h       2010-04-04 17:11:37 UTC (rev 
10774)
@@ -169,7 +169,7 @@
 #define GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_LOOKUP 27
 
 /**
- * Response to the address lookup request. 
+ * Response to the address lookup request.
  */
 #define GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_REPLY 28
 
@@ -506,9 +506,14 @@
 /**
  * Local and message acknowledgment
  */
-#define GNUNET_MESSAGE_TYPE_DHT_ACK 145
+#define GNUNET_MESSAGE_TYPE_DHT_ACK 144
 
 /**
+ * Local DHT Put message, from API to service
+ */
+#define GNUNET_MESSAGE_TYPE_DHT_PUT 145
+
+/**
  * Local DHT Get message, from API to service
  */
 #define GNUNET_MESSAGE_TYPE_DHT_GET 146
@@ -519,24 +524,24 @@
 #define GNUNET_MESSAGE_TYPE_DHT_GET_STOP 147
 
 /**
- * Local DHT Get message, from API to service
+ * Local DHT Get result message, from service to API
  */
-#define GNUNET_MESSAGE_TYPE_DHT_FIND_PEER 148
+#define GNUNET_MESSAGE_TYPE_DHT_GET_RESULT 148
 
 /**
- * Local DHT Get stop message, from API to service
+ * Local DHT Get message, from API to service
  */
-#define GNUNET_MESSAGE_TYPE_DHT_FIND_PEER_STOP 149
+#define GNUNET_MESSAGE_TYPE_DHT_FIND_PEER 150
 
 /**
- * Local DHT Put message, from API to service
+ * Local DHT Get stop message, from API to service
  */
-#define GNUNET_MESSAGE_TYPE_DHT_PUT 150
+#define GNUNET_MESSAGE_TYPE_DHT_FIND_PEER_STOP 151
 
 /**
- * Local DHT Get result message, from service to API
+ * Local DHT find peer result message, from service to API
  */
-#define GNUNET_MESSAGE_TYPE_DHT_GET_RESULT 151
+#define GNUNET_MESSAGE_TYPE_DHT_FIND_PEER_RESULT 152
 
 
 /**





reply via email to

[Prev in Thread] Current Thread [Next in Thread]