diff options
author | Martin Schanzenbach <schanzen@gnunet.org> | 2023-12-01 10:25:42 +0100 |
---|---|---|
committer | Martin Schanzenbach <schanzen@gnunet.org> | 2023-12-01 10:25:42 +0100 |
commit | 61a26b616cf5bef1eb6759f8d35ae4ad93d0ad78 (patch) | |
tree | d429af2c6f0a01aae907e4702837cc54600d1b01 | |
parent | 2ccbe6a28c86fb1618d30b3d76d9fd70c95203ae (diff) | |
download | gana-61a26b616cf5bef1eb6759f8d35ae4ad93d0ad78.tar.gz gana-61a26b616cf5bef1eb6759f8d35ae4ad93d0ad78.zip |
Add GNS service and port mappings for BOX records
-rw-r--r-- | gns-protocol-numbers/.gitignore | 1 | ||||
-rw-r--r-- | gns-protocol-numbers/Makefile | 30 | ||||
-rw-r--r-- | gns-protocol-numbers/POLICY | 20 | ||||
-rw-r--r-- | gns-protocol-numbers/README | 5 | ||||
-rw-r--r-- | gns-protocol-numbers/h.footer | 42 | ||||
-rw-r--r-- | gns-protocol-numbers/h.header | 47 | ||||
-rw-r--r-- | gns-protocol-numbers/h.template | 8 | ||||
-rw-r--r-- | gns-protocol-numbers/registry.rec | 22 | ||||
-rw-r--r-- | gns-protocol-numbers/rst.footer | 0 | ||||
-rw-r--r-- | gns-protocol-numbers/rst.header.template | 4 | ||||
-rw-r--r-- | gns-protocol-numbers/rst.template | 10 | ||||
-rw-r--r-- | gns-service-port-numbers/.gitignore | 1 | ||||
-rw-r--r-- | gns-service-port-numbers/Makefile | 30 | ||||
-rw-r--r-- | gns-service-port-numbers/POLICY | 20 | ||||
-rw-r--r-- | gns-service-port-numbers/README | 4 | ||||
-rw-r--r-- | gns-service-port-numbers/h.footer | 42 | ||||
-rw-r--r-- | gns-service-port-numbers/h.header | 47 | ||||
-rw-r--r-- | gns-service-port-numbers/h.template | 8 | ||||
-rw-r--r-- | gns-service-port-numbers/registry.rec | 22 | ||||
-rw-r--r-- | gns-service-port-numbers/rst.footer | 0 | ||||
-rw-r--r-- | gns-service-port-numbers/rst.header.template | 4 | ||||
-rw-r--r-- | gns-service-port-numbers/rst.template | 10 |
22 files changed, 377 insertions, 0 deletions
diff --git a/gns-protocol-numbers/.gitignore b/gns-protocol-numbers/.gitignore new file mode 100644 index 0000000..0a437d0 --- /dev/null +++ b/gns-protocol-numbers/.gitignore | |||
@@ -0,0 +1 @@ | |||
gnu-name-system-record-types.h | |||
diff --git a/gns-protocol-numbers/Makefile b/gns-protocol-numbers/Makefile new file mode 100644 index 0000000..afcf051 --- /dev/null +++ b/gns-protocol-numbers/Makefile | |||
@@ -0,0 +1,30 @@ | |||
1 | FILES=gnu_name_system_protocols.h gnu_name_system_protocols.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_protocols.h.tmp: registry.rec h.template | ||
13 | ../format.sh h.template < registry.rec > $@ | ||
14 | |||
15 | gnu_name_system_protocols.h: h.header gnu_name_system_protocols.h.tmp h.footer | ||
16 | cat h.header gnu_name_system_protocols.h.tmp h.footer > $@ | ||
17 | |||
18 | gnu_name_system_protocols.rst.tmp: registry.rec rst.template | ||
19 | ../format.sh rst.template < registry.rec > $@ | ||
20 | |||
21 | rst.header.tmp: | ||
22 | cat rst.header.template README POLICY > $@ | ||
23 | echo "Entries" >> $@ | ||
24 | echo "^^^^^^^" >> $@ | ||
25 | |||
26 | gnu_name_system_protocols.rst: rst.header.tmp gnu_name_system_protocols.rst.tmp rst.footer | ||
27 | cat rst.header.tmp gnu_name_system_protocols.rst.tmp rst.footer > $@ | ||
28 | |||
29 | |||
30 | .PHONY: check clean distclean | ||
diff --git a/gns-protocol-numbers/POLICY b/gns-protocol-numbers/POLICY new file mode 100644 index 0000000..3972d5d --- /dev/null +++ b/gns-protocol-numbers/POLICY | |||
@@ -0,0 +1,20 @@ | |||
1 | Policy | ||
2 | ^^^^^^ | ||
3 | |||
4 | Each registry entry should contain three values: the port "Number" of the | ||
5 | protocol, which must be above 255, | ||
6 | the "Name" of the protocol, and a "Reference" with links | ||
7 | to further information about the record type. | ||
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 protocols 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 type. | ||
17 | |||
18 | The current contact(s) for expert review are reachable at | ||
19 | gns-registry@gnunet.org. | ||
20 | |||
diff --git a/gns-protocol-numbers/README b/gns-protocol-numbers/README new file mode 100644 index 0000000..b8e46be --- /dev/null +++ b/gns-protocol-numbers/README | |||
@@ -0,0 +1,5 @@ | |||
1 | This registry is for protocol number mappings for GNS names that are BOXed. | ||
2 | |||
3 | Some "_"-labels map to protocol numbers, but others do not. | ||
4 | For common "_"-labels, we provide a number mapping in this registry. | ||
5 | |||
diff --git a/gns-protocol-numbers/h.footer b/gns-protocol-numbers/h.footer new file mode 100644 index 0000000..a9ac1bb --- /dev/null +++ b/gns-protocol-numbers/h.footer | |||
@@ -0,0 +1,42 @@ | |||
1 | { | ||
2 | .name = NULL, | ||
3 | .number = 0 | ||
4 | } | ||
5 | |||
6 | }; | ||
7 | |||
8 | uint16_t | ||
9 | GNUNET_GNS_protocol_name_to_number (const char* name) | ||
10 | { | ||
11 | int i = 0; | ||
12 | while (NULL != GNUNET_GNS_Protocols[i].name) | ||
13 | { | ||
14 | if (0 == strcmp (name, GNUNET_GNS_Protocols[i].name)) | ||
15 | return GNUNET_GNS_Protocols[i].number; | ||
16 | i++; | ||
17 | } | ||
18 | return 0; | ||
19 | } | ||
20 | |||
21 | const char* | ||
22 | GNUNET_GNS_protocol_number_to_name (uint16_t number) | ||
23 | { | ||
24 | int i = 0; | ||
25 | while (NULL != GNUNET_GNS_Protocol[i].name) | ||
26 | { | ||
27 | if (number == GNUNET_GNS_Protocols[i].number) | ||
28 | return GNUNET_GNS_Protocols[i].name; | ||
29 | i++; | ||
30 | } | ||
31 | return NULL; | ||
32 | } | ||
33 | |||
34 | |||
35 | #if 0 /* keep Emacsens' auto-indent happy */ | ||
36 | { | ||
37 | #endif | ||
38 | #ifdef __cplusplus | ||
39 | } | ||
40 | #endif | ||
41 | |||
42 | #endif | ||
diff --git a/gns-protocol-numbers/h.header b/gns-protocol-numbers/h.header new file mode 100644 index 0000000..8571e41 --- /dev/null +++ b/gns-protocol-numbers/h.header | |||
@@ -0,0 +1,47 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet | ||
3 | Copyright (C) 2012-2023 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_GNS_PROTOCOLS_H | ||
21 | #define GNUNET_GNS_PROTOCOLS_H | ||
22 | |||
23 | /** | ||
24 | * WARNING: | ||
25 | * This header is generated! | ||
26 | * In order to add GNS service ports, 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 | struct GNUNET_GNS_Protocol | ||
40 | { | ||
41 | const char* name; | ||
42 | |||
43 | uint16_t number; | ||
44 | }; | ||
45 | |||
46 | struct GNUNET_GNS_Protocol GNUNET_GNS_Protocols[] = | ||
47 | { | ||
diff --git a/gns-protocol-numbers/h.template b/gns-protocol-numbers/h.template new file mode 100644 index 0000000..aec5968 --- /dev/null +++ b/gns-protocol-numbers/h.template | |||
@@ -0,0 +1,8 @@ | |||
1 | |||
2 | |||
3 | /** | ||
4 | * {{Comment}} | ||
5 | */ | ||
6 | { .name = "{{Name}}", | ||
7 | .number = "{{Number}}" | ||
8 | }, | ||
diff --git a/gns-protocol-numbers/registry.rec b/gns-protocol-numbers/registry.rec new file mode 100644 index 0000000..2ce438a --- /dev/null +++ b/gns-protocol-numbers/registry.rec | |||
@@ -0,0 +1,22 @@ | |||
1 | # -*- mode: rec -*- | ||
2 | # | ||
3 | # Registry for GNS protocols | ||
4 | # | ||
5 | |||
6 | %rec: GnsProtocol | ||
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: 49152 | ||
20 | Name: scheme | ||
21 | Comment: LIGHest trust policy scheme | ||
22 | References: TODO | ||
diff --git a/gns-protocol-numbers/rst.footer b/gns-protocol-numbers/rst.footer new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/gns-protocol-numbers/rst.footer | |||
diff --git a/gns-protocol-numbers/rst.header.template b/gns-protocol-numbers/rst.header.template new file mode 100644 index 0000000..af9afd6 --- /dev/null +++ b/gns-protocol-numbers/rst.header.template | |||
@@ -0,0 +1,4 @@ | |||
1 | GNS Service Ports | ||
2 | ----------------- | ||
3 | |||
4 | |||
diff --git a/gns-protocol-numbers/rst.template b/gns-protocol-numbers/rst.template new file mode 100644 index 0000000..3b3917a --- /dev/null +++ b/gns-protocol-numbers/rst.template | |||
@@ -0,0 +1,10 @@ | |||
1 | |||
2 | |||
3 | =================== =========================================================== | ||
4 | Name {{Name}} | ||
5 | ------------------- ----------------------------------------------------------- | ||
6 | Number {{Number}} | ||
7 | Comment {{Comment}} | ||
8 | References {{References}} | ||
9 | =================== =========================================================== | ||
10 | |||
diff --git a/gns-service-port-numbers/.gitignore b/gns-service-port-numbers/.gitignore new file mode 100644 index 0000000..0a437d0 --- /dev/null +++ b/gns-service-port-numbers/.gitignore | |||
@@ -0,0 +1 @@ | |||
gnu-name-system-record-types.h | |||
diff --git a/gns-service-port-numbers/Makefile b/gns-service-port-numbers/Makefile new file mode 100644 index 0000000..85dd35f --- /dev/null +++ b/gns-service-port-numbers/Makefile | |||
@@ -0,0 +1,30 @@ | |||
1 | FILES=gnu_name_system_service_ports.h gnu_name_system_service_ports.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_service_ports.h.tmp: registry.rec h.template | ||
13 | ../format.sh h.template < registry.rec > $@ | ||
14 | |||
15 | gnu_name_system_service_ports.h: h.header gnu_name_system_service_ports.h.tmp h.footer | ||
16 | cat h.header gnu_name_system_service_ports.h.tmp h.footer > $@ | ||
17 | |||
18 | gnu_name_system_service_ports.rst.tmp: registry.rec rst.template | ||
19 | ../format.sh rst.template < registry.rec > $@ | ||
20 | |||
21 | rst.header.tmp: | ||
22 | cat rst.header.template README POLICY > $@ | ||
23 | echo "Entries" >> $@ | ||
24 | echo "^^^^^^^" >> $@ | ||
25 | |||
26 | gnu_name_system_service_ports.rst: rst.header.tmp gnu_name_system_service_ports.rst.tmp rst.footer | ||
27 | cat rst.header.tmp gnu_name_system_service_ports.rst.tmp rst.footer > $@ | ||
28 | |||
29 | |||
30 | .PHONY: check clean distclean | ||
diff --git a/gns-service-port-numbers/POLICY b/gns-service-port-numbers/POLICY new file mode 100644 index 0000000..3dbb6dc --- /dev/null +++ b/gns-service-port-numbers/POLICY | |||
@@ -0,0 +1,20 @@ | |||
1 | Policy | ||
2 | ^^^^^^ | ||
3 | |||
4 | Each registry entry should contain three values: the port "Number" of the | ||
5 | service, which must be above 49151 (private/dynamic port range), | ||
6 | the "Name" of the service, and a "Reference" with links | ||
7 | to further information about the record type. | ||
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 records 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 type. | ||
17 | |||
18 | The current contact(s) for expert review are reachable at | ||
19 | gns-registry@gnunet.org. | ||
20 | |||
diff --git a/gns-service-port-numbers/README b/gns-service-port-numbers/README new file mode 100644 index 0000000..06727f3 --- /dev/null +++ b/gns-service-port-numbers/README | |||
@@ -0,0 +1,4 @@ | |||
1 | This registry is for service-to-port mappings for GNS names that are BOXed. | ||
2 | |||
3 | Some "_"-labels map to service ports (RFC 6335), but others do not. | ||
4 | For common "_"-labels, we provide a number mapping in this registry. | ||
diff --git a/gns-service-port-numbers/h.footer b/gns-service-port-numbers/h.footer new file mode 100644 index 0000000..614133b --- /dev/null +++ b/gns-service-port-numbers/h.footer | |||
@@ -0,0 +1,42 @@ | |||
1 | { | ||
2 | .name = NULL, | ||
3 | .port = 0 | ||
4 | } | ||
5 | |||
6 | }; | ||
7 | |||
8 | uint16_t | ||
9 | GNUNET_GNS_service_port_name_to_number (const char* name) | ||
10 | { | ||
11 | int i = 0; | ||
12 | while (NULL != GNUNET_GNS_ServicePorts[i].name) | ||
13 | { | ||
14 | if (0 == strcmp (name, GNUNET_GNS_ServicePorts[i].name)) | ||
15 | return GNUNET_GNS_ServicePorts[i].port; | ||
16 | i++; | ||
17 | } | ||
18 | return 0; | ||
19 | } | ||
20 | |||
21 | const char* | ||
22 | GNUNET_GNS_service_port_number_to_name (uint16_t port) | ||
23 | { | ||
24 | int i = 0; | ||
25 | while (NULL != GNUNET_GNS_ServicePorts[i].name) | ||
26 | { | ||
27 | if (port == GNUNET_GNS_ServicePorts[i].port) | ||
28 | return GNUNET_GNS_ServicePorts[i].name; | ||
29 | i++; | ||
30 | } | ||
31 | return NULL; | ||
32 | } | ||
33 | |||
34 | |||
35 | #if 0 /* keep Emacsens' auto-indent happy */ | ||
36 | { | ||
37 | #endif | ||
38 | #ifdef __cplusplus | ||
39 | } | ||
40 | #endif | ||
41 | |||
42 | #endif | ||
diff --git a/gns-service-port-numbers/h.header b/gns-service-port-numbers/h.header new file mode 100644 index 0000000..ed8860e --- /dev/null +++ b/gns-service-port-numbers/h.header | |||
@@ -0,0 +1,47 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet | ||
3 | Copyright (C) 2012-2023 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_GNS_SERVICE_PORTS_H | ||
21 | #define GNUNET_GNS_SERVICE_PORTS_H | ||
22 | |||
23 | /** | ||
24 | * WARNING: | ||
25 | * This header is generated! | ||
26 | * In order to add GNS service ports, 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 | struct GNUNET_GNS_ServicePort | ||
40 | { | ||
41 | const char* name; | ||
42 | |||
43 | uint16_t port; | ||
44 | }; | ||
45 | |||
46 | struct GNUNET_GNS_ServicePort GNUNET_GNS_ServicePorts[] = | ||
47 | { | ||
diff --git a/gns-service-port-numbers/h.template b/gns-service-port-numbers/h.template new file mode 100644 index 0000000..0b2d512 --- /dev/null +++ b/gns-service-port-numbers/h.template | |||
@@ -0,0 +1,8 @@ | |||
1 | |||
2 | |||
3 | /** | ||
4 | * {{Comment}} | ||
5 | */ | ||
6 | { .name = "{{Name}}", | ||
7 | .port = "{{Number}}" | ||
8 | }, | ||
diff --git a/gns-service-port-numbers/registry.rec b/gns-service-port-numbers/registry.rec new file mode 100644 index 0000000..ad5af0e --- /dev/null +++ b/gns-service-port-numbers/registry.rec | |||
@@ -0,0 +1,22 @@ | |||
1 | # -*- mode: rec -*- | ||
2 | # | ||
3 | # Registry for GNS service ports | ||
4 | # | ||
5 | |||
6 | %rec: GnsServicePort | ||
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: 49152 | ||
20 | Name: scheme | ||
21 | Comment: LIGHest trust policy scheme | ||
22 | References: TODO | ||
diff --git a/gns-service-port-numbers/rst.footer b/gns-service-port-numbers/rst.footer new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/gns-service-port-numbers/rst.footer | |||
diff --git a/gns-service-port-numbers/rst.header.template b/gns-service-port-numbers/rst.header.template new file mode 100644 index 0000000..af9afd6 --- /dev/null +++ b/gns-service-port-numbers/rst.header.template | |||
@@ -0,0 +1,4 @@ | |||
1 | GNS Service Ports | ||
2 | ----------------- | ||
3 | |||
4 | |||
diff --git a/gns-service-port-numbers/rst.template b/gns-service-port-numbers/rst.template new file mode 100644 index 0000000..3b3917a --- /dev/null +++ b/gns-service-port-numbers/rst.template | |||
@@ -0,0 +1,10 @@ | |||
1 | |||
2 | |||
3 | =================== =========================================================== | ||
4 | Name {{Name}} | ||
5 | ------------------- ----------------------------------------------------------- | ||
6 | Number {{Number}} | ||
7 | Comment {{Comment}} | ||
8 | References {{References}} | ||
9 | =================== =========================================================== | ||
10 | |||