gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r17060 - in gnunet/src: hello include


From: gnunet
Subject: [GNUnet-SVN] r17060 - in gnunet/src: hello include
Date: Tue, 27 Sep 2011 16:20:12 +0200

Author: grothoff
Date: 2011-09-27 16:20:12 +0200 (Tue, 27 Sep 2011)
New Revision: 17060

Modified:
   gnunet/src/hello/hello.c
   gnunet/src/include/gnunet_dht_service_new.h
   gnunet/src/include/gnunet_hello_lib.h
Log:
helper

Modified: gnunet/src/hello/hello.c
===================================================================
--- gnunet/src/hello/hello.c    2011-09-27 14:09:26 UTC (rev 17059)
+++ gnunet/src/hello/hello.c    2011-09-27 14:20:12 UTC (rev 17060)
@@ -590,6 +590,7 @@
   return GNUNET_OK;
 }
 
+
 /**
  * Test if two HELLO messages contain the same addresses.
  * If they only differ in expiration time, the lowest
@@ -629,4 +630,33 @@
 }
 
 
+static int
+find_min_expire (void *cls, const char *tname,
+                struct GNUNET_TIME_Absolute expiration, const void *addr,
+                uint16_t addrlen)
+{
+  struct GNUNET_TIME_Absolute *min = cls;
+
+  *min = GNUNET_TIME_absolute_min (*min, expiration);
+  return GNUNET_OK;
+}
+
+
+/**
+ * When does the last address in the given HELLO expire?
+ *
+ * @param msg HELLO to inspect
+ * @return time the last address expires, 0 if there are no addresses in the 
HELLO
+ */
+struct GNUNET_TIME_Absolute
+GNUNET_HELLO_get_last_expiration (const struct GNUNET_HELLO_Message *msg)
+{
+  struct GNUNET_TIME_Absolute ret;
+
+  ret.abs_value = 0;
+  GNUNET_HELLO_iterate_addresses (msg, GNUNET_NO, &find_min_expire, &ret);
+  return ret;
+}
+
+
 /* end of hello.c */

Modified: gnunet/src/include/gnunet_dht_service_new.h
===================================================================
--- gnunet/src/include/gnunet_dht_service_new.h 2011-09-27 14:09:26 UTC (rev 
17059)
+++ gnunet/src/include/gnunet_dht_service_new.h 2011-09-27 14:20:12 UTC (rev 
17060)
@@ -142,10 +142,10 @@
  * @param cls closure
  * @param exp when will this value expire
  * @param key key of the result
- * @param get_path NULL-terminated array of pointers
- *                 to the peers on reverse GET path (or NULL if not recorded)
- * @param put_path NULL-terminated array of pointers
- *                 to the peers on the PUT path (or NULL if not recorded)
+ * @param get_path peers on reply path (or NULL if not recorded)
+ * @param get_path_length number of entries in get_path
+ * @param put_path peers on the PUT path (or NULL if not recorded)
+ * @param put_path_length number of entries in get_path
  * @param type type of the result
  * @param size number of bytes in data
  * @param data pointer to the result data
@@ -153,10 +153,10 @@
 typedef void (*GNUNET_DHT_GetIterator) (void *cls,
                                         struct GNUNET_TIME_Absolute exp,
                                         const GNUNET_HashCode * key,
-                                        const struct GNUNET_PeerIdentity *
-                                        const *get_path,
-                                        const struct GNUNET_PeerIdentity *
-                                        const *put_path,
+                                        const struct GNUNET_PeerIdentity 
*get_path,
+                                       unsigned int get_path_length,
+                                        const struct GNUNET_PeerIdentity 
*put_path,
+                                       unsigned int put_path_length,
                                         enum GNUNET_BLOCK_Type type,
                                         size_t size, const void *data);
 
@@ -173,8 +173,6 @@
  * @param desired_replication_level estimate of how many
                   nearest peers this request should reach
  * @param options routing options for this message
- * @param bf bloom filter associated with query (can be NULL)
- * @param bf_mutator mutation value for bf
  * @param xquery extended query data (can be NULL, depending on type)
  * @param xquery_size number of bytes in xquery
  * @param iter function to call on each result
@@ -188,8 +186,7 @@
                       enum GNUNET_BLOCK_Type type, const GNUNET_HashCode * key,
                       uint32_t desired_replication_level,
                       enum GNUNET_DHT_RouteOption options,
-                      const struct GNUNET_CONTAINER_BloomFilter *bf,
-                      int32_t bf_mutator, const void *xquery,
+                      const void *xquery,
                       size_t xquery_size, GNUNET_DHT_GetIterator iter,
                       void *iter_cls);
 

Modified: gnunet/src/include/gnunet_hello_lib.h
===================================================================
--- gnunet/src/include/gnunet_hello_lib.h       2011-09-27 14:09:26 UTC (rev 
17059)
+++ gnunet/src/include/gnunet_hello_lib.h       2011-09-27 14:20:12 UTC (rev 
17060)
@@ -161,6 +161,16 @@
 
 
 /**
+ * When does the last address in the given HELLO expire?
+ *
+ * @param msg HELLO to inspect
+ * @return time the last address expires, 0 if there are no addresses in the 
HELLO
+ */
+struct GNUNET_TIME_Absolute
+GNUNET_HELLO_get_last_expiration (const struct GNUNET_HELLO_Message *msg);
+
+
+/**
  * Iterate over all of the addresses in the HELLO.
  *
  * @param msg HELLO to iterate over; client does not need to




reply via email to

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