first batch of license fixes (boring)
[oweals/gnunet.git] / src / fs / fs_publish_ublock.h
1 /*
2      This file is part of GNUnet.
3      Copyright (C) 2009, 2010, 2012, 2013 GNUnet e.V.
4
5      GNUnet is free software: you can redistribute it and/or modify it
6      under the terms of the GNU General Public License as published
7      by the Free Software Foundation, either version 3 of the License,
8      or (at your option) any later version.
9
10      GNUnet is distributed in the hope that it will be useful, but
11      WITHOUT ANY WARRANTY; without even the implied warranty of
12      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13      Affero General Public License for more details.
14 */
15
16 /**
17  * @file fs/fs_publish_ublock.h
18  * @brief publish a UBLOCK in GNUnet
19  * @see https://gnunet.org/encoding and #2564
20  * @author Krista Bennett
21  * @author Christian Grothoff
22  */
23 #ifndef FS_PUBLISH_UBLOCK_H
24 #define FS_PUBLISH_UBLOCK_H
25
26 #include "gnunet_util_lib.h"
27 #include "gnunet_datastore_service.h"
28 #include "gnunet_fs_service.h"
29 #include "gnunet_identity_service.h"
30
31
32 /**
33  * Decrypt the given UBlock, storing the result in output.
34  *
35  * @param input input data
36  * @param input_len number of bytes in input
37  * @param ns public key under which the UBlock was stored
38  * @param label label under which the UBlock was stored
39  * @param output where to write the result, has input_len bytes
40  */
41 void
42 GNUNET_FS_ublock_decrypt_ (const void *input,
43                            size_t input_len,
44                            const struct GNUNET_CRYPTO_EcdsaPublicKey *ns,
45                            const char *label,
46                            void *output);
47
48
49 /**
50  * Context for 'ublock_put_cont'.
51  */
52 struct GNUNET_FS_PublishUblockContext;
53
54
55 /**
56  * Signature of a function called as the continuation of a UBlock
57  * publication.
58  *
59  * @param cls closure
60  * @param emsg error message, NULL on success
61  */
62 typedef void (*GNUNET_FS_UBlockContinuation) (void *cls,
63                                               const char *emsg);
64
65
66 /**
67  * Publish a UBlock.
68  *
69  * @param h handle to the file sharing subsystem
70  * @param dsh datastore handle to use for storage operation
71  * @param label identifier to use
72  * @param ulabel update label to use, may be an empty string for none
73  * @param ns namespace to publish in
74  * @param meta metadata to use
75  * @param uri URI to refer to in the UBlock
76  * @param bo per-block options
77  * @param options publication options
78  * @param cont continuation
79  * @param cont_cls closure for cont
80  * @return NULL on error ('cont' will still be called)
81  */
82 struct GNUNET_FS_PublishUblockContext *
83 GNUNET_FS_publish_ublock_ (struct GNUNET_FS_Handle *h,
84                            struct GNUNET_DATASTORE_Handle *dsh,
85                            const char *label,
86                            const char *ulabel,
87                            const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns,
88                            const struct GNUNET_CONTAINER_MetaData *meta,
89                            const struct GNUNET_FS_Uri *uri,
90                            const struct GNUNET_FS_BlockOptions *bo,
91                            enum GNUNET_FS_PublishOptions options,
92                            GNUNET_FS_UBlockContinuation cont, void *cont_cls);
93
94
95 /**
96  * Abort UBlock publishing operation.
97  *
98  * @param uc operation to abort.
99  */
100 void
101 GNUNET_FS_publish_ublock_cancel_ (struct GNUNET_FS_PublishUblockContext *uc);
102
103 #endif