gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r10657 - gnunet/src/include
Date: Thu, 18 Mar 2010 17:33:14 +0100

Author: nevans
Date: 2010-03-18 17:33:14 +0100 (Thu, 18 Mar 2010)
New Revision: 10657

Modified:
   gnunet/src/include/gnunet_dht_service.h
   gnunet/src/include/gnunet_protocols.h
Log:
dht related changes to message types and whatnot

Modified: gnunet/src/include/gnunet_dht_service.h
===================================================================
--- gnunet/src/include/gnunet_dht_service.h     2010-03-18 16:32:41 UTC (rev 
10656)
+++ gnunet/src/include/gnunet_dht_service.h     2010-03-18 16:33:14 UTC (rev 
10657)
@@ -43,6 +43,12 @@
  */
 struct GNUNET_DHT_Handle;
 
+/**
+ * Iterator called on each result obtained from a generic route
+ * operation
+ */
+typedef void (*GNUNET_DHT_MessageCallback)(void *cls,
+                                           int code);
 
 /**
  * Initialize the connection with the DHT service.
@@ -87,14 +93,14 @@
  * @param cont_cls closure for cont
  */
 void
-GNUNET_DHT_put (struct GNUNET_DHT_Handle *h, 
+GNUNET_DHT_put (struct GNUNET_DHT_Handle *handle,
                const GNUNET_HashCode * key,
                uint32_t type,              
                uint32_t size, 
                const char *data,
                struct GNUNET_TIME_Absolute exp,
                struct GNUNET_TIME_Relative timeout,
-               GNUNET_SCHEDULER_Task cont,
+               GNUNET_DHT_MessageCallback cont,
                void *cont_cls);
 
 
@@ -105,8 +111,8 @@
 
 
 /**
- * Iterator called on each result obtained for a GET
- * operation.
+ * Iterator called on each result obtained for a DHT
+ * operation that expects a reply
  *
  * @param cls closure
  * @param exp when will this value expire
@@ -115,7 +121,7 @@
  * @param size number of bytes in data
  * @param data pointer to the result data
  */
-typedef void (*GNUNET_DHT_Iterator)(void *cls,
+typedef void (*GNUNET_DHT_GetIterator)(void *cls,
                                    struct GNUNET_TIME_Absolute exp,
                                    const GNUNET_HashCode * key,
                                    uint32_t type,
@@ -128,17 +134,20 @@
  * Perform an asynchronous GET operation on the DHT identified.
  *
  * @param h handle to the DHT service
+ * @param timeout timeout for this request to be sent to the
+ *        service
  * @param type expected type of the response object
  * @param key the key to look up
  * @param iter function to call on each result
  * @param iter_cls closure for iter
  * @return handle to stop the async get, NULL on error
  */
-struct GNUNET_DHT_GetHandle *
+struct GNUNET_DHT_RouteHandle *
 GNUNET_DHT_get_start (struct GNUNET_DHT_Handle *h,
+                      struct GNUNET_TIME_Relative timeout,
                      uint32_t type,
                      const GNUNET_HashCode * key,
-                     GNUNET_DHT_Iterator iter,
+                     GNUNET_DHT_GetIterator iter,
                      void *iter_cls);
 
 /**
@@ -147,23 +156,30 @@
  * @param get_handle GET operation to stop.
  */
 void
-GNUNET_DHT_get_stop (struct GNUNET_DHT_GetHandle *get_handle);
+GNUNET_DHT_get_stop (struct GNUNET_DHT_RouteHandle *get_handle);
 
 
 /**
- * Iterator called on each result obtained from a FIND_PEER
+ * Iterator called on each result obtained from a find peer
  * operation
  *
  * @param cls closure
- * @param peer a peer that was located
- * @param reply response generated by the peer (for example, a HELLO); or NULL
+ * @param reply response
  */
-typedef void (*GNUNET_DHT_ReplyProcessor)(void *cls,
+typedef void (*GNUNET_DHT_FindPeerProcessor)(void *cls,
                                          const struct GNUNET_PeerIdentity 
*peer,
                                          const struct GNUNET_MessageHeader 
*reply);
 
 
 /**
+ * Iterator called on each result obtained from a generic route
+ * operation
+ */
+typedef void (*GNUNET_DHT_ReplyProcessor)(void *cls,
+                                          const struct GNUNET_MessageHeader 
*reply);
+
+
+/**
  * Options for routing.
  */
 enum GNUNET_DHT_RouteOption
@@ -180,6 +196,10 @@
     GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE = 1
   };
 
+/**
+ * Handle to control a route operation.
+ */
+struct GNUNET_DHT_RouteHandle;
 
 /**
  * Perform an asynchronous FIND_PEER operation on the DHT.
@@ -195,13 +215,12 @@
  * @param iter_cls closure for iter
  * @param timeout when to abort with an error if we fail to get
  *                a confirmation for the PUT from the local DHT service
- * @param cont continuation to call when done; 
- *             reason will be TIMEOUT on error,
- *             reason will be PREREQ_DONE on success
+ * @param cont continuation to call when done, GNUNET_SYSERR if failed
+ *             GNUNET_OK otherwise
  * @param cont_cls closure for cont
  * @return handle to stop the request
  */
-struct GNUNET_DHT_FindPeerHandle *
+struct GNUNET_DHT_RouteHandle *
 GNUNET_DHT_route_start (struct GNUNET_DHT_Handle *handle,
                        const GNUNET_HashCode *key,
                        unsigned int desired_replication_level,
@@ -210,11 +229,11 @@
                        struct GNUNET_TIME_Relative timeout,
                        GNUNET_DHT_ReplyProcessor iter,
                        void *iter_cls,
-                       GNUNET_SCHEDULER_Task cont,
+                       GNUNET_DHT_MessageCallback cont,
                        void *cont_cls);
 
 void
-GNUNET_DHT_route_stop (struct GNUNET_DHT_FindPeerHandle *fph);
+GNUNET_DHT_route_stop (struct GNUNET_DHT_RouteHandle *fph);
 
 
 #if 0                           /* keep Emacsens' auto-indent happy */

Modified: gnunet/src/include/gnunet_protocols.h
===================================================================
--- gnunet/src/include/gnunet_protocols.h       2010-03-18 16:32:41 UTC (rev 
10656)
+++ gnunet/src/include/gnunet_protocols.h       2010-03-18 16:33:14 UTC (rev 
10657)
@@ -489,42 +489,51 @@
  */
 
 /**
+ * Local and P2P generic DHT message start type
+ */
+#define GNUNET_MESSAGE_TYPE_DHT 142
+
+/**
+ * Local and P2P generic DHT message stop type
+ */
+#define GNUNET_MESSAGE_TYPE_DHT_STOP 143
+
+/**
+ * Local and message acknowledgment
+ */
+#define GNUNET_MESSAGE_TYPE_DHT_ACK 145
+
+/**
  * Local DHT Get message, from API to service
  */
-#define GNUNET_MESSAGE_TYPE_DHT_GET 143
+#define GNUNET_MESSAGE_TYPE_DHT_GET 146
 
 /**
  * Local DHT Get stop message, from API to service
  */
-#define GNUNET_MESSAGE_TYPE_DHT_GET_STOP 144
+#define GNUNET_MESSAGE_TYPE_DHT_GET_STOP 147
 
 /**
  * Local DHT Get message, from API to service
  */
-#define GNUNET_MESSAGE_TYPE_DHT_FIND_PEER 145
+#define GNUNET_MESSAGE_TYPE_DHT_FIND_PEER 148
 
 /**
  * Local DHT Get stop message, from API to service
  */
-#define GNUNET_MESSAGE_TYPE_DHT_FIND_PEER_STOP 146
+#define GNUNET_MESSAGE_TYPE_DHT_FIND_PEER_STOP 149
 
 /**
  * Local DHT Put message, from API to service
  */
-#define GNUNET_MESSAGE_TYPE_DHT_PUT 147
+#define GNUNET_MESSAGE_TYPE_DHT_PUT 150
 
 /**
  * Local DHT Get result message, from service to API
  */
-#define GNUNET_MESSAGE_TYPE_DHT_GET_RESULT 149
+#define GNUNET_MESSAGE_TYPE_DHT_GET_RESULT 151
 
-/**
- * Local DHT Put result message, from service to API
- */
-#define GNUNET_MESSAGE_TYPE_DHT_PUT_RESULT 151
 
-
-
 /**
  * Type used to match 'all' message types.
  */





reply via email to

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