diff options
author | Martin Schanzenbach <schanzen@gnunet.org> | 2022-05-09 09:36:56 +0200 |
---|---|---|
committer | Martin Schanzenbach <schanzen@gnunet.org> | 2022-05-09 09:36:56 +0200 |
commit | cdbbcf7ed842c15f987a55e6981d5aa98e68c865 (patch) | |
tree | 9b973c279e285d1acf7357fb8ba0fb5fe23ff14f | |
parent | fa6373d8e2432cd63da881e05f4100240e688cdf (diff) | |
download | gana-cdbbcf7ed842c15f987a55e6981d5aa98e68c865.tar.gz gana-cdbbcf7ed842c15f987a55e6981d5aa98e68c865.zip |
Add DHT block types
-rw-r--r-- | gnunet-dht-block-types/Makefile | 18 | ||||
-rw-r--r-- | gnunet-dht-block-types/POLICY | 15 | ||||
-rw-r--r-- | gnunet-dht-block-types/README | 9 | ||||
-rw-r--r-- | gnunet-dht-block-types/h.footer | 11 | ||||
-rw-r--r-- | gnunet-dht-block-types/h.header | 43 | ||||
-rw-r--r-- | gnunet-dht-block-types/h.template | 6 | ||||
-rw-r--r-- | gnunet-dht-block-types/registry.rec | 87 |
7 files changed, 189 insertions, 0 deletions
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 @@ | |||
1 | FILES=gnunet_dht_block_types.h | ||
2 | all: check $(FILES) | ||
3 | |||
4 | check: | ||
5 | recfix --check registry.rec | ||
6 | |||
7 | distclean: | ||
8 | rm -f *.tmp | ||
9 | clean: | ||
10 | rm -f $(FILES) *.tmp | ||
11 | |||
12 | gnunet_dht_block_types.h.tmp: registry.rec h.template | ||
13 | ../format.sh h.template < registry.rec > $@ | ||
14 | |||
15 | gnunet_dht_block_types.h: h.header gnunet_dht_block_types.h.tmp h.footer | ||
16 | cat h.header gnunet_dht_block_types.h.tmp h.footer > $@ | ||
17 | |||
18 | .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 @@ | |||
1 | Each registry entry should contain three values: the "Number" of the | ||
2 | block type, the "Name" of the block type, and a "Reference" with links | ||
3 | to further information about the block type. | ||
4 | |||
5 | The "Name" must be unique in the entire registry. The value must be a | ||
6 | case insensitive ASCII string and is restricted to alphanumeric | ||
7 | characters. | ||
8 | |||
9 | Adding records is possible after expert review, using a | ||
10 | first-come-first-served policy for unique "Name" allocation. | ||
11 | Experts are responsible to ensure that the chosen "Name" is | ||
12 | appropriate for the block type. | ||
13 | |||
14 | The current contact(s) for expert review are reachable at | ||
15 | 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 @@ | |||
1 | This registry is for GNUnet DHT Block Types. | ||
2 | |||
3 | DHT Block Types types uniquely identify the different kinds | ||
4 | of blocks that can be found in the GNUnet DHT. | ||
5 | |||
6 | This registry is used to ensure that the names and numeric values | ||
7 | used to identify block types are uniquely defined and to | ||
8 | allow DHT implementors to find out details about the | ||
9 | 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 @@ | |||
1 | }; | ||
2 | |||
3 | |||
4 | #if 0 /* keep Emacsens' auto-indent happy */ | ||
5 | { | ||
6 | #endif | ||
7 | #ifdef __cplusplus | ||
8 | } | ||
9 | #endif | ||
10 | |||
11 | #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 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet | ||
3 | Copyright (C) 2012-2022 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 | #ifndef GNUNET_DHT_BLOCK_TYPES_H | ||
21 | #define GNUNET_DHT_BLOCK_TYPES_H | ||
22 | |||
23 | /** | ||
24 | * WARNING: | ||
25 | * This header is generated! | ||
26 | * In order to add DHT block types, you must register | ||
27 | * them in GANA, and then use the header generation script | ||
28 | * to create an update of this file. You may then replace this | ||
29 | * file with the update. | ||
30 | */ | ||
31 | |||
32 | #ifdef __cplusplus | ||
33 | extern "C" { | ||
34 | #if 0 /* keep Emacsens' auto-indent happy */ | ||
35 | } | ||
36 | #endif | ||
37 | #endif | ||
38 | |||
39 | /** | ||
40 | * Blocks in the datastore and the datacache must have a unique type. | ||
41 | */ | ||
42 | enum GNUNET_BLOCK_Type | ||
43 | { | ||
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 @@ | |||
1 | |||
2 | |||
3 | /** | ||
4 | * {{Comment}} | ||
5 | */ | ||
6 | 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 @@ | |||
1 | # -*- mode: rec -*- | ||
2 | # | ||
3 | # Registry for GNU Name System record types | ||
4 | # | ||
5 | |||
6 | %rec: BlockType | ||
7 | %key: Number | ||
8 | %type: Number int | ||
9 | %mandatory: Number | ||
10 | %typedef: Name_t regexp /^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-]*$/ | ||
11 | %type: Name Name_t | ||
12 | %unique: Name | ||
13 | %mandatory: Name | ||
14 | %mandatory: Comment | ||
15 | %allowed: Contact | ||
16 | %allowed: References | ||
17 | %sort: Number Name Contact References | ||
18 | |||
19 | Number: 1 | ||
20 | Name: FS_DBLOCK | ||
21 | Comment: Data block (leaf) in the CHK tree. | ||
22 | References: None | ||
23 | |||
24 | Number: 2 | ||
25 | Name: FS_IBLOCK | ||
26 | Comment: Inner block in the CHK tree. | ||
27 | References: None | ||
28 | |||
29 | Number: 6 | ||
30 | Name: FS_ONDEMAND | ||
31 | Comment: Type of a block representing a block to be encoded on demand from disk. Should never appear on the network directly. | ||
32 | References: None | ||
33 | |||
34 | Number: 7 | ||
35 | Name: DHT_HELLO | ||
36 | Comment: Type of a block that contains a HELLO for a peer. | ||
37 | References: None | ||
38 | |||
39 | Number: 8 | ||
40 | Name: TEST | ||
41 | Comment: Block for testing. | ||
42 | References: None | ||
43 | |||
44 | Number: 9 | ||
45 | Name: FS_UBLOCK | ||
46 | Comment: Type of a block representing any type of search result (universal). | ||
47 | References: None | ||
48 | |||
49 | Number: 10 | ||
50 | Name: DNS | ||
51 | Comment: Block for storing DNS exit service advertisements. | ||
52 | References: None | ||
53 | |||
54 | Number: 11 | ||
55 | Name: GNS_NAMERECORD | ||
56 | Comment: Block for storing GNS record data. | ||
57 | References: None | ||
58 | |||
59 | Number: 12 | ||
60 | Name: REVOCATION | ||
61 | Comment: Block type for a revocation message by which a key is revoked. | ||
62 | References: None | ||
63 | |||
64 | Number: 13 | ||
65 | Name: DHT_URL_HELLO | ||
66 | Comment: Type of a block that contains a DHT-NG HELLO for a peer. | ||
67 | References: None | ||
68 | |||
69 | Number: 22 | ||
70 | Name: REGEX | ||
71 | Comment: Block to store a cadet regex state | ||
72 | References: None | ||
73 | |||
74 | Number: 23 | ||
75 | Name: REGEX_ACCEPT | ||
76 | Comment: Block to store a cadet regex accepting state | ||
77 | References: None | ||
78 | |||
79 | Number: 24 | ||
80 | Name: SET_TEST | ||
81 | Comment: Block for testing set/consensus. If first byte of the block is non-zero, the block is considered invalid. | ||
82 | References: None | ||
83 | |||
84 | Number: 25 | ||
85 | Name: CONSENSUS_ELEMENT | ||
86 | Comment: Block type for consensus elements. Contains either special marker elements or a nested block. | ||
87 | References: None | ||