gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet] 17/19: Merge master into branch.


From: gnunet
Subject: [gnunet] 17/19: Merge master into branch.
Date: Wed, 28 Aug 2024 11:19:47 +0200

This is an automated email from the git hooks/post-receive script.

t3sserakt pushed a commit to branch master
in repository gnunet.

commit 316caa8f6c1e8e120ed9a8854ed3e820fd4ed4e3
Merge: 422c58894 7322b322b
Author: t3sserakt <t3ss@posteo.de>
AuthorDate: Wed Aug 28 08:32:20 2024 +0200

    Merge master into branch.

 .gitignore                                         |   30 +-
 NEWS                                               |    4 +-
 configure.ac                                       |   30 +-
 contrib/ci/Containerfile                           |   56 +-
 contrib/ci/README                                  |    7 +
 contrib/ci/ci.sh                                   |   14 +-
 contrib/ci/{jobs/0-build => common/build}/build.sh |    1 +
 contrib/ci/{jobs/0-build => common/build}/job.sh   |    0
 .../2-deb-package/job.sh => debian-package-job.sh} |    9 +-
 contrib/ci/disabled_jobs/7-riscv64-build/build.sh  |    1 +
 .../ci/disabled_jobs/7-riscv64-build/config.ini    |    6 +
 contrib/ci/disabled_jobs/7-riscv64-build/job.sh    |    1 +
 .../disabled_jobs/8-riscv64-deb-package/config.ini |    6 +
 .../ci/disabled_jobs/8-riscv64-deb-package/job.sh  |    1 +
 .../disabled_jobs/8-riscv64-deb-package/version.sh |    1 +
 .../9-riscv64-deploy-package}/config.ini           |    2 +-
 .../disabled_jobs/9-riscv64-deploy-package/job.sh  |    1 +
 .../{3-deploy-package => 0-codespell}/config.ini   |    4 +-
 contrib/ci/jobs/0-codespell/dictionary.txt         |   53 +
 contrib/ci/jobs/0-codespell/job.sh                 |   93 +
 contrib/ci/jobs/1-amd64-build/build.sh             |    1 +
 contrib/ci/jobs/1-amd64-build/job.sh               |    1 +
 contrib/ci/jobs/2-amd64-deb-package/job.sh         |    2 +
 .../config.ini                                     |    0
 contrib/ci/jobs/3-amd64-deploy-package/job.sh      |    1 +
 contrib/ci/jobs/3-deploy-package/job.sh            |   14 -
 contrib/ci/jobs/4-arm64-build/build.sh             |   12 +-
 contrib/ci/jobs/4-arm64-build/job.sh               |    7 +-
 contrib/ci/jobs/5-arm64-deb-package/job.sh         |   22 +-
 contrib/ci/jobs/5-arm64-deb-package/version.sh     |   17 -
 contrib/ci/jobs/6-arm64-deploy-package/job.sh      |   15 +-
 contrib/ci/riscv64.Containerfile                   |   46 +
 contrib/ci/{jobs/2-deb-package => }/version.sh     |    5 +-
 contrib/gana                                       |    2 +-
 contrib/handbook                                   |    2 +-
 contrib/scripts/gnunet-logread/.gitignore          |    2 -
 debian/changelog                                   |    2 +-
 doc/.gitignore                                     |   22 -
 doc/doxygen/.gitignore                             |    5 -
 doc/man/Makefile.am                                |    1 +
 doc/man/gnunet-core.1                              |   10 +
 doc/man/{gnunet-core.1 => gnunet-hello.1}          |   31 +-
 doc/man/gnunet-namestore.1                         |    4 +
 doc/man/meson.build                                |    1 +
 doc/old/handbook/.gitignore                        |   11 -
 doc/old/tutorial/.gitignore                        |   11 -
 m4/libgcrypt.m4                                    |   95 +-
 meson.build                                        |   18 +-
 meson.build => meson.build.arm_util_only           |   70 -
 meson.options                                      |    2 +-
 po/POTFILES.in                                     |    1 -
 po/de.po                                           |   68 +-
 po/es.po                                           |  146 +-
 po/fr.po                                           |  175 +-
 po/it.po                                           |  175 +-
 po/sr.po                                           |  179 +-
 po/sv.po                                           |  183 +-
 po/vi.po                                           |  179 +-
 po/zh_CN.po                                        |  175 +-
 scripts/netjail/netjail_core.sh                    |    7 +-
 scripts/netjail/netjail_start.sh                   |    9 +-
 scripts/netjail/netjail_stop.sh                    |    5 +-
 src/cli/.gitignore                                 |    2 -
 src/cli/Makefile.am                                |    2 +-
 src/cli/arm/.gitignore                             |    1 -
 src/cli/arm/gnunet-arm.c                           |    2 +-
 src/cli/cadet/.gitignore                           |    1 -
 src/cli/cadet/gnunet-cadet.c                       |    2 +-
 src/cli/core/.gitignore                            |    1 -
 src/cli/core/gnunet-core.c                         |   48 +-
 src/cli/core/meson.build                           |    4 +-
 src/cli/datastore/.gitignore                       |    1 -
 src/cli/dht/.gitignore                             |    5 -
 src/cli/fs/.gitignore                              |    8 -
 src/cli/gns/.gitignore                             |    2 -
 src/cli/gns/openssl.cnf                            |    2 +-
 src/cli/gns/test_gns_box_sbox.sh                   |    2 +-
 src/cli/gns/test_gns_redirect_lookup.sh            |    2 +-
 src/cli/{peerstore => hello}/Makefile.am           |   22 +-
 src/cli/hello/gnunet-hello.c                       |  322 ++
 src/cli/hello/meson.build                          |    8 +
 src/cli/identity/.gitignore                        |    1 -
 src/cli/identity/gnunet-identity.c                 |   40 +-
 src/cli/identity/meson.build                       |   12 +
 src/cli/identity/test_identity.conf                |   11 +
 src/cli/identity/test_identity_messages.sh         |    4 +-
 src/cli/meson.build                                |    2 +-
 src/cli/messenger/.gitignore                       |    1 -
 src/cli/messenger/gnunet-messenger.c               |   87 +-
 src/cli/namecache/.gitignore                       |    1 -
 src/cli/namestore/.gitignore                       |    6 -
 src/cli/namestore/gnunet-namestore-zonefile.c      |    2 +-
 src/cli/namestore/gnunet-namestore.c               |  209 +-
 src/cli/namestore/test_namestore_put_multiple.sh   |    2 +-
 src/cli/namestore/test_namestore_put_stdin.sh      |   31 +-
 src/cli/nat-auto/.gitignore                        |    2 -
 src/cli/nat/.gitignore                             |    1 -
 src/cli/nse/.gitignore                             |    1 -
 src/cli/peerstore/.gitignore                       |    1 -
 src/cli/peerstore/gnunet-peerstore.c               |   97 -
 src/cli/peerstore/meson.build                      |    9 -
 src/cli/reclaim/.gitignore                         |    2 -
 src/cli/reclaim/gnunet-did.c                       |   27 +-
 src/cli/statistics/.gitignore                      |    1 -
 src/cli/util/.gitignore                            |   10 -
 src/cli/util/gnunet-config.c                       |   16 +
 src/cli/util/gnunet-crypto-tvg.c                   |   21 +-
 src/cli/util/gnunet-scrypt.c                       |    2 +-
 src/cli/vpn/.gitignore                             |    1 -
 src/contrib/cli/template/.gitignore                |    1 -
 src/contrib/service/abd/.gitignore                 |    2 -
 src/contrib/service/abd/gnunet-abd.c               |    4 +-
 src/contrib/service/auction/.gitignore             |    5 -
 src/contrib/service/consensus/.gitignore           |    4 -
 src/contrib/service/conversation/.gitignore        |    8 -
 src/contrib/service/rps/.gitignore                 |   16 -
 src/contrib/service/scalarproduct/.gitignore       |    6 -
 src/contrib/service/secretsharing/.gitignore       |    3 -
 src/contrib/service/set/.gitignore                 |    7 -
 src/contrib/service/template/.gitignore            |    3 -
 src/include/.gitignore                             |    3 -
 src/include/gnunet_abd_service.h                   |    2 +-
 src/include/gnunet_cadet_service.h                 |    2 +-
 src/include/gnunet_client_lib.h                    |    2 +-
 src/include/gnunet_common.h                        |   29 +
 src/include/gnunet_configuration_lib.h             |   43 +-
 src/include/gnunet_constants.h                     |    2 +-
 src/include/gnunet_core_service.h                  |   90 +
 src/include/gnunet_crypto_lib.h                    |  938 +++--
 src/include/gnunet_curl_lib.h                      |    3 -
 src/include/gnunet_dns_service.h                   |    2 +-
 src/include/gnunet_fs_service.h                    |    2 +-
 src/include/gnunet_gnsrecord_lib.h                 |    4 +-
 src/include/gnunet_mq_lib.h                        |    6 +-
 src/include/gnunet_namestore_plugin.h              |   35 +-
 src/include/gnunet_namestore_service.h             |    6 +-
 src/include/gnunet_os_lib.h                        |    6 +-
 src/include/gnunet_peerstore_plugin.h              |    2 +-
 src/include/gnunet_peerstore_service.h             |    2 +-
 src/include/gnunet_pq_lib.h                        |   14 +-
 src/include/gnunet_protocols.h                     |    8 +-
 src/include/gnunet_reclaim_service.h               |    2 +-
 src/include/gnunet_testing_lib.h                   |    4 +-
 src/include/gnunet_testing_testbed_lib.h           |    2 +-
 .../gnunet_transport_communication_service.h       |    2 +-
 src/lib/curl/curl.c                                |   33 +-
 src/lib/gnsrecord/.gitignore                       |    6 -
 src/lib/gnsrecord/gnsrecord_misc.c                 |    4 +-
 src/lib/gnsrecord/json_gnsrecord.c                 |    8 +-
 src/lib/gnsrecord/meson.build                      |    5 +
 src/lib/hello/.gitignore                           |    5 -
 src/lib/hello/gnunet-hello.c                       |  426 ---
 src/lib/hello/hello-uri.c                          |  121 +-
 src/lib/json/.gitignore                            |    2 -
 src/lib/json/json_helper.c                         |    9 +-
 src/lib/meson.build.arm_util_only                  |    1 +
 src/lib/pq/.gitignore                              |    1 -
 src/lib/pq/Makefile.am                             |    2 +-
 src/lib/pq/meson.build                             |    6 +
 src/lib/pq/pq_eval.c                               |    5 +-
 src/lib/pq/pq_query_helper.c                       |    2 +-
 src/lib/sq/.gitignore                              |    1 -
 src/lib/testing/.gitignore                         |   11 -
 src/lib/testing/gnunet-cmds-helper.c               |    9 +-
 src/lib/testing/testing_api_cmd_barrier_reached.c  |    6 +-
 .../testing_api_cmd_netjail_start_cmds_helper.c    |    3 +-
 src/lib/testing/testing_api_topology.c             |  302 --
 src/lib/testing/testing_api_topology.h             |    4 +-
 src/lib/util/.gitignore                            |   83 +-
 src/lib/util/Makefile.am                           |   21 +-
 src/lib/util/client.c                              |    7 +-
 src/lib/util/common_logging.c                      |   50 +-
 src/lib/util/configuration.c                       |  192 +-
 src/lib/util/crypto_cs.c                           |   41 +-
 src/lib/util/crypto_ecc.c                          |  190 +-
 src/lib/util/crypto_elligator.c                    |  145 +-
 src/lib/util/crypto_hash_file.c                    |    2 +-
 src/lib/util/crypto_hkdf.c                         |  390 +-
 src/lib/util/crypto_hpke.c                         | 1031 +++++
 src/lib/util/crypto_kdf.c                          |   10 +-
 src/lib/util/crypto_pkey.c                         |  174 -
 src/lib/util/getopt.c                              |    6 +-
 src/lib/util/gnunet-elligator-tvg.c                |  121 +
 src/lib/util/gnunet_error_codes.c                  |    1 -
 src/lib/util/meson.build                           |   24 +-
 .../{meson.build => meson.build.arm_util_only}     |  115 +-
 src/lib/util/mq.c                                  |   21 +-
 src/lib/util/network.c                             |    2 +-
 src/lib/util/perf_crypto_hash.c                    |   11 +-
 src/lib/util/service.c                             |  116 +-
 src/lib/util/socks.c                               |    2 +-
 src/lib/util/test_crypto_ecdh_eddsa.c              |   15 +-
 src/lib/util/test_crypto_elligator.c               |   99 +-
 src/lib/util/test_crypto_hkdf.c                    |  191 +-
 src/lib/util/test_crypto_hpke.c                    |  530 +++
 src/meson.build.arm_util_only                      |    1 +
 src/plugin/gnsrecord/plugin_gnsrecord_dns.c        |    2 +-
 src/plugin/namestore/plugin_namestore_postgres.c   |   59 +
 src/plugin/namestore/plugin_namestore_sqlite.c     |   69 +
 src/service/arm/.gitignore                         |    7 -
 src/service/arm/arm_api.c                          |    8 +-
 src/service/arm/gnunet-service-arm.c               |  410 +-
 src/service/arm/mockup-service.c                   |   10 +-
 src/service/arm/mockup_service                     |  130 -
 src/service/arm/test_arm_api_data.conf             |   12 +-
 src/service/arm/test_exponential_backoff.c         |  220 +-
 src/service/cadet/.gitignore                       |    2 -
 src/service/cadet/cadet_protocol.h                 |    2 +-
 src/service/cadet/gnunet-service-cadet_channel.c   |    2 +-
 src/service/cadet/gnunet-service-cadet_dht.c       |    2 +-
 src/service/cadet/gnunet-service-cadet_peer.c      |    2 +-
 src/service/cadet/gnunet-service-cadet_tunnels.c   |    2 +-
 src/service/cadet/gnunet-service-cadet_tunnels.h   |    2 +-
 src/service/core/.gitignore                        |    9 -
 src/service/core/gnunet-service-core_kx.c          |  298 +-
 src/service/core/meson.build                       |   18 +-
 src/service/datacache/.gitignore                   |    6 -
 src/service/datastore/.gitignore                   |   15 -
 src/service/dht/.gitignore                         |    8 -
 src/service/dht/Makefile.am                        |    1 +
 src/service/dht/dht.h                              |   59 +
 src/service/dht/dht_helper.c                       |  271 ++
 src/service/dht/dht_helper.h                       |   89 +
 src/service/dht/gnunet-dht-tvg.c                   |  168 +
 src/service/dht/gnunet-service-dht_clients.c       |   82 +-
 src/service/dht/gnunet-service-dht_neighbours.c    |  325 +-
 src/service/dht/meson.build                        |   13 +-
 src/service/dns/.gitignore                         |    7 -
 src/service/dns/gnunet-service-dns.c               |    2 +-
 src/service/exit/.gitignore                        |    2 -
 src/service/fs/.gitignore                          |   36 -
 src/service/fs/fs_api.h                            |    2 +-
 src/service/fs/gnunet-service-fs_cadet_server.c    |    2 +-
 src/service/gns/.gitignore                         |   12 -
 src/service/gns/gnunet-dns2gns.c                   |    2 +-
 src/service/gns/gnunet-service-gns_interceptor.c   |    2 +-
 src/service/hostlist/.gitignore                    |    4 -
 .../hostlist/gnunet-daemon-hostlist_client.c       |    2 +-
 .../hostlist/gnunet-daemon-hostlist_server.c       |    2 +-
 src/service/hostlist/hostlist.conf                 |    4 +-
 src/service/identity/.gitignore                    |    4 -
 src/service/identity/test_identity.c               |    2 +-
 src/service/messenger/.gitignore                   |   14 -
 .../gnunet-service-messenger_message_state.c       |    5 +-
 src/service/messenger/messenger_api.c              |  260 +-
 src/service/messenger/messenger_api_message.c      |  174 +-
 .../messenger/messenger_api_message_control.c      |    3 +-
 .../messenger/messenger_api_queue_messages.c       |   21 +-
 .../messenger/messenger_api_queue_messages.h       |    4 +-
 src/service/messenger/messenger_api_room.c         |  123 +-
 src/service/messenger/messenger_api_room.h         |    1 +
 src/service/namecache/.gitignore                   |    6 -
 src/service/namestore/.gitignore                   |   60 -
 src/service/namestore/gnunet-service-namestore.c   |   46 +-
 src/service/namestore/namestore.h                  |   13 +-
 src/service/namestore/namestore_api.c              |    1 +
 src/service/nat-auto/.gitignore                    |    2 -
 src/service/nat/.gitignore                         |    5 -
 src/service/nse/.gitignore                         |    5 -
 src/service/nse/gnunet-service-nse.c               |    2 +-
 src/service/peerstore/.gitignore                   |    9 -
 src/service/peerstore/gnunet-service-peerstore.c   |    6 +-
 src/service/pt/.gitignore                          |    6 -
 src/service/reclaim/.gitignore                     |    5 -
 src/service/reclaim/did_core.c                     |    2 +-
 src/service/reclaim/did_core.h                     |   10 +-
 src/service/reclaim/gnunet-service-reclaim.c       |    8 +-
 .../reclaim/gnunet-service-reclaim_tickets.c       |    2 +-
 src/service/reclaim/test_did_helper.c              |    2 +-
 src/service/regex/.gitignore                       |   11 -
 src/service/rest/.gitignore                        |    1 -
 src/service/rest/identity_plugin.c                 |   36 +-
 src/service/rest/oidc_helper.c                     |    2 +-
 src/service/rest/oidc_helper.h                     |    2 +-
 src/service/rest/openid_plugin.c                   |    6 +-
 src/service/revocation/.gitignore                  |    5 -
 src/service/seti/.gitignore                        |    3 -
 src/service/seti/gnunet-service-seti.c             |    4 +-
 src/service/setu/.gitignore                        |    7 -
 src/service/setu/gnunet-service-setu.c             |    4 +-
 src/service/setu/ibf_sim.c                         |    2 +-
 src/service/statistics/.gitignore                  |    7 -
 src/service/testbed/.gitignore                     |    1 -
 src/service/testbed/testbed.c                      |    2 +-
 src/service/topology/.gitignore                    |    2 -
 src/service/topology/gnunet-daemon-topology.c      |    2 +-
 src/service/transport/.gitignore                   |   94 -
 src/service/transport/Makefile.am                  |   46 +
 src/service/transport/gnunet-communicator-http3.c  | 3944 ++++++++++++++++++++
 src/service/transport/gnunet-communicator-tcp.c    |  169 +-
 src/service/transport/gnunet-communicator-udp.c    |  197 +-
 src/service/transport/gnunet-service-transport.c   |  102 +-
 src/service/transport/gnunet-transport.c           |    4 +-
 src/service/transport/meson.build                  |   47 +-
 src/service/transport/test_communicator_basic.c    |   26 +-
 .../test_communicator_http3_basic_peer1.conf       |   47 +
 .../test_communicator_http3_basic_peer2.conf       |   47 +
 .../test_communicator_http3_bidirect_peer1.conf    |   47 +
 .../test_communicator_http3_bidirect_peer2.conf    |   47 +
 .../transport/transport-testing-communicator.c     |   14 +-
 src/service/transport/transport-testing2.h         |    2 +-
 .../transport/transport_api2_communication.c       |    4 +-
 src/service/transport/transport_api2_core.c        |    2 +-
 .../transport_api_cmd_send_simple_performance.c    |    2 +-
 src/service/util/.gitignore                        |    1 -
 src/service/vpn/.gitignore                         |    3 -
 src/service/zonemaster/.gitignore                  |    2 -
 x86_64-aarch64-linux-android.txt                   |   15 +
 308 files changed, 11464 insertions(+), 5602 deletions(-)

