[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r27251 - in gnunet: po src/consensus src/include src/set sr
From: |
gnunet |
Subject: |
[GNUnet-SVN] r27251 - in gnunet: po src/consensus src/include src/set src/stream src/util |
Date: |
Wed, 22 May 2013 12:29:15 +0200 |
Author: dold
Date: 2013-05-22 12:29:15 +0200 (Wed, 22 May 2013)
New Revision: 27251
Added:
gnunet/src/include/gnunet_mq_lib.h
gnunet/src/set/gnunet-set-ibf.c
gnunet/src/util/mq.c
gnunet/src/util/test_mq.c
gnunet/src/util/test_mq_client.c
Removed:
gnunet/src/consensus/gnunet-consensus-ibf.c
gnunet/src/consensus/ibf.c
gnunet/src/consensus/ibf.h
gnunet/src/consensus/strata_estimator.c
gnunet/src/consensus/strata_estimator.h
gnunet/src/set/gnunet-set-bug.c
gnunet/src/set/mq.c
gnunet/src/set/mq.h
gnunet/src/set/test_mq.c
gnunet/src/set/test_mq_client.c
Modified:
gnunet/po/de.po
gnunet/po/es.po
gnunet/po/sv.po
gnunet/po/vi.po
gnunet/po/zh_CN.po
gnunet/src/consensus/Makefile.am
gnunet/src/consensus/consensus.h
gnunet/src/consensus/consensus_protocol.h
gnunet/src/consensus/gnunet-service-consensus.c
gnunet/src/include/gnunet_set_service.h
gnunet/src/include/gnunet_stream_lib.h
gnunet/src/include/gnunet_util_lib.h
gnunet/src/set/Makefile.am
gnunet/src/set/gnunet-service-set.c
gnunet/src/set/gnunet-service-set.h
gnunet/src/set/gnunet-service-set_union.c
gnunet/src/set/gnunet-set.c
gnunet/src/set/set_api.c
gnunet/src/set/test_set_api.c
gnunet/src/stream/stream_api.c
gnunet/src/util/Makefile.am
Log:
- moved MQ to util
- MQ support for stream
- set api
- starting to use set for consensus
Modified: gnunet/po/de.po
===================================================================
--- gnunet/po/de.po 2013-05-22 10:27:24 UTC (rev 27250)
+++ gnunet/po/de.po 2013-05-22 10:29:15 UTC (rev 27251)
@@ -7,7 +7,7 @@
msgstr ""
"Project-Id-Version: GNUnet 0.7.0b\n"
"Report-Msgid-Bugs-To: address@hidden"
-"POT-Creation-Date: 2013-04-27 12:39+0200\n"
+"POT-Creation-Date: 2013-05-20 15:09+0200\n"
"PO-Revision-Date: 2006-03-17 21:37+0100\n"
"Last-Translator: Nils Durner <address@hidden>\n"
"Language-Team: German <address@hidden>\n"
@@ -36,89 +36,89 @@
msgid "Failed to remove servicehome directory %s\n"
msgstr "Dateiformat fehlerhaft (kein GNUnet Verzeichnis?)\n"
-#: src/arm/gnunet-arm.c:204 src/testbed/gnunet-service-testbed_peers.c:712
+#: src/arm/gnunet-arm.c:204 src/testbed/gnunet-service-testbed_peers.c:962
msgid "Message was sent successfully"
msgstr ""
-#: src/arm/gnunet-arm.c:206 src/testbed/gnunet-service-testbed_peers.c:714
+#: src/arm/gnunet-arm.c:206 src/testbed/gnunet-service-testbed_peers.c:964
#, fuzzy
msgid "Misconfiguration (can't connect to the ARM service)"
msgstr "Es konnte keine Verbindung mit gnunetd hergestellt werden.\n"
-#: src/arm/gnunet-arm.c:208 src/testbed/gnunet-service-testbed_peers.c:716
+#: src/arm/gnunet-arm.c:208 src/testbed/gnunet-service-testbed_peers.c:966
#, fuzzy
msgid "We disconnected from ARM before we could send a request"
msgstr "# gap Anfragen verworfen: Kollision in RT"
-#: src/arm/gnunet-arm.c:210 src/testbed/gnunet-service-testbed_peers.c:718
+#: src/arm/gnunet-arm.c:210 src/testbed/gnunet-service-testbed_peers.c:968
msgid "ARM API is busy"
msgstr ""
-#: src/arm/gnunet-arm.c:212 src/testbed/gnunet-service-testbed_peers.c:720
+#: src/arm/gnunet-arm.c:212 src/testbed/gnunet-service-testbed_peers.c:970
msgid "Request doesn't fit into a message"
msgstr ""
-#: src/arm/gnunet-arm.c:214 src/testbed/gnunet-service-testbed_peers.c:722
+#: src/arm/gnunet-arm.c:214 src/testbed/gnunet-service-testbed_peers.c:972
#, fuzzy
msgid "Request timed out"
msgstr "# Sitzungsschlüssel akzeptiert"
-#: src/arm/gnunet-arm.c:216 src/testbed/gnunet-service-testbed_peers.c:724
+#: src/arm/gnunet-arm.c:216 src/testbed/gnunet-service-testbed_peers.c:974
#, fuzzy
msgid "Unknown request status"
msgstr "Unbekannte Operation `%s'\n"
-#: src/arm/gnunet-arm.c:232 src/testbed/gnunet-service-testbed_peers.c:740
+#: src/arm/gnunet-arm.c:232 src/testbed/gnunet-service-testbed_peers.c:990
#, fuzzy, c-format
msgid "%s is stopped"
msgstr "# bytes in der Datenbank"
-#: src/arm/gnunet-arm.c:234 src/testbed/gnunet-service-testbed_peers.c:742
+#: src/arm/gnunet-arm.c:234 src/testbed/gnunet-service-testbed_peers.c:992
#, fuzzy, c-format
msgid "%s is starting"
msgstr "`%s' startet\n"
-#: src/arm/gnunet-arm.c:236 src/testbed/gnunet-service-testbed_peers.c:744
+#: src/arm/gnunet-arm.c:236 src/testbed/gnunet-service-testbed_peers.c:994
#, c-format
msgid "%s is stopping"
msgstr ""
-#: src/arm/gnunet-arm.c:238 src/testbed/gnunet-service-testbed_peers.c:746
+#: src/arm/gnunet-arm.c:238 src/testbed/gnunet-service-testbed_peers.c:996
#, fuzzy, c-format
msgid "%s is starting already"
msgstr "`%s' startet\n"
-#: src/arm/gnunet-arm.c:240 src/testbed/gnunet-service-testbed_peers.c:748
+#: src/arm/gnunet-arm.c:240 src/testbed/gnunet-service-testbed_peers.c:998
#, c-format
msgid "%s is stopping already"
msgstr ""
-#: src/arm/gnunet-arm.c:242 src/testbed/gnunet-service-testbed_peers.c:750
+#: src/arm/gnunet-arm.c:242 src/testbed/gnunet-service-testbed_peers.c:1000
#, c-format
msgid "%s is started already"
msgstr ""
-#: src/arm/gnunet-arm.c:244 src/testbed/gnunet-service-testbed_peers.c:752
+#: src/arm/gnunet-arm.c:244 src/testbed/gnunet-service-testbed_peers.c:1002
#, c-format
msgid "%s is stopped already"
msgstr ""
-#: src/arm/gnunet-arm.c:246 src/testbed/gnunet-service-testbed_peers.c:754
+#: src/arm/gnunet-arm.c:246 src/testbed/gnunet-service-testbed_peers.c:1004
#, fuzzy, c-format
msgid "%s service is not known to ARM"
msgstr "Namespace `%s' hat das Rating %d.\n"
-#: src/arm/gnunet-arm.c:248 src/testbed/gnunet-service-testbed_peers.c:756
+#: src/arm/gnunet-arm.c:248 src/testbed/gnunet-service-testbed_peers.c:1006
#, fuzzy, c-format
msgid "%s service failed to start"
msgstr "Fehler beim Starten der Collection.\n"
-#: src/arm/gnunet-arm.c:250 src/testbed/gnunet-service-testbed_peers.c:758
+#: src/arm/gnunet-arm.c:250 src/testbed/gnunet-service-testbed_peers.c:1008
#, fuzzy, c-format
msgid "%s service can't be started because ARM is shutting down"
msgstr "`%s' fährt herunter.\n"
-#: src/arm/gnunet-arm.c:252 src/testbed/gnunet-service-testbed_peers.c:760
+#: src/arm/gnunet-arm.c:252 src/testbed/gnunet-service-testbed_peers.c:1010
#, c-format
msgid "%.s Unknown result code."
msgstr ""
@@ -844,8 +844,8 @@
#: src/transport/gnunet-service-transport_neighbours.c:1041
#: src/transport/gnunet-service-transport_neighbours.c:1265
#: src/transport/gnunet-service-transport_neighbours.c:1274
-#: src/transport/gnunet-service-transport_neighbours.c:2794
-#: src/transport/gnunet-service-transport_neighbours.c:3053
+#: src/transport/gnunet-service-transport_neighbours.c:2798
+#: src/transport/gnunet-service-transport_neighbours.c:3057
#, fuzzy
msgid "# peers connected"
msgstr "# verbundener Knoten"
@@ -1332,7 +1332,7 @@
#: src/dht/gnunet-dht-put.c:213 src/fs/gnunet-auto-share.c:753
#: src/fs/gnunet-download.c:328 src/fs/gnunet-publish.c:736
#: src/fs/gnunet-search.c:294 src/fs/gnunet-unindex.c:168
-#: src/nse/gnunet-nse-profiler.c:900
+#: src/nse/gnunet-nse-profiler.c:899
msgid "be verbose (print progress information)"
msgstr ""
@@ -2243,7 +2243,7 @@
msgid "no-name"
msgstr "Name anzeigen"
-#: src/fs/fs_pseudonym.c:1182 src/util/crypto_ecc.c:975
+#: src/fs/fs_pseudonym.c:1182 src/util/crypto_ecc.c:1014
#, fuzzy, c-format
msgid "ECC signing failed at %s:%d: %s\n"
msgstr "`%s' schlug fehl bei %s:%d mit dem Fehler: `%s'.\n"
@@ -2447,12 +2447,12 @@
msgid "Unrecognized URI type"
msgstr ""
-#: src/fs/fs_uri.c:898
+#: src/fs/fs_uri.c:898 src/util/crypto_ecc.c:941
#, fuzzy
msgid "Lacking key configuration settings.\n"
msgstr "GNUnet Konfiguration"
-#: src/fs/fs_uri.c:904
+#: src/fs/fs_uri.c:904 src/util/crypto_ecc.c:947
#, fuzzy, c-format
msgid "Could not access hostkey file `%s'.\n"
msgstr "Konfigurationsdatei `%s' konnte nicht geparst werden.\n"
@@ -3797,16 +3797,16 @@
msgid "Hostlist file `%s' could not be removed\n"
msgstr "Sitzungsschlüssel von Knoten `%s' konnte nicht überprüft werden.\n"
-#: src/hostlist/hostlist-server.c:134
+#: src/hostlist/hostlist-server.c:137
#, fuzzy
msgid "bytes in hostlist"
msgstr "# bytes in der Datenbank"
-#: src/hostlist/hostlist-server.c:157
+#: src/hostlist/hostlist-server.c:161
msgid "expired addresses encountered"
msgstr ""
-#: src/hostlist/hostlist-server.c:184 src/hostlist/hostlist-server.c:421
+#: src/hostlist/hostlist-server.c:189 src/hostlist/hostlist-server.c:424
#: src/peerinfo-tool/gnunet-peerinfo.c:348
#: src/peerinfo-tool/gnunet-peerinfo.c:418
#: src/peerinfo-tool/gnunet-peerinfo.c:489
@@ -3815,88 +3815,88 @@
msgid "Error in communication with PEERINFO service: %s\n"
msgstr "Informationen über andere GNUnet Knoten ausgeben."
-#: src/hostlist/hostlist-server.c:205
+#: src/hostlist/hostlist-server.c:210
msgid "HELLOs without addresses encountered (ignored)"
msgstr ""
-#: src/hostlist/hostlist-server.c:219
+#: src/hostlist/hostlist-server.c:224
msgid "bytes not included in hostlist (size limit)"
msgstr ""
-#: src/hostlist/hostlist-server.c:263
+#: src/hostlist/hostlist-server.c:268
#, fuzzy, c-format
msgid "Refusing `%s' request to hostlist server\n"
msgstr "Fehler beim Senden einer `%s' Anfrage an den SMTP Server.\n"
-#: src/hostlist/hostlist-server.c:266
+#: src/hostlist/hostlist-server.c:271
#, fuzzy
msgid "hostlist requests refused (not HTTP GET)"
msgstr "# Client Trace-Anfragen empfangen"
-#: src/hostlist/hostlist-server.c:279
+#: src/hostlist/hostlist-server.c:284
#, c-format
msgid "Refusing `%s' request with %llu bytes of upload data\n"
msgstr ""
-#: src/hostlist/hostlist-server.c:283
+#: src/hostlist/hostlist-server.c:288
#, fuzzy
msgid "hostlist requests refused (upload data)"
msgstr "# Client Trace-Anfragen empfangen"
-#: src/hostlist/hostlist-server.c:291
+#: src/hostlist/hostlist-server.c:296
msgid "Could not handle hostlist request since I do not have a response yet\n"
msgstr ""
-#: src/hostlist/hostlist-server.c:294
+#: src/hostlist/hostlist-server.c:299
#, fuzzy
msgid "hostlist requests refused (not ready)"
msgstr "# Client Trace-Anfragen empfangen"
-#: src/hostlist/hostlist-server.c:298
+#: src/hostlist/hostlist-server.c:303
msgid "Received request for our hostlist\n"
msgstr ""
-#: src/hostlist/hostlist-server.c:299
+#: src/hostlist/hostlist-server.c:304
#, fuzzy
msgid "hostlist requests processed"
msgstr "# Client Trace-Anfragen empfangen"
-#: src/hostlist/hostlist-server.c:341
+#: src/hostlist/hostlist-server.c:346
#, fuzzy
msgid "# hostlist advertisements send"
msgstr "# Bekanntmachungen von anderen übertragen"
-#: src/hostlist/hostlist-server.c:384
+#: src/hostlist/hostlist-server.c:389
msgid "Advertisement message could not be queued by core\n"
msgstr ""
-#: src/hostlist/hostlist-server.c:548 src/peerinfo-tool/gnunet-peerinfo.c:649
+#: src/hostlist/hostlist-server.c:560 src/peerinfo-tool/gnunet-peerinfo.c:649
#: src/transport/gnunet-service-transport.c:661
#, fuzzy
msgid "Could not access PEERINFO service. Exiting.\n"
msgstr "Auf die Namespace Informationen konnte nicht zugegriffen werden.\n"
-#: src/hostlist/hostlist-server.c:558
+#: src/hostlist/hostlist-server.c:570
#, fuzzy, c-format
msgid "Invalid port number %llu. Exiting.\n"
msgstr "Ungültige Parameter. Abbruch.\n"
-#: src/hostlist/hostlist-server.c:567
+#: src/hostlist/hostlist-server.c:579
#, c-format
msgid "Hostlist service starts on %s:%llu\n"
msgstr ""
-#: src/hostlist/hostlist-server.c:581
+#: src/hostlist/hostlist-server.c:593
#, fuzzy, c-format
msgid "Address to obtain hostlist: `%s'\n"
msgstr "Fehler beim Lesen der Freunde-Liste von `%s'\n"
-#: src/hostlist/hostlist-server.c:621
+#: src/hostlist/hostlist-server.c:633
#, fuzzy, c-format
msgid "`%s' is not a valid IP address! Ignoring BINDTOIP.\n"
msgstr "`%s' ist nicht verfügbar."
-#: src/hostlist/hostlist-server.c:663
+#: src/hostlist/hostlist-server.c:675
#, fuzzy, c-format
msgid "Could not start hostlist HTTP server on port %u\n"
msgstr "Der Transportdienst auf Port %d konnte nicht gestartet werden.\n"
@@ -3936,11 +3936,11 @@
msgid "Print information about mesh tunnels and peers."
msgstr "Informationen über andere GNUnet Knoten ausgeben."
-#: src/mesh/gnunet-service-mesh.c:7966 src/mesh/gnunet-service-mesh-new.c:7972
+#: src/mesh/gnunet-service-mesh.c:7966 src/mesh/gnunet-service-mesh-new.c:4649
msgid "Wrong CORE service\n"
msgstr ""
-#: src/mesh/gnunet-service-mesh.c:8179 src/mesh/gnunet-service-mesh-new.c:8185
+#: src/mesh/gnunet-service-mesh.c:8179 src/mesh/gnunet-service-mesh-new.c:4790
#, fuzzy, c-format
msgid "Mesh service could not access hostkey: %s. Exiting.\n"
msgstr "Auf die Namespace Informationen konnte nicht zugegriffen werden.\n"
@@ -3948,14 +3948,13 @@
#: src/mesh/gnunet-service-mesh.c:8261 src/mesh/gnunet-service-mesh.c:8273
#: src/mesh/gnunet-service-mesh.c:8285 src/mesh/gnunet-service-mesh.c:8299
#: src/mesh/gnunet-service-mesh.c:8311 src/mesh/gnunet-service-mesh.c:8323
-#: src/mesh/gnunet-service-mesh.c:8335 src/mesh/gnunet-service-mesh-new.c:8274
-#: src/mesh/gnunet-service-mesh-new.c:8286
-#: src/mesh/gnunet-service-mesh-new.c:8298
-#: src/mesh/gnunet-service-mesh-new.c:8312
-#: src/mesh/gnunet-service-mesh-new.c:8324
-#: src/mesh/gnunet-service-mesh-new.c:8336
-#: src/mesh/gnunet-service-mesh-new.c:8348 src/nse/gnunet-service-nse.c:1516
-#: src/nse/gnunet-service-nse.c:1534
+#: src/mesh/gnunet-service-mesh.c:8335 src/mesh/gnunet-service-mesh-new.c:4860
+#: src/mesh/gnunet-service-mesh-new.c:4872
+#: src/mesh/gnunet-service-mesh-new.c:4884
+#: src/mesh/gnunet-service-mesh-new.c:4896
+#: src/mesh/gnunet-service-mesh-new.c:4908
+#: src/mesh/gnunet-service-mesh-new.c:4920 src/nse/gnunet-service-nse.c:1500
+#: src/nse/gnunet-service-nse.c:1518
#: src/regex/gnunet-daemon-regexprofiler.c:320
#: src/regex/gnunet-daemon-regexprofiler.c:332
#: src/regex/gnunet-daemon-regexprofiler.c:344
@@ -3966,9 +3965,9 @@
msgstr "GNUnet Konfiguration"
#: src/mesh/gnunet-service-mesh.c:8347 src/mesh/gnunet-service-mesh.c:8357
-#: src/mesh/gnunet-service-mesh.c:8368 src/mesh/gnunet-service-mesh-new.c:8360
-#: src/mesh/gnunet-service-mesh-new.c:8370
-#: src/mesh/gnunet-service-mesh-new.c:8381
+#: src/mesh/gnunet-service-mesh.c:8368 src/mesh/gnunet-service-mesh-new.c:4932
+#: src/mesh/gnunet-service-mesh-new.c:4942
+#: src/mesh/gnunet-service-mesh-new.c:4953
#, fuzzy, c-format
msgid ""
"%s service is lacking key configuration settings (%s). Using default (%u).\n"
@@ -4307,32 +4306,32 @@
msgid "gnunet-helper-nat-client not found or behind NAT, disabling it\n"
msgstr ""
-#: src/nat/nat.c:795
+#: src/nat/nat.c:834
#, c-format
msgid "gnunet-helper-nat-server generated malformed address `%s'\n"
msgstr ""
-#: src/nat/nat.c:844
+#: src/nat/nat.c:883
#, fuzzy, c-format
msgid "Failed to start %s\n"
msgstr "Fehler beim Starten der Collection.\n"
-#: src/nat/nat.c:1113
+#: src/nat/nat.c:1152
msgid "malformed"
msgstr ""
-#: src/nat/nat.c:1179 src/nat/nat.c:1191
+#: src/nat/nat.c:1218 src/nat/nat.c:1230
#, c-format
msgid ""
"Configuration requires `%s', but binary is not installed properly (SUID bit "
"not set). Option disabled.\n"
msgstr ""
-#: src/nat/nat.c:1326
+#: src/nat/nat.c:1365
msgid "Internal IP address not known, cannot use ICMP NAT traversal method\n"
msgstr ""
-#: src/nat/nat.c:1337
+#: src/nat/nat.c:1376
#, c-format
msgid "Running gnunet-helper-nat-client %s %s %u\n"
msgstr ""
@@ -4355,46 +4354,46 @@
msgid "Failed to create listen socket bound to `%s' for NAT test: %s\n"
msgstr ""
-#: src/nse/gnunet-nse-profiler.c:885
+#: src/nse/gnunet-nse-profiler.c:884
#, fuzzy
msgid "limit to the number of connections to NSE services, 0 for none"
msgstr "Es konnte keine Verbindung mit gnunetd hergestellt werden."
-#: src/nse/gnunet-nse-profiler.c:888
+#: src/nse/gnunet-nse-profiler.c:887
msgid "name of the file for writing connection information and statistics"
msgstr ""
-#: src/nse/gnunet-nse-profiler.c:891 src/testbed/gnunet-testbed-profiler.c:282
+#: src/nse/gnunet-nse-profiler.c:890 src/testbed/gnunet-testbed-profiler.c:284
msgid "name of the file with the login information for the testbed"
msgstr ""
-#: src/nse/gnunet-nse-profiler.c:894
+#: src/nse/gnunet-nse-profiler.c:893
msgid "name of the file for writing the main results"
msgstr ""
-#: src/nse/gnunet-nse-profiler.c:897
+#: src/nse/gnunet-nse-profiler.c:896
msgid "Number of peers to run in each round, separated by commas"
msgstr ""
-#: src/nse/gnunet-nse-profiler.c:903
+#: src/nse/gnunet-nse-profiler.c:902
msgid "delay between rounds"
msgstr ""
-#: src/nse/gnunet-nse-profiler.c:912
+#: src/nse/gnunet-nse-profiler.c:911
#, fuzzy
msgid "Measure quality and performance of the NSE service."
msgstr "Auf den Dienst konnte nicht zugegriffen werden"
-#: src/nse/gnunet-service-nse.c:1405
+#: src/nse/gnunet-service-nse.c:1419
#, fuzzy, c-format
msgid "NSE service could not access hostkey: %s\n"
msgstr "Auf die Namespace Informationen konnte nicht zugegriffen werden.\n"
-#: src/nse/gnunet-service-nse.c:1419
+#: src/nse/gnunet-service-nse.c:1433
msgid "NSE service is lacking key configuration settings. Exiting.\n"
msgstr ""
-#: src/nse/gnunet-service-nse.c:1524
+#: src/nse/gnunet-service-nse.c:1508
#, fuzzy
msgid "Invalid work requirement for NSE service. Exiting.\n"
msgstr "Ungültige Parameter. Abbruch.\n"
@@ -4404,21 +4403,21 @@
msgid "Removing expired address of transport `%s'\n"
msgstr "Verfügbare(r) Transport(e): %s\n"
-#: src/peerinfo/gnunet-service-peerinfo.c:354
+#: src/peerinfo/gnunet-service-peerinfo.c:355
#, fuzzy, c-format
msgid "Failed to parse HELLO in file `%s': %s\n"
msgstr "Fehler beim Lesen der Freunde-Liste von `%s'\n"
-#: src/peerinfo/gnunet-service-peerinfo.c:369
+#: src/peerinfo/gnunet-service-peerinfo.c:370
#, fuzzy, c-format
msgid "Failed to parse HELLO in file `%s': %s %u \n"
msgstr "Fehler beim Lesen der Freunde-Liste von `%s'\n"
-#: src/peerinfo/gnunet-service-peerinfo.c:444
+#: src/peerinfo/gnunet-service-peerinfo.c:445
msgid "# peers known"
msgstr ""
-#: src/peerinfo/gnunet-service-peerinfo.c:480
+#: src/peerinfo/gnunet-service-peerinfo.c:481
#, c-format
msgid ""
"File `%s' in directory `%s' does not match naming convention. Removed.\n"
@@ -4426,22 +4425,22 @@
"Die Datei `%s' im Verzeichnis `%s' entspricht nicht der Namenskonvention. "
"Datei wurde entfernt.\n"
-#: src/peerinfo/gnunet-service-peerinfo.c:632
+#: src/peerinfo/gnunet-service-peerinfo.c:633
#, fuzzy, c-format
msgid "Scanning directory `%s'\n"
msgstr "Fehler beim Lesen der Freunde-Liste von `%s'\n"
-#: src/peerinfo/gnunet-service-peerinfo.c:637
+#: src/peerinfo/gnunet-service-peerinfo.c:638
#, fuzzy, c-format
msgid "Still no peers found in `%s'!\n"
msgstr "Dienst `%s' konnte nicht ordentlich entladen werden!\n"
-#: src/peerinfo/gnunet-service-peerinfo.c:969
+#: src/peerinfo/gnunet-service-peerinfo.c:970
#, fuzzy, c-format
msgid "Cleaning up directory `%s'\n"
msgstr "Fehler beim Lesen der Freunde-Liste von `%s'\n"
-#: src/peerinfo/gnunet-service-peerinfo.c:1249
+#: src/peerinfo/gnunet-service-peerinfo.c:1250
#, c-format
msgid "Importing HELLOs from `%s'\n"
msgstr ""
@@ -4658,81 +4657,73 @@
msgid "Daemon to announce regular expressions for the peer using mesh."
msgstr ""
-#: src/regex/gnunet-regex-profiler.c:1246
+#: src/regex/gnunet-regex-profiler.c:1247
#, fuzzy
msgid "No configuration file given. Exiting\n"
msgstr "Konfigurationsdatei FILENAME verwenden"
-#: src/regex/gnunet-regex-profiler.c:1257
+#: src/regex/gnunet-regex-profiler.c:1258
#, fuzzy
msgid "Configuration option \"regex_prefix\" missing. Exiting\n"
msgstr "Konfigurationsdatei `%s' wurde erzeugt.\n"
-#: src/regex/gnunet-regex-profiler.c:1276
-msgid "No hosts-file specified on command line. Exiting.\n"
-msgstr ""
-
-#: src/regex/gnunet-regex-profiler.c:1282
+#: src/regex/gnunet-regex-profiler.c:1287
#: src/regex/gnunet-regex-simulation-profiler.c:622
#, c-format
msgid "No policy directory specified on command line. Exiting.\n"
msgstr ""
-#: src/regex/gnunet-regex-profiler.c:1288
+#: src/regex/gnunet-regex-profiler.c:1293
#: src/regex/gnunet-regex-simulation-profiler.c:629
#, c-format
msgid "Specified policies directory does not exist. Exiting.\n"
msgstr ""
-#: src/regex/gnunet-regex-profiler.c:1295
+#: src/regex/gnunet-regex-profiler.c:1300
#, fuzzy, c-format
msgid "No files found in `%s'\n"
msgstr "Dienst `%s' konnte nicht ordentlich entladen werden!\n"
-#: src/regex/gnunet-regex-profiler.c:1304
+#: src/regex/gnunet-regex-profiler.c:1309
msgid "No search strings file given. Exiting.\n"
msgstr ""
-#: src/regex/gnunet-regex-profiler.c:1314
+#: src/regex/gnunet-regex-profiler.c:1319
#, fuzzy
msgid ""
"Error loading search strings.Given file does not contain enough strings. "
"Exiting.\n"
msgstr "Fehler beim Verlassen der DHT.\n"
-#: src/regex/gnunet-regex-profiler.c:1322
+#: src/regex/gnunet-regex-profiler.c:1327
#, fuzzy
msgid "Error loading search strings. Exiting.\n"
msgstr "Fehler beim Verlassen der DHT.\n"
-#: src/regex/gnunet-regex-profiler.c:1389
+#: src/regex/gnunet-regex-profiler.c:1394
#, fuzzy
msgid "name of the file for writing statistics"
msgstr "Statistiken über den Netzwerkverkehr konnten nicht ermittelt werden.\n"
-#: src/regex/gnunet-regex-profiler.c:1392
-msgid "wait TIMEOUT before considering a string match as failed"
+#: src/regex/gnunet-regex-profiler.c:1397
+msgid "wait TIMEOUT before ending the experiment"
msgstr ""
-#: src/regex/gnunet-regex-profiler.c:1395
-msgid "number of search strings to read from search strings file"
-msgstr ""
-
-#: src/regex/gnunet-regex-profiler.c:1398
+#: src/regex/gnunet-regex-profiler.c:1400
msgid "directory with policy files"
msgstr ""
-#: src/regex/gnunet-regex-profiler.c:1401
+#: src/regex/gnunet-regex-profiler.c:1403
#, fuzzy
msgid "name of file with input strings"
msgstr "Statistiken über den Netzwerkverkehr konnten nicht ermittelt werden.\n"
-#: src/regex/gnunet-regex-profiler.c:1404
+#: src/regex/gnunet-regex-profiler.c:1406
#, fuzzy
msgid "name of file with hosts' names"
msgstr "Statistiken über den Netzwerkverkehr konnten nicht ermittelt werden.\n"
-#: src/regex/gnunet-regex-profiler.c:1416
+#: src/regex/gnunet-regex-profiler.c:1418
msgid "Profiler for regex"
msgstr ""
@@ -4851,7 +4842,7 @@
msgid "Could not parse execution interval for `%s', set to default 60 sec.\n"
msgstr ""
-#: src/testbed/gnunet-service-testbed_cpustatus.c:670
+#: src/testbed/gnunet-service-testbed_cpustatus.c:692
#, c-format
msgid ""
"Cannot open %s for writing load statistics. Not logging load statistics\n"
@@ -4862,28 +4853,28 @@
msgid "Job command file not given. Exiting\n"
msgstr "Konfigurationsdatei FILENAME verwenden"
-#: src/testbed/gnunet_testbed_mpi_spawn.c:135
+#: src/testbed/gnunet_testbed_mpi_spawn.c:125
#, fuzzy
msgid "Waiting for child to exit.\n"
msgstr ""
"Warte darauf, dass sich andere Knoten verbinden (%u Iterationen "
"verbleiben)...\n"
-#: src/testbed/gnunet_testbed_mpi_spawn.c:296
+#: src/testbed/gnunet_testbed_mpi_spawn.c:247
#, fuzzy, c-format
msgid "Spawning process `%s'\n"
msgstr "Collection `%s' begonnen.\n"
-#: src/testbed/gnunet-testbed-profiler.c:249
+#: src/testbed/gnunet-testbed-profiler.c:251
#, fuzzy, c-format
msgid "Exiting as the number of peers is %u\n"
msgstr "Maximale Anzahl an Chat Clients erreicht.\n"
-#: src/testbed/gnunet-testbed-profiler.c:275
+#: src/testbed/gnunet-testbed-profiler.c:277
msgid "create COUNT number of peers"
msgstr ""
-#: src/testbed/gnunet-testbed-profiler.c:278
+#: src/testbed/gnunet-testbed-profiler.c:280
msgid "tolerate COUNT number of continious timeout failures"
msgstr ""
@@ -4902,56 +4893,56 @@
msgid "Hosts file %s cannot be read\n"
msgstr "Sitzungsschlüssel von Knoten `%s' konnte nicht überprüft werden.\n"
-#: src/testbed/testbed_api_hosts.c:583
+#: src/testbed/testbed_api_hosts.c:595
#, c-format
msgid "The function %s is only available when compiled with (--with-ll)\n"
msgstr ""
-#: src/testbed/testbed_api_hosts.c:1856
+#: src/testbed/testbed_api_hosts.c:1879
#, fuzzy, c-format
msgid "Adding host %u failed with error: %s\n"
msgstr "`%s' schlug bei %s:%d mit dem Fehler %s fehl\n"
-#: src/testbed/testbed_api_testbed.c:771
+#: src/testbed/testbed_api_testbed.c:891
msgid "Linking controllers failed. Exiting"
msgstr ""
-#: src/testbed/testbed_api_testbed.c:913
+#: src/testbed/testbed_api_testbed.c:1094
#, c-format
msgid "Host registration failed for a host. Error: %s\n"
msgstr ""
-#: src/testbed/testbed_api_testbed.c:978
+#: src/testbed/testbed_api_testbed.c:1175
msgid "Controller crash detected. Shutting down.\n"
msgstr ""
-#: src/testbed/testbed_api_testbed.c:1081
+#: src/testbed/testbed_api_testbed.c:1320
#, c-format
msgid "Host %s cannot start testbed\n"
msgstr ""
-#: src/testbed/testbed_api_testbed.c:1085
+#: src/testbed/testbed_api_testbed.c:1324
msgid "Testbed cannot be started on localhost\n"
msgstr ""
-#: src/testbed/testbed_api_testbed.c:1120
+#: src/testbed/testbed_api_testbed.c:1365
#, fuzzy
msgid "Cannot start the master controller"
msgstr "GNUnet testbed Controller starten."
-#: src/testbed/testbed_api_testbed.c:1138
+#: src/testbed/testbed_api_testbed.c:1383
msgid "Shutting down testbed due to timeout while setup.\n"
msgstr ""
-#: src/testbed/testbed_api_testbed.c:1197
+#: src/testbed/testbed_api_testbed.c:1443
msgid "No hosts loaded from LoadLeveler. Need at least one host\n"
msgstr ""
-#: src/testbed/testbed_api_testbed.c:1209
+#: src/testbed/testbed_api_testbed.c:1455
msgid "No hosts loaded. Need at least one host\n"
msgstr ""
-#: src/testbed/testbed_api_testbed.c:1233
+#: src/testbed/testbed_api_testbed.c:1479
msgid "Specified topology must be supported by testbed"
msgstr ""
@@ -5101,7 +5092,7 @@
msgid "Failed to start `%s': %s\n"
msgstr "Es konnte keine Verbindung mit gnunetd hergestellt werden.\n"
-#: src/testing/testing.c:1691
+#: src/testing/testing.c:1709
#, fuzzy, c-format
msgid "Failed to load configuration from %s\n"
msgstr "Fehler beim Speichern der Konfigurationsdatei `%s':"
@@ -5255,7 +5246,7 @@
msgid "# bytes payload dropped (other peer was not connected)"
msgstr ""
-#: src/transport/gnunet-service-transport_clients.c:728
+#: src/transport/gnunet-service-transport_clients.c:733
#, fuzzy
msgid "# REQUEST CONNECT messages received"
msgstr "# verschlüsselter PONG Nachrichten empfangen"
@@ -5328,53 +5319,53 @@
msgid "# ms throttling suggested"
msgstr ""
-#: src/transport/gnunet-service-transport_neighbours.c:2770
+#: src/transport/gnunet-service-transport_neighbours.c:2774
#, fuzzy
msgid "# unexpected CONNECT_ACK messages (no peer)"
msgstr "COUNT Nachrichten versenden"
-#: src/transport/gnunet-service-transport_neighbours.c:2785
-#: src/transport/gnunet-service-transport_neighbours.c:2819
+#: src/transport/gnunet-service-transport_neighbours.c:2789
+#: src/transport/gnunet-service-transport_neighbours.c:2823
#, fuzzy
msgid "# unexpected CONNECT_ACK messages (not ready)"
msgstr "COUNT Nachrichten versenden"
-#: src/transport/gnunet-service-transport_neighbours.c:2832
+#: src/transport/gnunet-service-transport_neighbours.c:2836
#, fuzzy
msgid "# unexpected CONNECT_ACK messages (waiting on ATS)"
msgstr "COUNT Nachrichten versenden"
-#: src/transport/gnunet-service-transport_neighbours.c:2865
+#: src/transport/gnunet-service-transport_neighbours.c:2869
#, fuzzy
msgid "# unexpected CONNECT_ACK messages (disconnecting)"
msgstr "COUNT Nachrichten versenden"
-#: src/transport/gnunet-service-transport_neighbours.c:3046
+#: src/transport/gnunet-service-transport_neighbours.c:3050
#, fuzzy
msgid "# unexpected SESSION ACK messages"
msgstr "# verschlüsselter PONG Nachrichten gesendet"
-#: src/transport/gnunet-service-transport_neighbours.c:3101
+#: src/transport/gnunet-service-transport_neighbours.c:3105
msgid "# SET QUOTA messages ignored (no such peer)"
msgstr ""
-#: src/transport/gnunet-service-transport_neighbours.c:3115
+#: src/transport/gnunet-service-transport_neighbours.c:3119
msgid "# disconnects due to quota of 0"
msgstr ""
-#: src/transport/gnunet-service-transport_neighbours.c:3146
+#: src/transport/gnunet-service-transport_neighbours.c:3150
msgid "# disconnect messages ignored (old format)"
msgstr ""
-#: src/transport/gnunet-service-transport_neighbours.c:3157
+#: src/transport/gnunet-service-transport_neighbours.c:3161
msgid "# disconnect messages ignored (timestamp)"
msgstr ""
-#: src/transport/gnunet-service-transport_neighbours.c:3188
+#: src/transport/gnunet-service-transport_neighbours.c:3192
msgid "# other peer asked to disconnect from us"
msgstr ""
-#: src/transport/gnunet-service-transport_neighbours.c:3283
+#: src/transport/gnunet-service-transport_neighbours.c:3287
#, fuzzy
msgid "# disconnected from peer upon explicit request"
msgstr "# gap Anfragen verworfen: Kollision in RT"
@@ -5801,92 +5792,92 @@
msgid "# bytes dropped by SMTP (outgoing)"
msgstr "# Bytes verworfen von TCP (ausgehend)"
-#: src/transport/plugin_transport_tcp.c:595
+#: src/transport/plugin_transport_tcp.c:596
#, c-format
msgid "Unexpected address length: %u bytes\n"
msgstr ""
-#: src/transport/plugin_transport_tcp.c:771
-#: src/transport/plugin_transport_tcp.c:860
-#: src/transport/plugin_transport_tcp.c:910
-#: src/transport/plugin_transport_tcp.c:996
-#: src/transport/plugin_transport_tcp.c:1139
-#: src/transport/plugin_transport_tcp.c:1156
+#: src/transport/plugin_transport_tcp.c:772
+#: src/transport/plugin_transport_tcp.c:861
+#: src/transport/plugin_transport_tcp.c:911
+#: src/transport/plugin_transport_tcp.c:997
+#: src/transport/plugin_transport_tcp.c:1140
+#: src/transport/plugin_transport_tcp.c:1157
#, fuzzy
msgid "# bytes currently in TCP buffers"
msgstr "# Bytes gesendet über TCP"
-#: src/transport/plugin_transport_tcp.c:778
-#: src/transport/plugin_transport_tcp.c:967
-#: src/transport/plugin_transport_tcp.c:1826
-#: src/transport/plugin_transport_tcp.c:2456
+#: src/transport/plugin_transport_tcp.c:779
+#: src/transport/plugin_transport_tcp.c:968
+#: src/transport/plugin_transport_tcp.c:1827
+#: src/transport/plugin_transport_tcp.c:2460
#, fuzzy
msgid "# TCP sessions active"
msgstr "# Sitzungsschlüssel akzeptiert"
-#: src/transport/plugin_transport_tcp.c:864
+#: src/transport/plugin_transport_tcp.c:865
#, fuzzy
msgid "# bytes discarded by TCP (timeout)"
msgstr "# Bytes verworfen von TCP (ausgehend)"
-#: src/transport/plugin_transport_tcp.c:913
+#: src/transport/plugin_transport_tcp.c:914
#, fuzzy
msgid "# bytes transmitted via TCP"
msgstr "# Bytes des Typs %d übertragen"
-#: src/transport/plugin_transport_tcp.c:1000
+#: src/transport/plugin_transport_tcp.c:1001
#, fuzzy
msgid "# bytes discarded by TCP (disconnect)"
msgstr "# Bytes verworfen von TCP (ausgehend)"
-#: src/transport/plugin_transport_tcp.c:1113
+#: src/transport/plugin_transport_tcp.c:1114
#, c-format
msgid "Trying to send with invalid session %p\n"
msgstr ""
-#: src/transport/plugin_transport_tcp.c:1349
+#: src/transport/plugin_transport_tcp.c:1350
#, c-format
msgid "Address of unexpected length: %u\n"
msgstr ""
-#: src/transport/plugin_transport_tcp.c:1466
+#: src/transport/plugin_transport_tcp.c:1467
msgid "# transport-service disconnect requests for TCP"
msgstr ""
-#: src/transport/plugin_transport_tcp.c:1867
+#: src/transport/plugin_transport_tcp.c:1868
#, fuzzy
msgid "# TCP WELCOME messages received"
msgstr "# verschlüsselter PONG Nachrichten empfangen"
-#: src/transport/plugin_transport_tcp.c:2036
+#: src/transport/plugin_transport_tcp.c:2037
msgid "# bytes received via TCP"
msgstr "# Bytes empfangen über TCP"
-#: src/transport/plugin_transport_tcp.c:2118
+#: src/transport/plugin_transport_tcp.c:2119
msgid "# network-level TCP disconnect events"
msgstr ""
-#: src/transport/plugin_transport_tcp.c:2344 src/util/service.c:948
+#: src/transport/plugin_transport_tcp.c:2345 src/util/service.c:948
#: src/util/service.c:954
#, c-format
msgid "Require valid port number for service `%s' in configuration!\n"
msgstr ""
-#: src/transport/plugin_transport_tcp.c:2358
+#: src/transport/plugin_transport_tcp.c:2359
#, fuzzy
msgid "Failed to start service.\n"
msgstr "Fehler beim Starten der Collection.\n"
-#: src/transport/plugin_transport_tcp.c:2444
+#: src/transport/plugin_transport_tcp.c:2448
#, fuzzy, c-format
msgid "TCP transport listening on port %llu\n"
msgstr "Der Transportdienst auf Port %d konnte nicht gestartet werden.\n"
-#: src/transport/plugin_transport_tcp.c:2448
+#: src/transport/plugin_transport_tcp.c:2452
msgid "TCP transport not listening on any port (client only)\n"
msgstr ""
-#: src/transport/plugin_transport_tcp.c:2452
+#: src/transport/plugin_transport_tcp.c:2456
#, c-format
msgid "TCP transport advertises itself as being on port %llu\n"
msgstr ""
@@ -5911,14 +5902,14 @@
msgid "Failed to set IPv4 broadcast option for broadcast socket on port %d\n"
msgstr ""
-#: src/transport/plugin_transport_udp.c:2520
+#: src/transport/plugin_transport_udp.c:2350
#, c-format
msgid ""
"UDP could not transmit message to `%s': Network seems down, please check "
"your network configuration\n"
msgstr ""
-#: src/transport/plugin_transport_udp.c:2534
+#: src/transport/plugin_transport_udp.c:2364
#, c-format
msgid ""
"UDP could not transmit message to `%s': Please check your network "
@@ -5926,24 +5917,29 @@
"IPv6 address\n"
msgstr ""
-#: src/transport/plugin_transport_udp.c:2775
+#: src/transport/plugin_transport_udp.c:2664
#, fuzzy
msgid "Failed to open UDP sockets\n"
msgstr "Fehler beim Binden an UDP6 Port %d.\n"
-#: src/transport/plugin_transport_udp.c:2851
+#: src/transport/plugin_transport_udp.c:2762
#, c-format
msgid "Given `%s' option is out of range: %llu > %u\n"
msgstr ""
-#: src/transport/plugin_transport_udp.c:2894
+#: src/transport/plugin_transport_udp.c:2805
#, fuzzy, c-format
msgid "Invalid IPv6 address: `%s'\n"
msgstr "Ungültiger Parameter: `%s'\n"
-#: src/transport/plugin_transport_unix.c:1353
+#: src/transport/plugin_transport_udp.c:2862
#, fuzzy
-msgid "Failed to open UNIX sockets\n"
+msgid "Failed to create network sockets, plugin failed\n"
+msgstr "Namespace `%s' konnte nicht erstellt werden (existiert bereits?).\n"
+
+#: src/transport/plugin_transport_unix.c:1427
+#, fuzzy
+msgid "Failed to open UNIX listen socket\n"
msgstr "Datei wurde als `%s' gespeichert.\n"
#: src/transport/plugin_transport_wlan.c:580
@@ -6260,7 +6256,7 @@
msgid "gnunet-ecc failed"
msgstr "gnunet-update ausführen"
-#: src/util/crypto_ecc.c:1045
+#: src/util/crypto_ecc.c:1084
#, fuzzy, c-format
msgid "ECC signature verification failed at %s:%d: %s\n"
msgstr "RSA Signaturüberprüfung fehlgeschlagen bei %s:%d: %s\n"
@@ -6526,17 +6522,17 @@
msgid "Perform default-actions for GNUnet URIs"
msgstr ""
-#: src/util/helper.c:271
+#: src/util/helper.c:322
#, fuzzy, c-format
msgid "Error reading from `%s': %s\n"
msgstr "Fehler beim Anlegen des Benutzers"
-#: src/util/helper.c:316
+#: src/util/helper.c:367
#, fuzzy, c-format
msgid "Failed to parse inbound message from helper `%s'\n"
msgstr "Fehler beim Lesen der Freunde-Liste von `%s'\n"
-#: src/util/helper.c:537
+#: src/util/helper.c:564
#, fuzzy, c-format
msgid "Error writing to `%s': %s\n"
msgstr "Fehler beim Anlegen des Benutzers"
Modified: gnunet/po/es.po
===================================================================
--- gnunet/po/es.po 2013-05-22 10:27:24 UTC (rev 27250)
+++ gnunet/po/es.po 2013-05-22 10:29:15 UTC (rev 27251)
@@ -7,7 +7,7 @@
msgstr ""
"Project-Id-Version: gnunet 0.9.5a\n"
"Report-Msgid-Bugs-To: address@hidden"
-"POT-Creation-Date: 2013-04-27 12:39+0200\n"
+"POT-Creation-Date: 2013-05-20 15:09+0200\n"
"PO-Revision-Date: 2013-02-23 17:50+0100\n"
"Last-Translator: Miguel Ángel Arruga Vivas <address@hidden>\n"
"Language-Team: Spanish <address@hidden>\n"
@@ -40,73 +40,73 @@
msgid "Failed to remove servicehome directory %s\n"
msgstr "Se produjo un fallo al eliminar el directorio «servicehome» %s.\n"
-#: src/arm/gnunet-arm.c:204 src/testbed/gnunet-service-testbed_peers.c:712
+#: src/arm/gnunet-arm.c:204 src/testbed/gnunet-service-testbed_peers.c:962
#, fuzzy
msgid "Message was sent successfully"
msgstr "El almacén de nombres añadió el registro satisfactoriamente"
-#: src/arm/gnunet-arm.c:206 src/testbed/gnunet-service-testbed_peers.c:714
+#: src/arm/gnunet-arm.c:206 src/testbed/gnunet-service-testbed_peers.c:964
#, fuzzy
msgid "Misconfiguration (can't connect to the ARM service)"
msgstr "¡Se produjo un fallo al conectar con el servicio dv!\n"
-#: src/arm/gnunet-arm.c:208 src/testbed/gnunet-service-testbed_peers.c:716
+#: src/arm/gnunet-arm.c:208 src/testbed/gnunet-service-testbed_peers.c:966
#, fuzzy
msgid "We disconnected from ARM before we could send a request"
msgstr "# desconexiones del par debido a una petición explícita"
-#: src/arm/gnunet-arm.c:210 src/testbed/gnunet-service-testbed_peers.c:718
+#: src/arm/gnunet-arm.c:210 src/testbed/gnunet-service-testbed_peers.c:968
msgid "ARM API is busy"
msgstr ""
-#: src/arm/gnunet-arm.c:212 src/testbed/gnunet-service-testbed_peers.c:720
+#: src/arm/gnunet-arm.c:212 src/testbed/gnunet-service-testbed_peers.c:970
#, fuzzy
msgid "Request doesn't fit into a message"
msgstr "no imprime mensajes de estado"
# Miguel: "timeout" lo he traducido como plazo, pero no se
# si hay alguna palabra que lo describa mejor.
-#: src/arm/gnunet-arm.c:214 src/testbed/gnunet-service-testbed_peers.c:722
+#: src/arm/gnunet-arm.c:214 src/testbed/gnunet-service-testbed_peers.c:972
#, fuzzy
msgid "Request timed out"
msgstr "plazo de consenso"
-#: src/arm/gnunet-arm.c:216 src/testbed/gnunet-service-testbed_peers.c:724
+#: src/arm/gnunet-arm.c:216 src/testbed/gnunet-service-testbed_peers.c:974
#, fuzzy
msgid "Unknown request status"
msgstr "Usuario desconocido «%s»\n"
-#: src/arm/gnunet-arm.c:232 src/testbed/gnunet-service-testbed_peers.c:740
+#: src/arm/gnunet-arm.c:232 src/testbed/gnunet-service-testbed_peers.c:990
#, fuzzy, c-format
msgid "%s is stopped"
msgstr "# elementos almacenados"
-#: src/arm/gnunet-arm.c:234 src/testbed/gnunet-service-testbed_peers.c:742
+#: src/arm/gnunet-arm.c:234 src/testbed/gnunet-service-testbed_peers.c:992
#, fuzzy, c-format
msgid "%s is starting"
msgstr "'%s' comenzando\n"
-#: src/arm/gnunet-arm.c:236 src/testbed/gnunet-service-testbed_peers.c:744
+#: src/arm/gnunet-arm.c:236 src/testbed/gnunet-service-testbed_peers.c:994
#, c-format
msgid "%s is stopping"
msgstr ""
-#: src/arm/gnunet-arm.c:238 src/testbed/gnunet-service-testbed_peers.c:746
+#: src/arm/gnunet-arm.c:238 src/testbed/gnunet-service-testbed_peers.c:996
#, fuzzy, c-format
msgid "%s is starting already"
msgstr "'%s' comenzando\n"
-#: src/arm/gnunet-arm.c:240 src/testbed/gnunet-service-testbed_peers.c:748
+#: src/arm/gnunet-arm.c:240 src/testbed/gnunet-service-testbed_peers.c:998
#, c-format
msgid "%s is stopping already"
msgstr ""
-#: src/arm/gnunet-arm.c:242 src/testbed/gnunet-service-testbed_peers.c:750
+#: src/arm/gnunet-arm.c:242 src/testbed/gnunet-service-testbed_peers.c:1000
#, c-format
msgid "%s is started already"
msgstr ""
-#: src/arm/gnunet-arm.c:244 src/testbed/gnunet-service-testbed_peers.c:752
+#: src/arm/gnunet-arm.c:244 src/testbed/gnunet-service-testbed_peers.c:1002
#, c-format
msgid "%s is stopped already"
msgstr ""
@@ -114,23 +114,23 @@
# Miguel: ¿Debería cambiar las siglas de ARM?
# De momento las he mantenido con una traducción en
# otro mensaje.
-#: src/arm/gnunet-arm.c:246 src/testbed/gnunet-service-testbed_peers.c:754
+#: src/arm/gnunet-arm.c:246 src/testbed/gnunet-service-testbed_peers.c:1004
#, fuzzy, c-format
msgid "%s service is not known to ARM"
msgstr "El servicio «%s» es desconocido para el ARM.\n"
-#: src/arm/gnunet-arm.c:248 src/testbed/gnunet-service-testbed_peers.c:756
+#: src/arm/gnunet-arm.c:248 src/testbed/gnunet-service-testbed_peers.c:1006
#, fuzzy, c-format
msgid "%s service failed to start"
msgstr "El proceso del servicio no devolvió un estado\n"
# Miguel: ¿Es mejor «ya que» que «porque» o «debido al apagado»?
-#: src/arm/gnunet-arm.c:250 src/testbed/gnunet-service-testbed_peers.c:758
+#: src/arm/gnunet-arm.c:250 src/testbed/gnunet-service-testbed_peers.c:1008
#, fuzzy, c-format
msgid "%s service can't be started because ARM is shutting down"
msgstr "Petición ignorada porque el ARM se está apagando.\n"
-#: src/arm/gnunet-arm.c:252 src/testbed/gnunet-service-testbed_peers.c:760
+#: src/arm/gnunet-arm.c:252 src/testbed/gnunet-service-testbed_peers.c:1010
#, fuzzy, c-format
msgid "%.s Unknown result code."
msgstr "Código de respuesta del ARM desconocido.\n"
@@ -883,8 +883,8 @@
#: src/transport/gnunet-service-transport_neighbours.c:1041
#: src/transport/gnunet-service-transport_neighbours.c:1265
#: src/transport/gnunet-service-transport_neighbours.c:1274
-#: src/transport/gnunet-service-transport_neighbours.c:2794
-#: src/transport/gnunet-service-transport_neighbours.c:3053
+#: src/transport/gnunet-service-transport_neighbours.c:2798
+#: src/transport/gnunet-service-transport_neighbours.c:3057
msgid "# peers connected"
msgstr "# pares conectados"
@@ -1359,7 +1359,7 @@
#: src/dht/gnunet-dht-put.c:213 src/fs/gnunet-auto-share.c:753
#: src/fs/gnunet-download.c:328 src/fs/gnunet-publish.c:736
#: src/fs/gnunet-search.c:294 src/fs/gnunet-unindex.c:168
-#: src/nse/gnunet-nse-profiler.c:900
+#: src/nse/gnunet-nse-profiler.c:899
msgid "be verbose (print progress information)"
msgstr "ser prolijo (imprime información de progreso)"
@@ -2278,7 +2278,7 @@
msgid "no-name"
msgstr "sin nombre"
-#: src/fs/fs_pseudonym.c:1182 src/util/crypto_ecc.c:975
+#: src/fs/fs_pseudonym.c:1182 src/util/crypto_ecc.c:1014
#, c-format
msgid "ECC signing failed at %s:%d: %s\n"
msgstr "El firmado ECC falló en %s:%d: %s\n"
@@ -2474,11 +2474,11 @@
msgid "Unrecognized URI type"
msgstr "Tipo de URI no reconocido"
-#: src/fs/fs_uri.c:898
+#: src/fs/fs_uri.c:898 src/util/crypto_ecc.c:941
msgid "Lacking key configuration settings.\n"
msgstr "Falta configuración sobre las opciones de claves.\n"
-#: src/fs/fs_uri.c:904
+#: src/fs/fs_uri.c:904 src/util/crypto_ecc.c:947
#, c-format
msgid "Could not access hostkey file `%s'.\n"
msgstr "No se pudo acceder al fichero de clave de máquina «%s».\n"
@@ -3806,15 +3806,15 @@
msgid "Hostlist file `%s' could not be removed\n"
msgstr "El fichero de listas de máquinas «%s» no pudo ser eliminado\n"
-#: src/hostlist/hostlist-server.c:134
+#: src/hostlist/hostlist-server.c:137
msgid "bytes in hostlist"
msgstr "bytes en la lista de máquinas"
-#: src/hostlist/hostlist-server.c:157
+#: src/hostlist/hostlist-server.c:161
msgid "expired addresses encountered"
msgstr "direcciones expiradas encontradas"
-#: src/hostlist/hostlist-server.c:184 src/hostlist/hostlist-server.c:421
+#: src/hostlist/hostlist-server.c:189 src/hostlist/hostlist-server.c:424
#: src/peerinfo-tool/gnunet-peerinfo.c:348
#: src/peerinfo-tool/gnunet-peerinfo.c:418
#: src/peerinfo-tool/gnunet-peerinfo.c:489
@@ -3825,87 +3825,87 @@
"Error en la comunicación con el servicio de información de pares (PEERINFO): "
"%s\n"
-#: src/hostlist/hostlist-server.c:205
+#: src/hostlist/hostlist-server.c:210
msgid "HELLOs without addresses encountered (ignored)"
msgstr "«HELLO» sin dirección encontrados (ignorados)"
-#: src/hostlist/hostlist-server.c:219
+#: src/hostlist/hostlist-server.c:224
msgid "bytes not included in hostlist (size limit)"
msgstr "bytes no incluidos en la lista de máquinas (límite de tamaño)"
-#: src/hostlist/hostlist-server.c:263
+#: src/hostlist/hostlist-server.c:268
#, c-format
msgid "Refusing `%s' request to hostlist server\n"
msgstr "Rechazando petición «%s» al servidor de listas de máquinas\n"
-#: src/hostlist/hostlist-server.c:266
+#: src/hostlist/hostlist-server.c:271
msgid "hostlist requests refused (not HTTP GET)"
msgstr "Peticiones de listas de máquinas rechazadas (no HTTP GET)"
-#: src/hostlist/hostlist-server.c:279
+#: src/hostlist/hostlist-server.c:284
#, c-format
msgid "Refusing `%s' request with %llu bytes of upload data\n"
msgstr "Rechazando petición «%s» con %llu bytes de datos de subida\n"
-#: src/hostlist/hostlist-server.c:283
+#: src/hostlist/hostlist-server.c:288
msgid "hostlist requests refused (upload data)"
msgstr "Peticiones de listas de máquinas rechazadas (datos de subida)"
-#: src/hostlist/hostlist-server.c:291
+#: src/hostlist/hostlist-server.c:296
msgid "Could not handle hostlist request since I do not have a response yet\n"
msgstr ""
"No se pudo manejar una petición de lista de máquinas debido a que no hay una "
"respuesta todavía\n"
-#: src/hostlist/hostlist-server.c:294
+#: src/hostlist/hostlist-server.c:299
msgid "hostlist requests refused (not ready)"
msgstr "Peticiones de listas de máquinas rechazadas (no preparados)"
-#: src/hostlist/hostlist-server.c:298
+#: src/hostlist/hostlist-server.c:303
msgid "Received request for our hostlist\n"
msgstr "Peticiones recibidas de nuestra lista de máquinas\n"
-#: src/hostlist/hostlist-server.c:299
+#: src/hostlist/hostlist-server.c:304
msgid "hostlist requests processed"
msgstr "Peticiones de lista de máquinas procesadas"
-#: src/hostlist/hostlist-server.c:341
+#: src/hostlist/hostlist-server.c:346
msgid "# hostlist advertisements send"
msgstr "# anuncios de listas de máquinas enviados"
-#: src/hostlist/hostlist-server.c:384
+#: src/hostlist/hostlist-server.c:389
msgid "Advertisement message could not be queued by core\n"
msgstr ""
"Los mensajes de anuncio no pudieron encolarse por el servicio principal\n"
-#: src/hostlist/hostlist-server.c:548 src/peerinfo-tool/gnunet-peerinfo.c:649
+#: src/hostlist/hostlist-server.c:560 src/peerinfo-tool/gnunet-peerinfo.c:649
#: src/transport/gnunet-service-transport.c:661
msgid "Could not access PEERINFO service. Exiting.\n"
msgstr ""
"No se pudo acceder al servicio de información de pares (PEERINFO). "
"Saliendo.\n"
-#: src/hostlist/hostlist-server.c:558
+#: src/hostlist/hostlist-server.c:570
#, c-format
msgid "Invalid port number %llu. Exiting.\n"
msgstr "Número de puerto %llu no válido. Saliendo.\n"
-#: src/hostlist/hostlist-server.c:567
+#: src/hostlist/hostlist-server.c:579
#, c-format
msgid "Hostlist service starts on %s:%llu\n"
msgstr "Servicio de listas de máquinas arranca en %s:%llu\n"
-#: src/hostlist/hostlist-server.c:581
+#: src/hostlist/hostlist-server.c:593
#, c-format
msgid "Address to obtain hostlist: `%s'\n"
msgstr "Dirección para obtener la lista de máquinas: «%s»\n"
-#: src/hostlist/hostlist-server.c:621
+#: src/hostlist/hostlist-server.c:633
#, c-format
msgid "`%s' is not a valid IP address! Ignoring BINDTOIP.\n"
msgstr "¡«%s» no es una dirección IP válida! Ignorando «BINDTOIP».\n"
-#: src/hostlist/hostlist-server.c:663
+#: src/hostlist/hostlist-server.c:675
#, c-format
msgid "Could not start hostlist HTTP server on port %u\n"
msgstr ""
@@ -3945,11 +3945,11 @@
msgid "Print information about mesh tunnels and peers."
msgstr "Imprimir información acerca de tuneles mesh y pares."
-#: src/mesh/gnunet-service-mesh.c:7966 src/mesh/gnunet-service-mesh-new.c:7972
+#: src/mesh/gnunet-service-mesh.c:7966 src/mesh/gnunet-service-mesh-new.c:4649
msgid "Wrong CORE service\n"
msgstr "Servicio principal (CORE) erróneo\n"
-#: src/mesh/gnunet-service-mesh.c:8179 src/mesh/gnunet-service-mesh-new.c:8185
+#: src/mesh/gnunet-service-mesh.c:8179 src/mesh/gnunet-service-mesh-new.c:4790
#, c-format
msgid "Mesh service could not access hostkey: %s. Exiting.\n"
msgstr ""
@@ -3958,14 +3958,13 @@
#: src/mesh/gnunet-service-mesh.c:8261 src/mesh/gnunet-service-mesh.c:8273
#: src/mesh/gnunet-service-mesh.c:8285 src/mesh/gnunet-service-mesh.c:8299
#: src/mesh/gnunet-service-mesh.c:8311 src/mesh/gnunet-service-mesh.c:8323
-#: src/mesh/gnunet-service-mesh.c:8335 src/mesh/gnunet-service-mesh-new.c:8274
-#: src/mesh/gnunet-service-mesh-new.c:8286
-#: src/mesh/gnunet-service-mesh-new.c:8298
-#: src/mesh/gnunet-service-mesh-new.c:8312
-#: src/mesh/gnunet-service-mesh-new.c:8324
-#: src/mesh/gnunet-service-mesh-new.c:8336
-#: src/mesh/gnunet-service-mesh-new.c:8348 src/nse/gnunet-service-nse.c:1516
-#: src/nse/gnunet-service-nse.c:1534
+#: src/mesh/gnunet-service-mesh.c:8335 src/mesh/gnunet-service-mesh-new.c:4860
+#: src/mesh/gnunet-service-mesh-new.c:4872
+#: src/mesh/gnunet-service-mesh-new.c:4884
+#: src/mesh/gnunet-service-mesh-new.c:4896
+#: src/mesh/gnunet-service-mesh-new.c:4908
+#: src/mesh/gnunet-service-mesh-new.c:4920 src/nse/gnunet-service-nse.c:1500
+#: src/nse/gnunet-service-nse.c:1518
#: src/regex/gnunet-daemon-regexprofiler.c:320
#: src/regex/gnunet-daemon-regexprofiler.c:332
#: src/regex/gnunet-daemon-regexprofiler.c:344
@@ -3978,9 +3977,9 @@
"Saliendo.\n"
#: src/mesh/gnunet-service-mesh.c:8347 src/mesh/gnunet-service-mesh.c:8357
-#: src/mesh/gnunet-service-mesh.c:8368 src/mesh/gnunet-service-mesh-new.c:8360
-#: src/mesh/gnunet-service-mesh-new.c:8370
-#: src/mesh/gnunet-service-mesh-new.c:8381
+#: src/mesh/gnunet-service-mesh.c:8368 src/mesh/gnunet-service-mesh-new.c:4932
+#: src/mesh/gnunet-service-mesh-new.c:4942
+#: src/mesh/gnunet-service-mesh-new.c:4953
#, c-format
msgid ""
"%s service is lacking key configuration settings (%s). Using default (%u).\n"
@@ -4320,21 +4319,21 @@
"«gnunet-helper-nat-client» no encontrado o detrás de NAT, deshabilitando su "
"uso\n"
-#: src/nat/nat.c:795
+#: src/nat/nat.c:834
#, c-format
msgid "gnunet-helper-nat-server generated malformed address `%s'\n"
msgstr "«gnunet-helper-nat-server» generó la dirección mal formada «%s»\n"
-#: src/nat/nat.c:844
+#: src/nat/nat.c:883
#, c-format
msgid "Failed to start %s\n"
msgstr "Se produjo un fallo al arrancar %s\n"
-#: src/nat/nat.c:1113
+#: src/nat/nat.c:1152
msgid "malformed"
msgstr "mal formado"
-#: src/nat/nat.c:1179 src/nat/nat.c:1191
+#: src/nat/nat.c:1218 src/nat/nat.c:1230
#, c-format
msgid ""
"Configuration requires `%s', but binary is not installed properly (SUID bit "
@@ -4343,13 +4342,13 @@
"La configuración requiere «%s», pero el binario no está instalado de forma "
"correcta (SUID bit no activado). Opción deshabilitada.\n"
-#: src/nat/nat.c:1326
+#: src/nat/nat.c:1365
msgid "Internal IP address not known, cannot use ICMP NAT traversal method\n"
msgstr ""
"Direcciones internas IP no conocidas, no se puede usar el método del "
"recorrido NAT ICMP\n"
-#: src/nat/nat.c:1337
+#: src/nat/nat.c:1376
#, c-format
msgid "Running gnunet-helper-nat-client %s %s %u\n"
msgstr "Ejecutando gnunet-helper-nat-client %s %s %u\n"
@@ -4373,48 +4372,48 @@
"Se produjo un fallo al crear el «socket» de escucha asociado a «%s» para "
"pruebas NAT: %s\n"
-#: src/nse/gnunet-nse-profiler.c:885
+#: src/nse/gnunet-nse-profiler.c:884
msgid "limit to the number of connections to NSE services, 0 for none"
msgstr "límite al número de conexiones a servicios NSE, 0 para ilimitadas"
-#: src/nse/gnunet-nse-profiler.c:888
+#: src/nse/gnunet-nse-profiler.c:887
msgid "name of the file for writing connection information and statistics"
msgstr ""
"nombre del fichero para escribir información y estadísticas de la conexión"
-#: src/nse/gnunet-nse-profiler.c:891 src/testbed/gnunet-testbed-profiler.c:282
+#: src/nse/gnunet-nse-profiler.c:890 src/testbed/gnunet-testbed-profiler.c:284
msgid "name of the file with the login information for the testbed"
msgstr ""
"nombre del fichero con la información de acceso usada para la batería de "
"pruebas"
-#: src/nse/gnunet-nse-profiler.c:894
+#: src/nse/gnunet-nse-profiler.c:893
msgid "name of the file for writing the main results"
msgstr "nombre del fichero en el que escribir los resultados principales"
-#: src/nse/gnunet-nse-profiler.c:897
+#: src/nse/gnunet-nse-profiler.c:896
msgid "Number of peers to run in each round, separated by commas"
msgstr "Número de pares a ejecutar en cada ronda, separados por comas"
-#: src/nse/gnunet-nse-profiler.c:903
+#: src/nse/gnunet-nse-profiler.c:902
msgid "delay between rounds"
msgstr "retraso entre rondas"
-#: src/nse/gnunet-nse-profiler.c:912
+#: src/nse/gnunet-nse-profiler.c:911
msgid "Measure quality and performance of the NSE service."
msgstr "Medir la calidad y rendimiento del servicio NSE."
-#: src/nse/gnunet-service-nse.c:1405
+#: src/nse/gnunet-service-nse.c:1419
#, c-format
msgid "NSE service could not access hostkey: %s\n"
msgstr "El servicio NSE no puede acceder a la clave de máquina: %s\n"
-#: src/nse/gnunet-service-nse.c:1419
+#: src/nse/gnunet-service-nse.c:1433
msgid "NSE service is lacking key configuration settings. Exiting.\n"
msgstr ""
"El servicio NSE carece de opciones de configuración de clave. Saliendo.\n"
-#: src/nse/gnunet-service-nse.c:1524
+#: src/nse/gnunet-service-nse.c:1508
msgid "Invalid work requirement for NSE service. Exiting.\n"
msgstr "Requisitos de trabajo no válidos para el servicio NSE. Saliendo.\n"
@@ -4423,21 +4422,21 @@
msgid "Removing expired address of transport `%s'\n"
msgstr "Eliminando dirección de transporte «%s»\n"
-#: src/peerinfo/gnunet-service-peerinfo.c:354
+#: src/peerinfo/gnunet-service-peerinfo.c:355
#, fuzzy, c-format
msgid "Failed to parse HELLO in file `%s': %s\n"
msgstr "Se produjo un fallo al procesar «HELLO» en el fichero «%s»\n"
-#: src/peerinfo/gnunet-service-peerinfo.c:369
+#: src/peerinfo/gnunet-service-peerinfo.c:370
#, fuzzy, c-format
msgid "Failed to parse HELLO in file `%s': %s %u \n"
msgstr "Se produjo un fallo al procesar «HELLO» en el fichero «%s»\n"
-#: src/peerinfo/gnunet-service-peerinfo.c:444
+#: src/peerinfo/gnunet-service-peerinfo.c:445
msgid "# peers known"
msgstr "# pares conocidos"
-#: src/peerinfo/gnunet-service-peerinfo.c:480
+#: src/peerinfo/gnunet-service-peerinfo.c:481
#, c-format
msgid ""
"File `%s' in directory `%s' does not match naming convention. Removed.\n"
@@ -4445,22 +4444,22 @@
"El fichero «%s» en el directorio «%s» no sigue la convención de nombres. "
"Eliminado.\n"
-#: src/peerinfo/gnunet-service-peerinfo.c:632
+#: src/peerinfo/gnunet-service-peerinfo.c:633
#, fuzzy, c-format
msgid "Scanning directory `%s'\n"
msgstr "Escaneando directorio «%s».\n"
-#: src/peerinfo/gnunet-service-peerinfo.c:637
+#: src/peerinfo/gnunet-service-peerinfo.c:638
#, c-format
msgid "Still no peers found in `%s'!\n"
msgstr "¡Aún no se han encontrado pares en «%s»!\n"
-#: src/peerinfo/gnunet-service-peerinfo.c:969
+#: src/peerinfo/gnunet-service-peerinfo.c:970
#, fuzzy, c-format
msgid "Cleaning up directory `%s'\n"
msgstr "Escaneando directorio «%s».\n"
-#: src/peerinfo/gnunet-service-peerinfo.c:1249
+#: src/peerinfo/gnunet-service-peerinfo.c:1250
#, c-format
msgid "Importing HELLOs from `%s'\n"
msgstr "Importando HELLO de «%s»\n"
@@ -4671,22 +4670,16 @@
msgid "Daemon to announce regular expressions for the peer using mesh."
msgstr "Demonio para anunciar expresiones regulares para el par usando mesh."
-#: src/regex/gnunet-regex-profiler.c:1246
+#: src/regex/gnunet-regex-profiler.c:1247
msgid "No configuration file given. Exiting\n"
msgstr "No se ha introducido ningún fichero de configuración. Saliendo\n"
-#: src/regex/gnunet-regex-profiler.c:1257
+#: src/regex/gnunet-regex-profiler.c:1258
#, fuzzy
msgid "Configuration option \"regex_prefix\" missing. Exiting\n"
msgstr "Falta una opción de configuración (regex_prefix). Saliendo\n"
-#: src/regex/gnunet-regex-profiler.c:1276
-msgid "No hosts-file specified on command line. Exiting.\n"
-msgstr ""
-"No se ha especificado el fichero de máquinas en la línea de comandos. "
-"Saliendo.\n"
-
-#: src/regex/gnunet-regex-profiler.c:1282
+#: src/regex/gnunet-regex-profiler.c:1287
#: src/regex/gnunet-regex-simulation-profiler.c:622
#, c-format
msgid "No policy directory specified on command line. Exiting.\n"
@@ -4694,22 +4687,22 @@
"No se ha especificado una política de directorios en la línea de comandos. "
"Saliendo.\n"
-#: src/regex/gnunet-regex-profiler.c:1288
+#: src/regex/gnunet-regex-profiler.c:1293
#: src/regex/gnunet-regex-simulation-profiler.c:629
#, c-format
msgid "Specified policies directory does not exist. Exiting.\n"
msgstr "Las políticas de directorio especificadas no existen. Saliendo.\n"
-#: src/regex/gnunet-regex-profiler.c:1295
+#: src/regex/gnunet-regex-profiler.c:1300
#, c-format
msgid "No files found in `%s'\n"
msgstr "No se han encontrado ficheros en «%s»\n"
-#: src/regex/gnunet-regex-profiler.c:1304
+#: src/regex/gnunet-regex-profiler.c:1309
msgid "No search strings file given. Exiting.\n"
msgstr "No se ha proporcionado un fichero de cadenas de búsqueda. Saliendo.\n"
-#: src/regex/gnunet-regex-profiler.c:1314
+#: src/regex/gnunet-regex-profiler.c:1319
#, fuzzy
msgid ""
"Error loading search strings.Given file does not contain enough strings. "
@@ -4718,40 +4711,36 @@
"Error cargando cadenas de búsqueda. El fichero proporcionado no contiene "
"cadenas suficientes. Saliendo.\n"
-#: src/regex/gnunet-regex-profiler.c:1322
+#: src/regex/gnunet-regex-profiler.c:1327
msgid "Error loading search strings. Exiting.\n"
msgstr "Error cargando cadenas de búsqueda. Saliendo.\n"
-#: src/regex/gnunet-regex-profiler.c:1389
+#: src/regex/gnunet-regex-profiler.c:1394
msgid "name of the file for writing statistics"
msgstr "nombre del fichero para escribir las estadísticas"
-#: src/regex/gnunet-regex-profiler.c:1392
-msgid "wait TIMEOUT before considering a string match as failed"
+#: src/regex/gnunet-regex-profiler.c:1397
+#, fuzzy
+msgid "wait TIMEOUT before ending the experiment"
msgstr ""
"esperar «TIMEOUT» antes de considerar que una coincidencia de cadenas como "
"fallida"
-#: src/regex/gnunet-regex-profiler.c:1395
-msgid "number of search strings to read from search strings file"
-msgstr ""
-"número de cadenas de búsqueda a leer del fichero de cadenas de búsqueda"
-
-#: src/regex/gnunet-regex-profiler.c:1398
+#: src/regex/gnunet-regex-profiler.c:1400
msgid "directory with policy files"
msgstr ""
-#: src/regex/gnunet-regex-profiler.c:1401
+#: src/regex/gnunet-regex-profiler.c:1403
#, fuzzy
msgid "name of file with input strings"
msgstr "nombre del fichero para escribir las estadísticas"
-#: src/regex/gnunet-regex-profiler.c:1404
+#: src/regex/gnunet-regex-profiler.c:1406
#, fuzzy
msgid "name of file with hosts' names"
msgstr "nombre del fichero para escribir las estadísticas"
-#: src/regex/gnunet-regex-profiler.c:1416
+#: src/regex/gnunet-regex-profiler.c:1418
msgid "Profiler for regex"
msgstr "Perfilador para expresiones regulares."
@@ -4874,7 +4863,7 @@
"No se pudo determinar el intervalo de ejecución para «%s», estableciéndolo a "
"los 60 segundos predeterminados.\n"
-#: src/testbed/gnunet-service-testbed_cpustatus.c:670
+#: src/testbed/gnunet-service-testbed_cpustatus.c:692
#, c-format
msgid ""
"Cannot open %s for writing load statistics. Not logging load statistics\n"
@@ -4885,26 +4874,26 @@
msgid "Job command file not given. Exiting\n"
msgstr "Fichero de configuración de trabajos no proporcionado. Saliendo\n"
-#: src/testbed/gnunet_testbed_mpi_spawn.c:135
+#: src/testbed/gnunet_testbed_mpi_spawn.c:125
#, fuzzy
msgid "Waiting for child to exit.\n"
msgstr "Esperando a los pares para conectar (%u ciclos restantes)...\n"
-#: src/testbed/gnunet_testbed_mpi_spawn.c:296
+#: src/testbed/gnunet_testbed_mpi_spawn.c:247
#, fuzzy, c-format
msgid "Spawning process `%s'\n"
msgstr "Iniciando el proceso auxiliar (HELPER) «%s»\n"
-#: src/testbed/gnunet-testbed-profiler.c:249
+#: src/testbed/gnunet-testbed-profiler.c:251
#, fuzzy, c-format
msgid "Exiting as the number of peers is %u\n"
msgstr "El número máximo de conexiones es %u\n"
-#: src/testbed/gnunet-testbed-profiler.c:275
+#: src/testbed/gnunet-testbed-profiler.c:277
msgid "create COUNT number of peers"
msgstr "crea «COUNT» número de pares"
-#: src/testbed/gnunet-testbed-profiler.c:278
+#: src/testbed/gnunet-testbed-profiler.c:280
msgid "tolerate COUNT number of continious timeout failures"
msgstr "tolerar un número «COUNT» de continuas expiraciones de plazo"
@@ -4923,56 +4912,56 @@
msgid "Hosts file %s cannot be read\n"
msgstr "El archivo de máquinas %s no puede leerse\n"
-#: src/testbed/testbed_api_hosts.c:583
+#: src/testbed/testbed_api_hosts.c:595
#, c-format
msgid "The function %s is only available when compiled with (--with-ll)\n"
msgstr ""
-#: src/testbed/testbed_api_hosts.c:1856
+#: src/testbed/testbed_api_hosts.c:1879
#, c-format
msgid "Adding host %u failed with error: %s\n"
msgstr "No se pudo añadir la máquina %u por el error: %s\n"
-#: src/testbed/testbed_api_testbed.c:771
+#: src/testbed/testbed_api_testbed.c:891
msgid "Linking controllers failed. Exiting"
msgstr "Los controladores de enlazado fallaron. Saliendo"
-#: src/testbed/testbed_api_testbed.c:913
+#: src/testbed/testbed_api_testbed.c:1094
#, c-format
msgid "Host registration failed for a host. Error: %s\n"
msgstr "El registro de máquinas falló para una máquina. Error: %s\n"
-#: src/testbed/testbed_api_testbed.c:978
+#: src/testbed/testbed_api_testbed.c:1175
msgid "Controller crash detected. Shutting down.\n"
msgstr ""
-#: src/testbed/testbed_api_testbed.c:1081
+#: src/testbed/testbed_api_testbed.c:1320
#, c-format
msgid "Host %s cannot start testbed\n"
msgstr "La máquina %s no puede comenzar la batería de pruebas\n"
-#: src/testbed/testbed_api_testbed.c:1085
+#: src/testbed/testbed_api_testbed.c:1324
msgid "Testbed cannot be started on localhost\n"
msgstr "La batería de pruebas no se puede iniciar en localhost\n"
-#: src/testbed/testbed_api_testbed.c:1120
+#: src/testbed/testbed_api_testbed.c:1365
msgid "Cannot start the master controller"
msgstr "No se puede iniciar el controlador maestro"
-#: src/testbed/testbed_api_testbed.c:1138
+#: src/testbed/testbed_api_testbed.c:1383
msgid "Shutting down testbed due to timeout while setup.\n"
msgstr ""
-#: src/testbed/testbed_api_testbed.c:1197
+#: src/testbed/testbed_api_testbed.c:1443
#, fuzzy
msgid "No hosts loaded from LoadLeveler. Need at least one host\n"
msgstr "No se han cargado máquinas. Se necesita al menos una máquina.\n"
-#: src/testbed/testbed_api_testbed.c:1209
+#: src/testbed/testbed_api_testbed.c:1455
msgid "No hosts loaded. Need at least one host\n"
msgstr "No se han cargado máquinas. Se necesita al menos una máquina.\n"
-#: src/testbed/testbed_api_testbed.c:1233
+#: src/testbed/testbed_api_testbed.c:1479
msgid "Specified topology must be supported by testbed"
msgstr ""
"La topología especificada debe estar soportada por la batería de pruebas"
@@ -5134,7 +5123,7 @@
msgid "Failed to start `%s': %s\n"
msgstr "Se produjo un fallo al arrancar «%s»: %s\n"
-#: src/testing/testing.c:1691
+#: src/testing/testing.c:1709
#, c-format
msgid "Failed to load configuration from %s\n"
msgstr "Se produjo un fallo al cargar la configuración de %s\n"
@@ -5299,7 +5288,7 @@
msgid "# bytes payload dropped (other peer was not connected)"
msgstr "# bytes de «payload» omitidos (el otro par no estaba conectado)"
-#: src/transport/gnunet-service-transport_clients.c:728
+#: src/transport/gnunet-service-transport_clients.c:733
msgid "# REQUEST CONNECT messages received"
msgstr "# mensajes «REQUEST CONNECT» recibidos"
@@ -5361,48 +5350,48 @@
msgid "# ms throttling suggested"
msgstr "# ms de impulso sugeridos"
-#: src/transport/gnunet-service-transport_neighbours.c:2770
+#: src/transport/gnunet-service-transport_neighbours.c:2774
msgid "# unexpected CONNECT_ACK messages (no peer)"
msgstr "# Mensajes «CONNECT_ACK» inesperados (sin par)"
-#: src/transport/gnunet-service-transport_neighbours.c:2785
-#: src/transport/gnunet-service-transport_neighbours.c:2819
+#: src/transport/gnunet-service-transport_neighbours.c:2789
+#: src/transport/gnunet-service-transport_neighbours.c:2823
msgid "# unexpected CONNECT_ACK messages (not ready)"
msgstr "# Mensajes «CONNECT_ACK» inesperados (no estaba preparado)"
-#: src/transport/gnunet-service-transport_neighbours.c:2832
+#: src/transport/gnunet-service-transport_neighbours.c:2836
msgid "# unexpected CONNECT_ACK messages (waiting on ATS)"
msgstr "# Mensajes «CONNECT_ACK» inesperados (esperando en el ATS)"
-#: src/transport/gnunet-service-transport_neighbours.c:2865
+#: src/transport/gnunet-service-transport_neighbours.c:2869
msgid "# unexpected CONNECT_ACK messages (disconnecting)"
msgstr "# Mensajes «CONNECT_ACK» inesperados (desconectando)"
-#: src/transport/gnunet-service-transport_neighbours.c:3046
+#: src/transport/gnunet-service-transport_neighbours.c:3050
msgid "# unexpected SESSION ACK messages"
msgstr "# Mensajes «SESSION ACK» inesperados"
-#: src/transport/gnunet-service-transport_neighbours.c:3101
+#: src/transport/gnunet-service-transport_neighbours.c:3105
msgid "# SET QUOTA messages ignored (no such peer)"
msgstr "# Mensajes «SET QUOTA» ignorados (no existe tal par)"
-#: src/transport/gnunet-service-transport_neighbours.c:3115
+#: src/transport/gnunet-service-transport_neighbours.c:3119
msgid "# disconnects due to quota of 0"
msgstr "# desconexiones debido a una cuota de 0"
-#: src/transport/gnunet-service-transport_neighbours.c:3146
+#: src/transport/gnunet-service-transport_neighbours.c:3150
msgid "# disconnect messages ignored (old format)"
msgstr "# mensajes de desconexión ignorados (formato antiguo)"
-#: src/transport/gnunet-service-transport_neighbours.c:3157
+#: src/transport/gnunet-service-transport_neighbours.c:3161
msgid "# disconnect messages ignored (timestamp)"
msgstr "# mensajes de desconexión ignorados (marca temporal)"
-#: src/transport/gnunet-service-transport_neighbours.c:3188
+#: src/transport/gnunet-service-transport_neighbours.c:3192
msgid "# other peer asked to disconnect from us"
msgstr "# peticiones de otro par para desconectarse de nosotros"
-#: src/transport/gnunet-service-transport_neighbours.c:3283
+#: src/transport/gnunet-service-transport_neighbours.c:3287
msgid "# disconnected from peer upon explicit request"
msgstr "# desconexiones del par debido a una petición explícita"
@@ -5837,66 +5826,66 @@
msgid "# bytes dropped by SMTP (outgoing)"
msgstr "# bytes omitidos por SMTP (salientes)"
-#: src/transport/plugin_transport_tcp.c:595
+#: src/transport/plugin_transport_tcp.c:596
#, c-format
msgid "Unexpected address length: %u bytes\n"
msgstr "Longitud de dirección inesperada: %u bytes\n"
-#: src/transport/plugin_transport_tcp.c:771
-#: src/transport/plugin_transport_tcp.c:860
-#: src/transport/plugin_transport_tcp.c:910
-#: src/transport/plugin_transport_tcp.c:996
-#: src/transport/plugin_transport_tcp.c:1139
-#: src/transport/plugin_transport_tcp.c:1156
+#: src/transport/plugin_transport_tcp.c:772
+#: src/transport/plugin_transport_tcp.c:861
+#: src/transport/plugin_transport_tcp.c:911
+#: src/transport/plugin_transport_tcp.c:997
+#: src/transport/plugin_transport_tcp.c:1140
+#: src/transport/plugin_transport_tcp.c:1157
msgid "# bytes currently in TCP buffers"
msgstr "# bytes actualmente en los buffer TCP"
-#: src/transport/plugin_transport_tcp.c:778
-#: src/transport/plugin_transport_tcp.c:967
-#: src/transport/plugin_transport_tcp.c:1826
-#: src/transport/plugin_transport_tcp.c:2456
+#: src/transport/plugin_transport_tcp.c:779
+#: src/transport/plugin_transport_tcp.c:968
+#: src/transport/plugin_transport_tcp.c:1827
+#: src/transport/plugin_transport_tcp.c:2460
msgid "# TCP sessions active"
msgstr "# Sesiones TCP activas"
-#: src/transport/plugin_transport_tcp.c:864
+#: src/transport/plugin_transport_tcp.c:865
msgid "# bytes discarded by TCP (timeout)"
msgstr "# bytes omitidos por TCP (expirados)"
-#: src/transport/plugin_transport_tcp.c:913
+#: src/transport/plugin_transport_tcp.c:914
msgid "# bytes transmitted via TCP"
msgstr "# bytes recibidos vía TCP"
-#: src/transport/plugin_transport_tcp.c:1000
+#: src/transport/plugin_transport_tcp.c:1001
msgid "# bytes discarded by TCP (disconnect)"
msgstr "# bytes descartados por TCP (desconectado)"
-#: src/transport/plugin_transport_tcp.c:1113
+#: src/transport/plugin_transport_tcp.c:1114
#, c-format
msgid "Trying to send with invalid session %p\n"
msgstr "Intentando enviar con una sesión no válida %p\n"
-#: src/transport/plugin_transport_tcp.c:1349
+#: src/transport/plugin_transport_tcp.c:1350
#, c-format
msgid "Address of unexpected length: %u\n"
msgstr "Dirección de tamaño inesperado: %u\n"
-#: src/transport/plugin_transport_tcp.c:1466
+#: src/transport/plugin_transport_tcp.c:1467
msgid "# transport-service disconnect requests for TCP"
msgstr "# peticiones de desconexión del servicio de transporte por TCP"
-#: src/transport/plugin_transport_tcp.c:1867
+#: src/transport/plugin_transport_tcp.c:1868
msgid "# TCP WELCOME messages received"
msgstr "# Mensajes «WELCOME» TCP recibidos"
-#: src/transport/plugin_transport_tcp.c:2036
+#: src/transport/plugin_transport_tcp.c:2037
msgid "# bytes received via TCP"
msgstr "# bytes recibidos vía TCP"
-#: src/transport/plugin_transport_tcp.c:2118
+#: src/transport/plugin_transport_tcp.c:2119
msgid "# network-level TCP disconnect events"
msgstr "# eventos de desconexión TCP a nivel de red"
-#: src/transport/plugin_transport_tcp.c:2344 src/util/service.c:948
+#: src/transport/plugin_transport_tcp.c:2345 src/util/service.c:948
#: src/util/service.c:954
#, c-format
msgid "Require valid port number for service `%s' in configuration!\n"
@@ -5904,20 +5893,20 @@
"¡Se requiere un número de puerto válido para el servicio «%s» en la "
"configuración!\n"
-#: src/transport/plugin_transport_tcp.c:2358
+#: src/transport/plugin_transport_tcp.c:2359
msgid "Failed to start service.\n"
msgstr "Se produjo un fallo al iniciar el servicio.\n"
-#: src/transport/plugin_transport_tcp.c:2444
+#: src/transport/plugin_transport_tcp.c:2448
#, c-format
msgid "TCP transport listening on port %llu\n"
msgstr "Transporte TCP escuchando en el puerto %llu\n"
-#: src/transport/plugin_transport_tcp.c:2448
+#: src/transport/plugin_transport_tcp.c:2452
msgid "TCP transport not listening on any port (client only)\n"
msgstr "Transporte TCP no escuchando en ningún puerto (únicamente cliente)\n"
-#: src/transport/plugin_transport_tcp.c:2452
+#: src/transport/plugin_transport_tcp.c:2456
#, c-format
msgid "TCP transport advertises itself as being on port %llu\n"
msgstr "El transporte TCP anuncia que está en el puerto %llu\n"
@@ -5942,7 +5931,7 @@
"Se produjo un fallo al establecer la opción de «broadcast» IPv4 para el "
"«socket» en el puerto %d\n"
-#: src/transport/plugin_transport_udp.c:2520
+#: src/transport/plugin_transport_udp.c:2350
#, c-format
msgid ""
"UDP could not transmit message to `%s': Network seems down, please check "
@@ -5951,7 +5940,7 @@
"UDP no pudo transmitir el mensaje a «%s»: La red parece caída, por favor, "
"compruebe su configuración de red\n"
-#: src/transport/plugin_transport_udp.c:2534
+#: src/transport/plugin_transport_udp.c:2364
#, c-format
msgid ""
"UDP could not transmit message to `%s': Please check your network "
@@ -5962,22 +5951,28 @@
"configuración de red y deshabilite IPv6 si su conexión carece de una "
"dirección IPv6 global\n"
-#: src/transport/plugin_transport_udp.c:2775
+#: src/transport/plugin_transport_udp.c:2664
msgid "Failed to open UDP sockets\n"
msgstr "Se produjo un fallo al abrir los «sockets» UDP\n"
-#: src/transport/plugin_transport_udp.c:2851
+#: src/transport/plugin_transport_udp.c:2762
#, c-format
msgid "Given `%s' option is out of range: %llu > %u\n"
msgstr "La opción «%s» dada está fuera de rango: %llu > %u\n"
-#: src/transport/plugin_transport_udp.c:2894
+#: src/transport/plugin_transport_udp.c:2805
#, c-format
msgid "Invalid IPv6 address: `%s'\n"
msgstr "Dirección IPv6 no válida: «%s»\n"
-#: src/transport/plugin_transport_unix.c:1353
-msgid "Failed to open UNIX sockets\n"
+#: src/transport/plugin_transport_udp.c:2862
+#, fuzzy
+msgid "Failed to create network sockets, plugin failed\n"
+msgstr "Se produjo un fallo al crear una nueva firma"
+
+#: src/transport/plugin_transport_unix.c:1427
+#, fuzzy
+msgid "Failed to open UNIX listen socket\n"
msgstr "Se produjo un fallo al abrir los «sockets» UNIX\n"
#: src/transport/plugin_transport_wlan.c:580
@@ -6300,7 +6295,7 @@
msgid "gnunet-ecc failed"
msgstr "«gnunet-ecc» falló"
-#: src/util/crypto_ecc.c:1045
+#: src/util/crypto_ecc.c:1084
#, c-format
msgid "ECC signature verification failed at %s:%d: %s\n"
msgstr "La verificación de firma ECC falló en %s:%d: %s\n"
@@ -6567,19 +6562,19 @@
msgid "Perform default-actions for GNUnet URIs"
msgstr "Realizar las acciones predeterminadas para URI de GNUnet"
-#: src/util/helper.c:271
+#: src/util/helper.c:322
#, c-format
msgid "Error reading from `%s': %s\n"
msgstr "Error leyendo de «%s»: %s\n"
-#: src/util/helper.c:316
+#: src/util/helper.c:367
#, c-format
msgid "Failed to parse inbound message from helper `%s'\n"
msgstr ""
"Se produjo un fallo al procesar el mensaje interno del programa auxiliar "
"«%s»\n"
-#: src/util/helper.c:537
+#: src/util/helper.c:564
#, c-format
msgid "Error writing to `%s': %s\n"
msgstr "Error escribiendo a «%s»: %s\n"
@@ -7097,6 +7092,15 @@
msgid "`%s' failed on file `%s' at %s:%d with error: %s\n"
msgstr "«%s» falló en el fichero «%s» en %s:%d con el error: %s\n"
+#~ msgid "No hosts-file specified on command line. Exiting.\n"
+#~ msgstr ""
+#~ "No se ha especificado el fichero de máquinas en la línea de comandos. "
+#~ "Saliendo.\n"
+
+#~ msgid "number of search strings to read from search strings file"
+#~ msgstr ""
+#~ "número de cadenas de búsqueda a leer del fichero de cadenas de búsqueda"
+
# Miguel: "shutdown request" se refiere a finalizar el
# que hace de cliente.
#~ msgid "Failed to transmit shutdown request to client.\n"
Modified: gnunet/po/sv.po
===================================================================
--- gnunet/po/sv.po 2013-05-22 10:27:24 UTC (rev 27250)
+++ gnunet/po/sv.po 2013-05-22 10:29:15 UTC (rev 27251)
@@ -7,7 +7,7 @@
msgstr ""
"Project-Id-Version: GNUnet 0.7.0b\n"
"Report-Msgid-Bugs-To: address@hidden"
-"POT-Creation-Date: 2013-04-27 12:39+0200\n"
+"POT-Creation-Date: 2013-05-20 15:09+0200\n"
"PO-Revision-Date: 2006-01-21 17:16+0100\n"
"Last-Translator: Daniel Nylander <address@hidden>\n"
"Language-Team: Swedish <address@hidden>\n"
@@ -35,89 +35,89 @@
msgid "Failed to remove servicehome directory %s\n"
msgstr "Filformatsfel (inte en GNUnet-katalog?)\n"
-#: src/arm/gnunet-arm.c:204 src/testbed/gnunet-service-testbed_peers.c:712
+#: src/arm/gnunet-arm.c:204 src/testbed/gnunet-service-testbed_peers.c:962
msgid "Message was sent successfully"
msgstr ""
-#: src/arm/gnunet-arm.c:206 src/testbed/gnunet-service-testbed_peers.c:714
+#: src/arm/gnunet-arm.c:206 src/testbed/gnunet-service-testbed_peers.c:964
#, fuzzy
msgid "Misconfiguration (can't connect to the ARM service)"
msgstr "Misslyckades att ansluta till gnunetd.\n"
-#: src/arm/gnunet-arm.c:208 src/testbed/gnunet-service-testbed_peers.c:716
+#: src/arm/gnunet-arm.c:208 src/testbed/gnunet-service-testbed_peers.c:966
#, fuzzy
msgid "We disconnected from ARM before we could send a request"
msgstr "# av anslutna parter"
-#: src/arm/gnunet-arm.c:210 src/testbed/gnunet-service-testbed_peers.c:718
+#: src/arm/gnunet-arm.c:210 src/testbed/gnunet-service-testbed_peers.c:968
msgid "ARM API is busy"
msgstr ""
-#: src/arm/gnunet-arm.c:212 src/testbed/gnunet-service-testbed_peers.c:720
+#: src/arm/gnunet-arm.c:212 src/testbed/gnunet-service-testbed_peers.c:970
msgid "Request doesn't fit into a message"
msgstr ""
-#: src/arm/gnunet-arm.c:214 src/testbed/gnunet-service-testbed_peers.c:722
+#: src/arm/gnunet-arm.c:214 src/testbed/gnunet-service-testbed_peers.c:972
#, fuzzy
msgid "Request timed out"
msgstr "# sessionsnycklar accepterade"
-#: src/arm/gnunet-arm.c:216 src/testbed/gnunet-service-testbed_peers.c:724
+#: src/arm/gnunet-arm.c:216 src/testbed/gnunet-service-testbed_peers.c:974
#, fuzzy
msgid "Unknown request status"
msgstr "Okänd operation \"%s\"\n"
-#: src/arm/gnunet-arm.c:232 src/testbed/gnunet-service-testbed_peers.c:740
+#: src/arm/gnunet-arm.c:232 src/testbed/gnunet-service-testbed_peers.c:990
#, fuzzy, c-format
msgid "%s is stopped"
msgstr "# byte krypterade"
-#: src/arm/gnunet-arm.c:234 src/testbed/gnunet-service-testbed_peers.c:742
+#: src/arm/gnunet-arm.c:234 src/testbed/gnunet-service-testbed_peers.c:992
#, fuzzy, c-format
msgid "%s is starting"
msgstr "\"%s\" startar\n"
-#: src/arm/gnunet-arm.c:236 src/testbed/gnunet-service-testbed_peers.c:744
+#: src/arm/gnunet-arm.c:236 src/testbed/gnunet-service-testbed_peers.c:994
#, c-format
msgid "%s is stopping"
msgstr ""
-#: src/arm/gnunet-arm.c:238 src/testbed/gnunet-service-testbed_peers.c:746
+#: src/arm/gnunet-arm.c:238 src/testbed/gnunet-service-testbed_peers.c:996
#, fuzzy, c-format
msgid "%s is starting already"
msgstr "\"%s\" startar\n"
-#: src/arm/gnunet-arm.c:240 src/testbed/gnunet-service-testbed_peers.c:748
+#: src/arm/gnunet-arm.c:240 src/testbed/gnunet-service-testbed_peers.c:998
#, c-format
msgid "%s is stopping already"
msgstr ""
-#: src/arm/gnunet-arm.c:242 src/testbed/gnunet-service-testbed_peers.c:750
+#: src/arm/gnunet-arm.c:242 src/testbed/gnunet-service-testbed_peers.c:1000
#, c-format
msgid "%s is started already"
msgstr ""
-#: src/arm/gnunet-arm.c:244 src/testbed/gnunet-service-testbed_peers.c:752
+#: src/arm/gnunet-arm.c:244 src/testbed/gnunet-service-testbed_peers.c:1002
#, c-format
msgid "%s is stopped already"
msgstr ""
-#: src/arm/gnunet-arm.c:246 src/testbed/gnunet-service-testbed_peers.c:754
+#: src/arm/gnunet-arm.c:246 src/testbed/gnunet-service-testbed_peers.c:1004
#, fuzzy, c-format
msgid "%s service is not known to ARM"
msgstr "\"%s\" är inte en fil.\n"
-#: src/arm/gnunet-arm.c:248 src/testbed/gnunet-service-testbed_peers.c:756
+#: src/arm/gnunet-arm.c:248 src/testbed/gnunet-service-testbed_peers.c:1006
#, fuzzy, c-format
msgid "%s service failed to start"
msgstr "Misslyckades att starta samling.\n"
-#: src/arm/gnunet-arm.c:250 src/testbed/gnunet-service-testbed_peers.c:758
+#: src/arm/gnunet-arm.c:250 src/testbed/gnunet-service-testbed_peers.c:1008
#, c-format
msgid "%s service can't be started because ARM is shutting down"
msgstr ""
-#: src/arm/gnunet-arm.c:252 src/testbed/gnunet-service-testbed_peers.c:760
+#: src/arm/gnunet-arm.c:252 src/testbed/gnunet-service-testbed_peers.c:1010
#, c-format
msgid "%.s Unknown result code."
msgstr ""
@@ -841,8 +841,8 @@
#: src/transport/gnunet-service-transport_neighbours.c:1041
#: src/transport/gnunet-service-transport_neighbours.c:1265
#: src/transport/gnunet-service-transport_neighbours.c:1274
-#: src/transport/gnunet-service-transport_neighbours.c:2794
-#: src/transport/gnunet-service-transport_neighbours.c:3053
+#: src/transport/gnunet-service-transport_neighbours.c:2798
+#: src/transport/gnunet-service-transport_neighbours.c:3057
#, fuzzy
msgid "# peers connected"
msgstr "# av anslutna parter"
@@ -1311,7 +1311,7 @@
#: src/dht/gnunet-dht-put.c:213 src/fs/gnunet-auto-share.c:753
#: src/fs/gnunet-download.c:328 src/fs/gnunet-publish.c:736
#: src/fs/gnunet-search.c:294 src/fs/gnunet-unindex.c:168
-#: src/nse/gnunet-nse-profiler.c:900
+#: src/nse/gnunet-nse-profiler.c:899
msgid "be verbose (print progress information)"
msgstr ""
@@ -2215,7 +2215,7 @@
msgid "no-name"
msgstr "Visa namn"
-#: src/fs/fs_pseudonym.c:1182 src/util/crypto_ecc.c:975
+#: src/fs/fs_pseudonym.c:1182 src/util/crypto_ecc.c:1014
#, fuzzy, c-format
msgid "ECC signing failed at %s:%d: %s\n"
msgstr "\"%s\" misslyckades vid %s:%d med fel: \"%s\".\n"
@@ -2418,12 +2418,12 @@
msgid "Unrecognized URI type"
msgstr ""
-#: src/fs/fs_uri.c:898
+#: src/fs/fs_uri.c:898 src/util/crypto_ecc.c:941
#, fuzzy
msgid "Lacking key configuration settings.\n"
msgstr "GNUnet-konfiguration"
-#: src/fs/fs_uri.c:904
+#: src/fs/fs_uri.c:904 src/util/crypto_ecc.c:947
#, fuzzy, c-format
msgid "Could not access hostkey file `%s'.\n"
msgstr "Kunde inte tolka konfigurationsfil \"%s\".\n"
@@ -3736,16 +3736,16 @@
msgid "Hostlist file `%s' could not be removed\n"
msgstr ""
-#: src/hostlist/hostlist-server.c:134
+#: src/hostlist/hostlist-server.c:137
#, fuzzy
msgid "bytes in hostlist"
msgstr "# byte krypterade"
-#: src/hostlist/hostlist-server.c:157
+#: src/hostlist/hostlist-server.c:161
msgid "expired addresses encountered"
msgstr ""
-#: src/hostlist/hostlist-server.c:184 src/hostlist/hostlist-server.c:421
+#: src/hostlist/hostlist-server.c:189 src/hostlist/hostlist-server.c:424
#: src/peerinfo-tool/gnunet-peerinfo.c:348
#: src/peerinfo-tool/gnunet-peerinfo.c:418
#: src/peerinfo-tool/gnunet-peerinfo.c:489
@@ -3754,83 +3754,83 @@
msgid "Error in communication with PEERINFO service: %s\n"
msgstr "Skriv ut information om GNUnets motparter."
-#: src/hostlist/hostlist-server.c:205
+#: src/hostlist/hostlist-server.c:210
msgid "HELLOs without addresses encountered (ignored)"
msgstr ""
-#: src/hostlist/hostlist-server.c:219
+#: src/hostlist/hostlist-server.c:224
msgid "bytes not included in hostlist (size limit)"
msgstr ""
-#: src/hostlist/hostlist-server.c:263
+#: src/hostlist/hostlist-server.c:268
#, c-format
msgid "Refusing `%s' request to hostlist server\n"
msgstr ""
-#: src/hostlist/hostlist-server.c:266
+#: src/hostlist/hostlist-server.c:271
msgid "hostlist requests refused (not HTTP GET)"
msgstr ""
-#: src/hostlist/hostlist-server.c:279
+#: src/hostlist/hostlist-server.c:284
#, c-format
msgid "Refusing `%s' request with %llu bytes of upload data\n"
msgstr ""
-#: src/hostlist/hostlist-server.c:283
+#: src/hostlist/hostlist-server.c:288
msgid "hostlist requests refused (upload data)"
msgstr ""
-#: src/hostlist/hostlist-server.c:291
+#: src/hostlist/hostlist-server.c:296
msgid "Could not handle hostlist request since I do not have a response yet\n"
msgstr ""
-#: src/hostlist/hostlist-server.c:294
+#: src/hostlist/hostlist-server.c:299
msgid "hostlist requests refused (not ready)"
msgstr ""
-#: src/hostlist/hostlist-server.c:298
+#: src/hostlist/hostlist-server.c:303
msgid "Received request for our hostlist\n"
msgstr ""
-#: src/hostlist/hostlist-server.c:299
+#: src/hostlist/hostlist-server.c:304
msgid "hostlist requests processed"
msgstr ""
-#: src/hostlist/hostlist-server.c:341
+#: src/hostlist/hostlist-server.c:346
msgid "# hostlist advertisements send"
msgstr ""
-#: src/hostlist/hostlist-server.c:384
+#: src/hostlist/hostlist-server.c:389
msgid "Advertisement message could not be queued by core\n"
msgstr ""
-#: src/hostlist/hostlist-server.c:548 src/peerinfo-tool/gnunet-peerinfo.c:649
+#: src/hostlist/hostlist-server.c:560 src/peerinfo-tool/gnunet-peerinfo.c:649
#: src/transport/gnunet-service-transport.c:661
#, fuzzy
msgid "Could not access PEERINFO service. Exiting.\n"
msgstr "Kunde inte komma åt namnrymdsinformation.\n"
-#: src/hostlist/hostlist-server.c:558
+#: src/hostlist/hostlist-server.c:570
#, fuzzy, c-format
msgid "Invalid port number %llu. Exiting.\n"
msgstr "Ogiltiga argument. Avslutar.\n"
-#: src/hostlist/hostlist-server.c:567
+#: src/hostlist/hostlist-server.c:579
#, c-format
msgid "Hostlist service starts on %s:%llu\n"
msgstr ""
-#: src/hostlist/hostlist-server.c:581
+#: src/hostlist/hostlist-server.c:593
#, fuzzy, c-format
msgid "Address to obtain hostlist: `%s'\n"
msgstr "Misslyckades att läsa kompislista från \"%s\"\n"
-#: src/hostlist/hostlist-server.c:621
+#: src/hostlist/hostlist-server.c:633
#, fuzzy, c-format
msgid "`%s' is not a valid IP address! Ignoring BINDTOIP.\n"
msgstr "\"%s\" är inte tillgänglig."
-#: src/hostlist/hostlist-server.c:663
+#: src/hostlist/hostlist-server.c:675
#, c-format
msgid "Could not start hostlist HTTP server on port %u\n"
msgstr ""
@@ -3870,11 +3870,11 @@
msgid "Print information about mesh tunnels and peers."
msgstr "Skriv ut information om GNUnets motparter."
-#: src/mesh/gnunet-service-mesh.c:7966 src/mesh/gnunet-service-mesh-new.c:7972
+#: src/mesh/gnunet-service-mesh.c:7966 src/mesh/gnunet-service-mesh-new.c:4649
msgid "Wrong CORE service\n"
msgstr ""
-#: src/mesh/gnunet-service-mesh.c:8179 src/mesh/gnunet-service-mesh-new.c:8185
+#: src/mesh/gnunet-service-mesh.c:8179 src/mesh/gnunet-service-mesh-new.c:4790
#, fuzzy, c-format
msgid "Mesh service could not access hostkey: %s. Exiting.\n"
msgstr "Kunde inte komma åt namnrymdsinformation.\n"
@@ -3882,14 +3882,13 @@
#: src/mesh/gnunet-service-mesh.c:8261 src/mesh/gnunet-service-mesh.c:8273
#: src/mesh/gnunet-service-mesh.c:8285 src/mesh/gnunet-service-mesh.c:8299
#: src/mesh/gnunet-service-mesh.c:8311 src/mesh/gnunet-service-mesh.c:8323
-#: src/mesh/gnunet-service-mesh.c:8335 src/mesh/gnunet-service-mesh-new.c:8274
-#: src/mesh/gnunet-service-mesh-new.c:8286
-#: src/mesh/gnunet-service-mesh-new.c:8298
-#: src/mesh/gnunet-service-mesh-new.c:8312
-#: src/mesh/gnunet-service-mesh-new.c:8324
-#: src/mesh/gnunet-service-mesh-new.c:8336
-#: src/mesh/gnunet-service-mesh-new.c:8348 src/nse/gnunet-service-nse.c:1516
-#: src/nse/gnunet-service-nse.c:1534
+#: src/mesh/gnunet-service-mesh.c:8335 src/mesh/gnunet-service-mesh-new.c:4860
+#: src/mesh/gnunet-service-mesh-new.c:4872
+#: src/mesh/gnunet-service-mesh-new.c:4884
+#: src/mesh/gnunet-service-mesh-new.c:4896
+#: src/mesh/gnunet-service-mesh-new.c:4908
+#: src/mesh/gnunet-service-mesh-new.c:4920 src/nse/gnunet-service-nse.c:1500
+#: src/nse/gnunet-service-nse.c:1518
#: src/regex/gnunet-daemon-regexprofiler.c:320
#: src/regex/gnunet-daemon-regexprofiler.c:332
#: src/regex/gnunet-daemon-regexprofiler.c:344
@@ -3900,9 +3899,9 @@
msgstr "GNUnet-konfiguration"
#: src/mesh/gnunet-service-mesh.c:8347 src/mesh/gnunet-service-mesh.c:8357
-#: src/mesh/gnunet-service-mesh.c:8368 src/mesh/gnunet-service-mesh-new.c:8360
-#: src/mesh/gnunet-service-mesh-new.c:8370
-#: src/mesh/gnunet-service-mesh-new.c:8381
+#: src/mesh/gnunet-service-mesh.c:8368 src/mesh/gnunet-service-mesh-new.c:4932
+#: src/mesh/gnunet-service-mesh-new.c:4942
+#: src/mesh/gnunet-service-mesh-new.c:4953
#, fuzzy, c-format
msgid ""
"%s service is lacking key configuration settings (%s). Using default (%u).\n"
@@ -4239,32 +4238,32 @@
msgid "gnunet-helper-nat-client not found or behind NAT, disabling it\n"
msgstr ""
-#: src/nat/nat.c:795
+#: src/nat/nat.c:834
#, c-format
msgid "gnunet-helper-nat-server generated malformed address `%s'\n"
msgstr ""
-#: src/nat/nat.c:844
+#: src/nat/nat.c:883
#, fuzzy, c-format
msgid "Failed to start %s\n"
msgstr "Misslyckades att starta samling.\n"
-#: src/nat/nat.c:1113
+#: src/nat/nat.c:1152
msgid "malformed"
msgstr ""
-#: src/nat/nat.c:1179 src/nat/nat.c:1191
+#: src/nat/nat.c:1218 src/nat/nat.c:1230
#, c-format
msgid ""
"Configuration requires `%s', but binary is not installed properly (SUID bit "
"not set). Option disabled.\n"
msgstr ""
-#: src/nat/nat.c:1326
+#: src/nat/nat.c:1365
msgid "Internal IP address not known, cannot use ICMP NAT traversal method\n"
msgstr ""
-#: src/nat/nat.c:1337
+#: src/nat/nat.c:1376
#, c-format
msgid "Running gnunet-helper-nat-client %s %s %u\n"
msgstr ""
@@ -4287,46 +4286,46 @@
msgid "Failed to create listen socket bound to `%s' for NAT test: %s\n"
msgstr ""
-#: src/nse/gnunet-nse-profiler.c:885
+#: src/nse/gnunet-nse-profiler.c:884
#, fuzzy
msgid "limit to the number of connections to NSE services, 0 for none"
msgstr "Misslyckades att ansluta till gnunetd.\n"
-#: src/nse/gnunet-nse-profiler.c:888
+#: src/nse/gnunet-nse-profiler.c:887
msgid "name of the file for writing connection information and statistics"
msgstr ""
-#: src/nse/gnunet-nse-profiler.c:891 src/testbed/gnunet-testbed-profiler.c:282
+#: src/nse/gnunet-nse-profiler.c:890 src/testbed/gnunet-testbed-profiler.c:284
msgid "name of the file with the login information for the testbed"
msgstr ""
-#: src/nse/gnunet-nse-profiler.c:894
+#: src/nse/gnunet-nse-profiler.c:893
msgid "name of the file for writing the main results"
msgstr ""
-#: src/nse/gnunet-nse-profiler.c:897
+#: src/nse/gnunet-nse-profiler.c:896
msgid "Number of peers to run in each round, separated by commas"
msgstr ""
-#: src/nse/gnunet-nse-profiler.c:903
+#: src/nse/gnunet-nse-profiler.c:902
msgid "delay between rounds"
msgstr ""
-#: src/nse/gnunet-nse-profiler.c:912
+#: src/nse/gnunet-nse-profiler.c:911
#, fuzzy
msgid "Measure quality and performance of the NSE service."
msgstr "Kan inte tillgå tjänsten"
-#: src/nse/gnunet-service-nse.c:1405
+#: src/nse/gnunet-service-nse.c:1419
#, fuzzy, c-format
msgid "NSE service could not access hostkey: %s\n"
msgstr "Kunde inte komma åt namnrymdsinformation.\n"
-#: src/nse/gnunet-service-nse.c:1419
+#: src/nse/gnunet-service-nse.c:1433
msgid "NSE service is lacking key configuration settings. Exiting.\n"
msgstr ""
-#: src/nse/gnunet-service-nse.c:1524
+#: src/nse/gnunet-service-nse.c:1508
#, fuzzy
msgid "Invalid work requirement for NSE service. Exiting.\n"
msgstr "Ogiltiga argument. Avslutar.\n"
@@ -4336,42 +4335,42 @@
msgid "Removing expired address of transport `%s'\n"
msgstr "Tillgängliga transport(er): %s\n"
-#: src/peerinfo/gnunet-service-peerinfo.c:354
+#: src/peerinfo/gnunet-service-peerinfo.c:355
#, fuzzy, c-format
msgid "Failed to parse HELLO in file `%s': %s\n"
msgstr "Misslyckades att läsa kompislista från \"%s\"\n"
-#: src/peerinfo/gnunet-service-peerinfo.c:369
+#: src/peerinfo/gnunet-service-peerinfo.c:370
#, fuzzy, c-format
msgid "Failed to parse HELLO in file `%s': %s %u \n"
msgstr "Misslyckades att läsa kompislista från \"%s\"\n"
-#: src/peerinfo/gnunet-service-peerinfo.c:444
+#: src/peerinfo/gnunet-service-peerinfo.c:445
msgid "# peers known"
msgstr ""
-#: src/peerinfo/gnunet-service-peerinfo.c:480
+#: src/peerinfo/gnunet-service-peerinfo.c:481
#, c-format
msgid ""
"File `%s' in directory `%s' does not match naming convention. Removed.\n"
msgstr ""
-#: src/peerinfo/gnunet-service-peerinfo.c:632
+#: src/peerinfo/gnunet-service-peerinfo.c:633
#, fuzzy, c-format
msgid "Scanning directory `%s'\n"
msgstr "Misslyckades att läsa kompislista från \"%s\"\n"
-#: src/peerinfo/gnunet-service-peerinfo.c:637
+#: src/peerinfo/gnunet-service-peerinfo.c:638
#, c-format
msgid "Still no peers found in `%s'!\n"
msgstr ""
-#: src/peerinfo/gnunet-service-peerinfo.c:969
+#: src/peerinfo/gnunet-service-peerinfo.c:970
#, fuzzy, c-format
msgid "Cleaning up directory `%s'\n"
msgstr "Misslyckades att läsa kompislista från \"%s\"\n"
-#: src/peerinfo/gnunet-service-peerinfo.c:1249
+#: src/peerinfo/gnunet-service-peerinfo.c:1250
#, c-format
msgid "Importing HELLOs from `%s'\n"
msgstr ""
@@ -4587,81 +4586,73 @@
msgid "Daemon to announce regular expressions for the peer using mesh."
msgstr ""
-#: src/regex/gnunet-regex-profiler.c:1246
+#: src/regex/gnunet-regex-profiler.c:1247
#, fuzzy
msgid "No configuration file given. Exiting\n"
msgstr "använd konfigurationsfil FILNAMN"
-#: src/regex/gnunet-regex-profiler.c:1257
+#: src/regex/gnunet-regex-profiler.c:1258
#, fuzzy
msgid "Configuration option \"regex_prefix\" missing. Exiting\n"
msgstr "Konfigurationsfil \"%s\" skapad.\n"
-#: src/regex/gnunet-regex-profiler.c:1276
-msgid "No hosts-file specified on command line. Exiting.\n"
-msgstr ""
-
-#: src/regex/gnunet-regex-profiler.c:1282
+#: src/regex/gnunet-regex-profiler.c:1287
#: src/regex/gnunet-regex-simulation-profiler.c:622
#, c-format
msgid "No policy directory specified on command line. Exiting.\n"
msgstr ""
-#: src/regex/gnunet-regex-profiler.c:1288
+#: src/regex/gnunet-regex-profiler.c:1293
#: src/regex/gnunet-regex-simulation-profiler.c:629
#, c-format
msgid "Specified policies directory does not exist. Exiting.\n"
msgstr ""
-#: src/regex/gnunet-regex-profiler.c:1295
+#: src/regex/gnunet-regex-profiler.c:1300
#, fuzzy, c-format
msgid "No files found in `%s'\n"
msgstr "%d filer hittades i katalog.\n"
-#: src/regex/gnunet-regex-profiler.c:1304
+#: src/regex/gnunet-regex-profiler.c:1309
msgid "No search strings file given. Exiting.\n"
msgstr ""
-#: src/regex/gnunet-regex-profiler.c:1314
+#: src/regex/gnunet-regex-profiler.c:1319
#, fuzzy
msgid ""
"Error loading search strings.Given file does not contain enough strings. "
"Exiting.\n"
msgstr "Fel vid lämning av DHT.\n"
-#: src/regex/gnunet-regex-profiler.c:1322
+#: src/regex/gnunet-regex-profiler.c:1327
#, fuzzy
msgid "Error loading search strings. Exiting.\n"
msgstr "Fel vid lämning av DHT.\n"
-#: src/regex/gnunet-regex-profiler.c:1389
+#: src/regex/gnunet-regex-profiler.c:1394
#, fuzzy
msgid "name of the file for writing statistics"
msgstr "Visa värde av alternativet"
-#: src/regex/gnunet-regex-profiler.c:1392
-msgid "wait TIMEOUT before considering a string match as failed"
+#: src/regex/gnunet-regex-profiler.c:1397
+msgid "wait TIMEOUT before ending the experiment"
msgstr ""
-#: src/regex/gnunet-regex-profiler.c:1395
-msgid "number of search strings to read from search strings file"
-msgstr ""
-
-#: src/regex/gnunet-regex-profiler.c:1398
+#: src/regex/gnunet-regex-profiler.c:1400
msgid "directory with policy files"
msgstr ""
-#: src/regex/gnunet-regex-profiler.c:1401
+#: src/regex/gnunet-regex-profiler.c:1403
#, fuzzy
msgid "name of file with input strings"
msgstr "Visa värde av alternativet"
-#: src/regex/gnunet-regex-profiler.c:1404
+#: src/regex/gnunet-regex-profiler.c:1406
#, fuzzy
msgid "name of file with hosts' names"
msgstr "Visa värde av alternativet"
-#: src/regex/gnunet-regex-profiler.c:1416
+#: src/regex/gnunet-regex-profiler.c:1418
msgid "Profiler for regex"
msgstr ""
@@ -4779,7 +4770,7 @@
msgid "Could not parse execution interval for `%s', set to default 60 sec.\n"
msgstr ""
-#: src/testbed/gnunet-service-testbed_cpustatus.c:670
+#: src/testbed/gnunet-service-testbed_cpustatus.c:692
#, c-format
msgid ""
"Cannot open %s for writing load statistics. Not logging load statistics\n"
@@ -4790,26 +4781,26 @@
msgid "Job command file not given. Exiting\n"
msgstr "använd konfigurationsfil FILNAMN"
-#: src/testbed/gnunet_testbed_mpi_spawn.c:135
+#: src/testbed/gnunet_testbed_mpi_spawn.c:125
#, fuzzy
msgid "Waiting for child to exit.\n"
msgstr "Väntar på att motparter ska ansluta (%u iterationer kvar)...\n"
-#: src/testbed/gnunet_testbed_mpi_spawn.c:296
+#: src/testbed/gnunet_testbed_mpi_spawn.c:247
#, fuzzy, c-format
msgid "Spawning process `%s'\n"
msgstr "Startade samling \"%s\".\n"
-#: src/testbed/gnunet-testbed-profiler.c:249
+#: src/testbed/gnunet-testbed-profiler.c:251
#, fuzzy, c-format
msgid "Exiting as the number of peers is %u\n"
msgstr "Maximalt antal chattklienter uppnått.\n"
-#: src/testbed/gnunet-testbed-profiler.c:275
+#: src/testbed/gnunet-testbed-profiler.c:277
msgid "create COUNT number of peers"
msgstr ""
-#: src/testbed/gnunet-testbed-profiler.c:278
+#: src/testbed/gnunet-testbed-profiler.c:280
msgid "tolerate COUNT number of continious timeout failures"
msgstr ""
@@ -4828,55 +4819,55 @@
msgid "Hosts file %s cannot be read\n"
msgstr ""
-#: src/testbed/testbed_api_hosts.c:583
+#: src/testbed/testbed_api_hosts.c:595
#, c-format
msgid "The function %s is only available when compiled with (--with-ll)\n"
msgstr ""
-#: src/testbed/testbed_api_hosts.c:1856
+#: src/testbed/testbed_api_hosts.c:1879
#, fuzzy, c-format
msgid "Adding host %u failed with error: %s\n"
msgstr "\"%s\" misslyckades vid %s:%d med fel: %s\n"
-#: src/testbed/testbed_api_testbed.c:771
+#: src/testbed/testbed_api_testbed.c:891
msgid "Linking controllers failed. Exiting"
msgstr ""
-#: src/testbed/testbed_api_testbed.c:913
+#: src/testbed/testbed_api_testbed.c:1094
#, c-format
msgid "Host registration failed for a host. Error: %s\n"
msgstr ""
-#: src/testbed/testbed_api_testbed.c:978
+#: src/testbed/testbed_api_testbed.c:1175
msgid "Controller crash detected. Shutting down.\n"
msgstr ""
-#: src/testbed/testbed_api_testbed.c:1081
+#: src/testbed/testbed_api_testbed.c:1320
#, c-format
msgid "Host %s cannot start testbed\n"
msgstr ""
-#: src/testbed/testbed_api_testbed.c:1085
+#: src/testbed/testbed_api_testbed.c:1324
msgid "Testbed cannot be started on localhost\n"
msgstr ""
-#: src/testbed/testbed_api_testbed.c:1120
+#: src/testbed/testbed_api_testbed.c:1365
msgid "Cannot start the master controller"
msgstr ""
-#: src/testbed/testbed_api_testbed.c:1138
+#: src/testbed/testbed_api_testbed.c:1383
msgid "Shutting down testbed due to timeout while setup.\n"
msgstr ""
-#: src/testbed/testbed_api_testbed.c:1197
+#: src/testbed/testbed_api_testbed.c:1443
msgid "No hosts loaded from LoadLeveler. Need at least one host\n"
msgstr ""
-#: src/testbed/testbed_api_testbed.c:1209
+#: src/testbed/testbed_api_testbed.c:1455
msgid "No hosts loaded. Need at least one host\n"
msgstr ""
-#: src/testbed/testbed_api_testbed.c:1233
+#: src/testbed/testbed_api_testbed.c:1479
msgid "Specified topology must be supported by testbed"
msgstr ""
@@ -5023,7 +5014,7 @@
msgid "Failed to start `%s': %s\n"
msgstr "Fel vid %s:%d.\n"
-#: src/testing/testing.c:1691
+#: src/testing/testing.c:1709
#, fuzzy, c-format
msgid "Failed to load configuration from %s\n"
msgstr "Kunde inte spara konfigurationsfil \"%s\":"
@@ -5175,7 +5166,7 @@
msgid "# bytes payload dropped (other peer was not connected)"
msgstr ""
-#: src/transport/gnunet-service-transport_clients.c:728
+#: src/transport/gnunet-service-transport_clients.c:733
#, fuzzy
msgid "# REQUEST CONNECT messages received"
msgstr "# krypterade PONG-meddelanden mottagna"
@@ -5246,53 +5237,53 @@
msgid "# ms throttling suggested"
msgstr ""
-#: src/transport/gnunet-service-transport_neighbours.c:2770
+#: src/transport/gnunet-service-transport_neighbours.c:2774
#, fuzzy
msgid "# unexpected CONNECT_ACK messages (no peer)"
msgstr "skicka ANTAL meddelanden"
-#: src/transport/gnunet-service-transport_neighbours.c:2785
-#: src/transport/gnunet-service-transport_neighbours.c:2819
+#: src/transport/gnunet-service-transport_neighbours.c:2789
+#: src/transport/gnunet-service-transport_neighbours.c:2823
#, fuzzy
msgid "# unexpected CONNECT_ACK messages (not ready)"
msgstr "skicka ANTAL meddelanden"
-#: src/transport/gnunet-service-transport_neighbours.c:2832
+#: src/transport/gnunet-service-transport_neighbours.c:2836
#, fuzzy
msgid "# unexpected CONNECT_ACK messages (waiting on ATS)"
msgstr "skicka ANTAL meddelanden"
-#: src/transport/gnunet-service-transport_neighbours.c:2865
+#: src/transport/gnunet-service-transport_neighbours.c:2869
#, fuzzy
msgid "# unexpected CONNECT_ACK messages (disconnecting)"
msgstr "skicka ANTAL meddelanden"
-#: src/transport/gnunet-service-transport_neighbours.c:3046
+#: src/transport/gnunet-service-transport_neighbours.c:3050
#, fuzzy
msgid "# unexpected SESSION ACK messages"
msgstr "# krypterade PONG-meddelanden skickade"
-#: src/transport/gnunet-service-transport_neighbours.c:3101
+#: src/transport/gnunet-service-transport_neighbours.c:3105
msgid "# SET QUOTA messages ignored (no such peer)"
msgstr ""
-#: src/transport/gnunet-service-transport_neighbours.c:3115
+#: src/transport/gnunet-service-transport_neighbours.c:3119
msgid "# disconnects due to quota of 0"
msgstr ""
-#: src/transport/gnunet-service-transport_neighbours.c:3146
+#: src/transport/gnunet-service-transport_neighbours.c:3150
msgid "# disconnect messages ignored (old format)"
msgstr ""
-#: src/transport/gnunet-service-transport_neighbours.c:3157
+#: src/transport/gnunet-service-transport_neighbours.c:3161
msgid "# disconnect messages ignored (timestamp)"
msgstr ""
-#: src/transport/gnunet-service-transport_neighbours.c:3188
+#: src/transport/gnunet-service-transport_neighbours.c:3192
msgid "# other peer asked to disconnect from us"
msgstr ""
-#: src/transport/gnunet-service-transport_neighbours.c:3283
+#: src/transport/gnunet-service-transport_neighbours.c:3287
#, fuzzy
msgid "# disconnected from peer upon explicit request"
msgstr "# av anslutna parter"
@@ -5715,92 +5706,92 @@
msgid "# bytes dropped by SMTP (outgoing)"
msgstr "# byte kastade via TCP (utgående)"
-#: src/transport/plugin_transport_tcp.c:595
+#: src/transport/plugin_transport_tcp.c:596
#, c-format
msgid "Unexpected address length: %u bytes\n"
msgstr ""
-#: src/transport/plugin_transport_tcp.c:771
-#: src/transport/plugin_transport_tcp.c:860
-#: src/transport/plugin_transport_tcp.c:910
-#: src/transport/plugin_transport_tcp.c:996
-#: src/transport/plugin_transport_tcp.c:1139
-#: src/transport/plugin_transport_tcp.c:1156
+#: src/transport/plugin_transport_tcp.c:772
+#: src/transport/plugin_transport_tcp.c:861
+#: src/transport/plugin_transport_tcp.c:911
+#: src/transport/plugin_transport_tcp.c:997
+#: src/transport/plugin_transport_tcp.c:1140
+#: src/transport/plugin_transport_tcp.c:1157
#, fuzzy
msgid "# bytes currently in TCP buffers"
msgstr "# byte skickades via TCP"
-#: src/transport/plugin_transport_tcp.c:778
-#: src/transport/plugin_transport_tcp.c:967
-#: src/transport/plugin_transport_tcp.c:1826
-#: src/transport/plugin_transport_tcp.c:2456
+#: src/transport/plugin_transport_tcp.c:779
+#: src/transport/plugin_transport_tcp.c:968
+#: src/transport/plugin_transport_tcp.c:1827
+#: src/transport/plugin_transport_tcp.c:2460
#, fuzzy
msgid "# TCP sessions active"
msgstr "# sessionsnycklar accepterade"
-#: src/transport/plugin_transport_tcp.c:864
+#: src/transport/plugin_transport_tcp.c:865
#, fuzzy
msgid "# bytes discarded by TCP (timeout)"
msgstr "# byte kastade via TCP (utgående)"
-#: src/transport/plugin_transport_tcp.c:913
+#: src/transport/plugin_transport_tcp.c:914
#, fuzzy
msgid "# bytes transmitted via TCP"
msgstr "# byte skickade av typen %d"
-#: src/transport/plugin_transport_tcp.c:1000
+#: src/transport/plugin_transport_tcp.c:1001
#, fuzzy
msgid "# bytes discarded by TCP (disconnect)"
msgstr "# byte kastade via TCP (utgående)"
-#: src/transport/plugin_transport_tcp.c:1113
+#: src/transport/plugin_transport_tcp.c:1114
#, c-format
msgid "Trying to send with invalid session %p\n"
msgstr ""
-#: src/transport/plugin_transport_tcp.c:1349
+#: src/transport/plugin_transport_tcp.c:1350
#, c-format
msgid "Address of unexpected length: %u\n"
msgstr ""
-#: src/transport/plugin_transport_tcp.c:1466
+#: src/transport/plugin_transport_tcp.c:1467
msgid "# transport-service disconnect requests for TCP"
msgstr ""
-#: src/transport/plugin_transport_tcp.c:1867
+#: src/transport/plugin_transport_tcp.c:1868
#, fuzzy
msgid "# TCP WELCOME messages received"
msgstr "# krypterade PONG-meddelanden mottagna"
-#: src/transport/plugin_transport_tcp.c:2036
+#: src/transport/plugin_transport_tcp.c:2037
msgid "# bytes received via TCP"
msgstr "# byte mottogs via TCP"
-#: src/transport/plugin_transport_tcp.c:2118
+#: src/transport/plugin_transport_tcp.c:2119
msgid "# network-level TCP disconnect events"
msgstr ""
-#: src/transport/plugin_transport_tcp.c:2344 src/util/service.c:948
+#: src/transport/plugin_transport_tcp.c:2345 src/util/service.c:948
#: src/util/service.c:954
#, c-format
msgid "Require valid port number for service `%s' in configuration!\n"
msgstr ""
-#: src/transport/plugin_transport_tcp.c:2358
+#: src/transport/plugin_transport_tcp.c:2359
#, fuzzy
msgid "Failed to start service.\n"
msgstr "Misslyckades att starta samling.\n"
-#: src/transport/plugin_transport_tcp.c:2444
+#: src/transport/plugin_transport_tcp.c:2448
#, c-format
msgid "TCP transport listening on port %llu\n"
msgstr ""
-#: src/transport/plugin_transport_tcp.c:2448
+#: src/transport/plugin_transport_tcp.c:2452
msgid "TCP transport not listening on any port (client only)\n"
msgstr ""
-#: src/transport/plugin_transport_tcp.c:2452
+#: src/transport/plugin_transport_tcp.c:2456
#, c-format
msgid "TCP transport advertises itself as being on port %llu\n"
msgstr ""
@@ -5825,14 +5816,14 @@
msgid "Failed to set IPv4 broadcast option for broadcast socket on port %d\n"
msgstr ""
-#: src/transport/plugin_transport_udp.c:2520
+#: src/transport/plugin_transport_udp.c:2350
#, c-format
msgid ""
"UDP could not transmit message to `%s': Network seems down, please check "
"your network configuration\n"
msgstr ""
-#: src/transport/plugin_transport_udp.c:2534
+#: src/transport/plugin_transport_udp.c:2364
#, c-format
msgid ""
"UDP could not transmit message to `%s': Please check your network "
@@ -5840,24 +5831,29 @@
"IPv6 address\n"
msgstr ""
-#: src/transport/plugin_transport_udp.c:2775
+#: src/transport/plugin_transport_udp.c:2664
#, fuzzy
msgid "Failed to open UDP sockets\n"
msgstr "Misslyckades att binda till UDP6-port %d.\n"
-#: src/transport/plugin_transport_udp.c:2851
+#: src/transport/plugin_transport_udp.c:2762
#, c-format
msgid "Given `%s' option is out of range: %llu > %u\n"
msgstr ""
-#: src/transport/plugin_transport_udp.c:2894
+#: src/transport/plugin_transport_udp.c:2805
#, fuzzy, c-format
msgid "Invalid IPv6 address: `%s'\n"
msgstr "Ogiltigt svar på \"%s\".\n"
-#: src/transport/plugin_transport_unix.c:1353
+#: src/transport/plugin_transport_udp.c:2862
#, fuzzy
-msgid "Failed to open UNIX sockets\n"
+msgid "Failed to create network sockets, plugin failed\n"
+msgstr "Kunde inte skapa namnrymd \"%s\" (existerar?).\n"
+
+#: src/transport/plugin_transport_unix.c:1427
+#, fuzzy
+msgid "Failed to open UNIX listen socket\n"
msgstr "Misslyckades att leverera \"%s\" meddelande.\n"
#: src/transport/plugin_transport_wlan.c:580
@@ -6168,7 +6164,7 @@
msgid "gnunet-ecc failed"
msgstr "gnunet-update misslyckades!"
-#: src/util/crypto_ecc.c:1045
+#: src/util/crypto_ecc.c:1084
#, fuzzy, c-format
msgid "ECC signature verification failed at %s:%d: %s\n"
msgstr "\"%s\" misslyckades vid %s:%d med fel: \"%s\".\n"
@@ -6435,17 +6431,17 @@
msgid "Perform default-actions for GNUnet URIs"
msgstr ""
-#: src/util/helper.c:271
+#: src/util/helper.c:322
#, fuzzy, c-format
msgid "Error reading from `%s': %s\n"
msgstr "Fel vid skapandet av användare"
-#: src/util/helper.c:316
+#: src/util/helper.c:367
#, fuzzy, c-format
msgid "Failed to parse inbound message from helper `%s'\n"
msgstr "Misslyckades att läsa kompislista från \"%s\"\n"
-#: src/util/helper.c:537
+#: src/util/helper.c:564
#, fuzzy, c-format
msgid "Error writing to `%s': %s\n"
msgstr "Fel vid skapandet av användare"
Modified: gnunet/po/vi.po
===================================================================
--- gnunet/po/vi.po 2013-05-22 10:27:24 UTC (rev 27250)
+++ gnunet/po/vi.po 2013-05-22 10:29:15 UTC (rev 27251)
@@ -8,7 +8,7 @@
msgstr ""
"Project-Id-Version: gnunet 0.8.0a\n"
"Report-Msgid-Bugs-To: address@hidden"
-"POT-Creation-Date: 2013-04-27 12:39+0200\n"
+"POT-Creation-Date: 2013-05-20 15:09+0200\n"
"PO-Revision-Date: 2008-09-10 22:05+0930\n"
"Last-Translator: Clytie Siddall <address@hidden>\n"
"Language-Team: Vietnamese <address@hidden>\n"
@@ -38,89 +38,89 @@
msgid "Failed to remove servicehome directory %s\n"
msgstr "Lỗi truy cập đến thư mục nhà GNUnet « %s »\n"
-#: src/arm/gnunet-arm.c:204 src/testbed/gnunet-service-testbed_peers.c:712
+#: src/arm/gnunet-arm.c:204 src/testbed/gnunet-service-testbed_peers.c:962
msgid "Message was sent successfully"
msgstr ""
-#: src/arm/gnunet-arm.c:206 src/testbed/gnunet-service-testbed_peers.c:714
+#: src/arm/gnunet-arm.c:206 src/testbed/gnunet-service-testbed_peers.c:964
#, fuzzy
msgid "Misconfiguration (can't connect to the ARM service)"
msgstr "Lỗi kết nối đến gnunetd.\n"
-#: src/arm/gnunet-arm.c:208 src/testbed/gnunet-service-testbed_peers.c:716
+#: src/arm/gnunet-arm.c:208 src/testbed/gnunet-service-testbed_peers.c:966
#, fuzzy
msgid "We disconnected from ARM before we could send a request"
msgstr "# các yêu cầu lỗ hổng bị bỏ do trọng tải"
-#: src/arm/gnunet-arm.c:210 src/testbed/gnunet-service-testbed_peers.c:718
+#: src/arm/gnunet-arm.c:210 src/testbed/gnunet-service-testbed_peers.c:968
msgid "ARM API is busy"
msgstr ""
-#: src/arm/gnunet-arm.c:212 src/testbed/gnunet-service-testbed_peers.c:720
+#: src/arm/gnunet-arm.c:212 src/testbed/gnunet-service-testbed_peers.c:970
msgid "Request doesn't fit into a message"
msgstr ""
-#: src/arm/gnunet-arm.c:214 src/testbed/gnunet-service-testbed_peers.c:722
+#: src/arm/gnunet-arm.c:214 src/testbed/gnunet-service-testbed_peers.c:972
#, fuzzy
msgid "Request timed out"
msgstr "# các khoá phiên chạy được chấp nhận"
-#: src/arm/gnunet-arm.c:216 src/testbed/gnunet-service-testbed_peers.c:724
+#: src/arm/gnunet-arm.c:216 src/testbed/gnunet-service-testbed_peers.c:974
#, fuzzy
msgid "Unknown request status"
msgstr "Không rõ người dùng « %s »\n"
-#: src/arm/gnunet-arm.c:232 src/testbed/gnunet-service-testbed_peers.c:740
+#: src/arm/gnunet-arm.c:232 src/testbed/gnunet-service-testbed_peers.c:990
#, fuzzy, c-format
msgid "%s is stopped"
msgstr "# các byte trong kho dữ liệu"
-#: src/arm/gnunet-arm.c:234 src/testbed/gnunet-service-testbed_peers.c:742
+#: src/arm/gnunet-arm.c:234 src/testbed/gnunet-service-testbed_peers.c:992
#, c-format
msgid "%s is starting"
msgstr ""
-#: src/arm/gnunet-arm.c:236 src/testbed/gnunet-service-testbed_peers.c:744
+#: src/arm/gnunet-arm.c:236 src/testbed/gnunet-service-testbed_peers.c:994
#, c-format
msgid "%s is stopping"
msgstr ""
-#: src/arm/gnunet-arm.c:238 src/testbed/gnunet-service-testbed_peers.c:746
+#: src/arm/gnunet-arm.c:238 src/testbed/gnunet-service-testbed_peers.c:996
#, fuzzy, c-format
msgid "%s is starting already"
msgstr "« %s » đang đăng ký trình điều khiển %d\n"
-#: src/arm/gnunet-arm.c:240 src/testbed/gnunet-service-testbed_peers.c:748
+#: src/arm/gnunet-arm.c:240 src/testbed/gnunet-service-testbed_peers.c:998
#, c-format
msgid "%s is stopping already"
msgstr ""
-#: src/arm/gnunet-arm.c:242 src/testbed/gnunet-service-testbed_peers.c:750
+#: src/arm/gnunet-arm.c:242 src/testbed/gnunet-service-testbed_peers.c:1000
#, c-format
msgid "%s is started already"
msgstr ""
-#: src/arm/gnunet-arm.c:244 src/testbed/gnunet-service-testbed_peers.c:752
+#: src/arm/gnunet-arm.c:244 src/testbed/gnunet-service-testbed_peers.c:1002
#, c-format
msgid "%s is stopped already"
msgstr ""
-#: src/arm/gnunet-arm.c:246 src/testbed/gnunet-service-testbed_peers.c:754
+#: src/arm/gnunet-arm.c:246 src/testbed/gnunet-service-testbed_peers.c:1004
#, fuzzy, c-format
msgid "%s service is not known to ARM"
msgstr "Không gian tên « %s » có đánh giá %d.\n"
-#: src/arm/gnunet-arm.c:248 src/testbed/gnunet-service-testbed_peers.c:756
+#: src/arm/gnunet-arm.c:248 src/testbed/gnunet-service-testbed_peers.c:1006
#, fuzzy, c-format
msgid "%s service failed to start"
msgstr "Lỗi bắt đầu thu thập.\n"
-#: src/arm/gnunet-arm.c:250 src/testbed/gnunet-service-testbed_peers.c:758
+#: src/arm/gnunet-arm.c:250 src/testbed/gnunet-service-testbed_peers.c:1008
#, fuzzy, c-format
msgid "%s service can't be started because ARM is shutting down"
msgstr "« %s » đang tắt.\n"
-#: src/arm/gnunet-arm.c:252 src/testbed/gnunet-service-testbed_peers.c:760
+#: src/arm/gnunet-arm.c:252 src/testbed/gnunet-service-testbed_peers.c:1010
#, c-format
msgid "%.s Unknown result code."
msgstr ""
@@ -848,8 +848,8 @@
#: src/transport/gnunet-service-transport_neighbours.c:1041
#: src/transport/gnunet-service-transport_neighbours.c:1265
#: src/transport/gnunet-service-transport_neighbours.c:1274
-#: src/transport/gnunet-service-transport_neighbours.c:2794
-#: src/transport/gnunet-service-transport_neighbours.c:3053
+#: src/transport/gnunet-service-transport_neighbours.c:2798
+#: src/transport/gnunet-service-transport_neighbours.c:3057
#, fuzzy
msgid "# peers connected"
msgstr "# của các đồng đẳng đã kết nối"
@@ -1336,7 +1336,7 @@
#: src/dht/gnunet-dht-put.c:213 src/fs/gnunet-auto-share.c:753
#: src/fs/gnunet-download.c:328 src/fs/gnunet-publish.c:736
#: src/fs/gnunet-search.c:294 src/fs/gnunet-unindex.c:168
-#: src/nse/gnunet-nse-profiler.c:900
+#: src/nse/gnunet-nse-profiler.c:899
msgid "be verbose (print progress information)"
msgstr ""
@@ -2244,7 +2244,7 @@
msgid "no-name"
msgstr "không-tên"
-#: src/fs/fs_pseudonym.c:1182 src/util/crypto_ecc.c:975
+#: src/fs/fs_pseudonym.c:1182 src/util/crypto_ecc.c:1014
#, fuzzy, c-format
msgid "ECC signing failed at %s:%d: %s\n"
msgstr "%s bị lỗi tại %s:%d: « %s »\n"
@@ -2442,12 +2442,12 @@
msgid "Unrecognized URI type"
msgstr ""
-#: src/fs/fs_uri.c:898
+#: src/fs/fs_uri.c:898 src/util/crypto_ecc.c:941
#, fuzzy
msgid "Lacking key configuration settings.\n"
msgstr "Lưu cấu hình ngay bây giờ không?"
-#: src/fs/fs_uri.c:904
+#: src/fs/fs_uri.c:904 src/util/crypto_ecc.c:947
#, fuzzy, c-format
msgid "Could not access hostkey file `%s'.\n"
msgstr "Không thể truy cập đến tập tin gnunet-directory « %s »\n"
@@ -3800,16 +3800,16 @@
msgid "Hostlist file `%s' could not be removed\n"
msgstr "Khoá phiên chạy từ đồng đẳng « %s » không thể được thẩm tra.\n"
-#: src/hostlist/hostlist-server.c:134
+#: src/hostlist/hostlist-server.c:137
#, fuzzy
msgid "bytes in hostlist"
msgstr "# các byte trong kho dữ liệu"
-#: src/hostlist/hostlist-server.c:157
+#: src/hostlist/hostlist-server.c:161
msgid "expired addresses encountered"
msgstr ""
-#: src/hostlist/hostlist-server.c:184 src/hostlist/hostlist-server.c:421
+#: src/hostlist/hostlist-server.c:189 src/hostlist/hostlist-server.c:424
#: src/peerinfo-tool/gnunet-peerinfo.c:348
#: src/peerinfo-tool/gnunet-peerinfo.c:418
#: src/peerinfo-tool/gnunet-peerinfo.c:489
@@ -3818,89 +3818,89 @@
msgid "Error in communication with PEERINFO service: %s\n"
msgstr "Cổng để liên lạc với giao diện người dùng GNUnet"
-#: src/hostlist/hostlist-server.c:205
+#: src/hostlist/hostlist-server.c:210
msgid "HELLOs without addresses encountered (ignored)"
msgstr ""
-#: src/hostlist/hostlist-server.c:219
+#: src/hostlist/hostlist-server.c:224
msgid "bytes not included in hostlist (size limit)"
msgstr ""
-#: src/hostlist/hostlist-server.c:263
+#: src/hostlist/hostlist-server.c:268
#, fuzzy, c-format
msgid "Refusing `%s' request to hostlist server\n"
msgstr "trình phục vụ danh sách máy HTTP hợp nhất"
-#: src/hostlist/hostlist-server.c:266
+#: src/hostlist/hostlist-server.c:271
#, fuzzy
msgid "hostlist requests refused (not HTTP GET)"
msgstr "# các yêu cầu danh sách máy được nhận"
-#: src/hostlist/hostlist-server.c:279
+#: src/hostlist/hostlist-server.c:284
#, c-format
msgid "Refusing `%s' request with %llu bytes of upload data\n"
msgstr ""
-#: src/hostlist/hostlist-server.c:283
+#: src/hostlist/hostlist-server.c:288
#, fuzzy
msgid "hostlist requests refused (upload data)"
msgstr "# các yêu cầu danh sách máy được nhận"
-#: src/hostlist/hostlist-server.c:291
+#: src/hostlist/hostlist-server.c:296
msgid "Could not handle hostlist request since I do not have a response yet\n"
msgstr ""
-#: src/hostlist/hostlist-server.c:294
+#: src/hostlist/hostlist-server.c:299
#, fuzzy
msgid "hostlist requests refused (not ready)"
msgstr "# các yêu cầu danh sách máy được nhận"
-#: src/hostlist/hostlist-server.c:298
+#: src/hostlist/hostlist-server.c:303
#, fuzzy
msgid "Received request for our hostlist\n"
msgstr "Nhận yêu cầu định tuyến\n"
-#: src/hostlist/hostlist-server.c:299
+#: src/hostlist/hostlist-server.c:304
#, fuzzy
msgid "hostlist requests processed"
msgstr "# các yêu cầu danh sách máy được nhận"
-#: src/hostlist/hostlist-server.c:341
+#: src/hostlist/hostlist-server.c:346
#, fuzzy
msgid "# hostlist advertisements send"
msgstr "# Các quảng cáo ngoại được chuyển tiếp"
-#: src/hostlist/hostlist-server.c:384
+#: src/hostlist/hostlist-server.c:389
msgid "Advertisement message could not be queued by core\n"
msgstr ""
-#: src/hostlist/hostlist-server.c:548 src/peerinfo-tool/gnunet-peerinfo.c:649
+#: src/hostlist/hostlist-server.c:560 src/peerinfo-tool/gnunet-peerinfo.c:649
#: src/transport/gnunet-service-transport.c:661
#, fuzzy
msgid "Could not access PEERINFO service. Exiting.\n"
msgstr "Không thể truy cập đến thông tin về không gian tên.\n"
-#: src/hostlist/hostlist-server.c:558
+#: src/hostlist/hostlist-server.c:570
#, c-format
msgid "Invalid port number %llu. Exiting.\n"
msgstr ""
-#: src/hostlist/hostlist-server.c:567
+#: src/hostlist/hostlist-server.c:579
#, c-format
msgid "Hostlist service starts on %s:%llu\n"
msgstr ""
-#: src/hostlist/hostlist-server.c:581
+#: src/hostlist/hostlist-server.c:593
#, fuzzy, c-format
msgid "Address to obtain hostlist: `%s'\n"
msgstr "Đang thử tải danh sách các máy xuống « %s »\n"
-#: src/hostlist/hostlist-server.c:621
+#: src/hostlist/hostlist-server.c:633
#, fuzzy, c-format
msgid "`%s' is not a valid IP address! Ignoring BINDTOIP.\n"
msgstr "« %s » không sẵn sàng.\n"
-#: src/hostlist/hostlist-server.c:663
+#: src/hostlist/hostlist-server.c:675
#, fuzzy, c-format
msgid "Could not start hostlist HTTP server on port %u\n"
msgstr "Cổng cho trình phục vụ HTTP danh sách máy chủ thống nhất"
@@ -3939,11 +3939,11 @@
msgid "Print information about mesh tunnels and peers."
msgstr "In ra thông tin về các đồng đẳng GNUnet."
-#: src/mesh/gnunet-service-mesh.c:7966 src/mesh/gnunet-service-mesh-new.c:7972
+#: src/mesh/gnunet-service-mesh.c:7966 src/mesh/gnunet-service-mesh-new.c:4649
msgid "Wrong CORE service\n"
msgstr ""
-#: src/mesh/gnunet-service-mesh.c:8179 src/mesh/gnunet-service-mesh-new.c:8185
+#: src/mesh/gnunet-service-mesh.c:8179 src/mesh/gnunet-service-mesh-new.c:4790
#, fuzzy, c-format
msgid "Mesh service could not access hostkey: %s. Exiting.\n"
msgstr "Không thể truy cập đến thông tin về không gian tên.\n"
@@ -3951,14 +3951,13 @@
#: src/mesh/gnunet-service-mesh.c:8261 src/mesh/gnunet-service-mesh.c:8273
#: src/mesh/gnunet-service-mesh.c:8285 src/mesh/gnunet-service-mesh.c:8299
#: src/mesh/gnunet-service-mesh.c:8311 src/mesh/gnunet-service-mesh.c:8323
-#: src/mesh/gnunet-service-mesh.c:8335 src/mesh/gnunet-service-mesh-new.c:8274
-#: src/mesh/gnunet-service-mesh-new.c:8286
-#: src/mesh/gnunet-service-mesh-new.c:8298
-#: src/mesh/gnunet-service-mesh-new.c:8312
-#: src/mesh/gnunet-service-mesh-new.c:8324
-#: src/mesh/gnunet-service-mesh-new.c:8336
-#: src/mesh/gnunet-service-mesh-new.c:8348 src/nse/gnunet-service-nse.c:1516
-#: src/nse/gnunet-service-nse.c:1534
+#: src/mesh/gnunet-service-mesh.c:8335 src/mesh/gnunet-service-mesh-new.c:4860
+#: src/mesh/gnunet-service-mesh-new.c:4872
+#: src/mesh/gnunet-service-mesh-new.c:4884
+#: src/mesh/gnunet-service-mesh-new.c:4896
+#: src/mesh/gnunet-service-mesh-new.c:4908
+#: src/mesh/gnunet-service-mesh-new.c:4920 src/nse/gnunet-service-nse.c:1500
+#: src/nse/gnunet-service-nse.c:1518
#: src/regex/gnunet-daemon-regexprofiler.c:320
#: src/regex/gnunet-daemon-regexprofiler.c:332
#: src/regex/gnunet-daemon-regexprofiler.c:344
@@ -3969,9 +3968,9 @@
msgstr "Lưu cấu hình ngay bây giờ không?"
#: src/mesh/gnunet-service-mesh.c:8347 src/mesh/gnunet-service-mesh.c:8357
-#: src/mesh/gnunet-service-mesh.c:8368 src/mesh/gnunet-service-mesh-new.c:8360
-#: src/mesh/gnunet-service-mesh-new.c:8370
-#: src/mesh/gnunet-service-mesh-new.c:8381
+#: src/mesh/gnunet-service-mesh.c:8368 src/mesh/gnunet-service-mesh-new.c:4932
+#: src/mesh/gnunet-service-mesh-new.c:4942
+#: src/mesh/gnunet-service-mesh-new.c:4953
#, fuzzy, c-format
msgid ""
"%s service is lacking key configuration settings (%s). Using default (%u).\n"
@@ -4308,32 +4307,32 @@
msgid "gnunet-helper-nat-client not found or behind NAT, disabling it\n"
msgstr ""
-#: src/nat/nat.c:795
+#: src/nat/nat.c:834
#, c-format
msgid "gnunet-helper-nat-server generated malformed address `%s'\n"
msgstr ""
-#: src/nat/nat.c:844
+#: src/nat/nat.c:883
#, fuzzy, c-format
msgid "Failed to start %s\n"
msgstr "Lỗi bắt đầu thu thập.\n"
-#: src/nat/nat.c:1113
+#: src/nat/nat.c:1152
msgid "malformed"
msgstr ""
-#: src/nat/nat.c:1179 src/nat/nat.c:1191
+#: src/nat/nat.c:1218 src/nat/nat.c:1230
#, c-format
msgid ""
"Configuration requires `%s', but binary is not installed properly (SUID bit "
"not set). Option disabled.\n"
msgstr ""
-#: src/nat/nat.c:1326
+#: src/nat/nat.c:1365
msgid "Internal IP address not known, cannot use ICMP NAT traversal method\n"
msgstr ""
-#: src/nat/nat.c:1337
+#: src/nat/nat.c:1376
#, c-format
msgid "Running gnunet-helper-nat-client %s %s %u\n"
msgstr ""
@@ -4356,46 +4355,46 @@
msgid "Failed to create listen socket bound to `%s' for NAT test: %s\n"
msgstr ""
-#: src/nse/gnunet-nse-profiler.c:885
+#: src/nse/gnunet-nse-profiler.c:884
#, fuzzy
msgid "limit to the number of connections to NSE services, 0 for none"
msgstr "Không kết nối được đến trình nền gnunetd."
-#: src/nse/gnunet-nse-profiler.c:888
+#: src/nse/gnunet-nse-profiler.c:887
msgid "name of the file for writing connection information and statistics"
msgstr ""
-#: src/nse/gnunet-nse-profiler.c:891 src/testbed/gnunet-testbed-profiler.c:282
+#: src/nse/gnunet-nse-profiler.c:890 src/testbed/gnunet-testbed-profiler.c:284
msgid "name of the file with the login information for the testbed"
msgstr ""
-#: src/nse/gnunet-nse-profiler.c:894
+#: src/nse/gnunet-nse-profiler.c:893
msgid "name of the file for writing the main results"
msgstr ""
-#: src/nse/gnunet-nse-profiler.c:897
+#: src/nse/gnunet-nse-profiler.c:896
msgid "Number of peers to run in each round, separated by commas"
msgstr ""
-#: src/nse/gnunet-nse-profiler.c:903
+#: src/nse/gnunet-nse-profiler.c:902
msgid "delay between rounds"
msgstr ""
-#: src/nse/gnunet-nse-profiler.c:912
+#: src/nse/gnunet-nse-profiler.c:911
#, fuzzy
msgid "Measure quality and performance of the NSE service."
msgstr "Không thể truy cập đến dịch vụ"
-#: src/nse/gnunet-service-nse.c:1405
+#: src/nse/gnunet-service-nse.c:1419
#, fuzzy, c-format
msgid "NSE service could not access hostkey: %s\n"
msgstr "Không thể truy cập đến thông tin về không gian tên.\n"
-#: src/nse/gnunet-service-nse.c:1419
+#: src/nse/gnunet-service-nse.c:1433
msgid "NSE service is lacking key configuration settings. Exiting.\n"
msgstr ""
-#: src/nse/gnunet-service-nse.c:1524
+#: src/nse/gnunet-service-nse.c:1508
msgid "Invalid work requirement for NSE service. Exiting.\n"
msgstr ""
@@ -4404,21 +4403,21 @@
msgid "Removing expired address of transport `%s'\n"
msgstr "Đã nạp truyền tải « %s »\n"
-#: src/peerinfo/gnunet-service-peerinfo.c:354
+#: src/peerinfo/gnunet-service-peerinfo.c:355
#, fuzzy, c-format
msgid "Failed to parse HELLO in file `%s': %s\n"
msgstr "Lỗi đọc danh sách bạn bè từ « %s »\n"
-#: src/peerinfo/gnunet-service-peerinfo.c:369
+#: src/peerinfo/gnunet-service-peerinfo.c:370
#, fuzzy, c-format
msgid "Failed to parse HELLO in file `%s': %s %u \n"
msgstr "Lỗi đọc danh sách bạn bè từ « %s »\n"
-#: src/peerinfo/gnunet-service-peerinfo.c:444
+#: src/peerinfo/gnunet-service-peerinfo.c:445
msgid "# peers known"
msgstr ""
-#: src/peerinfo/gnunet-service-peerinfo.c:480
+#: src/peerinfo/gnunet-service-peerinfo.c:481
#, c-format
msgid ""
"File `%s' in directory `%s' does not match naming convention. Removed.\n"
@@ -4426,22 +4425,22 @@
"Tập tin « %s » trong thư mục « %s » không tùy theo quy ước đặt tên. Bị gỡ "
"bỏ.\n"
-#: src/peerinfo/gnunet-service-peerinfo.c:632
+#: src/peerinfo/gnunet-service-peerinfo.c:633
#, fuzzy, c-format
msgid "Scanning directory `%s'\n"
msgstr "Lỗi đọc danh sách bạn bè từ « %s »\n"
-#: src/peerinfo/gnunet-service-peerinfo.c:637
+#: src/peerinfo/gnunet-service-peerinfo.c:638
#, c-format
msgid "Still no peers found in `%s'!\n"
msgstr "Vẫn còn không tìm thấy đồng đẳng trong « %s ».\n"
-#: src/peerinfo/gnunet-service-peerinfo.c:969
+#: src/peerinfo/gnunet-service-peerinfo.c:970
#, fuzzy, c-format
msgid "Cleaning up directory `%s'\n"
msgstr "Lỗi đọc danh sách bạn bè từ « %s »\n"
-#: src/peerinfo/gnunet-service-peerinfo.c:1249
+#: src/peerinfo/gnunet-service-peerinfo.c:1250
#, c-format
msgid "Importing HELLOs from `%s'\n"
msgstr ""
@@ -4662,81 +4661,73 @@
msgid "Daemon to announce regular expressions for the peer using mesh."
msgstr ""
-#: src/regex/gnunet-regex-profiler.c:1246
+#: src/regex/gnunet-regex-profiler.c:1247
#, fuzzy
msgid "No configuration file given. Exiting\n"
msgstr "dùng tập tin cấu hình TÊN_TẬP_TIN"
-#: src/regex/gnunet-regex-profiler.c:1257
+#: src/regex/gnunet-regex-profiler.c:1258
#, fuzzy
msgid "Configuration option \"regex_prefix\" missing. Exiting\n"
msgstr "Giá trị cấu hình « %s » cho « %s » trong phần « %s » nên là con số\n"
-#: src/regex/gnunet-regex-profiler.c:1276
-msgid "No hosts-file specified on command line. Exiting.\n"
-msgstr ""
-
-#: src/regex/gnunet-regex-profiler.c:1282
+#: src/regex/gnunet-regex-profiler.c:1287
#: src/regex/gnunet-regex-simulation-profiler.c:622
#, c-format
msgid "No policy directory specified on command line. Exiting.\n"
msgstr ""
-#: src/regex/gnunet-regex-profiler.c:1288
+#: src/regex/gnunet-regex-profiler.c:1293
#: src/regex/gnunet-regex-simulation-profiler.c:629
#, c-format
msgid "Specified policies directory does not exist. Exiting.\n"
msgstr ""
-#: src/regex/gnunet-regex-profiler.c:1295
+#: src/regex/gnunet-regex-profiler.c:1300
#, fuzzy, c-format
msgid "No files found in `%s'\n"
msgstr "Vẫn còn không tìm thấy đồng đẳng trong « %s ».\n"
-#: src/regex/gnunet-regex-profiler.c:1304
+#: src/regex/gnunet-regex-profiler.c:1309
msgid "No search strings file given. Exiting.\n"
msgstr ""
-#: src/regex/gnunet-regex-profiler.c:1314
+#: src/regex/gnunet-regex-profiler.c:1319
#, fuzzy
msgid ""
"Error loading search strings.Given file does not contain enough strings. "
"Exiting.\n"
msgstr "Gặp lỗi khi tải xuống: %s\n"
-#: src/regex/gnunet-regex-profiler.c:1322
+#: src/regex/gnunet-regex-profiler.c:1327
#, fuzzy
msgid "Error loading search strings. Exiting.\n"
msgstr "Gặp lỗi khi tải xuống: %s\n"
-#: src/regex/gnunet-regex-profiler.c:1389
+#: src/regex/gnunet-regex-profiler.c:1394
#, fuzzy
msgid "name of the file for writing statistics"
msgstr "Lỗi lấy thông kê về truyền tải.\n"
-#: src/regex/gnunet-regex-profiler.c:1392
-msgid "wait TIMEOUT before considering a string match as failed"
+#: src/regex/gnunet-regex-profiler.c:1397
+msgid "wait TIMEOUT before ending the experiment"
msgstr ""
-#: src/regex/gnunet-regex-profiler.c:1395
-msgid "number of search strings to read from search strings file"
-msgstr ""
-
-#: src/regex/gnunet-regex-profiler.c:1398
+#: src/regex/gnunet-regex-profiler.c:1400
msgid "directory with policy files"
msgstr ""
-#: src/regex/gnunet-regex-profiler.c:1401
+#: src/regex/gnunet-regex-profiler.c:1403
#, fuzzy
msgid "name of file with input strings"
msgstr "Lỗi lấy thông kê về truyền tải.\n"
-#: src/regex/gnunet-regex-profiler.c:1404
+#: src/regex/gnunet-regex-profiler.c:1406
#, fuzzy
msgid "name of file with hosts' names"
msgstr "Lỗi lấy thông kê về truyền tải.\n"
-#: src/regex/gnunet-regex-profiler.c:1416
+#: src/regex/gnunet-regex-profiler.c:1418
msgid "Profiler for regex"
msgstr ""
@@ -4853,7 +4844,7 @@
msgid "Could not parse execution interval for `%s', set to default 60 sec.\n"
msgstr ""
-#: src/testbed/gnunet-service-testbed_cpustatus.c:670
+#: src/testbed/gnunet-service-testbed_cpustatus.c:692
#, c-format
msgid ""
"Cannot open %s for writing load statistics. Not logging load statistics\n"
@@ -4864,26 +4855,26 @@
msgid "Job command file not given. Exiting\n"
msgstr "dùng tập tin cấu hình TÊN_TẬP_TIN"
-#: src/testbed/gnunet_testbed_mpi_spawn.c:135
+#: src/testbed/gnunet_testbed_mpi_spawn.c:125
#, fuzzy
msgid "Waiting for child to exit.\n"
msgstr "Đang đợi các đồng đẳng kết nối"
-#: src/testbed/gnunet_testbed_mpi_spawn.c:296
+#: src/testbed/gnunet_testbed_mpi_spawn.c:247
#, fuzzy, c-format
msgid "Spawning process `%s'\n"
msgstr "Đang bắt đầu tài về « %s »\n"
-#: src/testbed/gnunet-testbed-profiler.c:249
+#: src/testbed/gnunet-testbed-profiler.c:251
#, fuzzy, c-format
msgid "Exiting as the number of peers is %u\n"
msgstr "tăng sổ tối đa các kết nối TCP/IP"
-#: src/testbed/gnunet-testbed-profiler.c:275
+#: src/testbed/gnunet-testbed-profiler.c:277
msgid "create COUNT number of peers"
msgstr ""
-#: src/testbed/gnunet-testbed-profiler.c:278
+#: src/testbed/gnunet-testbed-profiler.c:280
msgid "tolerate COUNT number of continious timeout failures"
msgstr ""
@@ -4902,55 +4893,55 @@
msgid "Hosts file %s cannot be read\n"
msgstr "Khoá phiên chạy từ đồng đẳng « %s » không thể được thẩm tra.\n"
-#: src/testbed/testbed_api_hosts.c:583
+#: src/testbed/testbed_api_hosts.c:595
#, c-format
msgid "The function %s is only available when compiled with (--with-ll)\n"
msgstr ""
-#: src/testbed/testbed_api_hosts.c:1856
+#: src/testbed/testbed_api_hosts.c:1879
#, fuzzy, c-format
msgid "Adding host %u failed with error: %s\n"
msgstr "« %s » thất bại với mã lỗi %d: %s\n"
-#: src/testbed/testbed_api_testbed.c:771
+#: src/testbed/testbed_api_testbed.c:891
msgid "Linking controllers failed. Exiting"
msgstr ""
-#: src/testbed/testbed_api_testbed.c:913
+#: src/testbed/testbed_api_testbed.c:1094
#, c-format
msgid "Host registration failed for a host. Error: %s\n"
msgstr ""
-#: src/testbed/testbed_api_testbed.c:978
+#: src/testbed/testbed_api_testbed.c:1175
msgid "Controller crash detected. Shutting down.\n"
msgstr ""
-#: src/testbed/testbed_api_testbed.c:1081
+#: src/testbed/testbed_api_testbed.c:1320
#, c-format
msgid "Host %s cannot start testbed\n"
msgstr ""
-#: src/testbed/testbed_api_testbed.c:1085
+#: src/testbed/testbed_api_testbed.c:1324
msgid "Testbed cannot be started on localhost\n"
msgstr ""
-#: src/testbed/testbed_api_testbed.c:1120
+#: src/testbed/testbed_api_testbed.c:1365
msgid "Cannot start the master controller"
msgstr ""
-#: src/testbed/testbed_api_testbed.c:1138
+#: src/testbed/testbed_api_testbed.c:1383
msgid "Shutting down testbed due to timeout while setup.\n"
msgstr ""
-#: src/testbed/testbed_api_testbed.c:1197
+#: src/testbed/testbed_api_testbed.c:1443
msgid "No hosts loaded from LoadLeveler. Need at least one host\n"
msgstr ""
-#: src/testbed/testbed_api_testbed.c:1209
+#: src/testbed/testbed_api_testbed.c:1455
msgid "No hosts loaded. Need at least one host\n"
msgstr ""
-#: src/testbed/testbed_api_testbed.c:1233
+#: src/testbed/testbed_api_testbed.c:1479
msgid "Specified topology must be supported by testbed"
msgstr ""
@@ -5097,7 +5088,7 @@
msgid "Failed to start `%s': %s\n"
msgstr "Lỗi chạy %s: %s %d\n"
-#: src/testing/testing.c:1691
+#: src/testing/testing.c:1709
#, fuzzy, c-format
msgid "Failed to load configuration from %s\n"
msgstr "Không thể lưu tập tin cấu hình « %s »:"
@@ -5257,7 +5248,7 @@
msgid "# bytes payload dropped (other peer was not connected)"
msgstr ""
-#: src/transport/gnunet-service-transport_clients.c:728
+#: src/transport/gnunet-service-transport_clients.c:733
#, fuzzy
msgid "# REQUEST CONNECT messages received"
msgstr "# các thông báo PONG đã mật mã được nhận"
@@ -5330,53 +5321,53 @@
msgid "# ms throttling suggested"
msgstr ""
-#: src/transport/gnunet-service-transport_neighbours.c:2770
+#: src/transport/gnunet-service-transport_neighbours.c:2774
#, fuzzy
msgid "# unexpected CONNECT_ACK messages (no peer)"
msgstr "gửi ĐẾM thông báo"
-#: src/transport/gnunet-service-transport_neighbours.c:2785
-#: src/transport/gnunet-service-transport_neighbours.c:2819
+#: src/transport/gnunet-service-transport_neighbours.c:2789
+#: src/transport/gnunet-service-transport_neighbours.c:2823
#, fuzzy
msgid "# unexpected CONNECT_ACK messages (not ready)"
msgstr "gửi ĐẾM thông báo"
-#: src/transport/gnunet-service-transport_neighbours.c:2832
+#: src/transport/gnunet-service-transport_neighbours.c:2836
#, fuzzy
msgid "# unexpected CONNECT_ACK messages (waiting on ATS)"
msgstr "gửi ĐẾM thông báo"
-#: src/transport/gnunet-service-transport_neighbours.c:2865
+#: src/transport/gnunet-service-transport_neighbours.c:2869
#, fuzzy
msgid "# unexpected CONNECT_ACK messages (disconnecting)"
msgstr "gửi ĐẾM thông báo"
-#: src/transport/gnunet-service-transport_neighbours.c:3046
+#: src/transport/gnunet-service-transport_neighbours.c:3050
#, fuzzy
msgid "# unexpected SESSION ACK messages"
msgstr "# các thông báo PONG đã mật mã được gửi"
-#: src/transport/gnunet-service-transport_neighbours.c:3101
+#: src/transport/gnunet-service-transport_neighbours.c:3105
msgid "# SET QUOTA messages ignored (no such peer)"
msgstr ""
-#: src/transport/gnunet-service-transport_neighbours.c:3115
+#: src/transport/gnunet-service-transport_neighbours.c:3119
msgid "# disconnects due to quota of 0"
msgstr ""
-#: src/transport/gnunet-service-transport_neighbours.c:3146
+#: src/transport/gnunet-service-transport_neighbours.c:3150
msgid "# disconnect messages ignored (old format)"
msgstr ""
-#: src/transport/gnunet-service-transport_neighbours.c:3157
+#: src/transport/gnunet-service-transport_neighbours.c:3161
msgid "# disconnect messages ignored (timestamp)"
msgstr ""
-#: src/transport/gnunet-service-transport_neighbours.c:3188
+#: src/transport/gnunet-service-transport_neighbours.c:3192
msgid "# other peer asked to disconnect from us"
msgstr ""
-#: src/transport/gnunet-service-transport_neighbours.c:3283
+#: src/transport/gnunet-service-transport_neighbours.c:3287
#, fuzzy
msgid "# disconnected from peer upon explicit request"
msgstr "# các yêu cầu lỗ hổng bị bỏ do trọng tải"
@@ -5790,92 +5781,92 @@
msgid "# bytes dropped by SMTP (outgoing)"
msgstr "# các byte loại đi bởi SMTP (đi ra)"
-#: src/transport/plugin_transport_tcp.c:595
+#: src/transport/plugin_transport_tcp.c:596
#, fuzzy, c-format
msgid "Unexpected address length: %u bytes\n"
msgstr "Gặp sự kiện bất thường: %d\n"
-#: src/transport/plugin_transport_tcp.c:771
-#: src/transport/plugin_transport_tcp.c:860
-#: src/transport/plugin_transport_tcp.c:910
-#: src/transport/plugin_transport_tcp.c:996
-#: src/transport/plugin_transport_tcp.c:1139
-#: src/transport/plugin_transport_tcp.c:1156
+#: src/transport/plugin_transport_tcp.c:772
+#: src/transport/plugin_transport_tcp.c:861
+#: src/transport/plugin_transport_tcp.c:911
+#: src/transport/plugin_transport_tcp.c:997
+#: src/transport/plugin_transport_tcp.c:1140
+#: src/transport/plugin_transport_tcp.c:1157
#, fuzzy
msgid "# bytes currently in TCP buffers"
msgstr "# các byte đã gừi qua TCP"
-#: src/transport/plugin_transport_tcp.c:778
-#: src/transport/plugin_transport_tcp.c:967
-#: src/transport/plugin_transport_tcp.c:1826
-#: src/transport/plugin_transport_tcp.c:2456
+#: src/transport/plugin_transport_tcp.c:779
+#: src/transport/plugin_transport_tcp.c:968
+#: src/transport/plugin_transport_tcp.c:1827
+#: src/transport/plugin_transport_tcp.c:2460
#, fuzzy
msgid "# TCP sessions active"
msgstr "# các khoá phiên chạy được chấp nhận"
-#: src/transport/plugin_transport_tcp.c:864
+#: src/transport/plugin_transport_tcp.c:865
#, fuzzy
msgid "# bytes discarded by TCP (timeout)"
msgstr "# các byte loại đi bởi TCP (đi ra)"
-#: src/transport/plugin_transport_tcp.c:913
+#: src/transport/plugin_transport_tcp.c:914
#, fuzzy
msgid "# bytes transmitted via TCP"
msgstr "# các byte được gửi"
-#: src/transport/plugin_transport_tcp.c:1000
+#: src/transport/plugin_transport_tcp.c:1001
#, fuzzy
msgid "# bytes discarded by TCP (disconnect)"
msgstr "# các byte loại đi bởi TCP (đi ra)"
-#: src/transport/plugin_transport_tcp.c:1113
+#: src/transport/plugin_transport_tcp.c:1114
#, c-format
msgid "Trying to send with invalid session %p\n"
msgstr ""
-#: src/transport/plugin_transport_tcp.c:1349
+#: src/transport/plugin_transport_tcp.c:1350
#, fuzzy, c-format
msgid "Address of unexpected length: %u\n"
msgstr "Gặp sự kiện bất thường: %d\n"
-#: src/transport/plugin_transport_tcp.c:1466
+#: src/transport/plugin_transport_tcp.c:1467
msgid "# transport-service disconnect requests for TCP"
msgstr ""
-#: src/transport/plugin_transport_tcp.c:1867
+#: src/transport/plugin_transport_tcp.c:1868
#, fuzzy
msgid "# TCP WELCOME messages received"
msgstr "# các thông báo PONG đã mật mã được nhận"
-#: src/transport/plugin_transport_tcp.c:2036
+#: src/transport/plugin_transport_tcp.c:2037
msgid "# bytes received via TCP"
msgstr "# các byte đã nhận qua TCP"
-#: src/transport/plugin_transport_tcp.c:2118
+#: src/transport/plugin_transport_tcp.c:2119
msgid "# network-level TCP disconnect events"
msgstr ""
-#: src/transport/plugin_transport_tcp.c:2344 src/util/service.c:948
+#: src/transport/plugin_transport_tcp.c:2345 src/util/service.c:948
#: src/util/service.c:954
#, c-format
msgid "Require valid port number for service `%s' in configuration!\n"
msgstr ""
-#: src/transport/plugin_transport_tcp.c:2358
+#: src/transport/plugin_transport_tcp.c:2359
#, fuzzy
msgid "Failed to start service.\n"
msgstr "Lỗi bắt đầu thu thập.\n"
-#: src/transport/plugin_transport_tcp.c:2444
+#: src/transport/plugin_transport_tcp.c:2448
#, c-format
msgid "TCP transport listening on port %llu\n"
msgstr ""
-#: src/transport/plugin_transport_tcp.c:2448
+#: src/transport/plugin_transport_tcp.c:2452
msgid "TCP transport not listening on any port (client only)\n"
msgstr ""
-#: src/transport/plugin_transport_tcp.c:2452
+#: src/transport/plugin_transport_tcp.c:2456
#, c-format
msgid "TCP transport advertises itself as being on port %llu\n"
msgstr ""
@@ -5900,14 +5891,14 @@
msgid "Failed to set IPv4 broadcast option for broadcast socket on port %d\n"
msgstr ""
-#: src/transport/plugin_transport_udp.c:2520
+#: src/transport/plugin_transport_udp.c:2350
#, c-format
msgid ""
"UDP could not transmit message to `%s': Network seems down, please check "
"your network configuration\n"
msgstr ""
-#: src/transport/plugin_transport_udp.c:2534
+#: src/transport/plugin_transport_udp.c:2364
#, c-format
msgid ""
"UDP could not transmit message to `%s': Please check your network "
@@ -5915,24 +5906,29 @@
"IPv6 address\n"
msgstr ""
-#: src/transport/plugin_transport_udp.c:2775
+#: src/transport/plugin_transport_udp.c:2664
#, fuzzy
msgid "Failed to open UDP sockets\n"
msgstr "Lỗi mở tập tin ghi sự kiện « %s »: %s\n"
-#: src/transport/plugin_transport_udp.c:2851
+#: src/transport/plugin_transport_udp.c:2762
#, c-format
msgid "Given `%s' option is out of range: %llu > %u\n"
msgstr ""
-#: src/transport/plugin_transport_udp.c:2894
+#: src/transport/plugin_transport_udp.c:2805
#, fuzzy, c-format
msgid "Invalid IPv6 address: `%s'\n"
msgstr "Mức ưu tiên tiến trình không hợp lê « %s ».\n"
-#: src/transport/plugin_transport_unix.c:1353
+#: src/transport/plugin_transport_udp.c:2862
#, fuzzy
-msgid "Failed to open UNIX sockets\n"
+msgid "Failed to create network sockets, plugin failed\n"
+msgstr "Không thể tạo miền tên.\n"
+
+#: src/transport/plugin_transport_unix.c:1427
+#, fuzzy
+msgid "Failed to open UNIX listen socket\n"
msgstr "Lỗi mở tập tin ghi sự kiện « %s »: %s\n"
#: src/transport/plugin_transport_wlan.c:580
@@ -6245,7 +6241,7 @@
msgid "gnunet-ecc failed"
msgstr ""
-#: src/util/crypto_ecc.c:1045
+#: src/util/crypto_ecc.c:1084
#, fuzzy, c-format
msgid "ECC signature verification failed at %s:%d: %s\n"
msgstr "Lỗi thẩm tra chữ ký RSA tại %s:%d: %s\n"
@@ -6510,17 +6506,17 @@
msgid "Perform default-actions for GNUnet URIs"
msgstr ""
-#: src/util/helper.c:271
+#: src/util/helper.c:322
#, fuzzy, c-format
msgid "Error reading from `%s': %s\n"
msgstr "Gặp lỗi khi tạo người dùng"
-#: src/util/helper.c:316
+#: src/util/helper.c:367
#, fuzzy, c-format
msgid "Failed to parse inbound message from helper `%s'\n"
msgstr "Lỗi đọc danh sách bạn bè từ « %s »\n"
-#: src/util/helper.c:537
+#: src/util/helper.c:564
#, fuzzy, c-format
msgid "Error writing to `%s': %s\n"
msgstr "Gặp lỗi khi tạo người dùng"
Modified: gnunet/po/zh_CN.po
===================================================================
--- gnunet/po/zh_CN.po 2013-05-22 10:27:24 UTC (rev 27250)
+++ gnunet/po/zh_CN.po 2013-05-22 10:29:15 UTC (rev 27251)
@@ -7,7 +7,7 @@
msgstr ""
"Project-Id-Version: gnunet-0.8.1\n"
"Report-Msgid-Bugs-To: address@hidden"
-"POT-Creation-Date: 2013-04-27 12:39+0200\n"
+"POT-Creation-Date: 2013-05-20 15:09+0200\n"
"PO-Revision-Date: 2011-07-09 12:12+0800\n"
"Last-Translator: Wylmer Wang <address@hidden>\n"
"Language-Team: Chinese (simplified) <address@hidden>\n"
@@ -35,87 +35,87 @@
msgid "Failed to remove servicehome directory %s\n"
msgstr ""
-#: src/arm/gnunet-arm.c:204 src/testbed/gnunet-service-testbed_peers.c:712
+#: src/arm/gnunet-arm.c:204 src/testbed/gnunet-service-testbed_peers.c:962
msgid "Message was sent successfully"
msgstr ""
-#: src/arm/gnunet-arm.c:206 src/testbed/gnunet-service-testbed_peers.c:714
+#: src/arm/gnunet-arm.c:206 src/testbed/gnunet-service-testbed_peers.c:964
#, fuzzy
msgid "Misconfiguration (can't connect to the ARM service)"
msgstr "初始化“%s”服务失败。\n"
-#: src/arm/gnunet-arm.c:208 src/testbed/gnunet-service-testbed_peers.c:716
+#: src/arm/gnunet-arm.c:208 src/testbed/gnunet-service-testbed_peers.c:966
msgid "We disconnected from ARM before we could send a request"
msgstr ""
-#: src/arm/gnunet-arm.c:210 src/testbed/gnunet-service-testbed_peers.c:718
+#: src/arm/gnunet-arm.c:210 src/testbed/gnunet-service-testbed_peers.c:968
msgid "ARM API is busy"
msgstr ""
-#: src/arm/gnunet-arm.c:212 src/testbed/gnunet-service-testbed_peers.c:720
+#: src/arm/gnunet-arm.c:212 src/testbed/gnunet-service-testbed_peers.c:970
msgid "Request doesn't fit into a message"
msgstr ""
-#: src/arm/gnunet-arm.c:214 src/testbed/gnunet-service-testbed_peers.c:722
+#: src/arm/gnunet-arm.c:214 src/testbed/gnunet-service-testbed_peers.c:972
msgid "Request timed out"
msgstr ""
-#: src/arm/gnunet-arm.c:216 src/testbed/gnunet-service-testbed_peers.c:724
+#: src/arm/gnunet-arm.c:216 src/testbed/gnunet-service-testbed_peers.c:974
#, fuzzy
msgid "Unknown request status"
msgstr "未知的用户“%s”\n"
-#: src/arm/gnunet-arm.c:232 src/testbed/gnunet-service-testbed_peers.c:740
+#: src/arm/gnunet-arm.c:232 src/testbed/gnunet-service-testbed_peers.c:990
#, c-format
msgid "%s is stopped"
msgstr ""
-#: src/arm/gnunet-arm.c:234 src/testbed/gnunet-service-testbed_peers.c:742
+#: src/arm/gnunet-arm.c:234 src/testbed/gnunet-service-testbed_peers.c:992
#, c-format
msgid "%s is starting"
msgstr ""
-#: src/arm/gnunet-arm.c:236 src/testbed/gnunet-service-testbed_peers.c:744
+#: src/arm/gnunet-arm.c:236 src/testbed/gnunet-service-testbed_peers.c:994
#, c-format
msgid "%s is stopping"
msgstr ""
-#: src/arm/gnunet-arm.c:238 src/testbed/gnunet-service-testbed_peers.c:746
+#: src/arm/gnunet-arm.c:238 src/testbed/gnunet-service-testbed_peers.c:996
#, c-format
msgid "%s is starting already"
msgstr ""
-#: src/arm/gnunet-arm.c:240 src/testbed/gnunet-service-testbed_peers.c:748
+#: src/arm/gnunet-arm.c:240 src/testbed/gnunet-service-testbed_peers.c:998
#, c-format
msgid "%s is stopping already"
msgstr ""
-#: src/arm/gnunet-arm.c:242 src/testbed/gnunet-service-testbed_peers.c:750
+#: src/arm/gnunet-arm.c:242 src/testbed/gnunet-service-testbed_peers.c:1000
#, c-format
msgid "%s is started already"
msgstr ""
-#: src/arm/gnunet-arm.c:244 src/testbed/gnunet-service-testbed_peers.c:752
+#: src/arm/gnunet-arm.c:244 src/testbed/gnunet-service-testbed_peers.c:1002
#, c-format
msgid "%s is stopped already"
msgstr ""
-#: src/arm/gnunet-arm.c:246 src/testbed/gnunet-service-testbed_peers.c:754
+#: src/arm/gnunet-arm.c:246 src/testbed/gnunet-service-testbed_peers.c:1004
#, fuzzy, c-format
msgid "%s service is not known to ARM"
msgstr "服务已删除。\n"
-#: src/arm/gnunet-arm.c:248 src/testbed/gnunet-service-testbed_peers.c:756
+#: src/arm/gnunet-arm.c:248 src/testbed/gnunet-service-testbed_peers.c:1006
#, fuzzy, c-format
msgid "%s service failed to start"
msgstr "运行 %s失败:%s %d\n"
-#: src/arm/gnunet-arm.c:250 src/testbed/gnunet-service-testbed_peers.c:758
+#: src/arm/gnunet-arm.c:250 src/testbed/gnunet-service-testbed_peers.c:1008
#, c-format
msgid "%s service can't be started because ARM is shutting down"
msgstr ""
-#: src/arm/gnunet-arm.c:252 src/testbed/gnunet-service-testbed_peers.c:760
+#: src/arm/gnunet-arm.c:252 src/testbed/gnunet-service-testbed_peers.c:1010
#, c-format
msgid "%.s Unknown result code."
msgstr ""
@@ -814,8 +814,8 @@
#: src/transport/gnunet-service-transport_neighbours.c:1041
#: src/transport/gnunet-service-transport_neighbours.c:1265
#: src/transport/gnunet-service-transport_neighbours.c:1274
-#: src/transport/gnunet-service-transport_neighbours.c:2794
-#: src/transport/gnunet-service-transport_neighbours.c:3053
+#: src/transport/gnunet-service-transport_neighbours.c:2798
+#: src/transport/gnunet-service-transport_neighbours.c:3057
msgid "# peers connected"
msgstr ""
@@ -1268,7 +1268,7 @@
#: src/dht/gnunet-dht-put.c:213 src/fs/gnunet-auto-share.c:753
#: src/fs/gnunet-download.c:328 src/fs/gnunet-publish.c:736
#: src/fs/gnunet-search.c:294 src/fs/gnunet-unindex.c:168
-#: src/nse/gnunet-nse-profiler.c:900
+#: src/nse/gnunet-nse-profiler.c:899
msgid "be verbose (print progress information)"
msgstr ""
@@ -2120,7 +2120,7 @@
msgid "no-name"
msgstr "无名称"
-#: src/fs/fs_pseudonym.c:1182 src/util/crypto_ecc.c:975
+#: src/fs/fs_pseudonym.c:1182 src/util/crypto_ecc.c:1014
#, fuzzy, c-format
msgid "ECC signing failed at %s:%d: %s\n"
msgstr "对驱动器“%2$s”的“%1$s”操作失败:%3$u\n"
@@ -2314,12 +2314,12 @@
msgid "Unrecognized URI type"
msgstr ""
-#: src/fs/fs_uri.c:898
+#: src/fs/fs_uri.c:898 src/util/crypto_ecc.c:941
#, fuzzy
msgid "Lacking key configuration settings.\n"
msgstr "立即保存配置?"
-#: src/fs/fs_uri.c:904
+#: src/fs/fs_uri.c:904 src/util/crypto_ecc.c:947
#, fuzzy, c-format
msgid "Could not access hostkey file `%s'.\n"
msgstr "找不到接口“%s”的一个 IP 地址。\n"
@@ -3592,15 +3592,15 @@
msgid "Hostlist file `%s' could not be removed\n"
msgstr ""
-#: src/hostlist/hostlist-server.c:134
+#: src/hostlist/hostlist-server.c:137
msgid "bytes in hostlist"
msgstr ""
-#: src/hostlist/hostlist-server.c:157
+#: src/hostlist/hostlist-server.c:161
msgid "expired addresses encountered"
msgstr ""
-#: src/hostlist/hostlist-server.c:184 src/hostlist/hostlist-server.c:421
+#: src/hostlist/hostlist-server.c:189 src/hostlist/hostlist-server.c:424
#: src/peerinfo-tool/gnunet-peerinfo.c:348
#: src/peerinfo-tool/gnunet-peerinfo.c:418
#: src/peerinfo-tool/gnunet-peerinfo.c:489
@@ -3609,82 +3609,82 @@
msgid "Error in communication with PEERINFO service: %s\n"
msgstr ""
-#: src/hostlist/hostlist-server.c:205
+#: src/hostlist/hostlist-server.c:210
msgid "HELLOs without addresses encountered (ignored)"
msgstr ""
-#: src/hostlist/hostlist-server.c:219
+#: src/hostlist/hostlist-server.c:224
msgid "bytes not included in hostlist (size limit)"
msgstr ""
-#: src/hostlist/hostlist-server.c:263
+#: src/hostlist/hostlist-server.c:268
#, c-format
msgid "Refusing `%s' request to hostlist server\n"
msgstr ""
-#: src/hostlist/hostlist-server.c:266
+#: src/hostlist/hostlist-server.c:271
msgid "hostlist requests refused (not HTTP GET)"
msgstr ""
-#: src/hostlist/hostlist-server.c:279
+#: src/hostlist/hostlist-server.c:284
#, c-format
msgid "Refusing `%s' request with %llu bytes of upload data\n"
msgstr ""
-#: src/hostlist/hostlist-server.c:283
+#: src/hostlist/hostlist-server.c:288
msgid "hostlist requests refused (upload data)"
msgstr ""
-#: src/hostlist/hostlist-server.c:291
+#: src/hostlist/hostlist-server.c:296
msgid "Could not handle hostlist request since I do not have a response yet\n"
msgstr ""
-#: src/hostlist/hostlist-server.c:294
+#: src/hostlist/hostlist-server.c:299
msgid "hostlist requests refused (not ready)"
msgstr ""
-#: src/hostlist/hostlist-server.c:298
+#: src/hostlist/hostlist-server.c:303
msgid "Received request for our hostlist\n"
msgstr ""
-#: src/hostlist/hostlist-server.c:299
+#: src/hostlist/hostlist-server.c:304
msgid "hostlist requests processed"
msgstr ""
-#: src/hostlist/hostlist-server.c:341
+#: src/hostlist/hostlist-server.c:346
msgid "# hostlist advertisements send"
msgstr ""
-#: src/hostlist/hostlist-server.c:384
+#: src/hostlist/hostlist-server.c:389
msgid "Advertisement message could not be queued by core\n"
msgstr ""
-#: src/hostlist/hostlist-server.c:548 src/peerinfo-tool/gnunet-peerinfo.c:649
+#: src/hostlist/hostlist-server.c:560 src/peerinfo-tool/gnunet-peerinfo.c:649
#: src/transport/gnunet-service-transport.c:661
msgid "Could not access PEERINFO service. Exiting.\n"
msgstr ""
-#: src/hostlist/hostlist-server.c:558
+#: src/hostlist/hostlist-server.c:570
#, c-format
msgid "Invalid port number %llu. Exiting.\n"
msgstr ""
-#: src/hostlist/hostlist-server.c:567
+#: src/hostlist/hostlist-server.c:579
#, c-format
msgid "Hostlist service starts on %s:%llu\n"
msgstr ""
-#: src/hostlist/hostlist-server.c:581
+#: src/hostlist/hostlist-server.c:593
#, c-format
msgid "Address to obtain hostlist: `%s'\n"
msgstr ""
-#: src/hostlist/hostlist-server.c:621
+#: src/hostlist/hostlist-server.c:633
#, fuzzy, c-format
msgid "`%s' is not a valid IP address! Ignoring BINDTOIP.\n"
msgstr "“%s”不可用。\n"
-#: src/hostlist/hostlist-server.c:663
+#: src/hostlist/hostlist-server.c:675
#, c-format
msgid "Could not start hostlist HTTP server on port %u\n"
msgstr ""
@@ -3722,11 +3722,11 @@
msgid "Print information about mesh tunnels and peers."
msgstr "无法获取有关用户“%s”的信息:%s\n"
-#: src/mesh/gnunet-service-mesh.c:7966 src/mesh/gnunet-service-mesh-new.c:7972
+#: src/mesh/gnunet-service-mesh.c:7966 src/mesh/gnunet-service-mesh-new.c:4649
msgid "Wrong CORE service\n"
msgstr ""
-#: src/mesh/gnunet-service-mesh.c:8179 src/mesh/gnunet-service-mesh-new.c:8185
+#: src/mesh/gnunet-service-mesh.c:8179 src/mesh/gnunet-service-mesh-new.c:4790
#, fuzzy, c-format
msgid "Mesh service could not access hostkey: %s. Exiting.\n"
msgstr "找不到接口“%s”的一个 IP 地址。\n"
@@ -3734,14 +3734,13 @@
#: src/mesh/gnunet-service-mesh.c:8261 src/mesh/gnunet-service-mesh.c:8273
#: src/mesh/gnunet-service-mesh.c:8285 src/mesh/gnunet-service-mesh.c:8299
#: src/mesh/gnunet-service-mesh.c:8311 src/mesh/gnunet-service-mesh.c:8323
-#: src/mesh/gnunet-service-mesh.c:8335 src/mesh/gnunet-service-mesh-new.c:8274
-#: src/mesh/gnunet-service-mesh-new.c:8286
-#: src/mesh/gnunet-service-mesh-new.c:8298
-#: src/mesh/gnunet-service-mesh-new.c:8312
-#: src/mesh/gnunet-service-mesh-new.c:8324
-#: src/mesh/gnunet-service-mesh-new.c:8336
-#: src/mesh/gnunet-service-mesh-new.c:8348 src/nse/gnunet-service-nse.c:1516
-#: src/nse/gnunet-service-nse.c:1534
+#: src/mesh/gnunet-service-mesh.c:8335 src/mesh/gnunet-service-mesh-new.c:4860
+#: src/mesh/gnunet-service-mesh-new.c:4872
+#: src/mesh/gnunet-service-mesh-new.c:4884
+#: src/mesh/gnunet-service-mesh-new.c:4896
+#: src/mesh/gnunet-service-mesh-new.c:4908
+#: src/mesh/gnunet-service-mesh-new.c:4920 src/nse/gnunet-service-nse.c:1500
+#: src/nse/gnunet-service-nse.c:1518
#: src/regex/gnunet-daemon-regexprofiler.c:320
#: src/regex/gnunet-daemon-regexprofiler.c:332
#: src/regex/gnunet-daemon-regexprofiler.c:344
@@ -3752,9 +3751,9 @@
msgstr "立即保存配置?"
#: src/mesh/gnunet-service-mesh.c:8347 src/mesh/gnunet-service-mesh.c:8357
-#: src/mesh/gnunet-service-mesh.c:8368 src/mesh/gnunet-service-mesh-new.c:8360
-#: src/mesh/gnunet-service-mesh-new.c:8370
-#: src/mesh/gnunet-service-mesh-new.c:8381
+#: src/mesh/gnunet-service-mesh.c:8368 src/mesh/gnunet-service-mesh-new.c:4932
+#: src/mesh/gnunet-service-mesh-new.c:4942
+#: src/mesh/gnunet-service-mesh-new.c:4953
#, fuzzy, c-format
msgid ""
"%s service is lacking key configuration settings (%s). Using default (%u).\n"
@@ -4083,32 +4082,32 @@
msgid "gnunet-helper-nat-client not found or behind NAT, disabling it\n"
msgstr ""
-#: src/nat/nat.c:795
+#: src/nat/nat.c:834
#, c-format
msgid "gnunet-helper-nat-server generated malformed address `%s'\n"
msgstr ""
-#: src/nat/nat.c:844
+#: src/nat/nat.c:883
#, fuzzy, c-format
msgid "Failed to start %s\n"
msgstr "运行 %s失败:%s %d\n"
-#: src/nat/nat.c:1113
+#: src/nat/nat.c:1152
msgid "malformed"
msgstr ""
-#: src/nat/nat.c:1179 src/nat/nat.c:1191
+#: src/nat/nat.c:1218 src/nat/nat.c:1230
#, c-format
msgid ""
"Configuration requires `%s', but binary is not installed properly (SUID bit "
"not set). Option disabled.\n"
msgstr ""
-#: src/nat/nat.c:1326
+#: src/nat/nat.c:1365
msgid "Internal IP address not known, cannot use ICMP NAT traversal method\n"
msgstr ""
-#: src/nat/nat.c:1337
+#: src/nat/nat.c:1376
#, c-format
msgid "Running gnunet-helper-nat-client %s %s %u\n"
msgstr ""
@@ -4130,45 +4129,45 @@
msgid "Failed to create listen socket bound to `%s' for NAT test: %s\n"
msgstr ""
-#: src/nse/gnunet-nse-profiler.c:885
+#: src/nse/gnunet-nse-profiler.c:884
msgid "limit to the number of connections to NSE services, 0 for none"
msgstr ""
-#: src/nse/gnunet-nse-profiler.c:888
+#: src/nse/gnunet-nse-profiler.c:887
msgid "name of the file for writing connection information and statistics"
msgstr ""
-#: src/nse/gnunet-nse-profiler.c:891 src/testbed/gnunet-testbed-profiler.c:282
+#: src/nse/gnunet-nse-profiler.c:890 src/testbed/gnunet-testbed-profiler.c:284
msgid "name of the file with the login information for the testbed"
msgstr ""
-#: src/nse/gnunet-nse-profiler.c:894
+#: src/nse/gnunet-nse-profiler.c:893
msgid "name of the file for writing the main results"
msgstr ""
-#: src/nse/gnunet-nse-profiler.c:897
+#: src/nse/gnunet-nse-profiler.c:896
msgid "Number of peers to run in each round, separated by commas"
msgstr ""
-#: src/nse/gnunet-nse-profiler.c:903
+#: src/nse/gnunet-nse-profiler.c:902
msgid "delay between rounds"
msgstr ""
-#: src/nse/gnunet-nse-profiler.c:912
+#: src/nse/gnunet-nse-profiler.c:911
#, fuzzy
msgid "Measure quality and performance of the NSE service."
msgstr "无法访问该服务"
-#: src/nse/gnunet-service-nse.c:1405
+#: src/nse/gnunet-service-nse.c:1419
#, fuzzy, c-format
msgid "NSE service could not access hostkey: %s\n"
msgstr "找不到接口“%s”的一个 IP 地址。\n"
-#: src/nse/gnunet-service-nse.c:1419
+#: src/nse/gnunet-service-nse.c:1433
msgid "NSE service is lacking key configuration settings. Exiting.\n"
msgstr ""
-#: src/nse/gnunet-service-nse.c:1524
+#: src/nse/gnunet-service-nse.c:1508
msgid "Invalid work requirement for NSE service. Exiting.\n"
msgstr ""
@@ -4177,42 +4176,42 @@
msgid "Removing expired address of transport `%s'\n"
msgstr ""
-#: src/peerinfo/gnunet-service-peerinfo.c:354
+#: src/peerinfo/gnunet-service-peerinfo.c:355
#, fuzzy, c-format
msgid "Failed to parse HELLO in file `%s': %s\n"
msgstr "解析配置文件“%s”失败\n"
-#: src/peerinfo/gnunet-service-peerinfo.c:369
+#: src/peerinfo/gnunet-service-peerinfo.c:370
#, fuzzy, c-format
msgid "Failed to parse HELLO in file `%s': %s %u \n"
msgstr "解析配置文件“%s”失败\n"
-#: src/peerinfo/gnunet-service-peerinfo.c:444
+#: src/peerinfo/gnunet-service-peerinfo.c:445
msgid "# peers known"
msgstr ""
-#: src/peerinfo/gnunet-service-peerinfo.c:480
+#: src/peerinfo/gnunet-service-peerinfo.c:481
#, c-format
msgid ""
"File `%s' in directory `%s' does not match naming convention. Removed.\n"
msgstr ""
-#: src/peerinfo/gnunet-service-peerinfo.c:632
+#: src/peerinfo/gnunet-service-peerinfo.c:633
#, fuzzy, c-format
msgid "Scanning directory `%s'\n"
msgstr "解析配置文件“%s”失败\n"
-#: src/peerinfo/gnunet-service-peerinfo.c:637
+#: src/peerinfo/gnunet-service-peerinfo.c:638
#, c-format
msgid "Still no peers found in `%s'!\n"
msgstr ""
-#: src/peerinfo/gnunet-service-peerinfo.c:969
+#: src/peerinfo/gnunet-service-peerinfo.c:970
#, fuzzy, c-format
msgid "Cleaning up directory `%s'\n"
msgstr "解析配置文件“%s”失败\n"
-#: src/peerinfo/gnunet-service-peerinfo.c:1249
+#: src/peerinfo/gnunet-service-peerinfo.c:1250
#, c-format
msgid "Importing HELLOs from `%s'\n"
msgstr ""
@@ -4420,80 +4419,72 @@
msgid "Daemon to announce regular expressions for the peer using mesh."
msgstr ""
-#: src/regex/gnunet-regex-profiler.c:1246
+#: src/regex/gnunet-regex-profiler.c:1247
msgid "No configuration file given. Exiting\n"
msgstr ""
-#: src/regex/gnunet-regex-profiler.c:1257
+#: src/regex/gnunet-regex-profiler.c:1258
#, fuzzy
msgid "Configuration option \"regex_prefix\" missing. Exiting\n"
msgstr "配置文件“%s”已写入。\n"
-#: src/regex/gnunet-regex-profiler.c:1276
-msgid "No hosts-file specified on command line. Exiting.\n"
-msgstr ""
-
-#: src/regex/gnunet-regex-profiler.c:1282
+#: src/regex/gnunet-regex-profiler.c:1287
#: src/regex/gnunet-regex-simulation-profiler.c:622
#, c-format
msgid "No policy directory specified on command line. Exiting.\n"
msgstr ""
-#: src/regex/gnunet-regex-profiler.c:1288
+#: src/regex/gnunet-regex-profiler.c:1293
#: src/regex/gnunet-regex-simulation-profiler.c:629
#, c-format
msgid "Specified policies directory does not exist. Exiting.\n"
msgstr ""
-#: src/regex/gnunet-regex-profiler.c:1295
+#: src/regex/gnunet-regex-profiler.c:1300
#, fuzzy, c-format
msgid "No files found in `%s'\n"
msgstr "运行 %s失败:%s %d\n"
-#: src/regex/gnunet-regex-profiler.c:1304
+#: src/regex/gnunet-regex-profiler.c:1309
msgid "No search strings file given. Exiting.\n"
msgstr ""
-#: src/regex/gnunet-regex-profiler.c:1314
+#: src/regex/gnunet-regex-profiler.c:1319
#, fuzzy
msgid ""
"Error loading search strings.Given file does not contain enough strings. "
"Exiting.\n"
msgstr "创建用户出错"
-#: src/regex/gnunet-regex-profiler.c:1322
+#: src/regex/gnunet-regex-profiler.c:1327
#, fuzzy
msgid "Error loading search strings. Exiting.\n"
msgstr "创建用户出错"
-#: src/regex/gnunet-regex-profiler.c:1389
+#: src/regex/gnunet-regex-profiler.c:1394
#, fuzzy
msgid "name of the file for writing statistics"
msgstr "初始化“%s”服务失败。\n"
-#: src/regex/gnunet-regex-profiler.c:1392
-msgid "wait TIMEOUT before considering a string match as failed"
+#: src/regex/gnunet-regex-profiler.c:1397
+msgid "wait TIMEOUT before ending the experiment"
msgstr ""
-#: src/regex/gnunet-regex-profiler.c:1395
-msgid "number of search strings to read from search strings file"
-msgstr ""
-
-#: src/regex/gnunet-regex-profiler.c:1398
+#: src/regex/gnunet-regex-profiler.c:1400
msgid "directory with policy files"
msgstr ""
-#: src/regex/gnunet-regex-profiler.c:1401
+#: src/regex/gnunet-regex-profiler.c:1403
#, fuzzy
msgid "name of file with input strings"
msgstr "初始化“%s”服务失败。\n"
-#: src/regex/gnunet-regex-profiler.c:1404
+#: src/regex/gnunet-regex-profiler.c:1406
#, fuzzy
msgid "name of file with hosts' names"
msgstr "初始化“%s”服务失败。\n"
-#: src/regex/gnunet-regex-profiler.c:1416
+#: src/regex/gnunet-regex-profiler.c:1418
msgid "Profiler for regex"
msgstr ""
@@ -4610,7 +4601,7 @@
msgid "Could not parse execution interval for `%s', set to default 60 sec.\n"
msgstr ""
-#: src/testbed/gnunet-service-testbed_cpustatus.c:670
+#: src/testbed/gnunet-service-testbed_cpustatus.c:692
#, c-format
msgid ""
"Cannot open %s for writing load statistics. Not logging load statistics\n"
@@ -4621,25 +4612,25 @@
msgid "Job command file not given. Exiting\n"
msgstr ""
-#: src/testbed/gnunet_testbed_mpi_spawn.c:135
+#: src/testbed/gnunet_testbed_mpi_spawn.c:125
msgid "Waiting for child to exit.\n"
msgstr ""
-#: src/testbed/gnunet_testbed_mpi_spawn.c:296
+#: src/testbed/gnunet_testbed_mpi_spawn.c:247
#, fuzzy, c-format
msgid "Spawning process `%s'\n"
msgstr "卸载 GNUnet 服务"
-#: src/testbed/gnunet-testbed-profiler.c:249
+#: src/testbed/gnunet-testbed-profiler.c:251
#, fuzzy, c-format
msgid "Exiting as the number of peers is %u\n"
msgstr "增加 TCP/IP 的最大连接数"
-#: src/testbed/gnunet-testbed-profiler.c:275
+#: src/testbed/gnunet-testbed-profiler.c:277
msgid "create COUNT number of peers"
msgstr ""
-#: src/testbed/gnunet-testbed-profiler.c:278
+#: src/testbed/gnunet-testbed-profiler.c:280
msgid "tolerate COUNT number of continious timeout failures"
msgstr ""
@@ -4658,55 +4649,55 @@
msgid "Hosts file %s cannot be read\n"
msgstr ""
-#: src/testbed/testbed_api_hosts.c:583
+#: src/testbed/testbed_api_hosts.c:595
#, c-format
msgid "The function %s is only available when compiled with (--with-ll)\n"
msgstr ""
-#: src/testbed/testbed_api_hosts.c:1856
+#: src/testbed/testbed_api_hosts.c:1879
#, fuzzy, c-format
msgid "Adding host %u failed with error: %s\n"
msgstr "“%s”以错误码 %d 失败:%s\n"
-#: src/testbed/testbed_api_testbed.c:771
+#: src/testbed/testbed_api_testbed.c:891
msgid "Linking controllers failed. Exiting"
msgstr ""
-#: src/testbed/testbed_api_testbed.c:913
+#: src/testbed/testbed_api_testbed.c:1094
#, c-format
msgid "Host registration failed for a host. Error: %s\n"
msgstr ""
-#: src/testbed/testbed_api_testbed.c:978
+#: src/testbed/testbed_api_testbed.c:1175
msgid "Controller crash detected. Shutting down.\n"
msgstr ""
-#: src/testbed/testbed_api_testbed.c:1081
+#: src/testbed/testbed_api_testbed.c:1320
#, c-format
msgid "Host %s cannot start testbed\n"
msgstr ""
-#: src/testbed/testbed_api_testbed.c:1085
+#: src/testbed/testbed_api_testbed.c:1324
msgid "Testbed cannot be started on localhost\n"
msgstr ""
-#: src/testbed/testbed_api_testbed.c:1120
+#: src/testbed/testbed_api_testbed.c:1365
msgid "Cannot start the master controller"
msgstr ""
-#: src/testbed/testbed_api_testbed.c:1138
+#: src/testbed/testbed_api_testbed.c:1383
msgid "Shutting down testbed due to timeout while setup.\n"
msgstr ""
-#: src/testbed/testbed_api_testbed.c:1197
+#: src/testbed/testbed_api_testbed.c:1443
msgid "No hosts loaded from LoadLeveler. Need at least one host\n"
msgstr ""
-#: src/testbed/testbed_api_testbed.c:1209
+#: src/testbed/testbed_api_testbed.c:1455
msgid "No hosts loaded. Need at least one host\n"
msgstr ""
-#: src/testbed/testbed_api_testbed.c:1233
+#: src/testbed/testbed_api_testbed.c:1479
msgid "Specified topology must be supported by testbed"
msgstr ""
@@ -4853,7 +4844,7 @@
msgid "Failed to start `%s': %s\n"
msgstr "运行 %s失败:%s %d\n"
-#: src/testing/testing.c:1691
+#: src/testing/testing.c:1709
#, fuzzy, c-format
msgid "Failed to load configuration from %s\n"
msgstr "解析配置文件“%s”失败\n"
@@ -5003,7 +4994,7 @@
msgid "# bytes payload dropped (other peer was not connected)"
msgstr ""
-#: src/transport/gnunet-service-transport_clients.c:728
+#: src/transport/gnunet-service-transport_clients.c:733
msgid "# REQUEST CONNECT messages received"
msgstr ""
@@ -5064,48 +5055,48 @@
msgid "# ms throttling suggested"
msgstr ""
-#: src/transport/gnunet-service-transport_neighbours.c:2770
+#: src/transport/gnunet-service-transport_neighbours.c:2774
msgid "# unexpected CONNECT_ACK messages (no peer)"
msgstr ""
-#: src/transport/gnunet-service-transport_neighbours.c:2785
-#: src/transport/gnunet-service-transport_neighbours.c:2819
+#: src/transport/gnunet-service-transport_neighbours.c:2789
+#: src/transport/gnunet-service-transport_neighbours.c:2823
msgid "# unexpected CONNECT_ACK messages (not ready)"
msgstr ""
-#: src/transport/gnunet-service-transport_neighbours.c:2832
+#: src/transport/gnunet-service-transport_neighbours.c:2836
msgid "# unexpected CONNECT_ACK messages (waiting on ATS)"
msgstr ""
-#: src/transport/gnunet-service-transport_neighbours.c:2865
+#: src/transport/gnunet-service-transport_neighbours.c:2869
msgid "# unexpected CONNECT_ACK messages (disconnecting)"
msgstr ""
-#: src/transport/gnunet-service-transport_neighbours.c:3046
+#: src/transport/gnunet-service-transport_neighbours.c:3050
msgid "# unexpected SESSION ACK messages"
msgstr ""
-#: src/transport/gnunet-service-transport_neighbours.c:3101
+#: src/transport/gnunet-service-transport_neighbours.c:3105
msgid "# SET QUOTA messages ignored (no such peer)"
msgstr ""
-#: src/transport/gnunet-service-transport_neighbours.c:3115
+#: src/transport/gnunet-service-transport_neighbours.c:3119
msgid "# disconnects due to quota of 0"
msgstr ""
-#: src/transport/gnunet-service-transport_neighbours.c:3146
+#: src/transport/gnunet-service-transport_neighbours.c:3150
msgid "# disconnect messages ignored (old format)"
msgstr ""
-#: src/transport/gnunet-service-transport_neighbours.c:3157
+#: src/transport/gnunet-service-transport_neighbours.c:3161
msgid "# disconnect messages ignored (timestamp)"
msgstr ""
-#: src/transport/gnunet-service-transport_neighbours.c:3188
+#: src/transport/gnunet-service-transport_neighbours.c:3192
msgid "# other peer asked to disconnect from us"
msgstr ""
-#: src/transport/gnunet-service-transport_neighbours.c:3283
+#: src/transport/gnunet-service-transport_neighbours.c:3287
msgid "# disconnected from peer upon explicit request"
msgstr ""
@@ -5515,86 +5506,86 @@
msgid "# bytes dropped by SMTP (outgoing)"
msgstr ""
-#: src/transport/plugin_transport_tcp.c:595
+#: src/transport/plugin_transport_tcp.c:596
#, c-format
msgid "Unexpected address length: %u bytes\n"
msgstr ""
-#: src/transport/plugin_transport_tcp.c:771
-#: src/transport/plugin_transport_tcp.c:860
-#: src/transport/plugin_transport_tcp.c:910
-#: src/transport/plugin_transport_tcp.c:996
-#: src/transport/plugin_transport_tcp.c:1139
-#: src/transport/plugin_transport_tcp.c:1156
+#: src/transport/plugin_transport_tcp.c:772
+#: src/transport/plugin_transport_tcp.c:861
+#: src/transport/plugin_transport_tcp.c:911
+#: src/transport/plugin_transport_tcp.c:997
+#: src/transport/plugin_transport_tcp.c:1140
+#: src/transport/plugin_transport_tcp.c:1157
msgid "# bytes currently in TCP buffers"
msgstr ""
-#: src/transport/plugin_transport_tcp.c:778
-#: src/transport/plugin_transport_tcp.c:967
-#: src/transport/plugin_transport_tcp.c:1826
-#: src/transport/plugin_transport_tcp.c:2456
+#: src/transport/plugin_transport_tcp.c:779
+#: src/transport/plugin_transport_tcp.c:968
+#: src/transport/plugin_transport_tcp.c:1827
+#: src/transport/plugin_transport_tcp.c:2460
msgid "# TCP sessions active"
msgstr ""
-#: src/transport/plugin_transport_tcp.c:864
+#: src/transport/plugin_transport_tcp.c:865
msgid "# bytes discarded by TCP (timeout)"
msgstr ""
-#: src/transport/plugin_transport_tcp.c:913
+#: src/transport/plugin_transport_tcp.c:914
msgid "# bytes transmitted via TCP"
msgstr ""
-#: src/transport/plugin_transport_tcp.c:1000
+#: src/transport/plugin_transport_tcp.c:1001
msgid "# bytes discarded by TCP (disconnect)"
msgstr ""
-#: src/transport/plugin_transport_tcp.c:1113
+#: src/transport/plugin_transport_tcp.c:1114
#, c-format
msgid "Trying to send with invalid session %p\n"
msgstr ""
-#: src/transport/plugin_transport_tcp.c:1349
+#: src/transport/plugin_transport_tcp.c:1350
#, c-format
msgid "Address of unexpected length: %u\n"
msgstr ""
-#: src/transport/plugin_transport_tcp.c:1466
+#: src/transport/plugin_transport_tcp.c:1467
msgid "# transport-service disconnect requests for TCP"
msgstr ""
-#: src/transport/plugin_transport_tcp.c:1867
+#: src/transport/plugin_transport_tcp.c:1868
msgid "# TCP WELCOME messages received"
msgstr ""
-#: src/transport/plugin_transport_tcp.c:2036
+#: src/transport/plugin_transport_tcp.c:2037
msgid "# bytes received via TCP"
msgstr ""
-#: src/transport/plugin_transport_tcp.c:2118
+#: src/transport/plugin_transport_tcp.c:2119
msgid "# network-level TCP disconnect events"
msgstr ""
-#: src/transport/plugin_transport_tcp.c:2344 src/util/service.c:948
+#: src/transport/plugin_transport_tcp.c:2345 src/util/service.c:948
#: src/util/service.c:954
#, c-format
msgid "Require valid port number for service `%s' in configuration!\n"
msgstr ""
-#: src/transport/plugin_transport_tcp.c:2358
+#: src/transport/plugin_transport_tcp.c:2359
#, fuzzy
msgid "Failed to start service.\n"
msgstr "初始化“%s”服务失败。\n"
-#: src/transport/plugin_transport_tcp.c:2444
+#: src/transport/plugin_transport_tcp.c:2448
#, c-format
msgid "TCP transport listening on port %llu\n"
msgstr ""
-#: src/transport/plugin_transport_tcp.c:2448
+#: src/transport/plugin_transport_tcp.c:2452
msgid "TCP transport not listening on any port (client only)\n"
msgstr ""
-#: src/transport/plugin_transport_tcp.c:2452
+#: src/transport/plugin_transport_tcp.c:2456
#, c-format
msgid "TCP transport advertises itself as being on port %llu\n"
msgstr ""
@@ -5617,14 +5608,14 @@
msgid "Failed to set IPv4 broadcast option for broadcast socket on port %d\n"
msgstr ""
-#: src/transport/plugin_transport_udp.c:2520
+#: src/transport/plugin_transport_udp.c:2350
#, c-format
msgid ""
"UDP could not transmit message to `%s': Network seems down, please check "
"your network configuration\n"
msgstr ""
-#: src/transport/plugin_transport_udp.c:2534
+#: src/transport/plugin_transport_udp.c:2364
#, c-format
msgid ""
"UDP could not transmit message to `%s': Please check your network "
@@ -5632,24 +5623,29 @@
"IPv6 address\n"
msgstr ""
-#: src/transport/plugin_transport_udp.c:2775
+#: src/transport/plugin_transport_udp.c:2664
#, fuzzy
msgid "Failed to open UDP sockets\n"
msgstr "打开日志文件“%s”失败:%s\n"
-#: src/transport/plugin_transport_udp.c:2851
+#: src/transport/plugin_transport_udp.c:2762
#, c-format
msgid "Given `%s' option is out of range: %llu > %u\n"
msgstr ""
-#: src/transport/plugin_transport_udp.c:2894
+#: src/transport/plugin_transport_udp.c:2805
#, fuzzy, c-format
msgid "Invalid IPv6 address: `%s'\n"
msgstr "无效的进程优先级“%s”\n"
-#: src/transport/plugin_transport_unix.c:1353
+#: src/transport/plugin_transport_udp.c:2862
#, fuzzy
-msgid "Failed to open UNIX sockets\n"
+msgid "Failed to create network sockets, plugin failed\n"
+msgstr "发送消息失败。\n"
+
+#: src/transport/plugin_transport_unix.c:1427
+#, fuzzy
+msgid "Failed to open UNIX listen socket\n"
msgstr "打开日志文件“%s”失败:%s\n"
#: src/transport/plugin_transport_wlan.c:580
@@ -5947,7 +5943,7 @@
msgid "gnunet-ecc failed"
msgstr ""
-#: src/util/crypto_ecc.c:1045
+#: src/util/crypto_ecc.c:1084
#, c-format
msgid "ECC signature verification failed at %s:%d: %s\n"
msgstr ""
@@ -6209,17 +6205,17 @@
msgid "Perform default-actions for GNUnet URIs"
msgstr ""
-#: src/util/helper.c:271
+#: src/util/helper.c:322
#, fuzzy, c-format
msgid "Error reading from `%s': %s\n"
msgstr "创建用户出错"
-#: src/util/helper.c:316
+#: src/util/helper.c:367
#, fuzzy, c-format
msgid "Failed to parse inbound message from helper `%s'\n"
msgstr "打开日志文件“%s”失败:%s\n"
-#: src/util/helper.c:537
+#: src/util/helper.c:564
#, fuzzy, c-format
msgid "Error writing to `%s': %s\n"
msgstr "创建用户出错"
Modified: gnunet/src/consensus/Makefile.am
===================================================================
--- gnunet/src/consensus/Makefile.am 2013-05-22 10:27:24 UTC (rev 27250)
+++ gnunet/src/consensus/Makefile.am 2013-05-22 10:29:15 UTC (rev 27251)
@@ -17,8 +17,7 @@
bin_PROGRAMS = \
gnunet-consensus \
- gnunet-consensus-start-peers \
- gnunet-consensus-ibf
+ gnunet-consensus-start-peers
libexec_PROGRAMS = \
gnunet-service-consensus
@@ -52,33 +51,25 @@
gnunet_consensus_start_peers_DEPENDENCIES = \
libgnunetconsensus.la
-gnunet_consensus_ibf_SOURCES = \
- gnunet-consensus-ibf.c \
- ibf.c
-gnunet_consensus_ibf_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la \
- $(GN_LIBINTL)
gnunet_service_consensus_SOURCES = \
- gnunet-service-consensus.c \
- ibf.c \
- strata_estimator.c
+ gnunet-service-consensus.c
gnunet_service_consensus_LDADD = \
$(top_builddir)/src/util/libgnunetutil.la \
$(top_builddir)/src/core/libgnunetcore.la \
$(top_builddir)/src/stream/libgnunetstream.la \
$(top_builddir)/src/mesh/libgnunetmesh.la \
+ $(top_builddir)/src/set/libgnunetset.la \
$(GN_LIBINTL)
gnunet_service_evil_consensus_SOURCES = \
- gnunet-service-consensus.c \
- ibf.c \
- strata_estimator.c
+ gnunet-service-consensus.c
gnunet_service_evil_consensus_LDADD = \
$(top_builddir)/src/util/libgnunetutil.la \
$(top_builddir)/src/core/libgnunetcore.la \
$(top_builddir)/src/stream/libgnunetstream.la \
$(top_builddir)/src/mesh/libgnunetmesh.la \
+ $(top_builddir)/src/set/libgnunetset.la \
$(GN_LIBINTL)
gnunet_service_evil_consensus_CFLAGS = -DEVIL
Modified: gnunet/src/consensus/consensus.h
===================================================================
--- gnunet/src/consensus/consensus.h 2013-05-22 10:27:24 UTC (rev 27250)
+++ gnunet/src/consensus/consensus.h 2013-05-22 10:29:15 UTC (rev 27251)
@@ -30,6 +30,10 @@
GNUNET_NETWORK_STRUCT_BEGIN
+/**
+ * Sent by the client to the service,
+ * when the client wants the service to join a consensus session.
+ */
struct GNUNET_CONSENSUS_JoinMessage
{
/**
Modified: gnunet/src/consensus/consensus_protocol.h
===================================================================
--- gnunet/src/consensus/consensus_protocol.h 2013-05-22 10:27:24 UTC (rev
27250)
+++ gnunet/src/consensus/consensus_protocol.h 2013-05-22 10:29:15 UTC (rev
27251)
@@ -35,54 +35,17 @@
GNUNET_NETWORK_STRUCT_BEGIN
-struct StrataMessage
+/**
+ * Sent as context message for set reconciliation.
+ */
+struct ConsensusRoundMessage
{
struct GNUNET_MessageHeader header;
uint8_t round;
uint8_t exp_round;
uint8_t exp_subround;
- /* struct GNUNET_HashCode hash_buckets[ibf_size*num_strata] */
- /* struct GNUNET_HashCode id_buckets[ibf_size*num_strata] */
- /* uint8_t count_buckets[ibf_size*num_strata] */
};
-struct DifferenceDigest
-{
- struct GNUNET_MessageHeader header;
- uint8_t order;
- uint8_t round;
- uint8_t exp_round;
- uint8_t exp_subround;
- /* rest: IBF */
-};
-
-
-struct Element
-{
- struct GNUNET_MessageHeader header;
- struct GNUNET_HashCode hash;
-};
-
-
-struct ElementRequest
-{
- struct GNUNET_MessageHeader header;
- /* struct GNUNET_HashCode[] rest */
-};
-
-struct ConsensusHello
-{
- struct GNUNET_MessageHeader header;
- struct GNUNET_HashCode global_id;
-};
-
-struct ConsensusRoundMessage
-{
- struct GNUNET_MessageHeader header;
- uint8_t round;
-};
-
-
GNUNET_NETWORK_STRUCT_END
#endif
Deleted: gnunet/src/consensus/gnunet-consensus-ibf.c
===================================================================
--- gnunet/src/consensus/gnunet-consensus-ibf.c 2013-05-22 10:27:24 UTC (rev
27250)
+++ gnunet/src/consensus/gnunet-consensus-ibf.c 2013-05-22 10:29:15 UTC (rev
27251)
@@ -1,238 +0,0 @@
-/*
- This file is part of GNUnet.
- (C) 2012 Christian Grothoff (and other contributing authors)
-
- GNUnet is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 3, or (at your
- option) any later version.
-
- GNUnet is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GNUnet; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
-*/
-
-/**
- * @file consensus/gnunet-consensus-ibf.c
- * @brief tool for reconciling data with invertible bloom filters
- * @author Florian Dold
- */
-
-
-#include "platform.h"
-#include "gnunet_common.h"
-#include "gnunet_container_lib.h"
-#include "gnunet_util_lib.h"
-
-#include "ibf.h"
-
-static unsigned int asize = 10;
-static unsigned int bsize = 10;
-static unsigned int csize = 10;
-static unsigned int hash_num = 3;
-static unsigned int ibf_size = 80;
-
-/* FIXME: add parameter for this */
-static enum GNUNET_CRYPTO_Quality random_quality = GNUNET_CRYPTO_QUALITY_WEAK;
-
-static struct GNUNET_CONTAINER_MultiHashMap *set_a;
-static struct GNUNET_CONTAINER_MultiHashMap *set_b;
-/* common elements in a and b */
-static struct GNUNET_CONTAINER_MultiHashMap *set_c;
-
-static struct GNUNET_CONTAINER_MultiHashMap *key_to_hashcode;
-
-static struct InvertibleBloomFilter *ibf_a;
-static struct InvertibleBloomFilter *ibf_b;
-
-
-static void
-register_hashcode (struct GNUNET_HashCode *hash)
-{
- struct GNUNET_HashCode replicated;
- struct IBF_Key key;
- key = ibf_key_from_hashcode (hash);
- ibf_hashcode_from_key (key, &replicated);
- GNUNET_CONTAINER_multihashmap_put (key_to_hashcode, &replicated,
GNUNET_memdup (hash, sizeof *hash),
-
GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE);
-}
-
-static void
-iter_hashcodes (struct IBF_Key key, GNUNET_CONTAINER_HashMapIterator iter,
void *cls)
-{
- struct GNUNET_HashCode replicated;
- ibf_hashcode_from_key (key, &replicated);
- GNUNET_CONTAINER_multihashmap_get_multiple (key_to_hashcode, &replicated,
iter, cls);
-}
-
-
-static int
-insert_iterator (void *cls,
- const struct GNUNET_HashCode *key,
- void *value)
-{
- struct InvertibleBloomFilter *ibf = (struct InvertibleBloomFilter *) cls;
- ibf_insert (ibf, ibf_key_from_hashcode (key));
- return GNUNET_YES;
-}
-
-
-static int
-remove_iterator (void *cls,
- const struct GNUNET_HashCode *key,
- void *value)
-{
- struct GNUNET_CONTAINER_MultiHashMap *hashmap = cls;
- /* if remove fails, there just was a collision with another key */
- (void) GNUNET_CONTAINER_multihashmap_remove (hashmap, value, NULL);
- return GNUNET_YES;
-}
-
-
-static void
-run (void *cls, char *const *args, const char *cfgfile,
- const struct GNUNET_CONFIGURATION_Handle *cfg)
-{
- struct GNUNET_HashCode id;
- struct IBF_Key ibf_key;
- int i;
- int side;
- int res;
- struct GNUNET_TIME_Absolute start_time;
- struct GNUNET_TIME_Relative delta_time;
-
- set_a = GNUNET_CONTAINER_multihashmap_create (((asize == 0) ? 1 : (asize +
csize)),
- GNUNET_NO);
- set_b = GNUNET_CONTAINER_multihashmap_create (((bsize == 0) ? 1 : (bsize +
csize)),
- GNUNET_NO);
- set_c = GNUNET_CONTAINER_multihashmap_create (((csize == 0) ? 1 : csize),
- GNUNET_NO);
-
- key_to_hashcode = GNUNET_CONTAINER_multihashmap_create (((asize+bsize+csize
== 0) ? 1 : (asize+bsize+csize)),
- GNUNET_NO);
-
- printf ("hash-num=%u, size=%u, #(A-B)=%u, #(B-A)=%u, #(A&B)=%u\n",
- hash_num, ibf_size, asize, bsize, csize);
-
- i = 0;
- while (i < asize)
- {
- GNUNET_CRYPTO_hash_create_random (random_quality, &id);
- if (GNUNET_YES == GNUNET_CONTAINER_multihashmap_contains (set_a, &id))
- continue;
- GNUNET_CONTAINER_multihashmap_put (
- set_a, &id, NULL, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY);
- register_hashcode (&id);
- i++;
- }
- i = 0;
- while (i < bsize)
- {
- GNUNET_CRYPTO_hash_create_random (random_quality, &id);
- if (GNUNET_YES == GNUNET_CONTAINER_multihashmap_contains (set_a, &id))
- continue;
- if (GNUNET_YES == GNUNET_CONTAINER_multihashmap_contains (set_b, &id))
- continue;
- GNUNET_CONTAINER_multihashmap_put (
- set_b, &id, NULL, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY);
- register_hashcode (&id);
- i++;
- }
- i = 0;
- while (i < csize)
- {
- GNUNET_CRYPTO_hash_create_random (random_quality, &id);
- if (GNUNET_YES == GNUNET_CONTAINER_multihashmap_contains (set_a, &id))
- continue;
- if (GNUNET_YES == GNUNET_CONTAINER_multihashmap_contains (set_b, &id))
- continue;
- if (GNUNET_YES == GNUNET_CONTAINER_multihashmap_contains (set_c, &id))
- continue;
- GNUNET_CONTAINER_multihashmap_put (
- set_c, &id, NULL, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY);
- register_hashcode (&id);
- i++;
- }
-
- ibf_a = ibf_create (ibf_size, hash_num);
- ibf_b = ibf_create (ibf_size, hash_num);
-
- printf ("generated sets\n");
-
- start_time = GNUNET_TIME_absolute_get ();
-
- GNUNET_CONTAINER_multihashmap_iterate (set_a, &insert_iterator, ibf_a);
- GNUNET_CONTAINER_multihashmap_iterate (set_b, &insert_iterator, ibf_b);
- GNUNET_CONTAINER_multihashmap_iterate (set_c, &insert_iterator, ibf_a);
- GNUNET_CONTAINER_multihashmap_iterate (set_c, &insert_iterator, ibf_b);
-
- delta_time = GNUNET_TIME_absolute_get_duration (start_time);
-
- printf ("encoded in: %s\n", GNUNET_STRINGS_relative_time_to_string
(delta_time, GNUNET_NO));
-
- ibf_subtract (ibf_a, ibf_b);
-
-
- start_time = GNUNET_TIME_absolute_get ();
-
- for (;;)
- {
- res = ibf_decode (ibf_a, &side, &ibf_key);
- if (GNUNET_SYSERR == res)
- {
- printf ("decode failed\n");
- return;
- }
- if (GNUNET_NO == res)
- {
- if ((0 == GNUNET_CONTAINER_multihashmap_size (set_b)) &&
- (0 == GNUNET_CONTAINER_multihashmap_size (set_a)))
- {
- delta_time = GNUNET_TIME_absolute_get_duration (start_time);
- printf ("decoded successfully in: %s\n",
GNUNET_STRINGS_relative_time_to_string (delta_time, GNUNET_NO));
- }
- else
- printf ("decode missed elements\n");
- return;
- }
-
- if (side == 1)
- iter_hashcodes (ibf_key, remove_iterator, set_a);
- if (side == -1)
- iter_hashcodes (ibf_key, remove_iterator, set_b);
- }
-}
-
-int
-main (int argc, char **argv)
-{
- static const struct GNUNET_GETOPT_CommandLineOption options[] = {
- {'A', "asize", NULL,
- gettext_noop ("number of element in set A-B"), 1,
- &GNUNET_GETOPT_set_uint, &asize},
- {'B', "bsize", NULL,
- gettext_noop ("number of element in set B-A"), 1,
- &GNUNET_GETOPT_set_uint, &bsize},
- {'C', "csize", NULL,
- gettext_noop ("number of common elements in A and B"), 1,
- &GNUNET_GETOPT_set_uint, &csize},
- {'k', "hash-num", NULL,
- gettext_noop ("hash num"), 1,
- &GNUNET_GETOPT_set_uint, &hash_num},
- {'s', "ibf-size", NULL,
- gettext_noop ("ibf size"), 1,
- &GNUNET_GETOPT_set_uint, &ibf_size},
- GNUNET_GETOPT_OPTION_END
- };
- GNUNET_PROGRAM_run2 (argc, argv, "gnunet-consensus-ibf",
- "help",
- options, &run, NULL, GNUNET_YES);
- return 0;
-}
-
Modified: gnunet/src/consensus/gnunet-service-consensus.c
===================================================================
--- gnunet/src/consensus/gnunet-service-consensus.c 2013-05-22 10:27:24 UTC
(rev 27250)
+++ gnunet/src/consensus/gnunet-service-consensus.c 2013-05-22 10:29:15 UTC
(rev 27251)
@@ -29,14 +29,10 @@
#include "gnunet_protocols.h"
#include "gnunet_applications.h"
#include "gnunet_util_lib.h"
+#include "gnunet_set_service.h"
#include "gnunet_consensus_service.h"
-#include "gnunet_core_service.h"
-#include "gnunet_stream_lib.h"
-
#include "consensus_protocol.h"
#include "consensus.h"
-#include "ibf.h"
-#include "strata_estimator.h"
/*
@@ -47,84 +43,21 @@
/**
- * Number of IBFs in a strata estimator.
- */
-#define SE_STRATA_COUNT 32
-/**
- * Size of the IBFs in the strata estimator.
- */
-#define SE_IBF_SIZE 80
-/**
- * hash num parameter for the difference digests and strata estimators
- */
-#define SE_IBF_HASH_NUM 3
-
-/**
- * Number of buckets that can be transmitted in one message.
- */
-#define BUCKETS_PER_MESSAGE ((1<<15) / IBF_BUCKET_SIZE)
-
-/**
- * The maximum size of an ibf we use is 2^(MAX_IBF_ORDER).
- * Choose this value so that computing the IBF is still cheaper
- * than transmitting all values.
- */
-#define MAX_IBF_ORDER (16)
-
-/**
* Number of exponential rounds, used in the inventory and completion round.
*/
#define NUM_EXP_ROUNDS (4)
-
/* forward declarations */
/* mutual recursion with struct ConsensusSession */
struct ConsensusPeerInformation;
-struct MessageQueue;
-
/* mutual recursion with round_over */
static void
subround_over (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
-/* mutial recursion with transmit_queued */
-static void
-client_send_next (struct MessageQueue *mq);
-/* mutual recursion with mst_session_callback */
-static void
-open_cb (void *cls, struct GNUNET_STREAM_Socket *socket);
-
-static int
-mst_session_callback (void *cls, void *client, const struct
GNUNET_MessageHeader *message);
-
-
/**
- * Additional information about a consensus element.
- */
-struct ElementInfo
-{
- /**
- * The element itself.
- */
- struct GNUNET_CONSENSUS_Element *element;
- /**
- * Hash of the element
- */
- struct GNUNET_HashCode *element_hash;
- /**
- * Number of other peers that have the element in the inventory.
- */
- unsigned int inventory_count;
- /**
- * Bitmap of peers that have this element in their inventory
- */
- uint8_t *inventory_bitmap;
-};
-
-
-/**
* Describes the current round a consensus session is in.
*/
enum ConsensusRound
@@ -138,7 +71,8 @@
*/
CONSENSUS_ROUND_EXCHANGE,
/**
- * Exchange which elements each peer has, but not the elements.
+ * Exchange which elements each peer has, but don't
+ * transmit the element's data, only their SHA-512 hashes.
* This round uses the all-to-all scheme.
*/
CONSENSUS_ROUND_INVENTORY,
@@ -153,83 +87,7 @@
CONSENSUS_ROUND_FINISH
};
-/* FIXME: review states, ANTICIPATE_DIFF and DECODING in particular */
-
/**
- * State of another peer with respect to the
- * current ibf.
- */
-enum ConsensusIBFState {
- /**
- * There is nothing going on with the IBF.
- */
- IBF_STATE_NONE=0,
- /**
- * We currently receive an ibf.
- */
- IBF_STATE_RECEIVING,
- /*
- * we decode a received ibf
- */
- IBF_STATE_DECODING,
- /**
- * wait for elements and element requests
- */
- IBF_STATE_ANTICIPATE_DIFF
-};
-
-
-typedef void (*AddCallback) (struct MessageQueue *mq);
-typedef void (*MessageSentCallback) (void *cls);
-
-
-/**
- * Collection of the state necessary to read and write gnunet messages
- * to a stream socket. Should be used as closure for stream_data_processor.
- */
-struct MessageStreamState
-{
- struct GNUNET_SERVER_MessageStreamTokenizer *mst;
- struct MessageQueue *mq;
- void *mst_cls;
- struct GNUNET_STREAM_Socket *socket;
- struct GNUNET_STREAM_ReadHandle *rh;
- struct GNUNET_STREAM_WriteHandle *wh;
-};
-
-
-struct ServerClientSocketState
-{
- struct GNUNET_SERVER_Client *client;
- struct GNUNET_SERVER_TransmitHandle* th;
-};
-
-
-/**
- * Generic message queue, for queueing outgoing messages.
- */
-struct MessageQueue
-{
- void *state;
- AddCallback add_cb;
- struct PendingMessage *pending_head;
- struct PendingMessage *pending_tail;
- struct PendingMessage *current_pm;
-};
-
-
-struct PendingMessage
-{
- struct GNUNET_MessageHeader *msg;
- struct MessageQueue *parent_queue;
- struct PendingMessage *next;
- struct PendingMessage *prev;
- MessageSentCallback sent_cb;
- void *sent_cb_cls;
-};
-
-
-/**
* A consensus session consists of one local client and the remote authorities.
*/
struct ConsensusSession
@@ -245,58 +103,35 @@
struct ConsensusSession *prev;
/**
- * Join message. Used to initialize the session later,
- * if the identity of the local peer is not yet known.
- * NULL if the session has been fully initialized.
- */
- struct GNUNET_CONSENSUS_JoinMessage *join_msg;
-
- /**
* Global consensus identification, computed
* from the session id and participating authorities.
*/
struct GNUNET_HashCode global_id;
/**
- * The server's client and associated local state
+ * Client that inhabits the session
*/
- struct ServerClientSocketState scss;
+ struct GNUNET_SERVER_Client *client;
/**
* Queued messages to the client.
*/
- struct MessageQueue *client_mq;
+ struct GNUNET_MQ_MessageQueue *client_mq;
/**
- * IBF_Key -> 2^(HashCode*)
- * FIXME:
- * should be array of hash maps, mapping replicated struct IBF_Keys to
struct HashCode *.
- */
- struct GNUNET_CONTAINER_MultiHashMap *ibf_key_map;
-
- /**
- * Maps HashCodes to ElementInfos
- */
- struct GNUNET_CONTAINER_MultiHashMap *values;
-
- /**
- * Currently active transmit handle for sending to the client
- */
- struct GNUNET_SERVER_TransmitHandle *client_th;
-
- /**
* Timeout for all rounds together, single rounds will schedule a timeout
task
* with a fraction of the conclude timeout.
+ * Only valid once the current round is not CONSENSUS_ROUND_BEGIN.
*/
struct GNUNET_TIME_Relative conclude_timeout;
/**
- * Timeout task identifier for the current round
+ * Timeout task identifier for the current round.
*/
GNUNET_SCHEDULER_TaskIdentifier round_timeout_tid;
/**
- * Number of other peers in the consensus
+ * Number of other peers in the consensus.
*/
unsigned int num_peers;
@@ -307,26 +142,11 @@
struct ConsensusPeerInformation *info;
/**
- * GNUNET_YES if the client has called conclude.
- * */
- int conclude;
-
- /**
* Index of the local peer in the peers array
*/
unsigned int local_peer_idx;
/**
- * Strata estimator, computed online
- */
- struct StrataEstimator *se;
-
- /**
- * Pre-computed IBFs
- */
- struct InvertibleBloomFilter **ibfs;
-
- /**
* Current round
*/
enum ConsensusRound current_round;
@@ -337,19 +157,36 @@
*/
int *shuffle;
+ /**
+ * Current round of the exponential scheme.
+ */
int exp_round;
+ /**
+ * Current sub-round of the exponential scheme.
+ */
int exp_subround;
/**
* The partner for the current exp-round
*/
- struct ConsensusPeerInformation* partner_outgoing;
+ struct ConsensusPeerInformation *partner_outgoing;
/**
* The partner for the current exp-round
*/
- struct ConsensusPeerInformation* partner_incoming;
+ struct ConsensusPeerInformation *partner_incoming;
+
+ /**
+ * The consensus set of this session.
+ */
+ struct GNUNET_SET_Handle *element_set;
+
+ /**
+ * Listener for requests from other peers.
+ * Uses the session's global id as app id.
+ */
+ struct GNUNET_SET_ListenHandle *set_listener;
};
@@ -374,60 +211,13 @@
*/
int hello;
- /*
- * FIXME
- */
- struct MessageStreamState mss;
-
/**
- * Current state
- */
- enum ConsensusIBFState ibf_state;
-
- /**
- * What is the order (=log2 size) of the ibf
- * we're currently dealing with?
- * Interpretation depends on ibf_state.
- */
- int ibf_order;
-
- /**
- * The current IBF for this peer,
- * purpose dependent on ibf_state
- */
- struct InvertibleBloomFilter *ibf;
-
- /**
- * How many buckets have we transmitted/received?
- * Interpretatin depends on ibf_state
- */
- int ibf_bucket_counter;
-
- /**
- * Strata estimator of the peer, NULL if our peer
- * initiated the reconciliation.
- */
- struct StrataEstimator *se;
-
- /**
* Back-reference to the consensus session,
* to that ConsensusPeerInformation can be used as a closure
*/
struct ConsensusSession *session;
/**
- * True if we are actually replaying the strata message,
- * e.g. currently handling the premature_strata_message.
- */
- int replaying_strata_message;
-
- /**
- * A strata message that is not actually for the current round,
- * used in the exp-scheme.
- */
- struct StrataMessage *premature_strata_message;
-
- /**
* We have finishes the exp-subround with the peer.
*/
int exp_subround_finished;
@@ -444,65 +234,15 @@
* older round, while we are already in the next round.
*/
enum ConsensusRound apparent_round;
-};
-
-/**
- * Sockets from other peers who want to communicate with us.
- * It may not be known yet which consensus session they belong to, we have to
wait for the
- * peer's hello.
- * Also, the session might not exist yet locally, we have to wait for a local
client to connect.
- */
-struct IncomingSocket
-{
/**
- * Incoming sockets are kept in a double linked list.
+ * Set operation we are currently executing with this peer.
*/
- struct IncomingSocket *next;
-
- /**
- * Incoming sockets are kept in a double linked list.
- */
- struct IncomingSocket *prev;
-
- /**
- * Peer that connected to us with the socket.
- */
- struct GNUNET_PeerIdentity peer_id;
-
- /**
- * Peer-in-session this socket belongs to, once known, otherwise NULL.
- */
- struct ConsensusPeerInformation *cpi;
-
- /**
- * Set to the global session id, if the peer sent us a hello-message,
- * but the session does not exist yet.
- */
- struct GNUNET_HashCode *requested_gid;
-
- /*
- * Timeout, will disconnect the socket if not yet in a session.
- * FIXME: implement
- */
- GNUNET_SCHEDULER_TaskIdentifier timeout;
-
- /* FIXME */
- struct MessageStreamState mss;
+ struct GNUNET_SET_OperationHandle *set_op;
};
/**
- * Linked list of incoming sockets.
- */
-static struct IncomingSocket *incoming_sockets_head;
-
-/**
- * Linked list of incoming sockets.
- */
-static struct IncomingSocket *incoming_sockets_tail;
-
-/**
* Linked list of sessions this peer participates in.
*/
static struct ConsensusSession *sessions_head;
@@ -525,298 +265,11 @@
/**
* Peer that runs this service.
*/
-static struct GNUNET_PeerIdentity *my_peer;
+static struct GNUNET_PeerIdentity my_peer;
-/**
- * Handle to the core service. Only used during service startup, will be NULL
after that.
- */
-static struct GNUNET_CORE_Handle *core;
-/**
- * Listener for sockets from peers that want to reconcile with us.
- */
-static struct GNUNET_STREAM_ListenSocket *listener;
-
-
-/**
- * Transmit a queued message to the session's client.
- *
- * @param cls consensus session
- * @param size number of bytes available in buf
- * @param buf where the callee should write the message
- * @return number of bytes written to buf
- */
-static size_t
-transmit_queued (void *cls, size_t size,
- void *buf)
-{
- struct MessageQueue *mq = cls;
- struct PendingMessage *pm = mq->pending_head;
- struct ServerClientSocketState *state = mq->state;
- size_t msg_size;
-
- GNUNET_assert (NULL != pm);
- GNUNET_assert (NULL != buf);
- msg_size = ntohs (pm->msg->size);
- GNUNET_assert (size >= msg_size);
- memcpy (buf, pm->msg, msg_size);
- GNUNET_CONTAINER_DLL_remove (mq->pending_head, mq->pending_tail, pm);
- state->th = NULL;
- client_send_next (cls);
- GNUNET_free (pm);
- return msg_size;
-}
-
-
-static void
-client_send_next (struct MessageQueue *mq)
-{
- struct ServerClientSocketState *state = mq->state;
- int msize;
-
- GNUNET_assert (NULL != state);
-
- if ( (NULL != state->th) ||
- (NULL == mq->pending_head) )
- return;
- msize = ntohs (mq->pending_head->msg->size);
- state->th =
- GNUNET_SERVER_notify_transmit_ready (state->client, msize,
- GNUNET_TIME_UNIT_FOREVER_REL,
- &transmit_queued, mq);
-}
-
-
-struct MessageQueue *
-create_message_queue_for_server_client (struct ServerClientSocketState *scss)
-{
- struct MessageQueue *mq;
- mq = GNUNET_new (struct MessageQueue);
- mq->add_cb = client_send_next;
- mq->state = scss;
- return mq;
-}
-
-
-/**
- * Functions of this signature are called whenever writing operations
- * on a stream are executed
- *
- * @param cls the closure from GNUNET_STREAM_write
- * @param status the status of the stream at the time this function is called;
- * GNUNET_STREAM_OK if writing to stream was completed successfully;
- * GNUNET_STREAM_TIMEOUT if the given data is not sent successfully
- * (this doesn't mean that the data is never sent, the receiver may
- * have read the data but its ACKs may have been lost);
- * GNUNET_STREAM_SHUTDOWN if the stream is shutdown for writing in the
- * mean time; GNUNET_STREAM_SYSERR if the stream is broken and cannot
- * be processed.
- * @param size the number of bytes written
- */
-static void
-write_queued (void *cls, enum GNUNET_STREAM_Status status, size_t size)
-{
- struct MessageQueue *mq = cls;
- struct MessageStreamState *mss = mq->state;
- struct PendingMessage *pm;
-
- GNUNET_assert (GNUNET_STREAM_OK == status);
-
- /* call cb for message we finished sending */
- pm = mq->current_pm;
- if (NULL != pm)
- {
- if (NULL != pm->sent_cb)
- pm->sent_cb (pm->sent_cb_cls);
- GNUNET_free (pm);
- }
-
- mss->wh = NULL;
-
- pm = mq->pending_head;
- mq->current_pm = pm;
- if (NULL == pm)
- return;
- GNUNET_CONTAINER_DLL_remove (mq->pending_head, mq->pending_tail, pm);
- mss->wh = GNUNET_STREAM_write (mss->socket, pm->msg, ntohs (pm->msg->size),
- GNUNET_TIME_UNIT_FOREVER_REL, write_queued,
cls);
- GNUNET_assert (NULL != mss->wh);
-}
-
-
-static void
-stream_socket_add_cb (struct MessageQueue *mq)
-{
- if (NULL != mq->current_pm)
- return;
- write_queued (mq, GNUNET_STREAM_OK, 0);
-}
-
-
-struct MessageQueue *
-create_message_queue_for_stream_socket (struct MessageStreamState *mss)
-{
- struct MessageQueue *mq;
- mq = GNUNET_new (struct MessageQueue);
- mq->state = mss;
- mq->add_cb = stream_socket_add_cb;
- return mq;
-}
-
-
-struct PendingMessage *
-new_pending_message (uint16_t size, uint16_t type)
-{
- struct PendingMessage *pm;
- pm = GNUNET_malloc (sizeof *pm + size);
- pm->msg = (void *) &pm[1];
- pm->msg->size = htons (size);
- pm->msg->type = htons (type);
- return pm;
-}
-
-
-/**
- * Queue a message in a message queue.
- *
- * @param queue the message queue
- * @param pending message, message with additional information
- */
-void
-message_queue_add (struct MessageQueue *queue, struct PendingMessage *msg)
-{
- GNUNET_CONTAINER_DLL_insert_tail (queue->pending_head, queue->pending_tail,
msg);
- queue->add_cb (queue);
-}
-
-
-/**
- * Called when we receive data from a peer via stream.
- *
- * @param cls the closure from GNUNET_STREAM_read
- * @param status the status of the stream at the time this function is called
- * @param data traffic from the other side
- * @param size the number of bytes available in data read; will be 0 on
timeout
- * @return number of bytes of processed from 'data' (any data remaining should
be
- * given to the next time the read processor is called).
- */
-static size_t
-stream_data_processor (void *cls, enum GNUNET_STREAM_Status status, const void
*data, size_t size)
-{
- struct MessageStreamState *mss = cls;
- int ret;
-
- mss->rh = NULL;
-
- if (GNUNET_STREAM_OK != status)
- {
- /* FIXME: handle this correctly */
- GNUNET_break (0);
- return 0;
- }
- GNUNET_assert (NULL != mss->mst);
- ret = GNUNET_SERVER_mst_receive (mss->mst, NULL, data, size, GNUNET_NO,
GNUNET_YES);
- if (GNUNET_SYSERR == ret)
- {
- /* FIXME: handle this correctly */
- GNUNET_break (0);
- return 0;
- }
- /* read again */
- mss->rh = GNUNET_STREAM_read (mss->socket, GNUNET_TIME_UNIT_FOREVER_REL,
&stream_data_processor, mss);
- /* we always read all data */
- return size;
-}
-
-
-/**
- * Send element or element report to the peer specified in cpi.
- *
- * @param cpi peer to send the elements to
- * @param head head of the element list
- */
-static void
-send_element_or_report (struct ConsensusPeerInformation *cpi, struct
ElementInfo *e)
-{
- struct PendingMessage *pm;
-
- switch (cpi->apparent_round)
- {
- case CONSENSUS_ROUND_COMPLETION:
- case CONSENSUS_ROUND_EXCHANGE:
- pm = new_pending_message (sizeof (struct GNUNET_MessageHeader) +
e->element->size,
- GNUNET_MESSAGE_TYPE_CONSENSUS_P2P_ELEMENTS);
- memcpy (&pm->msg[1], e->element->data, e->element->size);
- message_queue_add (cpi->mss.mq, pm);
- break;
- case CONSENSUS_ROUND_INVENTORY:
- pm = new_pending_message (sizeof (struct GNUNET_MessageHeader) + sizeof
(struct GNUNET_HashCode),
-
GNUNET_MESSAGE_TYPE_CONSENSUS_P2P_ELEMENTS_REPORT);
- memcpy (&pm->msg[1], e->element_hash, sizeof (struct GNUNET_HashCode));
- message_queue_add (cpi->mss.mq, pm);
- break;
- default:
- GNUNET_break (0);
- }
-}
-
-
-/**
- * Iterator to insert values into an ibf.
- *
- * @param cls closure
- * @param key current key code
- * @param value value in the hash map
- * @return GNUNET_YES if we should continue to
- * iterate,
- * GNUNET_NO if not.
- */
+/*
static int
-ibf_values_iterator (void *cls,
- const struct GNUNET_HashCode *key,
- void *value)
-{
- struct ConsensusPeerInformation *cpi = cls;
- struct ElementInfo *e = value;
- struct IBF_Key ibf_key = ibf_key_from_hashcode (e->element_hash);
-
- GNUNET_assert (ibf_key.key_val == ibf_key_from_hashcode (key).key_val);
- ibf_insert (cpi->session->ibfs[cpi->ibf_order], ibf_key);
- return GNUNET_YES;
-}
-
-/**
- * Create and populate an IBF for the specified peer,
- * if it does not already exist.
- *
- * @param cpi peer to create the ibf for
- */
-static void
-prepare_ibf (struct ConsensusPeerInformation *cpi)
-{
- if (NULL != cpi->session->ibfs[cpi->ibf_order])
- return;
- cpi->session->ibfs[cpi->ibf_order] = ibf_create (1 << cpi->ibf_order,
SE_IBF_HASH_NUM);
- GNUNET_CONTAINER_multihashmap_iterate (cpi->session->values,
ibf_values_iterator, cpi);
-}
-
-
-/**
- * Called when a remote peer wants to inform the local peer
- * that the remote peer misses elements.
- * Elements are not reconciled.
- *
- * @param cpi session
- * @param msg message
- */
-static int
-handle_p2p_element_report (struct ConsensusPeerInformation *cpi, const struct
GNUNET_MessageHeader *msg)
-{
- GNUNET_assert (0);
-}
-
-
-static int
exp_subround_finished (const struct ConsensusSession *session)
{
int not_finished;
@@ -831,8 +284,11 @@
return GNUNET_YES;
return GNUNET_NO;
}
+*/
+
+/*
static int
inventory_round_finished (struct ConsensusSession *session)
{
@@ -846,63 +302,9 @@
return GNUNET_YES;
return GNUNET_NO;
}
+*/
-
-static void
-clear_message_stream_state (struct MessageStreamState *mss)
-{
- if (NULL != mss->mst)
- {
- GNUNET_SERVER_mst_destroy (mss->mst);
- mss->mst = NULL;
- }
- if (NULL != mss->rh)
- {
- GNUNET_STREAM_read_cancel (mss->rh);
- mss->rh = NULL;
- }
- if (NULL != mss->wh)
- {
- GNUNET_STREAM_write_cancel (mss->wh);
- mss->wh = NULL;
- }
- if (NULL != mss->socket)
- {
- GNUNET_STREAM_close (mss->socket);
- mss->socket = NULL;
- }
- if (NULL != mss->mq)
- {
- GNUNET_free (mss->mq);
- mss->mq = NULL;
- }
-}
-
-
/**
- * Iterator over hash map entries.
- *
- * @param cls closure
- * @param key current key code
- * @param value value in the hash map
- * @return GNUNET_YES if we should continue to
- * iterate,
- * GNUNET_NO if not.
- */
-static int
-destroy_element_info_iter (void *cls,
- const struct GNUNET_HashCode * key,
- void *value)
-{
- struct ElementInfo *ei = value;
- GNUNET_free (ei->element);
- GNUNET_free (ei->element_hash);
- GNUNET_free (ei);
- return GNUNET_YES;
-}
-
-
-/**
* Destroy a session, free all resources associated with it.
*
* @param session the session to destroy
@@ -913,11 +315,9 @@
int i;
GNUNET_CONTAINER_DLL_remove (sessions_head, sessions_tail, session);
- GNUNET_SERVER_client_drop (session->scss.client);
- session->scss.client = NULL;
if (NULL != session->client_mq)
{
- GNUNET_free (session->client_mq);
+ GNUNET_MQ_destroy (session->client_mq);
session->client_mq = NULL;
}
if (NULL != session->shuffle)
@@ -925,618 +325,22 @@
GNUNET_free (session->shuffle);
session->shuffle = NULL;
}
- if (NULL != session->se)
- {
- strata_estimator_destroy (session->se);
- session->se = NULL;
- }
if (NULL != session->info)
{
for (i = 0; i < session->num_peers; i++)
{
struct ConsensusPeerInformation *cpi;
cpi = &session->info[i];
- clear_message_stream_state (&cpi->mss);
- if (NULL != cpi->se)
- {
- strata_estimator_destroy (cpi->se);
- cpi->se = NULL;
- }
- if (NULL != cpi->ibf)
- {
- ibf_destroy (cpi->ibf);
- cpi->ibf = NULL;
- }
+ GNUNET_free (cpi);
}
GNUNET_free (session->info);
session->info = NULL;
}
- if (NULL != session->ibfs)
- {
- for (i = 0; i <= MAX_IBF_ORDER; i++)
- {
- if (NULL != session->ibfs[i])
- {
- ibf_destroy (session->ibfs[i]);
- session->ibfs[i] = NULL;
- }
- }
- GNUNET_free (session->ibfs);
- session->ibfs = NULL;
- }
- if (NULL != session->values)
- {
- GNUNET_CONTAINER_multihashmap_iterate (session->values,
destroy_element_info_iter, NULL);
- GNUNET_CONTAINER_multihashmap_destroy (session->values);
- session->values = NULL;
- }
-
- if (NULL != session->ibf_key_map)
- {
- GNUNET_CONTAINER_multihashmap_destroy (session->ibf_key_map);
- session->ibf_key_map = NULL;
- }
GNUNET_free (session);
}
-static void
-send_client_conclude_done (struct ConsensusSession *session)
-{
- struct PendingMessage *pm;
-
- /* check if client is even there anymore */
- if (NULL == session->scss.client)
- return;
- pm = new_pending_message (sizeof (struct GNUNET_MessageHeader),
-
GNUNET_MESSAGE_TYPE_CONSENSUS_CLIENT_CONCLUDE_DONE);
- message_queue_add (session->client_mq, pm);
-}
-
-
/**
- * Check if a strata message is for the current round or not
- *
- * @param session session we are in
- * @param strata_msg the strata message to check
- * @return GNUNET_YES if the strata_msg is premature, GNUNET_NO otherwise
- */
-static int
-is_premature_strata_message (const struct ConsensusSession *session, const
struct StrataMessage *strata_msg)
-{
- switch (strata_msg->round)
- {
- case CONSENSUS_ROUND_COMPLETION:
- case CONSENSUS_ROUND_EXCHANGE:
- /* here, we also have to compare subrounds */
- if ( (strata_msg->round != session->current_round) ||
- (strata_msg->exp_round != session->exp_round) ||
- (strata_msg->exp_subround != session->exp_subround) )
- return GNUNET_YES;
- break;
- default:
- if (session->current_round != strata_msg->round)
- return GNUNET_YES;
- break;
- }
- return GNUNET_NO;
-}
-
-
-/**
- * Send a strata estimator.
- *
- * @param cpi the peer
- */
-static void
-send_strata_estimator (struct ConsensusPeerInformation *cpi)
-{
- struct PendingMessage *pm;
- struct StrataMessage *strata_msg;
-
- /* FIXME: why is this correct? */
- cpi->apparent_round = cpi->session->current_round;
- cpi->ibf_state = IBF_STATE_NONE;
- cpi->ibf_bucket_counter = 0;
-
- LOG_PP (GNUNET_ERROR_TYPE_INFO, cpi, "sending SE (in round: %d)\n",
cpi->session->current_round);
-
- pm = new_pending_message ((sizeof *strata_msg) + (SE_STRATA_COUNT *
IBF_BUCKET_SIZE * SE_IBF_SIZE),
- GNUNET_MESSAGE_TYPE_CONSENSUS_P2P_DELTA_ESTIMATE);
- strata_msg = (struct StrataMessage *) pm->msg;
- strata_msg->round = cpi->session->current_round;
- strata_msg->exp_round = cpi->session->exp_round;
- strata_msg->exp_subround = cpi->session->exp_subround;
- strata_estimator_write (cpi->session->se, &strata_msg[1]);
- message_queue_add (cpi->mss.mq, pm);
-}
-
-
-/**
- * Send an IBF of the order specified in cpi.
- *
- * @param cpi the peer
- */
-static void
-send_ibf (struct ConsensusPeerInformation *cpi)
-{
- GNUNET_log (GNUNET_ERROR_TYPE_INFO, "P%d: sending IBF to P%d\n",
- cpi->session->local_peer_idx, (int) (cpi - cpi->session->info));
-
- cpi->ibf_bucket_counter = 0;
- while (cpi->ibf_bucket_counter < (1 << cpi->ibf_order))
- {
- unsigned int num_buckets;
- struct PendingMessage *pm;
- struct DifferenceDigest *digest;
-
- num_buckets = (1 << cpi->ibf_order) - cpi->ibf_bucket_counter;
- /* limit to maximum */
- if (num_buckets > BUCKETS_PER_MESSAGE)
- num_buckets = BUCKETS_PER_MESSAGE;
-
- pm = new_pending_message ((sizeof *digest) + (num_buckets *
IBF_BUCKET_SIZE),
-
GNUNET_MESSAGE_TYPE_CONSENSUS_P2P_DIFFERENCE_DIGEST);
- digest = (struct DifferenceDigest *) pm->msg;
- digest->order = cpi->ibf_order;
- digest->round = cpi->apparent_round;
- ibf_write_slice (cpi->ibf, cpi->ibf_bucket_counter, num_buckets,
&digest[1]);
- cpi->ibf_bucket_counter += num_buckets;
- message_queue_add (cpi->mss.mq, pm);
- }
- cpi->ibf_bucket_counter = 0;
- cpi->ibf_state = IBF_STATE_ANTICIPATE_DIFF;
-}
-
-
-/**
- * Called when a peer sends us its strata estimator.
- * In response, we sent out IBF of appropriate size back.
- *
- * @param cpi session
- * @param strata_msg message
- */
-static int
-handle_p2p_strata (struct ConsensusPeerInformation *cpi, const struct
StrataMessage *strata_msg)
-{
- unsigned int diff;
-
- if ( (cpi->session->current_round == CONSENSUS_ROUND_COMPLETION) &&
- (strata_msg->round == CONSENSUS_ROUND_INVENTORY) )
- {
- /* we still have to handle this request appropriately */
- GNUNET_log (GNUNET_ERROR_TYPE_INFO, "P%d: got inventory SE from P%d, we
are already further alog\n",
- cpi->session->local_peer_idx, (int) (cpi -
cpi->session->info));
- }
- else if (is_premature_strata_message (cpi->session, strata_msg))
- {
- if (GNUNET_NO == cpi->replaying_strata_message)
- {
- LOG_PP (GNUNET_ERROR_TYPE_INFO, cpi, "got probably premature SE
(%d,%d)\n",
- strata_msg->exp_round, strata_msg->exp_subround);
- cpi->premature_strata_message = (struct StrataMessage *)
GNUNET_copy_message (&strata_msg->header);
- }
- return GNUNET_YES;
- }
-
- if (NULL == cpi->se)
- cpi->se = strata_estimator_create (SE_STRATA_COUNT, SE_IBF_SIZE,
SE_IBF_HASH_NUM);
-
- cpi->apparent_round = strata_msg->round;
-
- if (htons (strata_msg->header.size) != ((sizeof *strata_msg) +
SE_STRATA_COUNT * SE_IBF_SIZE * IBF_BUCKET_SIZE))
- {
- LOG_PP (GNUNET_ERROR_TYPE_WARNING, cpi, "got SE of wrong size\n");
- return GNUNET_NO;
- }
- strata_estimator_read (&strata_msg[1], cpi->se);
- GNUNET_assert (NULL != cpi->session->se);
- diff = strata_estimator_difference (cpi->session->se, cpi->se);
-
- GNUNET_log (GNUNET_ERROR_TYPE_INFO, "P%d: got SE from P%d, diff=%d\n",
- cpi->session->local_peer_idx, (int) (cpi - cpi->session->info),
diff);
-
- switch (cpi->session->current_round)
- {
- case CONSENSUS_ROUND_EXCHANGE:
- case CONSENSUS_ROUND_INVENTORY:
- case CONSENSUS_ROUND_COMPLETION:
- /* send IBF of the right size */
- cpi->ibf_order = 0;
- while (((1 << cpi->ibf_order) < diff) || (SE_IBF_HASH_NUM > (1 <<
cpi->ibf_order)) )
- cpi->ibf_order++;
- if (cpi->ibf_order > MAX_IBF_ORDER)
- cpi->ibf_order = MAX_IBF_ORDER;
- cpi->ibf_order += 1;
- /* create ibf if not already pre-computed */
- prepare_ibf (cpi);
- if (NULL != cpi->ibf)
- ibf_destroy (cpi->ibf);
- cpi->ibf = ibf_dup (cpi->session->ibfs[cpi->ibf_order]);
- cpi->ibf_bucket_counter = 0;
- send_ibf (cpi);
- break;
- default:
- GNUNET_log (GNUNET_ERROR_TYPE_INFO, "P%d: got unexpected SE from P%d\n",
- cpi->session->local_peer_idx, (int) (cpi -
cpi->session->info));
- break;
- }
- return GNUNET_YES;
-}
-
-
-
-static int
-send_elements_iterator (void *cls,
- const struct GNUNET_HashCode * key,
- void *value)
-{
- struct ConsensusPeerInformation *cpi = cls;
- struct ElementInfo *ei;
- ei = GNUNET_CONTAINER_multihashmap_get (cpi->session->values, value);
- if (NULL == ei)
- {
- LOG_PP (GNUNET_ERROR_TYPE_WARNING, cpi, "peer's ibf contained non-existing
element %s\n",
- GNUNET_h2s((struct GNUNET_HashCode *) value));
- return GNUNET_YES;
- }
- LOG_PP (GNUNET_ERROR_TYPE_INFO, cpi, "sending element\n");
- send_element_or_report (cpi, ei);
- return GNUNET_YES;
-}
-
-
-/**
- * Decode the current diff ibf, and send elements/requests/reports/
- *
- * @param cpi partner peer
- */
-static void
-decode (struct ConsensusPeerInformation *cpi)
-{
- struct IBF_Key key;
- int side;
-
- GNUNET_log (GNUNET_ERROR_TYPE_INFO, "P%d: decoding ibf from P%d\n",
cpi->session->local_peer_idx, (int) (cpi - cpi->session->info));
-
- while (1)
- {
- int res;
-
- res = ibf_decode (cpi->ibf, &side, &key);
- if (GNUNET_SYSERR == res)
- {
- GNUNET_log (GNUNET_ERROR_TYPE_INFO, "decoding failed, transmitting
larger IBF\n");
- /* decoding failed, we tell the other peer by sending our ibf with a
larger order */
- cpi->ibf_order++;
- prepare_ibf (cpi);
- cpi->ibf = ibf_dup (cpi->session->ibfs[cpi->ibf_order]);
- cpi->ibf_bucket_counter = 0;
- send_ibf (cpi);
- return;
- }
- if (GNUNET_NO == res)
- {
- struct PendingMessage *pm;
- struct ConsensusRoundMessage *rmsg;
- GNUNET_log (GNUNET_ERROR_TYPE_INFO, "P%d: transmitted all values,
sending SYNC\n", cpi->session->local_peer_idx);
-
- pm = new_pending_message (sizeof *rmsg,
GNUNET_MESSAGE_TYPE_CONSENSUS_P2P_SYNCED);
- rmsg = (struct ConsensusRoundMessage *) pm->msg;
- rmsg->round = cpi->apparent_round;
- message_queue_add (cpi->mss.mq, pm);
- return;
- }
- if (-1 == side)
- {
- struct GNUNET_HashCode hashcode;
- /* we have the element(s), send it to the other peer */
- ibf_hashcode_from_key (key, &hashcode);
- GNUNET_CONTAINER_multihashmap_get_multiple (cpi->session->ibf_key_map,
&hashcode, send_elements_iterator, cpi);
- }
- else
- {
- struct PendingMessage *pm;
- uint16_t type;
-
- switch (cpi->apparent_round)
- {
- case CONSENSUS_ROUND_COMPLETION:
- /* FIXME: check if we really want to request the element */
- case CONSENSUS_ROUND_EXCHANGE:
- case CONSENSUS_ROUND_INVENTORY:
- type = GNUNET_MESSAGE_TYPE_CONSENSUS_P2P_ELEMENTS_REQUEST;
- break;
- default:
- GNUNET_assert (0);
- }
- pm = new_pending_message (sizeof (struct GNUNET_MessageHeader) + sizeof
(struct IBF_Key),
- type);
- *(struct IBF_Key *) &pm->msg[1] = key;
- message_queue_add (cpi->mss.mq, pm);
- }
- }
-}
-
-
-static int
-handle_p2p_ibf (struct ConsensusPeerInformation *cpi, const struct
DifferenceDigest *digest)
-{
- int num_buckets;
-
- /* FIXME: find out if we're still expecting the same ibf! */
-
- cpi->apparent_round = cpi->session->current_round;
- // FIXME: check header.size >= sizeof (DD)
- num_buckets = (ntohs (digest->header.size) - (sizeof *digest)) /
IBF_BUCKET_SIZE;
- switch (cpi->ibf_state)
- {
- case IBF_STATE_NONE:
- GNUNET_log (GNUNET_ERROR_TYPE_INFO, "P%d: receiving IBF from P%d\n",
cpi->session->local_peer_idx, (int) (cpi - cpi->session->info));
- cpi->ibf_state = IBF_STATE_RECEIVING;
- cpi->ibf_order = digest->order;
- cpi->ibf_bucket_counter = 0;
- if (NULL != cpi->ibf)
- {
- ibf_destroy (cpi->ibf);
- cpi->ibf = NULL;
- }
- break;
- case IBF_STATE_ANTICIPATE_DIFF:
- GNUNET_log (GNUNET_ERROR_TYPE_INFO, "P%d: receiving IBF from P%d
(probably out IBF did not decode)\n",
- cpi->session->local_peer_idx, (int) (cpi -
cpi->session->info));
- cpi->ibf_state = IBF_STATE_RECEIVING;
- cpi->ibf_order = digest->order;
- cpi->ibf_bucket_counter = 0;
- if (NULL != cpi->ibf)
- {
- ibf_destroy (cpi->ibf);
- cpi->ibf = NULL;
- }
- break;
- case IBF_STATE_RECEIVING:
- break;
- default:
- GNUNET_log (GNUNET_ERROR_TYPE_INFO, "P%d: unexpected IBF from P%d\n",
cpi->session->local_peer_idx, (int) (cpi - cpi->session->info));
- return GNUNET_YES;
- }
-
- if (cpi->ibf_bucket_counter + num_buckets > (1 << cpi->ibf_order))
- {
- GNUNET_log (GNUNET_ERROR_TYPE_INFO, "P%d: overfull IBF from P%d\n",
cpi->session->local_peer_idx, (int) (cpi - cpi->session->info));
- return GNUNET_YES;
- }
-
- if (NULL == cpi->ibf)
- cpi->ibf = ibf_create (1 << cpi->ibf_order, SE_IBF_HASH_NUM);
-
- ibf_read_slice (&digest[1], cpi->ibf_bucket_counter, num_buckets, cpi->ibf);
- cpi->ibf_bucket_counter += num_buckets;
-
- if (cpi->ibf_bucket_counter == (1 << cpi->ibf_order))
- {
- cpi->ibf_state = IBF_STATE_DECODING;
- cpi->ibf_bucket_counter = 0;
- prepare_ibf (cpi);
- ibf_subtract (cpi->ibf, cpi->session->ibfs[cpi->ibf_order]);
- decode (cpi);
- }
- return GNUNET_YES;
-}
-
-
-/**
- * Insert an element into the consensus set of the specified session.
- * The element will not be copied, and freed when destroying the session.
- *
- * @param session session for new element
- * @param element element to insert
- */
-static void
-insert_element (struct ConsensusSession *session, struct
GNUNET_CONSENSUS_Element *element)
-{
- struct GNUNET_HashCode hash;
- struct ElementInfo *e;
- struct IBF_Key ibf_key;
- int i;
-
- e = GNUNET_new (struct ElementInfo);
- e->element = element;
- e->element_hash = GNUNET_new (struct GNUNET_HashCode);
- GNUNET_CRYPTO_hash (e->element->data, e->element->size, e->element_hash);
- ibf_key = ibf_key_from_hashcode (e->element_hash);
- ibf_hashcode_from_key (ibf_key, &hash);
- strata_estimator_insert (session->se, &hash);
- GNUNET_CONTAINER_multihashmap_put (session->values, e->element_hash, e,
-
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY);
- GNUNET_CONTAINER_multihashmap_put (session->ibf_key_map, &hash,
e->element_hash,
-
GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE);
-
- for (i = 0; i <= MAX_IBF_ORDER; i++)
- {
- if (NULL == session->ibfs[i])
- continue;
- ibf_insert (session->ibfs[i], ibf_key);
- }
-}
-
-
-/**
- * Handle an element that another peer sent us
- */
-static int
-handle_p2p_element (struct ConsensusPeerInformation *cpi, const struct
GNUNET_MessageHeader *element_msg)
-{
- struct GNUNET_CONSENSUS_Element *element;
- size_t size;
-
- switch (cpi->session->current_round)
- {
- case CONSENSUS_ROUND_COMPLETION:
- /* FIXME: check if we really expect the element */
- case CONSENSUS_ROUND_EXCHANGE:
- break;
- default:
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "got unexpected element,
ignoring\n");
- return GNUNET_YES;
- }
-
- size = ntohs (element_msg->size) - sizeof *element_msg;
-
- element = GNUNET_malloc (size + sizeof *element);
- element->size = size;
- memcpy (&element[1], &element_msg[1], size);
- element->data = &element[1];
-
- LOG_PP (GNUNET_ERROR_TYPE_INFO, cpi, "got element\n");
-
- insert_element (cpi->session, element);
-
- return GNUNET_YES;
-}
-
-
-/**
- * Handle a request for elements.
- *
- * @param cpi peer that is requesting the element
- * @param msg the element request message
- */
-static int
-handle_p2p_element_request (struct ConsensusPeerInformation *cpi, const struct
ElementRequest *msg)
-{
- struct GNUNET_HashCode hashcode;
- struct IBF_Key *ibf_key;
- unsigned int num;
-
- /* element requests are allowed in every round */
-
- num = ntohs (msg->header.size) / sizeof (struct IBF_Key);
-
- ibf_key = (struct IBF_Key *) &msg[1];
- while (num--)
- {
- ibf_hashcode_from_key (*ibf_key, &hashcode);
- GNUNET_CONTAINER_multihashmap_get_multiple (cpi->session->ibf_key_map,
&hashcode, send_elements_iterator, cpi);
- ibf_key++;
- }
- return GNUNET_YES;
-}
-
-static int
-is_peer_connected (struct ConsensusPeerInformation *cpi)
-{
- if (NULL == cpi->mss.socket)
- return GNUNET_NO;
- return GNUNET_YES;
-}
-
-
-static void
-ensure_peer_connected (struct ConsensusPeerInformation *cpi)
-{
- if (NULL != cpi->mss.socket)
- return;
- cpi->mss.socket = GNUNET_STREAM_open (cfg, &cpi->peer_id,
GNUNET_APPLICATION_TYPE_CONSENSUS,
- open_cb, cpi,
GNUNET_STREAM_OPTION_END);
-}
-
-
-/**
- * If necessary, send a message to the peer, depending on the current
- * round.
- */
-static void
-embrace_peer (struct ConsensusPeerInformation *cpi)
-{
- if (GNUNET_NO == is_peer_connected (cpi))
- {
- ensure_peer_connected (cpi);
- return;
- }
- if (GNUNET_NO == cpi->hello)
- return;
- /* FIXME: correctness of switch */
- switch (cpi->session->current_round)
- {
- case CONSENSUS_ROUND_EXCHANGE:
- case CONSENSUS_ROUND_INVENTORY:
- if (cpi->session->partner_outgoing != cpi)
- break;
- /* fallthrough */
- case CONSENSUS_ROUND_COMPLETION:
- send_strata_estimator (cpi);
- default:
- break;
- }
-}
-
-
-/**
- * Called when stream has finishes writing the hello message
- */
-static void
-hello_cont (void *cls)
-{
- struct ConsensusPeerInformation *cpi = cls;
-
- cpi->hello = GNUNET_YES;
- embrace_peer (cpi);
-}
-
-
-/**
- * Called when we established a stream connection to another peer
- *
- * @param cls cpi of the peer we just connected to
- * @param socket socket to use to communicate with the other side (read/write)
- */
-static void
-open_cb (void *cls, struct GNUNET_STREAM_Socket *socket)
-{
- struct ConsensusPeerInformation *cpi = cls;
- struct PendingMessage *pm;
- struct ConsensusHello *hello;
-
- GNUNET_assert (NULL == cpi->mss.mst);
- GNUNET_assert (NULL == cpi->mss.mq);
-
- cpi->mss.mq = create_message_queue_for_stream_socket (&cpi->mss);
- cpi->mss.mst = GNUNET_SERVER_mst_create (mst_session_callback, cpi);
- cpi->mss.mst_cls = cpi;
-
- pm = new_pending_message (sizeof *hello,
GNUNET_MESSAGE_TYPE_CONSENSUS_P2P_HELLO);
- hello = (struct ConsensusHello *) pm->msg;
- memcpy (&hello->global_id, &cpi->session->global_id, sizeof (struct
GNUNET_HashCode));
- pm->sent_cb = hello_cont;
- pm->sent_cb_cls = cpi;
- message_queue_add (cpi->mss.mq, pm);
- cpi->mss.rh = GNUNET_STREAM_read (socket, GNUNET_TIME_UNIT_FOREVER_REL,
- &stream_data_processor, &cpi->mss);
-}
-
-
-static void
-replay_premature_message (struct ConsensusPeerInformation *cpi)
-{
- if (NULL != cpi->premature_strata_message)
- {
- struct StrataMessage *sm;
-
- GNUNET_log (GNUNET_ERROR_TYPE_INFO, "replaying premature SE\n");
- sm = cpi->premature_strata_message;
- cpi->premature_strata_message = NULL;
-
- cpi->replaying_strata_message = GNUNET_YES;
- handle_p2p_strata (cpi, sm);
- cpi->replaying_strata_message = GNUNET_NO;
-
- GNUNET_free (sm);
- }
-}
-
-
-/**
* Start the inventory round, contact all peers we are supposed to contact.
*
* @param session the current session
@@ -1548,11 +352,7 @@
int last;
for (i = 0; i < session->num_peers; i++)
- {
- session->info[i].ibf_bucket_counter = 0;
- session->info[i].ibf_state = IBF_STATE_NONE;
session->info[i].is_outgoing = GNUNET_NO;
- }
last = (session->local_peer_idx + ((session->num_peers - 1) / 2) + 1) %
session->num_peers;
i = (session->local_peer_idx + 1) % session->num_peers;
@@ -1560,7 +360,7 @@
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "P%d contacting P%d in all-to-all\n",
session->local_peer_idx, i);
session->info[i].is_outgoing = GNUNET_YES;
- embrace_peer (&session->info[i]);
+ // embrace_peer (&session->info[i]);
i = (i + 1) % session->num_peers;
}
// tie-breaker for even number of peers
@@ -1568,49 +368,12 @@
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "P%d contacting P%d in all-to-all
(tie-breaker)\n", session->local_peer_idx, i);
session->info[last].is_outgoing = GNUNET_YES;
- embrace_peer (&session->info[last]);
+ // embrace_peer (&session->info[last]);
}
-
- for (i = 0; i < session->num_peers; i++)
- {
- if (GNUNET_NO == session->info[i].is_outgoing)
- replay_premature_message (&session->info[i]);
- }
}
/**
- * Iterator over hash map entries.
- *
- * @param cls closure
- * @param key current key code
- * @param value value in the hash map
- * @return GNUNET_YES if we should continue to
- * iterate,
- * GNUNET_NO if not.
- */
-static int
-send_client_elements_iter (void *cls,
- const struct GNUNET_HashCode * key,
- void *value)
-{
- struct ConsensusSession *session = cls;
- struct ElementInfo *ei = value;
- struct PendingMessage *pm;
-
- /* is the client still there? */
- if (NULL == session->scss.client)
- return GNUNET_NO;
-
- pm = new_pending_message (sizeof (struct GNUNET_MessageHeader) +
ei->element->size,
-
GNUNET_MESSAGE_TYPE_CONSENSUS_CLIENT_RECEIVED_ELEMENT);
- message_queue_add (session->client_mq, pm);
- return GNUNET_YES;
-}
-
-
-
-/**
* Start the next round.
* This function can be invoked as a timeout task, or called manually (tc will
be NULL then).
*
@@ -1630,7 +393,7 @@
session = cls;
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "P%d: round over\n",
session->local_peer_idx);
- if ((NULL == tc) && (session->round_timeout_tid != GNUNET_SCHEDULER_NO_TASK))
+ if (session->round_timeout_tid != GNUNET_SCHEDULER_NO_TASK)
{
GNUNET_SCHEDULER_cancel (session->round_timeout_tid);
session->round_timeout_tid = GNUNET_SCHEDULER_NO_TASK;
@@ -1648,8 +411,8 @@
if (session->num_peers <= 2)
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "P%d: 2-peer consensus done\n",
session->local_peer_idx);
- GNUNET_CONTAINER_multihashmap_iterate (session->values,
send_client_elements_iter, session);
- send_client_conclude_done (session);
+ //GNUNET_CONTAINER_multihashmap_iterate (session->values,
send_client_elements_iter, session);
+ //send_client_conclude_done (session);
session->current_round = CONSENSUS_ROUND_FINISH;
return;
}
@@ -1663,7 +426,7 @@
break;
case CONSENSUS_ROUND_COMPLETION:
session->current_round = CONSENSUS_ROUND_FINISH;
- send_client_conclude_done (session);
+ //send_client_conclude_done (session);
break;
default:
GNUNET_assert (0);
@@ -1671,159 +434,9 @@
}
-static void
-fin_sent_cb (void *cls)
-{
- struct ConsensusPeerInformation *cpi;
- cpi = cls;
- GNUNET_log (GNUNET_ERROR_TYPE_INFO, "P%d: sent FIN\n",
cpi->session->local_peer_idx);
- switch (cpi->session->current_round)
- {
- case CONSENSUS_ROUND_EXCHANGE:
- case CONSENSUS_ROUND_COMPLETION:
- if (cpi->session->current_round != cpi->apparent_round)
- {
- GNUNET_log (GNUNET_ERROR_TYPE_INFO, "P%d: FIN to SYNC from the
past\n", cpi->session->local_peer_idx);
- break;
- }
- cpi->exp_subround_finished = GNUNET_YES;
- /* the subround is only really over if *both* partners are done */
- if (GNUNET_YES == exp_subround_finished (cpi->session))
- subround_over (cpi->session, NULL);
- else
- GNUNET_log (GNUNET_ERROR_TYPE_INFO, "P%d: still waiting for more after
FIN sent\n", cpi->session->local_peer_idx);
- break;
- case CONSENSUS_ROUND_INVENTORY:
- cpi->inventory_synced = GNUNET_YES;
- if (inventory_round_finished (cpi->session) &&
cpi->session->current_round == cpi->apparent_round)
- round_over (cpi->session, NULL);
- /* FIXME: maybe go to next round */
- break;
- default:
- GNUNET_break (0);
- }
-}
-
-
/**
- * The other peer wants us to inform that he sent us all the elements we
requested.
+ * Adapt the shuffle of the session for the current round.
*/
-static int
-handle_p2p_fin (struct ConsensusPeerInformation *cpi, const struct
GNUNET_MessageHeader *msg)
-{
- struct ConsensusRoundMessage *round_msg;
- round_msg = (struct ConsensusRoundMessage *) msg;
- /* FIXME: only call subround_over if round is the current one! */
- switch (cpi->session->current_round)
- {
- case CONSENSUS_ROUND_EXCHANGE:
- case CONSENSUS_ROUND_COMPLETION:
- if (cpi->session->current_round != round_msg->round)
- {
- GNUNET_log (GNUNET_ERROR_TYPE_INFO, "P%d: got FIN from P%d (past
round)\n", cpi->session->local_peer_idx, (int) (cpi - cpi->session->info));
- cpi->ibf_state = IBF_STATE_NONE;
- cpi->ibf_bucket_counter = 0;
- break;
- }
- GNUNET_log (GNUNET_ERROR_TYPE_INFO, "P%d: got FIN from P%d (exp)\n",
cpi->session->local_peer_idx, (int) (cpi - cpi->session->info));
- cpi->exp_subround_finished = GNUNET_YES;
- if (GNUNET_YES == exp_subround_finished (cpi->session))
- subround_over (cpi->session, NULL);
- else
- GNUNET_log (GNUNET_ERROR_TYPE_INFO, "P%d: still waiting for more after
got FIN\n", cpi->session->local_peer_idx);
- break;
- case CONSENSUS_ROUND_INVENTORY:
- cpi->inventory_synced = GNUNET_YES;
- GNUNET_log (GNUNET_ERROR_TYPE_INFO, "P%d: got FIN from P%d (a2a)\n",
cpi->session->local_peer_idx, (int) (cpi - cpi->session->info));
- if (inventory_round_finished (cpi->session))
- round_over (cpi->session, NULL);
- break;
- default:
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "unexpected FIN message the
current round\n");
- break;
- }
- return GNUNET_YES;
-}
-
-
-/**
- * Gets called when the other peer wants us to inform that
- * it has decoded our ibf and sent us all elements / requests
- */
-static int
-handle_p2p_synced (struct ConsensusPeerInformation *cpi, const struct
GNUNET_MessageHeader *msg)
-{
- struct PendingMessage *pm;
- struct ConsensusRoundMessage *fin_msg;
-
- /* FIXME: why handle current round?? */
- switch (cpi->session->current_round)
- {
- case CONSENSUS_ROUND_INVENTORY:
- cpi->inventory_synced = GNUNET_YES;
- case CONSENSUS_ROUND_COMPLETION:
- case CONSENSUS_ROUND_EXCHANGE:
- LOG_PP (GNUNET_ERROR_TYPE_INFO, cpi, "received SYNC\n");
- pm = new_pending_message (sizeof *fin_msg,
- GNUNET_MESSAGE_TYPE_CONSENSUS_P2P_FIN);
- fin_msg = (struct ConsensusRoundMessage *) pm->msg;
- fin_msg->round = cpi->apparent_round;
- /* the subround is over once we kicked off sending the fin msg */
- /* FIXME: assert we are talking to the right peer! */
- /* FIXME: mark peer as synced */
- pm->sent_cb = fin_sent_cb;
- pm->sent_cb_cls = cpi;
- message_queue_add (cpi->mss.mq, pm);
- break;
- default:
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "unexpected SYNCED message the
current round\n");
- break;
- }
- return GNUNET_YES;
-}
-
-
-/**
- * Functions with this signature are called whenever a
- * complete message is received by the tokenizer.
- *
- * Do not call GNUNET_SERVER_mst_destroy in callback
- *
- * @param cls closure
- * @param client identification of the client
- * @param message the actual message
- * @return GNUNET_OK on success, GNUNET_SYSERR to stop further processing
- */
-static int
-mst_session_callback (void *cls, void *client, const struct
GNUNET_MessageHeader *message)
-{
- struct ConsensusPeerInformation *cpi = cls;
- GNUNET_assert (NULL == client);
- GNUNET_assert (NULL != cls);
- switch (ntohs (message->type))
- {
- case GNUNET_MESSAGE_TYPE_CONSENSUS_P2P_DELTA_ESTIMATE:
- return handle_p2p_strata (cpi, (struct StrataMessage *) message);
- case GNUNET_MESSAGE_TYPE_CONSENSUS_P2P_DIFFERENCE_DIGEST:
- return handle_p2p_ibf (cpi, (struct DifferenceDigest *) message);
- case GNUNET_MESSAGE_TYPE_CONSENSUS_P2P_ELEMENTS:
- return handle_p2p_element (cpi, message);
- case GNUNET_MESSAGE_TYPE_CONSENSUS_P2P_ELEMENTS_REPORT:
- return handle_p2p_element_report (cpi, message);
- case GNUNET_MESSAGE_TYPE_CONSENSUS_P2P_ELEMENTS_REQUEST:
- return handle_p2p_element_request (cpi, (struct ElementRequest *)
message);
- case GNUNET_MESSAGE_TYPE_CONSENSUS_P2P_SYNCED:
- return handle_p2p_synced (cpi, message);
- case GNUNET_MESSAGE_TYPE_CONSENSUS_P2P_FIN:
- return handle_p2p_fin (cpi, message);
- default:
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "ignoring unexpected message type
(%u) from peer: %s\n",
- ntohs (message->type), GNUNET_h2s
(&cpi->peer_id.hashPubKey));
- }
- return GNUNET_OK;
-}
-
-
static void
shuffle (struct ConsensusSession *session)
{
@@ -1860,6 +473,7 @@
{
int mark[session->num_peers];
int i;
+
memset (mark, 0, session->num_peers * sizeof (int));
session->partner_incoming = session->partner_outgoing = NULL;
for (i = 0; i < session->num_peers; i++)
@@ -1887,6 +501,22 @@
/**
+ * Callback for set operation results. Called for each element
+ * in the result set.
+ *
+ * @param cls closure
+ * @param element a result element, only valid if status is
GNUNET_SET_STATUS_OK
+ * @param status see enum GNUNET_SET_Status
+ */
+static void set_result_cb (void *cls,
+ const struct GNUNET_SET_Element *element,
+ enum GNUNET_SET_Status status)
+{
+ /* FIXME */
+}
+
+
+/**
* Do the next subround in the exp-scheme.
* This function can be invoked as a timeout task, or called manually (tc will
be NULL then).
*
@@ -1905,9 +535,11 @@
return;
session = cls;
/* cancel timeout */
- if ((NULL == tc) && (session->round_timeout_tid != GNUNET_SCHEDULER_NO_TASK))
+ if (session->round_timeout_tid != GNUNET_SCHEDULER_NO_TASK)
+ {
GNUNET_SCHEDULER_cancel (session->round_timeout_tid);
- session->round_timeout_tid = GNUNET_SCHEDULER_NO_TASK;
+ session->round_timeout_tid = GNUNET_SCHEDULER_NO_TASK;
+ }
/* check if we are done with the log phase, 2-peer consensus only does one
log round */
if ( (session->exp_round == NUM_EXP_ROUNDS) ||
((session->num_peers == 2) && (session->exp_round == 1)))
@@ -1938,8 +570,25 @@
session->exp_subround++;
}
+ /* determine the incoming and outgoing partner */
find_partners (session);
+ if (NULL != session->partner_outgoing)
+ {
+ if (NULL != session->partner_outgoing->set_op)
+ GNUNET_SET_operation_cancel (session->partner_outgoing->set_op);
+ session->partner_outgoing->set_op =
+ GNUNET_SET_evaluate (session->element_set,
+ &session->partner_outgoing->peer_id,
+ &session->global_id,
+ NULL, /* FIXME */
+ 0, /* FIXME */
+ GNUNET_SET_RESULT_ADDED,
+ set_result_cb, session);
+
+
+ }
+
#ifdef GNUNET_EXTRA_LOGGING
{
int in;
@@ -1957,29 +606,6 @@
}
#endif /* GNUNET_EXTRA_LOGGING */
- if (NULL != session->partner_incoming)
- {
- session->partner_incoming->ibf_state = IBF_STATE_NONE;
- session->partner_incoming->exp_subround_finished = GNUNET_NO;
- session->partner_incoming->ibf_bucket_counter = 0;
-
- /* maybe there's an early strata estimator? */
- replay_premature_message (session->partner_incoming);
- }
-
- if (NULL != session->partner_outgoing)
- {
- session->partner_outgoing->ibf_state = IBF_STATE_NONE;
- session->partner_outgoing->ibf_bucket_counter = 0;
- session->partner_outgoing->exp_subround_finished = GNUNET_NO;
- /* make sure peer is connected and send the SE */
- embrace_peer (session->partner_outgoing);
- }
-
- /*
- session->round_timeout_tid = GNUNET_SCHEDULER_add_delayed
(GNUNET_TIME_relative_divide (session->conclude_timeout, 3 * NUM_EXP_ROUNDS),
-
subround_over, session);
- */
}
@@ -2002,146 +628,6 @@
/**
- * Handle a HELLO-message, send when another peer wants to join a session where
- * our peer is a member. The session may or may not be inhabited yet.
- */
-static int
-handle_p2p_hello (struct IncomingSocket *inc, const struct ConsensusHello
*hello)
-{
- struct ConsensusSession *session;
-
- if (NULL != inc->requested_gid)
- {
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "peer tried to HELLO uninhabited
session more than once, ignoring\n");
- return GNUNET_YES;
- }
- if (NULL != inc->cpi)
- {
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "peer with active session sent
HELLO again, ignoring\n");
- return GNUNET_YES;
- }
-
- for (session = sessions_head; NULL != session; session = session->next)
- {
- int idx;
- struct ConsensusPeerInformation *cpi;
- if (0 != GNUNET_CRYPTO_hash_cmp (&session->global_id, &hello->global_id))
- continue;
- idx = get_peer_idx (&inc->peer_id, session);
- GNUNET_assert (-1 != idx);
- GNUNET_log (GNUNET_ERROR_TYPE_INFO, "peer %d hello'ed session %d\n", idx);
- cpi = &session->info[idx];
- inc->cpi = cpi;
- cpi->mss = inc->mss;
- cpi = &session->info[idx];
- cpi->hello = GNUNET_YES;
- cpi->mss.mq = create_message_queue_for_stream_socket (&cpi->mss);
- embrace_peer (cpi);
- return GNUNET_YES;
- }
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "peer tried to HELLO uninhabited
session\n");
- inc->requested_gid = GNUNET_memdup (&hello->global_id, sizeof (struct
GNUNET_HashCode));
- return GNUNET_YES;
-}
-
-
-
-/**
- * Handle tokenized messages from stream sockets.
- * Delegate them if the socket belongs to a session,
- * handle hello messages otherwise.
- *
- * Do not call GNUNET_SERVER_mst_destroy in callback
- *
- * @param cls closure, unused
- * @param client incoming socket this message comes from
- * @param message the actual message
- *
- * @return GNUNET_OK on success, GNUNET_SYSERR to stop further processing
- */
-static int
-mst_incoming_callback (void *cls, void *client, const struct
GNUNET_MessageHeader *message)
-{
- struct IncomingSocket *inc;
- GNUNET_assert (NULL == client);
- GNUNET_assert (NULL != cls);
- inc = (struct IncomingSocket *) cls;
- switch (ntohs( message->type))
- {
- case GNUNET_MESSAGE_TYPE_CONSENSUS_P2P_HELLO:
- return handle_p2p_hello (inc, (struct ConsensusHello *) message);
- default:
- if (NULL != inc->cpi)
- return mst_session_callback (inc->cpi, client, message);
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "ignoring unexpected message type
(%u) from peer: %s (not in session)\n",
- ntohs (message->type), GNUNET_h2s
(&inc->peer_id.hashPubKey));
- }
- return GNUNET_OK;
-}
-
-
-/**
- * Functions of this type are called upon new stream connection from other
peers
- * or upon binding error which happen when the app_port given in
- * GNUNET_STREAM_listen() is already taken.
- *
- * @param cls the closure from GNUNET_STREAM_listen
- * @param socket the socket representing the stream; NULL on binding error
- * @param initiator the identity of the peer who wants to establish a stream
- * with us; NULL on binding error
- * @return GNUNET_OK to keep the socket open, GNUNET_SYSERR to close the
- * stream (the socket will be invalid after the call)
- */
-static int
-listen_cb (void *cls,
- struct GNUNET_STREAM_Socket *socket,
- const struct GNUNET_PeerIdentity *initiator)
-{
- struct IncomingSocket *incoming;
-
- if (NULL == socket)
- {
- GNUNET_break (0);
- return GNUNET_SYSERR;
- }
- incoming = GNUNET_malloc (sizeof *incoming);
- incoming->peer_id = *initiator;
- incoming->mss.socket = socket;
- incoming->mss.rh = GNUNET_STREAM_read (socket, GNUNET_TIME_UNIT_FOREVER_REL,
- &stream_data_processor, &incoming->mss);
- incoming->mss.mst = GNUNET_SERVER_mst_create (mst_incoming_callback,
incoming);
- incoming->mss.mst_cls = incoming;
- GNUNET_CONTAINER_DLL_insert_tail (incoming_sockets_head,
incoming_sockets_tail, incoming);
- return GNUNET_OK;
-}
-
-
-/**
- * Disconnect a client, and destroy all sessions associated with it.
- *
- * @param client the client to disconnect
- */
-static void
-disconnect_client (struct GNUNET_SERVER_Client *client)
-{
- struct ConsensusSession *session;
- GNUNET_SERVER_client_disconnect (client);
-
- /* if the client owns a session, remove it */
- session = sessions_head;
- while (NULL != session)
- {
- if (client == session->scss.client)
- {
- destroy_session (session);
- break;
- }
- session = session->next;
- }
-}
-
-
-/**
* Compute a global, (hopefully) unique consensus session id,
* from the local id of the consensus session, and the identities of all
participants.
* Thus, if the local id of two consensus sessions coincide, but are not
comprised of
@@ -2188,7 +674,8 @@
* add the local peer if not in the join message.
*/
static void
-initialize_session_peer_list (struct ConsensusSession *session)
+initialize_session_peer_list (struct ConsensusSession *session,
+ struct GNUNET_CONSENSUS_JoinMessage *join_msg)
{
unsigned int local_peer_in_list;
uint32_t listed_peers;
@@ -2196,19 +683,19 @@
struct GNUNET_PeerIdentity *peers;
unsigned int i;
- GNUNET_assert (NULL != session->join_msg);
+ GNUNET_assert (NULL != join_msg);
/* peers in the join message, may or may not include the local peer */
- listed_peers = ntohl (session->join_msg->num_peers);
+ listed_peers = ntohl (join_msg->num_peers);
session->num_peers = listed_peers;
- msg_peers = (struct GNUNET_PeerIdentity *) &session->join_msg[1];
+ msg_peers = (struct GNUNET_PeerIdentity *) &join_msg[1];
local_peer_in_list = GNUNET_NO;
for (i = 0; i < listed_peers; i++)
{
- if (0 == memcmp (&msg_peers[i], my_peer, sizeof (struct
GNUNET_PeerIdentity)))
+ if (0 == memcmp (&msg_peers[i], &my_peer, sizeof (struct
GNUNET_PeerIdentity)))
{
local_peer_in_list = GNUNET_YES;
break;
@@ -2221,7 +708,7 @@
peers = GNUNET_malloc (session->num_peers * sizeof (struct
GNUNET_PeerIdentity));
if (GNUNET_NO == local_peer_in_list)
- peers[session->num_peers - 1] = *my_peer;
+ peers[session->num_peers - 1] = my_peer;
memcpy (peers, msg_peers, listed_peers * sizeof (struct
GNUNET_PeerIdentity));
qsort (peers, session->num_peers, sizeof (struct GNUNET_PeerIdentity),
&hash_cmp);
@@ -2236,38 +723,34 @@
session->info[i].peer_id = peers[i];
}
- free (peers);
+ GNUNET_free (peers);
}
+
+
+
/**
- * Add incoming peer connections to the session,
- * for peers who have connected to us before the local session has been
established
+ * Called when another peer wants to do a set operation with the
+ * local peer.
*
- * @param session ...
+ * @param other_peer the other peer
+ * @param context_msg message with application specific information from
+ * the other peer
+ * @param request request from the other peer, use GNUNET_SET_accept
+ * to accept it, otherwise the request will be refused
+ * Note that we don't use a return value here, as it is also
+ * necessary to specify the set we want to do the operation with,
+ * whith sometimes can be derived from the context message.
+ * Also necessary to specify the timeout.
*/
static void
-add_incoming_peers (struct ConsensusSession *session)
+set_listen_cb (void *cls,
+ const struct GNUNET_PeerIdentity *other_peer,
+ const struct GNUNET_MessageHeader *context_msg,
+ struct GNUNET_SET_Request *request)
{
- struct IncomingSocket *inc;
- int i;
- struct ConsensusPeerInformation *cpi;
-
- for (inc = incoming_sockets_head; NULL != inc; inc = inc->next)
- {
- if ( (NULL == inc->requested_gid) ||
- (0 != GNUNET_CRYPTO_hash_cmp (&session->global_id,
inc->requested_gid)) )
- continue;
- for (i = 0; i < session->num_peers; i++)
- {
- cpi = &session->info[i];
- cpi->peer_id = inc->peer_id;
- cpi->mss = inc->mss;
- cpi->hello = GNUNET_YES;
- inc->cpi = cpi;
- break;
- }
- }
+ /* FIXME */
}
@@ -2277,46 +760,59 @@
* @param session the session to initialize
*/
static void
-initialize_session (struct ConsensusSession *session)
+initialize_session (struct ConsensusSession *session,
+ struct GNUNET_CONSENSUS_JoinMessage *join_msg)
{
struct ConsensusSession *other_session;
- GNUNET_assert (NULL != session->join_msg);
- initialize_session_peer_list (session);
+ initialize_session_peer_list (session, join_msg);
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "session with %u peers\n",
session->num_peers);
- compute_global_id (session, &session->join_msg->session_id);
+ compute_global_id (session, &join_msg->session_id);
- /* Check if some local client already owns the session. */
+ /* check if some local client already owns the session. */
other_session = sessions_head;
while (NULL != other_session)
{
if ((other_session != session) &&
(0 == GNUNET_CRYPTO_hash_cmp (&session->global_id,
&other_session->global_id)))
{
- if (GNUNET_NO == other_session->conclude)
+ if (CONSENSUS_ROUND_FINISH != other_session->current_round)
{
GNUNET_break (0);
destroy_session (session);
return;
}
- GNUNET_SERVER_client_drop (other_session->scss.client);
- other_session->scss.client = NULL;
break;
}
other_session = other_session->next;
}
- session->local_peer_idx = get_peer_idx (my_peer, session);
+ session->local_peer_idx = get_peer_idx (&my_peer, session);
GNUNET_assert (-1 != session->local_peer_idx);
+ session->set_listener = GNUNET_SET_listen (cfg, GNUNET_SET_OPERATION_UNION,
+ &session->global_id,
+ set_listen_cb, session);
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "%d is the local peer\n",
session->local_peer_idx);
- GNUNET_free (session->join_msg);
- session->join_msg = NULL;
- add_incoming_peers (session);
- GNUNET_SERVER_receive_done (session->scss.client, GNUNET_OK);
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "session %s initialized\n", GNUNET_h2s
(&session->global_id));
}
+static struct ConsensusSession *
+get_session_by_client (struct GNUNET_SERVER_Client *client)
+{
+ struct ConsensusSession *session;
+
+ session = sessions_head;
+ while (NULL != session)
+ {
+ if (session->client == client)
+ return session;
+ session = session->next;
+ }
+ return NULL;
+}
+
+
/**
* Called when a client wants to join a consensus session.
*
@@ -2331,45 +827,20 @@
{
struct ConsensusSession *session;
- // make sure the client has not already joined a session
- session = sessions_head;
- while (NULL != session)
+ session = get_session_by_client (client);
+ if (NULL != session)
{
- if (session->scss.client == client)
- {
- GNUNET_break (0);
- disconnect_client (client);
- return;
- }
- session = session->next;
+ GNUNET_break (0);
+ GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
+ return;
}
-
session = GNUNET_new (struct ConsensusSession);
- session->join_msg = (struct GNUNET_CONSENSUS_JoinMessage *)
GNUNET_copy_message (m);
- /* these have to be initialized here, as the client can already start to
give us values */
- session->ibfs = GNUNET_malloc ((MAX_IBF_ORDER+1) * sizeof (struct
InvertibleBloomFilter *));
- session->values = GNUNET_CONTAINER_multihashmap_create (256, GNUNET_NO);
- session->ibf_key_map = GNUNET_CONTAINER_multihashmap_create (256, GNUNET_NO);
- session->se = strata_estimator_create (SE_STRATA_COUNT, SE_IBF_SIZE,
SE_IBF_HASH_NUM);
- session->scss.client = client;
- session->client_mq = create_message_queue_for_server_client (&session->scss);
GNUNET_SERVER_client_keep (client);
-
GNUNET_CONTAINER_DLL_insert (sessions_head, sessions_tail, session);
-
- // Initialize session later if local peer identity is not known yet.
- if (NULL == my_peer)
- {
- GNUNET_SERVER_disable_receive_done_warning (client);
- return;
- }
-
- initialize_session (session);
+ initialize_session (session, (struct GNUNET_CONSENSUS_JoinMessage *) m);
}
-
-
/**
* Called when a client performs an insert operation.
*
@@ -2379,38 +850,48 @@
*/
void
client_insert (void *cls,
- struct GNUNET_SERVER_Client *client,
- const struct GNUNET_MessageHeader *m)
+ struct GNUNET_SERVER_Client *client,
+ const struct GNUNET_MessageHeader *m)
{
struct ConsensusSession *session;
struct GNUNET_CONSENSUS_ElementMessage *msg;
- struct GNUNET_CONSENSUS_Element *element;
- int element_size;
+ struct GNUNET_SET_Element *element;
+ ssize_t element_size;
session = sessions_head;
while (NULL != session)
{
- if (session->scss.client == client)
+ if (session->client == client)
break;
}
if (NULL == session)
{
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "client tried to insert, but client
is not in any session\n");
+ GNUNET_break (0);
GNUNET_SERVER_client_disconnect (client);
return;
}
+ if (CONSENSUS_ROUND_BEGIN != session->current_round)
+ {
+ GNUNET_break (0);
+ GNUNET_SERVER_client_disconnect (client);
+ return;
+ }
+
msg = (struct GNUNET_CONSENSUS_ElementMessage *) m;
- element_size = ntohs (msg->header.size )- sizeof (struct
GNUNET_CONSENSUS_ElementMessage);
- element = GNUNET_malloc (sizeof (struct GNUNET_CONSENSUS_Element) +
element_size);
+ element_size = ntohs (msg->header.size) - sizeof (struct
GNUNET_CONSENSUS_ElementMessage);
+ if (element_size < 0)
+ {
+ GNUNET_break (0);
+ return;
+ }
+ element = GNUNET_malloc (sizeof (struct GNUNET_SET_Element) + element_size);
element->type = msg->element_type;
element->size = element_size;
memcpy (&element[1], &msg[1], element_size);
element->data = &element[1];
- GNUNET_assert (NULL != element->data);
- insert_element (session, element);
-
+ GNUNET_SET_add_element (session->element_set, element, NULL, NULL);
GNUNET_SERVER_receive_done (client, GNUNET_OK);
}
@@ -2432,9 +913,8 @@
cmsg = (struct GNUNET_CONSENSUS_ConcludeMessage *) message;
- session = sessions_head;
- while ((session != NULL) && (session->scss.client != client))
- session = session->next;
+ session = get_session_by_client (client);
+
if (NULL == session)
{
/* client not found */
@@ -2447,16 +927,12 @@
{
/* client requested conclude twice */
GNUNET_break (0);
- /* client may still own a session, destroy it */
- disconnect_client (client);
return;
}
- session->conclude = GNUNET_YES;
-
if (session->num_peers <= 1)
{
- send_client_conclude_done (session);
+ //send_client_conclude_done (session);
}
else
{
@@ -2465,48 +941,12 @@
round_over (session, NULL);
}
+ GNUNET_assert (CONSENSUS_ROUND_BEGIN != session->current_round);
GNUNET_SERVER_receive_done (client, GNUNET_OK);
}
/**
- * Task that disconnects from core.
- *
- * @param cls core handle
- * @param tc context information (why was this task triggered now)
- */
-static void
-disconnect_core (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
-{
- if (core != NULL)
- {
- GNUNET_CORE_disconnect (core);
- core = NULL;
- }
- GNUNET_log (GNUNET_ERROR_TYPE_INFO, "disconnected from core\n");
-}
-
-
-static void
-core_startup (void *cls,
- struct GNUNET_CORE_Handle *core,
- const struct GNUNET_PeerIdentity *peer)
-{
- struct ConsensusSession *session;
-
- my_peer = GNUNET_memdup(peer, sizeof (struct GNUNET_PeerIdentity));
- /* core can't be disconnected directly in the core startup callback,
schedule a task to do it! */
- GNUNET_SCHEDULER_add_now (&disconnect_core, core);
- GNUNET_log(GNUNET_ERROR_TYPE_INFO, "connected to core\n");
- /* initialize sessions that are waiting for the local peer identity */
- for (session = sessions_head; NULL != session; session = session->next)
- if (NULL != session->join_msg)
- initialize_session (session);
-}
-
-
-/**
* Called to clean up, after a shutdown has been requested.
*
* @param cls closure
@@ -2516,36 +956,9 @@
shutdown_task (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- while (NULL != incoming_sockets_head)
- {
- struct IncomingSocket *socket;
- socket = incoming_sockets_head;
- if (NULL == socket->cpi)
- clear_message_stream_state (&socket->mss);
- incoming_sockets_head = incoming_sockets_head->next;
- GNUNET_free (socket);
- }
-
while (NULL != sessions_head)
- {
- struct ConsensusSession *session;
- session = sessions_head->next;
destroy_session (sessions_head);
- sessions_head = session;
- }
- if (NULL != core)
- {
- GNUNET_CORE_disconnect (core);
- core = NULL;
- }
-
- if (NULL != listener)
- {
- GNUNET_STREAM_listen_close (listener);
- listener = NULL;
- }
-
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "handled shutdown request\n");
}
@@ -2560,10 +973,6 @@
static void
run (void *cls, struct GNUNET_SERVER_Handle *server, const struct
GNUNET_CONFIGURATION_Handle *c)
{
- /* core is only used to retrieve the peer identity */
- static const struct GNUNET_CORE_MessageHandler core_handlers[] = {
- {NULL, 0, 0}
- };
static const struct GNUNET_SERVER_MessageHandler server_handlers[] = {
{&client_join, NULL, GNUNET_MESSAGE_TYPE_CONSENSUS_CLIENT_JOIN, 0},
{&client_insert, NULL, GNUNET_MESSAGE_TYPE_CONSENSUS_CLIENT_INSERT, 0},
@@ -2574,21 +983,15 @@
cfg = c;
srv = server;
-
+ if (GNUNET_OK != GNUNET_CRYPTO_get_host_identity (cfg, &my_peer))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "could not retrieve host identity\n");
+ GNUNET_break (0);
+ GNUNET_SCHEDULER_shutdown ();
+ return;
+ }
GNUNET_SERVER_add_handlers (server, server_handlers);
-
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task,
NULL);
-
- listener = GNUNET_STREAM_listen (cfg, GNUNET_APPLICATION_TYPE_CONSENSUS,
- &listen_cb, NULL,
- GNUNET_STREAM_OPTION_END);
-
- /* we have to wait for the core_startup callback before proceeding with the
consensus service startup */
- core = GNUNET_CORE_connect (c, NULL,
- &core_startup, NULL,
- NULL, NULL, GNUNET_NO, NULL,
- GNUNET_NO, core_handlers);
- GNUNET_assert (NULL != core);
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "consensus running\n");
}
Deleted: gnunet/src/consensus/ibf.c
===================================================================
--- gnunet/src/consensus/ibf.c 2013-05-22 10:27:24 UTC (rev 27250)
+++ gnunet/src/consensus/ibf.c 2013-05-22 10:29:15 UTC (rev 27251)
@@ -1,357 +0,0 @@
-/*
- This file is part of GNUnet
- (C) 2012 Christian Grothoff (and other contributing authors)
-
- GNUnet is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 2, or (at your
- option) any later version.
-
- GNUnet is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GNUnet; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
-*/
-
-/**
- * @file consensus/ibf.c
- * @brief implementation of the invertible bloom filter
- * @author Florian Dold
- */
-
-#include "ibf.h"
-
-/**
- * Create a key from a hashcode.
- *
- * @param hash the hashcode
- * @return a key
- */
-struct IBF_Key
-ibf_key_from_hashcode (const struct GNUNET_HashCode *hash)
-{
- /* FIXME: endianess */
- return *(struct IBF_Key *) hash;
-}
-
-/**
- * Create a hashcode from a key, by replicating the key
- * until the hascode is filled
- *
- * @param key the key
- * @param dst hashcode to store the result in
- */
-void
-ibf_hashcode_from_key (struct IBF_Key key, struct GNUNET_HashCode *dst)
-{
- struct IBF_Key *p;
- unsigned int i;
- const unsigned int keys_per_hashcode = sizeof (struct GNUNET_HashCode) /
sizeof (struct IBF_Key);
- p = (struct IBF_Key *) dst;
- for (i = 0; i < keys_per_hashcode; i++)
- *p++ = key;
-}
-
-
-/**
- * Create an invertible bloom filter.
- *
- * @param size number of IBF buckets
- * @param hash_num number of buckets one element is hashed in
- * @return the newly created invertible bloom filter
- */
-struct InvertibleBloomFilter *
-ibf_create (uint32_t size, uint8_t hash_num)
-{
- struct InvertibleBloomFilter *ibf;
-
- /* TODO: use malloc_large */
-
- ibf = GNUNET_malloc (sizeof (struct InvertibleBloomFilter));
- ibf->count = GNUNET_malloc (size * sizeof (uint8_t));
- ibf->key_sum = GNUNET_malloc (size * sizeof (struct GNUNET_HashCode));
- ibf->key_hash_sum = GNUNET_malloc (size * sizeof (struct GNUNET_HashCode));
- ibf->size = size;
- ibf->hash_num = hash_num;
-
- return ibf;
-}
-
-/**
- * Store unique bucket indices for the specified key in dst.
- */
-static inline void
-ibf_get_indices (const struct InvertibleBloomFilter *ibf,
- struct IBF_Key key, int *dst)
-{
- struct GNUNET_HashCode bucket_indices;
- unsigned int filled;
- int i;
- GNUNET_CRYPTO_hash (&key, sizeof key, &bucket_indices);
- filled = 0;
- for (i = 0; filled < ibf->hash_num; i++)
- {
- unsigned int bucket;
- unsigned int j;
- if ( (0 != i) && (0 == (i % 16)) )
- GNUNET_CRYPTO_hash (&bucket_indices, sizeof (struct GNUNET_HashCode),
&bucket_indices);
- bucket = bucket_indices.bits[i % 16] % ibf->size;
- for (j = 0; j < filled; j++)
- if (dst[j] == bucket)
- goto try_next;
- dst[filled++] = bucket;
- try_next: ;
- }
-}
-
-
-static void
-ibf_insert_into (struct InvertibleBloomFilter *ibf,
- struct IBF_Key key,
- const int *buckets, int side)
-{
- int i;
- struct GNUNET_HashCode key_hash_sha;
- struct IBF_KeyHash key_hash;
- GNUNET_CRYPTO_hash (&key, sizeof key, &key_hash_sha);
- key_hash.key_hash_val = key_hash_sha.bits[0];
- for (i = 0; i < ibf->hash_num; i++)
- {
- const int bucket = buckets[i];
- ibf->count[bucket].count_val += side;
- ibf->key_sum[bucket].key_val ^= key.key_val;
- ibf->key_hash_sum[bucket].key_hash_val ^= key_hash.key_hash_val;
- }
-}
-
-
-/**
- * Insert an element into an IBF.
- *
- * @param ibf the IBF
- * @param key the element's hash code
- */
-void
-ibf_insert (struct InvertibleBloomFilter *ibf, struct IBF_Key key)
-{
- int buckets[ibf->hash_num];
- GNUNET_assert (ibf->hash_num <= ibf->size);
- ibf_get_indices (ibf, key, buckets);
- ibf_insert_into (ibf, key, buckets, 1);
-}
-
-/**
- * Test is the IBF is empty, i.e. all counts, keys and key hashes are zero.
- */
-static int
-ibf_is_empty (struct InvertibleBloomFilter *ibf)
-{
- int i;
- for (i = 0; i < ibf->size; i++)
- {
- if (0 != ibf->count[i].count_val)
- return GNUNET_NO;
- if (0 != ibf->key_hash_sum[i].key_hash_val)
- return GNUNET_NO;
- if (0 != ibf->key_sum[i].key_val)
- return GNUNET_NO;
- }
- return GNUNET_YES;
-}
-
-
-/**
- * Decode and remove an element from the IBF, if possible.
- *
- * @param ibf the invertible bloom filter to decode
- * @param ret_side sign of the cell's count where the decoded element came
from.
- * A negative sign indicates that the element was recovered
- * resides in an IBF that was previously subtracted from.
- * @param ret_id receives the hash code of the decoded element, if successful
- * @return GNUNET_YES if decoding an element was successful,
- * GNUNET_NO if the IBF is empty,
- * GNUNET_SYSERR if the decoding has failed
- */
-int
-ibf_decode (struct InvertibleBloomFilter *ibf,
- int *ret_side, struct IBF_Key *ret_id)
-{
- struct IBF_KeyHash hash;
- int i;
- struct GNUNET_HashCode key_hash_sha;
- int buckets[ibf->hash_num];
-
- GNUNET_assert (NULL != ibf);
-
- for (i = 0; i < ibf->size; i++)
- {
- int j;
- int hit;
-
- /* we can only decode from pure buckets */
- if ((1 != ibf->count[i].count_val) && (-1 != ibf->count[i].count_val))
- continue;
-
- GNUNET_CRYPTO_hash (&ibf->key_sum[i], sizeof (struct IBF_Key),
&key_hash_sha);
- hash.key_hash_val = key_hash_sha.bits[0];
-
- /* test if the hash matches the key */
- if (hash.key_hash_val != ibf->key_hash_sum[i].key_hash_val)
- continue;
-
- /* test if key in bucket hits its own location,
- * if not, the key hash was subject to collision */
- hit = GNUNET_NO;
- ibf_get_indices (ibf, ibf->key_sum[i], buckets);
- for (j = 0; j < ibf->hash_num; j++)
- if (buckets[j] == i)
- hit = GNUNET_YES;
-
- if (GNUNET_NO == hit)
- continue;
-
- if (NULL != ret_side)
- *ret_side = ibf->count[i].count_val;
- if (NULL != ret_id)
- *ret_id = ibf->key_sum[i];
-
- /* insert on the opposite side, effectively removing the element */
- ibf_insert_into (ibf, ibf->key_sum[i], buckets, -ibf->count[i].count_val);
-
- return GNUNET_YES;
- }
-
- if (GNUNET_YES == ibf_is_empty (ibf))
- return GNUNET_NO;
- return GNUNET_SYSERR;
-}
-
-
-/**
- * Write buckets from an ibf to a buffer.
- * Exactly (IBF_BUCKET_SIZE*ibf->size) bytes are written to buf.
- *
- * @param ibf the ibf to write
- * @param start with which bucket to start
- * @param count how many buckets to write
- * @param buf buffer to write the data to
- */
-void
-ibf_write_slice (const struct InvertibleBloomFilter *ibf, uint32_t start,
uint32_t count, void *buf)
-{
- struct IBF_Key *key_dst;
- struct IBF_KeyHash *key_hash_dst;
- struct IBF_Count *count_dst;
-
- GNUNET_assert (start + count <= ibf->size);
-
- /* copy keys */
- key_dst = (struct IBF_Key *) buf;
- memcpy (key_dst, ibf->key_sum + start, count * sizeof *key_dst);
- key_dst += count;
- /* copy key hashes */
- key_hash_dst = (struct IBF_KeyHash *) key_dst;
- memcpy (key_hash_dst, ibf->key_hash_sum + start, count * sizeof
*key_hash_dst);
- key_hash_dst += count;
- /* copy counts */
- count_dst = (struct IBF_Count *) key_hash_dst;
- memcpy (count_dst, ibf->count + start, count * sizeof *count_dst);
- count_dst += count;
-}
-
-
-/**
- * Read buckets from a buffer into an ibf.
- *
- * @param buf pointer to the buffer to read from
- * @param start which bucket to start at
- * @param count how many buckets to read
- * @param ibf the ibf to read from
- */
-void
-ibf_read_slice (const void *buf, uint32_t start, uint32_t count, struct
InvertibleBloomFilter *ibf)
-{
- struct IBF_Key *key_src;
- struct IBF_KeyHash *key_hash_src;
- struct IBF_Count *count_src;
-
- GNUNET_assert (start + count <= ibf->size);
-
- /* copy keys */
- key_src = (struct IBF_Key *) buf;
- memcpy (ibf->key_sum + start, key_src, count * sizeof *key_src);
- key_src += count;
- /* copy key hashes */
- key_hash_src = (struct IBF_KeyHash *) key_src;
- memcpy (ibf->key_hash_sum + start, key_hash_src, count * sizeof
*key_hash_src);
- key_hash_src += count;
- /* copy counts */
- count_src = (struct IBF_Count *) key_hash_src;
- memcpy (ibf->count + start, count_src, count * sizeof *count_src);
- count_src += count;
-}
-
-
-/**
- * Subtract ibf2 from ibf1, storing the result in ibf1.
- * The two IBF's must have the same parameters size and hash_num.
- *
- * @param ibf1 IBF that is subtracted from
- * @param ibf2 IBF that will be subtracted from ibf1
- */
-void
-ibf_subtract (struct InvertibleBloomFilter *ibf1, const struct
InvertibleBloomFilter *ibf2)
-{
- int i;
-
- GNUNET_assert (ibf1->size == ibf2->size);
- GNUNET_assert (ibf1->hash_num == ibf2->hash_num);
-
- for (i = 0; i < ibf1->size; i++)
- {
- ibf1->count[i].count_val -= ibf2->count[i].count_val;
- ibf1->key_hash_sum[i].key_hash_val ^= ibf2->key_hash_sum[i].key_hash_val;
- ibf1->key_sum[i].key_val ^= ibf2->key_sum[i].key_val;
- }
-}
-
-
-/**
- * Create a copy of an IBF, the copy has to be destroyed properly.
- *
- * @param ibf the IBF to copy
- */
-struct InvertibleBloomFilter *
-ibf_dup (const struct InvertibleBloomFilter *ibf)
-{
- struct InvertibleBloomFilter *copy;
- copy = GNUNET_malloc (sizeof *copy);
- copy->hash_num = ibf->hash_num;
- copy->size = ibf->size;
- copy->key_hash_sum = GNUNET_memdup (ibf->key_hash_sum, ibf->size * sizeof
(struct IBF_KeyHash));
- copy->key_sum = GNUNET_memdup (ibf->key_sum, ibf->size * sizeof (struct
IBF_Key));
- copy->count = GNUNET_memdup (ibf->count, ibf->size * sizeof (struct
IBF_Count));
- return copy;
-}
-
-
-/**
- * Destroy all resources associated with the invertible bloom filter.
- * No more ibf_*-functions may be called on ibf after calling destroy.
- *
- * @param ibf the intertible bloom filter to destroy
- */
-void
-ibf_destroy (struct InvertibleBloomFilter *ibf)
-{
- GNUNET_free (ibf->key_sum);
- GNUNET_free (ibf->key_hash_sum);
- GNUNET_free (ibf->count);
- GNUNET_free (ibf);
-}
-
Deleted: gnunet/src/consensus/ibf.h
===================================================================
--- gnunet/src/consensus/ibf.h 2013-05-22 10:27:24 UTC (rev 27250)
+++ gnunet/src/consensus/ibf.h 2013-05-22 10:29:15 UTC (rev 27251)
@@ -1,224 +0,0 @@
-/*
- This file is part of GNUnet
- (C) 2012 Christian Grothoff (and other contributing authors)
-
- GNUnet is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 2, or (at your
- option) any later version.
-
- GNUnet is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GNUnet; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
-*/
-
-/**
- * @file consensus/ibf.h
- * @brief invertible bloom filter
- * @author Florian Dold
- */
-
-#ifndef GNUNET_CONSENSUS_IBF_H
-#define GNUNET_CONSENSUS_IBF_H
-
-#include "platform.h"
-#include "gnunet_common.h"
-#include "gnunet_util_lib.h"
-
-#ifdef __cplusplus
-extern "C"
-{
-#if 0 /* keep Emacsens' auto-indent happy */
-}
-#endif
-#endif
-
-
-struct IBF_Key
-{
- uint64_t key_val;
-};
-
-struct IBF_KeyHash
-{
- uint32_t key_hash_val;
-};
-
-struct IBF_Count
-{
- int8_t count_val;
-};
-
-/**
- * Size of one ibf bucket in bytes
- */
-#define IBF_BUCKET_SIZE (sizeof (struct IBF_Count) + sizeof (struct IBF_Key) +
\
- sizeof (struct IBF_KeyHash))
-
-/**
- * Invertible bloom filter (IBF).
- *
- * An IBF is a counting bloom filter that has the ability to restore
- * the hashes of its stored elements with high probability.
- */
-struct InvertibleBloomFilter
-{
- /**
- * How many cells does this IBF have?
- */
- uint32_t size;
-
- /**
- * In how many cells do we hash one element?
- * Usually 4 or 3.
- */
- uint8_t hash_num;
-
- /**
- * Xor sums of the elements' keys, used to identify the elements.
- * Array of 'size' elements.
- */
- struct IBF_Key *key_sum;
-
- /**
- * Xor sums of the hashes of the keys of inserted elements.
- * Array of 'size' elements.
- */
- struct IBF_KeyHash *key_hash_sum;
-
- /**
- * How many times has a bucket been hit?
- * Can be negative, as a result of IBF subtraction.
- * Array of 'size' elements.
- */
- struct IBF_Count *count;
-};
-
-
-/**
- * Write buckets from an ibf to a buffer.
- * Exactly (IBF_BUCKET_SIZE*ibf->size) bytes are written to buf.
- *
- * @param ibf the ibf to write
- * @param start with which bucket to start
- * @param count how many buckets to write
- * @param buf buffer to write the data to
- */
-void
-ibf_write_slice (const struct InvertibleBloomFilter *ibf, uint32_t start,
uint32_t count, void *buf);
-
-
-/**
- * Read buckets from a buffer into an ibf.
- *
- * @param buf pointer to the buffer to read from
- * @param start which bucket to start at
- * @param count how many buckets to read
- * @param ibf the ibf to read from
- */
-void
-ibf_read_slice (const void *buf, uint32_t start, uint32_t count, struct
InvertibleBloomFilter *ibf);
-
-
-/**
- * Create a key from a hashcode.
- *
- * @param hash the hashcode
- * @return a key
- */
-struct IBF_Key
-ibf_key_from_hashcode (const struct GNUNET_HashCode *hash);
-
-
-/**
- * Create a hashcode from a key, by replicating the key
- * until the hascode is filled
- *
- * @param key the key
- * @param dst hashcode to store the result in
- */
-void
-ibf_hashcode_from_key (struct IBF_Key key, struct GNUNET_HashCode *dst);
-
-
-/**
- * Create an invertible bloom filter.
- *
- * @param size number of IBF buckets
- * @param hash_num number of buckets one element is hashed in, usually 3 or 4
- * @return the newly created invertible bloom filter
- */
-struct InvertibleBloomFilter *
-ibf_create (uint32_t size, uint8_t hash_num);
-
-
-/**
- * Insert an element into an IBF.
- *
- * @param ibf the IBF
- * @param key the element's hash code
- */
-void
-ibf_insert (struct InvertibleBloomFilter *ibf, struct IBF_Key key);
-
-
-/**
- * Subtract ibf2 from ibf1, storing the result in ibf1.
- * The two IBF's must have the same parameters size and hash_num.
- *
- * @param ibf1 IBF that is subtracted from
- * @param ibf2 IBF that will be subtracted from ibf1
- */
-void
-ibf_subtract (struct InvertibleBloomFilter *ibf1, const struct
InvertibleBloomFilter *ibf2);
-
-
-/**
- * Decode and remove an element from the IBF, if possible.
- *
- * @param ibf the invertible bloom filter to decode
- * @param ret_side sign of the cell's count where the decoded element came
from.
- * A negative sign indicates that the element was recovered
- * resides in an IBF that was previously subtracted from.
- * @param ret_id receives the hash code of the decoded element, if successful
- * @return GNUNET_YES if decoding an element was successful,
- * GNUNET_NO if the IBF is empty,
- * GNUNET_SYSERR if the decoding has failed
- */
-int
-ibf_decode (struct InvertibleBloomFilter *ibf, int *ret_side, struct IBF_Key
*ret_id);
-
-
-/**
- * Create a copy of an IBF, the copy has to be destroyed properly.
- *
- * @param ibf the IBF to copy
- */
-struct InvertibleBloomFilter *
-ibf_dup (const struct InvertibleBloomFilter *ibf);
-
-/**
- * Destroy all resources associated with the invertible bloom filter.
- * No more ibf_*-functions may be called on ibf after calling destroy.
- *
- * @param ibf the intertible bloom filter to destroy
- */
-void
-ibf_destroy (struct InvertibleBloomFilter *ibf);
-
-
-#if 0 /* keep Emacsens' auto-indent happy */
-{
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
Deleted: gnunet/src/consensus/strata_estimator.c
===================================================================
--- gnunet/src/consensus/strata_estimator.c 2013-05-22 10:27:24 UTC (rev
27250)
+++ gnunet/src/consensus/strata_estimator.c 2013-05-22 10:29:15 UTC (rev
27251)
@@ -1,145 +0,0 @@
-/*
- This file is part of GNUnet
- (C) 2012 Christian Grothoff (and other contributing authors)
-
- GNUnet is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 2, or (at your
- option) any later version.
-
- GNUnet is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GNUnet; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
-*/
-
-/**
- * @file consensus/ibf.h
- * @brief invertible bloom filter
- * @author Florian Dold
- */
-
-#include "platform.h"
-#include "gnunet_common.h"
-#include "ibf.h"
-#include "strata_estimator.h"
-
-void
-strata_estimator_write (const struct StrataEstimator *se, void *buf)
-{
- int i;
- for (i = 0; i < se->strata_count; i++)
- {
- ibf_write_slice (se->strata[i], 0, se->ibf_size, buf);
- buf += se->ibf_size * IBF_BUCKET_SIZE;
- }
-}
-
-void
-strata_estimator_read (const void *buf, struct StrataEstimator *se)
-{
- int i;
- for (i = 0; i < se->strata_count; i++)
- {
- ibf_read_slice (buf, 0, se->ibf_size, se->strata[i]);
- buf += se->ibf_size * IBF_BUCKET_SIZE;
- }
-}
-
-
-void
-strata_estimator_insert (struct StrataEstimator *se, struct GNUNET_HashCode
*key)
-{
- uint32_t v;
- int i;
- v = key->bits[0];
- /* count trailing '1'-bits of v */
- for (i = 0; v & 1; v>>=1, i++)
- /* empty */;
- ibf_insert (se->strata[i], ibf_key_from_hashcode (key));
-}
-
-
-
-struct StrataEstimator *
-strata_estimator_create (unsigned int strata_count, uint32_t ibf_size, uint8_t
ibf_hashnum)
-{
- struct StrataEstimator *se;
- int i;
-
- /* fixme: allocate everything in one chunk */
-
- se = GNUNET_malloc (sizeof (struct StrataEstimator));
- se->strata_count = strata_count;
- se->ibf_size = ibf_size;
- se->strata = GNUNET_malloc (sizeof (struct InvertibleBloomFilter *) *
strata_count);
- for (i = 0; i < strata_count; i++)
- se->strata[i] = ibf_create (ibf_size, ibf_hashnum);
- return se;
-}
-
-
-/**
- * Estimate set difference with two strata estimators,
- * i.e. arrays of IBFs.
- * Does not not modify its arguments.
- *
- * @param se1 first strata estimator
- * @param se2 second strata estimator
- * @return the estimated difference
- */
-unsigned int
-strata_estimator_difference (const struct StrataEstimator *se1,
- const struct StrataEstimator *se2)
-{
- int i;
- int count;
-
- GNUNET_assert (se1->strata_count == se2->strata_count);
- count = 0;
- for (i = se1->strata_count - 1; i >= 0; i--)
- {
- struct InvertibleBloomFilter *diff;
- /* number of keys decoded from the ibf */
- int ibf_count;
- int more;
- ibf_count = 0;
- /* FIXME: implement this without always allocating new IBFs */
- diff = ibf_dup (se1->strata[i]);
- ibf_subtract (diff, se2->strata[i]);
- for (;;)
- {
- more = ibf_decode (diff, NULL, NULL);
- if (GNUNET_NO == more)
- {
- count += ibf_count;
- break;
- }
- if (GNUNET_SYSERR == more)
- {
- ibf_destroy (diff);
- return count * (1 << (i + 1));
- }
- ibf_count++;
- }
- ibf_destroy (diff);
- }
- return count;
-}
-
-
-void
-strata_estimator_destroy (struct StrataEstimator *se)
-{
- int i;
- for (i = 0; i < se->strata_count; i++)
- ibf_destroy (se->strata[i]);
- GNUNET_free (se->strata);
- GNUNET_free (se);
-}
-
Deleted: gnunet/src/consensus/strata_estimator.h
===================================================================
--- gnunet/src/consensus/strata_estimator.h 2013-05-22 10:27:24 UTC (rev
27250)
+++ gnunet/src/consensus/strata_estimator.h 2013-05-22 10:29:15 UTC (rev
27251)
@@ -1,84 +0,0 @@
-/*
- This file is part of GNUnet
- (C) 2012 Christian Grothoff (and other contributing authors)
-
- GNUnet is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 2, or (at your
- option) any later version.
-
- GNUnet is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GNUnet; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
-*/
-
-/**
- * @file consensus/strata_estimator.h
- * @brief estimator of set difference
- * @author Florian Dold
- */
-
-#ifndef GNUNET_CONSENSUS_STRATA_ESTIMATOR_H
-#define GNUNET_CONSENSUS_STRATA_ESTIMATOR_H
-
-#include "platform.h"
-#include "gnunet_common.h"
-#include "gnunet_util_lib.h"
-
-#ifdef __cplusplus
-extern "C"
-{
-#if 0 /* keep Emacsens' auto-indent happy */
-}
-#endif
-#endif
-
-
-struct StrataEstimator
-{
- struct InvertibleBloomFilter **strata;
- unsigned int strata_count;
- unsigned int ibf_size;
-};
-
-
-void
-strata_estimator_write (const struct StrataEstimator *se, void *buf);
-
-
-void
-strata_estimator_read (const void *buf, struct StrataEstimator *se);
-
-
-struct StrataEstimator *
-strata_estimator_create (unsigned int strata_count, uint32_t ibf_size, uint8_t
ibf_hashnum);
-
-
-unsigned int
-strata_estimator_difference (const struct StrataEstimator *se1,
- const struct StrataEstimator *se2);
-
-
-void
-strata_estimator_insert (struct StrataEstimator *se, struct GNUNET_HashCode
*key);
-
-
-void
-strata_estimator_destroy (struct StrataEstimator *se);
-
-
-#if 0 /* keep Emacsens' auto-indent happy */
-{
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
Added: gnunet/src/include/gnunet_mq_lib.h
===================================================================
--- gnunet/src/include/gnunet_mq_lib.h (rev 0)
+++ gnunet/src/include/gnunet_mq_lib.h 2013-05-22 10:29:15 UTC (rev 27251)
@@ -0,0 +1,478 @@
+/*
+ This file is part of GNUnet.
+ (C) 2012 Christian Grothoff (and other contributing authors)
+
+ GNUnet is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 2, or (at your
+ option) any later version.
+
+ GNUnet is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNUnet; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+/**
+ * @author Florian Dold
+ * @file set/mq.h
+ * @brief general purpose request queue
+ */
+#ifndef GNUNET_MQ_H
+#define GNUNET_MQ_H
+
+#include "gnunet_common.h"
+
+
+/**
+ * Allocate a GNUNET_MQ_Message, with extra space allocated after the space
needed
+ * by the message struct.
+ * The allocated message will already have the type and size field set.
+ *
+ * @param mvar variable to store the allocated message in;
+ * must have a header field
+ * @param esize extra space to allocate after the message
+ * @param type type of the message
+ * @return the MQ message
+ */
+#define GNUNET_MQ_msg_extra(mvar, esize, type)
GNUNET_MQ_msg_((((void)(mvar)->header), (struct GNUNET_MessageHeader**)
&(mvar)), (esize) + sizeof *(mvar), (type))
+
+/**
+ * Allocate a GNUNET_MQ_Message.
+ * The allocated message will already have the type and size field set.
+ *
+ * @param mvar variable to store the allocated message in;
+ * must have a header field
+ * @param type type of the message
+ * @return the MQ message
+ */
+#define GNUNET_MQ_msg(mvar, type) GNUNET_MQ_msg_extra(mvar, 0, type)
+
+/**
+ * Append data to the end of an existing MQ message.
+ * If the operation is successful, mqm is changed to point to the new MQ
message,
+ * and GNUNET_OK is returned.
+ * On failure, GNUNET_SYSERR is returned, and the pointer mqm is not changed,
+ * the user of this API must take care of disposing the already allocated
message
+ * (either by sending it, or by using GNUNET_MQ_discard)
+ *
+ * @param mqm MQ message to augment with additional data
+ * @param src source buffer for the additional data
+ * @param len length of the additional data
+ * @return GNUNET_SYSERR if nesting the message failed,
+ * GNUNET_OK on success
+ */
+#define GNUNET_MQ_nest(mqm, src, len) GNUNET_MQ_nest_ (&mqm, src, len)
+
+
+/**
+ * Append a message to the end of an existing MQ message.
+ * If the operation is successful, mqm is changed to point to the new MQ
message,
+ * and GNUNET_OK is returned.
+ * On failure, GNUNET_SYSERR is returned, and the pointer mqm is not changed,
+ * the user of this API must take care of disposing the already allocated
message
+ * (either by sending it, or by using GNUNET_MQ_discard)
+ *
+ * @param mqm MQ message to augment with additional data
+ * @param mh the message to append, must be of type 'struct
GNUNET_MessageHeader *'
+ */
+#define GNUNET_MQ_nest_mh(mqm, mh) ((NULL == mh) ? (GNUNET_OK) :
GNUNET_MQ_nest((mqm), (mh), ntohs ((mh)->size)))
+
+
+/**
+ * Allocate a GNUNET_MQ_Message, where the message only consists of a header.
+ * The allocated message will already have the type and size field set.
+ *
+ * @param type type of the message
+ */
+#define GNUNET_MQ_msg_header(type) GNUNET_MQ_msg_ (NULL, sizeof (struct
GNUNET_MessageHeader), type)
+
+
+/**
+ * Allocate a GNUNET_MQ_Message, where the message only consists of a header
and extra space.
+ * The allocated message will already have the type and size field set.
+ *
+ * @param mh pointer that will changed to point at to the allocated message
header
+ * @param esize extra space to allocate after the message header
+ * @param type type of the message
+ */
+#define GNUNET_MQ_msg_header_extra(mh, esize, type) GNUNET_MQ_msg_ (&mh,
(esize) + sizeof (struct GNUNET_MessageHeader), type)
+
+
+/**
+ * End-marker for the handlers array
+ */
+#define GNUNET_MQ_HANDLERS_END {NULL, 0, 0}
+
+
+struct GNUNET_MQ_MessageQueue;
+
+struct GNUNET_MQ_Message;
+
+enum GNUNET_MQ_Error
+{
+ GNUNET_MQ_ERROR_READ = 1,
+ GNUNET_MQ_ERROR_WRITE = 2,
+ GNUNET_MQ_ERROR_TIMEOUT = 4
+};
+
+
+/**
+ * Called when a message has been received.
+ *
+ * @param cls closure
+ * @param msg the received message
+ */
+typedef void (*GNUNET_MQ_MessageCallback) (void *cls, const struct
GNUNET_MessageHeader *msg);
+
+
+/**
+ * Signature of functions implementing the
+ * sending part of a message queue
+ *
+ * @param q the message queue
+ * @param m the message
+ */
+typedef void
+(*GNUNET_MQ_SendImpl) (struct GNUNET_MQ_MessageQueue *q, struct
GNUNET_MQ_Message *m);
+
+
+typedef void
+(*GNUNET_MQ_DestroyImpl) (struct GNUNET_MQ_MessageQueue *q);
+
+
+/**
+ * Callback used for notifications
+ *
+ * @param cls closure
+ */
+typedef void (*GNUNET_MQ_NotifyCallback) (void *cls);
+
+
+typedef void (*GNUNET_MQ_ErrorHandler) (void *cls, enum GNUNET_MQ_Error error);
+
+
+struct GNUNET_MQ_Message
+{
+ /**
+ * Messages are stored in a linked list
+ */
+ struct GNUNET_MQ_Message *next;
+
+ /**
+ * Messages are stored in a linked list
+ */
+ struct GNUNET_MQ_Message *prev;
+
+ /**
+ * Actual allocated message header,
+ * usually points to the end of the containing GNUNET_MQ_Message
+ */
+ struct GNUNET_MessageHeader *mh;
+
+ /**
+ * Queue the message is queued in, NULL if message is not queued.
+ */
+ struct GNUNET_MQ_MessageQueue *parent_queue;
+
+ /**
+ * Called after the message was sent irrevokably
+ */
+ GNUNET_MQ_NotifyCallback sent_cb;
+
+ /**
+ * Closure for send_cb
+ */
+ void *sent_cls;
+};
+
+
+/**
+ * Handle to a message queue.
+ */
+struct GNUNET_MQ_MessageQueue
+{
+ /**
+ * Handlers array, or NULL if the queue should not receive messages
+ */
+ const struct GNUNET_MQ_Handler *handlers;
+
+ /**
+ * Closure for the handler callbacks,
+ * as well as for the error handler.
+ */
+ void *handlers_cls;
+
+ /**
+ * Actual implementation of message sending,
+ * called when a message is added
+ */
+ GNUNET_MQ_SendImpl send_impl;
+
+ /**
+ * Implementation-dependent queue destruction function
+ */
+ GNUNET_MQ_DestroyImpl destroy_impl;
+
+ /**
+ * Implementation-specific state
+ */
+ void *impl_state;
+
+ /**
+ * Callback will be called when an error occurs.
+ */
+ GNUNET_MQ_ErrorHandler error_handler;
+
+ /**
+ * Linked list of messages pending to be sent
+ */
+ struct GNUNET_MQ_Message *msg_head;
+
+ /**
+ * Linked list of messages pending to be sent
+ */
+ struct GNUNET_MQ_Message *msg_tail;
+
+ /**
+ * Message that is currently scheduled to be
+ * sent. Not the head of the message queue, as the implementation
+ * needs to know if sending has been already scheduled or not.
+ */
+ struct GNUNET_MQ_Message *current_msg;
+
+ /**
+ * Map of associations, lazily allocated
+ */
+ struct GNUNET_CONTAINER_MultiHashMap32 *assoc_map;
+
+ /**
+ * Next id that should be used for the assoc_map,
+ * initialized lazily to a random value together with
+ * assoc_map
+ */
+ uint32_t assoc_id;
+};
+
+
+/**
+ * Message handler for a specific message type.
+ */
+struct GNUNET_MQ_Handler
+{
+ /**
+ * Callback, called every time a new message of
+ * the specified type has been receied.
+ */
+ GNUNET_MQ_MessageCallback cb;
+
+
+ /**
+ * Type of the message this handler covers.
+ */
+ uint16_t type;
+
+ /**
+ * Expected size of messages of this type. Use 0 for
+ * variable-size. If non-zero, messages of the given
+ * type will be discarded (and the connection closed)
+ * if they do not have the right size.
+ */
+ uint16_t expected_size;
+};
+
+
+/**
+ * Create a new message for MQ.
+ *
+ * @param mhp message header to store the allocated message header in, can be
NULL
+ * @param size size of the message to allocate
+ * @param type type of the message, will be set in the allocated message
+ * @return the allocated MQ message
+ */
+struct GNUNET_MQ_Message *
+GNUNET_MQ_msg_ (struct GNUNET_MessageHeader **mhp, uint16_t size, uint16_t
type);
+
+
+/**
+ * Resize the the mq message pointed to by mqmp,
+ * and append the given data to it.
+ *
+ * @param mqmp pointer to a mq message pointer
+ * @param src source of the data to append
+ * @param len length of the data to append
+ * @return GNUNET_OK on success,
+ * GNUNET_SYSERR on error (e.g. if len is too large)
+ */
+int
+GNUNET_MQ_nest_ (struct GNUNET_MQ_Message **mqmp,
+ const void *src, uint16_t len);
+
+
+/**
+ * Discard the message queue message, free all
+ * allocated resources. Must be called in the event
+ * that a message is created but should not actually be sent.
+ *
+ * @param mqm the message to discard
+ */
+void
+GNUNET_MQ_discard (struct GNUNET_MQ_Message *mqm);
+
+
+/**
+ * Send a message with the give message queue.
+ * May only be called once per message.
+ *
+ * @param mq message queue
+ * @param mqm the message to send.
+ */
+void
+GNUNET_MQ_send (struct GNUNET_MQ_MessageQueue *mq, struct GNUNET_MQ_Message
*mqm);
+
+
+/**
+ * Cancel sending the message. Message must have been sent with GNUNET_MQ_send
before.
+ * May not be called after the notify sent callback has been called
+ *
+ * @param mqm queued message to cancel
+ */
+void
+GNUNET_MQ_send_cancel (struct GNUNET_MQ_Message *mqm);
+
+
+/**
+ * Associate the assoc_data in mq with a unique request id.
+ *
+ * @param mq message queue, id will be unique for the queue
+ * @param mqm message to associate
+ * @param assoc_data to associate
+ */
+uint32_t
+GNUNET_MQ_assoc_add (struct GNUNET_MQ_MessageQueue *mq,
+ struct GNUNET_MQ_Message *mqm,
+ void *assoc_data);
+
+/**
+ * Get the data associated with a request id in a queue
+ *
+ * @param mq the message queue with the association
+ * @param request_id the request id we are interested in
+ * @return the associated data
+ */
+void *
+GNUNET_MQ_assoc_get (struct GNUNET_MQ_MessageQueue *mq, uint32_t request_id);
+
+
+/**
+ * Remove the association for a request id
+ *
+ * @param mq the message queue with the association
+ * @param request_id the request id we want to remove
+ * @return the associated data
+ */
+void *
+GNUNET_MQ_assoc_remove (struct GNUNET_MQ_MessageQueue *mq, uint32_t
request_id);
+
+
+
+/**
+ * Create a message queue for a GNUNET_CLIENT_Connection.
+ * If handlers are specfied, receive messages from the connection.
+ *
+ * @param connection the client connection
+ * @param handlers handlers for receiving messages
+ * @param cls closure for the handlers
+ * @return the message queue
+ */
+struct GNUNET_MQ_MessageQueue *
+GNUNET_MQ_queue_for_connection_client (struct GNUNET_CLIENT_Connection
*connection,
+ const struct GNUNET_MQ_Handler
*handlers,
+ void *cls);
+
+
+/**
+ * Create a message queue for a GNUNET_STREAM_Socket.
+ *
+ * @param client the client
+ * @return the message queue
+ */
+struct GNUNET_MQ_MessageQueue *
+GNUNET_MQ_queue_for_server_client (struct GNUNET_SERVER_Client *client);
+
+
+/**
+ * Create a message queue for the specified handlers.
+ *
+ * @param send function the implements sending messages
+ * @param destroy function that implements destroying the queue
+ * @param state for the queue, passed to 'send' and 'destroy'
+ * @param handlers array of message handlers
+ * @param error_handler handler for read and write errors
+ * @return a new message queue
+ */
+struct GNUNET_MQ_MessageQueue *
+GNUNET_MQ_queue_for_callbacks (GNUNET_MQ_SendImpl send,
+ GNUNET_MQ_DestroyImpl destroy,
+ void *impl_state,
+ struct GNUNET_MQ_Handler *handlers,
+ GNUNET_MQ_ErrorHandler error_handler,
+ void *cls);
+
+
+
+/**
+ * Replace the handlers of a message queue with new handlers.
+ * Takes effect immediately, even for messages that already have been
received, but for
+ * with the handler has not been called.
+ *
+ * @param mq message queue
+ * @param new_handlers new handlers
+ * @param cls new closure for the handlers
+ */
+void
+GNUNET_MQ_replace_handlers (struct GNUNET_MQ_MessageQueue *mq,
+ const struct GNUNET_MQ_Handler *new_handlers,
+ void *cls);
+
+
+/**
+ * Call a callback once the message has been sent, that is, the message
+ * can not be canceled anymore.
+ * There can be only one notify sent callback per message.
+ *
+ * @param mqm message to call the notify callback for
+ * @param cb the notify callback
+ * @param cls closure for the callback
+ */
+void
+GNUNET_MQ_notify_sent (struct GNUNET_MQ_Message *mqm,
+ GNUNET_MQ_NotifyCallback cb,
+ void *cls);
+
+
+/**
+ * Destroy the message queue.
+ *
+ * @param mq message queue to destroy
+ */
+void
+GNUNET_MQ_destroy (struct GNUNET_MQ_MessageQueue *mq);
+
+
+/**
+ * Call the right callback for a message.
+ *
+ * @param mq message queue with the handlers
+ * @param mh message to dispatch
+ */
+void
+GNUNET_MQ_dispatch (struct GNUNET_MQ_MessageQueue *mq,
+ const struct GNUNET_MessageHeader *mh);
+
+#endif
Modified: gnunet/src/include/gnunet_set_service.h
===================================================================
--- gnunet/src/include/gnunet_set_service.h 2013-05-22 10:27:24 UTC (rev
27250)
+++ gnunet/src/include/gnunet_set_service.h 2013-05-22 10:29:15 UTC (rev
27251)
@@ -35,7 +35,6 @@
#endif
#endif
-#include "platform.h"
#include "gnunet_common.h"
#include "gnunet_time_lib.h"
#include "gnunet_configuration_lib.h"
@@ -176,7 +175,7 @@
/**
* Called when another peer wants to do a set operation with the
- * local peer
+ * local peer.
*
* @param other_peer the other peer
* @param context_msg message with application specific information from
@@ -266,8 +265,6 @@
* @param salt salt used for the set operation; sometimes set operations
* fail due to hash collisions, using a different salt for each
operation
* makes it harder for an attacker to exploit this
- * @param timeout result_cb will be called with GNUNET_SET_STATUS_TIMEOUT
- * if the operation is not done after the specified time; @deprecated
* @param result_mode specified how results will be returned,
* see 'GNUNET_SET_ResultMode'.
* @param result_cb called on error or success
@@ -280,7 +277,6 @@
const struct GNUNET_HashCode *app_id,
const struct GNUNET_MessageHeader *context_msg,
uint16_t salt,
- struct GNUNET_TIME_Relative timeout,
enum GNUNET_SET_ResultMode result_mode,
GNUNET_SET_ResultIterator result_cb,
void *result_cls);
@@ -322,7 +318,6 @@
*
* @param request request to accept
* @param set set used for the requested operation
- * @param timeout timeout for the set operation, @deprecated
* @param result_mode specified how results will be returned,
* see 'GNUNET_SET_ResultMode'.
* @param result_cb callback for the results
@@ -332,7 +327,6 @@
struct GNUNET_SET_OperationHandle *
GNUNET_SET_accept (struct GNUNET_SET_Request *request,
struct GNUNET_SET_Handle *set,
- struct GNUNET_TIME_Relative timeout,
enum GNUNET_SET_ResultMode result_mode,
GNUNET_SET_ResultIterator result_cb,
void *cls);
Modified: gnunet/src/include/gnunet_stream_lib.h
===================================================================
--- gnunet/src/include/gnunet_stream_lib.h 2013-05-22 10:27:24 UTC (rev
27250)
+++ gnunet/src/include/gnunet_stream_lib.h 2013-05-22 10:29:15 UTC (rev
27251)
@@ -395,6 +395,21 @@
GNUNET_STREAM_read_cancel (struct GNUNET_STREAM_ReadHandle *rh);
+/**
+ * Create a message queue for a stream socket.
+ *
+ * @param socket the socket to read/write in the message queue
+ * @param msg_handlers message handler array
+ * @param error_handler callback for errors
+ * @return the message queue for the socket
+ */
+struct GNUNET_MQ_MessageQueue *
+GNUNET_STREAM_mq_create (struct GNUNET_STREAM_Socket *socket,
+ const struct GNUNET_MQ_Handler *msg_handlers,
+ GNUNET_MQ_ErrorHandler error_handler,
+ void *cls);
+
+
#if 0
{
#endif
Modified: gnunet/src/include/gnunet_util_lib.h
===================================================================
--- gnunet/src/include/gnunet_util_lib.h 2013-05-22 10:27:24 UTC (rev
27250)
+++ gnunet/src/include/gnunet_util_lib.h 2013-05-22 10:29:15 UTC (rev
27251)
@@ -47,6 +47,7 @@
#include "gnunet_disk_lib.h"
#include "gnunet_getopt_lib.h"
#include "gnunet_helper_lib.h"
+#include "gnunet_mq_lib.h"
#include "gnunet_network_lib.h"
#include "gnunet_os_lib.h"
#include "gnunet_peer_lib.h"
Modified: gnunet/src/set/Makefile.am
===================================================================
--- gnunet/src/set/Makefile.am 2013-05-22 10:27:24 UTC (rev 27250)
+++ gnunet/src/set/Makefile.am 2013-05-22 10:29:15 UTC (rev 27251)
@@ -16,7 +16,7 @@
endif
bin_PROGRAMS = \
- gnunet-set gnunet-set-bug
+ gnunet-set
libexec_PROGRAMS = \
gnunet-service-set
@@ -35,17 +35,9 @@
gnunet_set_DEPENDENCIES = \
libgnunetset.la
-gnunet_set_bug_SOURCES = \
- gnunet-set-bug.c
-gnunet_set_bug_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la \
- $(top_builddir)/src/stream/libgnunetstream.la \
- $(GN_LIBINTL)
-
gnunet_service_set_SOURCES = \
gnunet-service-set.c \
gnunet-service-set_union.c \
- mq.c \
ibf.c \
strata_estimator.c
gnunet_service_set_LDADD = \
@@ -54,13 +46,9 @@
$(top_builddir)/src/stream/libgnunetstream.la \
$(top_builddir)/src/mesh/libgnunetmesh.la \
$(GN_LIBINTL)
-# hack for mq.c, see automake Objects ‘created with both libtool and without’
-# remove once GNUNET_MQ is in util/
-gnunet_service_set_CFLAGS = $(AM_CFLAGS)
libgnunetset_la_SOURCES = \
- set_api.c \
- mq.c
+ set_api.c
libgnunetset_la_LIBADD = \
$(top_builddir)/src/util/libgnunetutil.la \
$(top_builddir)/src/stream/libgnunetstream.la \
@@ -84,24 +72,6 @@
test_set_api_DEPENDENCIES = \
libgnunetset.la
-
-test_mq_SOURCES = \
- test_mq.c \
- mq.c
-test_mq_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la \
- $(top_builddir)/src/stream/libgnunetstream.la
-test_mq_CFLAGS = $(AM_CFLAGS)
-
-
-test_mq_client_SOURCES = \
- test_mq_client.c \
- mq.c
-test_mq_client_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la \
- $(top_builddir)/src/stream/libgnunetstream.la
-test_mq_client_CFLAGS = $(AM_CFLAGS)
-
EXTRA_DIST = \
test_set.conf
Modified: gnunet/src/set/gnunet-service-set.c
===================================================================
--- gnunet/src/set/gnunet-service-set.c 2013-05-22 10:27:24 UTC (rev 27250)
+++ gnunet/src/set/gnunet-service-set.c 2013-05-22 10:29:15 UTC (rev 27251)
@@ -632,7 +632,7 @@
incoming = GNUNET_new (struct Incoming);
incoming->peer = *initiator;
incoming->socket = socket;
- incoming->mq = GNUNET_MQ_queue_for_stream_socket (incoming->socket,
handlers, incoming);
+ incoming->mq = GNUNET_STREAM_mq_create (incoming->socket, handlers, NULL,
incoming);
/* FIXME: timeout for peers that only connect but don't send anything */
GNUNET_CONTAINER_DLL_insert_tail (incoming_head, incoming_tail, incoming);
return GNUNET_OK;
Modified: gnunet/src/set/gnunet-service-set.h
===================================================================
--- gnunet/src/set/gnunet-service-set.h 2013-05-22 10:27:24 UTC (rev 27250)
+++ gnunet/src/set/gnunet-service-set.h 2013-05-22 10:29:15 UTC (rev 27251)
@@ -36,7 +36,6 @@
#include "gnunet_stream_lib.h"
#include "gnunet_set_service.h"
#include "set.h"
-#include "mq.h"
/* FIXME: cfuchs */
Modified: gnunet/src/set/gnunet-service-set_union.c
===================================================================
--- gnunet/src/set/gnunet-service-set_union.c 2013-05-22 10:27:24 UTC (rev
27250)
+++ gnunet/src/set/gnunet-service-set_union.c 2013-05-22 10:29:15 UTC (rev
27251)
@@ -1053,8 +1053,8 @@
}
element_size = ntohs (mh->size) - sizeof (struct GNUNET_MessageHeader);
ee = GNUNET_malloc (sizeof *eo + element_size);
+ memcpy (&ee[1], &mh[1], element_size);
ee->element.data = &ee[1];
- memcpy (ee->element.data, &mh[1], element_size);
ee->remote = GNUNET_YES;
insert_element (eo, ee);
@@ -1183,8 +1183,8 @@
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "open cb successful\n");
- eo->mq = GNUNET_MQ_queue_for_stream_socket (eo->socket,
- union_handlers, eo);
+
+ eo->mq = GNUNET_STREAM_mq_create (eo->socket, union_handlers, NULL, eo);
/* we started the operation, thus we have to send the operation request */
send_operation_request (eo);
eo->phase = PHASE_EXPECT_SE;
@@ -1312,9 +1312,9 @@
element_size = ntohs (m->header.size) - sizeof *m;
ee = GNUNET_malloc (element_size + sizeof *ee);
ee->element.size = element_size;
+ memcpy (&ee[1], &m[1], element_size);
ee->element.data = &ee[1];
ee->generation_added = set->state.u->current_generation;
- memcpy (ee->element.data, &m[1], element_size);
GNUNET_CRYPTO_hash (ee->element.data, element_size, &ee->element_hash);
ee_dup = GNUNET_CONTAINER_multihashmap_get (set->state.u->elements,
&ee->element_hash);
if (NULL != ee_dup)
Deleted: gnunet/src/set/gnunet-set-bug.c
===================================================================
--- gnunet/src/set/gnunet-set-bug.c 2013-05-22 10:27:24 UTC (rev 27250)
+++ gnunet/src/set/gnunet-set-bug.c 2013-05-22 10:29:15 UTC (rev 27251)
@@ -1,142 +0,0 @@
-/*
- This file is part of GNUnet
- (C) 2012 Christian Grothoff (and other contributing authors)
-
- GNUnet is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 2, or (at your
- option) any later version.
-
- GNUnet is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GNUnet; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
- */
-
-/**
- * @file set/gnunet-set.c
- * @brief profiling tool for the set service
- * @author Florian Dold
- */
-#include "platform.h"
-#include "gnunet_common.h"
-#include "gnunet_applications.h"
-#include "gnunet_util_lib.h"
-#include "gnunet_stream_lib.h"
-
-
-static struct GNUNET_PeerIdentity local_id;
-
-static struct GNUNET_CONFIGURATION_Handle *cfg;
-
-static struct GNUNET_STREAM_ListenSocket *listen_socket;
-
-static struct GNUNET_STREAM_Socket *s1;
-
-static struct GNUNET_STREAM_Socket *s2;
-
-static void
-do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
-{
- if (NULL != s2)
- GNUNET_STREAM_close (s2);
- GNUNET_STREAM_close (s1);
- GNUNET_STREAM_listen_close (listen_socket);
- GNUNET_CONFIGURATION_destroy (cfg);
-}
-
-static size_t
-stream_data_processor (void *cls,
- enum GNUNET_STREAM_Status status,
- const void *data,
- size_t size)
-{
- return size;
-}
-
-static int
-listen_cb (void *cls,
- struct GNUNET_STREAM_Socket *socket,
- const struct
- GNUNET_PeerIdentity *initiator)
-{
- if (NULL == (s2 = socket))
- {
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "socket listen failed\n");
- return GNUNET_NO;
- }
-
- GNUNET_log (GNUNET_ERROR_TYPE_INFO, "socket listen succesful\n");
- GNUNET_assert (NULL != socket);
- GNUNET_assert (0 == memcmp (initiator, &local_id, sizeof (*initiator)));
- GNUNET_STREAM_read (socket, GNUNET_TIME_UNIT_FOREVER_REL,
- &stream_data_processor, NULL);
- return GNUNET_YES;
-}
-
-static void
-open_cb (void *cls, struct GNUNET_STREAM_Socket *socket)
-{
-
-}
-
-static void
-stream_connect (void)
-{
- s1 = GNUNET_STREAM_open (cfg,
- &local_id,
- GNUNET_APPLICATION_TYPE_SET,
- &open_cb,
- NULL,
- GNUNET_STREAM_OPTION_END);
-}
-
-/**
- * Main function that will be run.
- *
- * @param cls closure
- * @param args remaining command-line arguments
- * @param cfgfile name of the configuration file used (for saving, can be
NULL!)
- * @param cfg configuration
- */
-static void
-run (void *cls, char *const *args,
- const char *cfgfile,
- const struct GNUNET_CONFIGURATION_Handle *cfg2)
-{
-
- cfg = GNUNET_CONFIGURATION_dup (cfg2);
- GNUNET_CRYPTO_get_host_identity (cfg, &local_id);
-
- GNUNET_log (GNUNET_ERROR_TYPE_INFO, "I am Peer %s\n", GNUNET_h2s
(&local_id.hashPubKey));
-
- listen_socket = GNUNET_STREAM_listen (cfg,
- GNUNET_APPLICATION_TYPE_SET,
- &listen_cb,
- NULL,
-
GNUNET_STREAM_OPTION_SIGNAL_LISTEN_SUCCESS,
- &stream_connect,
- GNUNET_STREAM_OPTION_END);
- GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
- &do_shutdown, NULL);
-}
-
-
-
-int
-main (int argc, char **argv)
-{
- static const struct GNUNET_GETOPT_CommandLineOption options[] = {
- GNUNET_GETOPT_OPTION_END
- };
- GNUNET_PROGRAM_run (argc, argv, "gnunet-set",
- "help",
- options, &run, NULL);
- return 0;
-}
-
Added: gnunet/src/set/gnunet-set-ibf.c
===================================================================
--- gnunet/src/set/gnunet-set-ibf.c (rev 0)
+++ gnunet/src/set/gnunet-set-ibf.c 2013-05-22 10:29:15 UTC (rev 27251)
@@ -0,0 +1,238 @@
+/*
+ This file is part of GNUnet.
+ (C) 2012 Christian Grothoff (and other contributing authors)
+
+ GNUnet is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3, or (at your
+ option) any later version.
+
+ GNUnet is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNUnet; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+/**
+ * @file consensus/gnunet-consensus-ibf.c
+ * @brief tool for reconciling data with invertible bloom filters
+ * @author Florian Dold
+ */
+
+
+#include "platform.h"
+#include "gnunet_common.h"
+#include "gnunet_container_lib.h"
+#include "gnunet_util_lib.h"
+
+#include "ibf.h"
+
+static unsigned int asize = 10;
+static unsigned int bsize = 10;
+static unsigned int csize = 10;
+static unsigned int hash_num = 3;
+static unsigned int ibf_size = 80;
+
+/* FIXME: add parameter for this */
+static enum GNUNET_CRYPTO_Quality random_quality = GNUNET_CRYPTO_QUALITY_WEAK;
+
+static struct GNUNET_CONTAINER_MultiHashMap *set_a;
+static struct GNUNET_CONTAINER_MultiHashMap *set_b;
+/* common elements in a and b */
+static struct GNUNET_CONTAINER_MultiHashMap *set_c;
+
+static struct GNUNET_CONTAINER_MultiHashMap *key_to_hashcode;
+
+static struct InvertibleBloomFilter *ibf_a;
+static struct InvertibleBloomFilter *ibf_b;
+
+
+static void
+register_hashcode (struct GNUNET_HashCode *hash)
+{
+ struct GNUNET_HashCode replicated;
+ struct IBF_Key key;
+ key = ibf_key_from_hashcode (hash);
+ ibf_hashcode_from_key (key, &replicated);
+ GNUNET_CONTAINER_multihashmap_put (key_to_hashcode, &replicated,
GNUNET_memdup (hash, sizeof *hash),
+
GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE);
+}
+
+static void
+iter_hashcodes (struct IBF_Key key, GNUNET_CONTAINER_HashMapIterator iter,
void *cls)
+{
+ struct GNUNET_HashCode replicated;
+ ibf_hashcode_from_key (key, &replicated);
+ GNUNET_CONTAINER_multihashmap_get_multiple (key_to_hashcode, &replicated,
iter, cls);
+}
+
+
+static int
+insert_iterator (void *cls,
+ const struct GNUNET_HashCode *key,
+ void *value)
+{
+ struct InvertibleBloomFilter *ibf = (struct InvertibleBloomFilter *) cls;
+ ibf_insert (ibf, ibf_key_from_hashcode (key));
+ return GNUNET_YES;
+}
+
+
+static int
+remove_iterator (void *cls,
+ const struct GNUNET_HashCode *key,
+ void *value)
+{
+ struct GNUNET_CONTAINER_MultiHashMap *hashmap = cls;
+ /* if remove fails, there just was a collision with another key */
+ (void) GNUNET_CONTAINER_multihashmap_remove (hashmap, value, NULL);
+ return GNUNET_YES;
+}
+
+
+static void
+run (void *cls, char *const *args, const char *cfgfile,
+ const struct GNUNET_CONFIGURATION_Handle *cfg)
+{
+ struct GNUNET_HashCode id;
+ struct IBF_Key ibf_key;
+ int i;
+ int side;
+ int res;
+ struct GNUNET_TIME_Absolute start_time;
+ struct GNUNET_TIME_Relative delta_time;
+
+ set_a = GNUNET_CONTAINER_multihashmap_create (((asize == 0) ? 1 : (asize +
csize)),
+ GNUNET_NO);
+ set_b = GNUNET_CONTAINER_multihashmap_create (((bsize == 0) ? 1 : (bsize +
csize)),
+ GNUNET_NO);
+ set_c = GNUNET_CONTAINER_multihashmap_create (((csize == 0) ? 1 : csize),
+ GNUNET_NO);
+
+ key_to_hashcode = GNUNET_CONTAINER_multihashmap_create (((asize+bsize+csize
== 0) ? 1 : (asize+bsize+csize)),
+ GNUNET_NO);
+
+ printf ("hash-num=%u, size=%u, #(A-B)=%u, #(B-A)=%u, #(A&B)=%u\n",
+ hash_num, ibf_size, asize, bsize, csize);
+
+ i = 0;
+ while (i < asize)
+ {
+ GNUNET_CRYPTO_hash_create_random (random_quality, &id);
+ if (GNUNET_YES == GNUNET_CONTAINER_multihashmap_contains (set_a, &id))
+ continue;
+ GNUNET_CONTAINER_multihashmap_put (
+ set_a, &id, NULL, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY);
+ register_hashcode (&id);
+ i++;
+ }
+ i = 0;
+ while (i < bsize)
+ {
+ GNUNET_CRYPTO_hash_create_random (random_quality, &id);
+ if (GNUNET_YES == GNUNET_CONTAINER_multihashmap_contains (set_a, &id))
+ continue;
+ if (GNUNET_YES == GNUNET_CONTAINER_multihashmap_contains (set_b, &id))
+ continue;
+ GNUNET_CONTAINER_multihashmap_put (
+ set_b, &id, NULL, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY);
+ register_hashcode (&id);
+ i++;
+ }
+ i = 0;
+ while (i < csize)
+ {
+ GNUNET_CRYPTO_hash_create_random (random_quality, &id);
+ if (GNUNET_YES == GNUNET_CONTAINER_multihashmap_contains (set_a, &id))
+ continue;
+ if (GNUNET_YES == GNUNET_CONTAINER_multihashmap_contains (set_b, &id))
+ continue;
+ if (GNUNET_YES == GNUNET_CONTAINER_multihashmap_contains (set_c, &id))
+ continue;
+ GNUNET_CONTAINER_multihashmap_put (
+ set_c, &id, NULL, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY);
+ register_hashcode (&id);
+ i++;
+ }
+
+ ibf_a = ibf_create (ibf_size, hash_num);
+ ibf_b = ibf_create (ibf_size, hash_num);
+
+ printf ("generated sets\n");
+
+ start_time = GNUNET_TIME_absolute_get ();
+
+ GNUNET_CONTAINER_multihashmap_iterate (set_a, &insert_iterator, ibf_a);
+ GNUNET_CONTAINER_multihashmap_iterate (set_b, &insert_iterator, ibf_b);
+ GNUNET_CONTAINER_multihashmap_iterate (set_c, &insert_iterator, ibf_a);
+ GNUNET_CONTAINER_multihashmap_iterate (set_c, &insert_iterator, ibf_b);
+
+ delta_time = GNUNET_TIME_absolute_get_duration (start_time);
+
+ printf ("encoded in: %s\n", GNUNET_STRINGS_relative_time_to_string
(delta_time, GNUNET_NO));
+
+ ibf_subtract (ibf_a, ibf_b);
+
+
+ start_time = GNUNET_TIME_absolute_get ();
+
+ for (;;)
+ {
+ res = ibf_decode (ibf_a, &side, &ibf_key);
+ if (GNUNET_SYSERR == res)
+ {
+ printf ("decode failed\n");
+ return;
+ }
+ if (GNUNET_NO == res)
+ {
+ if ((0 == GNUNET_CONTAINER_multihashmap_size (set_b)) &&
+ (0 == GNUNET_CONTAINER_multihashmap_size (set_a)))
+ {
+ delta_time = GNUNET_TIME_absolute_get_duration (start_time);
+ printf ("decoded successfully in: %s\n",
GNUNET_STRINGS_relative_time_to_string (delta_time, GNUNET_NO));
+ }
+ else
+ printf ("decode missed elements\n");
+ return;
+ }
+
+ if (side == 1)
+ iter_hashcodes (ibf_key, remove_iterator, set_a);
+ if (side == -1)
+ iter_hashcodes (ibf_key, remove_iterator, set_b);
+ }
+}
+
+int
+main (int argc, char **argv)
+{
+ static const struct GNUNET_GETOPT_CommandLineOption options[] = {
+ {'A', "asize", NULL,
+ gettext_noop ("number of element in set A-B"), 1,
+ &GNUNET_GETOPT_set_uint, &asize},
+ {'B', "bsize", NULL,
+ gettext_noop ("number of element in set B-A"), 1,
+ &GNUNET_GETOPT_set_uint, &bsize},
+ {'C', "csize", NULL,
+ gettext_noop ("number of common elements in A and B"), 1,
+ &GNUNET_GETOPT_set_uint, &csize},
+ {'k', "hash-num", NULL,
+ gettext_noop ("hash num"), 1,
+ &GNUNET_GETOPT_set_uint, &hash_num},
+ {'s', "ibf-size", NULL,
+ gettext_noop ("ibf size"), 1,
+ &GNUNET_GETOPT_set_uint, &ibf_size},
+ GNUNET_GETOPT_OPTION_END
+ };
+ GNUNET_PROGRAM_run2 (argc, argv, "gnunet-consensus-ibf",
+ "help",
+ options, &run, NULL, GNUNET_YES);
+ return 0;
+}
+
Modified: gnunet/src/set/gnunet-set.c
===================================================================
--- gnunet/src/set/gnunet-set.c 2013-05-22 10:27:24 UTC (rev 27250)
+++ gnunet/src/set/gnunet-set.c 2013-05-22 10:29:15 UTC (rev 27251)
@@ -42,8 +42,8 @@
static void
-result_cb_set1 (void *cls, struct GNUNET_SET_Element *element,
- enum GNUNET_SET_Status status)
+result_cb_set1 (void *cls, const struct GNUNET_SET_Element *element,
+ enum GNUNET_SET_Status status)
{
switch (status)
{
@@ -64,7 +64,7 @@
static void
-result_cb_set2 (void *cls, struct GNUNET_SET_Element *element,
+result_cb_set2 (void *cls, const struct GNUNET_SET_Element *element,
enum GNUNET_SET_Status status)
{
switch (status)
@@ -94,7 +94,7 @@
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "listen cb called\n");
GNUNET_SET_listen_cancel (listen_handle);
- GNUNET_SET_accept (request, set2, GNUNET_TIME_UNIT_FOREVER_REL,
+ GNUNET_SET_accept (request, set2,
GNUNET_SET_RESULT_ADDED, result_cb_set2, NULL);
}
@@ -110,7 +110,7 @@
listen_handle = GNUNET_SET_listen (config, GNUNET_SET_OPERATION_UNION,
&app_id, listen_cb, NULL);
GNUNET_SET_evaluate (set1, &local_id, &app_id, NULL, 42,
- GNUNET_TIME_UNIT_FOREVER_REL, GNUNET_SET_RESULT_ADDED,
+ GNUNET_SET_RESULT_ADDED,
result_cb_set1, NULL);
}
Deleted: gnunet/src/set/mq.c
===================================================================
--- gnunet/src/set/mq.c 2013-05-22 10:27:24 UTC (rev 27250)
+++ gnunet/src/set/mq.c 2013-05-22 10:29:15 UTC (rev 27251)
@@ -1,793 +0,0 @@
-/*
- This file is part of GNUnet.
- (C) 2012 Christian Grothoff (and other contributing authors)
-
- GNUnet is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 2, or (at your
- option) any later version.
-
- GNUnet is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GNUnet; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
-*/
-
-/**
- * @author Florian Dold
- * @file set/mq.c
- * @brief general purpose request queue
- */
-
-#include "mq.h"
-
-
-#define LOG(kind,...) GNUNET_log_from (kind, "mq",__VA_ARGS__)
-
-/**
- * Signature of functions implementing the
- * sending part of a message queue
- *
- * @param q the message queue
- * @param m the message
- */
-typedef void (*SendImpl) (struct GNUNET_MQ_MessageQueue *q, struct
GNUNET_MQ_Message *m);
-
-
-typedef void (*DestroyImpl) (struct GNUNET_MQ_MessageQueue *q);
-
-
-/**
- * Collection of the state necessary to read and write gnunet messages
- * to a stream socket. Should be used as closure for stream_data_processor.
- */
-struct MessageStreamState
-{
- struct GNUNET_SERVER_MessageStreamTokenizer *mst;
- struct MessageQueue *mq;
- struct GNUNET_STREAM_Socket *socket;
- struct GNUNET_STREAM_ReadHandle *rh;
- struct GNUNET_STREAM_WriteHandle *wh;
-};
-
-
-struct ServerClientSocketState
-{
- struct GNUNET_SERVER_Client *client;
- struct GNUNET_SERVER_TransmitHandle* th;
-};
-
-
-struct ClientConnectionState
-{
- struct GNUNET_CLIENT_Connection *connection;
- struct GNUNET_CLIENT_TransmitHandle *th;
-};
-
-
-struct GNUNET_MQ_MessageQueue
-{
- /**
- * Handlers array, or NULL if the queue should not receive messages
- */
- const struct GNUNET_MQ_Handler *handlers;
-
- /**
- * Closure for the handler callbacks
- */
- void *handlers_cls;
-
- /**
- * Actual implementation of message sending,
- * called when a message is added
- */
- SendImpl send_impl;
-
- /**
- * Implementation-dependent queue destruction function
- */
- DestroyImpl destroy_impl;
-
- /**
- * Implementation-specific state
- */
- void *impl_state;
-
- /**
- * Callback will be called when the message queue is empty
- */
- GNUNET_MQ_NotifyCallback empty_cb;
-
- /**
- * Closure for empty_cb
- */
- void *empty_cls;
-
- /**
- * Callback will be called when a read error occurs.
- */
- GNUNET_MQ_NotifyCallback read_error_cb;
-
- /**
- * Closure for read_error_cb
- */
- void *read_error_cls;
-
- /**
- * Linked list of messages pending to be sent
- */
- struct GNUNET_MQ_Message *msg_head;
-
- /**
- * Linked list of messages pending to be sent
- */
- struct GNUNET_MQ_Message *msg_tail;
-
- /**
- * Message that is currently scheduled to be
- * sent. Not the head of the message queue, as the implementation
- * needs to know if sending has been already scheduled or not.
- */
- struct GNUNET_MQ_Message *current_msg;
-
- /**
- * Map of associations, lazily allocated
- */
- struct GNUNET_CONTAINER_MultiHashMap32 *assoc_map;
-
- /**
- * Next id that should be used for the assoc_map,
- * initialized lazily to a random value together with
- * assoc_map
- */
- uint32_t assoc_id;
-};
-
-
-struct GNUNET_MQ_Message
-{
- /**
- * Messages are stored in a linked list
- */
- struct GNUNET_MQ_Message *next;
-
- /**
- * Messages are stored in a linked list
- */
- struct GNUNET_MQ_Message *prev;
-
- /**
- * Actual allocated message header,
- * usually points to the end of the containing GNUNET_MQ_Message
- */
- struct GNUNET_MessageHeader *mh;
-
- /**
- * Queue the message is queued in, NULL if message is not queued.
- */
- struct GNUNET_MQ_MessageQueue *parent_queue;
-
- /**
- * Called after the message was sent irrevokably
- */
- GNUNET_MQ_NotifyCallback sent_cb;
-
- /**
- * Closure for send_cb
- */
- void *sent_cls;
-};
-
-
-/**
- * Call the right callback for a message received
- * by a queue
- */
-static void
-dispatch_message (struct GNUNET_MQ_MessageQueue *mq, const struct
GNUNET_MessageHeader *mh)
-{
- const struct GNUNET_MQ_Handler *handler;
- int handled = GNUNET_NO;
-
- handler = mq->handlers;
- if (NULL == handler)
- return;
- for (; NULL != handler->cb; handler++)
- {
- if (handler->type == ntohs (mh->type))
- {
- handler->cb (mq->handlers_cls, mh);
- handled = GNUNET_YES;
- }
- }
-
- if (GNUNET_NO == handled)
- LOG (GNUNET_ERROR_TYPE_WARNING, "no handler for message of type %d\n",
ntohs (mh->type));
-}
-
-
-void
-GNUNET_MQ_discard (struct GNUNET_MQ_Message *mqm)
-{
- GNUNET_assert (NULL == mqm->parent_queue);
- GNUNET_free (mqm);
-}
-
-
-/**
- * Send a message with the give message queue.
- * May only be called once per message.
- *
- * @param mq message queue
- * @param mqm the message to send.
- */
-void
-GNUNET_MQ_send (struct GNUNET_MQ_MessageQueue *mq, struct GNUNET_MQ_Message
*mqm)
-{
- GNUNET_assert (NULL != mq);
- mq->send_impl (mq, mqm);
-}
-
-
-struct GNUNET_MQ_Message *
-GNUNET_MQ_msg_ (struct GNUNET_MessageHeader **mhp, uint16_t size, uint16_t
type)
-{
- struct GNUNET_MQ_Message *mqm;
-
- mqm = GNUNET_malloc (sizeof *mqm + size);
- mqm->mh = (struct GNUNET_MessageHeader *) &mqm[1];
- mqm->mh->size = htons (size);
- mqm->mh->type = htons (type);
- if (NULL != mhp)
- *mhp = mqm->mh;
- return mqm;
-}
-
-
-int
-GNUNET_MQ_nest_ (struct GNUNET_MQ_Message **mqmp,
- const void *data, uint16_t len)
-{
- size_t new_size;
- size_t old_size;
-
- GNUNET_assert (NULL != mqmp);
- /* there's no data to append => do nothing */
- if (NULL == data)
- return GNUNET_OK;
- old_size = ntohs ((*mqmp)->mh->size);
- /* message too large to concatenate? */
- if (((uint16_t) (old_size + len)) < len)
- return GNUNET_SYSERR;
- new_size = old_size + len;
- *mqmp = GNUNET_realloc (*mqmp, sizeof (struct GNUNET_MQ_Message) + new_size);
- (*mqmp)->mh = (struct GNUNET_MessageHeader *) &(*mqmp)[1];
- memcpy (((void *) (*mqmp)->mh) + old_size, data, new_size - old_size);
- (*mqmp)->mh->size = htons (new_size);
- return GNUNET_OK;
-}
-
-
-/**
- * Functions of this signature are called whenever writing operations
- * on a stream are executed
- *
- * @param cls the closure from GNUNET_STREAM_write
- * @param status the status of the stream at the time this function is called;
- * GNUNET_STREAM_OK if writing to stream was completed successfully;
- * GNUNET_STREAM_TIMEOUT if the given data is not sent successfully
- * (this doesn't mean that the data is never sent, the receiver may
- * have read the data but its ACKs may have been lost);
- * GNUNET_STREAM_SHUTDOWN if the stream is shutdown for writing in the
- * mean time; GNUNET_STREAM_SYSERR if the stream is broken and cannot
- * be processed.
- * @param size the number of bytes written
- */
-static void
-stream_write_queued (void *cls, enum GNUNET_STREAM_Status status, size_t size)
-{
- struct GNUNET_MQ_MessageQueue *mq = cls;
- struct MessageStreamState *mss = (struct MessageStreamState *)
mq->impl_state;
- struct GNUNET_MQ_Message *mqm;
-
- GNUNET_assert (GNUNET_STREAM_OK == status);
-
- /* call cb for message we finished sending */
- mqm = mq->current_msg;
- GNUNET_assert (NULL != mq->current_msg);
- if (NULL != mqm->sent_cb)
- mqm->sent_cb (mqm->sent_cls);
- GNUNET_free (mqm);
-
- mss->wh = NULL;
-
- mqm = mq->msg_head;
- mq->current_msg = mqm;
- if (NULL == mqm)
- {
- if (NULL != mq->empty_cb)
- mq->empty_cb (mq->empty_cls);
- return;
- }
- GNUNET_CONTAINER_DLL_remove (mq->msg_head, mq->msg_tail, mqm);
- mss->wh = GNUNET_STREAM_write (mss->socket, mqm->mh, ntohs (mqm->mh->size),
- GNUNET_TIME_UNIT_FOREVER_REL,
- stream_write_queued, mq);
- GNUNET_assert (NULL != mss->wh);
-}
-
-
-static void
-stream_socket_send_impl (struct GNUNET_MQ_MessageQueue *mq,
- struct GNUNET_MQ_Message *mqm)
-{
- struct MessageStreamState *mss = (struct MessageStreamState *)
mq->impl_state;
- if (NULL != mq->current_msg)
- {
- GNUNET_CONTAINER_DLL_insert_tail (mq->msg_head, mq->msg_tail, mqm);
- return;
- }
- mq->current_msg = mqm;
- mss->wh = GNUNET_STREAM_write (mss->socket, mqm->mh, ntohs (mqm->mh->size),
- GNUNET_TIME_UNIT_FOREVER_REL,
- stream_write_queued, mq);
-}
-
-
-/**
- * Functions with this signature are called whenever a
- * complete message is received by the tokenizer.
- *
- * Do not call GNUNET_SERVER_mst_destroy in callback
- *
- * @param cls closure
- * @param client identification of the client
- * @param message the actual message
- *
- * @return GNUNET_OK on success, GNUNET_SYSERR to stop further processing
- */
-static int
-stream_mst_callback (void *cls, void *client,
- const struct GNUNET_MessageHeader *message)
-{
- struct GNUNET_MQ_MessageQueue *mq = cls;
-
- GNUNET_assert (NULL != message);
- dispatch_message (mq, message);
- return GNUNET_OK;
-}
-
-
-/**
- * Functions of this signature are called whenever data is available from the
- * stream.
- *
- * @param cls the closure from GNUNET_STREAM_read
- * @param status the status of the stream at the time this function is called
- * @param data traffic from the other side
- * @param size the number of bytes available in data read; will be 0 on
timeout
- * @return number of bytes of processed from 'data' (any data remaining should
be
- * given to the next time the read processor is called).
- */
-static size_t
-stream_data_processor (void *cls,
- enum GNUNET_STREAM_Status status,
- const void *data,
- size_t size)
-{
- struct GNUNET_MQ_MessageQueue *mq = cls;
- struct MessageStreamState *mss;
- int ret;
-
- mss = (struct MessageStreamState *) mq->impl_state;
- GNUNET_assert (GNUNET_STREAM_OK == status);
- ret = GNUNET_SERVER_mst_receive (mss->mst, NULL, data, size, GNUNET_NO,
GNUNET_NO);
- GNUNET_assert (GNUNET_OK == ret);
- /* we always read all data */
- mss->rh = GNUNET_STREAM_read (mss->socket, GNUNET_TIME_UNIT_FOREVER_REL,
- stream_data_processor, mq);
- return size;
-}
-
-
-static void
-stream_socket_destroy_impl (struct GNUNET_MQ_MessageQueue *mq)
-{
- struct MessageStreamState *mss = (struct MessageStreamState *)
mq->impl_state;
-
- if (NULL != mss->rh)
- {
- GNUNET_STREAM_read_cancel (mss->rh);
- mss->rh = NULL;
- }
-
- if (NULL != mss->wh)
- {
- GNUNET_STREAM_write_cancel (mss->wh);
- mss->wh = NULL;
- }
-
- if (NULL != mss->mst)
- {
- GNUNET_SERVER_mst_destroy (mss->mst);
- mss->mst = NULL;
- }
-
- GNUNET_free (mss);
-}
-
-
-
-
-struct GNUNET_MQ_MessageQueue *
-GNUNET_MQ_queue_for_stream_socket (struct GNUNET_STREAM_Socket *socket,
- const struct GNUNET_MQ_Handler *handlers,
- void *cls)
-{
- struct GNUNET_MQ_MessageQueue *mq;
- struct MessageStreamState *mss;
-
- mq = GNUNET_new (struct GNUNET_MQ_MessageQueue);
- mss = GNUNET_new (struct MessageStreamState);
- mss->socket = socket;
- mq->impl_state = mss;
- mq->send_impl = stream_socket_send_impl;
- mq->destroy_impl = &stream_socket_destroy_impl;
- mq->handlers = handlers;
- mq->handlers_cls = cls;
- if (NULL != handlers)
- {
- mss->mst = GNUNET_SERVER_mst_create (stream_mst_callback, mq);
- mss->rh = GNUNET_STREAM_read (socket, GNUNET_TIME_UNIT_FOREVER_REL,
- stream_data_processor, mq);
- }
- return mq;
-}
-
-
-/*** Transmit a queued message to the session's client.
- *
- * @param cls consensus session
- * @param size number of bytes available in buf
- * @param buf where the callee should write the message
- * @return number of bytes written to buf
- */
-static size_t
-transmit_queued (void *cls, size_t size,
- void *buf)
-{
- struct GNUNET_MQ_MessageQueue *mq = cls;
- struct GNUNET_MQ_Message *mqm = mq->current_msg;
- struct ServerClientSocketState *state = mq->impl_state;
- size_t msg_size;
-
- GNUNET_assert (NULL != buf);
-
- if (NULL != mqm->sent_cb)
- {
- mqm->sent_cb (mqm->sent_cls);
- }
-
- mq->current_msg = NULL;
- GNUNET_assert (NULL != mqm);
- msg_size = ntohs (mqm->mh->size);
- GNUNET_assert (size >= msg_size);
- memcpy (buf, mqm->mh, msg_size);
- GNUNET_free (mqm);
- state->th = NULL;
-
- if (NULL != mq->msg_head)
- {
- mq->current_msg = mq->msg_head;
- GNUNET_CONTAINER_DLL_remove (mq->msg_head, mq->msg_tail, mq->current_msg);
- state->th =
- GNUNET_SERVER_notify_transmit_ready (state->client, msg_size,
- GNUNET_TIME_UNIT_FOREVER_REL,
- &transmit_queued, mq);
- }
- else if (NULL != mq->empty_cb)
- mq->empty_cb (mq->empty_cls);
- return msg_size;
-}
-
-
-
-static void
-server_client_destroy_impl (struct GNUNET_MQ_MessageQueue *mq)
-{
- struct ServerClientSocketState *state;
-
- GNUNET_assert (NULL != mq);
- state = mq->impl_state;
- GNUNET_assert (NULL != state);
- GNUNET_SERVER_client_drop (state->client);
- GNUNET_free (state);
-}
-
-static void
-server_client_send_impl (struct GNUNET_MQ_MessageQueue *mq, struct
GNUNET_MQ_Message *mqm)
-{
- struct ServerClientSocketState *state;
- int msize;
-
- GNUNET_assert (NULL != mq);
- state = mq->impl_state;
- GNUNET_assert (NULL != state);
-
- if (NULL != state->th)
- {
- GNUNET_CONTAINER_DLL_insert_tail (mq->msg_head, mq->msg_tail, mqm);
- return;
- }
- GNUNET_assert (NULL == mq->msg_head);
- GNUNET_assert (NULL == mq->current_msg);
- msize = ntohs (mqm->mh->size);
- mq->current_msg = mqm;
- state->th =
- GNUNET_SERVER_notify_transmit_ready (state->client, msize,
- GNUNET_TIME_UNIT_FOREVER_REL,
- &transmit_queued, mq);
-}
-
-
-struct GNUNET_MQ_MessageQueue *
-GNUNET_MQ_queue_for_server_client (struct GNUNET_SERVER_Client *client)
-{
- struct GNUNET_MQ_MessageQueue *mq;
- struct ServerClientSocketState *scss;
-
- mq = GNUNET_new (struct GNUNET_MQ_MessageQueue);
- scss = GNUNET_new (struct ServerClientSocketState);
- mq->impl_state = scss;
- scss->client = client;
- GNUNET_SERVER_client_keep (client);
- mq->send_impl = server_client_send_impl;
- mq->destroy_impl = server_client_destroy_impl;
- return mq;
-}
-
-
-/**
- * Transmit a queued message to the session's client.
- *
- * @param cls consensus session
- * @param size number of bytes available in buf
- * @param buf where the callee should write the message
- * @return number of bytes written to buf
- */
-static size_t
-connection_client_transmit_queued (void *cls, size_t size,
- void *buf)
-{
- struct GNUNET_MQ_MessageQueue *mq = cls;
- struct GNUNET_MQ_Message *mqm = mq->current_msg;
- struct ClientConnectionState *state = mq->impl_state;
- size_t msg_size;
-
-
- GNUNET_assert (NULL != mqm);
-
- if (NULL != mqm->sent_cb)
- {
- mqm->sent_cb (mqm->sent_cls);
- }
-
- mq->current_msg = NULL;
- GNUNET_assert (NULL != buf);
- msg_size = ntohs (mqm->mh->size);
- GNUNET_assert (size >= msg_size);
- memcpy (buf, mqm->mh, msg_size);
- GNUNET_free (mqm);
- state->th = NULL;
- if (NULL != mq->msg_head)
- {
- mq->current_msg = mq->msg_head;
- GNUNET_CONTAINER_DLL_remove (mq->msg_head, mq->msg_tail, mq->current_msg);
- state->th =
- GNUNET_CLIENT_notify_transmit_ready (state->connection, ntohs
(mq->current_msg->mh->size),
- GNUNET_TIME_UNIT_FOREVER_REL,
GNUNET_NO,
-
&connection_client_transmit_queued, mq);
- }
- else if (NULL != mq->empty_cb)
- mq->empty_cb (mq->empty_cls);
- return msg_size;
-}
-
-
-
-static void
-connection_client_destroy_impl (struct GNUNET_MQ_MessageQueue *mq)
-{
- GNUNET_free (mq->impl_state);
-}
-
-static void
-connection_client_send_impl (struct GNUNET_MQ_MessageQueue *mq,
- struct GNUNET_MQ_Message *mqm)
-{
- struct ClientConnectionState *state = mq->impl_state;
- int msize;
-
- GNUNET_assert (NULL != state);
-
- if (NULL != state->th)
- {
- GNUNET_CONTAINER_DLL_insert_tail (mq->msg_head, mq->msg_tail, mqm);
- return;
- }
- GNUNET_assert (NULL == mq->current_msg);
- mq->current_msg = mqm;
- msize = ntohs (mqm->mh->size);
- state->th =
- GNUNET_CLIENT_notify_transmit_ready (state->connection, msize,
- GNUNET_TIME_UNIT_FOREVER_REL,
GNUNET_NO,
- &connection_client_transmit_queued,
mq);
-}
-
-
-
-/**
- * Type of a function to call when we receive a message
- * from the service.
- *
- * @param cls closure
- * @param msg message received, NULL on timeout or fatal error
- */
-static void
-handle_client_message (void *cls,
- const struct GNUNET_MessageHeader *msg)
-{
- struct GNUNET_MQ_MessageQueue *mq = cls;
- struct ClientConnectionState *state;
-
- state = mq->impl_state;
-
- if (NULL == msg)
- {
- if (NULL == mq->read_error_cb)
- LOG (GNUNET_ERROR_TYPE_WARNING, "ignoring read error (no handler
installed)\n");
- mq->read_error_cb (mq->read_error_cls);
- return;
- }
-
- GNUNET_CLIENT_receive (state->connection, handle_client_message, mq,
- GNUNET_TIME_UNIT_FOREVER_REL);
-
- dispatch_message (mq, msg);
-}
-
-
-struct GNUNET_MQ_MessageQueue *
-GNUNET_MQ_queue_for_connection_client (struct GNUNET_CLIENT_Connection
*connection,
- const struct GNUNET_MQ_Handler
*handlers,
- void *cls)
-{
- struct GNUNET_MQ_MessageQueue *mq;
- struct ClientConnectionState *state;
-
- GNUNET_assert (NULL != connection);
-
- mq = GNUNET_new (struct GNUNET_MQ_MessageQueue);
- mq->handlers = handlers;
- mq->handlers_cls = cls;
- state = GNUNET_new (struct ClientConnectionState);
- state->connection = connection;
- mq->impl_state = state;
- mq->send_impl = connection_client_send_impl;
- mq->destroy_impl = connection_client_destroy_impl;
-
- if (NULL != handlers)
- {
- GNUNET_CLIENT_receive (connection, handle_client_message, mq,
- GNUNET_TIME_UNIT_FOREVER_REL);
- }
-
- return mq;
-}
-
-
-void
-GNUNET_MQ_replace_handlers (struct GNUNET_MQ_MessageQueue *mq,
- const struct GNUNET_MQ_Handler *new_handlers,
- void *cls)
-{
- mq->handlers = new_handlers;
- mq->handlers_cls = cls;
-}
-
-
-/**
- * Associate the assoc_data in mq with a unique request id.
- *
- * @param mq message queue, id will be unique for the queue
- * @param mqm message to associate
- * @param assoc_data to associate
- */
-uint32_t
-GNUNET_MQ_assoc_add (struct GNUNET_MQ_MessageQueue *mq,
- struct GNUNET_MQ_Message *mqm,
- void *assoc_data)
-{
- uint32_t id;
-
- if (NULL == mq->assoc_map)
- {
- mq->assoc_map = GNUNET_CONTAINER_multihashmap32_create (8);
- mq->assoc_id = 1;
- }
- id = mq->assoc_id++;
- GNUNET_CONTAINER_multihashmap32_put (mq->assoc_map, id, assoc_data,
-
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY);
- return id;
-}
-
-
-
-void *
-GNUNET_MQ_assoc_get (struct GNUNET_MQ_MessageQueue *mq, uint32_t request_id)
-{
- if (NULL == mq->assoc_map)
- return NULL;
- return GNUNET_CONTAINER_multihashmap32_get (mq->assoc_map, request_id);
-}
-
-
-void *
-GNUNET_MQ_assoc_remove (struct GNUNET_MQ_MessageQueue *mq, uint32_t request_id)
-{
- void *val;
-
- if (NULL == mq->assoc_map)
- return NULL;
- val = GNUNET_CONTAINER_multihashmap32_get (mq->assoc_map, request_id);
- GNUNET_assert (NULL != val);
- GNUNET_CONTAINER_multihashmap32_remove (mq->assoc_map, request_id, val);
- return val;
-}
-
-
-void
-GNUNET_MQ_notify_sent (struct GNUNET_MQ_Message *mqm,
- GNUNET_MQ_NotifyCallback cb,
- void *cls)
-{
- mqm->sent_cb = cb;
- mqm->sent_cls = cls;
-}
-
-
-void
-GNUNET_MQ_destroy (struct GNUNET_MQ_MessageQueue *mq)
-{
- /* FIXME: destroy all pending messages in the queue */
-
- if (NULL != mq->destroy_impl)
- {
- mq->destroy_impl (mq);
- }
-
- GNUNET_free (mq);
-}
-
-
-/**
- * Call a callback once all messages queued have been sent,
- * i.e. the message queue is empty.
- *
- * @param mqm the message queue to send the notification for
- * @param cb the callback to call on an empty queue
- * @param cls closure for cb
- */
-void
-GNUNET_MQ_notify_empty (struct GNUNET_MQ_MessageQueue *mqm,
- GNUNET_MQ_NotifyCallback cb,
- void *cls)
-{
- mqm->empty_cb = cb;
- mqm->empty_cls = cls;
-}
Deleted: gnunet/src/set/mq.h
===================================================================
--- gnunet/src/set/mq.h 2013-05-22 10:27:24 UTC (rev 27250)
+++ gnunet/src/set/mq.h 2013-05-22 10:29:15 UTC (rev 27251)
@@ -1,362 +0,0 @@
-/*
- This file is part of GNUnet.
- (C) 2012 Christian Grothoff (and other contributing authors)
-
- GNUnet is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 2, or (at your
- option) any later version.
-
- GNUnet is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GNUnet; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
-*/
-
-/**
- * @author Florian Dold
- * @file set/mq.h
- * @brief general purpose request queue
- */
-#ifndef MQ_H
-#define MQ_H
-
-#include "platform.h"
-#include "gnunet_common.h"
-#include "gnunet_util_lib.h"
-#include "gnunet_connection_lib.h"
-#include "gnunet_server_lib.h"
-#include "gnunet_stream_lib.h"
-
-
-/**
- * Allocate a GNUNET_MQ_Message, with extra space allocated after the space
needed
- * by the message struct.
- * The allocated message will already have the type and size field set.
- *
- * @param mvar variable to store the allocated message in;
- * must have a header field
- * @param esize extra space to allocate after the message
- * @param type type of the message
- * @return the MQ message
- */
-#define GNUNET_MQ_msg_extra(mvar, esize, type)
GNUNET_MQ_msg_((((void)(mvar)->header), (struct GNUNET_MessageHeader**)
&(mvar)), (esize) + sizeof *(mvar), (type))
-
-/**
- * Allocate a GNUNET_MQ_Message.
- * The allocated message will already have the type and size field set.
- *
- * @param mvar variable to store the allocated message in;
- * must have a header field
- * @param type type of the message
- * @return the MQ message
- */
-#define GNUNET_MQ_msg(mvar, type) GNUNET_MQ_msg_extra(mvar, 0, type)
-
-/**
- * Append data to the end of an existing MQ message.
- * If the operation is successful, mqm is changed to point to the new MQ
message,
- * and GNUNET_OK is returned.
- * On failure, GNUNET_SYSERR is returned, and the pointer mqm is not changed,
- * the user of this API must take care of disposing the already allocated
message
- * (either by sending it, or by using GNUNET_MQ_discard)
- *
- * @param mqm MQ message to augment with additional data
- * @param src source buffer for the additional data
- * @param len length of the additional data
- * @return FIXME
- */
-#define GNUNET_MQ_nest(mqm, src, len) GNUNET_MQ_nest_ (&mqm, src, len)
-
-
-
-/**
- * Append a message to the end of an existing MQ message.
- * If the operation is successful, mqm is changed to point to the new MQ
message,
- * and GNUNET_OK is returned.
- * On failure, GNUNET_SYSERR is returned, and the pointer mqm is not changed,
- * the user of this API must take care of disposing the already allocated
message
- * (either by sending it, or by using GNUNET_MQ_discard)
- *
- * @param mqm MQ message to augment with additional data
- * @param mh the message to append, must be of type 'struct
GNUNET_MessageHeader *'
- */
-#define GNUNET_MQ_nest_mh(mqm, mh) ((NULL == mh) ? (GNUNET_OK) :
GNUNET_MQ_nest((mqm), (mh), ntohs ((mh)->size)))
-
-
-/**
- * Allocate a GNUNET_MQ_Message, where the message only consists of a header.
- * The allocated message will already have the type and size field set.
- *
- * @param type type of the message
- */
-#define GNUNET_MQ_msg_header(type) GNUNET_MQ_msg_ (NULL, sizeof (struct
GNUNET_MessageHeader), type)
-
-
-/**
- * Allocate a GNUNET_MQ_Message, where the message only consists of a header
and extra space.
- * The allocated message will already have the type and size field set.
- *
- * @param mh pointer that will changed to point at to the allocated message
header
- * @param esize extra space to allocate after the message header
- * @param type type of the message
- */
-#define GNUNET_MQ_msg_header_extra(mh, esize, type) GNUNET_MQ_msg_ (&mh,
(esize) + sizeof (struct GNUNET_MessageHeader), type)
-
-
-/**
- * End-marker for the handlers array
- */
-#define GNUNET_MQ_HANDLERS_END {NULL, 0, 0}
-
-/**
- * Opaque handle to a message queue
- */
-struct GNUNET_MQ_MessageQueue;
-
-/**
- * Opaque handle to an allocated message
- */
-struct GNUNET_MQ_Message; // Entry (/ Request)
-
-/**
- * Called when a message has been received.
- *
- * @param cls closure
- * @param msg the received message
- */
-typedef void (*GNUNET_MQ_MessageCallback) (void *cls, const struct
GNUNET_MessageHeader *msg);
-
-
-/**
- * Message handler for a specific message type.
- */
-struct GNUNET_MQ_Handler
-{
- /**
- * Callback, called every time a new message of
- * the specified type has been receied.
- */
- GNUNET_MQ_MessageCallback cb;
-
-
- /**
- * Type of the message this handler covers.
- */
- uint16_t type;
-
- /**
- * Expected size of messages of this type. Use 0 for
- * variable-size. If non-zero, messages of the given
- * type will be discarded (and the connection closed)
- * if they do not have the right size.
- */
- uint16_t expected_size;
-};
-
-/**
- * Callback used for notifications
- *
- * @param cls closure
- */
-typedef void (*GNUNET_MQ_NotifyCallback) (void *cls);
-
-
-/**
- * Create a new message for MQ.
- *
- * @param mhp message header to store the allocated message header in, can be
NULL
- * @param size size of the message to allocate
- * @param type type of the message, will be set in the allocated message
- * @return the allocated MQ message
- */
-struct GNUNET_MQ_Message *
-GNUNET_MQ_msg_ (struct GNUNET_MessageHeader **mhp, uint16_t size, uint16_t
type);
-
-
-int
-GNUNET_MQ_nest_ (struct GNUNET_MQ_Message **mqmp,
- const void *src, uint16_t len);
-
-
-/**
- * Discard the message queue message, free all
- * allocated resources. Must be called in the event
- * that a message is created but should not actually be sent.
- *
- * @param mqm the message to discard
- */
-void
-GNUNET_MQ_discard (struct GNUNET_MQ_Message *mqm);
-
-
-/**
- * Send a message with the give message queue.
- * May only be called once per message.
- *
- * @param mq message queue
- * @param mqm the message to send.
- */
-void
-GNUNET_MQ_send (struct GNUNET_MQ_MessageQueue *mq, struct GNUNET_MQ_Message
*mqm);
-
-
-/**
- * Cancel sending the message. Message must have been sent with GNUNET_MQ_send
before.
- * May not be called after the notify sent callback has been called
- *
- * @param mqm queued message to cancel
- */
-void
-GNUNET_MQ_send_cancel (struct GNUNET_MQ_Message *mqm);
-
-
-/**
- * Associate the assoc_data in mq with a unique request id.
- *
- * @param mq message queue, id will be unique for the queue
- * @param mqm message to associate
- * @param assoc_data to associate
- */
-uint32_t
-GNUNET_MQ_assoc_add (struct GNUNET_MQ_MessageQueue *mq,
- struct GNUNET_MQ_Message *mqm,
- void *assoc_data);
-
-/**
- * Get the data associated with a request id in a queue
- *
- * @param mq the message queue with the association
- * @param request_id the request id we are interested in
- * @return the associated data
- */
-void *
-GNUNET_MQ_assoc_get (struct GNUNET_MQ_MessageQueue *mq, uint32_t request_id);
-
-
-/**
- * Remove the association for a request id
- *
- * @param mq the message queue with the association
- * @param request_id the request id we want to remove
- * @return the associated data
- */
-void *
-GNUNET_MQ_assoc_remove (struct GNUNET_MQ_MessageQueue *mq, uint32_t
request_id);
-
-
-
-/**
- * Create a message queue for a GNUNET_CLIENT_Connection.
- * If handlers are specfied, receive messages from the connection.
- *
- * @param connection the client connection
- * @param handlers handlers for receiving messages
- * @param cls closure for the handlers
- * @return the message queue
- */
-struct GNUNET_MQ_MessageQueue *
-GNUNET_MQ_queue_for_connection_client (struct GNUNET_CLIENT_Connection
*connection,
- const struct GNUNET_MQ_Handler
*handlers,
- void *cls);
-
-
-/**
- * Create a message queue for a GNUNET_STREAM_Socket.
- *
- * @param client the client
- * @return the message queue
- */
-struct GNUNET_MQ_MessageQueue *
-GNUNET_MQ_queue_for_server_client (struct GNUNET_SERVER_Client *client);
-
-
-/**
- * Create a message queue for a GNUNET_STREAM_Socket.
- * If handlers are specfied, receive messages from the stream socket.
- *
- * @param socket the stream socket
- * @param handlers handlers for receiving messages
- * @param cls closure for the handlers
- * @return the message queue
- * @deprecated - GNUNET_MQ_queue_create_with_callbacks
- */
-struct GNUNET_MQ_MessageQueue *
-GNUNET_MQ_queue_for_stream_socket (struct GNUNET_STREAM_Socket *socket,
- const struct GNUNET_MQ_Handler *handlers,
- void *cls);
-
-
-/**
- * Replace the handlers of a message queue with new handlers.
- * Takes effect immediately, even for messages that already have been
received, but for
- * with the handler has not been called.
- *
- * @param mq message queue
- * @param new_handlers new handlers
- * @param cls new closure for the handlers
- */
-void
-GNUNET_MQ_replace_handlers (struct GNUNET_MQ_MessageQueue *mq,
- const struct GNUNET_MQ_Handler *new_handlers,
- void *cls);
-
-
-/**
- * Call a callback once the message has been sent, that is, the message
- * can not be canceled anymore.
- * There can be only one notify sent callback per message.
- *
- * @param mqm message to call the notify callback for
- * @param cb the notify callback
- * @param cls closure for the callback
- */
-void
-GNUNET_MQ_notify_sent (struct GNUNET_MQ_Message *mqm,
- GNUNET_MQ_NotifyCallback cb,
- void *cls);
-
-
-/**
- * Call a callback once all messages queued have been sent,
- * i.e. the message queue is empty.
- *
- * @param mqm the message queue to send the notification for
- * @param cb the callback to call on an empty queue
- * @param cls closure for cb
- * @deprecated
- */
-void
-GNUNET_MQ_notify_empty (struct GNUNET_MQ_MessageQueue *mqm,
- GNUNET_MQ_NotifyCallback cb,
- void *cls);
-
-
-/**
- * Call a callback if reading encountered an error.
- *
- * @param mqm the message queue to send the notification for
- * @param cb the callback to call on a read error
- * @param cls closure for cb
- * @deprecated, integrate with queue creation
- */
-void
-GNUNET_MQ_notify_read_error (struct GNUNET_MQ_MessageQueue *mqm,
- GNUNET_MQ_NotifyCallback cb,
- void *cls);
-
-
-/**
- * Destroy the message queue.
- *
- * @param mq message queue to destroy
- */
-void
-GNUNET_MQ_destroy (struct GNUNET_MQ_MessageQueue *mq);
-
-#endif
Modified: gnunet/src/set/set_api.c
===================================================================
--- gnunet/src/set/set_api.c 2013-05-22 10:27:24 UTC (rev 27250)
+++ gnunet/src/set/set_api.c 2013-05-22 10:29:15 UTC (rev 27251)
@@ -1,6 +1,6 @@
/*
This file is part of GNUnet.
- (C) 2012 Christian Grothoff (and other contributing authors)
+ (C) 2012, 2013 Christian Grothoff (and other contributing authors)
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
@@ -29,8 +29,6 @@
#include "gnunet_client_lib.h"
#include "gnunet_set_service.h"
#include "set.h"
-#include "mq.h"
-#include <inttypes.h>
#define LOG(kind,...) GNUNET_log_from (kind, "set-api",__VA_ARGS__)
@@ -61,7 +59,6 @@
void *result_cls;
struct GNUNET_SET_Handle *set;
uint32_t request_id;
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
};
@@ -104,11 +101,6 @@
* and this is the last result message we get */
if (htons (msg->result_status) != GNUNET_SET_STATUS_OK)
{
- if (GNUNET_SCHEDULER_NO_TASK != oh->timeout_task)
- {
- GNUNET_SCHEDULER_cancel (oh->timeout_task);
- oh->timeout_task = GNUNET_SCHEDULER_NO_TASK;
- }
GNUNET_MQ_assoc_remove (set->mq, ntohl (msg->request_id));
if (NULL != oh->result_cb)
oh->result_cb (oh->result_cls, NULL, htons (msg->result_status));
@@ -264,26 +256,6 @@
/**
- * Signature of the main function of a task.
- *
- * @param cls closure
- * @param tc context information (why was this task triggered now)
- */
-static void
-operation_timeout_task (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext * tc)
-{
- struct GNUNET_SET_OperationHandle *oh = cls;
- oh->timeout_task = GNUNET_SCHEDULER_NO_TASK;
- if (NULL != oh->result_cb)
- oh->result_cb (oh->result_cls, NULL, GNUNET_SET_STATUS_TIMEOUT);
- oh->result_cb = NULL;
- oh->result_cls = NULL;
- GNUNET_SET_operation_cancel (oh);
-}
-
-
-/**
* Evaluate a set operation with our set and the set of another peer.
*
* @param set set to use
@@ -294,8 +266,6 @@
* @param salt salt used for the set operation; sometimes set operations
* fail due to hash collisions, using a different salt for each
operation
* makes it harder for an attacker to exploit this
- * @param timeout result_cb will be called with GNUNET_SET_STATUS_TIMEOUT
- * if the operation is not done after the specified time
* @param result_mode specified how results will be returned,
* see 'GNUNET_SET_ResultMode'.
* @param result_cb called on error or success
@@ -308,7 +278,6 @@
const struct GNUNET_HashCode *app_id,
const struct GNUNET_MessageHeader *context_msg,
uint16_t salt,
- struct GNUNET_TIME_Relative timeout,
enum GNUNET_SET_ResultMode result_mode,
GNUNET_SET_ResultIterator result_cb,
void *result_cls)
@@ -331,7 +300,6 @@
if (GNUNET_OK != GNUNET_MQ_nest (mqm, context_msg, ntohs
(context_msg->size)))
GNUNET_assert (0);
- oh->timeout_task = GNUNET_SCHEDULER_add_delayed (timeout,
operation_timeout_task, oh);
GNUNET_MQ_send (set->mq, mqm);
return oh;
@@ -399,7 +367,6 @@
*
* @param request request to accept
* @param set set used for the requested operation
- * @param timeout timeout for the set operation
* @param result_mode specified how results will be returned,
* see 'GNUNET_SET_ResultMode'.
* @param result_cb callback for the results
@@ -409,7 +376,6 @@
struct GNUNET_SET_OperationHandle *
GNUNET_SET_accept (struct GNUNET_SET_Request *request,
struct GNUNET_SET_Handle *set,
- struct GNUNET_TIME_Relative timeout,
enum GNUNET_SET_ResultMode result_mode,
GNUNET_SET_ResultIterator result_cb,
void *result_cls)
@@ -432,8 +398,6 @@
msg->accept_id = htonl (request->accept_id);
GNUNET_MQ_send (set->mq, mqm);
- oh->timeout_task = GNUNET_SCHEDULER_add_delayed (timeout,
operation_timeout_task, oh);
-
return oh;
}
Deleted: gnunet/src/set/test_mq.c
===================================================================
--- gnunet/src/set/test_mq.c 2013-05-22 10:27:24 UTC (rev 27250)
+++ gnunet/src/set/test_mq.c 2013-05-22 10:29:15 UTC (rev 27251)
@@ -1,115 +0,0 @@
-/*
- This file is part of GNUnet.
- (C) 2012 Christian Grothoff (and other contributing authors)
-
- GNUnet is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 3, or (at your
- option) any later version.
-
- GNUnet is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GNUnet; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
-*/
-
-/**
- * @file set/test_mq.c
- * @brief simple tests for mq
- */
-#include "platform.h"
-#include "gnunet_util_lib.h"
-#include "gnunet_testing_lib.h"
-#include "mq.h"
-
-
-GNUNET_NETWORK_STRUCT_BEGIN
-
-struct MyMessage
-{
- struct GNUNET_MessageHeader header;
- uint32_t x GNUNET_PACKED;
-};
-
-GNUNET_NETWORK_STRUCT_END
-
-void
-test1 (void)
-{
- struct GNUNET_MQ_Message *mqm;
- struct MyMessage *mm;
-
- mm = NULL;
- mqm = NULL;
-
- mqm = GNUNET_MQ_msg (mm, 42);
- GNUNET_assert (NULL != mqm);
- GNUNET_assert (NULL != mm);
- GNUNET_assert (42 == ntohs (mm->header.type));
- GNUNET_assert (sizeof (struct MyMessage) == ntohs (mm->header.size));
-}
-
-
-void
-test2 (void)
-{
- struct GNUNET_MQ_Message *mqm;
- struct MyMessage *mm;
- int res;
- char *s = "foo";
-
- mqm = GNUNET_MQ_msg (mm, 42);
- res = GNUNET_MQ_nest (mqm, s, strlen(s));
- GNUNET_assert (GNUNET_OK == res);
- res = GNUNET_MQ_nest (mqm, s, strlen(s));
- GNUNET_assert (GNUNET_OK == res);
- res = GNUNET_MQ_nest (mqm, NULL, 0);
- GNUNET_assert (GNUNET_OK == res);
-
- GNUNET_assert (strlen (s) * 2 + sizeof (struct MyMessage) == ntohs
(mm->header.size));
-
- res = GNUNET_MQ_nest_mh (mqm, &mm->header);
- GNUNET_assert (GNUNET_OK == res);
- GNUNET_assert (2 * (strlen (s) * 2 + sizeof (struct MyMessage)) == ntohs
(mm->header.size));
-
- res = GNUNET_MQ_nest (mqm, (void *) 0xF00BA, 0xFFF0);
- GNUNET_assert (GNUNET_OK != res);
-
- GNUNET_MQ_discard (mqm);
-}
-
-
-void
-test3 (void)
-{
- struct GNUNET_MQ_Message *mqm;
- struct GNUNET_MessageHeader *mh;
-
- mqm = GNUNET_MQ_msg_header (42);
- /* how could the above be checked? */
-
- GNUNET_MQ_discard (mqm);
-
- mqm = GNUNET_MQ_msg_header_extra (mh, 20, 42);
- GNUNET_assert (42 == ntohs (mh->type));
- GNUNET_assert (sizeof (struct GNUNET_MessageHeader) + 20 == ntohs
(mh->size));
-}
-
-
-int
-main (int argc, char **argv)
-{
-
- GNUNET_log_setup ("test-mq", "INFO", NULL);
- test1 ();
- test2 ();
- test3 ();
-
- return 0;
-}
-
Deleted: gnunet/src/set/test_mq_client.c
===================================================================
--- gnunet/src/set/test_mq_client.c 2013-05-22 10:27:24 UTC (rev 27250)
+++ gnunet/src/set/test_mq_client.c 2013-05-22 10:29:15 UTC (rev 27251)
@@ -1,181 +0,0 @@
-/*
- This file is part of GNUnet.
- (C) 2012 Christian Grothoff (and other contributing authors)
-
- GNUnet is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 3, or (at your
- option) any later version.
-
- GNUnet is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GNUnet; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
-*/
-
-/**
- * @file set/test_mq.c
- * @brief tests for mq with connection client
- */
-/**
- * @file util/test_server_with_client.c
- * @brief tests for server.c and client.c,
- * specifically disconnect_notify,
- * client_get_address and receive_done (resume processing)
- */
-#include "platform.h"
-#include "gnunet_common.h"
-#include "gnunet_scheduler_lib.h"
-#include "gnunet_client_lib.h"
-#include "gnunet_server_lib.h"
-#include "gnunet_time_lib.h"
-#include "mq.h"
-
-#define PORT 23336
-
-#define MY_TYPE 128
-
-
-static struct GNUNET_SERVER_Handle *server;
-
-static struct GNUNET_CLIENT_Connection *client;
-
-static struct GNUNET_CONFIGURATION_Handle *cfg;
-
-static int ok;
-
-static int notify = GNUNET_NO;
-
-static int received = 0;
-
-
-static void
-recv_cb (void *cls, struct GNUNET_SERVER_Client *argclient,
- const struct GNUNET_MessageHeader *message)
-{
- received++;
-
- printf ("received\n");
-
-
- if ((received == 2) && (GNUNET_YES == notify))
- {
- printf ("done\n");
- GNUNET_SERVER_receive_done (argclient, GNUNET_NO);
- return;
- }
-
- GNUNET_SERVER_receive_done (argclient, GNUNET_YES);
-}
-
-
-static void
-clean_up (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
-{
- GNUNET_SERVER_destroy (server);
- server = NULL;
- GNUNET_CONFIGURATION_destroy (cfg);
- cfg = NULL;
-}
-
-
-/**
- * Functions with this signature are called whenever a client
- * is disconnected on the network level.
- *
- * @param cls closure
- * @param client identification of the client
- */
-static void
-notify_disconnect (void *cls, struct GNUNET_SERVER_Client *client)
-{
- if (client == NULL)
- return;
- ok = 0;
- GNUNET_SCHEDULER_add_now (&clean_up, NULL);
-}
-
-
-static struct GNUNET_SERVER_MessageHandler handlers[] = {
- {&recv_cb, NULL, MY_TYPE, sizeof (struct GNUNET_MessageHeader)},
- {NULL, NULL, 0, 0}
-};
-
-void send_cb (void *cls)
-{
- printf ("notify sent\n");
- notify = GNUNET_YES;
-}
-
-void test_mq (struct GNUNET_CLIENT_Connection *client)
-{
- struct GNUNET_MQ_MessageQueue *mq;
- struct GNUNET_MQ_Message *mqm;
-
- /* FIXME: test handling responses */
- mq = GNUNET_MQ_queue_for_connection_client (client, NULL, NULL);
-
- mqm = GNUNET_MQ_msg_header (MY_TYPE);
- GNUNET_MQ_send (mq, mqm);
-
- mqm = GNUNET_MQ_msg_header (MY_TYPE);
- GNUNET_MQ_notify_sent (mqm, send_cb, NULL);
- GNUNET_MQ_send (mq, mqm);
-
- /* FIXME: add a message that will be canceled */
-}
-
-
-static void
-task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
-{
- struct sockaddr_in sa;
- struct sockaddr *sap[2];
- socklen_t slens[2];
-
- sap[0] = (struct sockaddr *) &sa;
- slens[0] = sizeof (sa);
- sap[1] = NULL;
- slens[1] = 0;
- memset (&sa, 0, sizeof (sa));
-#if HAVE_SOCKADDR_IN_SIN_LEN
- sa.sin_len = sizeof (sa);
-#endif
- sa.sin_family = AF_INET;
- sa.sin_port = htons (PORT);
- server =
- GNUNET_SERVER_create (NULL, NULL, sap, slens,
- GNUNET_TIME_relative_multiply
- (GNUNET_TIME_UNIT_MILLISECONDS, 250), GNUNET_NO);
- GNUNET_assert (server != NULL);
- handlers[0].callback_cls = cls;
- GNUNET_SERVER_add_handlers (server, handlers);
- GNUNET_SERVER_disconnect_notify (server, ¬ify_disconnect, cls);
- cfg = GNUNET_CONFIGURATION_create ();
- GNUNET_CONFIGURATION_set_value_number (cfg, "test", "PORT", PORT);
- GNUNET_CONFIGURATION_set_value_string (cfg, "test", "HOSTNAME", "localhost");
- GNUNET_CONFIGURATION_set_value_string (cfg, "resolver", "HOSTNAME",
- "localhost");
- client = GNUNET_CLIENT_connect ("test", cfg);
- GNUNET_assert (client != NULL);
-
- test_mq (client);
-}
-
-
-int
-main (int argc, char *argv[])
-{
- GNUNET_log_setup ("test-mq-client",
- "INFO",
- NULL);
- ok = 1;
- GNUNET_SCHEDULER_run (&task, NULL);
- return ok;
-}
-
Modified: gnunet/src/set/test_set_api.c
===================================================================
--- gnunet/src/set/test_set_api.c 2013-05-22 10:27:24 UTC (rev 27250)
+++ gnunet/src/set/test_set_api.c 2013-05-22 10:29:15 UTC (rev 27251)
@@ -29,26 +29,57 @@
static struct GNUNET_PeerIdentity local_id;
+
static struct GNUNET_HashCode app_id;
static struct GNUNET_SET_Handle *set1;
static struct GNUNET_SET_Handle *set2;
static struct GNUNET_SET_ListenHandle *listen_handle;
const static struct GNUNET_CONFIGURATION_Handle *config;
+int num_done;
+
static void
-result_cb_set1 (void *cls, struct GNUNET_SET_Element *element,
- enum GNUNET_SET_Status status)
+result_cb_set1 (void *cls, const struct GNUNET_SET_Element *element,
+ enum GNUNET_SET_Status status)
{
- GNUNET_log (GNUNET_ERROR_TYPE_INFO, "got result (set 1)\n");
+ switch (status)
+ {
+ case GNUNET_SET_STATUS_OK:
+ printf ("set 1: got element\n");
+ break;
+ case GNUNET_SET_STATUS_FAILURE:
+ printf ("set 1: failure\n");
+ break;
+ case GNUNET_SET_STATUS_DONE:
+ printf ("set 1: done\n");
+ GNUNET_SET_destroy (set1);
+ break;
+ default:
+ GNUNET_assert (0);
+ }
}
static void
-result_cb_set2 (void *cls, struct GNUNET_SET_Element *element,
+result_cb_set2 (void *cls, const struct GNUNET_SET_Element *element,
enum GNUNET_SET_Status status)
{
- GNUNET_log (GNUNET_ERROR_TYPE_INFO, "got result (set 2)\n");
+ switch (status)
+ {
+ case GNUNET_SET_STATUS_OK:
+ printf ("set 2: got element\n");
+ break;
+ case GNUNET_SET_STATUS_FAILURE:
+ printf ("set 2: failure\n");
+ break;
+ case GNUNET_SET_STATUS_DONE:
+ printf ("set 2: done\n");
+ GNUNET_SET_destroy (set2);
+ break;
+ default:
+ GNUNET_assert (0);
+ }
}
@@ -59,7 +90,9 @@
struct GNUNET_SET_Request *request)
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "listen cb called\n");
- GNUNET_SET_accept (request, set2, GNUNET_TIME_UNIT_FOREVER_REL,
+ GNUNET_SET_listen_cancel (listen_handle);
+
+ GNUNET_SET_accept (request, set2,
GNUNET_SET_RESULT_ADDED, result_cb_set2, NULL);
}
@@ -75,7 +108,7 @@
listen_handle = GNUNET_SET_listen (config, GNUNET_SET_OPERATION_UNION,
&app_id, listen_cb, NULL);
GNUNET_SET_evaluate (set1, &local_id, &app_id, NULL, 42,
- GNUNET_TIME_UNIT_FOREVER_REL, GNUNET_SET_RESULT_ADDED,
+ GNUNET_SET_RESULT_ADDED,
result_cb_set1, NULL);
}
@@ -120,7 +153,6 @@
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "initialized set 1\n");
}
-
/**
* Signature of the 'main' function for a (single-peer) testcase that
* is run using 'GNUNET_TESTING_peer_run'.
Modified: gnunet/src/stream/stream_api.c
===================================================================
--- gnunet/src/stream/stream_api.c 2013-05-22 10:27:24 UTC (rev 27250)
+++ gnunet/src/stream/stream_api.c 2013-05-22 10:29:15 UTC (rev 27251)
@@ -579,6 +579,37 @@
/**
+ * Collection of the state necessary to read and write gnunet messages
+ * to a stream socket. Should be used as closure for stream_data_processor.
+ */
+struct MQStreamState
+{
+ /**
+ * Message stream tokenizer for the data received from the
+ * stream socket.
+ */
+ struct GNUNET_SERVER_MessageStreamTokenizer *mst;
+
+ /**
+ * The stream socket to use for receiving and transmitting
+ * messages with the message queue.
+ */
+ struct GNUNET_STREAM_Socket *socket;
+
+ /**
+ * Current read handle, NULL if no read active.
+ */
+ struct GNUNET_STREAM_ReadHandle *rh;
+
+ /**
+ * Current write handle, NULL if no write active.
+ */
+ struct GNUNET_STREAM_WriteHandle *wh;
+};
+
+
+
+/**
* Default value in seconds for various timeouts
*/
static const unsigned int default_timeout = 10;
@@ -3731,4 +3762,186 @@
cleanup_read_handle (socket);
}
+
+/**
+ * Functions of this signature are called whenever writing operations
+ * on a stream are executed
+ *
+ * @param cls the closure from GNUNET_STREAM_write
+ * @param status the status of the stream at the time this function is called;
+ * GNUNET_STREAM_OK if writing to stream was completed successfully;
+ * GNUNET_STREAM_TIMEOUT if the given data is not sent successfully
+ * (this doesn't mean that the data is never sent, the receiver may
+ * have read the data but its ACKs may have been lost);
+ * GNUNET_STREAM_SHUTDOWN if the stream is shutdown for writing in the
+ * mean time; GNUNET_STREAM_SYSERR if the stream is broken and cannot
+ * be processed.
+ * @param size the number of bytes written
+ */
+static void
+mq_stream_write_queued (void *cls, enum GNUNET_STREAM_Status status, size_t
size)
+{
+ struct GNUNET_MQ_MessageQueue *mq = cls;
+ struct MQStreamState *mss = (struct MQStreamState *) mq->impl_state;
+ struct GNUNET_MQ_Message *mqm;
+
+ GNUNET_assert (GNUNET_STREAM_OK == status);
+
+ /* call cb for message we finished sending */
+ mqm = mq->current_msg;
+ GNUNET_assert (NULL != mq->current_msg);
+ if (NULL != mqm->sent_cb)
+ mqm->sent_cb (mqm->sent_cls);
+ GNUNET_free (mqm);
+
+ mss->wh = NULL;
+
+ mqm = mq->msg_head;
+ mq->current_msg = mqm;
+ if (NULL == mqm)
+ return;
+ GNUNET_CONTAINER_DLL_remove (mq->msg_head, mq->msg_tail, mqm);
+ mss->wh = GNUNET_STREAM_write (mss->socket, mqm->mh, ntohs (mqm->mh->size),
+ GNUNET_TIME_UNIT_FOREVER_REL,
+ mq_stream_write_queued, mq);
+ GNUNET_assert (NULL != mss->wh);
+}
+
+
+static void
+mq_stream_send_impl (struct GNUNET_MQ_MessageQueue *mq,
+ struct GNUNET_MQ_Message *mqm)
+{
+ struct MQStreamState *mss = (struct MQStreamState *) mq->impl_state;
+
+ if (NULL != mq->current_msg)
+ {
+ GNUNET_CONTAINER_DLL_insert_tail (mq->msg_head, mq->msg_tail, mqm);
+ return;
+ }
+ mq->current_msg = mqm;
+ mss->wh = GNUNET_STREAM_write (mss->socket, mqm->mh, ntohs (mqm->mh->size),
+ GNUNET_TIME_UNIT_FOREVER_REL,
+ mq_stream_write_queued, mq);
+}
+
+
+/**
+ * Functions with this signature are called whenever a
+ * complete message is received by the tokenizer.
+ *
+ * Do not call GNUNET_SERVER_mst_destroy in callback
+ *
+ * @param cls closure
+ * @param client identification of the client
+ * @param message the actual message
+ *
+ * @return GNUNET_OK on success, GNUNET_SYSERR to stop further processing
+ */
+static int
+mq_stream_mst_callback (void *cls, void *client,
+ const struct GNUNET_MessageHeader *message)
+{
+ struct GNUNET_MQ_MessageQueue *mq = cls;
+
+ GNUNET_assert (NULL != message);
+ GNUNET_MQ_dispatch (mq, message);
+ return GNUNET_OK;
+}
+
+
+/**
+ * Functions of this signature are called whenever data is available from the
+ * stream.
+ *
+ * @param cls the closure from GNUNET_STREAM_read
+ * @param status the status of the stream at the time this function is called
+ * @param data traffic from the other side
+ * @param size the number of bytes available in data read; will be 0 on
timeout
+ * @return number of bytes of processed from 'data' (any data remaining should
be
+ * given to the next time the read processor is called).
+ */
+static size_t
+mq_stream_data_processor (void *cls,
+ enum GNUNET_STREAM_Status status,
+ const void *data,
+ size_t size)
+{
+ struct GNUNET_MQ_MessageQueue *mq = cls;
+ struct MQStreamState *mss;
+ int ret;
+
+ mss = (struct MQStreamState *) mq->impl_state;
+ GNUNET_assert (GNUNET_STREAM_OK == status);
+ ret = GNUNET_SERVER_mst_receive (mss->mst, NULL, data, size, GNUNET_NO,
GNUNET_NO);
+ GNUNET_assert (GNUNET_OK == ret);
+ /* we always read all data */
+ mss->rh = GNUNET_STREAM_read (mss->socket, GNUNET_TIME_UNIT_FOREVER_REL,
+ mq_stream_data_processor, mq);
+ return size;
+}
+
+
+static void
+mq_stream_destroy_impl (struct GNUNET_MQ_MessageQueue *mq)
+{
+ struct MQStreamState *mss = (struct MQStreamState *) mq->impl_state;
+
+ if (NULL != mss->rh)
+ {
+ GNUNET_STREAM_read_cancel (mss->rh);
+ mss->rh = NULL;
+ }
+
+ if (NULL != mss->wh)
+ {
+ GNUNET_STREAM_write_cancel (mss->wh);
+ mss->wh = NULL;
+ }
+
+ if (NULL != mss->mst)
+ {
+ GNUNET_SERVER_mst_destroy (mss->mst);
+ mss->mst = NULL;
+ }
+
+ GNUNET_free (mss);
+}
+
+
+
+/**
+ * Create a message queue for a stream socket.
+ *
+ * @param socket the socket to read/write in the message queue
+ * @param msg_handlers message handler array
+ * @param error_handler callback for errors
+ * @return the message queue for the socket
+ */
+struct GNUNET_MQ_MessageQueue *
+GNUNET_STREAM_mq_create (struct GNUNET_STREAM_Socket *socket,
+ const struct GNUNET_MQ_Handler *msg_handlers,
+ GNUNET_MQ_ErrorHandler error_handler,
+ void *cls)
+{
+ struct GNUNET_MQ_MessageQueue *mq;
+ struct MQStreamState *mss;
+
+ mq = GNUNET_new (struct GNUNET_MQ_MessageQueue);
+ mss = GNUNET_new (struct MQStreamState);
+ mss->socket = socket;
+ mq->impl_state = mss;
+ mq->send_impl = mq_stream_send_impl;
+ mq->destroy_impl = mq_stream_destroy_impl;
+ mq->handlers = msg_handlers;
+ mq->handlers_cls = cls;
+ if (NULL != msg_handlers)
+ {
+ mss->mst = GNUNET_SERVER_mst_create (mq_stream_mst_callback, mq);
+ mss->rh = GNUNET_STREAM_read (socket, GNUNET_TIME_UNIT_FOREVER_REL,
+ mq_stream_data_processor, mq);
+ }
+ return mq;
+}
+
/* end of stream_api.c */
Modified: gnunet/src/util/Makefile.am
===================================================================
--- gnunet/src/util/Makefile.am 2013-05-22 10:27:24 UTC (rev 27250)
+++ gnunet/src/util/Makefile.am 2013-05-22 10:29:15 UTC (rev 27251)
@@ -90,6 +90,7 @@
getopt_helpers.c \
helper.c \
load.c \
+ mq.c \
network.c \
os_installation.c \
os_network.c \
@@ -230,6 +231,8 @@
test_connection_timeout \
test_connection_timeout_no_connect \
test_connection_transmit_cancel \
+ test_mq \
+ test_mq_client \
test_os_network \
test_os_priority \
test_peer \
@@ -416,6 +419,16 @@
test_connection_transmit_cancel_LDADD = \
$(top_builddir)/src/util/libgnunetutil.la
+test_mq_SOURCES = \
+ test_mq.c
+test_mq_LDADD = \
+ $(top_builddir)/src/util/libgnunetutil.la
+
+test_mq_client_SOURCES = \
+ test_mq_client.c
+test_mq_client_LDADD = \
+ $(top_builddir)/src/util/libgnunetutil.la
+
test_os_network_SOURCES = \
test_os_network.c
test_os_network_LDADD = \
Added: gnunet/src/util/mq.c
===================================================================
--- gnunet/src/util/mq.c (rev 0)
+++ gnunet/src/util/mq.c 2013-05-22 10:29:15 UTC (rev 27251)
@@ -0,0 +1,481 @@
+/*
+ This file is part of GNUnet.
+ (C) 2012 Christian Grothoff (and other contributing authors)
+
+ GNUnet is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 2, or (at your
+ option) any later version.
+
+ GNUnet is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNUnet; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+/**
+ * @author Florian Dold
+ * @file util/mq.c
+ * @brief general purpose request queue
+ */
+
+#include "platform.h"
+#include "gnunet_common.h"
+#include "gnunet_util_lib.h"
+
+#define LOG(kind,...) GNUNET_log_from (kind, "mq",__VA_ARGS__)
+
+
+
+struct ServerClientSocketState
+{
+ struct GNUNET_SERVER_Client *client;
+ struct GNUNET_SERVER_TransmitHandle* th;
+};
+
+
+struct ClientConnectionState
+{
+ /**
+ * Did we call receive?
+ */
+ int receive_active;
+ struct GNUNET_CLIENT_Connection *connection;
+ struct GNUNET_CLIENT_TransmitHandle *th;
+};
+
+
+
+
+/**
+ * Call the right callback for a message.
+ *
+ * @param mq message queue with the handlers
+ * @param mh message to dispatch
+ */
+void
+GNUNET_MQ_dispatch (struct GNUNET_MQ_MessageQueue *mq, const struct
GNUNET_MessageHeader *mh)
+{
+ const struct GNUNET_MQ_Handler *handler;
+ int handled = GNUNET_NO;
+
+ handler = mq->handlers;
+ if (NULL == handler)
+ return;
+ for (; NULL != handler->cb; handler++)
+ {
+ if (handler->type == ntohs (mh->type))
+ {
+ handler->cb (mq->handlers_cls, mh);
+ handled = GNUNET_YES;
+ }
+ }
+
+ if (GNUNET_NO == handled)
+ LOG (GNUNET_ERROR_TYPE_WARNING, "no handler for message of type %d\n",
ntohs (mh->type));
+}
+
+
+void
+GNUNET_MQ_discard (struct GNUNET_MQ_Message *mqm)
+{
+ GNUNET_assert (NULL == mqm->parent_queue);
+ GNUNET_free (mqm);
+}
+
+
+/**
+ * Send a message with the give message queue.
+ * May only be called once per message.
+ *
+ * @param mq message queue
+ * @param mqm the message to send.
+ */
+void
+GNUNET_MQ_send (struct GNUNET_MQ_MessageQueue *mq, struct GNUNET_MQ_Message
*mqm)
+{
+ GNUNET_assert (NULL != mq);
+ mq->send_impl (mq, mqm);
+}
+
+
+struct GNUNET_MQ_Message *
+GNUNET_MQ_msg_ (struct GNUNET_MessageHeader **mhp, uint16_t size, uint16_t
type)
+{
+ struct GNUNET_MQ_Message *mqm;
+
+ mqm = GNUNET_malloc (sizeof *mqm + size);
+ mqm->mh = (struct GNUNET_MessageHeader *) &mqm[1];
+ mqm->mh->size = htons (size);
+ mqm->mh->type = htons (type);
+ if (NULL != mhp)
+ *mhp = mqm->mh;
+ return mqm;
+}
+
+
+int
+GNUNET_MQ_nest_ (struct GNUNET_MQ_Message **mqmp,
+ const void *data, uint16_t len)
+{
+ size_t new_size;
+ size_t old_size;
+
+ GNUNET_assert (NULL != mqmp);
+ /* there's no data to append => do nothing */
+ if (NULL == data)
+ return GNUNET_OK;
+ old_size = ntohs ((*mqmp)->mh->size);
+ /* message too large to concatenate? */
+ if (((uint16_t) (old_size + len)) < len)
+ return GNUNET_SYSERR;
+ new_size = old_size + len;
+ *mqmp = GNUNET_realloc (*mqmp, sizeof (struct GNUNET_MQ_Message) + new_size);
+ (*mqmp)->mh = (struct GNUNET_MessageHeader *) &(*mqmp)[1];
+ memcpy (((void *) (*mqmp)->mh) + old_size, data, new_size - old_size);
+ (*mqmp)->mh->size = htons (new_size);
+ return GNUNET_OK;
+}
+
+
+
+
+/*** Transmit a queued message to the session's client.
+ *
+ * @param cls consensus session
+ * @param size number of bytes available in buf
+ * @param buf where the callee should write the message
+ * @return number of bytes written to buf
+ */
+static size_t
+transmit_queued (void *cls, size_t size,
+ void *buf)
+{
+ struct GNUNET_MQ_MessageQueue *mq = cls;
+ struct GNUNET_MQ_Message *mqm = mq->current_msg;
+ struct ServerClientSocketState *state = mq->impl_state;
+ size_t msg_size;
+
+ GNUNET_assert (NULL != buf);
+
+ if (NULL != mqm->sent_cb)
+ {
+ mqm->sent_cb (mqm->sent_cls);
+ }
+
+ mq->current_msg = NULL;
+ GNUNET_assert (NULL != mqm);
+ msg_size = ntohs (mqm->mh->size);
+ GNUNET_assert (size >= msg_size);
+ memcpy (buf, mqm->mh, msg_size);
+ GNUNET_free (mqm);
+ state->th = NULL;
+
+ if (NULL != mq->msg_head)
+ {
+ mq->current_msg = mq->msg_head;
+ GNUNET_CONTAINER_DLL_remove (mq->msg_head, mq->msg_tail, mq->current_msg);
+ state->th =
+ GNUNET_SERVER_notify_transmit_ready (state->client, msg_size,
+ GNUNET_TIME_UNIT_FOREVER_REL,
+ &transmit_queued, mq);
+ }
+ return msg_size;
+}
+
+
+
+static void
+server_client_destroy_impl (struct GNUNET_MQ_MessageQueue *mq)
+{
+ struct ServerClientSocketState *state;
+
+ GNUNET_assert (NULL != mq);
+ state = mq->impl_state;
+ GNUNET_assert (NULL != state);
+ GNUNET_SERVER_client_drop (state->client);
+ GNUNET_free (state);
+}
+
+static void
+server_client_send_impl (struct GNUNET_MQ_MessageQueue *mq, struct
GNUNET_MQ_Message *mqm)
+{
+ struct ServerClientSocketState *state;
+ int msize;
+
+ GNUNET_assert (NULL != mq);
+ state = mq->impl_state;
+ GNUNET_assert (NULL != state);
+
+ if (NULL != state->th)
+ {
+ GNUNET_CONTAINER_DLL_insert_tail (mq->msg_head, mq->msg_tail, mqm);
+ return;
+ }
+ GNUNET_assert (NULL == mq->msg_head);
+ GNUNET_assert (NULL == mq->current_msg);
+ msize = ntohs (mqm->mh->size);
+ mq->current_msg = mqm;
+ state->th =
+ GNUNET_SERVER_notify_transmit_ready (state->client, msize,
+ GNUNET_TIME_UNIT_FOREVER_REL,
+ &transmit_queued, mq);
+}
+
+
+struct GNUNET_MQ_MessageQueue *
+GNUNET_MQ_queue_for_server_client (struct GNUNET_SERVER_Client *client)
+{
+ struct GNUNET_MQ_MessageQueue *mq;
+ struct ServerClientSocketState *scss;
+
+ mq = GNUNET_new (struct GNUNET_MQ_MessageQueue);
+ scss = GNUNET_new (struct ServerClientSocketState);
+ mq->impl_state = scss;
+ scss->client = client;
+ GNUNET_SERVER_client_keep (client);
+ mq->send_impl = server_client_send_impl;
+ mq->destroy_impl = server_client_destroy_impl;
+ return mq;
+}
+
+
+/**
+ * Type of a function to call when we receive a message
+ * from the service.
+ *
+ * @param cls closure
+ * @param msg message received, NULL on timeout or fatal error
+ */
+static void
+handle_client_message (void *cls,
+ const struct GNUNET_MessageHeader *msg)
+{
+ struct GNUNET_MQ_MessageQueue *mq = cls;
+ struct ClientConnectionState *state;
+
+ state = mq->impl_state;
+
+ if (NULL == msg)
+ {
+ if (NULL == mq->error_handler)
+ LOG (GNUNET_ERROR_TYPE_WARNING, "ignoring read error (no handler
installed)\n");
+ mq->error_handler (mq->handlers_cls, GNUNET_MQ_ERROR_READ);
+ return;
+ }
+
+ GNUNET_CLIENT_receive (state->connection, handle_client_message, mq,
+ GNUNET_TIME_UNIT_FOREVER_REL);
+
+ GNUNET_MQ_dispatch (mq, msg);
+}
+
+
+/**
+ * Transmit a queued message to the session's client.
+ *
+ * @param cls consensus session
+ * @param size number of bytes available in buf
+ * @param buf where the callee should write the message
+ * @return number of bytes written to buf
+ */
+static size_t
+connection_client_transmit_queued (void *cls, size_t size,
+ void *buf)
+{
+ struct GNUNET_MQ_MessageQueue *mq = cls;
+ struct GNUNET_MQ_Message *mqm = mq->current_msg;
+ struct ClientConnectionState *state = mq->impl_state;
+ size_t msg_size;
+
+ if (NULL == buf)
+ {
+ if (NULL == mq->error_handler)
+ {
+ LOG (GNUNET_ERROR_TYPE_WARNING, "read error, but no error handler
installed\n");
+ return 0;
+ }
+ mq->error_handler (mq->handlers_cls, GNUNET_MQ_ERROR_READ);
+ return 0;
+ }
+
+ if ((NULL != mq->handlers) && (GNUNET_NO == state->receive_active))
+ {
+ state->receive_active = GNUNET_YES;
+ GNUNET_CLIENT_receive (state->connection, handle_client_message, mq,
+ GNUNET_TIME_UNIT_FOREVER_REL);
+ }
+
+
+ GNUNET_assert (NULL != mqm);
+
+ if (NULL != mqm->sent_cb)
+ {
+ mqm->sent_cb (mqm->sent_cls);
+ }
+
+ mq->current_msg = NULL;
+ GNUNET_assert (NULL != buf);
+ msg_size = ntohs (mqm->mh->size);
+ GNUNET_assert (size >= msg_size);
+ memcpy (buf, mqm->mh, msg_size);
+ GNUNET_free (mqm);
+ state->th = NULL;
+ if (NULL != mq->msg_head)
+ {
+ mq->current_msg = mq->msg_head;
+ GNUNET_CONTAINER_DLL_remove (mq->msg_head, mq->msg_tail, mq->current_msg);
+ state->th =
+ GNUNET_CLIENT_notify_transmit_ready (state->connection, ntohs
(mq->current_msg->mh->size),
+ GNUNET_TIME_UNIT_FOREVER_REL,
GNUNET_NO,
+
&connection_client_transmit_queued, mq);
+ }
+ return msg_size;
+}
+
+
+
+static void
+connection_client_destroy_impl (struct GNUNET_MQ_MessageQueue *mq)
+{
+ GNUNET_free (mq->impl_state);
+}
+
+static void
+connection_client_send_impl (struct GNUNET_MQ_MessageQueue *mq,
+ struct GNUNET_MQ_Message *mqm)
+{
+ struct ClientConnectionState *state = mq->impl_state;
+ int msize;
+
+ GNUNET_assert (NULL != state);
+
+ if (NULL != state->th)
+ {
+ GNUNET_CONTAINER_DLL_insert_tail (mq->msg_head, mq->msg_tail, mqm);
+ return;
+ }
+ GNUNET_assert (NULL == mq->current_msg);
+ mq->current_msg = mqm;
+ msize = ntohs (mqm->mh->size);
+ state->th =
+ GNUNET_CLIENT_notify_transmit_ready (state->connection, msize,
+ GNUNET_TIME_UNIT_FOREVER_REL,
GNUNET_NO,
+ &connection_client_transmit_queued,
mq);
+}
+
+
+
+
+
+struct GNUNET_MQ_MessageQueue *
+GNUNET_MQ_queue_for_connection_client (struct GNUNET_CLIENT_Connection
*connection,
+ const struct GNUNET_MQ_Handler
*handlers,
+ void *cls)
+{
+ struct GNUNET_MQ_MessageQueue *mq;
+ struct ClientConnectionState *state;
+
+ GNUNET_assert (NULL != connection);
+
+ mq = GNUNET_new (struct GNUNET_MQ_MessageQueue);
+ mq->handlers = handlers;
+ mq->handlers_cls = cls;
+ state = GNUNET_new (struct ClientConnectionState);
+ state->connection = connection;
+ mq->impl_state = state;
+ mq->send_impl = connection_client_send_impl;
+ mq->destroy_impl = connection_client_destroy_impl;
+
+ return mq;
+}
+
+
+void
+GNUNET_MQ_replace_handlers (struct GNUNET_MQ_MessageQueue *mq,
+ const struct GNUNET_MQ_Handler *new_handlers,
+ void *cls)
+{
+ mq->handlers = new_handlers;
+ mq->handlers_cls = cls;
+}
+
+
+/**
+ * Associate the assoc_data in mq with a unique request id.
+ *
+ * @param mq message queue, id will be unique for the queue
+ * @param mqm message to associate
+ * @param assoc_data to associate
+ */
+uint32_t
+GNUNET_MQ_assoc_add (struct GNUNET_MQ_MessageQueue *mq,
+ struct GNUNET_MQ_Message *mqm,
+ void *assoc_data)
+{
+ uint32_t id;
+
+ if (NULL == mq->assoc_map)
+ {
+ mq->assoc_map = GNUNET_CONTAINER_multihashmap32_create (8);
+ mq->assoc_id = 1;
+ }
+ id = mq->assoc_id++;
+ GNUNET_CONTAINER_multihashmap32_put (mq->assoc_map, id, assoc_data,
+
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY);
+ return id;
+}
+
+
+
+void *
+GNUNET_MQ_assoc_get (struct GNUNET_MQ_MessageQueue *mq, uint32_t request_id)
+{
+ if (NULL == mq->assoc_map)
+ return NULL;
+ return GNUNET_CONTAINER_multihashmap32_get (mq->assoc_map, request_id);
+}
+
+
+void *
+GNUNET_MQ_assoc_remove (struct GNUNET_MQ_MessageQueue *mq, uint32_t request_id)
+{
+ void *val;
+
+ if (NULL == mq->assoc_map)
+ return NULL;
+ val = GNUNET_CONTAINER_multihashmap32_get (mq->assoc_map, request_id);
+ GNUNET_assert (NULL != val);
+ GNUNET_CONTAINER_multihashmap32_remove (mq->assoc_map, request_id, val);
+ return val;
+}
+
+
+void
+GNUNET_MQ_notify_sent (struct GNUNET_MQ_Message *mqm,
+ GNUNET_MQ_NotifyCallback cb,
+ void *cls)
+{
+ mqm->sent_cb = cb;
+ mqm->sent_cls = cls;
+}
+
+
+void
+GNUNET_MQ_destroy (struct GNUNET_MQ_MessageQueue *mq)
+{
+ /* FIXME: destroy all pending messages in the queue */
+
+ if (NULL != mq->destroy_impl)
+ {
+ mq->destroy_impl (mq);
+ }
+
+ GNUNET_free (mq);
+}
+
Added: gnunet/src/util/test_mq.c
===================================================================
--- gnunet/src/util/test_mq.c (rev 0)
+++ gnunet/src/util/test_mq.c 2013-05-22 10:29:15 UTC (rev 27251)
@@ -0,0 +1,114 @@
+/*
+ This file is part of GNUnet.
+ (C) 2012 Christian Grothoff (and other contributing authors)
+
+ GNUnet is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3, or (at your
+ option) any later version.
+
+ GNUnet is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNUnet; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+/**
+ * @file set/test_mq.c
+ * @brief simple tests for mq
+ */
+#include "platform.h"
+#include "gnunet_util_lib.h"
+#include "gnunet_testing_lib.h"
+
+
+GNUNET_NETWORK_STRUCT_BEGIN
+
+struct MyMessage
+{
+ struct GNUNET_MessageHeader header;
+ uint32_t x GNUNET_PACKED;
+};
+
+GNUNET_NETWORK_STRUCT_END
+
+void
+test1 (void)
+{
+ struct GNUNET_MQ_Message *mqm;
+ struct MyMessage *mm;
+
+ mm = NULL;
+ mqm = NULL;
+
+ mqm = GNUNET_MQ_msg (mm, 42);
+ GNUNET_assert (NULL != mqm);
+ GNUNET_assert (NULL != mm);
+ GNUNET_assert (42 == ntohs (mm->header.type));
+ GNUNET_assert (sizeof (struct MyMessage) == ntohs (mm->header.size));
+}
+
+
+void
+test2 (void)
+{
+ struct GNUNET_MQ_Message *mqm;
+ struct MyMessage *mm;
+ int res;
+ char *s = "foo";
+
+ mqm = GNUNET_MQ_msg (mm, 42);
+ res = GNUNET_MQ_nest (mqm, s, strlen(s));
+ GNUNET_assert (GNUNET_OK == res);
+ res = GNUNET_MQ_nest (mqm, s, strlen(s));
+ GNUNET_assert (GNUNET_OK == res);
+ res = GNUNET_MQ_nest (mqm, NULL, 0);
+ GNUNET_assert (GNUNET_OK == res);
+
+ GNUNET_assert (strlen (s) * 2 + sizeof (struct MyMessage) == ntohs
(mm->header.size));
+
+ res = GNUNET_MQ_nest_mh (mqm, &mm->header);
+ GNUNET_assert (GNUNET_OK == res);
+ GNUNET_assert (2 * (strlen (s) * 2 + sizeof (struct MyMessage)) == ntohs
(mm->header.size));
+
+ res = GNUNET_MQ_nest (mqm, (void *) 0xF00BA, 0xFFF0);
+ GNUNET_assert (GNUNET_OK != res);
+
+ GNUNET_MQ_discard (mqm);
+}
+
+
+void
+test3 (void)
+{
+ struct GNUNET_MQ_Message *mqm;
+ struct GNUNET_MessageHeader *mh;
+
+ mqm = GNUNET_MQ_msg_header (42);
+ /* how could the above be checked? */
+
+ GNUNET_MQ_discard (mqm);
+
+ mqm = GNUNET_MQ_msg_header_extra (mh, 20, 42);
+ GNUNET_assert (42 == ntohs (mh->type));
+ GNUNET_assert (sizeof (struct GNUNET_MessageHeader) + 20 == ntohs
(mh->size));
+}
+
+
+int
+main (int argc, char **argv)
+{
+
+ GNUNET_log_setup ("test-mq", "INFO", NULL);
+ test1 ();
+ test2 ();
+ test3 ();
+
+ return 0;
+}
+
Added: gnunet/src/util/test_mq_client.c
===================================================================
--- gnunet/src/util/test_mq_client.c (rev 0)
+++ gnunet/src/util/test_mq_client.c 2013-05-22 10:29:15 UTC (rev 27251)
@@ -0,0 +1,171 @@
+/*
+ This file is part of GNUnet.
+ (C) 2012 Christian Grothoff (and other contributing authors)
+
+ GNUnet is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3, or (at your
+ option) any later version.
+
+ GNUnet is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNUnet; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+/**
+ * @file util/test_mq_client.c
+ * @brief tests for mq with connection client
+ */
+#include "platform.h"
+#include "gnunet_common.h"
+#include "gnunet_util_lib.h"
+
+#define PORT 23336
+
+#define MY_TYPE 128
+
+
+static struct GNUNET_SERVER_Handle *server;
+
+static struct GNUNET_CLIENT_Connection *client;
+
+static struct GNUNET_CONFIGURATION_Handle *cfg;
+
+static int ok;
+
+static int notify = GNUNET_NO;
+
+static int received = 0;
+
+
+static void
+recv_cb (void *cls, struct GNUNET_SERVER_Client *argclient,
+ const struct GNUNET_MessageHeader *message)
+{
+ received++;
+
+ printf ("received\n");
+
+
+ if ((received == 2) && (GNUNET_YES == notify))
+ {
+ printf ("done\n");
+ GNUNET_SERVER_receive_done (argclient, GNUNET_NO);
+ return;
+ }
+
+ GNUNET_SERVER_receive_done (argclient, GNUNET_YES);
+}
+
+
+static void
+clean_up (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+{
+ GNUNET_SERVER_destroy (server);
+ server = NULL;
+ GNUNET_CONFIGURATION_destroy (cfg);
+ cfg = NULL;
+}
+
+
+/**
+ * Functions with this signature are called whenever a client
+ * is disconnected on the network level.
+ *
+ * @param cls closure
+ * @param client identification of the client
+ */
+static void
+notify_disconnect (void *cls, struct GNUNET_SERVER_Client *client)
+{
+ if (client == NULL)
+ return;
+ ok = 0;
+ GNUNET_SCHEDULER_add_now (&clean_up, NULL);
+}
+
+
+static struct GNUNET_SERVER_MessageHandler handlers[] = {
+ {&recv_cb, NULL, MY_TYPE, sizeof (struct GNUNET_MessageHeader)},
+ {NULL, NULL, 0, 0}
+};
+
+void send_cb (void *cls)
+{
+ printf ("notify sent\n");
+ notify = GNUNET_YES;
+}
+
+void test_mq (struct GNUNET_CLIENT_Connection *client)
+{
+ struct GNUNET_MQ_MessageQueue *mq;
+ struct GNUNET_MQ_Message *mqm;
+
+ /* FIXME: test handling responses */
+ mq = GNUNET_MQ_queue_for_connection_client (client, NULL, NULL);
+
+ mqm = GNUNET_MQ_msg_header (MY_TYPE);
+ GNUNET_MQ_send (mq, mqm);
+
+ mqm = GNUNET_MQ_msg_header (MY_TYPE);
+ GNUNET_MQ_notify_sent (mqm, send_cb, NULL);
+ GNUNET_MQ_send (mq, mqm);
+
+ /* FIXME: add a message that will be canceled */
+}
+
+
+static void
+task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+{
+ struct sockaddr_in sa;
+ struct sockaddr *sap[2];
+ socklen_t slens[2];
+
+ sap[0] = (struct sockaddr *) &sa;
+ slens[0] = sizeof (sa);
+ sap[1] = NULL;
+ slens[1] = 0;
+ memset (&sa, 0, sizeof (sa));
+#if HAVE_SOCKADDR_IN_SIN_LEN
+ sa.sin_len = sizeof (sa);
+#endif
+ sa.sin_family = AF_INET;
+ sa.sin_port = htons (PORT);
+ server =
+ GNUNET_SERVER_create (NULL, NULL, sap, slens,
+ GNUNET_TIME_relative_multiply
+ (GNUNET_TIME_UNIT_MILLISECONDS, 250), GNUNET_NO);
+ GNUNET_assert (server != NULL);
+ handlers[0].callback_cls = cls;
+ GNUNET_SERVER_add_handlers (server, handlers);
+ GNUNET_SERVER_disconnect_notify (server, ¬ify_disconnect, cls);
+ cfg = GNUNET_CONFIGURATION_create ();
+ GNUNET_CONFIGURATION_set_value_number (cfg, "test", "PORT", PORT);
+ GNUNET_CONFIGURATION_set_value_string (cfg, "test", "HOSTNAME", "localhost");
+ GNUNET_CONFIGURATION_set_value_string (cfg, "resolver", "HOSTNAME",
+ "localhost");
+ client = GNUNET_CLIENT_connect ("test", cfg);
+ GNUNET_assert (client != NULL);
+
+ test_mq (client);
+}
+
+
+int
+main (int argc, char *argv[])
+{
+ GNUNET_log_setup ("test-mq-client",
+ "INFO",
+ NULL);
+ ok = 1;
+ GNUNET_SCHEDULER_run (&task, NULL);
+ return ok;
+}
+
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r27251 - in gnunet: po src/consensus src/include src/set src/stream src/util,
gnunet <=