gana

GNUnet Assigned Numbers Authority
Log | Files | Refs | README | LICENSE

commit 61a26b616cf5bef1eb6759f8d35ae4ad93d0ad78
parent 2ccbe6a28c86fb1618d30b3d76d9fd70c95203ae
Author: Martin Schanzenbach <schanzen@gnunet.org>
Date:   Fri,  1 Dec 2023 10:25:42 +0100

Add GNS service and port mappings for BOX records

Diffstat:
Agns-protocol-numbers/.gitignore | 1+
Agns-protocol-numbers/Makefile | 30++++++++++++++++++++++++++++++
Agns-protocol-numbers/POLICY | 20++++++++++++++++++++
Agns-protocol-numbers/README | 5+++++
Agns-protocol-numbers/h.footer | 42++++++++++++++++++++++++++++++++++++++++++
Agns-protocol-numbers/h.header | 47+++++++++++++++++++++++++++++++++++++++++++++++
Agns-protocol-numbers/h.template | 8++++++++
Agns-protocol-numbers/registry.rec | 22++++++++++++++++++++++
Agns-protocol-numbers/rst.footer | 0
Agns-protocol-numbers/rst.header.template | 4++++
Agns-protocol-numbers/rst.template | 10++++++++++
Agns-service-port-numbers/.gitignore | 1+
Agns-service-port-numbers/Makefile | 30++++++++++++++++++++++++++++++
Agns-service-port-numbers/POLICY | 20++++++++++++++++++++
Agns-service-port-numbers/README | 4++++
Agns-service-port-numbers/h.footer | 42++++++++++++++++++++++++++++++++++++++++++
Agns-service-port-numbers/h.header | 47+++++++++++++++++++++++++++++++++++++++++++++++
Agns-service-port-numbers/h.template | 8++++++++
Agns-service-port-numbers/registry.rec | 22++++++++++++++++++++++
Agns-service-port-numbers/rst.footer | 0
Agns-service-port-numbers/rst.header.template | 4++++
Agns-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 @@ -0,0 +1 @@ +gnu-name-system-record-types.h diff --git a/gns-protocol-numbers/Makefile b/gns-protocol-numbers/Makefile @@ -0,0 +1,30 @@ +FILES=gnu_name_system_protocols.h gnu_name_system_protocols.rst +all: check $(FILES) + +check: + recfix --check registry.rec + +distclean: + rm -f *.tmp +clean: + rm -f $(FILES) *.tmp + +gnu_name_system_protocols.h.tmp: registry.rec h.template + ../format.sh h.template < registry.rec > $@ + +gnu_name_system_protocols.h: h.header gnu_name_system_protocols.h.tmp h.footer + cat h.header gnu_name_system_protocols.h.tmp h.footer > $@ + +gnu_name_system_protocols.rst.tmp: registry.rec rst.template + ../format.sh rst.template < registry.rec > $@ + +rst.header.tmp: + cat rst.header.template README POLICY > $@ + echo "Entries" >> $@ + echo "^^^^^^^" >> $@ + +gnu_name_system_protocols.rst: rst.header.tmp gnu_name_system_protocols.rst.tmp rst.footer + cat rst.header.tmp gnu_name_system_protocols.rst.tmp rst.footer > $@ + + +.PHONY: check clean distclean diff --git a/gns-protocol-numbers/POLICY b/gns-protocol-numbers/POLICY @@ -0,0 +1,20 @@ +Policy +^^^^^^ + +Each registry entry should contain three values: the port "Number" of the +protocol, which must be above 255, +the "Name" of the protocol, and a "Reference" with links +to further information about the record type. + +The "Name" must be unique in the entire registry. The value must be a +case insensitive ASCII string and is restricted to alphanumeric +characters. + +Adding protocols is possible after expert review, using a +first-come-first-served policy for unique "Name" allocation. +Experts are responsible to ensure that the chosen "Name" is +appropriate for the record type. + +The current contact(s) for expert review are reachable at +gns-registry@gnunet.org. + diff --git a/gns-protocol-numbers/README b/gns-protocol-numbers/README @@ -0,0 +1,5 @@ +This registry is for protocol number mappings for GNS names that are BOXed. + +Some "_"-labels map to protocol numbers, but others do not. +For common "_"-labels, we provide a number mapping in this registry. + diff --git a/gns-protocol-numbers/h.footer b/gns-protocol-numbers/h.footer @@ -0,0 +1,42 @@ + { + .name = NULL, + .number = 0 + } + +}; + +uint16_t +GNUNET_GNS_protocol_name_to_number (const char* name) +{ + int i = 0; + while (NULL != GNUNET_GNS_Protocols[i].name) + { + if (0 == strcmp (name, GNUNET_GNS_Protocols[i].name)) + return GNUNET_GNS_Protocols[i].number; + i++; + } + return 0; +} + +const char* +GNUNET_GNS_protocol_number_to_name (uint16_t number) +{ + int i = 0; + while (NULL != GNUNET_GNS_Protocol[i].name) + { + if (number == GNUNET_GNS_Protocols[i].number) + return GNUNET_GNS_Protocols[i].name; + i++; + } + return NULL; +} + + +#if 0 /* keep Emacsens' auto-indent happy */ +{ +#endif +#ifdef __cplusplus +} +#endif + +#endif diff --git a/gns-protocol-numbers/h.header b/gns-protocol-numbers/h.header @@ -0,0 +1,47 @@ +/* + This file is part of GNUnet + Copyright (C) 2012-2023 GNUnet e.V. + + GNUnet is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + GNUnet is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + + SPDX-License-Identifier: AGPL3.0-or-later + */ +#ifndef GNUNET_GNS_PROTOCOLS_H +#define GNUNET_GNS_PROTOCOLS_H + +/** + * WARNING: + * This header is generated! + * In order to add GNS service ports, you must register + * them in GANA, and then use the header generation script + * to create an update of this file. You may then replace this + * file with the update. + */ + +#ifdef __cplusplus +extern "C" { +#if 0 /* keep Emacsens' auto-indent happy */ +} +#endif +#endif + +struct GNUNET_GNS_Protocol +{ + const char* name; + + uint16_t number; +}; + +struct GNUNET_GNS_Protocol GNUNET_GNS_Protocols[] = +{ diff --git a/gns-protocol-numbers/h.template b/gns-protocol-numbers/h.template @@ -0,0 +1,8 @@ + + + /** + * {{Comment}} + */ + { .name = "{{Name}}", + .number = "{{Number}}" + }, diff --git a/gns-protocol-numbers/registry.rec b/gns-protocol-numbers/registry.rec @@ -0,0 +1,22 @@ +# -*- mode: rec -*- +# +# Registry for GNS protocols +# + +%rec: GnsProtocol +%key: Number +%type: Number int +%mandatory: Number +%typedef: Name_t regexp /^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-]*$/ +%type: Name Name_t +%unique: Name +%mandatory: Name +%mandatory: Comment +%allowed: Contact +%allowed: References +%sort: Number Name Contact References + +Number: 49152 +Name: scheme +Comment: LIGHest trust policy scheme +References: TODO diff --git a/gns-protocol-numbers/rst.footer b/gns-protocol-numbers/rst.footer diff --git a/gns-protocol-numbers/rst.header.template b/gns-protocol-numbers/rst.header.template @@ -0,0 +1,4 @@ +GNS Service Ports +----------------- + + diff --git a/gns-protocol-numbers/rst.template b/gns-protocol-numbers/rst.template @@ -0,0 +1,10 @@ + + +=================== =========================================================== +Name {{Name}} +------------------- ----------------------------------------------------------- +Number {{Number}} +Comment {{Comment}} +References {{References}} +=================== =========================================================== + diff --git a/gns-service-port-numbers/.gitignore 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 @@ -0,0 +1,30 @@ +FILES=gnu_name_system_service_ports.h gnu_name_system_service_ports.rst +all: check $(FILES) + +check: + recfix --check registry.rec + +distclean: + rm -f *.tmp +clean: + rm -f $(FILES) *.tmp + +gnu_name_system_service_ports.h.tmp: registry.rec h.template + ../format.sh h.template < registry.rec > $@ + +gnu_name_system_service_ports.h: h.header gnu_name_system_service_ports.h.tmp h.footer + cat h.header gnu_name_system_service_ports.h.tmp h.footer > $@ + +gnu_name_system_service_ports.rst.tmp: registry.rec rst.template + ../format.sh rst.template < registry.rec > $@ + +rst.header.tmp: + cat rst.header.template README POLICY > $@ + echo "Entries" >> $@ + echo "^^^^^^^" >> $@ + +gnu_name_system_service_ports.rst: rst.header.tmp gnu_name_system_service_ports.rst.tmp rst.footer + cat rst.header.tmp gnu_name_system_service_ports.rst.tmp rst.footer > $@ + + +.PHONY: check clean distclean diff --git a/gns-service-port-numbers/POLICY b/gns-service-port-numbers/POLICY @@ -0,0 +1,20 @@ +Policy +^^^^^^ + +Each registry entry should contain three values: the port "Number" of the +service, which must be above 49151 (private/dynamic port range), +the "Name" of the service, and a "Reference" with links +to further information about the record type. + +The "Name" must be unique in the entire registry. The value must be a +case insensitive ASCII string and is restricted to alphanumeric +characters. + +Adding records is possible after expert review, using a +first-come-first-served policy for unique "Name" allocation. +Experts are responsible to ensure that the chosen "Name" is +appropriate for the record type. + +The current contact(s) for expert review are reachable at +gns-registry@gnunet.org. + diff --git a/gns-service-port-numbers/README b/gns-service-port-numbers/README @@ -0,0 +1,4 @@ +This registry is for service-to-port mappings for GNS names that are BOXed. + +Some "_"-labels map to service ports (RFC 6335), but others do not. +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 @@ -0,0 +1,42 @@ + { + .name = NULL, + .port = 0 + } + +}; + +uint16_t +GNUNET_GNS_service_port_name_to_number (const char* name) +{ + int i = 0; + while (NULL != GNUNET_GNS_ServicePorts[i].name) + { + if (0 == strcmp (name, GNUNET_GNS_ServicePorts[i].name)) + return GNUNET_GNS_ServicePorts[i].port; + i++; + } + return 0; +} + +const char* +GNUNET_GNS_service_port_number_to_name (uint16_t port) +{ + int i = 0; + while (NULL != GNUNET_GNS_ServicePorts[i].name) + { + if (port == GNUNET_GNS_ServicePorts[i].port) + return GNUNET_GNS_ServicePorts[i].name; + i++; + } + return NULL; +} + + +#if 0 /* keep Emacsens' auto-indent happy */ +{ +#endif +#ifdef __cplusplus +} +#endif + +#endif diff --git a/gns-service-port-numbers/h.header b/gns-service-port-numbers/h.header @@ -0,0 +1,47 @@ +/* + This file is part of GNUnet + Copyright (C) 2012-2023 GNUnet e.V. + + GNUnet is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + GNUnet is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + + SPDX-License-Identifier: AGPL3.0-or-later + */ +#ifndef GNUNET_GNS_SERVICE_PORTS_H +#define GNUNET_GNS_SERVICE_PORTS_H + +/** + * WARNING: + * This header is generated! + * In order to add GNS service ports, you must register + * them in GANA, and then use the header generation script + * to create an update of this file. You may then replace this + * file with the update. + */ + +#ifdef __cplusplus +extern "C" { +#if 0 /* keep Emacsens' auto-indent happy */ +} +#endif +#endif + +struct GNUNET_GNS_ServicePort +{ + const char* name; + + uint16_t port; +}; + +struct GNUNET_GNS_ServicePort GNUNET_GNS_ServicePorts[] = +{ diff --git a/gns-service-port-numbers/h.template b/gns-service-port-numbers/h.template @@ -0,0 +1,8 @@ + + + /** + * {{Comment}} + */ + { .name = "{{Name}}", + .port = "{{Number}}" + }, diff --git a/gns-service-port-numbers/registry.rec b/gns-service-port-numbers/registry.rec @@ -0,0 +1,22 @@ +# -*- mode: rec -*- +# +# Registry for GNS service ports +# + +%rec: GnsServicePort +%key: Number +%type: Number int +%mandatory: Number +%typedef: Name_t regexp /^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-]*$/ +%type: Name Name_t +%unique: Name +%mandatory: Name +%mandatory: Comment +%allowed: Contact +%allowed: References +%sort: Number Name Contact References + +Number: 49152 +Name: scheme +Comment: LIGHest trust policy scheme +References: TODO diff --git a/gns-service-port-numbers/rst.footer 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 @@ -0,0 +1,4 @@ +GNS Service Ports +----------------- + + diff --git a/gns-service-port-numbers/rst.template b/gns-service-port-numbers/rst.template @@ -0,0 +1,10 @@ + + +=================== =========================================================== +Name {{Name}} +------------------- ----------------------------------------------------------- +Number {{Number}} +Comment {{Comment}} +References {{References}} +=================== =========================================================== +