diff --cc src/service/transport/gnunet-communicator-udp.c
index 134679e21,6e4de9626..9ac306fd8
--- a/src/service/transport/gnunet-communicator-udp.c
+++ b/src/service/transport/gnunet-communicator-udp.c
@@@ -871,8 -865,28 +881,31 @@@ char *my_ipv4
   */
  static int disable_v6;
  
 +static struct GNUNET_SCHEDULER_Task *burst_task;
 +
++
+ static void
+ eddsa_priv_to_hpke_key (struct GNUNET_CRYPTO_EddsaPrivateKey *edpk,
+                         struct GNUNET_CRYPTO_EcdhePrivateKey *pk)
+ {
+   struct GNUNET_CRYPTO_PrivateKey key;
+   key.type = htonl (GNUNET_PUBLIC_KEY_TYPE_EDDSA);
+   key.eddsa_key = *edpk;
+   GNUNET_CRYPTO_hpke_sk_to_x25519 (&key, pk);
+ }
+ 
+ 
+ static void
+ eddsa_pub_to_hpke_key (struct GNUNET_CRYPTO_EddsaPublicKey *edpk,
+                        struct GNUNET_CRYPTO_EcdhePublicKey *pk)
+ {
+   struct GNUNET_CRYPTO_PublicKey key;
+   key.type = htonl (GNUNET_PUBLIC_KEY_TYPE_EDDSA);
+   key.eddsa_key = *edpk;
+   GNUNET_CRYPTO_hpke_pk_to_x25519 (&key, pk);
+ }
+ 
+ 
  /**
   * An interface went away, stop broadcasting on it.
   *
@@@ -3721,11 -3605,12 +3745,12 @@@ run (void *cls
      return;
    }
    GNUNET_CRYPTO_eddsa_key_get_public (my_private_key, 
&my_identity.public_key);
+   eddsa_priv_to_hpke_key (my_private_key, &my_x25519_private_key);
    /* start reading */
    read_task = GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL,
 -                                             udp_sock,
 +                                             default_udp_sock,
                                               &sock_read,
 -                                             NULL);
 +                                             default_udp_sock);
    ch = GNUNET_TRANSPORT_communicator_connect (cfg,
                                                COMMUNICATOR_CONFIG_SECTION,
                                                COMMUNICATOR_ADDRESS_PREFIX,
diff --cc src/service/transport/gnunet-service-transport.c
index c0ae26a2f,be8afafab..2e499a332
--- a/src/service/transport/gnunet-service-transport.c
+++ b/src/service/transport/gnunet-service-transport.c
@@@ -9759,203 -9656,7 +9767,204 @@@ check_flow_control (void *cls, const st
    }
  }
  
