aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2009-08-27 11:14:19 +0000
committerChristian Grothoff <christian@grothoff.org>2009-08-27 11:14:19 +0000
commit57df0fbf8398720fbd4a9cf34934c212ea00ee54 (patch)
treea00d5740b2a35e21d4cff044c4ce941995b1bdff /src/include
parent2f7e69f969a822a38f9e311f79358e0fe8bda9d8 (diff)
downloadgnunet-57df0fbf8398720fbd4a9cf34934c212ea00ee54.tar.gz
gnunet-57df0fbf8398720fbd4a9cf34934c212ea00ee54.zip
syn
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gnunet_constants.h7
-rw-r--r--src/include/gnunet_container_lib.h27
-rw-r--r--src/include/gnunet_crypto_lib.h2
-rw-r--r--src/include/gnunet_datastore_service.h6
-rw-r--r--src/include/gnunet_fs_service.h46
5 files changed, 74 insertions, 14 deletions
diff --git a/src/include/gnunet_constants.h b/src/include/gnunet_constants.h
index 2c917cc59..bb122eb64 100644
--- a/src/include/gnunet_constants.h
+++ b/src/include/gnunet_constants.h
@@ -55,6 +55,13 @@ extern "C"
55 */ 55 */
56#define GNUNET_CONSTANTS_EXEC_WAIT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 100) 56#define GNUNET_CONSTANTS_EXEC_WAIT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 100)
57 57
58/**
59 * After how long do we consider a service irresponsive
60 * even if we assume that the service commonly does not
61 * respond instantly (DNS, Database, etc.).
62 */
63#define GNUNET_CONSTANTS_SERVICE_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 10)
64
58 65
59#if 0 /* keep Emacsens' auto-indent happy */ 66#if 0 /* keep Emacsens' auto-indent happy */
60{ 67{
diff --git a/src/include/gnunet_container_lib.h b/src/include/gnunet_container_lib.h
index 291b99fa2..e2a0787c8 100644
--- a/src/include/gnunet_container_lib.h
+++ b/src/include/gnunet_container_lib.h
@@ -305,8 +305,8 @@ int GNUNET_CONTAINER_meta_data_extract_from_file (struct
305 305
306enum GNUNET_CONTAINER_MetaDataSerializationOptions 306enum GNUNET_CONTAINER_MetaDataSerializationOptions
307{ 307{
308 GNUNET_CONTAINER_META_DATA_SERIALIZE_FULL = GNUNET_NO, 308 GNUNET_CONTAINER_META_DATA_SERIALIZE_FULL = 0,
309 GNUNET_CONTAINER_META_DATA_SERIALIZE_PART = GNUNET_YES, 309 GNUNET_CONTAINER_META_DATA_SERIALIZE_PART = 1,
310 GNUNET_CONTAINER_META_DATA_SERIALIZE_NO_COMPRESS = 2 310 GNUNET_CONTAINER_META_DATA_SERIALIZE_NO_COMPRESS = 2
311}; 311};
312 312
@@ -323,10 +323,11 @@ enum GNUNET_CONTAINER_MetaDataSerializationOptions
323 * GNUNET_SYSERR on error (typically: not enough 323 * GNUNET_SYSERR on error (typically: not enough
324 * space) 324 * space)
325 */ 325 */
326int GNUNET_CONTAINER_meta_data_serialize (const struct 326ssize_t GNUNET_CONTAINER_meta_data_serialize (const struct
327 GNUNET_CONTAINER_MetaData *md, 327 GNUNET_CONTAINER_MetaData *md,
328 char *target, unsigned int size, 328 char *target,
329 enum 329 size_t size,
330 enum
330 GNUNET_CONTAINER_MetaDataSerializationOptions 331 GNUNET_CONTAINER_MetaDataSerializationOptions
331 opt); 332 opt);
332 333
@@ -337,12 +338,12 @@ int GNUNET_CONTAINER_meta_data_serialize (const struct
337 * meta-data to match the size constraint, 338 * meta-data to match the size constraint,
338 * possibly discarding some data? 339 * possibly discarding some data?
339 */ 340 */
340unsigned int GNUNET_CONTAINER_meta_data_get_serialized_size (const struct 341ssize_t GNUNET_CONTAINER_meta_data_get_serialized_size (const struct
341 GNUNET_CONTAINER_MetaData 342 GNUNET_CONTAINER_MetaData
342 *md, 343 *md,
343 enum 344 enum
344 GNUNET_CONTAINER_MetaDataSerializationOptions 345 GNUNET_CONTAINER_MetaDataSerializationOptions
345 opt); 346 opt);
346 347
347/** 348/**
348 * Deserialize meta-data. Initializes md. 349 * Deserialize meta-data. Initializes md.
@@ -352,7 +353,7 @@ unsigned int GNUNET_CONTAINER_meta_data_get_serialized_size (const struct
352 */ 353 */
353struct GNUNET_CONTAINER_MetaData 354struct GNUNET_CONTAINER_MetaData
354 *GNUNET_CONTAINER_meta_data_deserialize (const char *input, 355 *GNUNET_CONTAINER_meta_data_deserialize (const char *input,
355 unsigned int size); 356 size_t size);
356 357
357/** 358/**
358 * Does the meta-data claim that this is a directory? 359 * Does the meta-data claim that this is a directory?
diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h
index 361d244e2..168c79b2a 100644
--- a/src/include/gnunet_crypto_lib.h
+++ b/src/include/gnunet_crypto_lib.h
@@ -394,7 +394,7 @@ void GNUNET_CRYPTO_hash_xor (const GNUNET_HashCode * a,
394/** 394/**
395 * Convert a hashcode into a key. 395 * Convert a hashcode into a key.
396 */ 396 */
397void GNUNET_CRYPTO_hash_to_AES_key (const GNUNET_HashCode * hc, 397void GNUNET_CRYPTO_hash_to_aes_key (const GNUNET_HashCode * hc,
398 struct GNUNET_CRYPTO_AesSessionKey *skey, 398 struct GNUNET_CRYPTO_AesSessionKey *skey,
399 struct 399 struct
400 GNUNET_CRYPTO_AesInitializationVector 400 GNUNET_CRYPTO_AesInitializationVector
diff --git a/src/include/gnunet_datastore_service.h b/src/include/gnunet_datastore_service.h
index 28419126f..3805dea97 100644
--- a/src/include/gnunet_datastore_service.h
+++ b/src/include/gnunet_datastore_service.h
@@ -41,6 +41,12 @@ extern "C"
41#endif 41#endif
42#endif 42#endif
43 43
44#define GNUNET_DATASTORE_BLOCKTYPE_ANY 0
45#define GNUNET_DATASTORE_BLOCKTYPE_DBLOCK 1
46#define GNUNET_DATASTORE_BLOCKTYPE_IBLOCK 2
47#define GNUNET_DATASTORE_BLOCKTYPE_KBLOCK 3
48#define GNUNET_DATASTORE_BLOCKTYPE_SBLOCK 4
49#define GNUNET_DATASTORE_BLOCKTYPE_SKBLOCK 5
44 50
45/** 51/**
46 * Handle to the datastore service. 52 * Handle to the datastore service.
diff --git a/src/include/gnunet_fs_service.h b/src/include/gnunet_fs_service.h
index 4664c4cee..3c71d40e7 100644
--- a/src/include/gnunet_fs_service.h
+++ b/src/include/gnunet_fs_service.h
@@ -2169,6 +2169,52 @@ GNUNET_FS_directory_list_contents (size_t size,
2169 void *dep_cls); 2169 void *dep_cls);
2170 2170
2171 2171
2172/**
2173 * Opaque handle to a directory builder.
2174 */
2175struct GNUNET_FS_DirectoryBuilder;
2176
2177/**
2178 * Create a directory builder.
2179 *
2180 * @param mdir metadata for the directory
2181 */
2182struct GNUNET_FS_DirectoryBuilder *
2183GNUNET_FS_directory_builder_create (const struct GNUNET_CONTAINER_MetaData *mdir);
2184
2185
2186/**
2187 * Add an entry to a directory.
2188 *
2189 * @param bld directory to extend
2190 * @param uri uri of the entry (must not be a KSK)
2191 * @param md metadata of the entry
2192 * @param data raw data of the entry, can be NULL, otherwise
2193 * data must point to exactly the number of bytes specified
2194 * by the uri
2195 */
2196void
2197GNUNET_FS_directory_builder_add (struct GNUNET_FS_DirectoryBuilder *bld,
2198 const struct GNUNET_FS_Uri *uri,
2199 const struct GNUNET_CONTAINER_MetaData *md,
2200 const void *data);
2201
2202
2203/**
2204 * Finish building the directory. Frees the
2205 * builder context and returns the directory
2206 * in-memory.
2207 *
2208 * @param bld directory to finish
2209 * @param size set to the number of bytes needed
2210 * @param data set to the encoded directory
2211 */
2212void
2213GNUNET_FS_directory_builder_finish (struct GNUNET_FS_DirectoryBuilder *bld,
2214 size_t *size,
2215 void **data);
2216
2217
2172#if 0 /* keep Emacsens' auto-indent happy */ 2218#if 0 /* keep Emacsens' auto-indent happy */
2173{ 2219{
2174#endif 2220#endif