aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2022-05-09 09:36:56 +0200
committerMartin Schanzenbach <schanzen@gnunet.org>2022-05-09 09:36:56 +0200
commitcdbbcf7ed842c15f987a55e6981d5aa98e68c865 (patch)
tree9b973c279e285d1acf7357fb8ba0fb5fe23ff14f
parentfa6373d8e2432cd63da881e05f4100240e688cdf (diff)
downloadgana-cdbbcf7ed842c15f987a55e6981d5aa98e68c865.tar.gz
gana-cdbbcf7ed842c15f987a55e6981d5aa98e68c865.zip
Add DHT block types
-rw-r--r--gnunet-dht-block-types/Makefile18
-rw-r--r--gnunet-dht-block-types/POLICY15
-rw-r--r--gnunet-dht-block-types/README9
-rw-r--r--gnunet-dht-block-types/h.footer11
-rw-r--r--gnunet-dht-block-types/h.header43
-rw-r--r--gnunet-dht-block-types/h.template6
-rw-r--r--gnunet-dht-block-types/registry.rec87
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 @@
1FILES=gnunet_dht_block_types.h
2all: check $(FILES)
3
4check:
5 recfix --check registry.rec
6
7distclean:
8 rm -f *.tmp
9clean:
10 rm -f $(FILES) *.tmp
11
12gnunet_dht_block_types.h.tmp: registry.rec h.template
13 ../format.sh h.template < registry.rec > $@
14
15gnunet_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 @@
1Each registry entry should contain three values: the "Number" of the
2block type, the "Name" of the block type, and a "Reference" with links
3to further information about the block type.
4
5The "Name" must be unique in the entire registry. The value must be a
6case insensitive ASCII string and is restricted to alphanumeric
7characters.
8
9Adding records is possible after expert review, using a
10first-come-first-served policy for unique "Name" allocation.
11Experts are responsible to ensure that the chosen "Name" is
12appropriate for the block type.
13
14The current contact(s) for expert review are reachable at
15gana@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 @@
1This registry is for GNUnet DHT Block Types.
2
3DHT Block Types types uniquely identify the different kinds
4of blocks that can be found in the GNUnet DHT.
5
6This registry is used to ensure that the names and numeric values
7used to identify block types are uniquely defined and to
8allow DHT implementors to find out details about the
9respective 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
33extern "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 */
42enum 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
19Number: 1
20Name: FS_DBLOCK
21Comment: Data block (leaf) in the CHK tree.
22References: None
23
24Number: 2
25Name: FS_IBLOCK
26Comment: Inner block in the CHK tree.
27References: None
28
29Number: 6
30Name: FS_ONDEMAND
31Comment: Type of a block representing a block to be encoded on demand from disk. Should never appear on the network directly.
32References: None
33
34Number: 7
35Name: DHT_HELLO
36Comment: Type of a block that contains a HELLO for a peer.
37References: None
38
39Number: 8
40Name: TEST
41Comment: Block for testing.
42References: None
43
44Number: 9
45Name: FS_UBLOCK
46Comment: Type of a block representing any type of search result (universal).
47References: None
48
49Number: 10
50Name: DNS
51Comment: Block for storing DNS exit service advertisements.
52References: None
53
54Number: 11
55Name: GNS_NAMERECORD
56Comment: Block for storing GNS record data.
57References: None
58
59Number: 12
60Name: REVOCATION
61Comment: Block type for a revocation message by which a key is revoked.
62References: None
63
64Number: 13
65Name: DHT_URL_HELLO
66Comment: Type of a block that contains a DHT-NG HELLO for a peer.
67References: None
68
69Number: 22
70Name: REGEX
71Comment: Block to store a cadet regex state
72References: None
73
74Number: 23
75Name: REGEX_ACCEPT
76Comment: Block to store a cadet regex accepting state
77References: None
78
79Number: 24
80Name: SET_TEST
81Comment: Block for testing set/consensus. If first byte of the block is non-zero, the block is considered invalid.
82References: None
83
84Number: 25
85Name: CONSENSUS_ELEMENT
86Comment: Block type for consensus elements. Contains either special marker elements or a nested block.
87References: None