[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet-scheme] 05/06: fs/struct: Define new message type /:msg:fs:index
From: |
gnunet |
Subject: |
[gnunet-scheme] 05/06: fs/struct: Define new message type /:msg:fs:index-start!. |
Date: |
Wed, 26 Oct 2022 00:30:06 +0200 |
This is an automated email from the git hooks/post-receive script.
maxime-devos pushed a commit to branch master
in repository gnunet-scheme.
commit 4eba71dd07c5c800574727550bf52ff4366fb98b
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Wed Oct 26 00:08:45 2022 +0200
fs/struct: Define new message type /:msg:fs:index-start!.
* gnu/gnunet/fs/struct.scm (/:msg:fs:index-start!): New
definition.
---
gnu/gnunet/fs/struct.scm | 43 +++++++++++++++++++++++++++++++++++++++++--
1 file changed, 41 insertions(+), 2 deletions(-)
diff --git a/gnu/gnunet/fs/struct.scm b/gnu/gnunet/fs/struct.scm
index 872ce07..e33ce8d 100644
--- a/gnu/gnunet/fs/struct.scm
+++ b/gnu/gnunet/fs/struct.scm
@@ -22,7 +22,8 @@
;; Ported to Scheme-GNUnet by: Maxime Devos
(define-library (gnu gnunet fs struct)
(export /:msg:fs:request-loc-signature
- /:msg:fs:response-loc-signature)
+ /:msg:fs:response-loc-signature
+ /:msg:fs:index-start!)
(import (only (rnrs base) define begin * quote)
(only (gnu gnunet crypto struct)
/peer-identity)
@@ -77,4 +78,42 @@ IIUC, not necessarily the time that was requested."))
(field (peer /peer-identity)
(synopsis "Identity of the peer sharing the file.")
(documentation "On a typical setup, this is the identity of the
-local peer on a typical setup, IIUC."))))))
+local peer on a typical setup, IIUC."))))
+
+ (define-type /:msg:fs:index-start!
+ (structure/packed
+ (synopsis "Message to request indexing of a file.")
+ (documentation "Message sent by a client to the service to request that
+a file (on the file system) is indexed. The service is supposed to check that
+the specified file is available and has the same cryptographic hash as
mentioned
+in the message. It should then respond with either a confirmation or a denial.
+
+On operating systems where this works, it is considered acceptable if the
+service only checks that the path, device and inode match (it can then be
+assumed that the hash will also match without actually computing it; this
+is an optimisation that should be safe given that the client is not our
+advisary).
+
+This message is followed by the file name of a file with the hash \"file-id\"
+as seen by the client, then followed by an octet 0 (i.e., the file name is
+zero-terminated).")
+ (field (header /:message-header))
+ (field (reserved u32/big)
+ (synopsis "For alignment."))
+ (field (device u64/big)
+ (synopsis "ID of device containing the file")
+ ;; TODO: why write 64-bit and not 32-bit?
+ ;; Also, verify endianness against the implementations.
+ (documentation "ID of device containing the file, as seen by the
+client. This device ID is obtained using a call like \"statvfs\" (and
+converting the \"f_fsid\" field to a 32-bit big-endian number). Use 0 if
+the operating system does not support this, in which case the service must
+do a full hash recomputation."))
+ (field (inode u64/big) ; TODO: check endianness
+ (synopsis "Inode of the file, on the device.")
+ (documentation "Inode of the file on the given device, as seen
+by the client (\"st_ino\" field from \"struct stat\"). Use 0 if the operating
+system does not support this, in which case the service must do a full hash
+recomputation."))
+ (field (file-id /hashcode:512)
+ (synopsis "Hash of the file that we would like to index."))))))
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [gnunet-scheme] branch master updated (446af15 -> 6a51f3a), gnunet, 2022/10/25
- [gnunet-scheme] 04/06: fs/struct: Adjust message type names., gnunet, 2022/10/25
- [gnunet-scheme] 01/06: server: Don't reuse lost-and-found operations., gnunet, 2022/10/25
- [gnunet-scheme] 06/06: fs/struct: Define new message type /:msg:fs:index-list:entry., gnunet, 2022/10/25
- [gnunet-scheme] 03/06: fs/struct: Define new message type /:msg:fs:response-loc-sign., gnunet, 2022/10/25
- [gnunet-scheme] 02/06: Unskip DHT test., gnunet, 2022/10/25
- [gnunet-scheme] 05/06: fs/struct: Define new message type /:msg:fs:index-start!.,
gnunet <=