diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-01-24 15:17:39 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-01-24 15:17:39 +0000 |
commit | cc495dba9bd5ecbe25a8607a535fd439ec2d03fd (patch) | |
tree | 027da72dab48d804eba81605a19076a4afdbcc1b | |
parent | d7c1aa6d7e8312be7a1614ecb09090e6914b8447 (diff) | |
download | gnunet-cc495dba9bd5ecbe25a8607a535fd439ec2d03fd.tar.gz gnunet-cc495dba9bd5ecbe25a8607a535fd439ec2d03fd.zip |
doxyfixes
-rw-r--r-- | TODO | 2 | ||||
-rw-r--r-- | src/chat/gnunet-chat.c | 5 | ||||
-rw-r--r-- | src/chat/gnunet-service-chat.c | 8 | ||||
-rw-r--r-- | src/fs/Makefile.am | 11 | ||||
-rw-r--r-- | src/fs/fs_download.c | 11 | ||||
-rw-r--r-- | src/fs/fs_test_lib.c | 2 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs.c | 2 | ||||
-rw-r--r-- | src/fs/perf_gnunet_service_fs_p2p_trust.c | 475 | ||||
-rw-r--r-- | src/include/Makefile.am | 4 | ||||
-rw-r--r-- | src/monkey/Makefile.am | 13 | ||||
-rw-r--r-- | src/monkey/gnunet_monkey_action.h (renamed from src/include/gnunet_monkey_action.h) | 0 | ||||
-rw-r--r-- | src/monkey/gnunet_monkey_edb.h (renamed from src/include/gnunet_monkey_edb.h) | 4 | ||||
-rw-r--r-- | src/transport/plugin_transport_wlan.c | 2 | ||||
-rw-r--r-- | src/vpn/gnunet-helper-vpn.c | 2 |
14 files changed, 513 insertions, 28 deletions
@@ -62,6 +62,8 @@ | |||
62 | - Remove KBlocks in gnunet-unindex (see discussion with Kenneth Almquist on gnunet-devs in 9/2009) | 62 | - Remove KBlocks in gnunet-unindex (see discussion with Kenneth Almquist on gnunet-devs in 9/2009) |
63 | - use different queue prioritization for probe-downloads vs. normal downloads | 63 | - use different queue prioritization for probe-downloads vs. normal downloads |
64 | - re-implement gnunet-auto-share | 64 | - re-implement gnunet-auto-share |
65 | - implement 'GNUNET_FS_file_information_create_from_directory', avoiding | ||
66 | code duplication with gnunet-gtk's similar code (!) | ||
65 | * GNUNET-GTK: [CG] | 67 | * GNUNET-GTK: [CG] |
66 | - add tool bar | 68 | - add tool bar |
67 | - do meaningful update to status line (starting up, peer running, #connections, shutdown, ...) | 69 | - do meaningful update to status line (starting up, peer running, #connections, shutdown, ...) |
diff --git a/src/chat/gnunet-chat.c b/src/chat/gnunet-chat.c index b960db043..be6db0ca4 100644 --- a/src/chat/gnunet-chat.c +++ b/src/chat/gnunet-chat.c | |||
@@ -83,7 +83,7 @@ static int do_help (const char *args, const void *xtra); | |||
83 | * @param cls closure, NULL | 83 | * @param cls closure, NULL |
84 | * @param room in which room was the message received? | 84 | * @param room in which room was the message received? |
85 | * @param sender what is the ID of the sender? (maybe NULL) | 85 | * @param sender what is the ID of the sender? (maybe NULL) |
86 | * @param member_info information about the joining member | 86 | * @param meta information about the joining member |
87 | * @param message the message text | 87 | * @param message the message text |
88 | * @param options options for the message | 88 | * @param options options for the message |
89 | * @return GNUNET_OK to accept the message now, GNUNET_NO to | 89 | * @return GNUNET_OK to accept the message now, GNUNET_NO to |
@@ -183,6 +183,7 @@ confirmation_cb (void *cls, | |||
183 | /** | 183 | /** |
184 | * Callback used for notification that another room member has joined or left. | 184 | * Callback used for notification that another room member has joined or left. |
185 | * | 185 | * |
186 | * @param cls closure (not used) | ||
186 | * @param member_info will be non-null if the member is joining, NULL if he is | 187 | * @param member_info will be non-null if the member is joining, NULL if he is |
187 | * leaving | 188 | * leaving |
188 | * @param member_id hash of public key of the user (for unique identification) | 189 | * @param member_id hash of public key of the user (for unique identification) |
@@ -580,7 +581,7 @@ out: | |||
580 | * @param cls closure, NULL | 581 | * @param cls closure, NULL |
581 | * @param args remaining command-line arguments | 582 | * @param args remaining command-line arguments |
582 | * @param cfgfile name of the configuration file used (for saving, can be NULL!) | 583 | * @param cfgfile name of the configuration file used (for saving, can be NULL!) |
583 | * @param cfg configuration | 584 | * @param c configuration |
584 | */ | 585 | */ |
585 | static void | 586 | static void |
586 | run (void *cls, | 587 | run (void *cls, |
diff --git a/src/chat/gnunet-service-chat.c b/src/chat/gnunet-service-chat.c index 4cf869595..e0a46abc4 100644 --- a/src/chat/gnunet-service-chat.c +++ b/src/chat/gnunet-service-chat.c | |||
@@ -19,8 +19,8 @@ | |||
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @file chat/gnunet-service-caht.c | 22 | * @file chat/gnunet-service-chat.c |
23 | * @brief program that tracks template | 23 | * @brief service providing chat functionality |
24 | * @author Christian Grothoff | 24 | * @author Christian Grothoff |
25 | * @author Vitaly Minko | 25 | * @author Vitaly Minko |
26 | */ | 26 | */ |
@@ -1460,7 +1460,7 @@ cleanup_task (void *cls, | |||
1460 | * | 1460 | * |
1461 | * @param cls closure, NULL | 1461 | * @param cls closure, NULL |
1462 | * @param server handle to the server for this service | 1462 | * @param server handle to the server for this service |
1463 | * @param identity the public identity of this peer | 1463 | * @param my_identity the public identity of this peer |
1464 | * @param publicKey the public key of this peer | 1464 | * @param publicKey the public key of this peer |
1465 | */ | 1465 | */ |
1466 | static void | 1466 | static void |
@@ -1479,7 +1479,7 @@ core_init (void *cls, | |||
1479 | * | 1479 | * |
1480 | * @param cls closure, NULL | 1480 | * @param cls closure, NULL |
1481 | * @param server the initialized server | 1481 | * @param server the initialized server |
1482 | * @param cfg configuration to use | 1482 | * @param c configuration to use |
1483 | */ | 1483 | */ |
1484 | static void | 1484 | static void |
1485 | run (void *cls, | 1485 | run (void *cls, |
diff --git a/src/fs/Makefile.am b/src/fs/Makefile.am index 2f67ce36a..fb1772562 100644 --- a/src/fs/Makefile.am +++ b/src/fs/Makefile.am | |||
@@ -152,7 +152,8 @@ check_PROGRAMS = \ | |||
152 | test_gnunet_service_fs_p2p \ | 152 | test_gnunet_service_fs_p2p \ |
153 | perf_gnunet_service_fs_p2p \ | 153 | perf_gnunet_service_fs_p2p \ |
154 | perf_gnunet_service_fs_p2p_dht \ | 154 | perf_gnunet_service_fs_p2p_dht \ |
155 | perf_gnunet_service_fs_p2p_index | 155 | perf_gnunet_service_fs_p2p_index \ |
156 | perf_gnunet_service_fs_p2p_trust | ||
156 | 157 | ||
157 | 158 | ||
158 | if HAVE_PYTHON_PEXPECT | 159 | if HAVE_PYTHON_PEXPECT |
@@ -336,6 +337,14 @@ perf_gnunet_service_fs_p2p_dht_LDADD = \ | |||
336 | $(top_builddir)/src/fs/libgnunetfs.la \ | 337 | $(top_builddir)/src/fs/libgnunetfs.la \ |
337 | $(top_builddir)/src/util/libgnunetutil.la | 338 | $(top_builddir)/src/util/libgnunetutil.la |
338 | 339 | ||
340 | perf_gnunet_service_fs_p2p_trust_SOURCES = \ | ||
341 | perf_gnunet_service_fs_p2p_trust.c | ||
342 | perf_gnunet_service_fs_p2p_trust_LDADD = \ | ||
343 | $(top_builddir)/src/fs/libgnunetfstest.a \ | ||
344 | $(top_builddir)/src/testing/libgnunettesting.la \ | ||
345 | $(top_builddir)/src/fs/libgnunetfs.la \ | ||
346 | $(top_builddir)/src/util/libgnunetutil.la | ||
347 | |||
339 | 348 | ||
340 | do_subst = $(SED) -e 's,[@]PYTHON[@],$(PYTHON),g' | 349 | do_subst = $(SED) -e 's,[@]PYTHON[@],$(PYTHON),g' |
341 | 350 | ||
diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c index 11db7fd10..126868e7b 100644 --- a/src/fs/fs_download.c +++ b/src/fs/fs_download.c | |||
@@ -464,6 +464,7 @@ check_completed (struct GNUNET_FS_DownloadContext *dc) | |||
464 | * the top-level block will move to state BRS_DOWNLOAD_UP. | 464 | * the top-level block will move to state BRS_DOWNLOAD_UP. |
465 | * | 465 | * |
466 | * @param dr one of our request entries | 466 | * @param dr one of our request entries |
467 | * @param dr download request to match against | ||
467 | * @param data plaintext data, starting from the beginning of the file | 468 | * @param data plaintext data, starting from the beginning of the file |
468 | * @param data_len number of bytes in data | 469 | * @param data_len number of bytes in data |
469 | */ | 470 | */ |
@@ -802,12 +803,7 @@ try_top_down_reconstruction (struct GNUNET_FS_DownloadContext *dc, | |||
802 | * Schedule the download of the specified block in the tree. | 803 | * Schedule the download of the specified block in the tree. |
803 | * | 804 | * |
804 | * @param dc overall download this block belongs to | 805 | * @param dc overall download this block belongs to |
805 | * @param chk content-hash-key of the block | 806 | * @param dr request to schedule |
806 | * @param offset offset of the block in the file | ||
807 | * (for IBlocks, the offset is the lowest | ||
808 | * offset of any DBlock in the subtree under | ||
809 | * the IBlock) | ||
810 | * @param depth depth of the block, 0 is the root of the tree | ||
811 | */ | 807 | */ |
812 | static void | 808 | static void |
813 | schedule_block_download (struct GNUNET_FS_DownloadContext *dc, | 809 | schedule_block_download (struct GNUNET_FS_DownloadContext *dc, |
@@ -1690,7 +1686,7 @@ deactivate_fs_download (void *cls) | |||
1690 | * @param file_start_offset desired starting offset for the download | 1686 | * @param file_start_offset desired starting offset for the download |
1691 | * in the original file; requesting tree should not contain | 1687 | * in the original file; requesting tree should not contain |
1692 | * DBLOCKs prior to the file_start_offset | 1688 | * DBLOCKs prior to the file_start_offset |
1693 | * @param file_length desired number of bytes the user wanted to access | 1689 | * @param desired_length desired number of bytes the user wanted to access |
1694 | * (from file_start_offset). Resulting tree should not contain | 1690 | * (from file_start_offset). Resulting tree should not contain |
1695 | * DBLOCKs after file_start_offset + file_length. | 1691 | * DBLOCKs after file_start_offset + file_length. |
1696 | * @return download request tree for the given range of DBLOCKs at | 1692 | * @return download request tree for the given range of DBLOCKs at |
@@ -1788,6 +1784,7 @@ reconstruct_cont (void *cls, | |||
1788 | /** | 1784 | /** |
1789 | * Task requesting the next block from the tree encoder. | 1785 | * Task requesting the next block from the tree encoder. |
1790 | * | 1786 | * |
1787 | * @param cls the 'struct GNUJNET_FS_DownloadContext' we're processing | ||
1791 | * @param tc task context | 1788 | * @param tc task context |
1792 | */ | 1789 | */ |
1793 | static void | 1790 | static void |
diff --git a/src/fs/fs_test_lib.c b/src/fs/fs_test_lib.c index e63c5d596..fd600951c 100644 --- a/src/fs/fs_test_lib.c +++ b/src/fs/fs_test_lib.c | |||
@@ -527,6 +527,7 @@ GNUNET_FS_TEST_daemons_stop (unsigned int total, | |||
527 | struct GNUNET_CONFIGURATION_Handle *gcfg; | 527 | struct GNUNET_CONFIGURATION_Handle *gcfg; |
528 | 528 | ||
529 | GNUNET_assert (total > 0); | 529 | GNUNET_assert (total > 0); |
530 | GNUNET_assert (daemons[0] != NULL); | ||
530 | pg = daemons[0]->group; | 531 | pg = daemons[0]->group; |
531 | gcfg = daemons[0]->gcfg; | 532 | gcfg = daemons[0]->gcfg; |
532 | for (i=0;i<total;i++) | 533 | for (i=0;i<total;i++) |
@@ -540,6 +541,7 @@ GNUNET_FS_TEST_daemons_stop (unsigned int total, | |||
540 | GNUNET_break (GNUNET_OK == | 541 | GNUNET_break (GNUNET_OK == |
541 | GNUNET_DISK_directory_remove (daemons[i]->publish_tmp_file)); | 542 | GNUNET_DISK_directory_remove (daemons[i]->publish_tmp_file)); |
542 | GNUNET_free (daemons[i]->publish_tmp_file); | 543 | GNUNET_free (daemons[i]->publish_tmp_file); |
544 | daemons[i]->publish_tmp_file = NULL; | ||
543 | } | 545 | } |
544 | GNUNET_free (daemons[i]); | 546 | GNUNET_free (daemons[i]); |
545 | daemons[i] = NULL; | 547 | daemons[i] = NULL; |
diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c index deaa04289..66b7a5e93 100644 --- a/src/fs/gnunet-service-fs.c +++ b/src/fs/gnunet-service-fs.c | |||
@@ -39,7 +39,7 @@ | |||
39 | #include "gnunet-service-fs_indexing.h" | 39 | #include "gnunet-service-fs_indexing.h" |
40 | #include "fs.h" | 40 | #include "fs.h" |
41 | 41 | ||
42 | #define DEBUG_FS GNUNET_NO | 42 | #define DEBUG_FS GNUNET_YES |
43 | 43 | ||
44 | /** | 44 | /** |
45 | * Should we introduce random latency in processing? Required for proper | 45 | * Should we introduce random latency in processing? Required for proper |
diff --git a/src/fs/perf_gnunet_service_fs_p2p_trust.c b/src/fs/perf_gnunet_service_fs_p2p_trust.c new file mode 100644 index 000000000..d4e98dbf2 --- /dev/null +++ b/src/fs/perf_gnunet_service_fs_p2p_trust.c | |||
@@ -0,0 +1,475 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet. | ||
3 | (C) 2010 Christian Grothoff (and other contributing authors) | ||
4 | |||
5 | GNUnet is free software; you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License as published | ||
7 | by the Free Software Foundation; either version 3, or (at your | ||
8 | option) any later version. | ||
9 | |||
10 | GNUnet is distributed in the hope that it will be useful, but | ||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU General Public License | ||
16 | along with GNUnet; see the file COPYING. If not, write to the | ||
17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
18 | Boston, MA 02111-1307, USA. | ||
19 | */ | ||
20 | |||
21 | /** | ||
22 | * @file fs/perf_gnunet_service_fs_p2p_trust.c | ||
23 | * @brief profile P2P routing trust mechanism. Creates | ||
24 | * a clique of NUM_DAEMONS (i.e. 3) where two | ||
25 | * peers share (seed) different files and download | ||
26 | * them from each other while all the other peers | ||
27 | * just "leach" those files. Ideally, the seeders | ||
28 | * "learn" that they contribute (to each other), | ||
29 | * and give the other seeder higher priority; | ||
30 | * naturally, this only happens nicely for larger | ||
31 | * files; finally, once the seeders are done, the | ||
32 | * leachers should see fast download rates as well. | ||
33 | * @author Christian Grothoff | ||
34 | * | ||
35 | * Sample outputs: | ||
36 | * - 1 MB, 3 peers: | ||
37 | * Download speed of type `seeder 1' was 3864 KiB/s | ||
38 | * Download speed of type `seeder 2' was 3764 KiB/s | ||
39 | * Download speed of type `leach' was 3592 KiB/s | ||
40 | * Analysis: download too small for trust to go into effect | ||
41 | * - 100 MB, 3 peers: | ||
42 | * Download speed of type `seeder 1' was 4018 KiB/s | ||
43 | * Download speed of type `seeder 2' was 4016 KiB/s | ||
44 | * | ||
45 | * Analysis: leach squeezed out entirely early, then backs off far too | ||
46 | * far => fails to ever recover (code needs improvement...) | ||
47 | * [system load is initially very high, then drops to 0 | ||
48 | * after seeders are done] | ||
49 | */ | ||
50 | #include "platform.h" | ||
51 | #include "fs_test_lib.h" | ||
52 | #include "gnunet_testing_lib.h" | ||
53 | |||
54 | #define VERBOSE GNUNET_NO | ||
55 | |||
56 | /** | ||
57 | * File-size we use for testing. | ||
58 | */ | ||
59 | #define FILESIZE (1024 * 1024 * 100) | ||
60 | |||
61 | /** | ||
62 | * How long until we give up on transmitting the message? | ||
63 | */ | ||
64 | #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 30) | ||
65 | |||
66 | /** | ||
67 | * Number of daemons in clique, must be at least 3 (!). | ||
68 | */ | ||
69 | #define NUM_DAEMONS 3 | ||
70 | |||
71 | /** | ||
72 | * Seed for first file on offer. | ||
73 | */ | ||
74 | #define SEED1 42 | ||
75 | |||
76 | /** | ||
77 | * Seed for second file on offer. | ||
78 | */ | ||
79 | #define SEED2 43 | ||
80 | |||
81 | static struct GNUNET_FS_TestDaemon *daemons[NUM_DAEMONS]; | ||
82 | |||
83 | static int ok; | ||
84 | |||
85 | static struct GNUNET_TIME_Absolute start_time; | ||
86 | |||
87 | static const char *progname; | ||
88 | |||
89 | static struct GNUNET_FS_Uri *uri1; | ||
90 | |||
91 | static struct GNUNET_FS_Uri *uri2; | ||
92 | |||
93 | static void | ||
94 | do_stop (void *cls, | ||
95 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
96 | { | ||
97 | GNUNET_FS_TEST_daemons_stop (NUM_DAEMONS, | ||
98 | daemons); | ||
99 | } | ||
100 | |||
101 | |||
102 | /** | ||
103 | * Master context for 'stat_run'. | ||
104 | */ | ||
105 | struct StatMaster | ||
106 | { | ||
107 | struct GNUNET_STATISTICS_Handle *stat; | ||
108 | unsigned int daemon; | ||
109 | unsigned int value; | ||
110 | }; | ||
111 | |||
112 | struct StatValues | ||
113 | { | ||
114 | const char *subsystem; | ||
115 | const char *name; | ||
116 | }; | ||
117 | |||
118 | /** | ||
119 | * Statistics we print out. | ||
120 | */ | ||
121 | static struct StatValues stats[] = | ||
122 | { | ||
123 | { "fs", "# queries forwarded"}, | ||
124 | { "fs", "# replies received and matched"}, | ||
125 | { "fs", "# results found locally"}, | ||
126 | { "fs", "# requests forwarded due to high load"}, | ||
127 | { "fs", "# requests done for free (low load)"}, | ||
128 | { "fs", "# requests dropped, priority insufficient"}, | ||
129 | { "fs", "# requests done for a price (normal load)"}, | ||
130 | { "fs", "# requests dropped by datastore (queue length limit)"}, | ||
131 | { "fs", "# P2P searches received"}, | ||
132 | { "fs", "# P2P searches discarded (queue length bound)"}, | ||
133 | { "fs", "# replies received for local clients"}, | ||
134 | { "fs", "# queries retransmitted to same target"}, | ||
135 | { "fs", "cummulative artificial delay introduced (ms)"}, | ||
136 | { "core", "# bytes decrypted"}, | ||
137 | { "core", "# bytes encrypted"}, | ||
138 | { "core", "# discarded CORE_SEND requests"}, | ||
139 | { "core", "# discarded CORE_SEND request bytes"}, | ||
140 | { "core", "# discarded lower priority CORE_SEND requests"}, | ||
141 | { "core", "# discarded lower priority CORE_SEND request bytes"}, | ||
142 | { "transport", "# bytes received via TCP"}, | ||
143 | { "transport", "# bytes transmitted via TCP"}, | ||
144 | { "datacache", "# bytes stored"}, | ||
145 | { NULL, NULL} | ||
146 | }; | ||
147 | |||
148 | |||
149 | /** | ||
150 | * Callback function to process statistic values. | ||
151 | * | ||
152 | * @param cls closure | ||
153 | * @param subsystem name of subsystem that created the statistic | ||
154 | * @param name the name of the datum | ||
155 | * @param value the current value | ||
156 | * @param is_persistent GNUNET_YES if the value is persistent, GNUNET_NO if not | ||
157 | * @return GNUNET_OK to continue, GNUNET_SYSERR to abort iteration | ||
158 | */ | ||
159 | static int | ||
160 | print_stat (void *cls, | ||
161 | const char *subsystem, | ||
162 | const char *name, | ||
163 | uint64_t value, | ||
164 | int is_persistent) | ||
165 | { | ||
166 | struct StatMaster *sm = cls; | ||
167 | fprintf (stderr, | ||
168 | "Peer %2u: %12s/%50s = %12llu\n", | ||
169 | sm->daemon, | ||
170 | subsystem, | ||
171 | name, | ||
172 | (unsigned long long) value); | ||
173 | return GNUNET_OK; | ||
174 | } | ||
175 | |||
176 | |||
177 | /** | ||
178 | * Function that gathers stats from all daemons. | ||
179 | */ | ||
180 | static void | ||
181 | stat_run (void *cls, | ||
182 | const struct GNUNET_SCHEDULER_TaskContext *tc); | ||
183 | |||
184 | |||
185 | /** | ||
186 | * Function called when GET operation on stats is done. | ||
187 | */ | ||
188 | static void | ||
189 | get_done (void *cls, | ||
190 | int success) | ||
191 | { | ||
192 | struct StatMaster *sm = cls; | ||
193 | GNUNET_break (GNUNET_OK == success); | ||
194 | sm->value++; | ||
195 | GNUNET_SCHEDULER_add_now (&stat_run, sm); | ||
196 | } | ||
197 | |||
198 | |||
199 | /** | ||
200 | * Function that gathers stats from all daemons. | ||
201 | */ | ||
202 | static void | ||
203 | stat_run (void *cls, | ||
204 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
205 | { | ||
206 | struct StatMaster *sm = cls; | ||
207 | |||
208 | if (stats[sm->value].name != NULL) | ||
209 | { | ||
210 | GNUNET_STATISTICS_get (sm->stat, | ||
211 | #if 0 | ||
212 | NULL, NULL, | ||
213 | #else | ||
214 | stats[sm->value].subsystem, | ||
215 | stats[sm->value].name, | ||
216 | #endif | ||
217 | GNUNET_TIME_UNIT_FOREVER_REL, | ||
218 | &get_done, | ||
219 | &print_stat, sm); | ||
220 | return; | ||
221 | } | ||
222 | GNUNET_STATISTICS_destroy (sm->stat, GNUNET_NO); | ||
223 | sm->value = 0; | ||
224 | sm->daemon++; | ||
225 | if (sm->daemon == NUM_DAEMONS) | ||
226 | { | ||
227 | GNUNET_free (sm); | ||
228 | GNUNET_SCHEDULER_add_now (&do_stop, NULL); | ||
229 | return; | ||
230 | } | ||
231 | sm->stat = GNUNET_STATISTICS_create ("<driver>", | ||
232 | GNUNET_FS_TEST_get_configuration (daemons, | ||
233 | sm->daemon)); | ||
234 | GNUNET_SCHEDULER_add_now (&stat_run, sm); | ||
235 | } | ||
236 | |||
237 | |||
238 | static void | ||
239 | do_report (void *cls, | ||
240 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
241 | { | ||
242 | static int download_counter; | ||
243 | const char *type = cls; | ||
244 | struct GNUNET_TIME_Relative del; | ||
245 | char *fancy; | ||
246 | struct StatMaster *sm; | ||
247 | |||
248 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE)) | ||
249 | { | ||
250 | del = GNUNET_TIME_absolute_get_duration (start_time); | ||
251 | if (del.rel_value == 0) | ||
252 | del.rel_value = 1; | ||
253 | fancy = GNUNET_STRINGS_byte_size_fancy (((unsigned long long)FILESIZE) * 1000LL / del.rel_value); | ||
254 | fprintf (stdout, | ||
255 | "Download speed of type `%s' was %s/s\n", | ||
256 | type, | ||
257 | fancy); | ||
258 | GNUNET_free (fancy); | ||
259 | if (NUM_DAEMONS != ++download_counter) | ||
260 | return; /* more downloads to come */ | ||
261 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
262 | "Finished all downloads, shutting down\n", | ||
263 | (unsigned long long) FILESIZE); | ||
264 | sm = GNUNET_malloc (sizeof (struct StatMaster)); | ||
265 | sm->stat = GNUNET_STATISTICS_create ("<driver>", | ||
266 | GNUNET_FS_TEST_get_configuration (daemons, | ||
267 | sm->daemon)); | ||
268 | GNUNET_SCHEDULER_add_now (&stat_run, sm); | ||
269 | } | ||
270 | else | ||
271 | { | ||
272 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
273 | "Timeout during download for type `%s', shutting down with error\n", | ||
274 | type); | ||
275 | ok = 1; | ||
276 | GNUNET_SCHEDULER_add_now (&do_stop, NULL); | ||
277 | } | ||
278 | } | ||
279 | |||
280 | |||
281 | static void | ||
282 | do_downloads (void *cls, | ||
283 | const struct GNUNET_FS_Uri *u2) | ||
284 | { | ||
285 | int anonymity; | ||
286 | unsigned int i; | ||
287 | |||
288 | if (NULL == u2) | ||
289 | { | ||
290 | GNUNET_FS_TEST_daemons_stop (NUM_DAEMONS, | ||
291 | daemons); | ||
292 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
293 | "Timeout during upload attempt, shutting down with error\n"); | ||
294 | ok = 1; | ||
295 | return; | ||
296 | } | ||
297 | uri2 = GNUNET_FS_uri_dup (u2); | ||
298 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
299 | "Downloading %llu bytes\n", | ||
300 | (unsigned long long) FILESIZE); | ||
301 | start_time = GNUNET_TIME_absolute_get (); | ||
302 | if (NULL != strstr (progname, "dht")) | ||
303 | anonymity = 0; | ||
304 | else | ||
305 | anonymity = 1; | ||
306 | /* (semi) leach-download(s); not true leaches since | ||
307 | these peers do participate in sharing, they just | ||
308 | don't have to offer anything *initially*. */ | ||
309 | for (i=0;i<NUM_DAEMONS-2;i++) | ||
310 | GNUNET_FS_TEST_download (daemons[i], | ||
311 | TIMEOUT, | ||
312 | anonymity, | ||
313 | 0 == (i%2) ? SEED1 : SEED2, | ||
314 | 0 == (i%2) ? uri1 : uri2, | ||
315 | VERBOSE, | ||
316 | &do_report, "leach"); | ||
317 | /* mutual downloads of (primary) sharing peers */ | ||
318 | GNUNET_FS_TEST_download (daemons[NUM_DAEMONS-1], | ||
319 | TIMEOUT, | ||
320 | anonymity, SEED1, uri1, | ||
321 | VERBOSE, | ||
322 | &do_report, "seeder 2"); | ||
323 | GNUNET_FS_TEST_download (daemons[NUM_DAEMONS-2], | ||
324 | TIMEOUT, | ||
325 | anonymity, SEED2, uri2, | ||
326 | VERBOSE, | ||
327 | &do_report, "seeder 1"); | ||
328 | } | ||
329 | |||
330 | |||
331 | static void | ||
332 | do_publish2 (void *cls, | ||
333 | const struct GNUNET_FS_Uri *u1) | ||
334 | { | ||
335 | int do_index; | ||
336 | int anonymity; | ||
337 | |||
338 | if (NULL == u1) | ||
339 | { | ||
340 | GNUNET_FS_TEST_daemons_stop (NUM_DAEMONS, | ||
341 | daemons); | ||
342 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
343 | "Timeout during upload attempt, shutting down with error\n"); | ||
344 | ok = 1; | ||
345 | return; | ||
346 | } | ||
347 | uri1 = GNUNET_FS_uri_dup (u1); | ||
348 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
349 | "Publishing %llu bytes\n", | ||
350 | (unsigned long long) FILESIZE); | ||
351 | if (NULL != strstr (progname, "index")) | ||
352 | do_index = GNUNET_YES; | ||
353 | else | ||
354 | do_index = GNUNET_NO; | ||
355 | if (NULL != strstr (progname, "dht")) | ||
356 | anonymity = 0; | ||
357 | else | ||
358 | anonymity = 1; | ||
359 | |||
360 | GNUNET_FS_TEST_publish (daemons[NUM_DAEMONS-2], | ||
361 | TIMEOUT, | ||
362 | anonymity, | ||
363 | do_index, FILESIZE, SEED2, | ||
364 | VERBOSE, | ||
365 | &do_downloads, NULL); | ||
366 | } | ||
367 | |||
368 | static void | ||
369 | do_publish1 (void *cls, | ||
370 | const char *emsg) | ||
371 | { | ||
372 | int do_index; | ||
373 | int anonymity; | ||
374 | |||
375 | if (NULL != emsg) | ||
376 | { | ||
377 | GNUNET_FS_TEST_daemons_stop (NUM_DAEMONS, | ||
378 | daemons); | ||
379 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
380 | "Error trying to connect: %s\n", | ||
381 | emsg); | ||
382 | ok = 1; | ||
383 | return; | ||
384 | } | ||
385 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
386 | "Publishing %llu bytes\n", | ||
387 | (unsigned long long) FILESIZE); | ||
388 | if (NULL != strstr (progname, "index")) | ||
389 | do_index = GNUNET_YES; | ||
390 | else | ||
391 | do_index = GNUNET_NO; | ||
392 | if (NULL != strstr (progname, "dht")) | ||
393 | anonymity = 0; | ||
394 | else | ||
395 | anonymity = 1; | ||
396 | |||
397 | GNUNET_FS_TEST_publish (daemons[NUM_DAEMONS-1], | ||
398 | TIMEOUT, | ||
399 | anonymity, | ||
400 | do_index, FILESIZE, SEED1, | ||
401 | VERBOSE, | ||
402 | &do_publish2, NULL); | ||
403 | } | ||
404 | |||
405 | |||
406 | static void | ||
407 | do_connect (void *cls, | ||
408 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
409 | { | ||
410 | struct GNUNET_TESTING_PeerGroup *pg; | ||
411 | |||
412 | GNUNET_assert (0 != (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE)); | ||
413 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
414 | "Daemons started, will now try to connect them\n"); | ||
415 | pg = GNUNET_FS_TEST_get_group (daemons); | ||
416 | GNUNET_TESTING_create_topology (pg, | ||
417 | GNUNET_TESTING_TOPOLOGY_CLIQUE, | ||
418 | GNUNET_TESTING_TOPOLOGY_NONE, | ||
419 | NULL); | ||
420 | GNUNET_TESTING_connect_topology (pg, | ||
421 | GNUNET_TESTING_TOPOLOGY_CLIQUE, | ||
422 | GNUNET_TESTING_TOPOLOGY_OPTION_NONE, | ||
423 | 0.0, | ||
424 | &do_publish1, | ||
425 | NULL); | ||
426 | } | ||
427 | |||
428 | |||
429 | static void | ||
430 | run (void *cls, | ||
431 | char *const *args, | ||
432 | const char *cfgfile, | ||
433 | const struct GNUNET_CONFIGURATION_Handle *cfg) | ||
434 | { | ||
435 | GNUNET_FS_TEST_daemons_start ("fs_test_lib_data.conf", | ||
436 | TIMEOUT, | ||
437 | NUM_DAEMONS, | ||
438 | daemons, | ||
439 | &do_connect, | ||
440 | NULL); | ||
441 | } | ||
442 | |||
443 | |||
444 | int | ||
445 | main (int argc, char *argv[]) | ||
446 | { | ||
447 | char *const argvx[] = { | ||
448 | "perf-gnunet-service-fs-p2p", | ||
449 | "-c", | ||
450 | "fs_test_lib_data.conf", | ||
451 | #if VERBOSE | ||
452 | "-L", "DEBUG", | ||
453 | #endif | ||
454 | NULL | ||
455 | }; | ||
456 | struct GNUNET_GETOPT_CommandLineOption options[] = { | ||
457 | GNUNET_GETOPT_OPTION_END | ||
458 | }; | ||
459 | progname = argv[0]; | ||
460 | GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-lib/"); | ||
461 | GNUNET_log_setup ("perf_gnunet_service_fs_p2p_index", | ||
462 | #if VERBOSE | ||
463 | "DEBUG", | ||
464 | #else | ||
465 | "WARNING", | ||
466 | #endif | ||
467 | NULL); | ||
468 | GNUNET_PROGRAM_run ((sizeof (argvx) / sizeof (char *)) - 1, | ||
469 | argvx, "perf-gnunet-service-fs-p2p-index", | ||
470 | "nohelp", options, &run, NULL); | ||
471 | GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-lib/"); | ||
472 | return ok; | ||
473 | } | ||
474 | |||
475 | /* end of perf_gnunet_service_fs_p2p_index.c */ | ||
diff --git a/src/include/Makefile.am b/src/include/Makefile.am index bdfa677c6..ea12f3339 100644 --- a/src/include/Makefile.am +++ b/src/include/Makefile.am | |||
@@ -64,6 +64,4 @@ gnunetinclude_HEADERS = \ | |||
64 | gnunet_transport_service.h \ | 64 | gnunet_transport_service.h \ |
65 | gnunet_transport_plugin.h \ | 65 | gnunet_transport_plugin.h \ |
66 | gnunet_upnp_service.h \ | 66 | gnunet_upnp_service.h \ |
67 | gnunet_util_lib.h \ | 67 | gnunet_util_lib.h |
68 | gnunet_monkey_edb.h \ | ||
69 | gnunet_monkey_action.h | ||
diff --git a/src/monkey/Makefile.am b/src/monkey/Makefile.am index 849aeef02..44042dfdd 100644 --- a/src/monkey/Makefile.am +++ b/src/monkey/Makefile.am | |||
@@ -21,12 +21,12 @@ lib_LTLIBRARIES = libmonkeyedb.la \ | |||
21 | libmonkeyedb_la_SOURCES = \ | 21 | libmonkeyedb_la_SOURCES = \ |
22 | edb_api.c \ | 22 | edb_api.c \ |
23 | gnunet_monkey_edb.h | 23 | gnunet_monkey_edb.h |
24 | 24 | ||
25 | libmonkeyedb_la_LIBADD = \ | 25 | libmonkeyedb_la_LIBADD = \ |
26 | $(top_builddir)/src/util/libgnunetutil.la \ | 26 | $(top_builddir)/src/util/libgnunetutil.la \ |
27 | -lsqlite3 \ | 27 | -lsqlite3 \ |
28 | $(GN_LIBINTL) $(XLIB) | 28 | $(GN_LIBINTL) $(XLIB) |
29 | 29 | ||
30 | libmonkeyaction_la_SOURCES = \ | 30 | libmonkeyaction_la_SOURCES = \ |
31 | action_api.c \ | 31 | action_api.c \ |
32 | gnunet_monkey_action.h | 32 | gnunet_monkey_action.h |
@@ -35,7 +35,6 @@ libmonkeyaction_la_LIBADD = \ | |||
35 | $(top_builddir)/src/util/libgnunetutil.la \ | 35 | $(top_builddir)/src/util/libgnunetutil.la \ |
36 | $(GN_LIBINTL) $(XLIB) | 36 | $(GN_LIBINTL) $(XLIB) |
37 | 37 | ||
38 | |||
39 | bin_PROGRAMS = \ | 38 | bin_PROGRAMS = \ |
40 | gnunet-monkey \ | 39 | gnunet-monkey \ |
41 | gnunet-service-monkey | 40 | gnunet-service-monkey |
@@ -80,7 +79,7 @@ gnunet_service_monkey_LDADD = \ | |||
80 | 79 | ||
81 | bug_null_pointer_exception: | 80 | bug_null_pointer_exception: |
82 | gcc -g -O0 -o bug_null_pointer_exception bug_null_pointer_exception.c | 81 | gcc -g -O0 -o bug_null_pointer_exception bug_null_pointer_exception.c |
83 | 82 | ||
84 | check_PROGRAMS = \ | 83 | check_PROGRAMS = \ |
85 | test_monkey_edb | 84 | test_monkey_edb |
86 | #test_gnunet_monkey | 85 | #test_gnunet_monkey |
@@ -95,14 +94,14 @@ test_monkey_edb_SOURCES = \ | |||
95 | test_monkey_edb_LDADD = \ | 94 | test_monkey_edb_LDADD = \ |
96 | $(top_builddir)/src/util/libgnunetutil.la \ | 95 | $(top_builddir)/src/util/libgnunetutil.la \ |
97 | $(top_builddir)/src/monkey/libmonkeyedb.la | 96 | $(top_builddir)/src/monkey/libmonkeyedb.la |
98 | 97 | ||
99 | #test_gnunet_monkey_SOURCES = \ | 98 | #test_gnunet_monkey_SOURCES = \ |
100 | #test_gnunet_monkey.c | 99 | #test_gnunet_monkey.c |
101 | #test_gnunet_monkey_LDADD = \ | 100 | #test_gnunet_monkey_LDADD = \ |
102 | #$(top_builddir)/src/arm/libgnunetarm.la \ | 101 | #$(top_builddir)/src/arm/libgnunetarm.la \ |
103 | #$(top_builddir)/src/util/libgnunetutil.la | 102 | #$(top_builddir)/src/util/libgnunetutil.la |
104 | 103 | ||
105 | 104 | ||
106 | check_SCRIPTS = \ | 105 | check_SCRIPTS = \ |
107 | #test_gnunet_monkey.sh \ | 106 | #test_gnunet_monkey.sh \ |
108 | #test_monkey_npe.sh | 107 | #test_monkey_npe.sh |
diff --git a/src/include/gnunet_monkey_action.h b/src/monkey/gnunet_monkey_action.h index da8f85396..da8f85396 100644 --- a/src/include/gnunet_monkey_action.h +++ b/src/monkey/gnunet_monkey_action.h | |||
diff --git a/src/include/gnunet_monkey_edb.h b/src/monkey/gnunet_monkey_edb.h index af5142a82..b373118f6 100644 --- a/src/include/gnunet_monkey_edb.h +++ b/src/monkey/gnunet_monkey_edb.h | |||
@@ -19,7 +19,7 @@ | |||
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @file include/gnunet_monkey_edb.h | 22 | * @file monkey/gnunet_monkey_edb.h |
23 | * @brief Monkey API for accessing the Expression Database (edb) | 23 | * @brief Monkey API for accessing the Expression Database (edb) |
24 | */ | 24 | */ |
25 | 25 | ||
@@ -64,12 +64,14 @@ typedef int (*GNUNET_MONKEY_ExpressionIterator) (void *, int, char **, | |||
64 | * Run an SQLite query to retrieve those expressions that are previous to | 64 | * Run an SQLite query to retrieve those expressions that are previous to |
65 | * given expression and are in the same scope of the given expression | 65 | * given expression and are in the same scope of the given expression |
66 | * For example, consider the following code snippet: | 66 | * For example, consider the following code snippet: |
67 | * | ||
67 | * { | 68 | * { |
68 | * struct Something whole; // line no.1 | 69 | * struct Something whole; // line no.1 |
69 | * struct SomethingElse part; // line no.2 | 70 | * struct SomethingElse part; // line no.2 |
70 | * whole.part = ∂ // line no.3 | 71 | * whole.part = ∂ // line no.3 |
71 | * whole.part->member = 1; // line no.4 | 72 | * whole.part->member = 1; // line no.4 |
72 | * } | 73 | * } |
74 | * | ||
73 | * If the expression supplied to the function is that of line no.4 "whole.part->member = 1;" | 75 | * If the expression supplied to the function is that of line no.4 "whole.part->member = 1;" |
74 | * The returned list of expressions will be: whole.part (line no.4), whole.part->member (line no.4), | 76 | * The returned list of expressions will be: whole.part (line no.4), whole.part->member (line no.4), |
75 | * whole (line no.3), whole.part (line no.3), &part (line no.3), whole.part = &part (line no.3) | 77 | * whole (line no.3), whole.part (line no.3), &part (line no.3), whole.part = &part (line no.3) |
diff --git a/src/transport/plugin_transport_wlan.c b/src/transport/plugin_transport_wlan.c index e8d4d11c5..f17d37146 100644 --- a/src/transport/plugin_transport_wlan.c +++ b/src/transport/plugin_transport_wlan.c | |||
@@ -893,7 +893,7 @@ get_next_queue_Session (struct Plugin * plugin){ | |||
893 | 893 | ||
894 | /** | 894 | /** |
895 | * Function to sort the message into the message fragment queue | 895 | * Function to sort the message into the message fragment queue |
896 | * @prarm plugin the plugin struct | 896 | * @param plugin the plugin struct |
897 | * @param message to sort into the queue | 897 | * @param message to sort into the queue |
898 | */ | 898 | */ |
899 | static void | 899 | static void |
diff --git a/src/vpn/gnunet-helper-vpn.c b/src/vpn/gnunet-helper-vpn.c index e495b4c3c..1cee01c71 100644 --- a/src/vpn/gnunet-helper-vpn.c +++ b/src/vpn/gnunet-helper-vpn.c | |||
@@ -59,7 +59,7 @@ struct in6_ifreq | |||
59 | /** | 59 | /** |
60 | * Creates a tun-interface called dev; | 60 | * Creates a tun-interface called dev; |
61 | * @param dev is asumed to point to a char[IFNAMSIZ] | 61 | * @param dev is asumed to point to a char[IFNAMSIZ] |
62 | * if *dev == '\0', uses the name supplied by the kernel | 62 | * if *dev == '\\0', uses the name supplied by the kernel |
63 | * @return the fd to the tun or -1 on error | 63 | * @return the fd to the tun or -1 on error |
64 | */ | 64 | */ |
65 | static int | 65 | static int |