+ 
 +static struct GNUNET_TIME_Relative
 +calculate_rtt (struct DistanceVector *dv)
 +{
 +  struct GNUNET_TIME_Relative ret = GNUNET_TIME_UNIT_ZERO;
 +  unsigned int n_hops = 0;
 +
 +  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
 +              "calculate_rtt\n");
 +  for (struct DistanceVectorHop *pos = dv->dv_head; NULL != pos;
 +         pos = pos->next_dv)
 +  {
 +    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
 +                "calculate_rtt %lu\n",
 +                pos->pd.aged_rtt.rel_value_us);
 +    n_hops++;
 +    ret = GNUNET_TIME_relative_add (GNUNET_TIME_relative_multiply 
(pos->pd.aged_rtt, pos->distance + 2), ret);
 +  }
 +
 +  GNUNET_assert (0 != n_hops);
 +
 +  return ret ;
 +}
 +
 +static void
 +iterate_address_start_burst (void *cls,
 +                             const struct GNUNET_PeerIdentity *pid,
 +                             const char *uri)
 +{
 +  struct VirtualLink *vl = cls;
 +  const char *slash;
 +  char *address_uri;
 +  char *prefix;
 +  char *uri_without_port;
 +
 +  slash = strrchr (uri, '/');
 +  prefix = GNUNET_strndup (uri, (slash - uri) - 2);
 +  GNUNET_assert (NULL != slash);
 +  slash++;
 +  GNUNET_asprintf (&address_uri,
 +                   "%s-%s",
 +                   prefix,
 +                   slash);
 +
 +  uri_without_port = get_address_without_port (address_uri);
 +  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
 +              "iterate_address_start_burst %s %s %s %s\n",
 +              uri_without_port,
 +              uri,
 +              address_uri,
 +              slash);
 +  if (0 == strcmp (uri_without_port, slash))
 +  {
 +    vl->burst_addr = GNUNET_strndup (uri_without_port, strlen 
(uri_without_port));
 +  }
 +  else
 +    vl->burst_addr = NULL;
 +
 +  GNUNET_free (prefix);
 +  GNUNET_free (uri_without_port);
 +}
 +
 +
 +static void
 +check_for_burst_address (void *cls,
 +                        const struct GNUNET_PEERSTORE_Record *record,
 +                        const char *emsg)
 +{
 +  struct GNUNET_StartBurstCls *sb_cls = cls;
 +  struct VirtualLink *vl = sb_cls->vl;
 +  struct GNUNET_MessageHeader *hello;
 +  struct GNUNET_HELLO_Builder *builder;
 +
 +  if (NULL != emsg)
 +  {
 +    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
 +         "Got failure from PEERSTORE: %s\n",
 +         emsg);
 +    return;
 +  }
 +  if (NULL == record)
 +  {
 +    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
 +                "Hello iteration end for %s\n",
 +                GNUNET_i2s (&vl->target));
 +    vl->ic = NULL;
 +    GNUNET_free (sb_cls);
 +    return;
 +  }
 +
 +  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
 +              "check_for_burst_address\n");
 +  hello = record->value;
 +  builder = GNUNET_HELLO_builder_from_msg (hello);
 +  GNUNET_HELLO_builder_iterate (builder,
 +                                &iterate_address_start_burst,
 +                                vl);
 +  GNUNET_HELLO_builder_free (builder);
 +
 +  GNUNET_PEERSTORE_iteration_stop (vl->ic);
 +  GNUNET_free (sb_cls);
 +}
 +
 +
 +static void
 +burst_timeout (void *cls)
 +{
 +  burst_running = GNUNET_NO;
 +}
 +
 +
 +static void
 +start_burst (void *cls)
 +{
 +  struct GNUNET_StartBurstCls *sb_cls = cls;
 +  struct VirtualLink *vl = sb_cls->vl;
 +  struct GNUNET_TRANSPORT_StartBurst *sb;
 +  struct GNUNET_MQ_Envelope *env;
 +  char *uri_without_port = vl->burst_addr;
 +
 +  burst_task = NULL;
 +  /*char buf[strlen (uri_without_port) + 1];
 +
 +  GNUNET_memcpy (buf, uri_without_port,  strlen (uri_without_port));
 +  buf[strlen (uri_without_port)] = '\0';*/
 +  env =
 +    GNUNET_MQ_msg_extra (sb ,
 +                         strlen (uri_without_port) + 1,
 +                         GNUNET_MESSAGE_TYPE_TRANSPORT_START_BURST);
 +  sb->rtt = GNUNET_TIME_relative_hton (sb_cls->rtt);
 +  sb->pid = vl->target;
 +  memcpy (&sb[1], uri_without_port, strlen (uri_without_port) + 1);
 +  for (struct TransportClient *tc = clients_head; NULL != tc; tc = tc->next)
 +  {
 +    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
 +                "iterate_address_start_burst client tc prefix %s\n",
 +                tc->details.communicator.address_prefix);
 +    if (CT_COMMUNICATOR != tc->type)
 +      continue;
 +    if (GNUNET_YES == tc->details.communicator.can_burst){
 +      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
 +                  "iterate_address_start_burst %s call %lu %u rtt %lu\n",
 +                  uri_without_port,
 +                  strlen (uri_without_port),
 +                  ntohs (sb->header.size),
 +                  sb_cls->rtt.rel_value_us);
 +      GNUNET_MQ_send (tc->mq, env);
 +      burst_running = GNUNET_YES;
 +      burst_timeout_task = GNUNET_SCHEDULER_add_delayed 
(GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS,
 +                                                                              
          60),
 +                                                         &burst_timeout,
 +                                                         NULL);
 +      //TODO We need some algo to choose from available communicators. Can we 
