From cdbbcf7ed842c15f987a55e6981d5aa98e68c865 Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Mon, 9 May 2022 09:36:56 +0200 Subject: Add DHT block types --- gnunet-dht-block-types/Makefile | 18 ++++++++ gnunet-dht-block-types/POLICY | 15 +++++++ gnunet-dht-block-types/README | 9 ++++ gnunet-dht-block-types/h.footer | 11 +++++ gnunet-dht-block-types/h.header | 43 ++++++++++++++++++ gnunet-dht-block-types/h.template | 6 +++ gnunet-dht-block-types/registry.rec | 87 +++++++++++++++++++++++++++++++++++++ 7 files changed, 189 insertions(+) create mode 100644 gnunet-dht-block-types/Makefile create mode 100644 gnunet-dht-block-types/POLICY create mode 100644 gnunet-dht-block-types/README create mode 100644 gnunet-dht-block-types/h.footer create mode 100644 gnunet-dht-block-types/h.header create mode 100644 gnunet-dht-block-types/h.template create mode 100644 gnunet-dht-block-types/registry.rec diff --git a/gnunet-dht-block-types/Makefile b/gnunet-dht-block-types/Makefile new file mode 100644 index 0000000..f402c2d --- /dev/null +++ b/gnunet-dht-block-types/Makefile @@ -0,0 +1,18 @@ +FILES=gnunet_dht_block_types.h +all: check $(FILES) + +check: + recfix --check registry.rec + +distclean: + rm -f *.tmp +clean: + rm -f $(FILES) *.tmp + +gnunet_dht_block_types.h.tmp: registry.rec h.template + ../format.sh h.template < registry.rec > $@ + +gnunet_dht_block_types.h: h.header gnunet_dht_block_types.h.tmp h.footer + cat h.header gnunet_dht_block_types.h.tmp h.footer > $@ + +.PHONY: check clean distclean diff --git a/gnunet-dht-block-types/POLICY b/gnunet-dht-block-types/POLICY new file mode 100644 index 0000000..c87e5d0 --- /dev/null +++ b/gnunet-dht-block-types/POLICY @@ -0,0 +1,15 @@ +Each registry entry should contain three values: the "Number" of the +block type, the "Name" of the block type, and a "Reference" with links +to further information about the block type. + +The "Name" must be unique in the entire registry. The value must be a +case insensitive ASCII string and is restricted to alphanumeric +characters. + +Adding records is possible after expert review, using a +first-come-first-served policy for unique "Name" allocation. +Experts are responsible to ensure that the chosen "Name" is +appropriate for the block type. + +The current contact(s) for expert review are reachable at +gana@gnunet.org. diff --git a/gnunet-dht-block-types/README b/gnunet-dht-block-types/README new file mode 100644 index 0000000..e11fe42 --- /dev/null +++ b/gnunet-dht-block-types/README @@ -0,0 +1,9 @@ +This registry is for GNUnet DHT Block Types. + +DHT Block Types types uniquely identify the different kinds +of blocks that can be found in the GNUnet DHT. + +This registry is used to ensure that the names and numeric values +used to identify block types are uniquely defined and to +allow DHT implementors to find out details about the +respective semantics and human-readable syntax. diff --git a/gnunet-dht-block-types/h.footer b/gnunet-dht-block-types/h.footer new file mode 100644 index 0000000..6e59d47 --- /dev/null +++ b/gnunet-dht-block-types/h.footer @@ -0,0 +1,11 @@ +}; + + +#if 0 /* keep Emacsens' auto-indent happy */ +{ +#endif +#ifdef __cplusplus +} +#endif + +#endif diff --git a/gnunet-dht-block-types/h.header b/gnunet-dht-block-types/h.header new file mode 100644 index 0000000..1ecca53 --- /dev/null +++ b/gnunet-dht-block-types/h.header @@ -0,0 +1,43 @@ +/* + This file is part of GNUnet + Copyright (C) 2012-2022 GNUnet e.V. + + 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 . + + SPDX-License-Identifier: AGPL3.0-or-later + */ +#ifndef GNUNET_DHT_BLOCK_TYPES_H +#define GNUNET_DHT_BLOCK_TYPES_H + +/** + * WARNING: + * This header is generated! + * In order to add DHT block types, you must register + * them in GANA, and then use the header generation script + * to create an update of this file. You may then replace this + * file with the update. + */ + +#ifdef __cplusplus +extern "C" { +#if 0 /* keep Emacsens' auto-indent happy */ +} +#endif +#endif + +/** + * Blocks in the datastore and the datacache must have a unique type. + */ +enum GNUNET_BLOCK_Type +{ diff --git a/gnunet-dht-block-types/h.template b/gnunet-dht-block-types/h.template new file mode 100644 index 0000000..5bdad42 --- /dev/null +++ b/gnunet-dht-block-types/h.template @@ -0,0 +1,6 @@ + + + /** + * {{Comment}} + */ + GNUNET_BLOCK_TYPE_{{Name}} = {{Number}}, diff --git a/gnunet-dht-block-types/registry.rec b/gnunet-dht-block-types/registry.rec new file mode 100644 index 0000000..793cf1e --- /dev/null +++ b/gnunet-dht-block-types/registry.rec @@ -0,0 +1,87 @@ +# -*- mode: rec -*- +# +# Registry for GNU Name System record types +# + +%rec: BlockType +%key: Number +%type: Number int +%mandatory: Number +%typedef: Name_t regexp /^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-]*$/ +%type: Name Name_t +%unique: Name +%mandatory: Name +%mandatory: Comment +%allowed: Contact +%allowed: References +%sort: Number Name Contact References + +Number: 1 +Name: FS_DBLOCK +Comment: Data block (leaf) in the CHK tree. +References: None + +Number: 2 +Name: FS_IBLOCK +Comment: Inner block in the CHK tree. +References: None + +Number: 6 +Name: FS_ONDEMAND +Comment: Type of a block representing a block to be encoded on demand from disk. Should never appear on the network directly. +References: None + +Number: 7 +Name: DHT_HELLO +Comment: Type of a block that contains a HELLO for a peer. +References: None + +Number: 8 +Name: TEST +Comment: Block for testing. +References: None + +Number: 9 +Name: FS_UBLOCK +Comment: Type of a block representing any type of search result (universal). +References: None + +Number: 10 +Name: DNS +Comment: Block for storing DNS exit service advertisements. +References: None + +Number: 11 +Name: GNS_NAMERECORD +Comment: Block for storing GNS record data. +References: None + +Number: 12 +Name: REVOCATION +Comment: Block type for a revocation message by which a key is revoked. +References: None + +Number: 13 +Name: DHT_URL_HELLO +Comment: Type of a block that contains a DHT-NG HELLO for a peer. +References: None + +Number: 22 +Name: REGEX +Comment: Block to store a cadet regex state +References: None + +Number: 23 +Name: REGEX_ACCEPT +Comment: Block to store a cadet regex accepting state +References: None + +Number: 24 +Name: SET_TEST +Comment: Block for testing set/consensus. If first byte of the block is non-zero, the block is considered invalid. +References: None + +Number: 25 +Name: CONSENSUS_ELEMENT +Comment: Block type for consensus elements. Contains either special marker elements or a nested block. +References: None -- cgit v1.2.3