diff options
-rw-r--r-- | src/transport/Makefile.am | 52 | ||||
-rw-r--r-- | src/transport/gnunet-service-transport_neighbours.c | 2 | ||||
-rw-r--r-- | src/transport/test_quota_compliance.c | 4 | ||||
-rw-r--r-- | src/transport/test_quota_compliance_wlan_asymmetric_peer1.conf | 30 | ||||
-rw-r--r-- | src/transport/test_quota_compliance_wlan_asymmetric_peer2.conf | 30 | ||||
-rw-r--r-- | src/transport/test_quota_compliance_wlan_peer1.conf | 30 | ||||
-rw-r--r-- | src/transport/test_quota_compliance_wlan_peer2.conf | 30 | ||||
-rw-r--r-- | src/transport/transport_api.c | 4 |
8 files changed, 153 insertions, 29 deletions
diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am index 0cf817db9..55d47f059 100644 --- a/src/transport/Makefile.am +++ b/src/transport/Makefile.am | |||
@@ -40,6 +40,8 @@ if LINUX | |||
40 | WLAN_API_TEST = test_transport_api_wlan | 40 | WLAN_API_TEST = test_transport_api_wlan |
41 | WLAN_REL_TEST = test_transport_api_reliability_wlan | 41 | WLAN_REL_TEST = test_transport_api_reliability_wlan |
42 | WLAN_UREL_TEST = test_transport_api_unreliability_wlan | 42 | WLAN_UREL_TEST = test_transport_api_unreliability_wlan |
43 | WLAN_QUOTA_TEST = test_quota_compliance_wlan \ | ||
44 | test_quota_compliance_wlan_asymmetric | ||
43 | endif | 45 | endif |
44 | 46 | ||
45 | 47 | ||
@@ -276,6 +278,7 @@ check_PROGRAMS = \ | |||
276 | $(HTTPS_API_TEST) \ | 278 | $(HTTPS_API_TEST) \ |
277 | $(HTTPS_NAT_API_TEST) \ | 279 | $(HTTPS_NAT_API_TEST) \ |
278 | $(HTTPS_API_TIMEOUT_TEST) \ | 280 | $(HTTPS_API_TIMEOUT_TEST) \ |
281 | $(WLAN_API_TEST) \ | ||
279 | test_transport_api_multi \ | 282 | test_transport_api_multi \ |
280 | test_transport_api_reliability_tcp \ | 283 | test_transport_api_reliability_tcp \ |
281 | test_transport_api_reliability_tcp_nat \ | 284 | test_transport_api_reliability_tcp_nat \ |
@@ -286,15 +289,14 @@ check_PROGRAMS = \ | |||
286 | $(HTTP_NAT_REL_TEST) \ | 289 | $(HTTP_NAT_REL_TEST) \ |
287 | $(HTTPS_REL_TEST) \ | 290 | $(HTTPS_REL_TEST) \ |
288 | $(HTTPS_NAT_REL_TEST) \ | 291 | $(HTTPS_NAT_REL_TEST) \ |
292 | $(WLAN_REL_TEST) \ | ||
293 | $(WLAN_UREL_TEST) \ | ||
289 | test_quota_compliance_tcp \ | 294 | test_quota_compliance_tcp \ |
290 | test_quota_compliance_tcp_asymmetric \ | 295 | test_quota_compliance_tcp_asymmetric \ |
291 | test_quota_compliance_udp \ | 296 | test_quota_compliance_udp \ |
292 | $(UNIX_QUOTA_TEST) \ | 297 | $(UNIX_QUOTA_TEST) \ |
293 | $(HTTP_QUOTA_TEST) \ | 298 | $(HTTP_QUOTA_TEST) \ |
294 | $(HTTPS_QUOTA_TEST) \ | 299 | $(WLAN_QUOTA_TEST) |
295 | $(WLAN_API_TEST) \ | ||
296 | $(WLAN_REL_TEST) \ | ||
297 | $(WLAN_UREL_TEST) | ||
298 | 300 | ||
299 | if ENABLE_TEST_RUN | 301 | if ENABLE_TEST_RUN |
300 | TESTS = \ | 302 | TESTS = \ |
@@ -322,6 +324,7 @@ TESTS = \ | |||
322 | $(HTTPS_API_TEST) \ | 324 | $(HTTPS_API_TEST) \ |
323 | $(HTTPS_NAT_API_TEST) \ | 325 | $(HTTPS_NAT_API_TEST) \ |
324 | $(HTTPS_API_TIMEOUT_TEST) \ | 326 | $(HTTPS_API_TIMEOUT_TEST) \ |
327 | $(WLAN_API_TEST) \ | ||
325 | test_transport_api_multi \ | 328 | test_transport_api_multi \ |
326 | test_transport_api_reliability_tcp \ | 329 | test_transport_api_reliability_tcp \ |
327 | test_transport_api_reliability_tcp_nat \ | 330 | test_transport_api_reliability_tcp_nat \ |
@@ -332,15 +335,14 @@ TESTS = \ | |||
332 | $(HTTP_NAT_REL_TEST) \ | 335 | $(HTTP_NAT_REL_TEST) \ |
333 | $(HTTPS_REL_TEST) \ | 336 | $(HTTPS_REL_TEST) \ |
334 | $(HTTPS_NAT_REL_TEST) \ | 337 | $(HTTPS_NAT_REL_TEST) \ |
338 | $(WLAN_REL_TEST) \ | ||
339 | $(WLAN_UREL_TEST) \ | ||
335 | test_quota_compliance_tcp \ | 340 | test_quota_compliance_tcp \ |
336 | test_quota_compliance_tcp_asymmetric \ | 341 | test_quota_compliance_tcp_asymmetric \ |
337 | test_quota_compliance_udp \ | 342 | test_quota_compliance_udp \ |
338 | $(UNIX_QUOTA_TEST) \ | 343 | $(UNIX_QUOTA_TEST) \ |
339 | $(HTTP_QUOTA_TEST) \ | 344 | $(HTTP_QUOTA_TEST) \ |
340 | $(HTTPS_QUOTA_TEST) \ | 345 | $(HTTPS_QUOTA_TEST) |
341 | $(WLAN_API_TEST) \ | ||
342 | $(WLAN_REL_TEST) \ | ||
343 | $(WLAN_UREL_TEST) | ||
344 | endif | 346 | endif |
345 | 347 | ||
346 | test_transport_testing_startstop_SOURCES = \ | 348 | test_transport_testing_startstop_SOURCES = \ |
@@ -655,12 +657,6 @@ test_quota_compliance_tcp_asymmetric_LDADD = \ | |||
655 | $(top_builddir)/src/util/libgnunetutil.la \ | 657 | $(top_builddir)/src/util/libgnunetutil.la \ |
656 | $(top_builddir)/src/transport/libgnunettransporttesting.la | 658 | $(top_builddir)/src/transport/libgnunettransporttesting.la |
657 | 659 | ||
658 | #test_quota_compliance_tcp_asymmetric_send_constant_SOURCES = \ | ||
659 | # test_quota_compliance.c | ||
660 | #test_quota_compliance_tcp_asymmetric_send_constant_LDADD = \ | ||
661 | # $(top_builddir)/src/transport/libgnunettransport.la \ | ||
662 | # $(top_builddir)/src/util/libgnunetutil.la | ||
663 | |||
664 | test_quota_compliance_http_SOURCES = \ | 660 | test_quota_compliance_http_SOURCES = \ |
665 | test_quota_compliance.c | 661 | test_quota_compliance.c |
666 | test_quota_compliance_http_LDADD = \ | 662 | test_quota_compliance_http_LDADD = \ |
@@ -677,12 +673,6 @@ test_quota_compliance_http_asymmetric_LDADD = \ | |||
677 | $(top_builddir)/src/util/libgnunetutil.la \ | 673 | $(top_builddir)/src/util/libgnunetutil.la \ |
678 | $(top_builddir)/src/transport/libgnunettransporttesting.la | 674 | $(top_builddir)/src/transport/libgnunettransporttesting.la |
679 | 675 | ||
680 | #test_quota_compliance_http_asymmetric_send_constant_SOURCES = \ | ||
681 | # test_quota_compliance.c | ||
682 | #test_quota_compliance_http_asymmetric_send_constant_LDADD = \ | ||
683 | # $(top_builddir)/src/transport/libgnunettransport.la \ | ||
684 | # $(top_builddir)/src/util/libgnunetutil.la | ||
685 | |||
686 | test_quota_compliance_https_SOURCES = \ | 676 | test_quota_compliance_https_SOURCES = \ |
687 | test_quota_compliance.c | 677 | test_quota_compliance.c |
688 | test_quota_compliance_https_LDADD = \ | 678 | test_quota_compliance_https_LDADD = \ |
@@ -699,12 +689,6 @@ test_quota_compliance_https_asymmetric_LDADD = \ | |||
699 | $(top_builddir)/src/util/libgnunetutil.la \ | 689 | $(top_builddir)/src/util/libgnunetutil.la \ |
700 | $(top_builddir)/src/transport/libgnunettransporttesting.la | 690 | $(top_builddir)/src/transport/libgnunettransporttesting.la |
701 | 691 | ||
702 | #test_quota_compliance_https_asymmetric_send_constant_SOURCES = \ | ||
703 | # test_quota_compliance.c | ||
704 | #test_quota_compliance_https_asymmetric_send_constant_LDADD = \ | ||
705 | # $(top_builddir)/src/transport/libgnunettransport.la \ | ||
706 | # $(top_builddir)/src/util/libgnunetutil.la | ||
707 | |||
708 | test_quota_compliance_udp_SOURCES = \ | 692 | test_quota_compliance_udp_SOURCES = \ |
709 | test_quota_compliance.c | 693 | test_quota_compliance.c |
710 | test_quota_compliance_udp_LDADD = \ | 694 | test_quota_compliance_udp_LDADD = \ |
@@ -729,6 +713,22 @@ test_quota_compliance_unix_asymmetric_LDADD = \ | |||
729 | $(top_builddir)/src/util/libgnunetutil.la \ | 713 | $(top_builddir)/src/util/libgnunetutil.la \ |
730 | $(top_builddir)/src/transport/libgnunettransporttesting.la | 714 | $(top_builddir)/src/transport/libgnunettransporttesting.la |
731 | 715 | ||
716 | test_quota_compliance_wlan_SOURCES = \ | ||
717 | test_quota_compliance.c | ||
718 | test_quota_compliance_wlan_LDADD = \ | ||
719 | $(top_builddir)/src/transport/libgnunettransport.la \ | ||
720 | $(top_builddir)/src/hello/libgnunethello.la \ | ||
721 | $(top_builddir)/src/util/libgnunetutil.la \ | ||
722 | $(top_builddir)/src/transport/libgnunettransporttesting.la | ||
723 | |||
724 | test_quota_compliance_wlan_asymmetric_SOURCES = \ | ||
725 | test_quota_compliance.c | ||
726 | test_quota_compliance_wlan_asymmetric_LDADD = \ | ||
727 | $(top_builddir)/src/transport/libgnunettransport.la \ | ||
728 | $(top_builddir)/src/hello/libgnunethello.la \ | ||
729 | $(top_builddir)/src/util/libgnunetutil.la \ | ||
730 | $(top_builddir)/src/transport/libgnunettransporttesting.la | ||
731 | |||
732 | test_transport_api_multi_SOURCES = \ | 732 | test_transport_api_multi_SOURCES = \ |
733 | test_transport_api.c | 733 | test_transport_api.c |
734 | test_transport_api_multi_LDADD = \ | 734 | test_transport_api_multi_LDADD = \ |
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c index ce407a382..629dd91bb 100644 --- a/src/transport/gnunet-service-transport_neighbours.c +++ b/src/transport/gnunet-service-transport_neighbours.c | |||
@@ -2169,7 +2169,7 @@ GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer, | |||
2169 | return; | 2169 | return; |
2170 | } | 2170 | } |
2171 | 2171 | ||
2172 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2172 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
2173 | "ATS tells us to switch to address '%s' session %p for " | 2173 | "ATS tells us to switch to address '%s' session %p for " |
2174 | "peer `%s' in state %s (quota in/out %u %u )\n", | 2174 | "peer `%s' in state %s (quota in/out %u %u )\n", |
2175 | (address->address_length != 0) ? GST_plugins_a2s (address): "<inbound>", | 2175 | (address->address_length != 0) ? GST_plugins_a2s (address): "<inbound>", |
diff --git a/src/transport/test_quota_compliance.c b/src/transport/test_quota_compliance.c index ebfbcd5eb..4aae669eb 100644 --- a/src/transport/test_quota_compliance.c +++ b/src/transport/test_quota_compliance.c | |||
@@ -529,7 +529,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
529 | 529 | ||
530 | if (NULL != strstr (test_name, "asymmetric")) | 530 | if (NULL != strstr (test_name, "asymmetric")) |
531 | { | 531 | { |
532 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 532 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
533 | "Running asymmetric test with sending peer unlimited, receiving peer (in/out): %llu/%llu b/s \n", | 533 | "Running asymmetric test with sending peer unlimited, receiving peer (in/out): %llu/%llu b/s \n", |
534 | p2_quota_in, p2_quota_out); | 534 | p2_quota_in, p2_quota_out); |
535 | p1_quota_out = 1024 * 1024 * 1024; | 535 | p1_quota_out = 1024 * 1024 * 1024; |
@@ -537,7 +537,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
537 | } | 537 | } |
538 | else | 538 | else |
539 | { | 539 | { |
540 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 540 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
541 | "Running symmetric test with (in/out) %llu/%llu b/s \n", | 541 | "Running symmetric test with (in/out) %llu/%llu b/s \n", |
542 | p2_quota_in, p2_quota_out); | 542 | p2_quota_in, p2_quota_out); |
543 | } | 543 | } |
diff --git a/src/transport/test_quota_compliance_wlan_asymmetric_peer1.conf b/src/transport/test_quota_compliance_wlan_asymmetric_peer1.conf new file mode 100644 index 000000000..9dd9d1bd6 --- /dev/null +++ b/src/transport/test_quota_compliance_wlan_asymmetric_peer1.conf | |||
@@ -0,0 +1,30 @@ | |||
1 | @INLINE@ template_cfg_peer1.conf | ||
2 | [PATHS] | ||
3 | SERVICEHOME = /tmp/test-transport/api-wlan-p1/ | ||
4 | DEFAULTCONFIG = test_transport_api_wlan_peer1.conf | ||
5 | |||
6 | [transport-wlan] | ||
7 | TESTMODE = 1 | ||
8 | |||
9 | [arm] | ||
10 | PORT = 12164 | ||
11 | UNIXPATH = /tmp/gnunet-p1-service-arm.sock | ||
12 | |||
13 | [statistics] | ||
14 | PORT = 12163 | ||
15 | UNIXPATH = /tmp/gnunet-p1-service-statistics.sock | ||
16 | |||
17 | [resolver] | ||
18 | PORT = 12162 | ||
19 | UNIXPATH = /tmp/gnunet-p1-service-resolver.sock | ||
20 | |||
21 | [peerinfo] | ||
22 | PORT = 12161 | ||
23 | UNIXPATH = /tmp/gnunet-p1-service-peerinfo.sock | ||
24 | |||
25 | [transport] | ||
26 | PORT = 12160 | ||
27 | PLUGINS = wlan | ||
28 | UNIXPATH = /tmp/gnunet-p1-service-transport.sock | ||
29 | |||
30 | |||
diff --git a/src/transport/test_quota_compliance_wlan_asymmetric_peer2.conf b/src/transport/test_quota_compliance_wlan_asymmetric_peer2.conf new file mode 100644 index 000000000..bc868d7d7 --- /dev/null +++ b/src/transport/test_quota_compliance_wlan_asymmetric_peer2.conf | |||
@@ -0,0 +1,30 @@ | |||
1 | @INLINE@ template_cfg_peer2.conf | ||
2 | [PATHS] | ||
3 | SERVICEHOME = /tmp/test-transport/api-wlan-p2/ | ||
4 | DEFAULTCONFIG = test_transport_api_wlan_peer2.conf | ||
5 | |||
6 | [transport-wlan] | ||
7 | INTERFACE = mon1 | ||
8 | TESTMODE = 2 | ||
9 | |||
10 | [arm] | ||
11 | PORT = 12174 | ||
12 | UNIXPATH = /tmp/gnunet-p2-service-arm.sock | ||
13 | |||
14 | [statistics] | ||
15 | PORT = 12173 | ||
16 | UNIXPATH = /tmp/gnunet-p2-service-statistics.sock | ||
17 | |||
18 | [resolver] | ||
19 | PORT = 12172 | ||
20 | UNIXPATH = /tmp/gnunet-p2-service-resolver.sock | ||
21 | |||
22 | [peerinfo] | ||
23 | PORT = 12171 | ||
24 | UNIXPATH = /tmp/gnunet-p2-service-peerinfo.sock | ||
25 | |||
26 | [transport] | ||
27 | PORT = 12170 | ||
28 | PLUGINS = wlan | ||
29 | UNIXPATH = /tmp/gnunet-p2-service-transport.sock | ||
30 | |||
diff --git a/src/transport/test_quota_compliance_wlan_peer1.conf b/src/transport/test_quota_compliance_wlan_peer1.conf new file mode 100644 index 000000000..9dd9d1bd6 --- /dev/null +++ b/src/transport/test_quota_compliance_wlan_peer1.conf | |||
@@ -0,0 +1,30 @@ | |||
1 | @INLINE@ template_cfg_peer1.conf | ||
2 | [PATHS] | ||
3 | SERVICEHOME = /tmp/test-transport/api-wlan-p1/ | ||
4 | DEFAULTCONFIG = test_transport_api_wlan_peer1.conf | ||
5 | |||
6 | [transport-wlan] | ||
7 | TESTMODE = 1 | ||
8 | |||
9 | [arm] | ||
10 | PORT = 12164 | ||
11 | UNIXPATH = /tmp/gnunet-p1-service-arm.sock | ||
12 | |||
13 | [statistics] | ||
14 | PORT = 12163 | ||
15 | UNIXPATH = /tmp/gnunet-p1-service-statistics.sock | ||
16 | |||
17 | [resolver] | ||
18 | PORT = 12162 | ||
19 | UNIXPATH = /tmp/gnunet-p1-service-resolver.sock | ||
20 | |||
21 | [peerinfo] | ||
22 | PORT = 12161 | ||
23 | UNIXPATH = /tmp/gnunet-p1-service-peerinfo.sock | ||
24 | |||
25 | [transport] | ||
26 | PORT = 12160 | ||
27 | PLUGINS = wlan | ||
28 | UNIXPATH = /tmp/gnunet-p1-service-transport.sock | ||
29 | |||
30 | |||
diff --git a/src/transport/test_quota_compliance_wlan_peer2.conf b/src/transport/test_quota_compliance_wlan_peer2.conf new file mode 100644 index 000000000..bc868d7d7 --- /dev/null +++ b/src/transport/test_quota_compliance_wlan_peer2.conf | |||
@@ -0,0 +1,30 @@ | |||
1 | @INLINE@ template_cfg_peer2.conf | ||
2 | [PATHS] | ||
3 | SERVICEHOME = /tmp/test-transport/api-wlan-p2/ | ||
4 | DEFAULTCONFIG = test_transport_api_wlan_peer2.conf | ||
5 | |||
6 | [transport-wlan] | ||
7 | INTERFACE = mon1 | ||
8 | TESTMODE = 2 | ||
9 | |||
10 | [arm] | ||
11 | PORT = 12174 | ||
12 | UNIXPATH = /tmp/gnunet-p2-service-arm.sock | ||
13 | |||
14 | [statistics] | ||
15 | PORT = 12173 | ||
16 | UNIXPATH = /tmp/gnunet-p2-service-statistics.sock | ||
17 | |||
18 | [resolver] | ||
19 | PORT = 12172 | ||
20 | UNIXPATH = /tmp/gnunet-p2-service-resolver.sock | ||
21 | |||
22 | [peerinfo] | ||
23 | PORT = 12171 | ||
24 | UNIXPATH = /tmp/gnunet-p2-service-peerinfo.sock | ||
25 | |||
26 | [transport] | ||
27 | PORT = 12170 | ||
28 | PLUGINS = wlan | ||
29 | UNIXPATH = /tmp/gnunet-p2-service-transport.sock | ||
30 | |||
diff --git a/src/transport/transport_api.c b/src/transport/transport_api.c index ddad8f196..960844f97 100644 --- a/src/transport/transport_api.c +++ b/src/transport/transport_api.c | |||
@@ -477,6 +477,8 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg) | |||
477 | break; | 477 | break; |
478 | } | 478 | } |
479 | n = neighbour_add (h, &cim->id); | 479 | n = neighbour_add (h, &cim->id); |
480 | LOG (GNUNET_ERROR_TYPE_ERROR, "Receiving `%s' message for `%4s' with quota %u\n", | ||
481 | "CONNECT", GNUNET_i2s (&cim->id), ntohl (cim->quota_out.value__)); | ||
480 | GNUNET_BANDWIDTH_tracker_update_quota (&n->out_tracker, cim->quota_out); | 482 | GNUNET_BANDWIDTH_tracker_update_quota (&n->out_tracker, cim->quota_out); |
481 | if (h->nc_cb != NULL) | 483 | if (h->nc_cb != NULL) |
482 | h->nc_cb (h->cls, &n->id, ats, ats_count); | 484 | h->nc_cb (h->cls, &n->id, ats, ats_count); |
@@ -564,6 +566,8 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg) | |||
564 | n = neighbour_find (h, &qm->peer); | 566 | n = neighbour_find (h, &qm->peer); |
565 | if (n == NULL) | 567 | if (n == NULL) |
566 | break; | 568 | break; |
569 | LOG (GNUNET_ERROR_TYPE_ERROR, "Receiving `%s' message for `%4s' with quota %u\n", | ||
570 | "SET_QUOTA", GNUNET_i2s (&qm->peer), ntohl (qm->quota.value__)); | ||
567 | GNUNET_BANDWIDTH_tracker_update_quota (&n->out_tracker, qm->quota); | 571 | GNUNET_BANDWIDTH_tracker_update_quota (&n->out_tracker, qm->quota); |
568 | break; | 572 | break; |
569 | default: | 573 | default: |