run two bursts at once? Atm we only implemented udp burst.
 +      break;
 +    }
 +  }
 +  GNUNET_free (sb_cls);
 +}
 +
 +
 +static void
 +queue_burst (void *cls)
 +{
 +  struct GNUNET_StartBurstCls *sb_cls = cls;
 +  struct VirtualLink *vl = sb_cls->vl;
 +
 +  if (GNUNET_YES != use_burst)
 +    return;
 +  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
 +              "burst_task %p ready %s burst addr %s (%p)\n",
 +              burst_task,
 +              sb_cls->sync_ready ? "yes" : "no",
 +              vl->burst_addr,
 +              vl->burst_addr);
 +  if (NULL != burst_task && GNUNET_NO == sb_cls->sync_ready)
 +  {
 +    GNUNET_SCHEDULER_cancel (burst_task);
 +    burst_task = NULL;
 +    GNUNET_free (sb_cls);
 +    return;
 +  }
 +  if (GNUNET_NO == burst_running && NULL != vl->burst_addr && NULL == 
burst_task)
 +  {
 +    burst_task = GNUNET_SCHEDULER_add_delayed (sb_cls->delay,
 +                                  &start_burst,
 +                                  sb_cls);
 +  }
 +  else if (NULL == vl->burst_addr)
 +  {
 +    vl->ic = GNUNET_PEERSTORE_iteration_start (peerstore,
 +                                               "peerstore",
 +                                               &vl->target,
 +                                               GNUNET_PEERSTORE_HELLO_KEY,
 +                                               check_for_burst_address,
 +                                               sb_cls);
 +  }
 +}
 +
  /**
   * Communicator gave us a transport address validation response.  Process the
   * request.
@@@ -12066,13 -11701,7 +12077,13 @@@ contains_address (void *cls
    struct TransportGlobalNattedAddress *tgna = value;
    char *addr = (char *) &tgna[1];
  
 +  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
 +              "Checking tgna %p with addr %s and length %u compare length 
%lu\n",
 +              tgna,
 +              addr,
 +              ntohl (tgna->address_length),
 +              strlen(tgna_cls->addr));
-   if (strlen(tgna_cls->addr) == ntohl (tgna->address_length)
+   if (strlen (tgna_cls->addr) == ntohl (tgna->address_length)
        && 0 == strncmp (addr, tgna_cls->addr, ntohl (tgna->address_length)))
    {
      tgna_cls->tgna = tgna;
@@@ -12113,8 -11726,13 +12124,8 @@@ check_for_global_natted (void *cls
    if (NULL != emsg)
    {
      GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-          "Got failure from PEERSTORE: %s\n",
-          emsg);
 -                "Got failure from PEERSTORE: %s\n",
 -                emsg);
 -    return;
 -  }
 -  if (NULL == record)
 -  {
 -    queue->mo = NULL;
++              "Got failure from PEERSTORE: %s\n",
++              emsg);
      return;
    }
    if (0 == record->value_size)

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]