diff options
Diffstat (limited to 'src/include/gnunet_fs_service.h')
-rw-r--r-- | src/include/gnunet_fs_service.h | 121 |
1 files changed, 15 insertions, 106 deletions
diff --git a/src/include/gnunet_fs_service.h b/src/include/gnunet_fs_service.h index efe2cd004..931406e2d 100644 --- a/src/include/gnunet_fs_service.h +++ b/src/include/gnunet_fs_service.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet | 2 | This file is part of GNUnet |
3 | (C) 2004, 2005, 2006, 2007, 2008, 2009 Christian Grothoff (and other contributing authors) | 3 | (C) 2004--2013 Christian Grothoff (and other contributing authors) |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
@@ -54,8 +54,9 @@ extern "C" | |||
54 | * 6.1.x: with simplified namespace support | 54 | * 6.1.x: with simplified namespace support |
55 | * 9.0.0: CPS-style integrated API | 55 | * 9.0.0: CPS-style integrated API |
56 | * 9.1.1: asynchronous directory scanning | 56 | * 9.1.1: asynchronous directory scanning |
57 | * 9.2.0: unified K-Block and S-block format (#2564) | ||
57 | */ | 58 | */ |
58 | #define GNUNET_FS_VERSION 0x00090103 | 59 | #define GNUNET_FS_VERSION 0x00090200 |
59 | 60 | ||
60 | 61 | ||
61 | /* ******************** URI API *********************** */ | 62 | /* ******************** URI API *********************** */ |
@@ -342,25 +343,26 @@ GNUNET_FS_uri_sks_create (struct GNUNET_FS_Namespace *ns, const char *id, | |||
342 | /** | 343 | /** |
343 | * Create an SKS URI from a namespace ID and an identifier. | 344 | * Create an SKS URI from a namespace ID and an identifier. |
344 | * | 345 | * |
345 | * @param nsid namespace ID | 346 | * @param pseudonym pseudonym to use |
346 | * @param id identifier | 347 | * @param id identifier |
347 | * @return an FS URI for the given namespace and identifier | 348 | * @return an FS URI for the given namespace and identifier |
348 | */ | 349 | */ |
349 | struct GNUNET_FS_Uri * | 350 | struct GNUNET_FS_Uri * |
350 | GNUNET_FS_uri_sks_create_from_nsid (struct GNUNET_HashCode * nsid, const char *id); | 351 | GNUNET_FS_uri_sks_create_from_nsid (struct GNUNET_PseudonymIdentifier *pseudonym, |
352 | const char *id); | ||
351 | 353 | ||
352 | 354 | ||
353 | /** | 355 | /** |
354 | * Get the ID of a namespace from the given | 356 | * Get the public key of a namespace from the given |
355 | * namespace URI. | 357 | * namespace URI. |
356 | * | 358 | * |
357 | * @param uri the uri to get the namespace ID from | 359 | * @param uri the uri to get the namespace ID from |
358 | * @param nsid where to store the ID of the namespace | 360 | * @param pseudonym where to store the public key of the namespace |
359 | * @return GNUNET_OK on success | 361 | * @return GNUNET_OK on success |
360 | */ | 362 | */ |
361 | int | 363 | int |
362 | GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri, | 364 | GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri, |
363 | struct GNUNET_HashCode * nsid); | 365 | struct GNUNET_PseudonymIdentifier *pseudonym); |
364 | 366 | ||
365 | 367 | ||
366 | /** | 368 | /** |
@@ -1403,9 +1405,9 @@ struct GNUNET_FS_ProgressInfo | |||
1403 | const struct GNUNET_CONTAINER_MetaData *meta; | 1405 | const struct GNUNET_CONTAINER_MetaData *meta; |
1404 | 1406 | ||
1405 | /** | 1407 | /** |
1406 | * Hash-identifier for the namespace. | 1408 | * Public key of the namespace. |
1407 | */ | 1409 | */ |
1408 | struct GNUNET_HashCode id; | 1410 | struct GNUNET_PseudonymIdentifier pseudonym; |
1409 | 1411 | ||
1410 | } ns; | 1412 | } ns; |
1411 | 1413 | ||
@@ -2189,60 +2191,6 @@ GNUNET_FS_unindex_stop (struct GNUNET_FS_UnindexContext *uc); | |||
2189 | 2191 | ||
2190 | 2192 | ||
2191 | /** | 2193 | /** |
2192 | * Context for advertising a namespace. | ||
2193 | */ | ||
2194 | struct GNUNET_FS_AdvertisementContext; | ||
2195 | |||
2196 | |||
2197 | /** | ||
2198 | * Publish an advertismement for a namespace. | ||
2199 | * | ||
2200 | * @param h handle to the file sharing subsystem | ||
2201 | * @param ksk_uri keywords to use for advertisment | ||
2202 | * @param ns handle for the namespace that should be advertised | ||
2203 | * @param meta meta-data for the namespace advertisement | ||
2204 | * @param bo block options | ||
2205 | * @param rootEntry name of the root of the namespace | ||
2206 | * @param cont continuation | ||
2207 | * @param cont_cls closure for cont | ||
2208 | * @return NULL on error ('cont' will still be called) | ||
2209 | */ | ||
2210 | struct GNUNET_FS_AdvertisementContext * | ||
2211 | GNUNET_FS_namespace_advertise (struct GNUNET_FS_Handle *h, | ||
2212 | struct GNUNET_FS_Uri *ksk_uri, | ||
2213 | struct GNUNET_FS_Namespace *ns, | ||
2214 | const struct GNUNET_CONTAINER_MetaData *meta, | ||
2215 | const struct GNUNET_FS_BlockOptions *bo, | ||
2216 | const char *rootEntry, | ||
2217 | GNUNET_FS_PublishContinuation cont, | ||
2218 | void *cont_cls); | ||
2219 | |||
2220 | |||
2221 | /** | ||
2222 | * Create an SKS uri that points to the root entry of the namespace, | ||
2223 | * then insert that SKS uri into metadata. | ||
2224 | * | ||
2225 | * @param ns handle for the namespace that should be advertised | ||
2226 | * @param meta meta-data into which namespace advertisement should be inserted | ||
2227 | * @param rootEntry name of the root of the namespace (use NULL to use default) | ||
2228 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | ||
2229 | */ | ||
2230 | int | ||
2231 | GNUNET_FS_namespace_insert_advertisement_into_metadata ( | ||
2232 | struct GNUNET_FS_Namespace *ns, struct GNUNET_CONTAINER_MetaData *meta, | ||
2233 | const char *rootEntry); | ||
2234 | |||
2235 | |||
2236 | /** | ||
2237 | * Abort the namespace advertisement operation. | ||
2238 | * | ||
2239 | * @param ac context of the operation to abort. | ||
2240 | */ | ||
2241 | void | ||
2242 | GNUNET_FS_namespace_advertise_cancel (struct GNUNET_FS_AdvertisementContext *ac); | ||
2243 | |||
2244 | |||
2245 | /** | ||
2246 | * Create a namespace with the given name; if one already | 2194 | * Create a namespace with the given name; if one already |
2247 | * exists, return a handle to the existing namespace. | 2195 | * exists, return a handle to the existing namespace. |
2248 | * | 2196 | * |
@@ -2268,45 +2216,6 @@ GNUNET_FS_namespace_open_existing (struct GNUNET_FS_Handle *h, const char *name) | |||
2268 | 2216 | ||
2269 | 2217 | ||
2270 | /** | 2218 | /** |
2271 | * Context for creating a namespace asynchronously. | ||
2272 | */ | ||
2273 | struct GNUNET_FS_NamespaceCreationContext; | ||
2274 | |||
2275 | /** | ||
2276 | * Function called upon completion of 'GNUNET_FS_namespace_create_start'. | ||
2277 | * | ||
2278 | * @param cls closure | ||
2279 | * @param ns NULL on error, otherwise the namespace (which must be free'd by the callee) | ||
2280 | * @param emsg NULL on success, otherwise an error message | ||
2281 | */ | ||
2282 | typedef void (*GNUNET_FS_NamespaceCreationCallback)(void *cls, | ||
2283 | struct GNUNET_FS_Namespace *ns, const char *emsg); | ||
2284 | |||
2285 | |||
2286 | /** | ||
2287 | * Create a namespace with the given name; if one already | ||
2288 | * exists, return a handle to the existing namespace immediately. | ||
2289 | * Otherwise create a namespace asynchronously. | ||
2290 | * | ||
2291 | * @param h handle to the file sharing subsystem | ||
2292 | * @param name name to use for the namespace | ||
2293 | * @return namespace creation context, NULL on error (i.e. invalid filename) | ||
2294 | */ | ||
2295 | struct GNUNET_FS_NamespaceCreationContext * | ||
2296 | GNUNET_FS_namespace_create_start (struct GNUNET_FS_Handle *h, const char *name, | ||
2297 | GNUNET_FS_NamespaceCreationCallback cont, void *cont_cls); | ||
2298 | |||
2299 | |||
2300 | /** | ||
2301 | * Abort namespace creation. | ||
2302 | * | ||
2303 | * @param ncc namespace creation context to abort | ||
2304 | */ | ||
2305 | void | ||
2306 | GNUNET_FS_namespace_create_stop (struct GNUNET_FS_NamespaceCreationContext *ncc); | ||
2307 | |||
2308 | |||
2309 | /** | ||
2310 | * Rename a local namespace. | 2219 | * Rename a local namespace. |
2311 | * | 2220 | * |
2312 | * @param h handle to the file sharing subsystem | 2221 | * @param h handle to the file sharing subsystem |
@@ -2338,8 +2247,8 @@ GNUNET_FS_namespace_dup (struct GNUNET_FS_Namespace *ns); | |||
2338 | * GNUNET_SYSERR on failure (contents of id remain intact) | 2247 | * GNUNET_SYSERR on failure (contents of id remain intact) |
2339 | */ | 2248 | */ |
2340 | int | 2249 | int |
2341 | GNUNET_FS_namespace_get_public_key_hash (struct GNUNET_FS_Namespace *ns, | 2250 | GNUNET_FS_namespace_get_public_identifier (struct GNUNET_FS_Namespace *ns, |
2342 | struct GNUNET_HashCode *id); | 2251 | struct GNUNET_PseudonymIdentifier *id); |
2343 | 2252 | ||
2344 | 2253 | ||
2345 | /** | 2254 | /** |
@@ -2364,10 +2273,10 @@ GNUNET_FS_namespace_delete (struct GNUNET_FS_Namespace *ns, int freeze); | |||
2364 | * | 2273 | * |
2365 | * @param cls closure | 2274 | * @param cls closure |
2366 | * @param name human-readable identifier of the namespace | 2275 | * @param name human-readable identifier of the namespace |
2367 | * @param id hash identifier for the namespace | 2276 | * @param id identifier for the namespace |
2368 | */ | 2277 | */ |
2369 | typedef void (*GNUNET_FS_NamespaceInfoProcessor) (void *cls, const char *name, | 2278 | typedef void (*GNUNET_FS_NamespaceInfoProcessor) (void *cls, const char *name, |
2370 | const struct GNUNET_HashCode * id); | 2279 | const struct GNUNET_PseudonymIdentifier *id); |
2371 | 2280 | ||
2372 | 2281 | ||
2373 | /** | 2282 | /** |