return GNUNET_OK;
}
+
/**
* Test if two HELLO messages contain the same addresses.
* If they only differ in expiration time, the lowest
}
+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 */
* @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
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);
* @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
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);