aboutsummaryrefslogtreecommitdiff
path: root/gns-service-port-numbers
diff options
context:
space:
mode:
Diffstat (limited to 'gns-service-port-numbers')
-rw-r--r--gns-service-port-numbers/.gitignore1
-rw-r--r--gns-service-port-numbers/Makefile28
-rw-r--r--gns-service-port-numbers/POLICY20
-rw-r--r--gns-service-port-numbers/README8
-rw-r--r--gns-service-port-numbers/h.footer42
-rw-r--r--gns-service-port-numbers/h.header46
-rw-r--r--gns-service-port-numbers/h.template8
-rw-r--r--gns-service-port-numbers/registry.rec27
-rw-r--r--gns-service-port-numbers/rst.footer0
-rw-r--r--gns-service-port-numbers/rst.header.template11
-rw-r--r--gns-service-port-numbers/rst.template4
11 files changed, 195 insertions, 0 deletions
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..be25889
--- /dev/null
+++ b/gns-service-port-numbers/Makefile
@@ -0,0 +1,28 @@
1FILES=gnu_name_system_service_ports.h gnu_name_system_service_ports.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_service_ports.h.tmp: registry.rec h.template
13 ../format.sh h.template < registry.rec > $@
14
15gnu_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
18gnu_name_system_service_ports.rst.tmp: registry.rec rst.template
19 ../format.sh rst.template < registry.rec > $@
20
21rst.header.tmp:
22 cat README POLICY rst.header.template > $@
23
24gnu_name_system_service_ports.rst: rst.header.tmp gnu_name_system_service_ports.rst.tmp rst.footer
25 cat rst.header.tmp gnu_name_system_service_ports.rst.tmp rst.footer > $@
26
27
28.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 @@
1Policy
2^^^^^^
3
4Each registry entry should contain three values: the port "Number" of the
5service, which must be above 49151 (private/dynamic port range),
6the "Name" of the service, and a "Reference" with links
7to further information about the record type.
8
9The "Name" must be unique in the entire registry. The value must be a
10case insensitive ASCII string and is restricted to alphanumeric
11characters.
12
13Adding records is possible after expert review, using a
14first-come-first-served policy for unique "Name" allocation.
15Experts are responsible to ensure that the chosen "Name" is
16appropriate for the record type.
17
18The current contact(s) for expert review are reachable at
19gns-registry@gnunet.org.
20
diff --git a/gns-service-port-numbers/README b/gns-service-port-numbers/README
new file mode 100644
index 0000000..0babc89
--- /dev/null
+++ b/gns-service-port-numbers/README
@@ -0,0 +1,8 @@
1GNS Service Ports
2-----------------
3
4This registry is for service-to-port mappings for GNS names that are BOXed.
5
6Some "_"-labels map to service ports (RFC 6335), but others do not.
7For common "_"-labels, we provide a number mapping in this registry.
8
diff --git a/gns-service-port-numbers/h.footer b/gns-service-port-numbers/h.footer
new file mode 100644
index 0000000..e2f02f9
--- /dev/null
+++ b/gns-service-port-numbers/h.footer
@@ -0,0 +1,42 @@
1 {
2 .name = NULL,
3 .port = 0
4 }
5};
6
7uint16_t
8GNUNET_GNS_service_port_name_to_number (const char *name)
9{
10 int i = 0;
11 while (NULL != GNUNET_GNS_ServicePorts[i].name)
12 {
13 if (0 == strcmp (name, GNUNET_GNS_ServicePorts[i].name))
14 return GNUNET_GNS_ServicePorts[i].port;
15 i++;
16 }
17 return 0;
18}
19
20
21const char*
22GNUNET_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..6cedfe8
--- /dev/null
+++ b/gns-service-port-numbers/h.header
@@ -0,0 +1,46 @@
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
33extern "C" {
34#if 0 /* keep Emacsens' auto-indent happy */
35}
36#endif
37#endif
38
39struct GNUNET_GNS_ServicePort
40{
41 const char *name;
42
43 uint16_t port;
44};
45
46struct GNUNET_GNS_ServicePort GNUNET_GNS_ServicePorts[] = {
diff --git a/gns-service-port-numbers/h.template b/gns-service-port-numbers/h.template
new file mode 100644
index 0000000..a7c0a60
--- /dev/null
+++ b/gns-service-port-numbers/h.template
@@ -0,0 +1,8 @@
1 /**
2 * {{Comment}}
3 */
4 {
5 .name = "{{Name}}",
6 .port = {{Number}}
7 },
8
diff --git a/gns-service-port-numbers/registry.rec b/gns-service-port-numbers/registry.rec
new file mode 100644
index 0000000..9a5725e
--- /dev/null
+++ b/gns-service-port-numbers/registry.rec
@@ -0,0 +1,27 @@
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
19Number: 49152
20Name: scheme
21Comment: Used by Trust Scheme Authorities to publish information about Trust Schemes (LIGHTest)
22References: TODO
23
24Number: 49153
25Name: translation
26Comment: Used Trust Translation Authorities to publish information about Trust Translations (LIGHTest)
27References: TODO \ No newline at end of file
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..9da49e7
--- /dev/null
+++ b/gns-service-port-numbers/rst.header.template
@@ -0,0 +1,11 @@
1Entries
2^^^^^^^
3
4.. list-table:: GNS Service Ports
5 :widths: auto
6 :header-rows: 1
7
8 * - Name
9 - Number
10 - References
11 - Comment
diff --git a/gns-service-port-numbers/rst.template b/gns-service-port-numbers/rst.template
new file mode 100644
index 0000000..11468c9
--- /dev/null
+++ b/gns-service-port-numbers/rst.template
@@ -0,0 +1,4 @@
1 * - {{Name}}
2 - {{Number}}
3 - {{References}}
4 - {{Comment}}