aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2022-11-10 13:46:18 +0900
committerMartin Schanzenbach <schanzen@gnunet.org>2022-11-10 13:46:18 +0900
commit092edfe57896d5f0fdf11008a4cba561203dfadd (patch)
tree8880afd3d48ff2b72a7fc0441ec92d8550063edd
parentd83d2584fd4698719b8eb78a4e0e9c8dad698aca (diff)
downloadgana-092edfe57896d5f0fdf11008a4cba561203dfadd.tar.gz
gana-092edfe57896d5f0fdf11008a4cba561203dfadd.zip
Add record flags registry
-rw-r--r--gnu-name-system-record-flags/.gitignore1
-rw-r--r--gnu-name-system-record-flags/Makefile25
-rw-r--r--gnu-name-system-record-flags/POLICY16
-rw-r--r--gnu-name-system-record-flags/README9
-rw-r--r--gnu-name-system-record-flags/h.footer11
-rw-r--r--gnu-name-system-record-flags/h.header49
-rw-r--r--gnu-name-system-record-flags/h.template6
-rw-r--r--gnu-name-system-record-flags/registry.rec43
-rw-r--r--gnu-name-system-record-flags/rst.footer0
-rw-r--r--gnu-name-system-record-flags/rst.header4
-rw-r--r--gnu-name-system-record-flags/rst.template9
-rw-r--r--gnu-name-system-record-types/rst.template2
12 files changed, 174 insertions, 1 deletions
diff --git a/gnu-name-system-record-flags/.gitignore b/gnu-name-system-record-flags/.gitignore
new file mode 100644
index 0000000..0a437d0
--- /dev/null
+++ b/gnu-name-system-record-flags/.gitignore
@@ -0,0 +1 @@
gnu-name-system-record-types.h
diff --git a/gnu-name-system-record-flags/Makefile b/gnu-name-system-record-flags/Makefile
new file mode 100644
index 0000000..372a6d5
--- /dev/null
+++ b/gnu-name-system-record-flags/Makefile
@@ -0,0 +1,25 @@
1FILES=gnu_name_system_record_flags.h gnu_name_system_record_flags.rst
2all: check $(FILES)
3
4check:
5 recfix --check registry.rec
6
7distclean:
8 rm -f *.tmp
9clean:
10 rm -f $(FILES) *.tmp
11
12gnu_name_system_record_flags.h.tmp: registry.rec h.template
13 ../format.sh h.template < registry.rec > $@
14
15gnu_name_system_record_flags.h: h.header gnu_name_system_record_flags.h.tmp h.footer
16 cat h.header gnu_name_system_record_flags.h.tmp h.footer > $@
17
18gnu_name_system_record_flags.rst.tmp: registry.rec rst.template
19 ../format.sh rst.template < registry.rec > $@
20
21gnu_name_system_record_flags.rst: rst.header gnu_name_system_record_flags.rst.tmp rst.footer
22 cat rst.header gnu_name_system_record_flags.rst.tmp rst.footer > $@
23
24
25.PHONY: check clean distclean
diff --git a/gnu-name-system-record-flags/POLICY b/gnu-name-system-record-flags/POLICY
new file mode 100644
index 0000000..5ece049
--- /dev/null
+++ b/gnu-name-system-record-flags/POLICY
@@ -0,0 +1,16 @@
1Each registry entry should contain three values: the "Number" of the
2record flags, which must be between 0 and 15,
3the "Name" of the record flag, and a "Reference" with links
4to further information about the record flag.
5
6The "Name" must be unique in the entire registry. The value must be a
7case insensitive ASCII string and is restricted to alphanumeric
8characters.
9
10Adding flags is possible after expert review, using a
11first-come-first-served policy for unique "Name" allocation.
12Experts are responsible to ensure that the chosen "Name" is
13appropriate for the record flag.
14
15The current contact(s) for expert review are reachable at
16gns-registry@gnunet.org.
diff --git a/gnu-name-system-record-flags/README b/gnu-name-system-record-flags/README
new file mode 100644
index 0000000..fa953b2
--- /dev/null
+++ b/gnu-name-system-record-flags/README
@@ -0,0 +1,9 @@
1This registry is for GNU Name System Record Flags.
2
3GNU Name System Record flags uniquely identify the different kinds
4of key-value pairs that can be used as flags of a GNU Name System record.
5
6This registry is used to ensure that the names and numeric values
7used to identify record flags are uniquely defined and to
8allow GNS resolvers implementors to find out details about the
9respective semantics and human-readable syntax.
diff --git a/gnu-name-system-record-flags/h.footer b/gnu-name-system-record-flags/h.footer
new file mode 100644
index 0000000..7b5140e
--- /dev/null
+++ b/gnu-name-system-record-flags/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/gnu-name-system-record-flags/h.header b/gnu-name-system-record-flags/h.header
new file mode 100644
index 0000000..c641893
--- /dev/null
+++ b/gnu-name-system-record-flags/h.header
@@ -0,0 +1,49 @@
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 GNU_NAME_SYSTEM_RECORD_FLAGS_H
21#define GNU_NAME_SYSTEM_RECORD_FLAGS_H
22
23/**
24 * WARNING:
25 * This header is generated!
26 * In order to add GNS record flags, 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/**
33 * Flags that can be set for a record.
34 * The numbers in the registry correspond to the bit index as specified in
35 * LSD0001 Chapter "Resource Records".
36 * Each enum member represents the 16-bit integer value of the flags field if
37 * only that particular flag was set.
38 * The value can be used to efficiently compare the bitmask setting for the
39 * record flag in C.
40 * WARNING: The values are in host byte order! In order to correctly check
41 * against the flags field a record, the respective fields must
42 * also be converted to HBO (or the enum value to NBO).
43 */
44enum GNUNET_GNSRECORD_Flags
45{
46 /**
47 * Entry for no flags / cleared flags.
48 */
49 GNUNET_GNSRECORD_RF_NONE = 0,
diff --git a/gnu-name-system-record-flags/h.template b/gnu-name-system-record-flags/h.template
new file mode 100644
index 0000000..d90329b
--- /dev/null
+++ b/gnu-name-system-record-flags/h.template
@@ -0,0 +1,6 @@
1
2
3 /**
4 * {{Comment}}
5 */
6 GNUNET_GNSRECORD_RF_{{Name}} = 1 << (15 - {{Number}}),
diff --git a/gnu-name-system-record-flags/registry.rec b/gnu-name-system-record-flags/registry.rec
new file mode 100644
index 0000000..adb8f41
--- /dev/null
+++ b/gnu-name-system-record-flags/registry.rec
@@ -0,0 +1,43 @@
1# -*- mode: rec -*-
2#
3# Registry for GNU Name System record flags
4#
5
6%rec: RecordType
7%key: Number
8%typedef: FlagRange_t range 0 15
9%type: Number FlagRange_t
10%mandatory: Number
11%typedef: Name_t regexp /^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-]*$/
12%type: Name Name_t
13%unique: Name
14%mandatory: Name
15%mandatory: Comment
16%allowed: Contact
17%allowed: References
18%sort: Number Name Contact References
19
20Number: 15
21Name: CRITICAL
22Comment: This record is critical. If it cannot be processed (for example because the record type is unknown) resolution MUST fail
23References: LSD0001
24
25Number: 14
26Name: SHADOW
27Comment: This record should not be used unless all (other) records in the set with an absolute expiration time have expired.
28References: LSD0001
29
30Number: 13
31Name: SUPPLEMENTAL
32Comment: This is a supplemental record.
33References: LSD0001
34
35Number: 1
36Name: RELATIVE_EXPIRATION
37Comment: This expiration time of the record is a relative time (not an absolute time). Used in GNUnet implementation.
38References: GNUnet implementation
39
40Number: 0
41Name: PRIVATE
42Comment: This is a private record of this peer and it should thus not be published.
43References: GNUnet implementation
diff --git a/gnu-name-system-record-flags/rst.footer b/gnu-name-system-record-flags/rst.footer
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/gnu-name-system-record-flags/rst.footer
diff --git a/gnu-name-system-record-flags/rst.header b/gnu-name-system-record-flags/rst.header
new file mode 100644
index 0000000..1549bb9
--- /dev/null
+++ b/gnu-name-system-record-flags/rst.header
@@ -0,0 +1,4 @@
1Registry for GNU Name System record flags
2-----------------------------------------
3
4
diff --git a/gnu-name-system-record-flags/rst.template b/gnu-name-system-record-flags/rst.template
new file mode 100644
index 0000000..47fb4b9
--- /dev/null
+++ b/gnu-name-system-record-flags/rst.template
@@ -0,0 +1,9 @@
1
2
3=================== ===========================================================
4Name GNUNET_GNSRECORD_RF_{{Name}}
5------------------- -----------------------------------------------------------
6Number {{Number}}
7Comment {{Comment}}
8=================== ===========================================================
9
diff --git a/gnu-name-system-record-types/rst.template b/gnu-name-system-record-types/rst.template
index 4be9cd8..dd8b1ea 100644
--- a/gnu-name-system-record-types/rst.template
+++ b/gnu-name-system-record-types/rst.template
@@ -4,6 +4,6 @@
4Name GNUNET_GNSRECORD_TYPE_{{Name}} 4Name GNUNET_GNSRECORD_TYPE_{{Name}}
5------------------- ----------------------------------------------------------- 5------------------- -----------------------------------------------------------
6Number {{Number}} 6Number {{Number}}
7Commenr {{Comment}} 7Comment {{Comment}}
8=================== =========================================================== 8=================== ===========================================================
9 9