block_fs.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /*
  2. This file is part of GNUnet.
  3. Copyright (C) 2010 Christian Grothoff (and other contributing authors)
  4. GNUnet is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published
  6. by the Free Software Foundation; either version 3, or (at your
  7. option) any later version.
  8. GNUnet is distributed in the hope that it will be useful, but
  9. WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with GNUnet; see the file COPYING. If not, write to the
  14. Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  15. Boston, MA 02110-1301, USA.
  16. */
  17. /**
  18. * @author Christian Grothoff
  19. *
  20. * @file
  21. * FS block formats (shared between FS and Block)
  22. *
  23. * @defgroup block-fs FS block formats
  24. * Shared between the [FS service](@ref fs) and the [Block library](@ref block).
  25. * @{
  26. */
  27. #ifndef BLOCK_FS_H
  28. #define BLOCK_FS_H
  29. #include "gnunet_util_lib.h"
  30. #include "gnunet_fs_service.h"
  31. /**
  32. * Maximum legal size for a ublock.
  33. */
  34. #define MAX_UBLOCK_SIZE (60 * 1024)
  35. GNUNET_NETWORK_STRUCT_BEGIN
  36. /**
  37. * @brief universal block for keyword and namespace search results
  38. */
  39. struct UBlock
  40. {
  41. /**
  42. * Signature using pseudonym and search keyword / identifier.
  43. */
  44. struct GNUNET_CRYPTO_EcdsaSignature signature;
  45. /**
  46. * What is being signed and why?
  47. */
  48. struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
  49. /**
  50. * Public key used to sign this block.
  51. */
  52. struct GNUNET_CRYPTO_EcdsaPublicKey verification_key;
  53. /* rest of the data is encrypted */
  54. /* 0-terminated update-identifier here (ignored for keyword results) */
  55. /* 0-terminated URI here */
  56. /* variable-size Meta-Data follows here */
  57. };
  58. /**
  59. * @brief index block (indexing a DBlock that
  60. * can be obtained directly from reading
  61. * the plaintext file)
  62. */
  63. struct OnDemandBlock
  64. {
  65. /**
  66. * Hash code of the entire content of the
  67. * file that was indexed (used to uniquely
  68. * identify the plaintext file).
  69. */
  70. struct GNUNET_HashCode file_id;
  71. /**
  72. * At which offset should we be able to find
  73. * this on-demand encoded block? (in NBO)
  74. */
  75. uint64_t offset GNUNET_PACKED;
  76. };
  77. GNUNET_NETWORK_STRUCT_END
  78. #endif
  79. /** @} */ /* end of group */