aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/fs/fs.h16
-rw-r--r--src/fs/fs_api.h10
-rw-r--r--src/fs/fs_uri.c30
-rw-r--r--src/include/gnunet_fs_service.h25
4 files changed, 17 insertions, 64 deletions
diff --git a/src/fs/fs.h b/src/fs/fs.h
index 9a987303b..c4a3e00ae 100644
--- a/src/fs/fs.h
+++ b/src/fs/fs.h
@@ -37,7 +37,7 @@
37/** 37/**
38 * Size of the individual blocks used for file-sharing. 38 * Size of the individual blocks used for file-sharing.
39 */ 39 */
40#define DBLOCK_SIZE (32*1024) 40#define DBLOCK_SIZE (32 * 1024)
41 41
42/** 42/**
43 * Blocksize to use when hashing files for indexing (blocksize for IO, 43 * Blocksize to use when hashing files for indexing (blocksize for IO,
@@ -83,7 +83,7 @@ struct IndexStartMessage
83{ 83{
84 84
85 /** 85 /**
86 * Message type will be GNUNET_MESSAGE_TYPE_FS_INDEX_START. 86 * Message type will be #GNUNET_MESSAGE_TYPE_FS_INDEX_START.
87 */ 87 */
88 struct GNUNET_MessageHeader header; 88 struct GNUNET_MessageHeader header;
89 89
@@ -129,7 +129,7 @@ struct IndexInfoMessage
129{ 129{
130 /** 130 /**
131 * Message type will be 131 * Message type will be
132 * GNUNET_MESSAGE_TYPE_FS_INDEX_LIST_ENTRY. 132 * #GNUNET_MESSAGE_TYPE_FS_INDEX_LIST_ENTRY.
133 */ 133 */
134 struct GNUNET_MessageHeader header; 134 struct GNUNET_MessageHeader header;
135 135
@@ -161,8 +161,7 @@ struct UnindexMessage
161{ 161{
162 162
163 /** 163 /**
164 * Message type will be 164 * Message type will be #GNUNET_MESSAGE_TYPE_FS_UNINDEX.
165 * GNUNET_MESSAGE_TYPE_FS_UNINDEX.
166 */ 165 */
167 struct GNUNET_MessageHeader header; 166 struct GNUNET_MessageHeader header;
168 167
@@ -206,8 +205,7 @@ struct SearchMessage
206{ 205{
207 206
208 /** 207 /**
209 * Message type will be 208 * Message type will be #GNUNET_MESSAGE_TYPE_FS_START_SEARCH.
210 * GNUNET_MESSAGE_TYPE_FS_START_SEARCH.
211 */ 209 */
212 struct GNUNET_MessageHeader header; 210 struct GNUNET_MessageHeader header;
213 211
@@ -268,7 +266,7 @@ struct PutMessage
268{ 266{
269 267
270 /** 268 /**
271 * Message type will be GNUNET_MESSAGE_TYPE_FS_PUT. 269 * Message type will be #GNUNET_MESSAGE_TYPE_FS_PUT.
272 */ 270 */
273 struct GNUNET_MessageHeader header; 271 struct GNUNET_MessageHeader header;
274 272
@@ -296,7 +294,7 @@ struct ClientPutMessage
296{ 294{
297 295
298 /** 296 /**
299 * Message type will be GNUNET_MESSAGE_TYPE_FS_PUT. 297 * Message type will be #GNUNET_MESSAGE_TYPE_FS_PUT.
300 */ 298 */
301 struct GNUNET_MessageHeader header; 299 struct GNUNET_MessageHeader header;
302 300
diff --git a/src/fs/fs_api.h b/src/fs/fs_api.h
index 83e8c3801..441e4fa9b 100644
--- a/src/fs/fs_api.h
+++ b/src/fs/fs_api.h
@@ -35,11 +35,6 @@
35#include "fs.h" 35#include "fs.h"
36 36
37/** 37/**
38 * Size of the individual blocks used for file-sharing.
39 */
40#define DBLOCK_SIZE (32*1024)
41
42/**
43 * Pick a multiple of 2 here to achive 8-byte alignment! We also 38 * Pick a multiple of 2 here to achive 8-byte alignment! We also
44 * probably want DBlocks to have (roughly) the same size as IBlocks. 39 * probably want DBlocks to have (roughly) the same size as IBlocks.
45 * With SHA-512, the optimal value is 32768 byte / 128 byte = 256 (128 40 * With SHA-512, the optimal value is 32768 byte / 128 byte = 256 (128
@@ -206,10 +201,11 @@ struct GNUNET_FS_Uri
206 struct GNUNET_CRYPTO_EccPublicKey ns; 201 struct GNUNET_CRYPTO_EccPublicKey ns;
207 202
208 /** 203 /**
209 * Human-readable identifier chosen for this 204 * Human-readable identifier chosen for this entry in the
210 * entry in the namespace. 205 * namespace.
211 */ 206 */
212 char *identifier; 207 char *identifier;
208
213 } sks; 209 } sks;
214 210
215 /** 211 /**
diff --git a/src/fs/fs_uri.c b/src/fs/fs_uri.c
index e35287bef..23a368261 100644
--- a/src/fs/fs_uri.c
+++ b/src/fs/fs_uri.c
@@ -1352,38 +1352,10 @@ GNUNET_FS_uri_sks_get_content_id (const struct GNUNET_FS_Uri *uri)
1352 1352
1353 1353
1354/** 1354/**
1355 * Convert namespace URI to a human readable format
1356 * (using the namespace description, if available).
1357 *
1358 * @param cfg configuration to use
1359 * @param uri SKS uri to convert
1360 * @return NULL on error (not an SKS URI)
1361 */
1362char *
1363GNUNET_FS_uri_sks_to_string_fancy (struct GNUNET_CONFIGURATION_Handle *cfg,
1364 const struct GNUNET_FS_Uri *uri)
1365{
1366 char *ret;
1367 char *name;
1368 char *unique_name;
1369
1370 if (uri->type != GNUNET_FS_URI_SKS)
1371 return NULL;
1372 (void) GNUNET_FS_pseudonym_get_info (cfg, &uri->data.sks.ns,
1373 NULL, NULL, &name, NULL);
1374 unique_name = GNUNET_FS_pseudonym_name_uniquify (cfg, &uri->data.sks.ns, name, NULL);
1375 GNUNET_free (name);
1376 GNUNET_asprintf (&ret, "%s: %s", unique_name, uri->data.sks.identifier);
1377 GNUNET_free (unique_name);
1378 return ret;
1379}
1380
1381
1382/**
1383 * Is this a keyword URI? 1355 * Is this a keyword URI?
1384 * 1356 *
1385 * @param uri the uri 1357 * @param uri the uri
1386 * @return GNUNET_YES if this is a KSK uri 1358 * @return #GNUNET_YES if this is a KSK uri
1387 */ 1359 */
1388int 1360int
1389GNUNET_FS_uri_test_ksk (const struct GNUNET_FS_Uri *uri) 1361GNUNET_FS_uri_test_ksk (const struct GNUNET_FS_Uri *uri)
diff --git a/src/include/gnunet_fs_service.h b/src/include/gnunet_fs_service.h
index 5dcee17cd..a49d8fb98 100644
--- a/src/include/gnunet_fs_service.h
+++ b/src/include/gnunet_fs_service.h
@@ -85,7 +85,7 @@ struct GNUNET_FS_Uri;
85 * @param cls closure 85 * @param cls closure
86 * @param keyword the keyword 86 * @param keyword the keyword
87 * @param is_mandatory is the keyword mandatory (in a search) 87 * @param is_mandatory is the keyword mandatory (in a search)
88 * @return GNUNET_OK to continue to iterate, GNUNET_SYSERR to abort 88 * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to abort
89 */ 89 */
90typedef int (*GNUNET_FS_KeywordIterator) (void *cls, const char *keyword, 90typedef int (*GNUNET_FS_KeywordIterator) (void *cls, const char *keyword,
91 int is_mandatory); 91 int is_mandatory);
@@ -101,7 +101,7 @@ typedef int (*GNUNET_FS_KeywordIterator) (void *cls, const char *keyword,
101 * @param unique_name unique name of the pseudonym (might be NULL) 101 * @param unique_name unique name of the pseudonym (might be NULL)
102 * @param md meta data known about the pseudonym 102 * @param md meta data known about the pseudonym
103 * @param rating the local rating of the pseudonym 103 * @param rating the local rating of the pseudonym
104 * @return GNUNET_OK to continue iteration, GNUNET_SYSERR to abort 104 * @return #GNUNET_OK to continue iteration, #GNUNET_SYSERR to abort
105 */ 105 */
106typedef int (*GNUNET_FS_PseudonymIterator) (void *cls, 106typedef int (*GNUNET_FS_PseudonymIterator) (void *cls,
107 const struct GNUNET_CRYPTO_EccPublicKey *pseudonym, 107 const struct GNUNET_CRYPTO_EccPublicKey *pseudonym,
@@ -217,9 +217,9 @@ GNUNET_FS_pseudonym_name_uniquify (const struct GNUNET_CONFIGURATION_Handle *cfg
217 * @param ret_rank a location to store rank. NULL, if rank not needed. 217 * @param ret_rank a location to store rank. NULL, if rank not needed.
218 * @param ret_name a location to store human-readable name. Name is not unique. 218 * @param ret_name a location to store human-readable name. Name is not unique.
219 * NULL, if name is not needed. Free with GNUNET_free(). 219 * NULL, if name is not needed. Free with GNUNET_free().
220 * @param name_is_a_dup is set to GNUNET_YES, if ret_name was filled with 220 * @param name_is_a_dup is set to #GNUNET_YES, if ret_name was filled with
221 * a duplicate of a "no-name" placeholder 221 * a duplicate of a "no-name" placeholder
222 * @return GNUNET_OK on success. GNUENT_SYSERR if the data was 222 * @return #GNUNET_OK on success. #GNUENT_SYSERR if the data was
223 * unobtainable (in that case ret_* are filled with placeholders - 223 * unobtainable (in that case ret_* are filled with placeholders -
224 * empty metadata container, rank -1 and a "no-name" name). 224 * empty metadata container, rank -1 and a "no-name" name).
225 */ 225 */
@@ -238,7 +238,7 @@ GNUNET_FS_pseudonym_get_info (const struct GNUNET_CONFIGURATION_Handle *cfg,
238 * @param cfg configuration to use 238 * @param cfg configuration to use
239 * @param ns_uname unique (!) human-readable name for the pseudonym 239 * @param ns_uname unique (!) human-readable name for the pseudonym
240 * @param pseudonym set to pseudonym ID based on 'ns_uname' 240 * @param pseudonym set to pseudonym ID based on 'ns_uname'
241 * @return GNUNET_OK on success, GNUNET_SYSERR on failure 241 * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure
242 */ 242 */
243int 243int
244GNUNET_FS_pseudonym_name_to_id (const struct GNUNET_CONFIGURATION_Handle *cfg, 244GNUNET_FS_pseudonym_name_to_id (const struct GNUNET_CONFIGURATION_Handle *cfg,
@@ -256,7 +256,7 @@ GNUNET_FS_pseudonym_name_to_id (const struct GNUNET_CONFIGURATION_Handle *cfg,
256 * @param md metadata to set 256 * @param md metadata to set
257 * May be NULL, in which case it erases pseudonym's metadata! 257 * May be NULL, in which case it erases pseudonym's metadata!
258 * @param rank rank to assign 258 * @param rank rank to assign
259 * @return GNUNET_OK on success, GNUNET_SYSERR on failure 259 * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure
260 */ 260 */
261int 261int
262GNUNET_FS_pseudonym_set_info (const struct GNUNET_CONFIGURATION_Handle *cfg, 262GNUNET_FS_pseudonym_set_info (const struct GNUNET_CONFIGURATION_Handle *cfg,
@@ -538,19 +538,6 @@ GNUNET_FS_uri_sks_get_content_id (const struct GNUNET_FS_Uri *uri);
538 538
539 539
540/** 540/**
541 * Convert namespace URI to a human readable format
542 * (using the namespace description, if available).
543 *
544 * @param cfg configuration to use
545 * @param uri SKS uri to convert
546 * @return NULL on error (not an SKS URI)
547 */
548char *
549GNUNET_FS_uri_sks_to_string_fancy (struct GNUNET_CONFIGURATION_Handle *cfg,
550 const struct GNUNET_FS_Uri *uri);
551
552
553/**
554 * Is this a keyword URI? 541 * Is this a keyword URI?
555 * 542 *
556 * @param uri the uri 543 * @param uri the uri