gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet-scheme] 81/324: nse: define network structures.


From: gnunet
Subject: [gnunet-scheme] 81/324: nse: define network structures.
Date: Tue, 21 Sep 2021 13:22:01 +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 66286858b7f677bf6cdfcd97be5b02e322842013
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Wed Feb 10 18:24:29 2021 +0100

    nse: define network structures.
    
    * gnu/gnunet/nse/struct.scm: new module,
      defining some NSE network structures.
    * Makefile.am (modules): compile it.
---
 Makefile.am               |  3 +-
 gnu/gnunet/nse/struct.scm | 74 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 76 insertions(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index d5fb460..9c6aa67 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -48,7 +48,8 @@ modules = \
   \
   gnu/gnunet/util/struct.scm \
   gnu/gnunet/crypto/struct.scm \
-  gnu/gnunet/hashcode/struct.scm
+  gnu/gnunet/hashcode/struct.scm \
+  gnu/gnunet/nse/struct.scm
 
 dist_guilesite_DATA = $(modules)
 
diff --git a/gnu/gnunet/nse/struct.scm b/gnu/gnunet/nse/struct.scm
new file mode 100644
index 0000000..7ecd8c9
--- /dev/null
+++ b/gnu/gnunet/nse/struct.scm
@@ -0,0 +1,74 @@
+;; This file is part of scheme-GNUnet
+;; Copyright (C) 2001-2011 GNUnet e.V.
+;; Copyright (C) 2021 Maxime Devos
+;;
+;; GNUnet is free software: you can redistribute it and/or modify it
+;; under the terms of the GNU Affero General Public License as published
+;; by the Free Software Foundation, either version 3 of the License,
+;; or (at your option) any later version.
+;;
+;; GNUnet is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; Affero General Public License for more details.
+;;
+;; You should have received a copy of the GNU Affero General Public License
+;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
+;;
+;; SPDX-License-Identifier: AGPL3.0-or-later
+
+;; Author (GNUnet): Nathan Evans
+;; File (GNUnet): nse/nse.h
+;;
+;; Brief: Common type definitions for the network size estimation
+;; service and API.
+
+(define-library (gnu gnunet nse struct (0 0))
+  (export /:msg:nse:estimate
+         /:msg:nse:flood)
+  (import (only (rnrs base)
+               define-syntax begin)
+         (gnu gnunet utils netstruct)
+         (gnu gnunet hashcode struct)
+         (gnu gnunet util struct))
+  (begin
+    ;; Network size estimate sent from the service
+    ;; to clients.  Contains the current size estimate
+    ;; (or 0 if none has been calculated) and the
+    ;; standard deviation of known estimates.
+    (define-syntax /:msg:nse:estimate
+      (structure/packed
+       ;; Type: msg:nse:estimate
+       ("header" /message-header)
+       ("reserved" u32/big)
+       ("timestamp" /time-absolute)
+       ("size-estimate" ieee-double/big)
+       ("std-deviation" ieee-double/big)))
+
+    ;; Network size estimate reply; sent when "this"
+    ;; peer's timer has run out before receiving a
+    ;; valid reply from another peer.
+    (define-syntax /:msg:nse:flood
+      (structure/packed
+       ;; Type: msg:nse:flood
+       ("header" /message-header)
+       ;; Number of hops this message has taken so far.
+       ("hop-count" u32/big)
+       ;; Purpose.
+       ("purpose" /ecc-signature-purpose)
+       ;; The current timestamp value (which all
+       ;; peers should agree on).
+       ("timestamp" /time-absolute)
+       ;; Number of matching bits between the hash
+       ;; of timestamp and the initiator's public
+       ;; key.
+       ;; XXX add to (gnu gnunet util struct)
+       ("matching-bits" u32/big)
+       ;; Public key of the originator.
+       ("origin" /peer-identity)
+       ;; Proof of work, causing leading zeros when hashed with pkey.
+       ("proof-of-work" u64/big)
+       ;; Signature (over range specified in purpose).
+       ("signature" /eddsa-signature)))))
+
+    

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]