summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authort3sserakt <t3ss@posteo.de>2021-03-04 10:43:15 +0100
committert3sserakt <t3ss@posteo.de>2021-03-04 11:31:11 +0100
commit1d6759045c958205201ae051d196a9e846b9ebd2 (patch)
treeee5ad3fae44ea5cb4792598cf1b7e852c8398df5
parente5d31aa52e4983bffce3eca6ca601bbb8f4a302a (diff)
parentdf757453c5f64540a58b6abb465963ca685de83f (diff)
Merge branch 'master' of ssh://gnunet.org/gnunet
-rw-r--r--configure.ac16
-rw-r--r--debian/libgnunet.install1
-rw-r--r--doc/Makefile.am2
-rw-r--r--doc/handbook/Makefile.am40
-rw-r--r--doc/handbook/chapters/developer.texi30
-rw-r--r--doc/handbook/chapters/user.texi109
-rw-r--r--doc/handbook/images/tng.dot55
-rw-r--r--doc/handbook/images/tng.pngbin0 -> 75821 bytes
-rw-r--r--doc/man/Makefile.am1
-rw-r--r--doc/man/gnunet-base32.174
-rw-r--r--doc/tutorial/Makefile.am21
-rw-r--r--po/POTFILES.in114
-rw-r--r--src/include/Makefile.am1
-rw-r--r--src/include/gnu_name_system_record_types.h138
-rw-r--r--src/include/gnunet_gnsrecord_lib.h104
-rw-r--r--src/peerstore/gnunet-service-peerstore.c15
-rw-r--r--src/reclaim/plugin_gnsrecord_reclaim.c3
-rw-r--r--src/transport/gnunet-communicator-tcp.c42
-rw-r--r--src/transport/gnunet-service-tng.c93
-rw-r--r--src/transport/test_transport_api2_tcp_peer1.conf3
-rw-r--r--src/transport/test_transport_api2_tcp_peer2.conf3
-rw-r--r--src/transport/transport-testing2.c83
-rw-r--r--src/transport/transport-testing2.h5
-rw-r--r--src/util/.gitignore1
-rw-r--r--src/util/Makefile.am9
-rw-r--r--src/util/gnunet-base32.c152
-rw-r--r--src/util/gnunet-scrypt.c7
27 files changed, 732 insertions, 390 deletions
diff --git a/configure.ac b/configure.ac
index 68cae8c0e..28c616069 100644
--- a/configure.ac
+++ b/configure.ac
@@ -558,6 +558,18 @@ AS_IF([test "x$include_manpages" = "xyes"],
# texinfo5 switches are used. This comes with no version checks, is
# enabled only at distributors action (ie defaults to "no").
# Mantis #3914 for more details (https://bugs.gnunet.org/view.php?id=3914)
+# While GNU makeinfo 6.5 supports --css-ref=URL,
+# makeinfo 4.8 (in NetBSD 8.0, macOS, and maybe other
+# base) does only support --css-include=FILE.
+# The only difference is a shorter html output and
+# in 6.5 the ability to use refs instead of include.
+# We prefer not to break builds in this case, so
+# we use the include version which is backwards compatible
+# and upwards compatible, while the ref variant is neither.
+# In the 5.x version they added `--split=chapters|sections` in
+# addition to `--split=nodes`.
+# Hold on to your hats: In version 6.5 this is already removed, ffs.
+# GNU Texinfo, please be more consistent than 1 version in switches.
AC_MSG_CHECKING(whether to enable texinfo4 switches)
AC_ARG_ENABLE([texinfo4],
[AS_HELP_STRING([--enable-texinfo4], [Use texinfo version 4 specific switches])],
@@ -568,11 +580,15 @@ AS_IF([test "x$activate_texinfo4" = "xyes"],
[
AM_CONDITIONAL([ACTIVATE_TEXINFO4],true)
AC_DEFINE([ACTIVATE_TEXINFO4],[1],[Using texinfo version 4 specific switches])
+ TEXINFO_HTMLFLAGS="--no-split --css-include=style.css --css-include=manual.css"
],[
AM_CONDITIONAL([ACTIVATE_TEXINFO4],false)
AC_DEFINE([INCLUDE_MANPAGES],[0],[Using texinfo version 5 or later switches])
+ TEXINFO_HTMLFLAGS="--no-split --css-ref='../style.css' --css-ref='../manual.css'"
+
])
+AC_SUBST([TEXINFO_HTMLFLAGS])
# Adam shostack suggests the following for Windows:
# -D_FORTIFY_SOURCE=2 -fstack-protector-all
diff --git a/debian/libgnunet.install b/debian/libgnunet.install
index 7cf63853c..dd216d5ba 100644
--- a/debian/libgnunet.install
+++ b/debian/libgnunet.install
@@ -7,6 +7,7 @@ usr/lib/*/libgnunetutil.so.*
usr/share/locale/
usr/share/gnunet/config.d/util.conf
usr/bin/gnunet-arm
+usr/bin/gnunet-base32
usr/bin/gnunet-bugreport
usr/bin/gnunet-config
usr/bin/gnunet-ecc
diff --git a/doc/Makefile.am b/doc/Makefile.am
index eb23b534b..a9ad69954 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -1,4 +1,6 @@
# This Makefile.am is in the public domain
+
+
if DOCUMENTATION
SUBDIRS = doxygen handbook tutorial
endif
diff --git a/doc/handbook/Makefile.am b/doc/handbook/Makefile.am
index 0435796a9..d7bcab696 100644
--- a/doc/handbook/Makefile.am
+++ b/doc/handbook/Makefile.am
@@ -3,25 +3,8 @@ docdir = $(datadir)/doc/gnunet/
infoimagedir = $(infodir)/images
-if ACTIVATE_TEXINFO4
-# NOTE: While GNU makeinfo 6.5 supports --css-ref=URL,
-# makeinfo 4.8 (in NetBSD 8.0, macOS, and maybe other
-# base) does only support --css-include=FILE.
-# The only difference is a shorter html output and
-# in 6.5 the ability to use refs instead of include.
-# We prefer not to break builds in this case, so
-# we use the include version which is backwards compatible
-# and upwards compatible, while the ref variant is neither.
-AM_MAKEINFOHTMLFLAGS = --no-split --css-include=style.css --css-include=manual.css
-else
-# In the 5.x version they added `--split=chapters|sections` in
-# addition to `--split=nodes`.
-# Hold on to your hats: In version 6.5 this is already removed, ffs.
-# GNU Texinfo, please be more consistent than 1 version in switches.
-# This however is compatible to version 5.2. Thanks, I hate it.
-# AM_MAKEINFOHTMLFLAGS = --split=sections --css-ref="../style.css" --css-ref="../manual.css"
-AM_MAKEINFOHTMLFLAGS = --no-split --css-ref="../style.css" --css-ref="../manual.css"
-endif
+AM_MAKEINFOHTMLFLAGS = $(TEXINFO_HTMLFLAGS)
+
dist_infoimage_DATA = \
images/gnunet-gtk-0-10-gns-a-done.png \
@@ -78,6 +61,25 @@ gnunet_TEXINFOS = \
agpl-3.0.texi \
version.texi
+#if ACTIVATE_TEXINFO4
+# NOTE: While GNU makeinfo 6.5 supports --css-ref=URL,
+# makeinfo 4.8 (in NetBSD 8.0, macOS, and maybe other
+# base) does only support --css-include=FILE.
+# The only difference is a shorter html output and
+# in 6.5 the ability to use refs instead of include.
+# We prefer not to break builds in this case, so
+# we use the include version which is backwards compatible
+# and upwards compatible, while the ref variant is neither.
+#AM_MAKEINFOHTMLFLAGS = --no-split --css-include=style.css --css-include=manual.css
+#else
+# In the 5.x version they added `--split=chapters|sections` in
+# addition to `--split=nodes`.
+# Hold on to your hats: In version 6.5 this is already removed, ffs.
+# GNU Texinfo, please be more consistent than 1 version in switches.
+# This however is compatible to version 5.2. Thanks, I hate it.
+# AM_MAKEINFOHTMLFLAGS = --split=sections --css-ref="../style.css" --css-ref="../manual.css"
+#AM_MAKEINFOHTMLFLAGS = --split --css-ref="../style.css" --css-ref="../manual.css"
+#endif
EXTRA_DIST = \
$(gnunet_TEXINFOS) \
htmlxref.cnf \
diff --git a/doc/handbook/chapters/developer.texi b/doc/handbook/chapters/developer.texi
index 0d3b4739b..8bc8c8005 100644
--- a/doc/handbook/chapters/developer.texi
+++ b/doc/handbook/chapters/developer.texi
@@ -9485,18 +9485,6 @@ of using plugins for the actual transmission operations and the ATS subsystem
to select a plugin and allocate bandwidth. The following key issues have been
identified with this design:
-@menu
-* Issues with TRANSPORT::
-* Design goals of TNG::
-* HELLO-NG::
-* Priorities and preferences::
-* Communicators::
-@end menu
-
-@node Issues with TRANSPORT
-@subsection Issues with TRANSPORT
-
-
@itemize @bullet
@item Bugs in one plugin can affect the TRANSPORT service and other plugins.
There is at least one open bug that affects sockets, where the origin is
@@ -9531,6 +9519,13 @@ identified with this design:
@end itemize
+@menu
+* Design goals of TNG::
+* HELLO-NG::
+* Priorities and preferences::
+* Communicators::
+@end menu
+
@node Design goals of TNG
@subsection Design goals of TNG
@@ -9564,17 +9559,8 @@ In order to address the above issues, we want to:
The new architecture is planned as follows:
-@verbatim
-
- APPLICATIONS
- |
- |
-CORE -- TRANSPORT -- COMMUNICATOR(S) -- NAT
- \ /
- \ /
- PEERSTORE
-@end verbatim
+@image{images/tng,5in,,TNG architecture.}
TRANSPORT's main objective is to establish bi-directional virtual links using a
variety of possibly uni-directional communicators. Links undergo the following
diff --git a/doc/handbook/chapters/user.texi b/doc/handbook/chapters/user.texi
index ebc1a7979..5d5d2fe14 100644
--- a/doc/handbook/chapters/user.texi
+++ b/doc/handbook/chapters/user.texi
@@ -1539,7 +1539,12 @@ authoritative zone (replacing ".+" with the name of the location
where the name was encountered) and hence generate a
valid GNS name.
-GNS currently supports the following record types:
+The GNS currently supports the record types as defined in
+@uref{https://git.gnunet.org/gana.git/tree/gnu-name-system-record-types/registry.rec, GANA}.
+In addition, GNS supports DNS record types, such as A, AAAA or TXT.
+
+In the following, we discuss GNS records with specific behaviour or special
+handling of DNS records.
@menu
* NICK::
@@ -1547,22 +1552,9 @@ GNS currently supports the following record types:
* BOX::
* LEHO::
* VPN::
-* A AAAA and TXT::
* CNAME::
* GNS2DNS::
* SOA SRV PTR and MX::
-* PLACE::
-* PHONE::
-* ID ATTR::
-* ID TOKEN::
-* ID TOKEN METADATA::
-* CREDENTIAL::
-* POLICY::
-* ATTRIBUTE::
-* ABE KEY::
-* ABE MASTER::
-* RECLAIM OIDC CLIENT::
-* RECLAIM OIDC REDIRECT::
@end menu
@node NICK
@@ -1658,11 +1650,6 @@ having the following lines in the @file{gnunet.conf} configuration file:
TCP_REDIRECTS = 80:localhost4:8080
@end example
-@node A AAAA and TXT
-@subsubsection A AAAA and TXT
-
-Those records work in exactly the same fashion as in traditional DNS.
-
@node CNAME
@subsubsection CNAME
@@ -1771,90 +1758,6 @@ $ gnunet-namestore -a -n mail -t MX -z bar -e 3600s -V \
> "10,mail.bar"
@end example
-@node PLACE
-@subsubsection PLACE
-
-@c TODO describe record type and give an example of how and
-@c when to use it
-Record type for a social place.
-
-@node PHONE
-@subsubsection PHONE
-
-@c TODO describe record type and give an example of how and
-@c when to use it
-Record type for a phone (of CONVERSATION).
-
-@node ID ATTR
-@subsubsection ID ATTR
-
-@c TODO describe record type and give an example of how and
-@c when to use it
-Record type for identity attributes (of IDENTITY).
-
-@node ID TOKEN
-@subsubsection ID TOKEN
-
-@c TODO describe record type and give an example of how and
-@c when to use it
-Record type for an identity token (of IDENTITY-TOKEN).
-
-@node ID TOKEN METADATA
-@subsubsection ID TOKEN METADATA
-
-@c TODO describe record type and give an example of how and
-@c when to use it
-Record type for the private metadata of an identity token (of IDENTITY-TOKEN).
-
-@node CREDENTIAL
-@subsubsection CREDENTIAL
-
-@c TODO describe record type and give an example of how and
-@c when to use it
-Record type for credential.
-
-@node POLICY
-@subsubsection POLICY
-
-@c TODO describe record type and give an example of how and
-@c when to use it
-Record type for policies.
-
-@node ATTRIBUTE
-@subsubsection ATTRIBUTE
-
-@c TODO describe record type and give an example of how and
-@c when to use it
-Record type for reverse lookups.
-
-@node ABE KEY
-@subsubsection ABE KEY
-
-@c TODO describe record type and give an example of how and
-@c when to use it
-Record type for ABE records.
-
-@node ABE MASTER
-@subsubsection ABE MASTER
-
-@c TODO describe record type and give an example of how and
-@c when to use it
-Record type for ABE master keys.
-
-@node RECLAIM OIDC CLIENT
-@subsubsection RECLAIM OIDC CLIENT
-
-@c TODO describe record type and give an example of how and
-@c when to use it
-Record type for reclaim OIDC clients.
-
-@node RECLAIM OIDC REDIRECT
-@subsubsection RECLAIM OIDC REDIRECT
-
-@c TODO describe record type and give an example of how and
-@c when to use it
-Record type for reclaim OIDC redirect URIs.
-
@node Synchronizing with legacy DNS
@subsection Synchronizing with legacy DNS
diff --git a/doc/handbook/images/tng.dot b/doc/handbook/images/tng.dot
new file mode 100644
index 000000000..14e72ee04
--- /dev/null
+++ b/doc/handbook/images/tng.dot
@@ -0,0 +1,55 @@
+// house = application
+// circle (default) = service
+// box = daemon
+// diamond = library
+// black line = dependency
+// blue line = extension via plugin
+// red line = possibly useful
+// dashed = in planning
+
+// this is what we have...o
+digraph tng {
+ // splines = true;
+ compound=true;
+ subgraph cluster0 {
+ label="Our peer";
+ style=dashed;
+ color=black;
+ subgraph cluster1 {
+ style=solid;
+ color=black;
+ tcp;
+ udp;
+ others [style=dotted];
+ label="Communicators";
+ }
+ subgraph cluster2 {
+ style=solid;
+ color=black;
+ dht;
+ fs;
+ cadet;
+ label="Applications";
+ }
+ cadet -> core [ltail=cluster2,label="Communicate with peers"];
+ dht -> transport [ltail=cluster2,label="Suggest connection to peer"];
+ core -> transport [label="Send/receive messages via secure channel"];
+ transport -> tcp [lhead=cluster1,dir=both,label="Offer connectivity/channel to other peer"];
+ udp -> nat [label="Get addresses"];
+ tcp -> nat;
+ }
+ subgraph cluster3 {
+ rank = sink;
+ style=dashed;
+ color=black;
+ peer3;
+ peer1;
+ peer2;
+ label="Other peers";
+ }
+
+
+ tcp -> peer1 [dir=both];
+ udp -> peer2;
+ transport->peer1 [style=invis];
+}
diff --git a/doc/handbook/images/tng.png b/doc/handbook/images/tng.png
new file mode 100644
index 000000000..3b93b77cc
--- /dev/null
+++ b/doc/handbook/images/tng.png
Binary files differ
diff --git a/doc/man/Makefile.am b/doc/man/Makefile.am
index a0283cf44..e7045e8bf 100644
--- a/doc/man/Makefile.am
+++ b/doc/man/Makefile.am
@@ -50,6 +50,7 @@ man_MANS = \
gnunet-arm.1 \
gnunet-ats.1 \
gnunet-auto-share.1 \
+ gnunet-base32.1 \
gnunet-bcd.1 \
gnunet-bugreport.1 \
gnunet-config.1 \
diff --git a/doc/man/gnunet-base32.1 b/doc/man/gnunet-base32.1
new file mode 100644
index 000000000..2e1224279
--- /dev/null
+++ b/doc/man/gnunet-base32.1
@@ -0,0 +1,74 @@
+.\" This file is part of GNUnet.
+.\" Copyright (C) 2021 GNUnet e.V.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.3 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A
+.\" copy of the license is included in the file
+.\" FDL-1.3.
+.\"
+.\" A copy of the license is also available from the Free Software
+.\" Foundation Web site at http://www.gnu.org/licenses/fdl.html}.
+.\"
+.\" Alternately, this document is also available under the General
+.\" Public License, version 3 or later, as published by the Free Software
+.\" Foundation. A copy of the license is included in the file
+.\" GPL3.
+.\"
+.\" A copy of the license is also available from the Free Software
+.\" Foundation Web site at http://www.gnu.org/licenses/gpl.html
+.\"
+.\" SPDX-License-Identifier: GPL3.0-or-later OR FDL1.3-or-later
+.\"
+.Dd March 5, 2021
+.Dt GNUNET-BASE32 1
+.Os
+.Sh NAME
+.Nm gnunet-base32
+.Nd encode/decode to Crockford base32 encoding
+.Sh SYNOPSIS
+.Nm
+.Op Fl d | -decode
+.sp
+.Sh DESCRIPTION
+.Nm
+By default, encodes data read from standard input into
+Crockford base32 and writes the result to standard output.
+The inverse operation is performed if the option
+.Fl --decode
+is given. Note that the tool keeps all of the data in
+memory and is largely intended for quick debugging and
+not for high performance.
+.Bl -tag -width indent
+.It Fl d | -decode
+Run in decode mode instead of in encode mode.
+.It Fl h | -help
+Print short help on options.
+.It Fl v | -version
+Print GNUnet version number.
+.El
+.Sh SEE ALSO
+The full documentation for gnunet is maintained as a Texinfo manual.
+If the
+.Xr info 1
+and gnunet programs are properly installed at your site, the command
+.Pp
+.Dl info gnunet
+.Pp
+should give you access to the complete handbook,
+.Pp
+.Dl info gnunet-c-tutorial
+.Pp
+will give you access to a tutorial for developers.
+.sp
+Depending on your installation, this information is also available in
+.Xr gnunet 7 and
+.Xr gnunet-c-tutorial 7 .
+.\".Sh HISTORY
+.\".Sh AUTHORS
+.Sh BUGS
+Report bugs by using
+.Lk https://bugs.gnunet.org
+or by sending electronic mail to
+.Aq Mt gnunet-developers@gnu.org .
diff --git a/doc/tutorial/Makefile.am b/doc/tutorial/Makefile.am
index d0307ecb5..afe4aa6c0 100644
--- a/doc/tutorial/Makefile.am
+++ b/doc/tutorial/Makefile.am
@@ -1,25 +1,8 @@
# This Makefile.am is in the public domain
docdir = $(datadir)/doc/gnunet/
-if ACTIVATE_TEXINFO4
-# NOTE: While GNU makeinfo 6.5 supports --css-ref=URL,
-# makeinfo 4.8 (in NetBSD 8.0, macOS, and maybe other
-# base) does only support --css-include=FILE.
-# The only difference is a shorter html output and
-# in 6.5 the ability to use refs instead of include.
-# We prefer not to break builds in this case, so
-# we use the include version which is backwards compatible
-# and upwards compatible, while the ref variant is neither.
-AM_MAKEINFOHTMLFLAGS = --no-split --css-include=style.css --css-include=manual.css
-else
-# In the 5.x version they added `--split=chapters|sections` in
-# addition to `--split=nodes`.
-# Hold on to your hats: In version 6.5 this is already removed, ffs.
-# GNU Texinfo, please be more consistent than 1 version in switches.
-# This however is compatible to version 5.2. Thanks, I hate it.
-# AM_MAKEINFOHTMLFLAGS = --split=sections --css-ref="../style.css" --css-ref="../manual.css"
-AM_MAKEINFOHTMLFLAGS = --split --css-ref="../style.css" --css-ref="../manual.css"
-endif
+AM_MAKEINFOHTMLFLAGS = $(TEXINFO_HTMLFLAGS)
+
gnunet_tutorial_examples = \
examples/001.c \
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 9dcfb81cf..51ada43b3 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -10,13 +10,21 @@ src/arm/arm_monitor_api.c
src/arm/gnunet-arm.c
src/arm/gnunet-service-arm.c
src/arm/mockup-service.c
+src/ats-tests/ats-testing-experiment.c
+src/ats-tests/ats-testing-log.c
+src/ats-tests/ats-testing-preferences.c
+src/ats-tests/ats-testing-traffic.c
+src/ats-tests/ats-testing.c
+src/ats-tests/gnunet-ats-sim.c
+src/ats-tests/gnunet-solver-eval.c
+src/ats-tool/gnunet-ats.c
src/ats/ats_api_connectivity.c
src/ats/ats_api_performance.c
src/ats/ats_api_scanner.c
src/ats/ats_api_scheduling.c
src/ats/gnunet-ats-solver-eval.c
-src/ats/gnunet-service-ats_addresses.c
src/ats/gnunet-service-ats.c
+src/ats/gnunet-service-ats_addresses.c
src/ats/gnunet-service-ats_connectivity.c
src/ats/gnunet-service-ats_normalization.c
src/ats/gnunet-service-ats_performance.c
@@ -25,14 +33,6 @@ src/ats/gnunet-service-ats_preferences.c
src/ats/gnunet-service-ats_reservations.c
src/ats/gnunet-service-ats_scheduling.c
src/ats/plugin_ats_proportional.c
-src/ats-tests/ats-testing.c
-src/ats-tests/ats-testing-experiment.c
-src/ats-tests/ats-testing-log.c
-src/ats-tests/ats-testing-preferences.c
-src/ats-tests/ats-testing-traffic.c
-src/ats-tests/gnunet-ats-sim.c
-src/ats-tests/gnunet-solver-eval.c
-src/ats-tool/gnunet-ats.c
src/auction/gnunet-auction-create.c
src/auction/gnunet-auction-info.c
src/auction/gnunet-auction-join.c
@@ -50,8 +50,8 @@ src/cadet/cadet_api_list_peers.c
src/cadet/cadet_api_list_tunnels.c
src/cadet/cadet_test_lib.c
src/cadet/desirability_table.c
-src/cadet/gnunet-cadet.c
src/cadet/gnunet-cadet-profiler.c
+src/cadet/gnunet-cadet.c
src/cadet/gnunet-service-cadet.c
src/cadet/gnunet-service-cadet_channel.c
src/cadet/gnunet-service-cadet_connection.c
@@ -67,15 +67,15 @@ src/consensus/gnunet-service-consensus.c
src/consensus/plugin_block_consensus.c
src/conversation/conversation_api.c
src/conversation/conversation_api_call.c
-src/conversation/gnunet-conversation.c
src/conversation/gnunet-conversation-test.c
-src/conversation/gnunet_gst.c
-src/conversation/gnunet_gst_test.c
-src/conversation/gnunet-helper-audio-playback.c
+src/conversation/gnunet-conversation.c
src/conversation/gnunet-helper-audio-playback-gst.c
-src/conversation/gnunet-helper-audio-record.c
+src/conversation/gnunet-helper-audio-playback.c
src/conversation/gnunet-helper-audio-record-gst.c
+src/conversation/gnunet-helper-audio-record.c
src/conversation/gnunet-service-conversation.c
+src/conversation/gnunet_gst.c
+src/conversation/gnunet_gst_test.c
src/conversation/microphone.c
src/conversation/plugin_gnsrecord_conversation.c
src/conversation/speaker.c
@@ -105,7 +105,6 @@ src/dht/dht_api.c
src/dht/dht_test_lib.c
src/dht/gnunet-dht-get.c
src/dht/gnunet-dht-monitor.c
-src/dht/gnunet_dht_profiler.c
src/dht/gnunet-dht-put.c
src/dht/gnunet-service-dht.c
src/dht/gnunet-service-dht_clients.c
@@ -114,6 +113,7 @@ src/dht/gnunet-service-dht_hello.c
src/dht/gnunet-service-dht_neighbours.c
src/dht/gnunet-service-dht_nse.c
src/dht/gnunet-service-dht_routing.c
+src/dht/gnunet_dht_profiler.c
src/dht/plugin_block_dht.c
src/dns/dns_api.c
src/dns/gnunet-dns-monitor.c
@@ -148,8 +148,8 @@ src/fs/gnunet-auto-share.c
src/fs/gnunet-daemon-fsprofiler.c
src/fs/gnunet-directory.c
src/fs/gnunet-download.c
-src/fs/gnunet-fs.c
src/fs/gnunet-fs-profiler.c
+src/fs/gnunet-fs.c
src/fs/gnunet-helper-fs-publish.c
src/fs/gnunet-publish.c
src/fs/gnunet-search.c
@@ -169,9 +169,9 @@ src/gns/gns_tld_api.c
src/gns/gnunet-bcd.c
src/gns/gnunet-dns2gns.c
src/gns/gnunet-gns-benchmark.c
-src/gns/gnunet-gns.c
src/gns/gnunet-gns-import.c
src/gns/gnunet-gns-proxy.c
+src/gns/gnunet-gns.c
src/gns/gnunet-service-gns.c
src/gns/gnunet-service-gns_interceptor.c
src/gns/gnunet-service-gns_resolver.c
@@ -189,8 +189,8 @@ src/gnsrecord/json_gnsrecord.c
src/gnsrecord/plugin_gnsrecord_dns.c
src/hello/address.c
src/hello/gnunet-hello.c
-src/hello/hello.c
src/hello/hello-ng.c
+src/hello/hello.c
src/hostlist/gnunet-daemon-hostlist.c
src/hostlist/gnunet-daemon-hostlist_client.c
src/hostlist/gnunet-daemon-hostlist_server.c
@@ -205,8 +205,8 @@ src/json/json_generator.c
src/json/json_helper.c
src/json/json_mhd.c
src/messenger/gnunet-messenger.c
-src/messenger/gnunet-service-messenger_basement.c
src/messenger/gnunet-service-messenger.c
+src/messenger/gnunet-service-messenger_basement.c
src/messenger/gnunet-service-messenger_contact.c
src/messenger/gnunet-service-messenger_handle.c
src/messenger/gnunet-service-messenger_list_handles.c
@@ -236,8 +236,8 @@ src/namecache/namecache_api.c
src/namecache/plugin_namecache_flat.c
src/namecache/plugin_namecache_postgres.c
src/namecache/plugin_namecache_sqlite.c
-src/namestore/gnunet-namestore.c
src/namestore/gnunet-namestore-fcfsd.c
+src/namestore/gnunet-namestore.c
src/namestore/gnunet-service-namestore.c
src/namestore/gnunet-zoneimport.c
src/namestore/namestore_api.c
@@ -263,17 +263,17 @@ src/nat/gnunet-service-nat_mini.c
src/nat/gnunet-service-nat_stun.c
src/nat/nat_api.c
src/nat/nat_api_stun.c
-src/nse/gnunet-nse.c
src/nse/gnunet-nse-profiler.c
+src/nse/gnunet-nse.c
src/nse/gnunet-service-nse.c
src/nse/nse_api.c
src/nt/nt.c
-src/peerinfo/gnunet-service-peerinfo.c
-src/peerinfo/peerinfo_api.c
-src/peerinfo/peerinfo_api_notify.c
src/peerinfo-tool/gnunet-peerinfo.c
src/peerinfo-tool/gnunet-peerinfo_plugins.c
src/peerinfo-tool/plugin_rest_peerinfo.c
+src/peerinfo/gnunet-service-peerinfo.c
+src/peerinfo/peerinfo_api.c
+src/peerinfo/peerinfo_api_notify.c
src/peerstore/gnunet-peerstore.c
src/peerstore/gnunet-service-peerstore.c
src/peerstore/peerstore_api.c
@@ -319,27 +319,27 @@ src/rest/gnunet-rest-server.c
src/rest/plugin_rest_config.c
src/rest/plugin_rest_copying.c
src/rest/rest.c
-src/revocation/gnunet-revocation.c
src/revocation/gnunet-revocation-tvg.c
+src/revocation/gnunet-revocation.c
src/revocation/gnunet-service-revocation.c
src/revocation/plugin_block_revocation.c
src/revocation/revocation_api.c
-src/rps/gnunet-rps.c
src/rps/gnunet-rps-profiler.c
+src/rps/gnunet-rps.c
src/rps/gnunet-service-rps.c
src/rps/gnunet-service-rps_custommap.c
src/rps/gnunet-service-rps_sampler.c
src/rps/gnunet-service-rps_sampler_elem.c
src/rps/gnunet-service-rps_view.c
-src/rps/rps_api.c
src/rps/rps-sampler_client.c
src/rps/rps-sampler_common.c
src/rps/rps-test_util.c
+src/rps/rps_api.c
src/scalarproduct/gnunet-scalarproduct.c
-src/scalarproduct/gnunet-service-scalarproduct_alice.c
-src/scalarproduct/gnunet-service-scalarproduct_bob.c
src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c
src/scalarproduct/gnunet-service-scalarproduct-ecc_bob.c
+src/scalarproduct/gnunet-service-scalarproduct_alice.c
+src/scalarproduct/gnunet-service-scalarproduct_bob.c
src/scalarproduct/scalarproduct_api.c
src/secretsharing/gnunet-secretsharing-profiler.c
src/secretsharing/gnunet-service-secretsharing.c
@@ -353,12 +353,12 @@ src/set/gnunet-set-ibf-profiler.c
src/set/gnunet-set-profiler.c
src/set/ibf.c
src/set/ibf_sim.c
+src/set/plugin_block_set_test.c
+src/set/set_api.c
src/seti/gnunet-service-seti.c
src/seti/gnunet-seti-profiler.c
src/seti/plugin_block_seti_test.c
src/seti/seti_api.c
-src/set/plugin_block_set_test.c
-src/set/set_api.c
src/setu/gnunet-service-setu.c
src/setu/gnunet-service-setu_strata_estimator.c
src/setu/gnunet-setu-ibf-profiler.c
@@ -377,15 +377,16 @@ src/statistics/gnunet-statistics.c
src/statistics/statistics_api.c
src/template/gnunet-service-template.c
src/template/gnunet-template.c
+src/testbed-logger/gnunet-service-testbed-logger.c
+src/testbed-logger/testbed_logger_api.c
src/testbed/generate-underlay-topology.c
src/testbed/gnunet-daemon-latency-logger.c
src/testbed/gnunet-daemon-testbed-blacklist.c
src/testbed/gnunet-daemon-testbed-underlay.c
src/testbed/gnunet-helper-testbed.c
-src/testbed/gnunet_mpi_test.c
src/testbed/gnunet-service-test-barriers.c
-src/testbed/gnunet-service-testbed_barriers.c
src/testbed/gnunet-service-testbed.c
+src/testbed/gnunet-service-testbed_barriers.c
src/testbed/gnunet-service-testbed_cache.c
src/testbed/gnunet-service-testbed_connectionpool.c
src/testbed/gnunet-service-testbed_cpustatus.c
@@ -393,20 +394,19 @@ src/testbed/gnunet-service-testbed_links.c
src/testbed/gnunet-service-testbed_meminfo.c
src/testbed/gnunet-service-testbed_oc.c
src/testbed/gnunet-service-testbed_peers.c
-src/testbed/gnunet_testbed_mpi_spawn.c
src/testbed/gnunet-testbed-profiler.c
-src/testbed-logger/gnunet-service-testbed-logger.c
-src/testbed-logger/testbed_logger_api.c
-src/testbed/testbed_api_barriers.c
+src/testbed/gnunet_mpi_test.c
+src/testbed/gnunet_testbed_mpi_spawn.c
src/testbed/testbed_api.c
+src/testbed/testbed_api_barriers.c
src/testbed/testbed_api_hosts.c
src/testbed/testbed_api_operations.c
src/testbed/testbed_api_peers.c
src/testbed/testbed_api_sd.c
src/testbed/testbed_api_services.c
src/testbed/testbed_api_statistics.c
-src/testbed/testbed_api_testbed.c
src/testbed/testbed_api_test.c
+src/testbed/testbed_api_testbed.c
src/testbed/testbed_api_topology.c
src/testbed/testbed_api_underlay.c
src/testing/gnunet-testing.c
@@ -418,34 +418,45 @@ src/transport/gnunet-communicator-tcp.c
src/transport/gnunet-communicator-udp.c
src/transport/gnunet-communicator-unix.c
src/transport/gnunet-helper-transport-bluetooth.c
-src/transport/gnunet-helper-transport-wlan.c
src/transport/gnunet-helper-transport-wlan-dummy.c
+src/transport/gnunet-helper-transport-wlan.c
src/transport/gnunet-service-tng.c
-src/transport/gnunet-service-transport_ats.c
src/transport/gnunet-service-transport.c
+src/transport/gnunet-service-transport_ats.c
src/transport/gnunet-service-transport_hello.c
src/transport/gnunet-service-transport_manipulation.c
src/transport/gnunet-service-transport_neighbours.c
src/transport/gnunet-service-transport_plugins.c
src/transport/gnunet-service-transport_validation.c
-src/transport/gnunet-transport.c
src/transport/gnunet-transport-profiler.c
src/transport/gnunet-transport-wlan-receiver.c
src/transport/gnunet-transport-wlan-sender.c
+src/transport/gnunet-transport.c
src/transport/plugin_transport_http_client.c
src/transport/plugin_transport_http_common.c
src/transport/plugin_transport_http_server.c
src/transport/plugin_transport_smtp.c
src/transport/plugin_transport_tcp.c
src/transport/plugin_transport_template.c
-src/transport/plugin_transport_udp_broadcasting.c
src/transport/plugin_transport_udp.c
+src/transport/plugin_transport_udp_broadcasting.c
src/transport/plugin_transport_unix.c
src/transport/plugin_transport_wlan.c
src/transport/tcp_connection_legacy.c
src/transport/tcp_server_legacy.c
src/transport/tcp_server_mst_legacy.c
src/transport/tcp_service_legacy.c
+src/transport/transport-testing-communicator.c
+src/transport/transport-testing-filenames.c
+src/transport/transport-testing-filenames2.c
+src/transport/transport-testing-loggers.c
+src/transport/transport-testing-loggers2.c
+src/transport/transport-testing-main.c
+src/transport/transport-testing-main2.c
+src/transport/transport-testing-send.c
+src/transport/transport-testing-send2.c
+src/transport/transport-testing.c
+src/transport/transport-testing2.c
src/transport/transport_api2_application.c
src/transport/transport_api2_communication.c
src/transport/transport_api2_core.c
@@ -458,17 +469,6 @@ src/transport/transport_api_manipulation.c
src/transport/transport_api_monitor_peers.c
src/transport/transport_api_monitor_plugins.c
src/transport/transport_api_offer_hello.c
-src/transport/transport-testing2.c
-src/transport/transport-testing.c
-src/transport/transport-testing-communicator.c
-src/transport/transport-testing-filenames2.c
-src/transport/transport-testing-filenames.c
-src/transport/transport-testing-loggers2.c
-src/transport/transport-testing-loggers.c
-src/transport/transport-testing-main2.c
-src/transport/transport-testing-main.c
-src/transport/transport-testing-send2.c
-src/transport/transport-testing-send.c
src/util/bandwidth.c
src/util/benchmark.c
src/util/bio.c
@@ -483,8 +483,8 @@ src/util/consttime_memcmp.c
src/util/container_bloomfilter.c
src/util/container_heap.c
src/util/container_meta_data.c
-src/util/container_multihashmap32.c
src/util/container_multihashmap.c
+src/util/container_multihashmap32.c
src/util/container_multipeermap.c
src/util/container_multishortmap.c
src/util/container_multiuuidmap.c
@@ -508,8 +508,8 @@ src/util/dnsparser.c
src/util/dnsstub.c
src/util/getopt.c
src/util/getopt_helpers.c
-src/util/gnunet-config.c
src/util/gnunet-config-diff.c
+src/util/gnunet-config.c
src/util/gnunet-crypto-tvg.c
src/util/gnunet-ecc.c
src/util/gnunet-qr.c
@@ -547,8 +547,8 @@ src/vpn/gnunet-helper-vpn.c
src/vpn/gnunet-service-vpn.c
src/vpn/gnunet-vpn.c
src/vpn/vpn_api.c
-src/zonemaster/gnunet-service-zonemaster.c
src/zonemaster/gnunet-service-zonemaster-monitor.c
+src/zonemaster/gnunet-service-zonemaster.c
src/fs/fs_api.h
src/testbed/testbed_api.h
src/testbed/testbed_api_operations.h
diff --git a/src/include/Makefile.am b/src/include/Makefile.am
index 39a67acc4..048ae00a2 100644
--- a/src/include/Makefile.am
+++ b/src/include/Makefile.am
@@ -53,6 +53,7 @@ gnunetinclude_HEADERS = \
gnunet_gnsrecord_lib.h \
gnunet_gnsrecord_json_lib.h \
gnunet_gnsrecord_plugin.h \
+ gnu_name_system_record_types.h \
gnunet_hello_lib.h \
gnunet_helper_lib.h \
gnunet_identity_service.h \
diff --git a/src/include/gnu_name_system_record_types.h b/src/include/gnu_name_system_record_types.h
new file mode 100644
index 000000000..b2cf45dc8
--- /dev/null
+++ b/src/include/gnu_name_system_record_types.h
@@ -0,0 +1,138 @@
+/*
+ This file is part of GNUnet
+ Copyright (C) 2012-2021 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 GNU_NAME_SYSTEM_RECORD_TYPES_H
+#define GNU_NAME_SYSTEM_RECORD_TYPES_H
+
+/**
+ * WARNING:
+ * This header is generated!
+ * In order to add GNS record types, 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
+
+
+/**
+ * GNS zone transfer
+ */
+#define GNUNET_GNSRECORD_TYPE_PKEY 65536
+
+/**
+ * GNS nick names
+ */
+#define GNUNET_GNSRECORD_TYPE_NICK 65537
+
+/**
+ * legacy hostnames
+ */
+#define GNUNET_GNSRECORD_TYPE_LEHO 65538
+
+/**
+ * VPN resolution
+ */
+#define GNUNET_GNSRECORD_TYPE_VPN 65539
+
+/**
+ * Delegation to DNS
+ */
+#define GNUNET_GNSRECORD_TYPE_GNS2DNS 65540
+
+/**
+ * Boxed records (see TLSA/SRV handling in GNS)
+ */
+#define GNUNET_GNSRECORD_TYPE_BOX 65541
+
+/**
+ * social place for SecuShare
+ */
+#define GNUNET_GNSRECORD_TYPE_PLACE 65542
+
+/**
+ * Endpoint for conversation
+ */
+#define GNUNET_GNSRECORD_TYPE_PHONE 65543
+
+/**
+ * identity attribute
+ */
+#define GNUNET_GNSRECORD_TYPE_RECLAIM_ATTRIBUTE 65544
+
+/**
+ * local ticket reference
+ */
+#define GNUNET_GNSRECORD_TYPE_RECLAIM_TICKET 65545
+
+/**
+ * For ABD policies
+ */
+#define GNUNET_GNSRECORD_TYPE_DELEGATE 65548
+
+/**
+ * For ABD reverse lookups
+ */
+#define GNUNET_GNSRECORD_TYPE_ATTRIBUTE 65549
+
+/**
+ * for reclaim records
+ */
+#define GNUNET_GNSRECORD_TYPE_RECLAIM_ATTRIBUTE_REF 65550
+
+/**
+ * For reclaim OIDC client names.
+ */
+#define GNUNET_GNSRECORD_TYPE_RECLAIM_OIDC_CLIENT 65552
+
+/**
+ * Used reclaimID OIDC client redirect URIs.
+ */
+#define GNUNET_GNSRECORD_TYPE_RECLAIM_OIDC_REDIRECT 65553
+
+/**
+ * Record type for an attribute attestation (e.g. JWT).
+ */
+#define GNUNET_GNSRECORD_TYPE_RECLAIM_CREDENTIAL 65554
+
+/**
+ * Record type for a presentation of a credential.
+ */
+#define GNUNET_GNSRECORD_TYPE_RECLAIM_PRESENTATION 65555
+
+/**
+ * Record type for EDKEY zone delegations.
+ */
+#define GNUNET_GNSRECORD_TYPE_EDKEY 65556
+
+
+#if 0 /* keep Emacsens' auto-indent happy */
+{
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/include/gnunet_gnsrecord_lib.h b/src/include/gnunet_gnsrecord_lib.h
index 0bf2ceed7..aff56146e 100644
--- a/src/include/gnunet_gnsrecord_lib.h
+++ b/src/include/gnunet_gnsrecord_lib.h
@@ -55,109 +55,9 @@ extern "C" {
#define GNUNET_GNSRECORD_TYPE_ANY 0
/**
- * Record type for GNS zone transfer ("PKEY").
+ * Include the record types generated from GANA
*/
-#define GNUNET_GNSRECORD_TYPE_PKEY GNUNET_IDENTITY_TYPE_ECDSA
-
-/**
- * Record type for GNS nick names ("NICK").
- */
-#define GNUNET_GNSRECORD_TYPE_NICK 65537
-
-/**
- * Record type for GNS legacy hostnames ("LEHO").
- */
-#define GNUNET_GNSRECORD_TYPE_LEHO 65538
-
-/**
- * Record type for VPN resolution
- */
-#define GNUNET_GNSRECORD_TYPE_VPN 65539
-
-/**
- * Record type for delegation to DNS.
- */
-#define GNUNET_GNSRECORD_TYPE_GNS2DNS 65540
-
-/**
- * Record type for a boxed record (see TLSA/SRV handling in GNS).
- */
-#define GNUNET_GNSRECORD_TYPE_BOX 65541
-
-/**
- * Record type for a social place.
- */
-#define GNUNET_GNSRECORD_TYPE_PLACE 65542
-
-/**
- * Record type for a phone (of CONVERSATION).
- */
-#define GNUNET_GNSRECORD_TYPE_PHONE 65543
-
-/**
- * Record type for identity attributes (of RECLAIM).
- */
-#define GNUNET_GNSRECORD_TYPE_RECLAIM_ATTRIBUTE 65544
-
-/**
- * Record type for local ticket references
- */
-#define GNUNET_GNSRECORD_TYPE_RECLAIM_TICKET 65545
-
-/**
- * 65546 reserved
- */
-
-/**
- * 65547 deleted, free to use
- */
-
-/**
- * Record type for policies
- */
-#define GNUNET_GNSRECORD_TYPE_DELEGATE 65548
-
-/**
- * Record type for reverse lookups
- */
-#define GNUNET_GNSRECORD_TYPE_ATTRIBUTE 65549
-
-/**
- * Record type for reclaim records
- */
-#define GNUNET_GNSRECORD_TYPE_RECLAIM_ATTRIBUTE_REF 65550
-
-/**
- * Record type for RECLAIM master
- */
-#define GNUNET_GNSRECORD_TYPE_RECLAIM_MASTER 65551
-
-/**
- * Record type for reclaim OIDC clients
- */
-#define GNUNET_GNSRECORD_TYPE_RECLAIM_OIDC_CLIENT 65552
-
-/**
- * Record type for reclaim OIDC redirect URIs
- */
-#define GNUNET_GNSRECORD_TYPE_RECLAIM_OIDC_REDIRECT 65553
-
-/**
- * Record type for an attribute attestation
- */
-#define GNUNET_GNSRECORD_TYPE_RECLAIM_CREDENTIAL 65554
-
-/**
- * Record type for a presentation of a credential (used
- * in a ticket record set)
- */
-#define GNUNET_GNSRECORD_TYPE_RECLAIM_PRESENTATION 65555
-
-/**
- * Record type for EDKEY delegations.
- */
-#define GNUNET_GNSRECORD_TYPE_EDKEY GNUNET_IDENTITY_TYPE_EDDSA
-
+#include "gnu_name_system_record_types.h"
/**
* Flags that can be set for a record.
diff --git a/src/peerstore/gnunet-service-peerstore.c b/src/peerstore/gnunet-service-peerstore.c
index c92e4d3f0..959d088f9 100644
--- a/src/peerstore/gnunet-service-peerstore.c
+++ b/src/peerstore/gnunet-service-peerstore.c
@@ -77,6 +77,8 @@ static unsigned int num_clients;
static void
do_shutdown ()
{
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Shutting down peerstore, bye.\n");
if (NULL != db_lib_name)
{
GNUNET_break (NULL == GNUNET_PLUGIN_unload (db_lib_name, db));
@@ -105,6 +107,8 @@ do_shutdown ()
static void
shutdown_task (void *cls)
{
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Priming PEERSTORE for shutdown.\n");
in_shutdown = GNUNET_YES;
if (0 == num_clients) /* Only when no connected clients. */
do_shutdown ();
@@ -176,6 +180,8 @@ client_connect_cb (void *cls,
struct GNUNET_MQ_Handle *mq)
{
num_clients++;
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "A client connected (now %u)\n", num_clients);
return client;
}
@@ -195,7 +201,7 @@ client_disconnect_it (void *cls, const struct GNUNET_HashCode *key, void *value)
{
GNUNET_assert (GNUNET_YES ==
GNUNET_CONTAINER_multihashmap_remove (watchers, key, value));
- num_clients++;
+ num_clients++; /* Watchers do not count */
}
return GNUNET_OK;
}
@@ -212,12 +218,14 @@ client_disconnect_cb (void *cls,
struct GNUNET_SERVICE_Client *client,
void *app_cls)
{
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "A client disconnected, cleaning up.\n");
+ num_clients--;
if (NULL != watchers)
GNUNET_CONTAINER_multihashmap_iterate (watchers,
&client_disconnect_it,
client);
- num_clients--;
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "A client disconnected (%u remaining).\n",
+ num_clients);
if ((0 == num_clients) && in_shutdown)
do_shutdown ();
}
@@ -540,6 +548,7 @@ run (void *cls,
char *database;
in_shutdown = GNUNET_NO;
+ num_clients = 0;
cfg = c;
if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (cfg,
"peerstore",
diff --git a/src/reclaim/plugin_gnsrecord_reclaim.c b/src/reclaim/plugin_gnsrecord_reclaim.c
index 60c49fd6a..9e4f0a5c4 100644
--- a/src/reclaim/plugin_gnsrecord_reclaim.c
+++ b/src/reclaim/plugin_gnsrecord_reclaim.c
@@ -50,7 +50,6 @@ value_to_string (void *cls, uint32_t type, const void *data, size_t data_size)
case GNUNET_GNSRECORD_TYPE_RECLAIM_ATTRIBUTE:
case GNUNET_GNSRECORD_TYPE_RECLAIM_ATTRIBUTE_REF:
case GNUNET_GNSRECORD_TYPE_RECLAIM_TICKET:
- case GNUNET_GNSRECORD_TYPE_RECLAIM_MASTER:
case GNUNET_GNSRECORD_TYPE_RECLAIM_CREDENTIAL:
case GNUNET_GNSRECORD_TYPE_RECLAIM_PRESENTATION:
return GNUNET_STRINGS_data_to_string_alloc (data, data_size);
@@ -87,7 +86,6 @@ string_to_value (void *cls, uint32_t type, const char *s, void **data,
return GNUNET_OK;
case GNUNET_GNSRECORD_TYPE_RECLAIM_ATTRIBUTE:
case GNUNET_GNSRECORD_TYPE_RECLAIM_ATTRIBUTE_REF:
- case GNUNET_GNSRECORD_TYPE_RECLAIM_MASTER:
case GNUNET_GNSRECORD_TYPE_RECLAIM_TICKET:
case GNUNET_GNSRECORD_TYPE_RECLAIM_CREDENTIAL:
case GNUNET_GNSRECORD_TYPE_RECLAIM_PRESENTATION:
@@ -112,7 +110,6 @@ static struct
{ "RECLAIM_ATTRIBUTE_REF", GNUNET_GNSRECORD_TYPE_RECLAIM_ATTRIBUTE_REF },
{ "RECLAIM_CREDENTIAL", GNUNET_GNSRECORD_TYPE_RECLAIM_CREDENTIAL },
{ "RECLAIM_PRESENTATION", GNUNET_GNSRECORD_TYPE_RECLAIM_PRESENTATION },
- { "RECLAIM_MASTER", GNUNET_GNSRECORD_TYPE_RECLAIM_MASTER },
{ "RECLAIM_OIDC_CLIENT", GNUNET_GNSRECORD_TYPE_RECLAIM_OIDC_CLIENT },
{ "RECLAIM_OIDC_REDIRECT", GNUNET_GNSRECORD_TYPE_RECLAIM_OIDC_REDIRECT },
{ "RECLAIM_TICKET", GNUNET_GNSRECORD_TYPE_RECLAIM_TICKET },
diff --git a/src/transport/gnunet-communicator-tcp.c b/src/transport/gnunet-communicator-tcp.c
index 273dbac48..c8a4c0375 100644
--- a/src/transport/gnunet-communicator-tcp.c
+++ b/src/transport/gnunet-communicator-tcp.c
@@ -739,7 +739,6 @@ struct Addresses
};
-
/**
* Maximum queue length before we stop reading towards the transport service.
*/
@@ -953,6 +952,9 @@ queue_destroy (struct Queue *queue)
else
GNUNET_free (queue);
+ if (NULL == lt)
+ return;
+
if ((! shutdown_running) && (NULL == lt->listen_task))
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -1193,6 +1195,7 @@ setup_cipher (const struct GNUNET_HashCode *dh,
0));
}
+
/**
* Callback called when peerstore store operation for rekey monotime value is finished.
* @param cls Queue context the store operation was executed.
@@ -1210,6 +1213,7 @@ rekey_monotime_store_cb (void *cls, int success)
queue->rekey_monotime_sc = NULL;
}
+
/**
* Callback called by peerstore when records for GNUNET_PEERSTORE_TRANSPORT_TCP_COMMUNICATOR_REKEY
* where found.
@@ -1266,6 +1270,7 @@ rekey_monotime_cb (void *cls,
queue);
}
+
/**
* Setup cipher of @a queue for decryption.
*
@@ -1344,6 +1349,7 @@ do_rekey (struct Queue *queue, const struct TCPRekey *rekey)
setup_in_cipher (&rekey->ephemeral, queue);
}
+
/**
* Callback called when peerstore store operation for handshake ack monotime value is finished.
* @param cls Queue context the store operation was executed.
@@ -1362,6 +1368,7 @@ handshake_ack_monotime_store_cb (void *cls, int success)
queue->handshake_ack_monotime_sc = NULL;
}
+
/**
* Callback called by peerstore when records for GNUNET_PEERSTORE_TRANSPORT_TCP_COMMUNICATOR_HANDSHAKE_ACK
* where found.
@@ -1420,6 +1427,7 @@ handshake_ack_monotime_cb (void *cls,
queue);
}
+
/**
* Sending challenge with TcpConfirmationAck back to sender of ephemeral key.
*
@@ -1465,6 +1473,7 @@ send_challenge (struct ChallengeNonceP challenge, struct Queue *queue)
"sending challenge done\n");
}
+
/**
* Setup cipher for outgoing data stream based on target and
* our ephemeral private key.
@@ -1545,6 +1554,7 @@ inject_rekey (struct Queue *queue)
setup_out_cipher (queue);
}
+
/**
* We have been notified that our socket is ready to write.
* Then reschedule this function to be called again once more is available.
@@ -1634,6 +1644,7 @@ queue_write (void *cls)
queue);
}
+
/**
* Test if we have received a full message in plaintext.
* If so, handle it.
@@ -1975,6 +1986,7 @@ queue_read (void *cls)
queue_finish (queue);
}
+
/**
* Convert a `struct sockaddr_in6 to a `struct sockaddr *`
*
@@ -2001,6 +2013,7 @@ tcp_address_to_sockaddr_numeric_v6 (socklen_t *sock_len, struct sockaddr_in6 v6,
return in;
}
+
/**
* Convert a `struct sockaddr_in4 to a `struct sockaddr *`
*
@@ -2024,6 +2037,7 @@ tcp_address_to_sockaddr_numeric_v4 (socklen_t *sock_len, struct sockaddr_in v4,
return in;
}
+
/**
* Convert TCP bind specification to a `struct PortOnlyIpv4Ipv6 *`
*
@@ -2083,6 +2097,7 @@ tcp_address_to_sockaddr_port_only (const char *bindto, unsigned int *port)
return po;
}
+
/**
* This Method extracts the address part of the BINDTO string.
*
@@ -2117,7 +2132,8 @@ extract_address (const char *bindto)
start++; /* skip over '['*/
cp[strlen (cp) - 1] = '\0'; /* eat ']'*/
}
- else {
+ else
+ {
token = strtok_r (cp, "]", &rest);
if (strlen (bindto) == strlen (token))
{
@@ -2139,6 +2155,7 @@ extract_address (const char *bindto)
return start;
}
+
/**
* This Method extracts the port part of the BINDTO string.
*
@@ -2217,6 +2234,7 @@ extract_port (const char *addr_and_port)
return port;
}
+
/**
* Convert TCP bind specification to a `struct sockaddr *`
*
@@ -2245,7 +2263,6 @@ tcp_address_to_sockaddr (const char *bindto, socklen_t *sock_len)
bindto);
-
if (1 == inet_pton (AF_INET, start, &v4.sin_addr))
{
// colon = strrchr (cp, ':');
@@ -2263,7 +2280,8 @@ tcp_address_to_sockaddr (const char *bindto, socklen_t *sock_len)
port = extract_port (bindto);
in = tcp_address_to_sockaddr_numeric_v6 (sock_len, v6, port);
}
- else{
+ else
+ {
GNUNET_assert (0);
}
@@ -2272,6 +2290,7 @@ tcp_address_to_sockaddr (const char *bindto, socklen_t *sock_len)
return in;
}
+
/**
* Signature of functions implementing the sending functionality of a
* message queue.
@@ -2510,6 +2529,7 @@ start_initial_kx_out (struct Queue *queue)
transmit_kx (queue, &epub);
}
+
/**
* Callback called when peerstore store operation for handshake monotime is finished.
* @param cls Queue context the store operation was executed.
@@ -2527,6 +2547,7 @@ handshake_monotime_store_cb (void *cls, int success)
queue->handshake_monotime_sc = NULL;
}
+
/**
* Callback called by peerstore when records for GNUNET_PEERSTORE_TRANSPORT_TCP_COMMUNICATOR_HANDSHAKE
* where found.
@@ -2585,6 +2606,7 @@ handshake_monotime_cb (void *cls,
queue);
}
+
/**
* We have received the first bytes from the other side on a @a queue.
* Decrypt the @a tc contained in @a ibuf and check the signature.
@@ -2651,6 +2673,7 @@ free_proto_queue (struct ProtoQueue *pq)
GNUNET_free (pq);
}
+
/**
* Read from the socket of the proto queue until we have enough data
* to upgrade to full queue.
@@ -2892,6 +2915,7 @@ queue_read_kx (void *cls)
queue->read_task = GNUNET_SCHEDULER_add_now (&queue_read, queue);
}
+
/**
* Function called by the transport service to initialize a
* message queue given address information about another peer.
@@ -2991,6 +3015,7 @@ mq_init (void *cls, const struct GNUNET_PeerIdentity *peer, const char *address)
return GNUNET_OK;
}
+
/**
* Iterator over all ListenTasks to clean up.
*
@@ -3021,6 +3046,7 @@ get_lt_delete_it (void *cls,
return GNUNET_OK;
}
+
/**
* Iterator over all message queues to clean up.
*
@@ -3042,6 +3068,7 @@ get_queue_delete_it (void *cls,
return GNUNET_OK;
}
+
/**
* Shutdown the UNIX communicator.
*
@@ -3182,6 +3209,7 @@ nat_address_cb (void *cls,
}
}
+
/**
* This method adds addresses to the DLL, that are later register at the NAT service.
*/
@@ -3211,6 +3239,7 @@ add_addr (struct sockaddr *in, socklen_t in_len)
addrs_lens++;
}
+
/**
* This method launch network interactions for each address we like to bind to.
*
@@ -3336,7 +3365,7 @@ init_socket (struct sockaddr *addr,
if (NULL == queue_map)
queue_map = GNUNET_CONTAINER_multipeermap_create (10, GNUNET_NO);
- if (NULL == ch )
+ if (NULL == ch)
ch = GNUNET_TRANSPORT_communicator_connect (cfg,
COMMUNICATOR_CONFIG_SECTION,
COMMUNICATOR_ADDRESS_PREFIX,
@@ -3360,6 +3389,7 @@ init_socket (struct sockaddr *addr,
}
+
/**
* This method reads from the DLL addrs_head to register them at the NAT service.
*/
@@ -3421,6 +3451,7 @@ nat_register ()
}
}
+
/**
* This method is the callback called by the resolver API, and wraps method init_socket.
*
@@ -3476,6 +3507,7 @@ init_socket_resolv (void *cls,
}
}
+
/**
* Setup communicator and launch network interactions.
*
diff --git a/src/transport/gnunet-service-tng.c b/src/transport/gnunet-service-tng.c
index f57d08395..3cba49250 100644
--- a/src/transport/gnunet-service-tng.c
+++ b/src/transport/gnunet-service-tng.c
@@ -2772,6 +2772,11 @@ static unsigned int pa_count;
*/
static struct GNUNET_TIME_Absolute hello_mono_time;
+/**
+ * Indication if we have received a shutdown signal
+ * and are in the process of cleaning up.
+ */
+static int in_shutdown;
/**
* Get an offset into the transmission history buffer for `struct
@@ -2805,6 +2810,7 @@ free_incoming_request (struct IncomingRequest *ir)
GNUNET_assert (ir_total > 0);
ir_total--;
GNUNET_PEERSTORE_watch_cancel (ir->wc);
+ ir->wc = NULL;
GNUNET_free (ir);
}
@@ -3333,6 +3339,8 @@ free_neighbour (struct Neighbour *neighbour)
GNUNET_CONTAINER_multipeermap_remove (neighbours,
&neighbour->pid,
neighbour));
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Freeing neighbour\n");
if (NULL != neighbour->reassembly_map)
{
GNUNET_CONTAINER_multihashmap32_iterate (neighbour->reassembly_map,
@@ -3499,6 +3507,8 @@ check_link_down (void *cls)
struct GNUNET_TIME_Absolute dvh_timeout;
struct GNUNET_TIME_Absolute q_timeout;
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Checking if link is down\n");
vl->visibility_task = NULL;
dvh_timeout = GNUNET_TIME_UNIT_ZERO_ABS;
if (NULL != dv)
@@ -3660,6 +3670,7 @@ stop_peer_request (void *cls,
struct PeerRequest *pr = value;
GNUNET_PEERSTORE_watch_cancel (pr->wc);
+ pr->wc = NULL;
GNUNET_assert (
GNUNET_YES ==
GNUNET_CONTAINER_multipeermap_remove (tc->details.application.requests,
@@ -3671,6 +3682,9 @@ stop_peer_request (void *cls,
}
+static void
+do_shutdown (void *cls);
+
/**
* Called whenever a client is disconnected. Frees our
* resources associated with that client.
@@ -3688,16 +3702,20 @@ client_disconnect_cb (void *cls,
(void) cls;
(void) client;
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Client %p disconnected, cleaning up.\n",
- tc);
GNUNET_CONTAINER_DLL_remove (clients_head, clients_tail, tc);
switch (tc->type)
{
case CT_NONE:
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Unknown Client %p disconnected, cleaning up.\n",
+ tc);
break;
case CT_CORE: {
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "CORE Client %p disconnected, cleaning up.\n",
+ tc);
+
struct PendingMessage *pm;
while (NULL != (pm = tc->details.core.pending_msg_head))
@@ -3712,9 +3730,17 @@ client_disconnect_cb (void *cls,
break;
case CT_MONITOR:
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "MONITOR Client %p disconnected, cleaning up.\n",
+ tc);
+
break;
case CT_COMMUNICATOR: {
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "COMMUNICATOR Client %p disconnected, cleaning up.\n",
+ tc);
+
struct Queue *q;
struct AddressListEntry *ale;
@@ -3727,6 +3753,10 @@ client_disconnect_cb (void *cls,
break;
case CT_APPLICATION:
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "APPLICATION Client %p disconnected, cleaning up.\n",
+ tc);
+
GNUNET_CONTAINER_multipeermap_iterate (tc->details.application.requests,
&stop_peer_request,
tc);
@@ -3734,6 +3764,12 @@ client_disconnect_cb (void *cls,
break;
}
GNUNET_free (tc);
+ if ((GNUNET_YES == in_shutdown) && (NULL == clients_head))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Our last client disconnected\n");
+ do_shutdown (cls);
+ }
}
@@ -4163,7 +4199,6 @@ queue_send_msg (struct Queue *queue,
struct GNUNET_TRANSPORT_SendMessageTo *smt;
struct GNUNET_MQ_Envelope *env;
- // queue->idle = GNUNET_NO;
GNUNET_log (
GNUNET_ERROR_TYPE_DEBUG,
"Queueing %u bytes of payload for transmission <%llu> on queue %llu to %s\n",
@@ -5164,9 +5199,12 @@ handle_del_address (void *cls,
ale->address);
free_address_list_entry (ale);
GNUNET_SERVICE_client_continue (tc->client);
+ return;
}
- GNUNET_break (0);
- GNUNET_SERVICE_client_drop (tc->client);
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "Communicator removed address we did not even have.\n");
+ GNUNET_SERVICE_client_continue (tc->client);
+ // GNUNET_SERVICE_client_drop (tc->client);
}
@@ -8832,6 +8870,8 @@ transmit_on_queue (void *cls)
queue->idle = GNUNET_YES;
return;
}
+ /* There is a message pending, we are certainly not idle */
+ queue->idle = GNUNET_NO;
/* Given selection in `sc`, do transmission */
pm = sc.best;
@@ -8940,7 +8980,8 @@ transmit_on_queue (void *cls)
OPTIMIZE: Note that in the future this heuristic should likely
be improved further (measure RTT stability, consider message
- urgency and size when delaying ACKs, etc.) */update_pm_next_attempt (pm,
+ urgency and size when delaying ACKs, etc.) */
+ update_pm_next_attempt (pm,
GNUNET_TIME_relative_to_absolute (
GNUNET_TIME_relative_multiply (queue->pd.aged_rtt,
4)));
@@ -9072,7 +9113,6 @@ handle_send_message_ack (void *cls,
NULL != queue;
queue = queue->next_client)
{
- queue->idle = GNUNET_YES;
schedule_transmit_on_queue (queue, GNUNET_SCHEDULER_PRIORITY_DEFAULT);
}
}
@@ -9083,7 +9123,6 @@ handle_send_message_ack (void *cls,
"# Transmission throttled due to queue queue limit",
-1,
GNUNET_NO);
- qe->queue->idle = GNUNET_YES;
schedule_transmit_on_queue (qe->queue, GNUNET_SCHEDULER_PRIORITY_DEFAULT);
}
@@ -10058,13 +10097,17 @@ do_shutdown (void *cls)
struct LearnLaunchEntry *lle;
(void) cls;
-
- //GNUNET_CONTAINER_multipeermap_iterate (neighbours,
- //&free_neighbour_cb, NULL);
- if (NULL != peerstore)
+ GNUNET_CONTAINER_multipeermap_iterate (neighbours,
+ &free_neighbour_cb, NULL);
+ if (NULL != validation_task)
{
- GNUNET_PEERSTORE_disconnect (peerstore, GNUNET_NO);
- peerstore = NULL;
+ GNUNET_SCHEDULER_cancel (validation_task);
+ validation_task = NULL;
+ }
+ if (NULL != dvlearn_task)
+ {
+ GNUNET_SCHEDULER_cancel (dvlearn_task);
+ dvlearn_task = NULL;
}
if (NULL != GST_stats)
{
@@ -10110,6 +10153,13 @@ do_shutdown (void *cls)
GNUNET_CONTAINER_DLL_remove (lle_head, lle_tail, lle);
GNUNET_free (lle);
}
+ if (NULL != peerstore)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Disconnecting from PEERSTORE service\n");
+ GNUNET_PEERSTORE_disconnect (peerstore, GNUNET_NO);
+ peerstore = NULL;
+ }
GNUNET_CONTAINER_multishortmap_destroy (dvlearn_map);
dvlearn_map = NULL;
GNUNET_CONTAINER_heap_destroy (validation_heap);
@@ -10117,6 +10167,16 @@ do_shutdown (void *cls)
GNUNET_CONTAINER_multipeermap_iterate (dv_routes, &free_dv_routes_cb, NULL);
GNUNET_CONTAINER_multipeermap_destroy (dv_routes);
dv_routes = NULL;
+ GNUNET_SCHEDULER_shutdown ();
+}
+
+
+static void
+shutdown_task (void *cls)
+{
+ in_shutdown = GNUNET_YES;
+ if (NULL == clients_head)
+ do_shutdown (cls);
}
@@ -10136,6 +10196,7 @@ run (void *cls,
(void) service;
/* setup globals */
hello_mono_time = GNUNET_TIME_absolute_get_monotonic (c);
+ in_shutdown = GNUNET_NO;
GST_cfg = c;
backtalkers = GNUNET_CONTAINER_multipeermap_create (16, GNUNET_YES);
pending_acks = GNUNET_CONTAINER_multiuuidmap_create (32768, GNUNET_YES);
@@ -10165,7 +10226,7 @@ run (void *cls,
"My identity is `%s'\n",
GNUNET_i2s_full (&GST_my_identity));
GST_stats = GNUNET_STATISTICS_create ("transport", GST_cfg);
- GNUNET_SCHEDULER_add_shutdown (&do_shutdown, NULL);
+ GNUNET_SCHEDULER_add_shutdown (&shutdown_task, NULL);
peerstore = GNUNET_PEERSTORE_connect (GST_cfg);
if (NULL == peerstore)
{
diff --git a/src/transport/test_transport_api2_tcp_peer1.conf b/src/transport/test_transport_api2_tcp_peer1.conf
index 417a855ad..745ed6887 100644
--- a/src/transport/test_transport_api2_tcp_peer1.conf
+++ b/src/transport/test_transport_api2_tcp_peer1.conf
@@ -6,12 +6,15 @@ GNUNET_TEST_HOME = $GNUNET_TMP/test-transport/api-tcp-p1/
BINARY = gnunet-service-tng
PLUGINS = tcp
#PREFIX = valgrind --log-file=/tmp/vg_peer1-%p
+UNIXPATH = $GNUNET_RUNTIME_DIR/tng-p1.sock
[communicator-tcp]
BINARY = gnunet-communicator-tcp
BINDTO = 60002
DISABLE_V6 = YES
IMMEDIATE_START = YES
+UNIXPATH = $GNUNET_RUNTIME_DIR/tcp-comm-p1.sock
+#PREFIX = valgrind --log-file=/tmp/vg_cpeer1-%p
[peerstore]
IMMEDIATE_START = YES
diff --git a/src/transport/test_transport_api2_tcp_peer2.conf b/src/transport/test_transport_api2_tcp_peer2.conf
index 949bd95f3..022468bcd 100644
--- a/src/transport/test_transport_api2_tcp_peer2.conf
+++ b/src/transport/test_transport_api2_tcp_peer2.conf
@@ -5,12 +5,15 @@ GNUNET_TEST_HOME = $GNUNET_TMP/test-transport/api-tcp-p2/
[transport]
BINARY = gnunet-service-tng
#PREFIX = valgrind --log-file=/tmp/vg_peer2-%p
+UNIXPATH = $GNUNET_RUNTIME_DIR/tng-p2.sock
[communicator-tcp]
BINARY = gnunet-communicator-tcp
BINDTO = 60003
DISABLE_V6 = YES
IMMEDIATE_START = YES
+#PREFIX = valgrind --log-file=/tmp/vg_comm2-%p
+UNIXPATH = $GNUNET_RUNTIME_DIR/tcp-comm-p2.sock
[peerstore]
IMMEDIATE_START = YES
diff --git a/src/transport/transport-testing2.c b/src/transport/transport-testing2.c
index d553a3961..eaa8a5f15 100644
--- a/src/transport/transport-testing2.c
+++ b/src/transport/transport-testing2.c
@@ -328,6 +328,8 @@ notify_disconnect (void *cls,
}
}
+static void
+retrieve_hello (void *cls);
static void
hello_iter_cb (void *cb_cls,
@@ -338,14 +340,15 @@ hello_iter_cb (void *cb_cls,
if ((NULL == record) && (NULL == emsg))
{
p->pic = NULL;
- LOG (GNUNET_ERROR_TYPE_DEBUG, "Iteration End\n");
+ if (NULL != p->start_cb)
+ p->rh_task = GNUNET_SCHEDULER_add_now (retrieve_hello, p);
return;
}
- //Check record type et al?
+ // Check record type et al?
p->hello_size = record->value_size;
p->hello = GNUNET_malloc (p->hello_size);
memcpy (p->hello, record->value, p->hello_size);
- p->hello[p->hello_size-1] = '\0';
+ p->hello[p->hello_size - 1] = '\0';
GNUNET_PEERSTORE_iterate_cancel (p->pic);
p->pic = NULL;
@@ -360,13 +363,12 @@ hello_iter_cb (void *cb_cls,
}
}
+
static void
-retrieve_hello(void *cls)
+retrieve_hello (void *cls)
{
struct GNUNET_TRANSPORT_TESTING_PeerContext *p = cls;
- LOG (GNUNET_ERROR_TYPE_DEBUG,
- "Getting hello...\n");
-
+ p->rh_task = NULL;
p->pic = GNUNET_PEERSTORE_iterate (p->ph,
"transport",
&p->id,
@@ -377,7 +379,6 @@ retrieve_hello(void *cls)
}
-
/**
* Start a peer with the given configuration
* @param tth the testing handle
@@ -535,11 +536,8 @@ GNUNET_TRANSPORT_TESTING_start_peer (struct
// FIXME Error handling
p->ah = GNUNET_TRANSPORT_application_init (p->cfg);
GNUNET_assert (NULL != p->ah);
- // FIXME Error handleing
- GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10),
- retrieve_hello,
- p);
- //GNUNET_assert (NULL != p->pic);
+ // FIXME Error handling
+ p->rh_task = GNUNET_SCHEDULER_add_now (retrieve_hello, p);
return p;
}
@@ -650,6 +648,11 @@ GNUNET_TRANSPORT_TESTING_stop_peer (struct
struct GNUNET_TRANSPORT_TESTING_Handle *tth = p->tth;
struct GNUNET_TRANSPORT_TESTING_ConnectRequest *cc;
struct GNUNET_TRANSPORT_TESTING_ConnectRequest *ccn;
+ /* shutdown */
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "Stopping peer %u (`%s')\n",
+ p->no,
+ GNUNET_i2s (&p->id));
for (cc = tth->cc_head; NULL != cc; cc = ccn)
{
@@ -660,7 +663,7 @@ GNUNET_TRANSPORT_TESTING_stop_peer (struct
}
if (NULL != p->pic)
{
- //GNUNET_PEERSTORE_iterate_cancel (p->pic);
+ GNUNET_PEERSTORE_iterate_cancel (p->pic);
p->pic = NULL;
}
if (NULL != p->th)
@@ -668,19 +671,6 @@ GNUNET_TRANSPORT_TESTING_stop_peer (struct
GNUNET_TRANSPORT_core_disconnect (p->th);
p->th = NULL;
}
- if (NULL != p->peer)
- {
- if (GNUNET_OK !=
- GNUNET_TESTING_peer_stop (p->peer))
- {
- LOG (GNUNET_ERROR_TYPE_DEBUG,
- "Testing lib failed to stop peer %u (`%s')\n",
- p->no,
- GNUNET_i2s (&p->id));
- }
- GNUNET_TESTING_peer_destroy (p->peer);
- p->peer = NULL;
- }
if (NULL != p->ats)
{
GNUNET_ATS_connectivity_done (p->ats);
@@ -693,9 +683,25 @@ GNUNET_TRANSPORT_TESTING_stop_peer (struct
}
if (NULL != p->ph)
{
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Disconnecting from PEERSTORE service\n");
GNUNET_PEERSTORE_disconnect (p->ph, GNUNET_NO);
p->ph = NULL;
}
+
+ if (NULL != p->peer)
+ {
+ if (GNUNET_OK !=
+ GNUNET_TESTING_peer_stop (p->peer))
+ {
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "Testing lib failed to stop peer %u (`%s')\n",
+ p->no,
+ GNUNET_i2s (&p->id));
+ }
+ GNUNET_TESTING_peer_destroy (p->peer);
+ p->peer = NULL;
+ }
if (NULL != p->hello)
{
GNUNET_free (p->hello);
@@ -718,6 +724,9 @@ GNUNET_TRANSPORT_TESTING_stop_peer (struct
"Peer %u (`%s') stopped\n",
p->no,
GNUNET_i2s (&p->id));
+ if (NULL != p->rh_task)
+ GNUNET_SCHEDULER_cancel (p->rh_task);
+ p->rh_task = NULL;
GNUNET_free (p);
}
@@ -728,16 +737,16 @@ GNUNET_TRANSPORT_TESTING_stop_peer (struct
* FIXME maybe schedule the application_validate somehow
*/
/*
-static void
-hello_offered (void *cls)
-{
- struct GNUNET_TRANSPORT_TESTING_ConnectRequest *cc = cls;
-
- cc->oh = NULL;
- cc->tct = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
- &offer_hello,
- cc);
-}*/
+ static void
+ hello_offered (void *cls)
+ {
+ struct GNUNET_TRANSPORT_TESTING_ConnectRequest *cc = cls;
+
+ cc->oh = NULL;
+ cc->tct = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
+ &offer_hello,
+ cc);
+ }*/
/**
diff --git a/src/transport/transport-testing2.h b/src/transport/transport-testing2.h
index 8c0f03556..db8700df9 100644
--- a/src/transport/transport-testing2.h
+++ b/src/transport/transport-testing2.h
@@ -145,6 +145,11 @@ struct GNUNET_TRANSPORT_TESTING_PeerContext
GNUNET_SCHEDULER_TaskCallback start_cb;
/**
+ * Hello get task
+ */
+ struct GNUNET_SCHEDULER_Task *rh_task;
+
+ /**
* Closure for the @a nc and @a nd callbacks
*/
void *cb_cls;
diff --git a/src/util/.gitignore b/src/util/.gitignore
index 8556ee7b8..7c7b7045d 100644
--- a/src/util/.gitignore
+++ b/src/util/.gitignore
@@ -80,3 +80,4 @@ python27_location
perf_malloc
perf_mq
perf_scheduler
+gnunet-base32
diff --git a/src/util/Makefile.am b/src/util/Makefile.am
index 33fe26e34..6b9e083a7 100644
--- a/src/util/Makefile.am
+++ b/src/util/Makefile.am
@@ -152,9 +152,10 @@ libexec_PROGRAMS = \
gnunet-timeout
bin_PROGRAMS = \
- gnunet-resolver \
+ gnunet-base32 \
gnunet-config \
gnunet-crypto-tvg \
+ gnunet-resolver \
$(GNUNET_ECC) \
$(GNUNET_SCRYPT) \
gnunet-uri
@@ -203,6 +204,12 @@ gnunet_ecc_LDADD = \
libgnunetutil.la \
$(GN_LIBINTL) -lgcrypt
+gnunet_base32_SOURCES = \
+ gnunet-base32.c
+gnunet_base32_LDADD = \
+ libgnunetutil.la \
+ $(GN_LIBINTL)
+
gnunet_scrypt_SOURCES = \
gnunet-scrypt.c
gnunet_scrypt_LDADD = \
diff --git a/src/util/gnunet-base32.c b/src/util/gnunet-base32.c
new file mode 100644
index 000000000..2c797f56e
--- /dev/null
+++ b/src/util/gnunet-base32.c
@@ -0,0 +1,152 @@
+/*
+ This file is part of GNUnet.
+ Copyright (C) 2021 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
+ */
+
+/**
+ * @file util/gnunet-base32.c
+ * @brief tool to encode/decode from/to the Crockford Base32 encoding GNUnet uses
+ * @author Christian Grothoff
+ */
+#include "platform.h"
+#include "gnunet_util_lib.h"
+
+
+/**
+ * The main function of gnunet-base32
+ *
+ * @param argc number of arguments from the command line
+ * @param argv command line arguments
+ * @return 0 ok, 1 on error
+ */
+int
+main (int argc,
+ char *const *argv)
+{
+ int decode = 0;
+ const struct GNUNET_GETOPT_CommandLineOption options[] = {
+ GNUNET_GETOPT_option_flag ('d',
+ "decode",
+ gettext_noop ("run decoder modus, otherwise runs as encoder"),
+ &decode),
+ GNUNET_GETOPT_option_help ("Crockford base32 encoder/decoder"),
+ GNUNET_GETOPT_option_version (PACKAGE_VERSION),
+ GNUNET_GETOPT_OPTION_END
+ };
+ int ret;
+ char *in;
+ unsigned int in_size;
+ ssize_t iret;
+ char *out;
+ size_t out_size;
+
+ if (GNUNET_OK !=
+ GNUNET_STRINGS_get_utf8_args (argc, argv,
+ &argc, &argv))
+ return 2;
+ ret = GNUNET_GETOPT_run ("gnunet-base32",
+ options,
+ argc,
+ argv);
+ if (ret < 0)
+ return 1;
+ if (0 == ret)
+ return 0;
+ in_size = 0;
+ in = NULL;
+ iret = 1;
+ while (iret > 0)
+ {
+ /* read in blocks of 4k */
+ char buf[4092];
+
+ iret = read (0,
+ buf,
+ sizeof (buf));
+ if (iret < 0)
+ {
+ GNUNET_free (in);
+ return 2;
+ }
+ if (iret > 0)
+ {
+ if (iret + in_size < in_size)
+ {
+ GNUNET_break (0);
+ GNUNET_free (in);
+ return 1;
+ }
+ GNUNET_array_grow (in,
+ in_size,
+ in_size + iret);
+ memcpy (&in[in_size - iret],
+ buf,
+ iret);
+ }
+ }
+ if (decode)
+ {
+ /* This formula can overestimate by 1 byte, so we try both
+ out_size and out_size-1 below */
+ out_size = in_size * 5 / 8;
+ out = GNUNET_malloc (out_size);
+ if (GNUNET_OK !=
+ GNUNET_STRINGS_string_to_data (in,
+ in_size,
+ out,
+ out_size))
+ {
+ out_size--;
+ if (GNUNET_OK !=
+ GNUNET_STRINGS_string_to_data (in,
+ in_size,
+ out,
+ out_size))
+ {
+ GNUNET_free (out);
+ GNUNET_free (in);
+ return 3;
+ }
+ }
+ }
+ else
+ {
+ out = GNUNET_STRINGS_data_to_string_alloc (in,
+ in_size);
+ out_size = strlen (out);
+ }
+ {
+ size_t pos = 0;
+
+ while (pos < out_size)
+ {
+ iret = write (1,
+ &out[pos],
+ out_size - pos);
+ if (iret <= 0)
+ return 4;
+ pos += iret;
+ }
+ }
+ GNUNET_free (out);
+ GNUNET_free_nz ((void *) argv);
+ return 0;
+}
+
+
+/* end of gnunet-uri.c */
diff --git a/src/util/gnunet-scrypt.c b/src/util/gnunet-scrypt.c
index 5c3dfc12e..fe8b6769f 100644
--- a/src/util/gnunet-scrypt.c
+++ b/src/util/gnunet-scrypt.c
@@ -290,8 +290,8 @@ run (void *cls,
int
main (int argc, char *const *argv)
{
- struct GNUNET_GETOPT_CommandLineOption options[] =
- { GNUNET_GETOPT_option_ulong (
+ struct GNUNET_GETOPT_CommandLineOption options[] = {
+ GNUNET_GETOPT_option_ulong (
'b',
"bits",
"BITS",
@@ -315,7 +315,8 @@ main (int argc, char *const *argv)
gettext_noop (
"time to wait between calculations"),
&proof_find_delay),
- GNUNET_GETOPT_OPTION_END };
+ GNUNET_GETOPT_OPTION_END
+ };
int ret;
if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))