block_fs.h (2469B)
1 /* 2 This file is part of GNUnet. 3 Copyright (C) 2010 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 * @addtogroup fs_l2 23 * @{ 24 * 25 * @author Christian Grothoff 26 * 27 * @file 28 * FS block formats (shared between FS and Block) 29 * 30 * @defgroup block-fs FS block formats 31 * Shared between the [FS service](@ref fs) and the [Block library](@ref block). 32 * @{ 33 */ 34 #ifndef BLOCK_FS_H 35 #define BLOCK_FS_H 36 37 38 #include "gnunet_util_lib.h" 39 #include "gnunet_fs_service.h" 40 41 42 /** 43 * Maximum legal size for a ublock. 44 */ 45 #define MAX_UBLOCK_SIZE (60 * 1024) 46 47 48 GNUNET_NETWORK_STRUCT_BEGIN 49 50 /** 51 * @brief universal block for keyword and namespace search results 52 */ 53 struct UBlock 54 { 55 /** 56 * Signature using pseudonym and search keyword / identifier. 57 */ 58 struct GNUNET_CRYPTO_EcdsaSignature signature; 59 60 /** 61 * What is being signed and why? 62 */ 63 struct GNUNET_CRYPTO_SignaturePurpose purpose; 64 65 /** 66 * Public key used to sign this block. 67 */ 68 struct GNUNET_CRYPTO_EcdsaPublicKey verification_key; 69 70 /* rest of the data is encrypted */ 71 72 /* 0-terminated update-identifier here (ignored for keyword results) */ 73 74 /* 0-terminated URI here */ 75 76 /* variable-size Meta-Data follows here */ 77 }; 78 79 80 /** 81 * @brief index block (indexing a DBlock that 82 * can be obtained directly from reading 83 * the plaintext file) 84 */ 85 struct OnDemandBlock 86 { 87 /** 88 * Hash code of the entire content of the 89 * file that was indexed (used to uniquely 90 * identify the plaintext file). 91 */ 92 struct GNUNET_HashCode file_id; 93 94 /** 95 * At which offset should we be able to find 96 * this on-demand encoded block? (in NBO) 97 */ 98 uint64_t offset GNUNET_PACKED; 99 }; 100 GNUNET_NETWORK_STRUCT_END 101 102 #endif 103 104 /** @} */ /* end of group */ 105 106 /** @} */ /* end of group addition to fs_l2 */