aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_namestore_plugin.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-02-21 15:32:34 +0000
committerChristian Grothoff <christian@grothoff.org>2012-02-21 15:32:34 +0000
commit39895e8a886613dc0df246023aba2f85a0fe9071 (patch)
treead82c33a784cdb20d518d62a9f28ecfcbbe3241c /src/include/gnunet_namestore_plugin.h
parentdf2725fc53449fb9cbc61e402d5124f5266743dc (diff)
downloadgnunet-39895e8a886613dc0df246023aba2f85a0fe9071.tar.gz
gnunet-39895e8a886613dc0df246023aba2f85a0fe9071.zip
-DB API updates, creating tables and preparing statements
Diffstat (limited to 'src/include/gnunet_namestore_plugin.h')
-rw-r--r--src/include/gnunet_namestore_plugin.h28
1 files changed, 13 insertions, 15 deletions
diff --git a/src/include/gnunet_namestore_plugin.h b/src/include/gnunet_namestore_plugin.h
index ecdc40f09..d19c3aeb2 100644
--- a/src/include/gnunet_namestore_plugin.h
+++ b/src/include/gnunet_namestore_plugin.h
@@ -47,8 +47,6 @@ extern "C"
47 * 47 *
48 * @param cls closure 48 * @param cls closure
49 * @param zone hash of the public key of the zone 49 * @param zone hash of the public key of the zone
50 * @param record_hash hash of the record
51 * @param record_key XOR of zone and hash of name
52 * @param name name that is being mapped (at most 255 characters long) 50 * @param name name that is being mapped (at most 255 characters long)
53 * @param record_type type of the record (A, AAAA, PKEY, etc.) 51 * @param record_type type of the record (A, AAAA, PKEY, etc.)
54 * @param expiration expiration time for the content 52 * @param expiration expiration time for the content
@@ -59,8 +57,6 @@ extern "C"
59 */ 57 */
60typedef void (*GNUNET_NAMESTORE_RecordIterator) (void *cls, 58typedef void (*GNUNET_NAMESTORE_RecordIterator) (void *cls,
61 const GNUNET_HashCode *zone, 59 const GNUNET_HashCode *zone,
62 const GNUNET_HashCode *record_hash,
63 const GNUNET_HashCode *record_key,
64 const char *name, 60 const char *name,
65 uint32_t record_type, 61 uint32_t record_type,
66 struct GNUNET_TIME_Absolute expiration, 62 struct GNUNET_TIME_Absolute expiration,
@@ -94,13 +90,15 @@ typedef void (*GNUNET_NAMESTORE_NodeCallback) (void *cls,
94 * @param cls closure 90 * @param cls closure
95 * @param zone public key of the zone 91 * @param zone public key of the zone
96 * @param loc location of the root in the B-tree (depth, revision) 92 * @param loc location of the root in the B-tree (depth, revision)
97 * @param top_sig 93 * @param top_sig signature signing the zone
94 * @param zone_time time the signature was created
98 * @param root_hash top level hash that is being signed 95 * @param root_hash top level hash that is being signed
99 */ 96 */
100typedef void (*GNUNET_NAMESTORE_SignatureCallback) (void *cls, 97typedef void (*GNUNET_NAMESTORE_SignatureCallback) (void *cls,
101 const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key, 98 const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key,
102 const struct GNUNET_NAMESTORE_SignatureLocation *loc, 99 const struct GNUNET_NAMESTORE_SignatureLocation *loc,
103 const struct GNUNET_CRYPTO_RsaSignature *top_sig, 100 const struct GNUNET_CRYPTO_RsaSignature *top_sig,
101 struct GNUNET_TIME_Absolute zone_time,
104 const GNUNET_HashCode *root_hash); 102 const GNUNET_HashCode *root_hash);
105 103
106 104
@@ -120,10 +118,9 @@ struct GNUNET_NAMESTORE_PluginFunctions
120 * 118 *
121 * @param cls closure (internal context for the plugin) 119 * @param cls closure (internal context for the plugin)
122 * @param zone hash of the public key of the zone 120 * @param zone hash of the public key of the zone
123 * @param record_hash hash of the record
124 * @param record_key XOR of zone and hash of name
125 * @param name name that is being mapped (at most 255 characters long) 121 * @param name name that is being mapped (at most 255 characters long)
126 * @param record_type type of the record (A, AAAA, PKEY, etc.) 122 * @param record_type type of the record (A, AAAA, PKEY, etc.)
123 * @param loc location of the signature for the record
127 * @param expiration expiration time for the content 124 * @param expiration expiration time for the content
128 * @param flags flags for the content 125 * @param flags flags for the content
129 * @param data_size number of bytes in data 126 * @param data_size number of bytes in data
@@ -133,10 +130,9 @@ struct GNUNET_NAMESTORE_PluginFunctions
133 */ 130 */
134 int (*put_record) (void *cls, 131 int (*put_record) (void *cls,
135 const GNUNET_HashCode *zone, 132 const GNUNET_HashCode *zone,
136 const GNUNET_HashCode *record_hash,
137 const GNUNET_HashCode *record_key,
138 const char *name, 133 const char *name,
139 uint32_t record_type, 134 uint32_t record_type,
135 const struct GNUNET_NAMESTORE_SignatureLocation *loc,
140 struct GNUNET_TIME_Absolute expiration, 136 struct GNUNET_TIME_Absolute expiration,
141 enum GNUNET_NAMESTORE_RecordFlags flags, 137 enum GNUNET_NAMESTORE_RecordFlags flags,
142 size_t data_size, 138 size_t data_size,
@@ -149,7 +145,8 @@ struct GNUNET_NAMESTORE_PluginFunctions
149 * @param cls closure (internal context for the plugin) 145 * @param cls closure (internal context for the plugin)
150 * @param zone hash of public key of the zone 146 * @param zone hash of public key of the zone
151 * @param loc location in the B-tree 147 * @param loc location in the B-tree
152 * @param ploc parent's location in the B-tree (must have depth = loc.depth - 1), NULL for root 148 * @param ploc parent's location in the B-tree (must have depth = loc.depth - 1) and the
149 * revision must also match loc's revision; NULL for root
153 * @param num_entries number of entries at this node in the B-tree 150 * @param num_entries number of entries at this node in the B-tree
154 * @param entries the 'num_entries' entries to store (hashes over the 151 * @param entries the 'num_entries' entries to store (hashes over the
155 * records) 152 * records)
@@ -172,15 +169,17 @@ struct GNUNET_NAMESTORE_PluginFunctions
172 * @param cls closure (internal context for the plugin) 169 * @param cls closure (internal context for the plugin)
173 * @param zone_key public key of the zone 170 * @param zone_key public key of the zone
174 * @param loc location in the B-tree (top of the tree, offset 0, depth at 'maximum') 171 * @param loc location in the B-tree (top of the tree, offset 0, depth at 'maximum')
175 * @param top_sig signature at the top, NULL if 'loc.depth > 0' 172 * @param top_sig signature at the top
176 * @param root_hash top level hash that is signed 173 * @param root_hash top level hash that is signed
174 * @param zone_time time the zone was signed
177 * @return GNUNET_OK on success 175 * @return GNUNET_OK on success
178 */ 176 */
179 int (*put_signature) (void *cls, 177 int (*put_signature) (void *cls,
180 const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key, 178 const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key,
181 const struct GNUNET_NAMESTORE_SignatureLocation *loc, 179 const struct GNUNET_NAMESTORE_SignatureLocation *loc,
182 const struct GNUNET_CRYPTO_RsaSignature *top_sig, 180 const struct GNUNET_CRYPTO_RsaSignature *top_sig,
183 const GNUNET_HashCode *root_hash); 181 const GNUNET_HashCode *root_hash,
182 struct GNUNET_TIME_Absolute zone_time);
184 183
185 184
186 /** 185 /**
@@ -191,15 +190,14 @@ struct GNUNET_NAMESTORE_PluginFunctions
191 * 190 *
192 * @param cls closure (internal context for the plugin) 191 * @param cls closure (internal context for the plugin)
193 * @param zone hash of public key of the zone 192 * @param zone hash of public key of the zone
194 * @param record_key key for the record (XOR of zone and hash of name); 193 * @param name_hash hash of name, NULL to iterate over all records of the zone
195 * NULL to iterate over all records of the zone
196 * @param iter maybe NULL (to just count) 194 * @param iter maybe NULL (to just count)
197 * @param iter_cls closure for iter 195 * @param iter_cls closure for iter
198 * @return the number of results found 196 * @return the number of results found
199 */ 197 */
200 unsigned int (*iterate_records) (void *cls, 198 unsigned int (*iterate_records) (void *cls,
201 const GNUNET_HashCode *zone, 199 const GNUNET_HashCode *zone,
202 const GNUNET_HashCode *record_key, 200 const GNUNET_HashCode *name_hash,
203 GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls); 201 GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls);
204 202
205 203