summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am8
-rw-r--r--src/arm/test_gnunet_arm.py.in2
-rwxr-xr-xsrc/cadet/loopcheck.sh42
-rwxr-xr-xsrc/cadet/run_profiler.sh2
-rw-r--r--src/consensus/consensus-simulation.py.in13
-rw-r--r--src/conversation/test.sh2
-rw-r--r--src/credential/Makefile.am16
-rw-r--r--src/credential/plugin_rest_credential.c (renamed from src/rest-plugins/plugin_rest_credential.c)0
-rwxr-xr-xsrc/credential/test_credential_collect.sh4
-rwxr-xr-xsrc/credential/test_credential_collect_rest.sh13
-rwxr-xr-xsrc/credential/test_credential_issue.sh4
-rwxr-xr-xsrc/credential/test_credential_issue_rest.sh4
-rwxr-xr-xsrc/credential/test_credential_verify.sh5
-rwxr-xr-xsrc/credential/test_credential_verify_and.sh5
-rwxr-xr-xsrc/credential/test_credential_verify_rest.sh5
-rwxr-xr-xsrc/credential/test_credential_verify_simple.sh4
-rw-r--r--src/dht/test_dht_tools.py.in3
-rw-r--r--src/dns/gnunet-helper-dns.c2
-rwxr-xr-xsrc/dns/test_gnunet_dns.sh12
-rwxr-xr-xsrc/exit/install-exit-helper.sh2
-rw-r--r--src/fs/gnunet-publish.c14
-rwxr-xr-xsrc/fs/test_gnunet_fs_psd.py.in2
-rwxr-xr-xsrc/fs/test_gnunet_fs_rec.py.in4
-rw-r--r--src/gns/Makefile.am24
-rw-r--r--src/gns/gns.conf.in4
-rw-r--r--src/gns/gnunet-dns2gns.c60
-rw-r--r--src/gns/gnunet-gns-proxy-setup-ca.in322
-rw-r--r--src/gns/gnunet-gns-proxy.c59
-rw-r--r--src/gns/plugin_rest_gns.c (renamed from src/rest-plugins/plugin_rest_gns.c)0
-rwxr-xr-xsrc/gns/test_gns_at_lookup.sh6
-rwxr-xr-xsrc/gns/test_gns_cname_lookup.sh12
-rwxr-xr-xsrc/gns/test_gns_config_lookup.sh6
-rwxr-xr-xsrc/gns/test_gns_delegated_lookup.sh6
-rwxr-xr-xsrc/gns/test_gns_dht_lookup.sh6
-rwxr-xr-xsrc/gns/test_gns_gns2dns_cname_lookup.sh10
-rwxr-xr-xsrc/gns/test_gns_gns2dns_lookup.sh14
-rwxr-xr-xsrc/gns/test_gns_ipv6_lookup.sh6
-rwxr-xr-xsrc/gns/test_gns_lookup.sh6
-rwxr-xr-xsrc/gns/test_gns_mx_lookup.sh6
-rw-r--r--src/gns/test_gns_proxy.c16
-rwxr-xr-xsrc/gns/test_gns_quickupdate.sh6
-rwxr-xr-xsrc/gns/test_gns_rel_expiration.sh8
-rwxr-xr-xsrc/gns/test_gns_revocation.sh6
-rwxr-xr-xsrc/gns/test_gns_soa_lookup.sh8
-rwxr-xr-xsrc/gns/test_gns_txt_lookup.sh6
-rwxr-xr-xsrc/gns/test_gns_zkey_lookup.sh6
-rwxr-xr-xsrc/gns/test_gnunet_gns.sh25
-rwxr-xr-xsrc/gns/test_plugin_rest_gns.sh (renamed from src/rest-plugins/test_plugin_rest_gns.sh)0
-rwxr-xr-xsrc/gns/test_proxy.sh4
-rw-r--r--src/hostlist/hostlist.conf2
-rw-r--r--src/identity/Makefile.am21
-rw-r--r--src/identity/plugin_rest_identity.c (renamed from src/rest-plugins/plugin_rest_identity.c)0
-rwxr-xr-xsrc/identity/test_plugin_rest_identity.sh (renamed from src/rest-plugins/test_plugin_rest_identity.sh)0
-rw-r--r--src/integration-tests/Makefile.am4
-rw-r--r--src/integration-tests/gnunet_pyexpect.py.in3
-rw-r--r--src/integration-tests/gnunet_testing.py.in5
-rwxr-xr-xsrc/integration-tests/test_integration_bootstrap_and_connect.py.in2
-rwxr-xr-xsrc/integration-tests/test_integration_clique.py.in1
-rwxr-xr-xsrc/integration-tests/test_integration_disconnect.py.in2
-rwxr-xr-xsrc/integration-tests/test_integration_disconnect_nat.py.in2
-rwxr-xr-xsrc/integration-tests/test_integration_reconnect.py.in2
-rwxr-xr-xsrc/integration-tests/test_integration_reconnect_nat.py.in2
-rw-r--r--src/namestore/Makefile.am57
-rw-r--r--src/namestore/plugin_rest_namestore.c (renamed from src/rest-plugins/plugin_rest_namestore.c)0
-rwxr-xr-xsrc/namestore/test_plugin_rest_namestore.sh (renamed from src/rest-plugins/test_plugin_rest_namestore.sh)0
-rwxr-xr-xsrc/nat/install-nat-helper.sh2
-rw-r--r--src/peerinfo/Makefile.am23
-rw-r--r--src/peerinfo/plugin_rest_peerinfo.c (renamed from src/rest-plugins/plugin_rest_peerinfo.c)0
-rw-r--r--src/pt/test_gns_vpn.c2
-rw-r--r--src/pt/test_gns_vpn.conf2
-rw-r--r--src/reclaim/.gitignore4
-rw-r--r--src/reclaim/Makefile.am46
-rw-r--r--src/reclaim/json_reclaim.c (renamed from src/rest-plugins/json_reclaim.c)0
-rw-r--r--src/reclaim/json_reclaim.h (renamed from src/rest-plugins/json_reclaim.h)0
-rw-r--r--src/reclaim/oidc_helper.c (renamed from src/rest-plugins/oidc_helper.c)0
-rw-r--r--src/reclaim/oidc_helper.h (renamed from src/rest-plugins/oidc_helper.h)0
-rw-r--r--src/reclaim/plugin_rest_openid_connect.c (renamed from src/rest-plugins/plugin_rest_openid_connect.c)0
-rw-r--r--src/reclaim/plugin_rest_reclaim.c (renamed from src/rest-plugins/plugin_rest_reclaim.c)0
-rwxr-xr-xsrc/reclaim/test_reclaim.sh4
-rw-r--r--src/rest-plugins/Makefile.am135
-rw-r--r--src/rest/Makefile.am15
-rw-r--r--src/rest/gnunet-rest-server.c63
-rw-r--r--src/rest/plugin_rest_copying.c (renamed from src/rest-plugins/plugin_rest_copying.c)0
-rw-r--r--src/rest/rest.conf2
-rw-r--r--src/revocation/test_local_revocation.py.in3
-rw-r--r--src/rps/gnunet-rps-profiler.c76
-rw-r--r--src/rps/gnunet-service-rps.c18
-rw-r--r--src/rps/rps-test_util.h2
-rw-r--r--src/statistics/test_gnunet_statistics.py.in2
-rwxr-xr-xsrc/transport/benchmark.sh8
-rwxr-xr-xsrc/transport/install-bluetooth-helper.sh2
-rwxr-xr-xsrc/transport/install-wlan-helper.sh2
-rwxr-xr-xsrc/transport/profile_transport.sh4
-rw-r--r--src/util/gnunet-config.c130
-rw-r--r--src/util/gnunet-qr.c221
-rwxr-xr-xsrc/vpn/install-vpn-helper.sh2
-rwxr-xr-xsrc/vpn/tests/test-helper-icmp.sh2
-rwxr-xr-xsrc/vpn/tests/test-helper-ifaddr.sh2
98 files changed, 1122 insertions, 553 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 03738e4ed..c1c708aa6 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -60,7 +60,7 @@ endif
if HAVE_MHD
if HAVE_JSON
- REST_DIR = rest rest-plugins
+ REST_DIR = rest
endif
endif
@@ -81,6 +81,8 @@ SUBDIRS = \
statistics \
arm \
$(TESTING) \
+ $(JSON_DIR) \
+ $(REST_DIR) \
peerinfo \
$(SQLITE_DIR) \
$(MYSQL_DIR) \
@@ -121,9 +123,7 @@ SUBDIRS = \
exit \
pt \
secretsharing \
- $(EXP_DIR) \
- $(JSON_DIR) \
- $(REST_DIR) \
+ $(EXP_DIR) \
integration-tests
endif
diff --git a/src/arm/test_gnunet_arm.py.in b/src/arm/test_gnunet_arm.py.in
index 10bb58a9c..1d067b5d9 100644
--- a/src/arm/test_gnunet_arm.py.in
+++ b/src/arm/test_gnunet_arm.py.in
@@ -1,5 +1,5 @@
#!@PYTHON@
-from __future__ import print_function
+
import os
import sys
import shutil
diff --git a/src/cadet/loopcheck.sh b/src/cadet/loopcheck.sh
index ddc8c191c..9b867e95b 100755
--- a/src/cadet/loopcheck.sh
+++ b/src/cadet/loopcheck.sh
@@ -1,4 +1,41 @@
-#!/bin/sh
+#!/usr/bin/env bash
+# This script is in the public domain
+# POSIX shell solution for named pipes and pipestatus,
+# http://shell.cfajohnson.com/cus-faq-2.html#Q11
+# run() {
+# j=1
+# while eval "\${pipestatus_$j+:} false"; do
+# unset pipestatus_$j
+# j=$(($j+1))
+# done
+# j=1 com= k=1 l=
+# for a; do
+# if [ "x$a" = 'x|' ]; then
+# com="$com { $l "'3>&-
+# echo "pipestatus_'$j'=$?" >&3
+# } 4>&- |'
+# j=$(($j+1)) l=
+# else
+# l="$l \"\$$k\""
+# fi
+# k=$(($k+1))
+# done
+# com="$com $l"' 3>&- >&4 4>&-
+# echo "pipestatus_'$j'=$?"'
+# exec 4>&1
+# eval "$(exec 3>&1; eval "$com")"
+# exec 4>&-
+# j=1
+# while eval "\${pipestatus_$j+:} false"; do
+# eval "[ \$pipestatus_$j -eq 0 ]" || return 1
+# j=$(($j+1))
+# done
+# return 0
+# }
+
+# # https://mywiki.wooledge.org/Bashism has another solution:
+# # mkfifo fifo; command2 <fifo & command1 >fifo; echo "$?"
+
while true; do
if [ "$1" = "" ]; then
echo All
@@ -7,6 +44,7 @@ while true; do
echo One
LOGFILE="test_`date "+%m.%d-%H:%M:%S"`.log"
taskset 01 $1 2>&1 | tee $LOGFILE | grep -v DEBUG;
+ # TODO: Replace $PIPESTATUS with more portable code
if [ "${PIPESTATUS[0]}" != "0" ]; then
echo "Failed";
date;
@@ -15,5 +53,5 @@ while true; do
fi
grep cadet test_*.log | grep -B 10 ERROR && break
grep cadet test_*.log | grep -B 10 Assert && break
- ls core* &> /dev/null && break
+ ls core* > /dev/null 2>&1 && break
done
diff --git a/src/cadet/run_profiler.sh b/src/cadet/run_profiler.sh
index 81ea4a761..4273dcd27 100755
--- a/src/cadet/run_profiler.sh
+++ b/src/cadet/run_profiler.sh
@@ -22,4 +22,4 @@ echo "using $PEERS peers, $LINKS links";
sed -e "s/%LINKS%/$LINKS/;s/%NSE%/$NSE/" profiler.conf > .profiler.conf
-./gnunet-cadet-profiler $ROUNDTIME $PEERS $PINGS $4 |& tee log | grep -v DEBUG
+./gnunet-cadet-profiler $ROUNDTIME $PEERS $PINGS $4 2>&1 | tee log | grep -v DEBUG
diff --git a/src/consensus/consensus-simulation.py.in b/src/consensus/consensus-simulation.py.in
index 161015d00..39daf81c6 100644
--- a/src/consensus/consensus-simulation.py.in
+++ b/src/consensus/consensus-simulation.py.in
@@ -17,16 +17,9 @@
#
# SPDX-License-Identifier: AGPL3.0-or-later
-from __future__ import absolute_import
-from __future__ import print_function
-from __future__ import division
-from builtins import str
-from builtins import range
-from past.utils import old_div
import argparse
import random
from math import ceil, log, floor
-from past.builtins import xrange
def bsc(n):
@@ -43,14 +36,12 @@ def bsc(n):
def simulate(k, n, verbose):
assert k < n
- largest_arc = old_div(int(2**ceil(log(n, 2))), 2)
+ largest_arc = int(2**ceil(log(n, 2))) // 2
num_ghosts = (2 * largest_arc) - n
if verbose:
print("we have", num_ghosts, "ghost peers")
# n.b. all peers with idx<k are evil
peers = list(range(n))
- # py2-3 compatible, backwards.
- # refer to http://python-future.org/compatible_idioms.html#xrange
info = [1 << x for x in range(n)]
def done_p():
@@ -111,4 +102,4 @@ if __name__ == "__main__":
sum = 0.0
for n in range(0, args.r):
sum += simulate(args.k, args.n, args.verbose)
- print(old_div(sum, args.r))
+ print(sum // args.r)
diff --git a/src/conversation/test.sh b/src/conversation/test.sh
index ca4d15ac1..20e82bc88 100644
--- a/src/conversation/test.sh
+++ b/src/conversation/test.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
export GST_DEBUG_DUMP_DOT_DIR=/tmp/
GST_DEBUG_DUMP_DOT_DIR=/tmp/ ./gnunet-helper-audio-record |GST_DEBUG_DUMP_DOT_DIR=/tmp/ ./gnunet-helper-audio-playback
diff --git a/src/credential/Makefile.am b/src/credential/Makefile.am
index b96e33b5c..aaac0d2c2 100644
--- a/src/credential/Makefile.am
+++ b/src/credential/Makefile.am
@@ -90,3 +90,19 @@ if HAVE_SQLITE
TESTS = $(check_SCRIPTS)
endif
endif
+
+#libgnunet_plugin_rest_credential_la_SOURCES = \
+# plugin_rest_credential.c
+#libgnunet_plugin_rest_credential_la_LIBADD = \
+# $(top_builddir)/src/credential/libgnunetcredential.la \
+# $(top_builddir)/src/rest/libgnunetrest.la \
+# $(top_builddir)/src/identity/libgnunetidentity.la \
+# $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
+# $(LTLIBINTL) -ljansson -lmicrohttpd
+#libgnunet_plugin_rest_credential_la_LDFLAGS = \
+# $(GN_PLUGIN_LDFLAGS)
+
+
+
+
+
diff --git a/src/rest-plugins/plugin_rest_credential.c b/src/credential/plugin_rest_credential.c
index 78267b54e..78267b54e 100644
--- a/src/rest-plugins/plugin_rest_credential.c
+++ b/src/credential/plugin_rest_credential.c
diff --git a/src/credential/test_credential_collect.sh b/src/credential/test_credential_collect.sh
index 6c713063f..0ae063eda 100755
--- a/src/credential/test_credential_collect.sh
+++ b/src/credential/test_credential_collect.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
trap "gnunet-arm -e -c test_credential_lookup.conf" SIGINT
LOCATION=$(which gnunet-config)
@@ -20,7 +20,7 @@ rm -rf `gnunet-config -c test_credential_lookup.conf -s PATHS -o GNUNET_HOME -f`
# (3) PKEY3.user -> PKEY4
-which timeout &> /dev/null && DO_TIMEOUT="timeout 30"
+which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 30"
TEST_ATTR="test"
TEST_ATTR2="test2"
diff --git a/src/credential/test_credential_collect_rest.sh b/src/credential/test_credential_collect_rest.sh
index 0b31f85bc..fe59d9399 100755
--- a/src/credential/test_credential_collect_rest.sh
+++ b/src/credential/test_credential_collect_rest.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
trap "gnunet-arm -e -c test_credential_lookup.conf" SIGINT
LOCATION=$(which gnunet-config)
@@ -22,7 +22,7 @@ rm -rf `gnunet-config -c test_credential_lookup.conf -s PATHS -o GNUNET_HOME -f`
# (5) GNUnet.developer -> Alice
-which timeout &> /dev/null && DO_TIMEOUT="timeout 30"
+which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 30"
gnunet-arm -s -c test_credential_lookup.conf
gnunet-identity -C service -c test_credential_lookup.conf
gnunet-identity -C alice -c test_credential_lookup.conf
@@ -82,9 +82,10 @@ gnunet-arm -e -c test_credential_lookup.conf
echo "Done"
if [ "$RES_CRED" != "Failed." ]
then
- echo -e "${RES_CRED}"
- exit 0
+ # TODO: replace echo -e bashism.
+ echo -e "${RES_CRED}"
+ exit 0
else
- echo "FAIL: Failed to verify credential $RES_CRED."
- exit 1
+ echo "FAIL: Failed to verify credential $RES_CRED."
+ exit 1
fi
diff --git a/src/credential/test_credential_issue.sh b/src/credential/test_credential_issue.sh
index 158d91c5b..f06de5d42 100755
--- a/src/credential/test_credential_issue.sh
+++ b/src/credential/test_credential_issue.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
trap "gnunet-arm -e -c test_credential_lookup.conf" SIGINT
LOCATION=$(which gnunet-config)
@@ -20,7 +20,7 @@ rm -rf `gnunet-config -c test_credential_lookup.conf -s PATHS -o GNUNET_HOME -f`
# (3) PKEY3.user -> PKEY4
-which timeout &> /dev/null && DO_TIMEOUT="timeout 30"
+which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 30"
TEST_ATTR="test"
gnunet-arm -s -c test_credential_lookup.conf
diff --git a/src/credential/test_credential_issue_rest.sh b/src/credential/test_credential_issue_rest.sh
index 15cd55083..c518c08ec 100755
--- a/src/credential/test_credential_issue_rest.sh
+++ b/src/credential/test_credential_issue_rest.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
trap "gnunet-arm -e -c test_credential_lookup.conf" SIGINT
LOCATION=$(which gnunet-config)
@@ -20,7 +20,7 @@ rm -rf `gnunet-config -c test_credential_lookup.conf -s PATHS -o GNUNET_HOME -f`
# (3) PKEY3.user -> PKEY4
-which timeout &> /dev/null && DO_TIMEOUT="timeout 30"
+which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 30"
TEST_ATTR="test"
gnunet-arm -s -c test_credential_lookup.conf
diff --git a/src/credential/test_credential_verify.sh b/src/credential/test_credential_verify.sh
index d042bcfe6..49d4d4afb 100755
--- a/src/credential/test_credential_verify.sh
+++ b/src/credential/test_credential_verify.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
trap "gnunet-arm -e -c test_credential_lookup.conf" SIGINT
LOCATION=$(which gnunet-config)
@@ -22,7 +22,7 @@ rm -rf `gnunet-config -c test_credential_lookup.conf -s PATHS -o GNUNET_HOME -f`
# (5) GNUnet.developer -> Alice
-which timeout &> /dev/null && DO_TIMEOUT="timeout 30"
+which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 30"
gnunet-arm -s -c test_credential_lookup.conf
gnunet-identity -C service -c test_credential_lookup.conf
gnunet-identity -C alice -c test_credential_lookup.conf
@@ -73,6 +73,7 @@ gnunet-arm -e -c test_credential_lookup.conf
if [ "$RES_CRED" != "Failed." ]
then
+ # TODO: replace echo -e bashism
echo -e "${RES_CRED}"
exit 0
else
diff --git a/src/credential/test_credential_verify_and.sh b/src/credential/test_credential_verify_and.sh
index 9d5c1962e..7e8dc1392 100755
--- a/src/credential/test_credential_verify_and.sh
+++ b/src/credential/test_credential_verify_and.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
trap "gnunet-arm -e -c test_credential_lookup.conf" SIGINT
LOCATION=$(which gnunet-config)
@@ -22,7 +22,7 @@ rm -rf `gnunet-config -c test_credential_lookup.conf -s PATHS -o GNUNET_HOME -f`
# (5) GNUnet.developer -> Alice
-which timeout &> /dev/null && DO_TIMEOUT="timeout 30"
+which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 30"
gnunet-arm -s -c test_credential_lookup.conf
gnunet-identity -C service -c test_credential_lookup.conf
gnunet-identity -C alice -c test_credential_lookup.conf
@@ -73,6 +73,7 @@ gnunet-arm -e -c test_credential_lookup.conf
if [ "$RES_CRED" != "Failed." ]
then
+ # TODO: echo -e bashism
echo -e "${RES_CRED}"
exit 0
else
diff --git a/src/credential/test_credential_verify_rest.sh b/src/credential/test_credential_verify_rest.sh
index 6133ea25e..99db5da8a 100755
--- a/src/credential/test_credential_verify_rest.sh
+++ b/src/credential/test_credential_verify_rest.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
trap "gnunet-arm -e -c test_credential_lookup.conf" SIGINT
LOCATION=$(which gnunet-config)
@@ -22,7 +22,7 @@ rm -rf `gnunet-config -c test_credential_lookup.conf -s PATHS -o GNUNET_HOME -f`
# (5) GNUnet.developer -> Alice
-which timeout &> /dev/null && DO_TIMEOUT="timeout 30"
+which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 30"
gnunet-arm -s -c test_credential_lookup.conf
gnunet-identity -C service -c test_credential_lookup.conf
gnunet-identity -C alice -c test_credential_lookup.conf
@@ -79,6 +79,7 @@ gnunet-arm -e -c test_credential_lookup.conf
if [ "$RES_CRED" != "Failed." ]
then
+ # TODO: replace echo -e bashism
echo -e "${RES_CRED}"
exit 0
else
diff --git a/src/credential/test_credential_verify_simple.sh b/src/credential/test_credential_verify_simple.sh
index bcb3f9877..41afb47b0 100755
--- a/src/credential/test_credential_verify_simple.sh
+++ b/src/credential/test_credential_verify_simple.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
trap "gnunet-arm -e -c test_credential_lookup.conf" SIGINT
LOCATION=$(which gnunet-config)
@@ -18,7 +18,7 @@ rm -rf `gnunet-config -c test_credential_lookup.conf -s PATHS -o GNUNET_HOME -f`
# (3) Isser.user -> Subject
-which timeout &> /dev/null && DO_TIMEOUT="timeout 30"
+which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 30"
gnunet-arm -s -c test_credential_lookup.conf
gnunet-identity -C testissuer -c test_credential_lookup.conf
gnunet-identity -C testsubject -c test_credential_lookup.conf
diff --git a/src/dht/test_dht_tools.py.in b/src/dht/test_dht_tools.py.in
index 38a9f9622..2d9379a42 100644
--- a/src/dht/test_dht_tools.py.in
+++ b/src/dht/test_dht_tools.py.in
@@ -11,8 +11,7 @@
#
# The code does NOT depend on DHT routing or any actual P2P functionality.
#
-from __future__ import print_function
-from __future__ import absolute_import
+
import os
import sys
import shutil
diff --git a/src/dns/gnunet-helper-dns.c b/src/dns/gnunet-helper-dns.c
index f236924bb..fb970224a 100644
--- a/src/dns/gnunet-helper-dns.c
+++ b/src/dns/gnunet-helper-dns.c
@@ -83,7 +83,7 @@
*/
#define MAX_SIZE 65536
-#ifndef _LINUX_IN6_H
+#if !HAVE_DECL_STRUCT_IN6_IFREQ
/**
* This is in linux/include/net/ipv6.h, but not always exported...
*/
diff --git a/src/dns/test_gnunet_dns.sh b/src/dns/test_gnunet_dns.sh
index 57b9716f5..0fa338c9b 100755
--- a/src/dns/test_gnunet_dns.sh
+++ b/src/dns/test_gnunet_dns.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
ME=`whoami`
if [ "$ME" != "root" ]
@@ -26,12 +26,17 @@ then
echo "This test requires nslookup. Skipping."
exit 77
fi
-if ! iptables -t mangle --list &> /dev/null
+if [ ! -x `which iptables` ]
+then
+ echo "This test requires iptables. Skipping."
+ exit 77
+fi
+if ! iptables -t mangle --list > /dev/null 2>&1
then
echo "This test requires iptables with 'mangle' support. Skipping."
exit 77
fi
-if grep % /etc/resolv.conf &> /dev/null
+if grep % /etc/resolv.conf > /dev/null 2>&1
then
echo "This system seems to use a DNS server on an IPv6 link-local address, which is not supported. Skipping."
exit 77
@@ -52,5 +57,6 @@ else
echo "Test run, with success."
ret=0
fi
+# TODO: jobs is a possible bashism. Fix.
kill `jobs -p`
exit $ret
diff --git a/src/exit/install-exit-helper.sh b/src/exit/install-exit-helper.sh
index 76af4efa7..d9ae14106 100755
--- a/src/exit/install-exit-helper.sh
+++ b/src/exit/install-exit-helper.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# $1 - bindir
# $2 - sudo binary (optional)
$2 chown root:root $1/gnunet-helper-exit || true
diff --git a/src/fs/gnunet-publish.c b/src/fs/gnunet-publish.c
index eb8a7ed19..fbf32c2a7 100644
--- a/src/fs/gnunet-publish.c
+++ b/src/fs/gnunet-publish.c
@@ -122,7 +122,7 @@ static int extract_only;
/**
* Command-line option to disable adding creation time.
*/
-static int do_disable_creation_time;
+static int enable_creation_time;
/**
* Handle to the directory scanner (for recursive insertions).
@@ -419,7 +419,7 @@ publish_inspector (void *cls,
GNUNET_CONTAINER_meta_data_destroy (meta);
meta = NULL;
}
- if (!do_disable_creation_time)
+ if (enable_creation_time)
GNUNET_CONTAINER_meta_data_add_publication_date (m);
if (extract_only)
{
@@ -902,15 +902,15 @@ main (int argc,
"LEVEL",
gettext_noop ("set the desired LEVEL of sender-anonymity"),
&bo.anonymity_level),
- GNUNET_GETOPT_option_flag ('d',
- "disable-creation-time",
- gettext_noop ("disable adding the creation time to the "
- "metadata of the uploaded file"),
- &do_disable_creation_time),
GNUNET_GETOPT_option_flag ('D',
"disable-extractor",
gettext_noop ("do not use libextractor to add keywords or metadata"),
&disable_extractor),
+ GNUNET_GETOPT_option_flag ('E',
+ "enable-creation-time",
+ gettext_noop ("enable adding the creation time to the "
+ "metadata of the uploaded file"),
+ &enable_creation_time),
GNUNET_GETOPT_option_flag ('e',
"extract",
gettext_noop ("print list of extracted keywords that would "
diff --git a/src/fs/test_gnunet_fs_psd.py.in b/src/fs/test_gnunet_fs_psd.py.in
index d5a036c28..a1e4db9d5 100755
--- a/src/fs/test_gnunet_fs_psd.py.in
+++ b/src/fs/test_gnunet_fs_psd.py.in
@@ -18,7 +18,7 @@
# SPDX-License-Identifier: AGPL3.0-or-later
#
# Testcase for file-sharing command-line tools (publish, search, download)
-from __future__ import print_function
+
import sys
import os
import subprocess
diff --git a/src/fs/test_gnunet_fs_rec.py.in b/src/fs/test_gnunet_fs_rec.py.in
index 59063a9ee..0f881564f 100755
--- a/src/fs/test_gnunet_fs_rec.py.in
+++ b/src/fs/test_gnunet_fs_rec.py.in
@@ -11,7 +11,7 @@
# 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/>.
#
@@ -65,7 +65,7 @@ tar.extractall()
# first, basic publish-search-download run
try:
pub = pexpect()
- pub.spawn(None, [publish, '-c', 'test_gnunet_fs_rec_data.conf', '-d', '-k', 'testdir', 'dir/'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ pub.spawn(None, [publish, '-c', 'test_gnunet_fs_rec_data.conf', '-k', 'testdir', 'dir/'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
# Can't say much for publishing, except that the last one is the toplevel directory
pub.expect("stdout", re.compile(r"Publishing `.+' done\.\r?\n"))
pub.expect("stdout", re.compile(r"URI is `gnunet://fs/chk/[A-Z0-9]{103}\.[A-Z0-9]{103}\.\d+'\.\r?\n"))
diff --git a/src/gns/Makefile.am b/src/gns/Makefile.am
index 434d50f34..6ebbbcaff 100644
--- a/src/gns/Makefile.am
+++ b/src/gns/Makefile.am
@@ -89,9 +89,16 @@ bin_PROGRAMS += gnunet-bcd
endif
endif
+if HAVE_MHD
+if HAVE_JSON
+REST_PLUGIN = libgnunet_plugin_rest_gns.la
+endif
+endif
+
plugin_LTLIBRARIES = \
libgnunet_plugin_block_gns.la \
- libgnunet_plugin_gnsrecord_gns.la
+ libgnunet_plugin_gnsrecord_gns.la \
+ $(REST_PLUGIN)
bin_SCRIPTS = \
@@ -104,6 +111,21 @@ gnunet-gns-proxy-setup-ca: gnunet-gns-proxy-setup-ca.in Makefile
$(do_subst) < $(srcdir)/gnunet-gns-proxy-setup-ca.in > gnunet-gns-proxy-setup-ca
chmod +x gnunet-gns-proxy-setup-ca
+
+libgnunet_plugin_rest_gns_la_SOURCES = \
+ plugin_rest_gns.c
+libgnunet_plugin_rest_gns_la_LIBADD = \
+ $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
+ libgnunetgns.la \
+ $(top_builddir)/src/rest/libgnunetrest.la \
+ $(top_builddir)/src/identity/libgnunetidentity.la \
+ $(top_builddir)/src/json/libgnunetjson.la \
+ $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
+ $(LTLIBINTL) -ljansson -lmicrohttpd
+libgnunet_plugin_rest_gns_la_LDFLAGS = \
+ $(GN_PLUGIN_LDFLAGS)
+
+
libgnunet_plugin_gnsrecord_gns_la_SOURCES = \
plugin_gnsrecord_gns.c
libgnunet_plugin_gnsrecord_gns_la_LIBADD = \
diff --git a/src/gns/gns.conf.in b/src/gns/gns.conf.in
index 2e6a02b07..3252e4888 100644
--- a/src/gns/gns.conf.in
+++ b/src/gns/gns.conf.in
@@ -32,6 +32,8 @@ INTERCEPT_DNS = NO
BINARY = gnunet-gns-proxy
START_ON_DEMAND = NO
RUN_PER_USER = YES
+BIND_TO=127.0.0.1
+BIND_TO6=::1
# Where is the certificate for the GNS proxy stored?
PROXY_CACERT = $GNUNET_DATA_HOME/gns/gns_ca_cert.pem
@@ -42,6 +44,8 @@ PROXY_UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-gns-proxy.sock
BINARY = gnunet-dns2gns
START_ON_DEMAND = NO
RUN_PER_USER = YES
+BIND_TO=127.0.0.1
+BIND_TO6=::1
# -d: DNS resolver to use, -s: suffix to use, -f: fcfs suffix to use
OPTIONS = -d 8.8.8.8
diff --git a/src/gns/gnunet-dns2gns.c b/src/gns/gnunet-dns2gns.c
index 68d090579..d2eabf02c 100644
--- a/src/gns/gnunet-dns2gns.c
+++ b/src/gns/gnunet-dns2gns.c
@@ -92,6 +92,17 @@ struct Request
uint16_t original_request_id;
};
+/**
+ * The address to bind to
+ */
+static in_addr_t address;
+
+/**
+ * The IPv6 address to bind to
+ */
+static struct in6_addr address6;
+
+
/**
* Handle to GNS resolver.
@@ -578,6 +589,7 @@ run (void *cls,
const char *cfgfile,
const struct GNUNET_CONFIGURATION_Handle *c)
{
+ char *addr_str;
(void) cls;
(void) args;
(void) cfgfile;
@@ -602,6 +614,52 @@ run (void *cls,
gns = NULL;
return;
}
+
+ /* Get address to bind to */
+ if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (c, "dns2gns",
+ "BIND_TO",
+ &addr_str))
+ {
+ //No address specified
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Don't know what to bind to...\n");
+ GNUNET_free (addr_str);
+ GNUNET_SCHEDULER_shutdown ();
+ return;
+ }
+ if (1 != inet_pton (AF_INET, addr_str, &address))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Unable to parse address %s\n",
+ addr_str);
+ GNUNET_free (addr_str);
+ GNUNET_SCHEDULER_shutdown ();
+ return;
+ }
+ GNUNET_free (addr_str);
+ /* Get address to bind to */
+ if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (c, "dns2gns",
+ "BIND_TO6",
+ &addr_str))
+ {
+ //No address specified
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Don't know what to bind6 to...\n");
+ GNUNET_free (addr_str);
+ GNUNET_SCHEDULER_shutdown ();
+ return;
+ }
+ if (1 != inet_pton (AF_INET6, addr_str, &address6))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Unable to parse IPv6 address %s\n",
+ addr_str);
+ GNUNET_free (addr_str);
+ GNUNET_SCHEDULER_shutdown ();
+ return;
+ }
+ GNUNET_free (addr_str);
+
listen_socket4 = GNUNET_NETWORK_socket_create (PF_INET,
SOCK_DGRAM,
IPPROTO_UDP);
@@ -611,6 +669,7 @@ run (void *cls,
memset (&v4, 0, sizeof (v4));
v4.sin_family = AF_INET;
+ v4.sin_addr.s_addr = address;
#if HAVE_SOCKADDR_IN_SIN_LEN
v4.sin_len = sizeof (v4);
#endif
@@ -634,6 +693,7 @@ run (void *cls,
memset (&v6, 0, sizeof (v6));
v6.sin6_family = AF_INET6;
+ v6.sin6_addr = address6;
#if HAVE_SOCKADDR_IN_SIN_LEN
v6.sin6_len = sizeof (v6);
#endif
diff --git a/src/gns/gnunet-gns-proxy-setup-ca.in b/src/gns/gnunet-gns-proxy-setup-ca.in
index 0a6fab18a..184da4853 100644
--- a/src/gns/gnunet-gns-proxy-setup-ca.in
+++ b/src/gns/gnunet-gns-proxy-setup-ca.in
@@ -1,78 +1,252 @@
#!/bin/sh
-# This shell script will generate an X509 certificate for your gnunet-gns-proxy
-# and install it (for both GNUnet and your browser).
#
+# This shell script will generate an X509 certificate for
+# your gnunet-gns-proxy and install it (for both GNUnet
+# and your browser).
+#
+# TODO: Implement support for more browsers
+# TODO: Debug and switch to the new version
+# TODO - The only remaining task is fixing the getopts
+# TODO: Error checks
+#
+# The current version partially reuses and recycles
+# code from build.sh by NetBSD (although not entirely
+# used because it needs debugging):
+#
+# Copyright (c) 2001-2011 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to
+# The NetBSD Foundation by Todd Vierling and Luke Mewburn.
+
+# Redistribution and use in source and binary forms, with or
+# without modification, are permitted provided that the following
+# conditions are met:
+# 1. Redistributions of source code must retain the above
+# copyright notice, this list of conditions and the following
+# disclaimer.
+# 2. Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following
+# disclaimer in the documentation and/or other materials
+# provided with the distribution.
-OPENSSLCFG=@pkgdatadir@/openssl.cnf
-if ! which openssl > /dev/null
-then
- echo "'openssl' command not found. Please install it."
- exit 1
-fi
-
-echo "Generating CA"
-options=''
-while getopts "c:" opt; do
- case $opt in
- c)
- options="$options -c $OPTARG"
- ;;
- \?)
- echo "Invalid option: -$OPTARG" >&2
- exit 1
- ;;
- :)
- echo "Option -$OPTARG requires an argument." >&2
- exit 1
- ;;
- esac
-done
-
-GNSCERT=`mktemp /tmp/gnscertXXXXXX.pem`
-GNSCAKY=`mktemp /tmp/gnscakeyXXXXXX.pem`
-GNSCANO=`mktemp /tmp/gnscakeynoencXXXXXX.pem`
-GNS_CA_CERT_PEM=`gnunet-config -s gns-proxy -o PROXY_CACERT -f $options`
-mkdir -p `dirname $GNS_CA_CERT_PEM`
-
-openssl req -config $OPENSSLCFG -new -x509 -days 3650 -extensions v3_ca -keyout $GNSCAKY -out $GNSCERT -subj "/C=ZZ/L=World/O=GNU/OU=GNUnet/CN=GNS Proxy CA/emailAddress=bounce@gnunet.org" -passout pass:"GNU Name System"
-
-echo "Removing passphrase from key"
-openssl rsa -passin pass:"GNU Name System" -in $GNSCAKY -out $GNSCANO
-
-echo "Making private key available to gnunet-gns-proxy"
-cat $GNSCERT $GNSCANO > $GNS_CA_CERT_PEM
-
-if ! which certutil > /dev/null
-then
- echo "The 'certutil' command was not found. Not importing into browsers."
- echo "For 'certutil' install nss."
-else
- echo "Importing CA into browsers"
- for f in ~/.mozilla/firefox/*.*/
- do
- if [ -d $f ]; then
- echo "Importing CA info Firefox at $f"
- # delete old certificate (if any)
- certutil -D -n "GNS Proxy CA" -d "$f" >/dev/null 2>/dev/null
- # add new certificate
- certutil -A -n "GNS Proxy CA" -t CT,, -d "$f" < $GNSCERT
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
+# CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED.
+# IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR
+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
+# OF SUCH DAMAGE.
+
+progname=${0##*/}
+
+setdefaults()
+{
+ verbosity=0
+ runcmd=
+}
+
+statusmsg()
+{
+ ${runcmd} echo " $@"
+}
+
+infomsg()
+{
+ if [ $verbosity = 1 ]; then
+ statusmsg "INFO: $@"
fi
- done
-
- if [ -d ~/.pki/nssdb/ ]; then
- echo "Importing CA into Chrome at ~/.pki/nssdb/"
- # delete old certificate (if any)
- certutil -D -n "GNS Proxy CA" -d ~/.pki/nssdb/ >/dev/null 2>/dev/null
- # add new certificate
- certutil -A -n "GNS Proxy CA" -t CT,, -d ~/.pki/nssdb/ < $GNSCERT
- fi
-fi
-
-echo "Cleaning up."
-rm -f $GNSCAKY $GNSCANO $GNSCERT
-
-echo "==================================="
-echo "You can now start gnunet-gns-proxy."
-echo "Afterwards, configure your browser "
-echo " to use a SOCKS proxy on port 7777."
-echo "==================================="
+}
+
+warningmsg()
+{
+ statusmsg "WARNING: $@"
+}
+
+errormsg()
+{
+ statusmsg "ERROR: $@"
+}
+
+linemsg()
+{
+ statusmsg "========================================="
+}
+
+
+usage()
+{
+ if [ -n "$*" ]; then
+ echo ""
+ echo "${progname}: $*"
+ fi
+ cat <<_usage_
+
+Usage: ${progname} [-hv] [-c FILE] [...]
+
+Options:
+ -c FILE Use the configuration file FILE.
+ -h Print this help message.
+ -v Print the version and exit.
+ -V be verbose
+
+_usage_
+ exit 1
+}
+
+
+generate_ca()
+{
+ echo ""
+ infomsg "Generating CA"
+ TMPDIR=${TMPDIR:-/tmp}
+ if [ -e "$TMPDIR" ]; then
+ GNSCERT=`mktemp -t certXXXXXXXX.pem` || exit 1
+ GNSCAKY=`mktemp -t cakyXXXXXXXX.pem` || exit 1
+ GNSCANO=`mktemp -t canoXXXXXXXX.pem` || exit 1
+ else
+ # This warning is mostly pointless.
+ warning "You need to export the TMPDIR variable"
+ fi
+
+ # # ------------- gnutls
+ #
+ # if ! which certutil > /dev/null
+ # then
+ # warningmsg "The 'certutil' command was not found."
+ # warningmsg "Not importing into browsers."
+ # warningmsg "For 'certutil' install nss."
+ # else
+ # # Generate CA key
+ # # pkcs#8 password-protects key
+ # certtool --pkcs8 --generate-privkey --sec-param high --outfile ca-key.pem
+ # # self-sign the CA to create public certificate
+ # certtool --generate-self-signed --load-privkey ca-key.pem --template ca.cfg --outfile ca.pem
+
+ # ------------- openssl
+
+ OPENSSLCFG=@pkgdatadir@/openssl.cnf
+ if test -z "`openssl version`" > /dev/null
+ then
+ warningmsg "'openssl' command not found. Please install it."
+ infomsg "Cleaning up."
+ rm -f $GNSCAKY $GNSCANO $GNSCERT
+ exit 1
+ fi
+ if [ -n "${GNUNET_CONFIG_FILE}" ]; then
+ GNUNET_CONFIG="-c ${GNUNET_CONFIG_FILE}"
+ else
+ GNUNET_CONFIG=""
+ fi
+ GNS_CA_CERT_PEM=`gnunet-config ${GNUNET_CONFIG} -s gns-proxy -o PROXY_CACERT -f ${options}`
+ mkdir -p `dirname $GNS_CA_CERT_PEM`
+
+ openssl req -config $OPENSSLCFG -new -x509 -days 3650 -extensions v3_ca -keyout $GNSCAKY -out $GNSCERT -subj "/C=ZZ/L=World/O=GNU/OU=GNUnet/CN=GNS Proxy CA/emailAddress=bounce@gnunet.org" -passout pass:"GNU Name System"
+
+ infomsg "Removing passphrase from key"
+ openssl rsa -passin pass:"GNU Name System" -in $GNSCAKY -out $GNSCANO
+
+ infomsg "Making private key available to gnunet-gns-proxy"
+ cat $GNSCERT $GNSCANO > $GNS_CA_CERT_PEM
+}
+
+importbrowsers()
+{
+ # Don't check with -H, -H defies any method to not
+ # print the output on screen! Let's hope that every
+ # certutil gets build with some kind of build flags
+ # which end up being printed here:
+ if test -z "`certutil --build-flags`" > /dev/null 2>&1
+ then
+ warningmsg "The 'certutil' command was not found."
+ warningmsg "Not importing into browsers."
+ warningmsg "For 'certutil' install nss."
+ else
+ infomsg "Importing CA into browsers"
+ # TODO: Error handling?
+ for f in ~/.mozilla/firefox/*.*/
+ do
+ if [ -d $f ]; then
+ infomsg "Importing CA into Firefox at $f"
+ # delete old certificate (if any)
+ certutil -D -n "GNS Proxy CA" -d "$f" >/dev/null 2>/dev/null
+ # add new certificate
+ certutil -A -n "GNS Proxy CA" -t CT,, -d "$f" < $GNSCERT
+ fi
+ done
+ # TODO: Error handling?
+ if [ -d ~/.pki/nssdb/ ]; then
+ infomsg "Importing CA into Chrome at ~/.pki/nssdb/"
+ # delete old certificate (if any)
+ certutil -D -n "GNS Proxy CA" -d ~/.pki/nssdb/ >/dev/null 2>/dev/null
+ # add new certificate
+ certutil -A -n "GNS Proxy CA" -t CT,, -d ~/.pki/nssdb/ < $GNSCERT
+ fi
+ fi
+}
+
+print_version()
+{
+ GNUNET_ARM_VERSION=`gnunet-arm -v`
+ echo $GNUNET_ARM_VERSION
+}
+
+clean_up()
+{
+ infomsg "Cleaning up."
+ rm -f $GNSCAKY $GNSCANO $GNSCERT
+ if [ -e $SETUP_TMPDIR ]; then
+ rm -rf $SETUP_TMPDIR
+ fi
+
+ linemsg
+ statusmsg "You can now start gnunet-gns-proxy."
+ statusmsg "Afterwards, configure your browser "
+ statusmsg "to use a SOCKS proxy on port 7777. "
+ linemsg
+}
+
+main()
+{
+ while getopts "vhVc:" opt; do
+ case $opt in
+ v)
+ print_version
+ exit 0
+ ;;
+ h)
+ usage
+ ;;
+ V)
+ verbosity=1
+ ;;
+ c)
+ options="$options -c $OPTARG"
+ infomsg "Using configuration file $OPTARG"
+ GNUNET_CONFIG_FILE=${OPTARG}
+ ;;
+ \?)
+ echo "Invalid option: -$OPTARG" >&2
+ usage
+ ;;
+ :)
+ echo "Option -$OPTARG requires an argument." >&2
+ usage
+ ;;
+ esac
+ done
+ setdefaults
+ generate_ca
+ importbrowsers
+ clean_up
+}
+
+main "$@"
diff --git a/src/gns/gnunet-gns-proxy.c b/src/gns/gnunet-gns-proxy.c
index 65a7b6018..bae222499 100644
--- a/src/gns/gnunet-gns-proxy.c
+++ b/src/gns/gnunet-gns-proxy.c
@@ -661,6 +661,15 @@ struct Socks5Request
/* *********************** Globals **************************** */
+/**
+ * The address to bind to
+ */
+static in_addr_t address;
+
+/**
+ * The IPv6 address to bind to
+ */
+static struct in6_addr address6;
/**
* The port the proxy is running on (default 7777)
@@ -2182,7 +2191,7 @@ create_response (void *cls,
}
MHD_get_connection_values (con,
MHD_HEADER_KIND,
- &con_val_iter,
+ (MHD_KeyValueIterator) &con_val_iter,
s5r);
curl_easy_setopt (s5r->curl,
CURLOPT_HTTPHEADER,
@@ -3516,6 +3525,7 @@ bind_v4 ()
memset (&sa4, 0, sizeof (sa4));
sa4.sin_family = AF_INET;
sa4.sin_port = htons (port);
+ sa4.sin_addr.s_addr = address;
#if HAVE_SOCKADDR_IN_SIN_LEN
sa4.sin_len = sizeof (sa4);
#endif
@@ -3553,6 +3563,7 @@ bind_v6 ()
memset (&sa6, 0, sizeof (sa6));
sa6.sin6_family = AF_INET6;
sa6.sin6_port = htons (port);
+ sa6.sin6_addr = address6;
#if HAVE_SOCKADDR_IN_SIN_LEN
sa6.sin6_len = sizeof (sa6);
#endif
@@ -3591,10 +3602,56 @@ run (void *cls,
{
char* cafile_cfg = NULL;
char* cafile;
+ char* addr_str;
struct MhdHttpList *hd;
cfg = c;
+ /* Get address to bind to */
+ if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (cfg, "gns-proxy",
+ "BIND_TO",
+ &addr_str))
+ {
+ //No address specified
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Don't know what to bind to...\n");
+ GNUNET_free (addr_str);
+ GNUNET_SCHEDULER_shutdown ();
+ return;
+ }
+ if (1 != inet_pton (AF_INET, addr_str, &address))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Unable to parse address %s\n",
+ addr_str);
+ GNUNET_free (addr_str);
+ GNUNET_SCHEDULER_shutdown ();
+ return;
+ }
+ GNUNET_free (addr_str);
+ /* Get address to bind to */
+ if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (cfg, "gns-proxy",
+ "BIND_TO6",
+ &addr_str))
+ {
+ //No address specified
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Don't know what to bind6 to...\n");
+ GNUNET_free (addr_str);
+ GNUNET_SCHEDULER_shutdown ();
+ return;
+ }
+ if (1 != inet_pton (AF_INET6, addr_str, &address6))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Unable to parse IPv6 address %s\n",
+ addr_str);
+ GNUNET_free (addr_str);
+ GNUNET_SCHEDULER_shutdown ();
+ return;
+ }
+ GNUNET_free (addr_str);
+
if (NULL == (curl_multi = curl_multi_init ()))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
diff --git a/src/rest-plugins/plugin_rest_gns.c b/src/gns/plugin_rest_gns.c
index e41df4085..e41df4085 100644
--- a/src/rest-plugins/plugin_rest_gns.c
+++ b/src/gns/plugin_rest_gns.c
diff --git a/src/gns/test_gns_at_lookup.sh b/src/gns/test_gns_at_lookup.sh
index d900c070b..bacc63eb0 100755
--- a/src/gns/test_gns_at_lookup.sh
+++ b/src/gns/test_gns_at_lookup.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# This file is in the public domain.
trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT
@@ -14,7 +14,7 @@ then
exit 77
fi
-which timeout &> /dev/null && DO_TIMEOUT="timeout 5"
+which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 5"
rm -rf `gnunet-config -c test_gns_lookup.conf -f -s paths -o GNUNET_TEST_HOME`
TEST_IP="127.0.0.1"
@@ -31,7 +31,7 @@ gnunet-namestore -z delegatedego -d -n '@' -t A -V $TEST_IP -e never -c test_gn
gnunet-arm -e -c test_gns_lookup.conf
rm -rf `gnunet-config -c test_gns_lookup.conf -f -s paths -o GNUNET_TEST_HOME`
-if [ "$RES_IP" == "$TEST_IP" ]
+if [ "$RES_IP" = "$TEST_IP" ]
then
exit 0
else
diff --git a/src/gns/test_gns_cname_lookup.sh b/src/gns/test_gns_cname_lookup.sh
index de575c561..d97a4fe5e 100755
--- a/src/gns/test_gns_cname_lookup.sh
+++ b/src/gns/test_gns_cname_lookup.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# This file is in the public domain.
trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT
@@ -16,7 +16,7 @@ fi
# permissive DNS resolver we will use for the test
DNS_RESOLVER="8.8.8.8"
-if ! nslookup gnunet.org $DNS_RESOLVER &> /dev/null
+if ! nslookup gnunet.org $DNS_RESOLVER > /dev/null 2>&1
then
echo "Cannot reach DNS, skipping test"
exit 77
@@ -36,7 +36,7 @@ TEST_RECORD_NAME_DNS="www3"
MY_EGO="myego"
TEST_DOMAIN_PLUS="www.$MY_EGO"
TEST_DOMAIN_DNS="www3.$MY_EGO"
-which timeout &> /dev/null && DO_TIMEOUT="timeout 15"
+which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 15"
gnunet-arm -s -c test_gns_lookup.conf
gnunet-identity -C $MY_EGO -c test_gns_lookup.conf
@@ -57,7 +57,7 @@ rm -rf `gnunet-config -c test_gns_lookup.conf -f -s paths -o GNUNET_TEST_HOME`
# make cmp case-insensitive by converting to lower case first
RES_CNAME_RAW=`echo $RES_CNAME_RAW | tr [A-Z] [a-z]`
TESTEGOZONE=`echo $TESTEGOZONE | tr [A-Z] [a-z]`
-if [ "$RES_CNAME_RAW" == "server.$TESTEGOZONE" ]
+if [ "$RES_CNAME_RAW" = "server.$TESTEGOZONE" ]
then
echo "PASS: CNAME resolution from GNS"
else
@@ -65,7 +65,7 @@ else
exit 1
fi
-if [ "$RES_CNAME" == "$TEST_IP_PLUS" ]
+if [ "$RES_CNAME" = "$TEST_IP_PLUS" ]
then
echo "PASS: IP resolution from GNS"
else
@@ -73,7 +73,7 @@ else
exit 1
fi
-if [ "$RES_CNAME_DNS" == "$TEST_IP_DNS" ]
+if [ "$RES_CNAME_DNS" = "$TEST_IP_DNS" ]
then
echo "PASS: IP resolution from DNS"
exit 0
diff --git a/src/gns/test_gns_config_lookup.sh b/src/gns/test_gns_config_lookup.sh
index 35d7c32d9..1c5a62b01 100755
--- a/src/gns/test_gns_config_lookup.sh
+++ b/src/gns/test_gns_config_lookup.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# This file is in the public domain.
trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT
@@ -18,7 +18,7 @@ MY_EGO="myego"
rm -rf `gnunet-config -c test_gns_lookup.conf -s PATHS -o GNUNET_HOME -f`
CFG=`mktemp --tmpdir=$PWD`
cp test_gns_lookup.conf $CFG || exit 77
-which timeout &> /dev/null && DO_TIMEOUT="timeout 5"
+which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 5"
TEST_IP="dead::beef"
gnunet-arm -s -c $CFG || exit 77
gnunet-identity -C $MY_EGO -c $CFG
@@ -35,7 +35,7 @@ gnunet-arm -e -c $CFG
rm -rf `gnunet-config -c $CFG -f -s paths -o GNUNET_TEST_HOME`
rm $CFG
-if [ "$RES_IP" == "$TEST_IP" ]
+if [ "$RES_IP" = "$TEST_IP" ]
then
exit 0
else
diff --git a/src/gns/test_gns_delegated_lookup.sh b/src/gns/test_gns_delegated_lookup.sh
index 21774ad8d..af9994b34 100755
--- a/src/gns/test_gns_delegated_lookup.sh
+++ b/src/gns/test_gns_delegated_lookup.sh
@@ -1,7 +1,7 @@
-#!/bin/bash
+#!/bin/sh
# This file is in the public domain.
trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT
-which timeout &> /dev/null && DO_TIMEOUT="timeout 30"
+which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 30"
LOCATION=$(which gnunet-config)
if [ -z $LOCATION ]
@@ -35,7 +35,7 @@ gnunet-arm -e -c test_gns_lookup.conf
rm -rf `gnunet-config -c test_gns_lookup.conf -f -s paths -o GNUNET_TEST_HOME`
-if [ "$RES_IP" == "$TEST_IP" ]
+if [ "$RES_IP" = "$TEST_IP" ]
then
exit 0
else
diff --git a/src/gns/test_gns_dht_lookup.sh b/src/gns/test_gns_dht_lookup.sh
index 07e559752..ac90d58a8 100755
--- a/src/gns/test_gns_dht_lookup.sh
+++ b/src/gns/test_gns_dht_lookup.sh
@@ -1,7 +1,7 @@
-#!/bin/bash
+#!/bin/sh
# This file is in the public domain.
trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT
-which timeout &> /dev/null && DO_TIMEOUT="timeout 30"
+which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 30"
LOCATION=$(which gnunet-config)
if [ -z $LOCATION ]
@@ -55,7 +55,7 @@ then
echo "Failed to resolve to proper IP, got $RES_IP_REL. (relative expiration)"
#exit 1
fi
-if [ "$RES_IP" == "$TEST_IP" ]
+if [ "$RES_IP" = "$TEST_IP" ]
then
exit 0
else
diff --git a/src/gns/test_gns_gns2dns_cname_lookup.sh b/src/gns/test_gns_gns2dns_cname_lookup.sh
index c07905d83..fbc1dd7ee 100755
--- a/src/gns/test_gns_gns2dns_cname_lookup.sh
+++ b/src/gns/test_gns_gns2dns_cname_lookup.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# This file is in the public domain.
trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT
@@ -25,7 +25,7 @@ TEST_RECORD_NAME="homepage"
XNS=ns.joker.com
-if ! nslookup gnunet.org a.$XNS &> /dev/null
+if ! nslookup gnunet.org a.$XNS > /dev/null 2>&1
then
echo "Cannot reach DNS, skipping test"
exit 77
@@ -43,7 +43,7 @@ MY_EGO="myego"
# various names we will use for resolution
TEST_DOMAIN="www.${TEST_RECORD_NAME}.$MY_EGO"
-which timeout &> /dev/null && DO_TIMEOUT="timeout 15"
+which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 15"
gnunet-arm -s -c test_gns_lookup.conf
OUT=`$DO_TIMEOUT gnunet-resolver -c test_gns_lookup.conf gnunet.org`
@@ -77,7 +77,7 @@ gnunet-arm -e -c test_gns_lookup.conf
rm -rf `gnunet-config -c test_gns_lookup.conf -f -s paths -o GNUNET_TEST_HOME`
ret=0
-if [ "$RES_IP" == "$TEST_IP" ]
+if [ "$RES_IP" = "$TEST_IP" ]
then
echo "PASS: Resolved $TEST_DOMAIN to $RES_IP."
else
@@ -85,7 +85,7 @@ else
ret=1
fi
-if [ "$RES_IP6" == "$TEST_IP6" ]
+if [ "$RES_IP6" = "$TEST_IP6" ]
then
echo "PASS: Resolved $TEST_DOMAIN to $RES_IP6."
else
diff --git a/src/gns/test_gns_gns2dns_lookup.sh b/src/gns/test_gns_gns2dns_lookup.sh
index 24fb36b9d..22caa68ff 100755
--- a/src/gns/test_gns_gns2dns_lookup.sh
+++ b/src/gns/test_gns_gns2dns_lookup.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT
LOCATION=$(which gnunet-config)
@@ -26,7 +26,7 @@ TEST_IP_GNS2DNS="8.8.8.8"
# main label used during resolution
TEST_RECORD_NAME="homepage"
-if ! nslookup gnunet.org $TEST_IP_GNS2DNS &> /dev/null
+if ! nslookup gnunet.org $TEST_IP_GNS2DNS > /dev/null 2>&1
then
echo "Cannot reach DNS, skipping test"
exit 77
@@ -44,7 +44,7 @@ TEST_DOMAIN="www.${TEST_RECORD_NAME}.$MY_EGO"
TEST_DOMAIN_ALT="${TEST_RECORD_NAME}.$MY_EGO"
TEST_DOMAIN_ALT2="docs.${TEST_RECORD_NAME}.$MY_EGO"
-which timeout &> /dev/null && DO_TIMEOUT="timeout 15"
+which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 15"
gnunet-arm -s -c test_gns_lookup.conf
@@ -83,7 +83,7 @@ gnunet-arm -e -c test_gns_lookup.conf
rm -rf `gnunet-config -c test_gns_lookup.conf -f -s paths -o GNUNET_TEST_HOME`
ret=0
-if [ "$RES_IP" == "$TEST_IP" ]
+if [ "$RES_IP" = "$TEST_IP" ]
then
echo "PASS: Resolved $TEST_DOMAIN to $RES_IP."
else
@@ -91,7 +91,7 @@ else
ret=1
fi
-if [ "$RES_IP6" == "$TEST_IP6" ]
+if [ "$RES_IP6" = "$TEST_IP6" ]
then
echo "PASS: Resolved $TEST_DOMAIN to $RES_IP6."
else
@@ -99,7 +99,7 @@ else
ret=1
fi
-if [ "$RES_IP_ALT" == "$TEST_IP" ]
+if [ "$RES_IP_ALT" = "$TEST_IP" ]
then
echo "PASS: Resolved $TEST_DOMAIN_ALT to $RES_IP_ALT."
else
@@ -107,7 +107,7 @@ else
ret=1
fi
-if [ "$RES_IP_ALT2" == "$TEST_IP_ALT2" ]
+if [ "$RES_IP_ALT2" = "$TEST_IP_ALT2" ]
then
echo "PASS: Resolved $TEST_DOMAIN_ALT2 to $RES_IP_ALT2."
else
diff --git a/src/gns/test_gns_ipv6_lookup.sh b/src/gns/test_gns_ipv6_lookup.sh
index 72da5ee2c..5dbb34a2c 100755
--- a/src/gns/test_gns_ipv6_lookup.sh
+++ b/src/gns/test_gns_ipv6_lookup.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# This file is in the public domain.
trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT
@@ -16,7 +16,7 @@ fi
MY_EGO="myego"
rm -rf `gnunet-config -c test_gns_lookup.conf -s PATHS -o GNUNET_HOME -f`
-which timeout &> /dev/null && DO_TIMEOUT="timeout 30"
+which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 30"
TEST_IP="dead::beef"
gnunet-arm -s -c test_gns_lookup.conf
gnunet-identity -C $MY_EGO -c test_gns_lookup.conf
@@ -27,7 +27,7 @@ gnunet-identity -D $MY_EGO -c test_gns_lookup.conf
gnunet-arm -e -c test_gns_lookup.conf
rm -rf `gnunet-config -c test_gns_lookup.conf -f -s paths -o GNUNET_TEST_HOME`
-if [ "$RES_IP" == "$TEST_IP" ]
+if [ "$RES_IP" = "$TEST_IP" ]
then
exit 0
else
diff --git a/src/gns/test_gns_lookup.sh b/src/gns/test_gns_lookup.sh
index 2dffa1251..4bd6ae879 100755
--- a/src/gns/test_gns_lookup.sh
+++ b/src/gns/test_gns_lookup.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# This file is in the public domain.
trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT
@@ -15,7 +15,7 @@ then
fi
rm -rf `gnunet-config -c test_gns_lookup.conf -s PATHS -o GNUNET_HOME -f`
-which timeout &> /dev/null && DO_TIMEOUT="timeout 30"
+which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 30"
TEST_IP="127.0.0.1"
MY_EGO="myego"
LABEL="www"
@@ -27,7 +27,7 @@ gnunet-namestore -z $MY_EGO -d -n $LABEL -t A -V $TEST_IP -e never -c test_gns_l
gnunet-identity -D $MY_EGO -c test_gns_lookup.conf
gnunet-arm -e -c test_gns_lookup.conf
-if [ "$RES_IP" == "$TEST_IP" ]
+if [ "$RES_IP" = "$TEST_IP" ]
then
exit 0
else
diff --git a/src/gns/test_gns_mx_lookup.sh b/src/gns/test_gns_mx_lookup.sh
index 79ac37b0a..4e9d98358 100755
--- a/src/gns/test_gns_mx_lookup.sh
+++ b/src/gns/test_gns_mx_lookup.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# This file is in the public domain.
trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT
@@ -15,7 +15,7 @@ then
fi
rm -rf `gnunet-config -c test_gns_lookup.conf -f -s paths -o GNUNET_TEST_HOME`
-which timeout &> /dev/null && DO_TIMEOUT="timeout 5"
+which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 5"
MY_EGO="myego"
TEST_MX="5,mail.+"
@@ -35,7 +35,7 @@ rm -rf `gnunet-config -c test_gns_lookup.conf -f -s paths -o GNUNET_TEST_HOME`
RES_MX=`echo $RES_MX | tr [A-Z] [a-z]`
WANT_MX=`echo $WANT_MX | tr [A-Z] [a-z]`
-if [ "$RES_MX" == "$WANT_MX" ]
+if [ "$RES_MX" = "$WANT_MX" ]
then
exit 0
else
diff --git a/src/gns/test_gns_proxy.c b/src/gns/test_gns_proxy.c
index 75fe95617..2a7f8104b 100644
--- a/src/gns/test_gns_proxy.c
+++ b/src/gns/test_gns_proxy.c
@@ -11,7 +11,7 @@
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/>.
@@ -50,9 +50,9 @@ static int global_ret;
static struct MHD_Daemon *mhd;
-static struct GNUNET_SCHEDULER_Task * mhd_task_id;
+static struct GNUNET_SCHEDULER_Task *mhd_task_id;
-static struct GNUNET_SCHEDULER_Task * curl_task_id;
+static struct GNUNET_SCHEDULER_Task *curl_task_id;
static CURL *curl;
@@ -349,6 +349,7 @@ curl_main ()
static void
start_curl (void *cls)
{
+ curl_task_id = NULL;
GNUNET_asprintf (&url,
"https://%s:%d/hello_world",
TEST_DOMAIN, port);
@@ -369,7 +370,9 @@ start_curl (void *cls)
multi = curl_multi_init ();
GNUNET_assert (multi != NULL);
GNUNET_assert (CURLM_OK == curl_multi_add_handle (multi, curl));
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Beginning HTTP download from `%s'\n", url);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Beginning HTTP download from `%s'\n",
+ url);
curl_main ();
}
@@ -391,7 +394,8 @@ commence_testing (void *cls)
{
curl_task_id =
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
- &start_curl, NULL);
+ &start_curl,
+ NULL);
}
@@ -561,4 +565,4 @@ main (int argc, char *const *argv)
return global_ret;
}
-/* end of test_gns_vpn.c */
+/* end of test_gns_proxy.c */
diff --git a/src/gns/test_gns_quickupdate.sh b/src/gns/test_gns_quickupdate.sh
index d9807fe22..d2b4bf2cb 100755
--- a/src/gns/test_gns_quickupdate.sh
+++ b/src/gns/test_gns_quickupdate.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# This file is in the public domain.
trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT
@@ -19,7 +19,7 @@ OTHER_EGO="delegatedego"
rm -rf `gnunet-config -c test_gns_lookup.conf -f -s paths -o GNUNET_TEST_HOME`
-which timeout &> /dev/null && DO_TIMEOUT="timeout 5"
+which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 5"
TEST_IP="127.0.0.1"
gnunet-arm -s -c test_gns_lookup.conf
gnunet-identity -C $MY_EGO -c test_gns_lookup.conf
@@ -56,7 +56,7 @@ gnunet-identity -D $OTHER_EGO -c test_gns_lookup.conf
gnunet-arm -e -c test_gns_lookup.conf
rm -rf `gnunet-config -c test_gns_lookup.conf -f -s paths -o GNUNET_TEST_HOME`
-if [ "$RES_IP" == "$TEST_IP" ]
+if [ "$RES_IP" = "$TEST_IP" ]
then
exit 0
else
diff --git a/src/gns/test_gns_rel_expiration.sh b/src/gns/test_gns_rel_expiration.sh
index c7c66bc27..993c2131e 100755
--- a/src/gns/test_gns_rel_expiration.sh
+++ b/src/gns/test_gns_rel_expiration.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# This file is in the public domain.
trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT
@@ -25,7 +25,7 @@ MY_EGO="myego"
OTHER_EGO="delegatedego"
rm -rf `gnunet-config -c test_gns_lookup.conf -f -s paths -o GNUNET_TEST_HOME`
-which timeout &> /dev/null && DO_TIMEOUT="timeout 5"
+which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 5"
TEST_IP="127.0.0.1"
gnunet-arm -s -c test_gns_lookup.conf
gnunet-identity -C $MY_EGO -c test_gns_lookup.conf
@@ -48,13 +48,13 @@ gnunet-identity -D $OTHER_EGO -c test_gns_lookup.conf
gnunet-arm -e -c test_gns_lookup.conf
rm -rf `gnunet-config -c test_gns_lookup.conf -f -s paths -o GNUNET_TEST_HOME`
-if [ "$RES_IP_EXP" == "$TEST_IP" ]
+if [ "$RES_IP_EXP" = "$TEST_IP" ]
then
echo "Failed to properly expire IP, got $RES_IP_EXP."
exit 1
fi
-if [ "$RES_IP" == "$TEST_IP" ]
+if [ "$RES_IP" = "$TEST_IP" ]
then
exit 0
else
diff --git a/src/gns/test_gns_revocation.sh b/src/gns/test_gns_revocation.sh
index 08a0f8ac1..3c0cf02fb 100755
--- a/src/gns/test_gns_revocation.sh
+++ b/src/gns/test_gns_revocation.sh
@@ -1,7 +1,7 @@
-#!/bin/bash
+#!/bin/sh
# This file is in the public domain.
trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT
-which timeout &> /dev/null && DO_TIMEOUT="timeout 5"
+which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 5"
LOCATION=$(which gnunet-config)
if [ -z $LOCATION ]
@@ -40,7 +40,7 @@ then
exit 1
fi
-if [ "x$RES_IP_REV" == "x" ]
+if [ "x$RES_IP_REV" = "x" ]
then
exit 0
else
diff --git a/src/gns/test_gns_soa_lookup.sh b/src/gns/test_gns_soa_lookup.sh
index 6a09ac8c7..c5b049b72 100755
--- a/src/gns/test_gns_soa_lookup.sh
+++ b/src/gns/test_gns_soa_lookup.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# This file is in the public domain.
trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT
@@ -14,7 +14,7 @@ then
exit 77
fi
-which timeout &> /dev/null && DO_TIMEOUT="timeout 5"
+which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 5"
rm -rf `gnunet-config -c test_gns_lookup.conf -f -s paths -o GNUNET_TEST_HOME`
MY_EGO="myego"
@@ -24,7 +24,7 @@ TEST_IP_GNS2DNS="184.172.157.218"
TEST_RECORD_NAME="homepage"
TEST_RECORD_GNS2DNS="gnunet.org"
-if ! nslookup $TEST_RECORD_GNS2DNS $TEST_IP_GNS2DNS &> /dev/null
+if ! nslookup $TEST_RECORD_GNS2DNS $TEST_IP_GNS2DNS > /dev/null 2>&1
then
echo "Cannot reach DNS, skipping test"
exit 77
@@ -34,7 +34,7 @@ gnunet-arm -s -c test_gns_lookup.conf
gnunet-identity -C $MY_EGO -c test_gns_lookup.conf
gnunet-namestore -p -z $MY_EGO -a -n $TEST_RECORD_NAME -t GNS2DNS -V ${TEST_RECORD_GNS2DNS}@${TEST_IP_GNS2DNS} -e never -c test_gns_lookup.conf
RES_SOA=`$DO_TIMEOUT gnunet-gns --raw -u $TEST_DOMAIN -t SOA -c test_gns_lookup.conf`
-gnunet-namestore -z $MY_EGO -d -n $TEST_RECORD_NAME -t GNS2DNS -V ${TEST_RECORD_GNS2DNS}@${TEST_IP_GNS2DNS} -e never -c test_gns_lookup.conf &> /dev/null
+gnunet-namestore -z $MY_EGO -d -n $TEST_RECORD_NAME -t GNS2DNS -V ${TEST_RECORD_GNS2DNS}@${TEST_IP_GNS2DNS} -e never -c test_gns_lookup.conf > /dev/null 2>&1
gnunet-identity -D $MY_EGO -c test_gns_lookup.conf
gnunet-arm -e -c test_gns_lookup.conf
rm -rf `gnunet-config -c test_gns_lookup.conf -f -s paths -o GNUNET_TEST_HOME`
diff --git a/src/gns/test_gns_txt_lookup.sh b/src/gns/test_gns_txt_lookup.sh
index 6c6b4b3f6..b0c9144c2 100755
--- a/src/gns/test_gns_txt_lookup.sh
+++ b/src/gns/test_gns_txt_lookup.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# This file is in the public domain.
trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT
@@ -15,7 +15,7 @@ then
fi
rm -rf `gnunet-config -c test_gns_lookup.conf -f -s paths -o GNUNET_TEST_HOME`
-which timeout &> /dev/null && DO_TIMEOUT="timeout 30"
+which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 30"
TEST_TXT="GNS powered txt record data"
MY_EGO="myego"
LABEL="testtxt"
@@ -28,7 +28,7 @@ gnunet-identity -D $MY_EGO -c test_gns_lookup.conf
gnunet-arm -e -c test_gns_lookup.conf
rm -rf `gnunet-config -c test_gns_lookup.conf -f -s paths -o GNUNET_TEST_HOME`
-if [ "$RES_TXT" == "$TEST_TXT" ]
+if [ "$RES_TXT" = "$TEST_TXT" ]
then
exit 0
else
diff --git a/src/gns/test_gns_zkey_lookup.sh b/src/gns/test_gns_zkey_lookup.sh
index b36a16fa2..03118d741 100755
--- a/src/gns/test_gns_zkey_lookup.sh
+++ b/src/gns/test_gns_zkey_lookup.sh
@@ -1,7 +1,7 @@
-#!/bin/bash
+#!/bin/sh
# This file is in the public domain.
trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT
-which timeout &> /dev/null && DO_TIMEOUT="timeout 5"
+which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 5"
LOCATION=$(which gnunet-config)
if [ -z $LOCATION ]
@@ -30,7 +30,7 @@ gnunet-namestore -z delegatedego -d -n www -t A -V $TEST_IP -e never -c test_gn
gnunet-arm -e -c test_gns_lookup.conf
rm -rf `gnunet-config -c test_gns_lookup.conf -f -s paths -o GNUNET_TEST_HOME`
-if [ "$RES_IP" == "$TEST_IP" ]
+if [ "$RES_IP" = "$TEST_IP" ]
then
exit 0
else
diff --git a/src/gns/test_gnunet_gns.sh b/src/gns/test_gnunet_gns.sh
index f6b4e721a..74c49c537 100755
--- a/src/gns/test_gnunet_gns.sh
+++ b/src/gns/test_gnunet_gns.sh
@@ -1,15 +1,25 @@
-#!/bin/bash
+#!/bin/sh
# This file is in the public domain.
-LOCATION=$(which gnunet-config)
-if [ -z $LOCATION ]
-then
- LOCATION="gnunet-config"
+# test -z being correct was a false assumption here.
+# I have no executable 'fooble', but this will
+# return 1:
+# if test -z "`which fooble`"; then echo 1; fi
+# The command builtin might not work with busybox's ash
+# but this works for now.
+existence()
+{
+ command -v "$1" >/dev/null 2>&1
+}
+
+LOCATION=`existence gnunet-config`
+if test -z $LOCATION; then
+ LOCATION="gnunet-config"
fi
$LOCATION --version
if test $? != 0
then
- echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
- exit 77
+ echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
+ exit 77
fi
trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT
@@ -32,4 +42,5 @@ if [ "$LO" != "Address: 4.5.6.7" ]
then
echo "Fail: $LO"
fi
+# XXX: jobs. a builtin by bash, netbsd sh, maybe leave it be for now.
kill `jobs -p`
diff --git a/src/rest-plugins/test_plugin_rest_gns.sh b/src/gns/test_plugin_rest_gns.sh
index ec495a04b..ec495a04b 100755
--- a/src/rest-plugins/test_plugin_rest_gns.sh
+++ b/src/gns/test_plugin_rest_gns.sh
diff --git a/src/gns/test_proxy.sh b/src/gns/test_proxy.sh
index c960d4df9..7c17cd4c5 100755
--- a/src/gns/test_proxy.sh
+++ b/src/gns/test_proxy.sh
@@ -1,7 +1,9 @@
#!/bin/bash
-
+# This file is in the public domain.
TEST_DOMAIN="www.test"
+# Delete old files before starting test
+rm -rf /tmp/gnunet/test-gnunet-gns-testing/
gnunet-arm -s -c test_gns_proxy.conf
gnunet-gns-proxy-setup-ca -c test_gns_proxy.conf
diff --git a/src/hostlist/hostlist.conf b/src/hostlist/hostlist.conf
index 32e5d8320..6b7a6aac7 100644
--- a/src/hostlist/hostlist.conf
+++ b/src/hostlist/hostlist.conf
@@ -20,7 +20,7 @@ HOSTLISTFILE = $GNUNET_CONFIG_HOME/hostlist/learned.txt
OPTIONS = -b
# Default list of hostlist servers for bootstrapping
-SERVERS = http://v10.gnunet.org/hostlist https://gnunet.io/hostlist
+SERVERS = http://v11.gnunet.org/hostlist https://gnunet.io/hostlist
# http://silent.0xdeadc0de.eu:8080/
# bind hostlist http server to a specific IPv4
diff --git a/src/identity/Makefile.am b/src/identity/Makefile.am
index 1f21fc65d..5c1af8e19 100644
--- a/src/identity/Makefile.am
+++ b/src/identity/Makefile.am
@@ -12,6 +12,12 @@ if USE_COVERAGE
XLIB = -lgcov
endif
+if HAVE_MHD
+if HAVE_JSON
+REST_PLUGIN = libgnunet_plugin_rest_identity.la
+endif
+endif
+
pkgcfgdir= $(pkgdatadir)/config.d/
libexecdir= $(pkglibdir)/libexec/
@@ -20,7 +26,20 @@ pkgcfg_DATA = \
identity.conf
lib_LTLIBRARIES = \
- libgnunetidentity.la
+ libgnunetidentity.la \
+ $(REST_PLUGIN)
+
+
+libgnunet_plugin_rest_identity_la_SOURCES = \
+ plugin_rest_identity.c
+libgnunet_plugin_rest_identity_la_LIBADD = \
+ libgnunetidentity.la \
+ $(top_builddir)/src/rest/libgnunetrest.la \
+ $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
+ $(LTLIBINTL) -ljansson -lmicrohttpd
+libgnunet_plugin_rest_identity_la_LDFLAGS = \
+ $(GN_PLUGIN_LDFLAGS)
+
libgnunetidentity_la_SOURCES = \
identity_api.c \
diff --git a/src/rest-plugins/plugin_rest_identity.c b/src/identity/plugin_rest_identity.c
index 3bfca3121..3bfca3121 100644
--- a/src/rest-plugins/plugin_rest_identity.c
+++ b/src/identity/plugin_rest_identity.c
diff --git a/src/rest-plugins/test_plugin_rest_identity.sh b/src/identity/test_plugin_rest_identity.sh
index a5879dd7e..a5879dd7e 100755
--- a/src/rest-plugins/test_plugin_rest_identity.sh
+++ b/src/identity/test_plugin_rest_identity.sh
diff --git a/src/integration-tests/Makefile.am b/src/integration-tests/Makefile.am
index 368980064..26dd4f92d 100644
--- a/src/integration-tests/Makefile.am
+++ b/src/integration-tests/Makefile.am
@@ -20,8 +20,8 @@ check_SCRIPTS = \
test_integration_disconnect.py \
test_integration_disconnect_nat.py \
test_integration_reconnect.py \
- test_integration_reconnect_nat.py \
- test_integration_clique.py
+ test_integration_reconnect_nat.py
+# test_integration_clique.py
endif
diff --git a/src/integration-tests/gnunet_pyexpect.py.in b/src/integration-tests/gnunet_pyexpect.py.in
index 83acb908f..d757634a5 100644
--- a/src/integration-tests/gnunet_pyexpect.py.in
+++ b/src/integration-tests/gnunet_pyexpect.py.in
@@ -18,8 +18,7 @@
# SPDX-License-Identifier: AGPL3.0-or-later
#
# Testcase for gnunet-peerinfo
-from __future__ import print_function
-from builtins import object
+
import os
import re
import subprocess
diff --git a/src/integration-tests/gnunet_testing.py.in b/src/integration-tests/gnunet_testing.py.in
index c9342ecf0..c3596d232 100644
--- a/src/integration-tests/gnunet_testing.py.in
+++ b/src/integration-tests/gnunet_testing.py.in
@@ -18,10 +18,7 @@
# SPDX-License-Identifier: AGPL3.0-or-later
#
# Functions for integration testing
-from __future__ import unicode_literals
-from __future__ import print_function
-from builtins import object
-from builtins import str
+
import os
import subprocess
import sys
diff --git a/src/integration-tests/test_integration_bootstrap_and_connect.py.in b/src/integration-tests/test_integration_bootstrap_and_connect.py.in
index f0de1c0cd..4b4b35629 100755
--- a/src/integration-tests/test_integration_bootstrap_and_connect.py.in
+++ b/src/integration-tests/test_integration_bootstrap_and_connect.py.in
@@ -18,7 +18,7 @@
# SPDX-License-Identifier: AGPL3.0-or-later
#
#
-from __future__ import print_function
+
import signal
import sys
import os
diff --git a/src/integration-tests/test_integration_clique.py.in b/src/integration-tests/test_integration_clique.py.in
index b5d6dd518..0444cf249 100755
--- a/src/integration-tests/test_integration_clique.py.in
+++ b/src/integration-tests/test_integration_clique.py.in
@@ -25,7 +25,6 @@
# Conditions for successful exit:
# Both peers have 2 connected peers in transport, core, topology, fs and dht
-from __future__ import print_function
import sys
import signal
import os
diff --git a/src/integration-tests/test_integration_disconnect.py.in b/src/integration-tests/test_integration_disconnect.py.in
index a81c78540..737014e61 100755
--- a/src/integration-tests/test_integration_disconnect.py.in
+++ b/src/integration-tests/test_integration_disconnect.py.in
@@ -18,7 +18,7 @@
# SPDX-License-Identifier: AGPL3.0-or-later
#
#
-from __future__ import print_function
+
import sys
import signal
import os
diff --git a/src/integration-tests/test_integration_disconnect_nat.py.in b/src/integration-tests/test_integration_disconnect_nat.py.in
index 601586f47..c3d5d8901 100755
--- a/src/integration-tests/test_integration_disconnect_nat.py.in
+++ b/src/integration-tests/test_integration_disconnect_nat.py.in
@@ -18,7 +18,7 @@
# SPDX-License-Identifier: AGPL3.0-or-later
#
#
-from __future__ import print_function
+
import sys
import signal
import os
diff --git a/src/integration-tests/test_integration_reconnect.py.in b/src/integration-tests/test_integration_reconnect.py.in
index e8abacd48..8c4193680 100755
--- a/src/integration-tests/test_integration_reconnect.py.in
+++ b/src/integration-tests/test_integration_reconnect.py.in
@@ -18,7 +18,7 @@
# SPDX-License-Identifier: AGPL3.0-or-later
#
#
-from __future__ import print_function
+
import sys
import os
import subprocess
diff --git a/src/integration-tests/test_integration_reconnect_nat.py.in b/src/integration-tests/test_integration_reconnect_nat.py.in
index 61d2ea966..45626d50d 100755
--- a/src/integration-tests/test_integration_reconnect_nat.py.in
+++ b/src/integration-tests/test_integration_reconnect_nat.py.in
@@ -18,7 +18,7 @@
# SPDX-License-Identifier: AGPL3.0-or-later
#
#
-from __future__ import print_function
+
import sys
import os
import subprocess
diff --git a/src/namestore/Makefile.am b/src/namestore/Makefile.am
index ac4eebd06..25941b4fb 100644
--- a/src/namestore/Makefile.am
+++ b/src/namestore/Makefile.am
@@ -104,10 +104,50 @@ TESTS = \
$(check_SCRIPTS)
endif
+if HAVE_MHD
+if HAVE_JSON
+REST_PLUGIN = libgnunet_plugin_rest_namestore.la
+endif
+endif
+
lib_LTLIBRARIES = \
libgnunetnamestore.la
+libexec_PROGRAMS = \
+ gnunet-service-namestore
+
+bin_PROGRAMS = \
+ gnunet-namestore \
+ gnunet-zoneimport
+
+if HAVE_MHD
+libexec_PROGRAMS += \
+ gnunet-namestore-fcfsd
+endif
+
+
+plugin_LTLIBRARIES = \
+ $(SQLITE_PLUGIN) \
+ $(POSTGRES_PLUGIN) \
+ $(HEAP_PLUGIN) \
+ $(REST_PLUGIN)
+
+
+libgnunet_plugin_rest_namestore_la_SOURCES = \
+ plugin_rest_namestore.c
+libgnunet_plugin_rest_namestore_la_LIBADD = \
+ libgnunetnamestore.la \
+ $(top_builddir)/src/rest/libgnunetrest.la \
+ $(top_builddir)/src/identity/libgnunetidentity.la \
+ $(top_builddir)/src/json/libgnunetjson.la \
+ $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
+ $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
+ $(LTLIBINTL) -ljansson -lmicrohttpd
+libgnunet_plugin_rest_namestore_la_LDFLAGS = \
+ $(GN_PLUGIN_LDFLAGS)
+
+
libgnunetnamestore_la_SOURCES = \
namestore_api.c \
namestore_api_monitor.c \
@@ -121,17 +161,6 @@ libgnunetnamestore_la_LDFLAGS = \
$(GN_LIB_LDFLAGS) $(WINFLAGS) \
-version-info 0:1:0
-libexec_PROGRAMS = \
- gnunet-service-namestore
-
-bin_PROGRAMS = \
- gnunet-namestore \
- gnunet-zoneimport
-
-if HAVE_MHD
-libexec_PROGRAMS += \
- gnunet-namestore-fcfsd
-endif
gnunet_zoneimport_SOURCES = \
@@ -176,12 +205,6 @@ gnunet_service_namestore_LDADD = \
$(GN_LIBINTL)
-plugin_LTLIBRARIES = \
- $(SQLITE_PLUGIN) \
- $(POSTGRES_PLUGIN) \
- $(HEAP_PLUGIN)
-
-
libgnunet_plugin_namestore_heap_la_SOURCES = \
plugin_namestore_heap.c
diff --git a/src/rest-plugins/plugin_rest_namestore.c b/src/namestore/plugin_rest_namestore.c
index 26a037eae..26a037eae 100644
--- a/src/rest-plugins/plugin_rest_namestore.c
+++ b/src/namestore/plugin_rest_namestore.c
diff --git a/src/rest-plugins/test_plugin_rest_namestore.sh b/src/namestore/test_plugin_rest_namestore.sh
index 532c7caae..532c7caae 100755
--- a/src/rest-plugins/test_plugin_rest_namestore.sh
+++ b/src/namestore/test_plugin_rest_namestore.sh
diff --git a/src/nat/install-nat-helper.sh b/src/nat/install-nat-helper.sh
index 502aa71f1..d5ee91fa3 100755
--- a/src/nat/install-nat-helper.sh
+++ b/src/nat/install-nat-helper.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# $1 - bindir
# $2 - sudo binary (optional)
$2 chown root:root $1/gnunet-helper-nat-server $1/gnunet-helper-nat-client || true
diff --git a/src/peerinfo/Makefile.am b/src/peerinfo/Makefile.am
index ef79d6720..3c710eb93 100644
--- a/src/peerinfo/Makefile.am
+++ b/src/peerinfo/Makefile.am
@@ -5,6 +5,8 @@ pkgcfgdir= $(pkgdatadir)/config.d/
libexecdir= $(pkglibdir)/libexec/
+plugindir = $(libdir)/gnunet
+
pkgcfg_DATA = \
peerinfo.conf
@@ -17,8 +19,29 @@ if USE_COVERAGE
XLIB = -lgcov
endif
+if HAVE_MHD
+if HAVE_JSON
+REST_PLUGIN = libgnunet_plugin_rest_peerinfo.la
+endif
+endif
+
lib_LTLIBRARIES = libgnunetpeerinfo.la
+plugin_LTLIBRARIES = $(REST_PLUGIN)
+
+libgnunet_plugin_rest_peerinfo_la_SOURCES = \
+ plugin_rest_peerinfo.c
+libgnunet_plugin_rest_peerinfo_la_LIBADD = \
+ $(top_builddir)/src/hello/libgnunethello.la \
+ libgnunetpeerinfo.la \
+ $(top_builddir)/src/rest/libgnunetrest.la \
+ $(top_builddir)/src/json/libgnunetjson.la \
+ $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
+ $(LTLIBINTL) -ljansson -lmicrohttpd
+libgnunet_plugin_rest_peerinfo_la_LDFLAGS = \
+ $(GN_PLUGIN_LDFLAGS)
+
+
libgnunetpeerinfo_la_SOURCES = \
peerinfo_api.c peerinfo.h \
peerinfo_api_notify.c
diff --git a/src/rest-plugins/plugin_rest_peerinfo.c b/src/peerinfo/plugin_rest_peerinfo.c
index 24af2c193..24af2c193 100644
--- a/src/rest-plugins/plugin_rest_peerinfo.c
+++ b/src/peerinfo/plugin_rest_peerinfo.c
diff --git a/src/pt/test_gns_vpn.c b/src/pt/test_gns_vpn.c
index 05fab18be..069277a00 100644
--- a/src/pt/test_gns_vpn.c
+++ b/src/pt/test_gns_vpn.c
@@ -11,7 +11,7 @@
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/>.
diff --git a/src/pt/test_gns_vpn.conf b/src/pt/test_gns_vpn.conf
index 85dd08113..9277aa3c3 100644
--- a/src/pt/test_gns_vpn.conf
+++ b/src/pt/test_gns_vpn.conf
@@ -7,8 +7,6 @@ PLUGINS = tcp
[arm]
PORT = 0
ALLOW_SHUTDOWN = YES
-START_SYSTEM_SERVICES = NO
-START_USER_SERVICES = NO
[exit]
IMMEDIATE_START = YES
diff --git a/src/reclaim/.gitignore b/src/reclaim/.gitignore
index ef77fccdc..46472101b 100644
--- a/src/reclaim/.gitignore
+++ b/src/reclaim/.gitignore
@@ -1,2 +1,2 @@
-gnunet-service-identity-provider
-gnunet-identity-token
+gnunet-reclaim
+gnunet-service-reclaim
diff --git a/src/reclaim/Makefile.am b/src/reclaim/Makefile.am
index f9942fa23..13918508e 100644
--- a/src/reclaim/Makefile.am
+++ b/src/reclaim/Makefile.am
@@ -16,6 +16,14 @@ if HAVE_SQLITE
SQLITE_PLUGIN = libgnunet_plugin_reclaim_sqlite.la
endif
+if HAVE_MHD
+if HAVE_JSON
+REST_PLUGIN = \
+ libgnunet_plugin_rest_openid_connect.la \
+ libgnunet_plugin_rest_reclaim.la
+endif
+endif
+
EXTRA_DIST = \
reclaim.conf \
test_reclaim_defaults.conf \
@@ -33,7 +41,8 @@ lib_LTLIBRARIES = \
libgnunetreclaim.la
plugin_LTLIBRARIES = \
libgnunet_plugin_gnsrecord_reclaim.la \
- $(SQLITE_PLUGIN)
+ $(SQLITE_PLUGIN) \
+ $(REST_PLUGIN)
bin_PROGRAMS = \
gnunet-reclaim
@@ -41,6 +50,41 @@ bin_PROGRAMS = \
libexec_PROGRAMS = \
gnunet-service-reclaim
+libgnunet_plugin_rest_reclaim_la_SOURCES = \
+ plugin_rest_reclaim.c \
+ json_reclaim.h \
+ json_reclaim.c
+libgnunet_plugin_rest_reclaim_la_LIBADD = \
+ $(top_builddir)/src/identity/libgnunetidentity.la \
+ libgnunetreclaim.la \
+ $(top_builddir)/src/json/libgnunetjson.la \
+ $(top_builddir)/src/rest/libgnunetrest.la \
+ $(top_builddir)/src/reclaim-attribute/libgnunetreclaimattribute.la \
+ $(top_builddir)/src/namestore/libgnunetnamestore.la \
+ $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
+ $(LTLIBINTL) -ljansson -lmicrohttpd
+libgnunet_plugin_rest_reclaim_la_LDFLAGS = \
+ $(GN_PLUGIN_LDFLAGS)
+
+
+libgnunet_plugin_rest_openid_connect_la_SOURCES = \
+ plugin_rest_openid_connect.c \
+ oidc_helper.h \
+ oidc_helper.c
+libgnunet_plugin_rest_openid_connect_la_LIBADD = \
+ $(top_builddir)/src/identity/libgnunetidentity.la \
+ libgnunetreclaim.la \
+ $(top_builddir)/src/rest/libgnunetrest.la \
+ $(top_builddir)/src/reclaim-attribute/libgnunetreclaimattribute.la \
+ $(top_builddir)/src/namestore/libgnunetnamestore.la \
+$(top_builddir)/src/gns/libgnunetgns.la \
+ $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
+ $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
+ $(LTLIBINTL) -ljansson -lmicrohttpd
+libgnunet_plugin_rest_openid_connect_la_LDFLAGS = \
+ $(GN_PLUGIN_LDFLAGS)
+
+
libgnunet_plugin_gnsrecord_reclaim_la_SOURCES = \
plugin_gnsrecord_reclaim.c
libgnunet_plugin_gnsrecord_reclaim_la_LIBADD = \
diff --git a/src/rest-plugins/json_reclaim.c b/src/reclaim/json_reclaim.c
index 0fe9150d9..0fe9150d9 100644
--- a/src/rest-plugins/json_reclaim.c
+++ b/src/reclaim/json_reclaim.c
diff --git a/src/rest-plugins/json_reclaim.h b/src/reclaim/json_reclaim.h
index ced2e10dd..ced2e10dd 100644
--- a/src/rest-plugins/json_reclaim.h
+++ b/src/reclaim/json_reclaim.h
diff --git a/src/rest-plugins/oidc_helper.c b/src/reclaim/oidc_helper.c
index 646e58551..646e58551 100644
--- a/src/rest-plugins/oidc_helper.c
+++ b/src/reclaim/oidc_helper.c
diff --git a/src/rest-plugins/oidc_helper.h b/src/reclaim/oidc_helper.h
index d718b7a78..d718b7a78 100644
--- a/src/rest-plugins/oidc_helper.h
+++ b/src/reclaim/oidc_helper.h
diff --git a/src/rest-plugins/plugin_rest_openid_connect.c b/src/reclaim/plugin_rest_openid_connect.c
index e755f079b..e755f079b 100644
--- a/src/rest-plugins/plugin_rest_openid_connect.c
+++ b/src/reclaim/plugin_rest_openid_connect.c
diff --git a/src/rest-plugins/plugin_rest_reclaim.c b/src/reclaim/plugin_rest_reclaim.c
index b36ed2bb6..b36ed2bb6 100644
--- a/src/rest-plugins/plugin_rest_reclaim.c
+++ b/src/reclaim/plugin_rest_reclaim.c
diff --git a/src/reclaim/test_reclaim.sh b/src/reclaim/test_reclaim.sh
index 311f5382a..da93b10f7 100755
--- a/src/reclaim/test_reclaim.sh
+++ b/src/reclaim/test_reclaim.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
#trap "gnunet-arm -e -c test_reclaim_lookup.conf" SIGINT
LOCATION=$(which gnunet-config)
@@ -20,7 +20,7 @@ rm -rf `gnunet-config -c test_reclaim.conf -s PATHS -o GNUNET_HOME -f`
# (3) PKEY3.user -> PKEY4
-which timeout &> /dev/null && DO_TIMEOUT="timeout 30"
+which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 30"
TEST_ATTR="test"
gnunet-arm -s -c test_reclaim.conf
diff --git a/src/rest-plugins/Makefile.am b/src/rest-plugins/Makefile.am
deleted file mode 100644
index 006c23101..000000000
--- a/src/rest-plugins/Makefile.am
+++ /dev/null
@@ -1,135 +0,0 @@
-# This Makefile.am is in the public domain
-AM_CPPFLAGS = -I$(top_srcdir)/src/include
-
-plugindir = $(libdir)/gnunet
-
-pkgcfgdir= $(pkgdatadir)/config.d/
-
-libexecdir= $(pkglibdir)/libexec/
-
-
-if MINGW
- WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols
-endif
-
-if USE_COVERAGE
- AM_CFLAGS = --coverage -O0
- XLIBS = -lgcov
-endif
-
-plugin_LTLIBRARIES = \
- libgnunet_plugin_rest_copying.la \
- libgnunet_plugin_rest_peerinfo.la \
- libgnunet_plugin_rest_identity.la \
- libgnunet_plugin_rest_namestore.la \
- libgnunet_plugin_rest_gns.la
-if HAVE_ABE
-plugin_LTLIBRARIES += libgnunet_plugin_rest_openid_connect.la \
- libgnunet_plugin_rest_reclaim.la
-endif
-
-libgnunet_plugin_rest_reclaim_la_SOURCES = \
- plugin_rest_reclaim.c \
- json_reclaim.h \
- json_reclaim.c
-libgnunet_plugin_rest_reclaim_la_LIBADD = \
- $(top_builddir)/src/identity/libgnunetidentity.la \
- $(top_builddir)/src/reclaim/libgnunetreclaim.la \
- $(top_builddir)/src/json/libgnunetjson.la \
- $(top_builddir)/src/rest/libgnunetrest.la \
- $(top_builddir)/src/reclaim-attribute/libgnunetreclaimattribute.la \
- $(top_builddir)/src/namestore/libgnunetnamestore.la \
- $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
- $(LTLIBINTL) -ljansson -lmicrohttpd
-libgnunet_plugin_rest_reclaim_la_LDFLAGS = \
- i$(GN_PLUGIN_LDFLAGS)
-
-
-#libgnunet_plugin_rest_credential_la_SOURCES = \
-# plugin_rest_credential.c
-#libgnunet_plugin_rest_credential_la_LIBADD = \
-# $(top_builddir)/src/credential/libgnunetcredential.la \
-# $(top_builddir)/src/rest/libgnunetrest.la \
-# $(top_builddir)/src/identity/libgnunetidentity.la \
-# $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
-# $(LTLIBINTL) -ljansson -lmicrohttpd
-#libgnunet_plugin_rest_credential_la_LDFLAGS = \
-# $(GN_PLUGIN_LDFLAGS)
-
-libgnunet_plugin_rest_copying_la_SOURCES = \
- plugin_rest_copying.c
-libgnunet_plugin_rest_copying_la_LIBADD = \
- $(top_builddir)/src/rest/libgnunetrest.la \
- $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
- $(LTLIBINTL) -lmicrohttpd
-libgnunet_plugin_rest_copying_la_LDFLAGS = \
- $(GN_PLUGIN_LDFLAGS)
-
-libgnunet_plugin_rest_peerinfo_la_SOURCES = \
- plugin_rest_peerinfo.c
-libgnunet_plugin_rest_peerinfo_la_LIBADD = \
- $(top_builddir)/src/hello/libgnunethello.la \
- $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
- $(top_builddir)/src/rest/libgnunetrest.la \
- $(top_builddir)/src/json/libgnunetjson.la \
- $(top_builddir)/src/transport/libgnunettransport.la \
- $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
- $(LTLIBINTL) -ljansson -lmicrohttpd
-libgnunet_plugin_rest_peerinfo_la_LDFLAGS = \
- $(GN_PLUGIN_LDFLAGS)
-
-libgnunet_plugin_rest_identity_la_SOURCES = \
- plugin_rest_identity.c
-libgnunet_plugin_rest_identity_la_LIBADD = \
- $(top_builddir)/src/identity/libgnunetidentity.la \
- $(top_builddir)/src/rest/libgnunetrest.la \
- $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
- $(LTLIBINTL) -ljansson -lmicrohttpd
-libgnunet_plugin_rest_identity_la_LDFLAGS = \
- $(GN_PLUGIN_LDFLAGS)
-
-
-
-libgnunet_plugin_rest_namestore_la_SOURCES = \
- plugin_rest_namestore.c
-libgnunet_plugin_rest_namestore_la_LIBADD = \
- $(top_builddir)/src/namestore/libgnunetnamestore.la \
- $(top_builddir)/src/rest/libgnunetrest.la \
- $(top_builddir)/src/identity/libgnunetidentity.la \
- $(top_builddir)/src/json/libgnunetjson.la \
- $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
- $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
- $(LTLIBINTL) -ljansson -lmicrohttpd
-libgnunet_plugin_rest_namestore_la_LDFLAGS = \
- $(GN_PLUGIN_LDFLAGS)
-
-libgnunet_plugin_rest_gns_la_SOURCES = \
- plugin_rest_gns.c
-libgnunet_plugin_rest_gns_la_LIBADD = \
- $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
- $(top_builddir)/src/gns/libgnunetgns.la \
- $(top_builddir)/src/rest/libgnunetrest.la \
- $(top_builddir)/src/identity/libgnunetidentity.la \
- $(top_builddir)/src/json/libgnunetjson.la \
- $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
- $(LTLIBINTL) -ljansson -lmicrohttpd
-libgnunet_plugin_rest_gns_la_LDFLAGS = \
- $(GN_PLUGIN_LDFLAGS)
-
-libgnunet_plugin_rest_openid_connect_la_SOURCES = \
- plugin_rest_openid_connect.c \
- oidc_helper.h \
- oidc_helper.c
-libgnunet_plugin_rest_openid_connect_la_LIBADD = \
- $(top_builddir)/src/identity/libgnunetidentity.la \
- $(top_builddir)/src/reclaim/libgnunetreclaim.la \
- $(top_builddir)/src/rest/libgnunetrest.la \
- $(top_builddir)/src/reclaim-attribute/libgnunetreclaimattribute.la \
- $(top_builddir)/src/namestore/libgnunetnamestore.la \
-$(top_builddir)/src/gns/libgnunetgns.la \
- $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
- $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
- $(LTLIBINTL) -ljansson -lmicrohttpd
-libgnunet_plugin_rest_openid_connect_la_LDFLAGS = \
- $(GN_PLUGIN_LDFLAGS)
-
diff --git a/src/rest/Makefile.am b/src/rest/Makefile.am
index 6c23ad2a6..acb95140b 100644
--- a/src/rest/Makefile.am
+++ b/src/rest/Makefile.am
@@ -20,14 +20,27 @@ if USE_COVERAGE
endif
lib_LTLIBRARIES = \
- libgnunetrest.la
+ libgnunetrest.la
libexec_PROGRAMS = \
gnunet-rest-server
+plugin_LTLIBRARIES = libgnunet_plugin_rest_copying.la
+
EXTRA_DIST = \
rest.conf
+libgnunet_plugin_rest_copying_la_SOURCES = \
+ plugin_rest_copying.c
+libgnunet_plugin_rest_copying_la_LIBADD = \
+ libgnunetrest.la \
+ $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
+ $(LTLIBINTL) -lmicrohttpd
+libgnunet_plugin_rest_copying_la_LDFLAGS = \
+ $(GN_PLUGIN_LDFLAGS)
+
+
+
gnunet_rest_server_SOURCES = \
gnunet-rest-server.c
diff --git a/src/rest/gnunet-rest-server.c b/src/rest/gnunet-rest-server.c
index 77f3d898d..3cbb750ba 100644
--- a/src/rest/gnunet-rest-server.c
+++ b/src/rest/gnunet-rest-server.c
@@ -64,6 +64,16 @@
static struct GNUNET_SCHEDULER_Task *httpd_task;
/**
+ * The address to bind to
+ */
+static in_addr_t address;
+
+/**
+ * The IPv6 address to bind to
+ */
+static struct in6_addr address6;
+
+/**
* The port the service is running on (default 7776)
*/
static unsigned long long port = GNUNET_REST_SERVICE_PORT;
@@ -406,11 +416,11 @@ create_response (void *cls,
con_handle->data_handle = rest_conndata_handle;
MHD_get_connection_values (con,
MHD_GET_ARGUMENT_KIND,
- &url_iterator,
+ (MHD_KeyValueIterator) &url_iterator,
rest_conndata_handle);
MHD_get_connection_values (con,
MHD_HEADER_KIND,
- &header_iterator,
+ (MHD_KeyValueIterator) &header_iterator,
rest_conndata_handle);
con_handle->pp = MHD_create_post_processor(con,
65536,
@@ -695,6 +705,7 @@ bind_v4 ()
memset (&sa4, 0, sizeof (sa4));
sa4.sin_family = AF_INET;
sa4.sin_port = htons (port);
+ sa4.sin_addr.s_addr = address;
#if HAVE_SOCKADDR_IN_SIN_LEN
sa4.sin_len = sizeof (sa4);
#endif
@@ -731,6 +742,7 @@ bind_v6 ()
memset (&sa6, 0, sizeof (sa6));
sa6.sin6_family = AF_INET6;
sa6.sin6_port = htons (port);
+ sa6.sin6_addr = address6;
#if HAVE_SOCKADDR_IN_SIN_LEN
sa6.sin6_len = sizeof (sa6);
#endif
@@ -806,9 +818,56 @@ run (void *cls,
const char *cfgfile,
const struct GNUNET_CONFIGURATION_Handle *c)
{
+ char* addr_str;
cfg = c;
plugin_map = GNUNET_CONTAINER_multihashmap_create (10, GNUNET_NO);
+ /* Get address to bind to */
+ if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (cfg, "rest",
+ "BIND_TO",
+ &addr_str))
+ {
+ //No address specified
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Don't know what to bind to...\n");
+ GNUNET_free (addr_str);
+ GNUNET_SCHEDULER_shutdown ();
+ return;
+ }
+ if (1 != inet_pton (AF_INET, addr_str, &address))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Unable to parse address %s\n",
+ addr_str);
+ GNUNET_free (addr_str);
+ GNUNET_SCHEDULER_shutdown ();
+ return;
+ }
+ GNUNET_free (addr_str);
+ /* Get address to bind to */
+ if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (cfg, "rest",
+ "BIND_TO6",
+ &addr_str))
+ {
+ //No address specified
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Don't know what to bind6 to...\n");
+ GNUNET_free (addr_str);
+ GNUNET_SCHEDULER_shutdown ();
+ return;
+ }
+ if (1 != inet_pton (AF_INET6, addr_str, &address6))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Unable to parse IPv6 address %s\n",
+ addr_str);
+ GNUNET_free (addr_str);
+ GNUNET_SCHEDULER_shutdown ();
+ return;
+ }
+ GNUNET_free (addr_str);
+
+
/* Get CORS data from cfg */
if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (cfg, "rest",
"REST_ALLOW_ORIGIN",
diff --git a/src/rest-plugins/plugin_rest_copying.c b/src/rest/plugin_rest_copying.c
index 92c2c6601..92c2c6601 100644
--- a/src/rest-plugins/plugin_rest_copying.c
+++ b/src/rest/plugin_rest_copying.c
diff --git a/src/rest/rest.conf b/src/rest/rest.conf
index 138751696..bef8cf473 100644
--- a/src/rest/rest.conf
+++ b/src/rest/rest.conf
@@ -1,6 +1,8 @@
[rest]
UNIXPATH = $GNUNET_USER_RUNTIME_DIR/gnunet-service-rest.sock
BINARY=gnunet-rest-server
+BIND_TO=127.0.0.1
+BIND_TO6=::1
REST_PORT=7776
REST_ALLOW_HEADERS=Authorization,Accept,Content-Type
REST_ALLOW_ORIGIN=*
diff --git a/src/revocation/test_local_revocation.py.in b/src/revocation/test_local_revocation.py.in
index 5caa616ca..4cc6119ca 100644
--- a/src/revocation/test_local_revocation.py.in
+++ b/src/revocation/test_local_revocation.py.in
@@ -18,8 +18,7 @@
# SPDX-License-Identifier: AGPL3.0-or-later
#
# Testcase for ego revocation
-from __future__ import print_function
-from builtins import str
+
import sys
import os
import subprocess
diff --git a/src/rps/gnunet-rps-profiler.c b/src/rps/gnunet-rps-profiler.c
index 9aa786334..af27546f2 100644
--- a/src/rps/gnunet-rps-profiler.c
+++ b/src/rps/gnunet-rps-profiler.c
@@ -84,29 +84,31 @@ enum STAT_TYPE
STAT_TYPE_BLOCKS_MANY_PUSH_NO_PULL, /* 5 */
STAT_TYPE_BLOCKS_NO_PUSH_NO_PULL, /* 6 */
STAT_TYPE_ISSUED_PUSH_SEND, /* 7 */
- STAT_TYPE_ISSUED_PULL_REQ, /* 8 */
- STAT_TYPE_ISSUED_PULL_REQ_MH, /* 9 */
- STAT_TYPE_ISSUED_PULL_REP, /* 10 */
- STAT_TYPE_SENT_PUSH_SEND, /* 11 */
- STAT_TYPE_SENT_PULL_REQ, /* 12 */
- STAT_TYPE_SENT_PULL_REQ_MH, /* 13 */
- STAT_TYPE_SENT_PULL_REP, /* 14 */
- STAT_TYPE_RECV_PUSH_SEND, /* 15 */
- STAT_TYPE_RECV_PULL_REQ, /* 16 */
- STAT_TYPE_RECV_PULL_REQ_MH, /* 17 */
- STAT_TYPE_RECV_PULL_REP, /* 18 */
- STAT_TYPE_RECV_PULL_REP_MH, /* 19 */
- STAT_TYPE_VIEW_SIZE, /* 20 */
- STAT_TYPE_KNOWN_PEERS, /* 21 */
- STAT_TYPE_VALID_PEERS, /* 22 */
- STAT_TYPE_LEARND_PEERS, /* 23 */
- STAT_TYPE_PENDING_ONLINE_CHECKS, /* 24 */
- STAT_TYPE_UNREQUESTED_PULL_REPLIES, /* 25 */
- STAT_TYPE_PEERS_IN_PUSH_MAP, /* 26 */
- STAT_TYPE_PEERS_IN_PULL_MAP, /* 27 */
- STAT_TYPE_PEERS_IN_VIEW, /* 28 */
- STAT_TYPE_VIEW_SIZE_AIM, /* 29 */
- STAT_TYPE_MAX, /* 30 */
+ STAT_TYPE_ISSUED_PUSH_SEND_MH, /* 8 */
+ STAT_TYPE_ISSUED_PULL_REQ, /* 9 */
+ STAT_TYPE_ISSUED_PULL_REQ_MH, /* 10 */
+ STAT_TYPE_ISSUED_PULL_REP, /* 11 */
+ STAT_TYPE_SENT_PUSH_SEND, /* 12 */
+ STAT_TYPE_SENT_PULL_REQ, /* 13 */
+ STAT_TYPE_SENT_PULL_REQ_MH, /* 14 */
+ STAT_TYPE_SENT_PULL_REP, /* 15 */
+ STAT_TYPE_RECV_PUSH_SEND, /* 16 */
+ STAT_TYPE_RECV_PUSH_SEND_MH, /* 17 */
+ STAT_TYPE_RECV_PULL_REQ, /* 18 */
+ STAT_TYPE_RECV_PULL_REQ_MH, /* 19 */
+ STAT_TYPE_RECV_PULL_REP, /* 20 */
+ STAT_TYPE_RECV_PULL_REP_MH, /* 21 */
+ STAT_TYPE_VIEW_SIZE, /* 22 */
+ STAT_TYPE_KNOWN_PEERS, /* 23 */
+ STAT_TYPE_VALID_PEERS, /* 24 */
+ STAT_TYPE_LEARND_PEERS, /* 25 */
+ STAT_TYPE_PENDING_ONLINE_CHECKS, /* 26 */
+ STAT_TYPE_UNREQUESTED_PULL_REPLIES, /* 27 */
+ STAT_TYPE_PEERS_IN_PUSH_MAP, /* 28 */
+ STAT_TYPE_PEERS_IN_PULL_MAP, /* 29 */
+ STAT_TYPE_PEERS_IN_VIEW, /* 30 */
+ STAT_TYPE_VIEW_SIZE_AIM, /* 31 */
+ STAT_TYPE_MAX, /* 32 */
};
static char* stat_type_strings[] = {
@@ -118,6 +120,7 @@ static char* stat_type_strings[] = {
"# rounds blocked - too many pushes, no pull replies",
"# rounds blocked - no pushes, no pull replies",
"# push send issued",
+ "# push send issued (multi-hop peer)",
"# pull request send issued",
"# pull request send issued (multi-hop peer)",
"# pull reply send issued",
@@ -126,6 +129,7 @@ static char* stat_type_strings[] = {
"# pull requests sent (multi-hop peer)",
"# pull replys sent",
"# push message received",
+ "# push message received (multi-hop peer)",
"# pull request message received",
"# pull request message received (multi-hop peer)",
"# pull reply messages received",
@@ -206,6 +210,12 @@ enum STAT_TYPE stat_str_2_type (const char *stat_str)
{
return STAT_TYPE_ISSUED_PUSH_SEND;
}
+ else if (0 == strncmp (stat_type_strings[STAT_TYPE_ISSUED_PUSH_SEND_MH],
+ stat_str,
+ strlen (stat_type_strings[STAT_TYPE_ISSUED_PUSH_SEND_MH])))
+ {
+ return STAT_TYPE_ISSUED_PUSH_SEND_MH;
+ }
else if (0 == strncmp (stat_type_strings[STAT_TYPE_ISSUED_PULL_REQ],
stat_str,
strlen (stat_type_strings[STAT_TYPE_ISSUED_PULL_REQ])))
@@ -254,6 +264,12 @@ enum STAT_TYPE stat_str_2_type (const char *stat_str)
{
return STAT_TYPE_RECV_PUSH_SEND;
}
+ else if (0 == strncmp (stat_type_strings[STAT_TYPE_RECV_PUSH_SEND_MH],
+ stat_str,
+ strlen (stat_type_strings[STAT_TYPE_RECV_PUSH_SEND_MH])))
+ {
+ return STAT_TYPE_RECV_PUSH_SEND_MH;
+ }
else if (0 == strncmp (stat_type_strings[STAT_TYPE_RECV_PULL_REQ],
stat_str,
strlen (stat_type_strings[STAT_TYPE_RECV_PULL_REQ])))
@@ -2461,9 +2477,9 @@ void write_final_stats (void){
"%s, %" /* id */
PRIu64 ", %" /* rounds */
PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" /* blocking */
- PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" /* issued */
+ PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" /* issued */
PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" /* sent */
- PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" /* recv */
+ PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" /* recv */
PRIu64 ", %" /* view size */
PRIu64 ", %" /* known peers */
PRIu64 ", %" /* valid peers */
@@ -2484,6 +2500,7 @@ void write_final_stats (void){
rps_peers[i].stats[STAT_TYPE_BLOCKS_MANY_PUSH_NO_PULL],
rps_peers[i].stats[STAT_TYPE_BLOCKS_NO_PUSH_NO_PULL],
rps_peers[i].stats[STAT_TYPE_ISSUED_PUSH_SEND],
+ rps_peers[i].stats[STAT_TYPE_ISSUED_PUSH_SEND_MH],
rps_peers[i].stats[STAT_TYPE_ISSUED_PULL_REQ],
rps_peers[i].stats[STAT_TYPE_ISSUED_PULL_REQ_MH],
rps_peers[i].stats[STAT_TYPE_ISSUED_PULL_REP],
@@ -2492,6 +2509,7 @@ void write_final_stats (void){
rps_peers[i].stats[STAT_TYPE_SENT_PULL_REQ_MH],
rps_peers[i].stats[STAT_TYPE_SENT_PULL_REP],
rps_peers[i].stats[STAT_TYPE_RECV_PUSH_SEND],
+ rps_peers[i].stats[STAT_TYPE_RECV_PUSH_SEND_MH],
rps_peers[i].stats[STAT_TYPE_RECV_PULL_REQ],
rps_peers[i].stats[STAT_TYPE_RECV_PULL_REQ_MH],
rps_peers[i].stats[STAT_TYPE_RECV_PULL_REP_MH],
@@ -2517,9 +2535,9 @@ void write_final_stats (void){
"SUM %"
PRIu64 " %" /* rounds */
PRIu64 " %" PRIu64 " %" PRIu64 " %" PRIu64 " %" PRIu64 " %" PRIu64 " %" /* blocking */
- PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" /* issued */
+ PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" /* issued */
PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" /* sent */
- PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" /* recv */
+ PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" /* recv */
PRIu64 ", %" /* view size */
PRIu64 ", %" /* known peers */
PRIu64 ", %" /* valid peers */
@@ -2538,6 +2556,7 @@ void write_final_stats (void){
sums[STAT_TYPE_BLOCKS_MANY_PUSH_NO_PULL],
sums[STAT_TYPE_BLOCKS_NO_PUSH_NO_PULL],
sums[STAT_TYPE_ISSUED_PUSH_SEND],
+ sums[STAT_TYPE_ISSUED_PUSH_SEND_MH],
sums[STAT_TYPE_ISSUED_PULL_REQ],
sums[STAT_TYPE_ISSUED_PULL_REQ_MH],
sums[STAT_TYPE_ISSUED_PULL_REP],
@@ -2546,6 +2565,7 @@ void write_final_stats (void){
sums[STAT_TYPE_SENT_PULL_REQ_MH],
sums[STAT_TYPE_SENT_PULL_REP],
sums[STAT_TYPE_RECV_PUSH_SEND],
+ sums[STAT_TYPE_RECV_PUSH_SEND_MH],
sums[STAT_TYPE_RECV_PULL_REQ],
sums[STAT_TYPE_RECV_PULL_REQ_MH],
sums[STAT_TYPE_RECV_PULL_REP],
@@ -2855,6 +2875,7 @@ run (void *cls,
BIT(STAT_TYPE_BLOCKS_MANY_PUSH_NO_PULL) |
BIT(STAT_TYPE_BLOCKS_NO_PUSH_NO_PULL) |
BIT(STAT_TYPE_ISSUED_PUSH_SEND) |
+ BIT(STAT_TYPE_ISSUED_PUSH_SEND_MH) |
BIT(STAT_TYPE_ISSUED_PULL_REQ) |
BIT(STAT_TYPE_ISSUED_PULL_REQ_MH) |
BIT(STAT_TYPE_ISSUED_PULL_REP) |
@@ -2863,6 +2884,7 @@ run (void *cls,
BIT(STAT_TYPE_SENT_PULL_REQ_MH) |
BIT(STAT_TYPE_SENT_PULL_REP) |
BIT(STAT_TYPE_RECV_PUSH_SEND) |
+ BIT(STAT_TYPE_RECV_PUSH_SEND_MH) |
BIT(STAT_TYPE_RECV_PULL_REQ) |
BIT(STAT_TYPE_RECV_PULL_REQ_MH) |
BIT(STAT_TYPE_RECV_PULL_REP) |
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c
index 63d4c1865..1871ef006 100644
--- a/src/rps/gnunet-service-rps.c
+++ b/src/rps/gnunet-service-rps.c
@@ -3500,6 +3500,15 @@ handle_peer_push (void *cls,
if (channel_ctx->peer_ctx->sub == msub)
{
GNUNET_STATISTICS_update(stats, "# push message received", 1, GNUNET_NO);
+ if (NULL != map_single_hop &&
+ GNUNET_NO == GNUNET_CONTAINER_multipeermap_contains (map_single_hop,
+ peer))
+ {
+ GNUNET_STATISTICS_update (stats,
+ "# push message received (multi-hop peer)",
+ 1,
+ GNUNET_NO);
+ }
}
#if ENABLE_MALICIOUS
@@ -3881,6 +3890,15 @@ send_push (struct PeerContext *peer_ctx)
"# push send issued",
1,
GNUNET_NO);
+ if (NULL != map_single_hop &&
+ GNUNET_NO == GNUNET_CONTAINER_multipeermap_contains (map_single_hop,
+ &peer_ctx->peer_id))
+ {
+ GNUNET_STATISTICS_update (stats,
+ "# push send issued (multi-hop peer)",
+ 1,
+ GNUNET_NO);
+ }
}
}
diff --git a/src/rps/rps-test_util.h b/src/rps/rps-test_util.h
index ace833034..5009073d0 100644
--- a/src/rps/rps-test_util.h
+++ b/src/rps/rps-test_util.h
@@ -65,7 +65,7 @@ close_all_files ();
#define to_file(file_name, ...) do { \
char tmp_buf[512] = "";\
int size;\
- if (NULL == file_name) return; \
+ if (NULL == file_name) break; \
size = GNUNET_snprintf(tmp_buf,sizeof(tmp_buf),__VA_ARGS__);\
if (0 > size)\
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,\
diff --git a/src/statistics/test_gnunet_statistics.py.in b/src/statistics/test_gnunet_statistics.py.in
index 64e66f238..b14dc9d9e 100644
--- a/src/statistics/test_gnunet_statistics.py.in
+++ b/src/statistics/test_gnunet_statistics.py.in
@@ -1,5 +1,5 @@
#!@PYTHON@
-from __future__ import print_function
+
import os
import sys
import shutil
diff --git a/src/transport/benchmark.sh b/src/transport/benchmark.sh
index 6ae68af2a..a29e6ec2d 100755
--- a/src/transport/benchmark.sh
+++ b/src/transport/benchmark.sh
@@ -1,15 +1,13 @@
-#/bin/sh
+#!/bin/sh
-for i in {1..0}
+for i in $(seq 1 0)
do
echo RUN $i
./test_transport_api_reliability_http
done
-for i in {1..100}
+for i in $(seq 1 100)
do
echo RUN $i
./test_transport_api_reliability_https
done
-
- \ No newline at end of file
diff --git a/src/transport/install-bluetooth-helper.sh b/src/transport/install-bluetooth-helper.sh
index 409078759..5c40250fa 100755
--- a/src/transport/install-bluetooth-helper.sh
+++ b/src/transport/install-bluetooth-helper.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# $1 - bindir
# $2 - sudo binary (optional)
$2 chown root:root $1/gnunet-helper-transport-bluetooth || true
diff --git a/src/transport/install-wlan-helper.sh b/src/transport/install-wlan-helper.sh
index 54b3360be..0fa9c9806 100755
--- a/src/transport/install-wlan-helper.sh
+++ b/src/transport/install-wlan-helper.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# $1 - bindir
# $2 - sudo binary (optional)
$2 chown root:root $1/gnunet-helper-transport-wlan || true
diff --git a/src/transport/profile_transport.sh b/src/transport/profile_transport.sh
index aa5c4a88f..0e6935fc7 100755
--- a/src/transport/profile_transport.sh
+++ b/src/transport/profile_transport.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
C_ITERATIONS=5
C_MESSAGE_DELTA=10
@@ -11,7 +11,7 @@ C_MESSAGE_END=2000
# done
-for ((cur=$C_MESSAGE_START; cur<=$C_MESSAGE_END; cur = cur + $C_MESSAGE_DELTA))
+for $((cur=$C_MESSAGE_START; cur<=$C_MESSAGE_END; cur = cur + $C_MESSAGE_DELTA))
{
./gnunet-transport-profiler -p NSGWRTMHG2YJK9KZSTEWKJ5TK20AGRDBWHFA1ZNKKZ7T360MZ8S0 -s -c perf_https_peer1.conf -n 20240 -m $cur -i 4
sleep 1
diff --git a/src/util/gnunet-config.c b/src/util/gnunet-config.c
index 361fa55d6..f700428a2 100644
--- a/src/util/gnunet-config.c
+++ b/src/util/gnunet-config.c
@@ -73,9 +73,9 @@ static int rewrite;
*/
static void
print_option (void *cls,
- const char *section,
- const char *option,
- const char *value)
+ const char *section,
+ const char *option,
+ const char *value)
{
const struct GNUNET_CONFIGURATION_Handle *cfg = cls;
@@ -86,27 +86,27 @@ print_option (void *cls,
char *fn;
GNUNET_assert (GNUNET_OK ==
- GNUNET_CONFIGURATION_get_value_filename (cfg,
- section,
- option,
- &value_fn));
+ GNUNET_CONFIGURATION_get_value_filename (cfg,
+ section,
+ option,
+ &value_fn));
fn = GNUNET_STRINGS_filename_expand (value_fn);
if (NULL == fn)
fn = value_fn;
else
GNUNET_free (value_fn);
fprintf (stdout,
- "%s = %s\n",
- option,
- fn);
+ "%s = %s\n",
+ option,
+ fn);
GNUNET_free (fn);
}
else
{
fprintf (stdout,
- "%s = %s\n",
- option,
- value);
+ "%s = %s\n",
+ option,
+ value);
}
}
@@ -123,8 +123,8 @@ print_section_name (void *cls,
{
(void) cls;
fprintf (stdout,
- "%s\n",
- section);
+ "%s\n",
+ section);
}
@@ -133,7 +133,8 @@ print_section_name (void *cls,
*
* @param cls closure
* @param args remaining command-line arguments
- * @param cfgfile name of the configuration file used (for saving, can be NULL!)
+ * @param cfgfile name of the configuration file used (for saving,
+ * can be NULL!)
* @param cfg configuration
*/
static void
@@ -192,35 +193,36 @@ run (void *cls,
{
GNUNET_CONFIGURATION_iterate_section_values (cfg,
section,
- &print_option,
+ &print_option,
(void *) cfg);
}
else
{
if (is_filename)
{
- if (GNUNET_OK !=
- GNUNET_CONFIGURATION_get_value_filename (cfg,
+ if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_filename (cfg,
section,
option,
&value))
- {
- GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
- section, option);
- ret = 3;
+ {
+ GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
+ section, option);
+ ret = 3;
goto cleanup;
- }
+ }
}
else
{
- if (GNUNET_OK !=
- GNUNET_CONFIGURATION_get_value_string (cfg, section, option, &value))
- {
- GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
- section, option);
- ret = 3;
+ if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_string (cfg, section,
+ option, &value))
+ {
+ GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
+ section, option);
+ ret = 3;
goto cleanup;
- }
+ }
}
fprintf (stdout, "%s\n", value);
}
@@ -245,10 +247,10 @@ run (void *cls,
const char *xdg = getenv ("XDG_CONFIG_HOME");
if (NULL != xdg)
GNUNET_asprintf (&cfg_fn,
- "%s%s%s",
- xdg,
- DIR_SEPARATOR_STR,
- GNUNET_OS_project_data_get ()->config_file);
+ "%s%s%s",
+ xdg,
+ DIR_SEPARATOR_STR,
+ GNUNET_OS_project_data_get ()->config_file);
else
cfg_fn = GNUNET_strdup (GNUNET_OS_project_data_get ()->user_config_file);
cfgfile = cfg_fn;
@@ -256,14 +258,14 @@ run (void *cls,
if ( (NULL != diff) || (NULL != out) )
{
if (GNUNET_OK !=
- GNUNET_CONFIGURATION_write ((NULL == out) ? diff : out,
+ GNUNET_CONFIGURATION_write ((NULL == out) ? diff : out,
cfgfile))
ret = 2;
}
GNUNET_free_non_null (cfg_fn);
if (NULL != out)
GNUNET_CONFIGURATION_destroy (out);
- cleanup:
+cleanup:
if (NULL != diff)
GNUNET_CONFIGURATION_destroy (diff);
}
@@ -282,32 +284,32 @@ main (int argc,
{
struct GNUNET_GETOPT_CommandLineOption options[] = {
GNUNET_GETOPT_option_flag ('f',
- "filename",
- gettext_noop ("obtain option of value as a filename (with $-expansion)"),
- &is_filename),
+ "filename",
+ gettext_noop ("interpret option value as a filename (with $-expansion)"),
+ &is_filename),
GNUNET_GETOPT_option_string ('s',
- "section",
- "SECTION",
- gettext_noop ("name of the section to access"),
- &section),
+ "section",
+ "SECTION",
+ gettext_noop ("name of the section to access"),
+ &section),
GNUNET_GETOPT_option_string ('o',
- "option",
- "OPTION",
- gettext_noop ("name of the option to access"),
- &option),
+ "option",
+ "OPTION",
+ gettext_noop ("name of the option to access"),
+ &option),
GNUNET_GETOPT_option_string ('V',
- "value",
- "VALUE",
- gettext_noop ("value to set"),
- &value),
+ "value",
+ "VALUE",
+ gettext_noop ("value to set"),
+ &value),
GNUNET_GETOPT_option_flag ('S',
- "list-sections",
- gettext_noop ("print available configuration sections"),
- &list_sections),
+ "list-sections",
+ gettext_noop ("print available configuration sections"),
+ &list_sections),
GNUNET_GETOPT_option_flag ('w',
- "rewrite",
- gettext_noop ("write configuration file that only contains delta to defaults"),
- &rewrite),
+ "rewrite",
+ gettext_noop ("write configuration file that only contains delta to defaults"),
+ &rewrite),
GNUNET_GETOPT_OPTION_END
};
if (GNUNET_OK !=
@@ -316,12 +318,12 @@ main (int argc,
return 2;
ret = (GNUNET_OK ==
- GNUNET_PROGRAM_run (argc,
- argv,
- "gnunet-config [OPTIONS]",
- gettext_noop ("Manipulate GNUnet configuration files"),
- options,
- &run, NULL)) ? 0 : ret;
+ GNUNET_PROGRAM_run (argc,
+ argv,
+ "gnunet-config [OPTIONS]",
+ gettext_noop ("Manipulate GNUnet configuration files"),
+ options,
+ &run, NULL)) ? 0 : ret;
GNUNET_free ((void*) argv);
return ret;
}
diff --git a/src/util/gnunet-qr.c b/src/util/gnunet-qr.c
index 1106d5cb2..fa95d6c05 100644
--- a/src/util/gnunet-qr.c
+++ b/src/util/gnunet-qr.c
@@ -17,7 +17,12 @@
SPDX-License-Identifier: AGPL3.0-or-later
*/
-
+/**
+ * @file util/gnunet-qr.c
+ * @author Hartmut Goebel (original implementation)
+ * @author Martin Schanzenbach (integrate gnunet-uri)
+ * @author Christian Grothoff (error handling)
+ */
#include <stdio.h>
#include <zbar.h>
#include <stdbool.h>
@@ -26,18 +31,35 @@
#define LOG(fmt, ...) if (verbose == true) printf(fmt, ## __VA_ARGS__)
-// Command line options
+/**
+ * Video device to capture from. Sane default for GNU/Linux systems.
+ */
static char* device = "/dev/video0";
+
+/**
+ * --verbose option
+ */
static int verbose = false;
+
+/**
+ * --silent option
+ */
static int silent = false;
-// Handler exit code
+/**
+ * Handler exit code
+ */
static long unsigned int exit_code = 1;
-// Helper process we started.
+/**
+ * Helper process we started.
+ */
static struct GNUNET_OS_Process *p;
-// Pipe used to communicate shutdown via signal.
+
+/**
+ * Pipe used to communicate child death via signal.
+ */
static struct GNUNET_DISK_PipeHandle *sigpipe;
@@ -69,8 +91,10 @@ maint_child_death (void *cls)
* @param cfg configuration
*/
static void
-gnunet_uri (void *cls, const char *uri, const char *cfgfile,
- const struct GNUNET_CONFIGURATION_Handle *cfg)
+gnunet_uri (void *cls,
+ const char *uri,
+ const char *cfgfile,
+ const struct GNUNET_CONFIGURATION_Handle *cfg)
{
const char *orig_uri;
const char *slash;
@@ -88,7 +112,8 @@ gnunet_uri (void *cls, const char *uri, const char *cfgfile,
uri += strlen ("gnunet://");
if (NULL == (slash = strchr (uri, '/')))
{
- fprintf (stderr, _("Invalid URI: fails to specify subsystem\n"));
+ fprintf (stderr,
+ _("Invalid URI: fails to specify subsystem\n"));
return;
}
subsystem = GNUNET_strndup (uri, slash - uri);
@@ -98,7 +123,9 @@ gnunet_uri (void *cls, const char *uri, const char *cfgfile,
subsystem,
&program))
{
- fprintf (stderr, _("No handler known for subsystem `%s'\n"), subsystem);
+ fprintf (stderr,
+ _("No handler known for subsystem `%s'\n"),
+ subsystem);
GNUNET_free (subsystem);
return;
}
@@ -120,6 +147,111 @@ gnunet_uri (void *cls, const char *uri, const char *cfgfile,
/**
+ * Obtain QR code 'symbol' from @a proc.
+ *
+ * @param proc zbar processor to use
+ * @return NULL on error
+ */
+static const zbar_symbol_t *
+get_symbol (zbar_processor_t *proc)
+{
+ const zbar_symbol_set_t* symbols;
+ int rc;
+ int n;
+
+ if (0 !=
+ zbar_processor_parse_config (proc, "enable"))
+ {
+ GNUNET_break (0);
+ return NULL;
+ }
+
+ /* initialize the Processor */
+ if (0 !=
+ (rc = zbar_processor_init(proc, device, 1)))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Failed to open device `%s': %d\n",
+ device,
+ rc);
+ return NULL;
+ }
+
+ /* enable the preview window */
+ if ( (0 != (rc = zbar_processor_set_visible (proc, 1))) ||
+ (0 != (rc = zbar_processor_set_active(proc, 1))) )
+ {
+ GNUNET_break (0);
+ return NULL;
+ }
+
+ /* read at least one barcode (or until window closed) */
+ LOG ("Capturing\n");
+ n = zbar_process_one (proc, -1);
+
+ /* hide the preview window */
+ (void) zbar_processor_set_active (proc, 0);
+ (void) zbar_processor_set_visible (proc, 0);
+ if (-1 == n)
+ return NULL; /* likely user closed the window */
+ LOG ("Got %i images\n",
+ n);
+ /* extract results */
+ symbols = zbar_processor_get_results (proc);
+ if (NULL == symbols)
+ {
+ GNUNET_break (0);
+ return NULL;
+ }
+ return zbar_symbol_set_first_symbol (symbols);
+}
+
+
+/**
+ * Run zbar QR code parser.
+ *
+ * @return NULL on error, otherwise the URI that we found
+ */
+static char *
+run_zbar ()
+{
+ zbar_processor_t *proc;
+ const char *data;
+ char *ret;
+ const zbar_symbol_t* symbol;
+
+ /* configure the Processor */
+ proc = zbar_processor_create (1);
+ if (NULL == proc)
+ {
+ GNUNET_break (0);
+ return NULL;
+ }
+
+ symbol = get_symbol (proc);
+ if (NULL == symbol)
+ {
+ zbar_processor_destroy (proc);
+ return NULL;
+ }
+ data = zbar_symbol_get_data (symbol);
+ if (NULL == data)
+ {
+ GNUNET_break (0);
+ zbar_processor_destroy (proc);
+ return NULL;
+ }
+ LOG ("Found %s \"%s\"\n",
+ zbar_get_symbol_name (zbar_symbol_get_type(symbol)),
+ data);
+ ret = GNUNET_strdup (data);
+ /* clean up */
+ zbar_processor_destroy(proc);
+ return ret;
+}
+
+
+/**
* Main function that will be run by the scheduler.
*
* @param cls closure
@@ -133,65 +265,33 @@ run (void *cls,
const char *cfgfile,
const struct GNUNET_CONFIGURATION_Handle *cfg)
{
- /* create a Processor */
- LOG("Initializing\n");
- zbar_processor_t *proc = zbar_processor_create(1);
-
- // FIXME: Wrap all this into a function which returns an error on
- // failure. And here ensure the processor is destroyed at the end.
-
- /* configure the Processor */
- zbar_processor_parse_config(proc, "enable");
-
- /* initialize the Processor */
- LOG("Opening video device %s\n", device);
- // FIXME: error handling
- zbar_processor_init(proc, device, 1);
-
- /* enable the preview window */
- zbar_processor_set_visible(proc, 1);
- zbar_processor_set_active(proc, 1);
-
- /* keep scanning until user provides key/mouse input */
- //zbar_processor_user_wait(proc, -1);
+ char *data;
- // read at least one barcode (or until window closed)
- LOG("Capturing\n");
- int n;
- n = zbar_process_one(proc, -1);
- LOG("Got %i images\n", n);
- // FIXME: Error handling (n = -1)
-
- // hide the preview window
- zbar_processor_set_active(proc, 0);
- zbar_processor_set_visible(proc, 0);
-
- // extract results
- const zbar_symbol_set_t* symbols = zbar_processor_get_results(proc);
- const zbar_symbol_t* symbol = zbar_symbol_set_first_symbol(symbols);
-
- if (symbol != NULL) {
- const char* data = zbar_symbol_get_data(symbol);
- LOG("Found %s \"%s\"\n",
- zbar_get_symbol_name(zbar_symbol_get_type(symbol)), data);
-
- gnunet_uri(cls, data, cfgfile, cfg);
- if (exit_code != 0) {
- printf("Failed to add URI %s\n", data);
- } else {
- printf("Added URI %s\n", data);
- }
+ data = run_zbar ();
+ if (NULL == data)
+ return;
+ gnunet_uri (cls,
+ data,
+ cfgfile,
+ cfg);
+ if (exit_code != 0)
+ {
+ printf ("Failed to add URI %s\n",
+ data);
}
-
- /* clean up */
- zbar_processor_destroy(proc);
+ else
+ {
+ printf ("Added URI %s\n",
+ data);
+ }
+ GNUNET_free (data);
};
int
main (int argc, char *const *argv)
{
- static int ret;
+ int ret;
struct GNUNET_GETOPT_CommandLineOption options[] = {
GNUNET_GETOPT_option_string ('d', "device", "DEVICE",
gettext_noop ("use video-device DEVICE (default: /dev/video0"),
@@ -204,6 +304,7 @@ main (int argc, char *const *argv)
&silent),
GNUNET_GETOPT_OPTION_END
};
+
ret = GNUNET_PROGRAM_run (argc,
argv,
"gnunet-qr",
diff --git a/src/vpn/install-vpn-helper.sh b/src/vpn/install-vpn-helper.sh
index 0996e7839..086dabb67 100755
--- a/src/vpn/install-vpn-helper.sh
+++ b/src/vpn/install-vpn-helper.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# $1 - bindir
# $2 - sudo binary (optional)
$2 chown root:root $1/gnunet-helper-vpn || true
diff --git a/src/vpn/tests/test-helper-icmp.sh b/src/vpn/tests/test-helper-icmp.sh
index eb5bd043b..2d0c8425a 100755
--- a/src/vpn/tests/test-helper-icmp.sh
+++ b/src/vpn/tests/test-helper-icmp.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
/opt/gnunet/bin/gnunet-helper-vpn < ping > result 2>/dev/null &
diff --git a/src/vpn/tests/test-helper-ifaddr.sh b/src/vpn/tests/test-helper-ifaddr.sh
index f64f9aa53..b8fde999d 100755
--- a/src/vpn/tests/test-helper-ifaddr.sh
+++ b/src/vpn/tests/test-helper-ifaddr.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
FIFO=$(mktemp)