diff options
author | Nathan S. Evans <evans@in.tum.de> | 2011-02-24 12:33:03 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2011-02-24 12:33:03 +0000 |
commit | 69310a44f874d645c03bc2aca96673bc78bcfb0d (patch) | |
tree | a3493b1e54498fb0cd9cf1fdde59434dac435805 /src/testing/testing_group.c | |
parent | be11fb77e7339a09e3bbb9f1b30ec7d2e96dfe8d (diff) | |
download | gnunet-69310a44f874d645c03bc2aca96673bc78bcfb0d.tar.gz gnunet-69310a44f874d645c03bc2aca96673bc78bcfb0d.zip |
ugh
Diffstat (limited to 'src/testing/testing_group.c')
-rw-r--r-- | src/testing/testing_group.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/testing/testing_group.c b/src/testing/testing_group.c index 60d3fd141..65457817a 100644 --- a/src/testing/testing_group.c +++ b/src/testing/testing_group.c | |||
@@ -2009,6 +2009,8 @@ create_nated_internet_copy (struct GNUNET_TESTING_PeerGroup *pg, | |||
2009 | int connect_attempts; | 2009 | int connect_attempts; |
2010 | double nat_percentage; | 2010 | double nat_percentage; |
2011 | char *p_string; | 2011 | char *p_string; |
2012 | unsigned int count; | ||
2013 | struct ProgressMeter *conn_meter; | ||
2012 | 2014 | ||
2013 | nat_percentage = 0.6; /* FIXME: default percentage? */ | 2015 | nat_percentage = 0.6; /* FIXME: default percentage? */ |
2014 | if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_string (pg->cfg, | 2016 | if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_string (pg->cfg, |
@@ -2025,6 +2027,19 @@ create_nated_internet_copy (struct GNUNET_TESTING_PeerGroup *pg, | |||
2025 | } | 2027 | } |
2026 | 2028 | ||
2027 | cutoff = (unsigned int) (nat_percentage * pg->total); | 2029 | cutoff = (unsigned int) (nat_percentage * pg->total); |
2030 | count = 0; | ||
2031 | for (outer_count = 0; outer_count < pg->total - 1; outer_count++) | ||
2032 | { | ||
2033 | for (inner_count = outer_count + 1; inner_count < pg->total; | ||
2034 | inner_count++) | ||
2035 | { | ||
2036 | if ((outer_count > cutoff) || (inner_count > cutoff)) | ||
2037 | { | ||
2038 | count++; | ||
2039 | } | ||
2040 | } | ||
2041 | } | ||
2042 | conn_meter = create_meter(count, "NAT COPY", GNUNET_YES); | ||
2028 | connect_attempts = 0; | 2043 | connect_attempts = 0; |
2029 | for (outer_count = 0; outer_count < pg->total - 1; outer_count++) | 2044 | for (outer_count = 0; outer_count < pg->total - 1; outer_count++) |
2030 | { | 2045 | { |
@@ -2040,9 +2055,11 @@ create_nated_internet_copy (struct GNUNET_TESTING_PeerGroup *pg, | |||
2040 | #endif | 2055 | #endif |
2041 | connect_attempts += proc (pg, outer_count, inner_count, list, GNUNET_YES); | 2056 | connect_attempts += proc (pg, outer_count, inner_count, list, GNUNET_YES); |
2042 | add_connections(pg, outer_count, inner_count, ALLOWED, GNUNET_NO); | 2057 | add_connections(pg, outer_count, inner_count, ALLOWED, GNUNET_NO); |
2058 | update_meter(conn_meter); | ||
2043 | } | 2059 | } |
2044 | } | 2060 | } |
2045 | } | 2061 | } |
2062 | free_meter(conn_meter); | ||
2046 | 2063 | ||
2047 | return connect_attempts; | 2064 | return connect_attempts; |
2048 | } | 2065 | } |