diff options
Diffstat (limited to 'gnu-name-system-record-flags')
-rw-r--r-- | gnu-name-system-record-flags/.gitignore | 1 | ||||
-rw-r--r-- | gnu-name-system-record-flags/Makefile | 28 | ||||
-rw-r--r-- | gnu-name-system-record-flags/POLICY | 20 | ||||
-rw-r--r-- | gnu-name-system-record-flags/README | 13 | ||||
-rw-r--r-- | gnu-name-system-record-flags/h.footer | 11 | ||||
-rw-r--r-- | gnu-name-system-record-flags/h.header | 49 | ||||
-rw-r--r-- | gnu-name-system-record-flags/h.template | 6 | ||||
-rw-r--r-- | gnu-name-system-record-flags/registry.rec | 43 | ||||
-rw-r--r-- | gnu-name-system-record-flags/rst.footer | 0 | ||||
-rw-r--r-- | gnu-name-system-record-flags/rst.header.template | 11 | ||||
-rw-r--r-- | gnu-name-system-record-flags/rst.template | 4 |
11 files changed, 186 insertions, 0 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..9166ba5 --- /dev/null +++ b/gnu-name-system-record-flags/Makefile | |||
@@ -0,0 +1,28 @@ | |||
1 | FILES=gnu_name_system_record_flags.h gnu_name_system_record_flags.rst | ||
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 | gnu_name_system_record_flags.h.tmp: registry.rec h.template | ||
13 | ../format.sh h.template < registry.rec > $@ | ||
14 | |||
15 | gnu_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 | |||
18 | gnu_name_system_record_flags.rst.tmp: registry.rec rst.template | ||
19 | ../format.sh rst.template < registry.rec > $@ | ||
20 | |||
21 | rst.header.tmp: | ||
22 | cat README POLICY rst.header.template > $@ | ||
23 | |||
24 | gnu_name_system_record_flags.rst: rst.header.tmp gnu_name_system_record_flags.rst.tmp rst.footer | ||
25 | cat rst.header.tmp gnu_name_system_record_flags.rst.tmp rst.footer > $@ | ||
26 | |||
27 | |||
28 | .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..f9607ee --- /dev/null +++ b/gnu-name-system-record-flags/POLICY | |||
@@ -0,0 +1,20 @@ | |||
1 | Policy | ||
2 | ^^^^^^ | ||
3 | |||
4 | Each registry entry should contain three values: the "Number" of the | ||
5 | record flags, which must be between 0 and 15, | ||
6 | the "Name" of the record flag, and a "Reference" with links | ||
7 | to further information about the record flag. | ||
8 | |||
9 | The "Name" must be unique in the entire registry. The value must be a | ||
10 | case insensitive ASCII string and is restricted to alphanumeric | ||
11 | characters. | ||
12 | |||
13 | Adding flags is possible after expert review, using a | ||
14 | first-come-first-served policy for unique "Name" allocation. | ||
15 | Experts are responsible to ensure that the chosen "Name" is | ||
16 | appropriate for the record flag. | ||
17 | |||
18 | The current contact(s) for expert review are reachable at | ||
19 | gns-registry@gnunet.org. | ||
20 | |||
diff --git a/gnu-name-system-record-flags/README b/gnu-name-system-record-flags/README new file mode 100644 index 0000000..6cb5f1b --- /dev/null +++ b/gnu-name-system-record-flags/README | |||
@@ -0,0 +1,13 @@ | |||
1 | GNS Record Flags | ||
2 | ---------------- | ||
3 | |||
4 | This registry is for GNU Name System Record Flags. | ||
5 | |||
6 | GNU Name System Record flags uniquely identify the different kinds | ||
7 | of key-value pairs that can be used as flags of a GNU Name System record. | ||
8 | |||
9 | This registry is used to ensure that the names and numeric values | ||
10 | used to identify record flags are uniquely defined and to | ||
11 | allow GNS resolvers implementors to find out details about the | ||
12 | respective semantics and human-readable syntax. | ||
13 | |||
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 | */ | ||
44 | enum 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..22aa750 --- /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 | |||
20 | Number: 15 | ||
21 | Name: CRITICAL | ||
22 | Comment: This record is critical. If it cannot be processed (for example because the record type is unknown) resolution MUST fail | ||
23 | References: https://lsd.gnunet.org/lsd0001 | ||
24 | |||
25 | Number: 14 | ||
26 | Name: SHADOW | ||
27 | Comment: This record should not be used unless all (other) records in the set with an absolute expiration time have expired. | ||
28 | References: https://lsd.gnunet.org/lsd0001 | ||
29 | |||
30 | Number: 13 | ||
31 | Name: SUPPLEMENTAL | ||
32 | Comment: This is a supplemental record. | ||
33 | References: https://lsd.gnunet.org/lsd0001 | ||
34 | |||
35 | Number: 1 | ||
36 | Name: RELATIVE_EXPIRATION | ||
37 | Comment: This expiration time of the record is a relative time (not an absolute time). Used in GNUnet implementation. | ||
38 | References: https://git.gnunet.org/gnunet.git | ||
39 | |||
40 | Number: 0 | ||
41 | Name: PRIVATE | ||
42 | Comment: This is a private record of this peer and it should thus not be published. | ||
43 | References: https://git.gnunet.org/gnunet.git | ||
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.template b/gnu-name-system-record-flags/rst.header.template new file mode 100644 index 0000000..76d353f --- /dev/null +++ b/gnu-name-system-record-flags/rst.header.template | |||
@@ -0,0 +1,11 @@ | |||
1 | Entries | ||
2 | ^^^^^^^ | ||
3 | |||
4 | .. list-table:: GNS Record Flags | ||
5 | :widths: auto | ||
6 | :header-rows: 1 | ||
7 | |||
8 | * - Name | ||
9 | - Number | ||
10 | - References | ||
11 | - Comment | ||
diff --git a/gnu-name-system-record-flags/rst.template b/gnu-name-system-record-flags/rst.template new file mode 100644 index 0000000..11468c9 --- /dev/null +++ b/gnu-name-system-record-flags/rst.template | |||
@@ -0,0 +1,4 @@ | |||
1 | * - {{Name}} | ||
2 | - {{Number}} | ||
3 | - {{References}} | ||
4 | - {{Comment}} | ||