aboutsummaryrefslogtreecommitdiff
path: root/src/service/fs/fs_publish_ublock.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/service/fs/fs_publish_ublock.h')
-rw-r--r--src/service/fs/fs_publish_ublock.h109
1 files changed, 109 insertions, 0 deletions
diff --git a/src/service/fs/fs_publish_ublock.h b/src/service/fs/fs_publish_ublock.h
new file mode 100644
index 000000000..4adffc6c1
--- /dev/null
+++ b/src/service/fs/fs_publish_ublock.h
@@ -0,0 +1,109 @@
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 Affero 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 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 SPDX-License-Identifier: AGPL3.0-or-later
19 */
20
21/**
22 * @file fs/fs_publish_ublock.h
23 * @brief publish a UBLOCK in GNUnet
24 * @see https://gnunet.org/encoding and #2564
25 * @author Krista Bennett
26 * @author Christian Grothoff
27 */
28#ifndef FS_PUBLISH_UBLOCK_H
29#define FS_PUBLISH_UBLOCK_H
30
31#include "gnunet_util_lib.h"
32#include "gnunet_datastore_service.h"
33
34#include "gnunet_fs_service.h"
35#include "gnunet_identity_service.h"
36
37
38/**
39 * Decrypt the given UBlock, storing the result in output.
40 *
41 * @param input input data
42 * @param input_len number of bytes in @a input
43 * @param ns public key under which the UBlock was stored
44 * @param label label under which the UBlock was stored
45 * @param output where to write the result, has input_len bytes
46 */
47void
48GNUNET_FS_ublock_decrypt_ (const void *input,
49 size_t input_len,
50 const struct GNUNET_CRYPTO_EcdsaPublicKey *ns,
51 const char *label,
52 void *output);
53
54
55/**
56 * Context for 'ublock_put_cont'.
57 */
58struct GNUNET_FS_PublishUblockContext;
59
60
61/**
62 * Signature of a function called as the continuation of a UBlock
63 * publication.
64 *
65 * @param cls closure
66 * @param emsg error message, NULL on success
67 */
68typedef void (*GNUNET_FS_UBlockContinuation) (void *cls,
69 const char *emsg);
70
71
72/**
73 * Publish a UBlock.
74 *
75 * @param h handle to the file sharing subsystem
76 * @param dsh datastore handle to use for storage operation
77 * @param label identifier to use
78 * @param ulabel update label to use, may be an empty string for none
79 * @param ns namespace to publish in
80 * @param meta metadata to use
81 * @param uri URI to refer to in the UBlock
82 * @param bo per-block options
83 * @param options publication options
84 * @param cont continuation
85 * @param cont_cls closure for @a cont
86 * @return NULL on error (@a cont will still be called)
87 */
88struct GNUNET_FS_PublishUblockContext *
89GNUNET_FS_publish_ublock_ (struct GNUNET_FS_Handle *h,
90 struct GNUNET_DATASTORE_Handle *dsh,
91 const char *label,
92 const char *ulabel,
93 const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns,
94 const struct GNUNET_FS_MetaData *meta,
95 const struct GNUNET_FS_Uri *uri,
96 const struct GNUNET_FS_BlockOptions *bo,
97 enum GNUNET_FS_PublishOptions options,
98 GNUNET_FS_UBlockContinuation cont, void *cont_cls);
99
100
101/**
102 * Abort UBlock publishing operation.
103 *
104 * @param uc operation to abort.
105 */
106void
107GNUNET_FS_publish_ublock_cancel_ (struct GNUNET_FS_PublishUblockContext *uc);
108
109#endif