[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r19896 - gnunet/src/include
From: |
gnunet |
Subject: |
[GNUnet-SVN] r19896 - gnunet/src/include |
Date: |
Tue, 21 Feb 2012 16:38:01 +0100 |
Author: grothoff
Date: 2012-02-21 16:38:00 +0100 (Tue, 21 Feb 2012)
New Revision: 19896
Modified:
gnunet/src/include/gnunet_namestore_service.h
Log:
-DB API updates, creating tables and preparing statements
Modified: gnunet/src/include/gnunet_namestore_service.h
===================================================================
--- gnunet/src/include/gnunet_namestore_service.h 2012-02-21 15:32:34 UTC
(rev 19895)
+++ gnunet/src/include/gnunet_namestore_service.h 2012-02-21 15:38:00 UTC
(rev 19896)
@@ -253,8 +253,7 @@
* @param h handle to the namestore
* @param zone_key public key of the zone
* @param loc location in the B-tree
- * @param ploc parent's location in the B-tree (must have depth = loc.depth -
1), NULL for root
- * @param top_sig signature at the top, NULL if 'loc.depth > 0'
+ * @param ploc parent's location in the B-tree (must have depth = loc.depth -
1)
* @param num_entries number of entries at this node in the B-tree
* @param entries the 'num_entries' entries to store (hashes over the
* records)
@@ -267,7 +266,6 @@
const struct
GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key,
const struct GNUNET_NAMESTORE_SignatureLocation
*loc,
const struct GNUNET_NAMESTORE_SignatureLocation
*ploc,
- const struct GNUNET_CRYPTO_RsaSignature *sig,
unsigned int num_entries,
const GNUNET_HashCode *entries,
GNUNET_NAMESTORE_ContinuationWithStatus cont,
@@ -275,6 +273,33 @@
/**
+ * Store current zone signature in the namestore. This function
+ * is used by non-authorities to cache the top of a zone's signature tree.
+ * Note that the tree must be build top-down, so this function is called
+ * first for a given zone and revision.
+ *
+ * @param h handle to the namestore
+ * @param zone_key public key of the zone
+ * @param loc identifies the top of the B-tree (depth and revision)
+ * @param time time of the signature creation
+ * @param top_sig signature at the top
+ * @param root_hash top level hash code in the Merkle-tree / stree
+ * @param cont continuation to call when done
+ * @param cont_cls closure for cont
+ * @return handle to abort the request
+ */
+struct GNUNET_NAMESTORE_QueueEntry *
+GNUNET_NAMESTORE_signature_put (struct GNUNET_NAMESTORE_Handle *h,
+ const struct
GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key,
+ const struct GNUNET_NAMESTORE_SignatureLocation
*loc,
+ struct GNUNET_TIME_Absolute time,
+ const struct GNUNET_CRYPTO_RsaSignature
*top_sig,
+ const GNUNET_HashCode *root_hash,
+ GNUNET_NAMESTORE_ContinuationWithStatus cont,
+ void *cont_cls);
+
+
+/**
* Store an item in the namestore. If the item is already present,
* the expiration time is updated to the max of the existing time and
* the new time. The operation must fail if there is no matching
@@ -406,8 +431,7 @@
* @param cls closure
* @param zone hash of the public key of the zone
* @param loc where we are in the signature tree
- * @param ploc location of our parent in the signature tree (NULL if
'loc.depth == 0')
- * @param top_sig signature at the root (NULL if 'loc.depth > 0')
+ * @param ploc location of our parent in the signature tree
* @param num_entries number of entries being stored here
* @param entries the entries themselves
*/
@@ -415,7 +439,6 @@
const GNUNET_HashCode *zone,
const struct
GNUNET_NAMESTORE_SignatureLocation *loc,
const struct
GNUNET_NAMESTORE_SignatureLocation *ploc,
- const struct
GNUNET_CRYPTO_RsaSignature *top_sig,
unsigned int num_entries,
const GNUNET_HashCode
*entries);
@@ -439,8 +462,43 @@
const struct GNUNET_NAMESTORE_SignatureLocation
*sig_loc,
GNUNET_NAMESTORE_StreeProcessor proc, void
*proc_cls);
+/**
+ * Process zone signature information that was stored in the namestore.
+ *
+ * @param cls closure
+ * @param zone hash of the public key of the zone
+ * @param loc where we are in the signature tree (identifies top)
+ * @param top_sig signature at the root
+ * @param time timestamp of the signature
+ * @param top_hash hash at the top of the tree
+ */
+typedef void (*GNUNET_NAMESTORE_SignatureProcessor) (void *cls,
+ const GNUNET_HashCode
*zone,
+ const struct
GNUNET_NAMESTORE_SignatureLocation *loc,
+ const struct
GNUNET_CRYPTO_RsaSignature *top_sig,
+ struct
GNUNET_TIME_Absolute time,
+ const GNUNET_HashCode
*top_hash);
+
/**
+ * Obtain latest/current signature of a zone. The processor
+ * will only be called once.
+ *
+ * @param h handle to the namestore
+ * @param zone zone to look up a record from
+ * @param proc function to call on each matching value;
+ * will be called once with a NULL value at the end
+ * @param proc_cls closure for proc
+ * @return a handle that can be used to
+ * cancel
+ */
+struct GNUNET_NAMESTORE_QueueEntry *
+GNUNET_NAMESTORE_lookup_stree (struct GNUNET_NAMESTORE_Handle *h,
+ const GNUNET_HashCode *zone,
+ GNUNET_NAMESTORE_StreeProcessor proc, void
*proc_cls);
+
+
+/**
* Get all records of a zone.
*
* @param h handle to the namestore
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r19896 - gnunet/src/include,
gnunet <=