diff options
Diffstat (limited to 'src/testbed/generate-underlay-topology.c')
-rw-r--r-- | src/testbed/generate-underlay-topology.c | 375 |
1 files changed, 191 insertions, 184 deletions
diff --git a/src/testbed/generate-underlay-topology.c b/src/testbed/generate-underlay-topology.c index 7857652e0..a463d384a 100644 --- a/src/testbed/generate-underlay-topology.c +++ b/src/testbed/generate-underlay-topology.c | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @file testbed/generate-underlay-topology.c | 22 | * @file testbed/generate-underlay-topology.c |
@@ -30,10 +30,10 @@ | |||
30 | #include "testbed_api_topology.h" | 30 | #include "testbed_api_topology.h" |
31 | #include "sqlite3.h" | 31 | #include "sqlite3.h" |
32 | 32 | ||
33 | #define LOG(type, ...) GNUNET_log (type, __VA_ARGS__) | 33 | #define LOG(type, ...) GNUNET_log(type, __VA_ARGS__) |
34 | 34 | ||
35 | 35 | ||
36 | #define LOG_ERROR(...) LOG (GNUNET_ERROR_TYPE_ERROR, __VA_ARGS__) | 36 | #define LOG_ERROR(...) LOG(GNUNET_ERROR_TYPE_ERROR, __VA_ARGS__) |
37 | 37 | ||
38 | /** | 38 | /** |
39 | * Log an error message at log-level 'level' that indicates | 39 | * Log an error message at log-level 'level' that indicates |
@@ -42,22 +42,22 @@ | |||
42 | */ | 42 | */ |
43 | #define LOG_SQLITE(db, msg, level, cmd) \ | 43 | #define LOG_SQLITE(db, msg, level, cmd) \ |
44 | do \ | 44 | do \ |
45 | { \ | 45 | { \ |
46 | GNUNET_log_from (level, \ | 46 | GNUNET_log_from(level, \ |
47 | "sqlite", \ | 47 | "sqlite", \ |
48 | _ ("`%s' failed at %s:%d with error: %s\n"), \ | 48 | _("`%s' failed at %s:%d with error: %s\n"), \ |
49 | cmd, \ | 49 | cmd, \ |
50 | __FILE__, \ | 50 | __FILE__, \ |
51 | __LINE__, \ | 51 | __LINE__, \ |
52 | sqlite3_errmsg (db)); \ | 52 | sqlite3_errmsg(db)); \ |
53 | if (msg != NULL) \ | 53 | if (msg != NULL) \ |
54 | GNUNET_asprintf (msg, \ | 54 | GNUNET_asprintf (msg, \ |
55 | _ ("`%s' failed at %s:%u with error: %s"), \ | 55 | _("`%s' failed at %s:%u with error: %s"), \ |
56 | cmd, \ | 56 | cmd, \ |
57 | __FILE__, \ | 57 | __FILE__, \ |
58 | __LINE__, \ | 58 | __LINE__, \ |
59 | sqlite3_errmsg (db)); \ | 59 | sqlite3_errmsg(db)); \ |
60 | } while (0) | 60 | } while (0) |
61 | 61 | ||
62 | 62 | ||
63 | /** | 63 | /** |
@@ -98,43 +98,43 @@ static int exit_result; | |||
98 | * @return GNUNET_OK to continue processing; GNUNET_SYSERR to abort | 98 | * @return GNUNET_OK to continue processing; GNUNET_SYSERR to abort |
99 | */ | 99 | */ |
100 | static int | 100 | static int |
101 | link_processor (void *cls, | 101 | link_processor(void *cls, |
102 | unsigned int A, | 102 | unsigned int A, |
103 | unsigned int B, | 103 | unsigned int B, |
104 | unsigned int bandwidth, | 104 | unsigned int bandwidth, |
105 | unsigned int latency, | 105 | unsigned int latency, |
106 | unsigned int loss) | 106 | unsigned int loss) |
107 | { | 107 | { |
108 | if ((SQLITE_OK != sqlite3_bind_int (stmt_insert, 1, A)) || | 108 | if ((SQLITE_OK != sqlite3_bind_int(stmt_insert, 1, A)) || |
109 | (SQLITE_OK != sqlite3_bind_int (stmt_insert, 2, B)) || | 109 | (SQLITE_OK != sqlite3_bind_int(stmt_insert, 2, B)) || |
110 | (SQLITE_OK != sqlite3_bind_int (stmt_insert, 3, bandwidth)) || | 110 | (SQLITE_OK != sqlite3_bind_int(stmt_insert, 3, bandwidth)) || |
111 | (SQLITE_OK != sqlite3_bind_int (stmt_insert, 4, latency)) || | 111 | (SQLITE_OK != sqlite3_bind_int(stmt_insert, 4, latency)) || |
112 | (SQLITE_OK != sqlite3_bind_int (stmt_insert, 5, loss))) | 112 | (SQLITE_OK != sqlite3_bind_int(stmt_insert, 5, loss))) |
113 | { | 113 | { |
114 | LOG_SQLITE (db, NULL, GNUNET_ERROR_TYPE_ERROR, "sqlite3_bind_int"); | 114 | LOG_SQLITE(db, NULL, GNUNET_ERROR_TYPE_ERROR, "sqlite3_bind_int"); |
115 | return GNUNET_SYSERR; | 115 | return GNUNET_SYSERR; |
116 | } | 116 | } |
117 | if (SQLITE_DONE != sqlite3_step (stmt_insert)) | 117 | if (SQLITE_DONE != sqlite3_step(stmt_insert)) |
118 | { | 118 | { |
119 | LOG_SQLITE (db, NULL, GNUNET_ERROR_TYPE_ERROR, "sqlite3_step"); | 119 | LOG_SQLITE(db, NULL, GNUNET_ERROR_TYPE_ERROR, "sqlite3_step"); |
120 | return GNUNET_SYSERR; | 120 | return GNUNET_SYSERR; |
121 | } | 121 | } |
122 | fprintf (stdout, "%u -> %u\n", A, B); | 122 | fprintf(stdout, "%u -> %u\n", A, B); |
123 | GNUNET_break (SQLITE_OK == sqlite3_reset (stmt_insert)); | 123 | GNUNET_break(SQLITE_OK == sqlite3_reset(stmt_insert)); |
124 | //GNUNET_break (SQLITE_OK == sqlite3_clear_bindings (stmt_insert)); | 124 | //GNUNET_break (SQLITE_OK == sqlite3_clear_bindings (stmt_insert)); |
125 | if ((SQLITE_OK != sqlite3_bind_int (stmt_insert, 1, B)) || | 125 | if ((SQLITE_OK != sqlite3_bind_int(stmt_insert, 1, B)) || |
126 | (SQLITE_OK != sqlite3_bind_int (stmt_insert, 2, A))) | 126 | (SQLITE_OK != sqlite3_bind_int(stmt_insert, 2, A))) |
127 | { | 127 | { |
128 | LOG_SQLITE (db, NULL, GNUNET_ERROR_TYPE_ERROR, "sqlite3_bind_int"); | 128 | LOG_SQLITE(db, NULL, GNUNET_ERROR_TYPE_ERROR, "sqlite3_bind_int"); |
129 | return GNUNET_SYSERR; | 129 | return GNUNET_SYSERR; |
130 | } | 130 | } |
131 | if (SQLITE_DONE != sqlite3_step (stmt_insert)) | 131 | if (SQLITE_DONE != sqlite3_step(stmt_insert)) |
132 | { | 132 | { |
133 | LOG_SQLITE (db, NULL, GNUNET_ERROR_TYPE_ERROR, "sqlite3_step"); | 133 | LOG_SQLITE(db, NULL, GNUNET_ERROR_TYPE_ERROR, "sqlite3_step"); |
134 | return GNUNET_SYSERR; | 134 | return GNUNET_SYSERR; |
135 | } | 135 | } |
136 | fprintf (stdout, "%u -> %u\n", B, A); | 136 | fprintf(stdout, "%u -> %u\n", B, A); |
137 | GNUNET_break (SQLITE_OK == sqlite3_reset (stmt_insert)); | 137 | GNUNET_break(SQLITE_OK == sqlite3_reset(stmt_insert)); |
138 | return GNUNET_OK; | 138 | return GNUNET_OK; |
139 | } | 139 | } |
140 | 140 | ||
@@ -148,7 +148,7 @@ link_processor (void *cls, | |||
148 | * to be printed) | 148 | * to be printed) |
149 | */ | 149 | */ |
150 | static int | 150 | static int |
151 | setup_db (const char *dbfile) | 151 | setup_db(const char *dbfile) |
152 | { | 152 | { |
153 | const char *query_create = "CREATE TABLE whitelist (" | 153 | const char *query_create = "CREATE TABLE whitelist (" |
154 | "id INTEGER," | 154 | "id INTEGER," |
@@ -176,28 +176,28 @@ setup_db (const char *dbfile) | |||
176 | int ret; | 176 | int ret; |
177 | 177 | ||
178 | ret = GNUNET_SYSERR; | 178 | ret = GNUNET_SYSERR; |
179 | if (SQLITE_OK != sqlite3_open (dbfile, &db)) | 179 | if (SQLITE_OK != sqlite3_open(dbfile, &db)) |
180 | { | 180 | { |
181 | LOG_SQLITE (db, NULL, GNUNET_ERROR_TYPE_ERROR, "sqlite3_open"); | 181 | LOG_SQLITE(db, NULL, GNUNET_ERROR_TYPE_ERROR, "sqlite3_open"); |
182 | goto err_ret; | 182 | goto err_ret; |
183 | } | 183 | } |
184 | if (0 != sqlite3_exec (db, query_create, NULL, NULL, NULL)) | 184 | if (0 != sqlite3_exec(db, query_create, NULL, NULL, NULL)) |
185 | { | 185 | { |
186 | LOG_SQLITE (db, NULL, GNUNET_ERROR_TYPE_ERROR, "sqlite3_exec"); | 186 | LOG_SQLITE(db, NULL, GNUNET_ERROR_TYPE_ERROR, "sqlite3_exec"); |
187 | fprintf (stderr, | 187 | fprintf(stderr, |
188 | "Error: %d. Perhaps the database `%s' already exits.\n", | 188 | "Error: %d. Perhaps the database `%s' already exits.\n", |
189 | sqlite3_errcode (db), | 189 | sqlite3_errcode(db), |
190 | dbfile); | 190 | dbfile); |
191 | goto err_ret; | 191 | goto err_ret; |
192 | } | 192 | } |
193 | GNUNET_break (0 == | 193 | GNUNET_break(0 == |
194 | sqlite3_exec (db, "PRAGMA synchronous = 0;", NULL, NULL, NULL)); | 194 | sqlite3_exec(db, "PRAGMA synchronous = 0;", NULL, NULL, NULL)); |
195 | if (SQLITE_OK != | 195 | if (SQLITE_OK != |
196 | sqlite3_prepare_v2 (db, query_insert, -1, &stmt_insert, NULL)) | 196 | sqlite3_prepare_v2(db, query_insert, -1, &stmt_insert, NULL)) |
197 | { | 197 | { |
198 | LOG_SQLITE (db, NULL, GNUNET_ERROR_TYPE_ERROR, "sqlite3_prepare_v2"); | 198 | LOG_SQLITE(db, NULL, GNUNET_ERROR_TYPE_ERROR, "sqlite3_prepare_v2"); |
199 | goto err_ret; | 199 | goto err_ret; |
200 | } | 200 | } |
201 | ret = GNUNET_OK; | 201 | ret = GNUNET_OK; |
202 | 202 | ||
203 | err_ret: | 203 | err_ret: |
@@ -214,10 +214,10 @@ err_ret: | |||
214 | * @param cfg the configuration file handle | 214 | * @param cfg the configuration file handle |
215 | */ | 215 | */ |
216 | static void | 216 | static void |
217 | run (void *cls, | 217 | run(void *cls, |
218 | char *const *args, | 218 | char *const *args, |
219 | const char *cfgfile, | 219 | const char *cfgfile, |
220 | const struct GNUNET_CONFIGURATION_Handle *config) | 220 | const struct GNUNET_CONFIGURATION_Handle *config) |
221 | { | 221 | { |
222 | const char *dbfile; | 222 | const char *dbfile; |
223 | const char *topology_string; | 223 | const char *topology_string; |
@@ -231,118 +231,125 @@ run (void *cls, | |||
231 | arg_uint1 = 0; /* make compilers happy */ | 231 | arg_uint1 = 0; /* make compilers happy */ |
232 | arg_uint2 = 0; /* make compilers happy */ | 232 | arg_uint2 = 0; /* make compilers happy */ |
233 | if (NULL == args) | 233 | if (NULL == args) |
234 | { | 234 | { |
235 | LOG_ERROR (_ ("Need at least 2 arguments\n")); | 235 | LOG_ERROR(_("Need at least 2 arguments\n")); |
236 | return; | 236 | return; |
237 | } | 237 | } |
238 | if (NULL == (dbfile = args[argc++])) | 238 | if (NULL == (dbfile = args[argc++])) |
239 | { | ||
240 | LOG_ERROR (_ ("Database filename missing\n")); | ||
241 | return; | ||
242 | } | ||
243 | if (GNUNET_OK != setup_db (dbfile)) | ||
244 | return; | ||
245 | if (NULL == (topology_string = args[argc++])) | ||
246 | { | ||
247 | LOG_ERROR (_ ("Topology string missing\n")); | ||
248 | return; | ||
249 | } | ||
250 | if (GNUNET_YES != GNUNET_TESTBED_topology_get_ (&topology, topology_string)) | ||
251 | { | ||
252 | LOG_ERROR (_ ("Invalid topology: %s\n"), topology_string); | ||
253 | return; | ||
254 | } | ||
255 | arg_str1 = NULL; | ||
256 | /* parse for first TOPOOPT. This can either be arg_uint1 or arg_str1 */ | ||
257 | switch (topology) | ||
258 | { | ||
259 | case GNUNET_TESTBED_TOPOLOGY_ERDOS_RENYI: | ||
260 | case GNUNET_TESTBED_TOPOLOGY_SMALL_WORLD_RING: | ||
261 | case GNUNET_TESTBED_TOPOLOGY_SMALL_WORLD: | ||
262 | case GNUNET_TESTBED_TOPOLOGY_SCALE_FREE: | ||
263 | if (NULL == (value = args[argc++])) | ||
264 | { | 239 | { |
265 | LOG_ERROR (_ ("An argument is missing for given topology `%s'\n"), | 240 | LOG_ERROR(_("Database filename missing\n")); |
266 | topology_string); | ||
267 | return; | 241 | return; |
268 | } | 242 | } |
269 | if (-1 == sscanf (value, "%u", &arg_uint1)) | 243 | if (GNUNET_OK != setup_db(dbfile)) |
244 | return; | ||
245 | if (NULL == (topology_string = args[argc++])) | ||
270 | { | 246 | { |
271 | LOG_ERROR (_ ("Invalid argument `%s' given as topology argument\n"), | 247 | LOG_ERROR(_("Topology string missing\n")); |
272 | value); | ||
273 | return; | 248 | return; |
274 | } | 249 | } |
275 | break; | 250 | if (GNUNET_YES != GNUNET_TESTBED_topology_get_(&topology, topology_string)) |
276 | case GNUNET_TESTBED_TOPOLOGY_FROM_FILE: | ||
277 | if (NULL == (arg_str1 = args[argc++])) | ||
278 | { | 251 | { |
279 | LOG_ERROR (_ ("Filename argument missing for topology `%s'\n"), | 252 | LOG_ERROR(_("Invalid topology: %s\n"), topology_string); |
280 | topology_string); | ||
281 | return; | 253 | return; |
282 | } | 254 | } |
283 | break; | 255 | arg_str1 = NULL; |
284 | default: | 256 | /* parse for first TOPOOPT. This can either be arg_uint1 or arg_str1 */ |
285 | break; | ||
286 | } | ||
287 | /* parse for second TOPOOPT. Only required for SCALE_FREE topology */ | ||
288 | switch (topology) | 257 | switch (topology) |
289 | { | ||
290 | case GNUNET_TESTBED_TOPOLOGY_SCALE_FREE: | ||
291 | if (NULL == (value = args[argc++])) | ||
292 | { | 258 | { |
293 | LOG_ERROR (_ ("Second argument for topology `%s' is missing\n"), | 259 | case GNUNET_TESTBED_TOPOLOGY_ERDOS_RENYI: |
294 | topology_string); | 260 | case GNUNET_TESTBED_TOPOLOGY_SMALL_WORLD_RING: |
295 | return; | 261 | case GNUNET_TESTBED_TOPOLOGY_SMALL_WORLD: |
262 | case GNUNET_TESTBED_TOPOLOGY_SCALE_FREE: | ||
263 | if (NULL == (value = args[argc++])) | ||
264 | { | ||
265 | LOG_ERROR(_("An argument is missing for given topology `%s'\n"), | ||
266 | topology_string); | ||
267 | return; | ||
268 | } | ||
269 | if (-1 == sscanf(value, "%u", &arg_uint1)) | ||
270 | { | ||
271 | LOG_ERROR(_("Invalid argument `%s' given as topology argument\n"), | ||
272 | value); | ||
273 | return; | ||
274 | } | ||
275 | break; | ||
276 | |||
277 | case GNUNET_TESTBED_TOPOLOGY_FROM_FILE: | ||
278 | if (NULL == (arg_str1 = args[argc++])) | ||
279 | { | ||
280 | LOG_ERROR(_("Filename argument missing for topology `%s'\n"), | ||
281 | topology_string); | ||
282 | return; | ||
283 | } | ||
284 | break; | ||
285 | |||
286 | default: | ||
287 | break; | ||
296 | } | 288 | } |
297 | if (-1 == sscanf (value, "%u", &arg_uint2)) | 289 | /* parse for second TOPOOPT. Only required for SCALE_FREE topology */ |
290 | switch (topology) | ||
298 | { | 291 | { |
299 | LOG_ERROR (_ ("Invalid argument `%s'; expecting unsigned int\n"), value); | 292 | case GNUNET_TESTBED_TOPOLOGY_SCALE_FREE: |
300 | return; | 293 | if (NULL == (value = args[argc++])) |
294 | { | ||
295 | LOG_ERROR(_("Second argument for topology `%s' is missing\n"), | ||
296 | topology_string); | ||
297 | return; | ||
298 | } | ||
299 | if (-1 == sscanf(value, "%u", &arg_uint2)) | ||
300 | { | ||
301 | LOG_ERROR(_("Invalid argument `%s'; expecting unsigned int\n"), value); | ||
302 | return; | ||
303 | } | ||
304 | break; | ||
305 | |||
306 | default: | ||
307 | break; | ||
301 | } | 308 | } |
302 | break; | ||
303 | default: | ||
304 | break; | ||
305 | } | ||
306 | /* contruct topologies */ | 309 | /* contruct topologies */ |
307 | switch (topology) | 310 | switch (topology) |
308 | { | 311 | { |
309 | case GNUNET_TESTBED_TOPOLOGY_LINE: | 312 | case GNUNET_TESTBED_TOPOLOGY_LINE: |
310 | case GNUNET_TESTBED_TOPOLOGY_RING: | 313 | case GNUNET_TESTBED_TOPOLOGY_RING: |
311 | case GNUNET_TESTBED_TOPOLOGY_STAR: | 314 | case GNUNET_TESTBED_TOPOLOGY_STAR: |
312 | case GNUNET_TESTBED_TOPOLOGY_CLIQUE: | 315 | case GNUNET_TESTBED_TOPOLOGY_CLIQUE: |
313 | case GNUNET_TESTBED_TOPOLOGY_2D_TORUS: | 316 | case GNUNET_TESTBED_TOPOLOGY_2D_TORUS: |
314 | GNUNET_TESTBED_underlay_construct_ (num_peers, | 317 | GNUNET_TESTBED_underlay_construct_(num_peers, |
315 | link_processor, | 318 | link_processor, |
316 | NULL, | 319 | NULL, |
317 | topology); | 320 | topology); |
318 | break; | 321 | break; |
319 | case GNUNET_TESTBED_TOPOLOGY_ERDOS_RENYI: | 322 | |
320 | case GNUNET_TESTBED_TOPOLOGY_SMALL_WORLD_RING: | 323 | case GNUNET_TESTBED_TOPOLOGY_ERDOS_RENYI: |
321 | case GNUNET_TESTBED_TOPOLOGY_SMALL_WORLD: | 324 | case GNUNET_TESTBED_TOPOLOGY_SMALL_WORLD_RING: |
322 | GNUNET_TESTBED_underlay_construct_ (num_peers, | 325 | case GNUNET_TESTBED_TOPOLOGY_SMALL_WORLD: |
323 | link_processor, | 326 | GNUNET_TESTBED_underlay_construct_(num_peers, |
324 | NULL, | 327 | link_processor, |
325 | topology, | 328 | NULL, |
326 | arg_uint1); | 329 | topology, |
327 | break; | 330 | arg_uint1); |
328 | case GNUNET_TESTBED_TOPOLOGY_FROM_FILE: | 331 | break; |
329 | GNUNET_TESTBED_underlay_construct_ (num_peers, | 332 | |
330 | link_processor, | 333 | case GNUNET_TESTBED_TOPOLOGY_FROM_FILE: |
331 | NULL, | 334 | GNUNET_TESTBED_underlay_construct_(num_peers, |
332 | topology, | 335 | link_processor, |
333 | arg_str1); | 336 | NULL, |
334 | break; | 337 | topology, |
335 | case GNUNET_TESTBED_TOPOLOGY_SCALE_FREE: | 338 | arg_str1); |
336 | GNUNET_TESTBED_underlay_construct_ (num_peers, | 339 | break; |
337 | link_processor, | 340 | |
338 | NULL, | 341 | case GNUNET_TESTBED_TOPOLOGY_SCALE_FREE: |
339 | topology, | 342 | GNUNET_TESTBED_underlay_construct_(num_peers, |
340 | arg_uint1, | 343 | link_processor, |
341 | arg_uint2); | 344 | NULL, |
342 | break; | 345 | topology, |
343 | default: | 346 | arg_uint1, |
344 | GNUNET_assert (0); | 347 | arg_uint2); |
345 | } | 348 | break; |
349 | |||
350 | default: | ||
351 | GNUNET_assert(0); | ||
352 | } | ||
346 | } | 353 | } |
347 | 354 | ||
348 | 355 | ||
@@ -350,25 +357,25 @@ run (void *cls, | |||
350 | * Main | 357 | * Main |
351 | */ | 358 | */ |
352 | int | 359 | int |
353 | main (int argc, char *const argv[]) | 360 | main(int argc, char *const argv[]) |
354 | { | 361 | { |
355 | struct GNUNET_GETOPT_CommandLineOption option[] = { | 362 | struct GNUNET_GETOPT_CommandLineOption option[] = { |
356 | 363 | GNUNET_GETOPT_option_uint('p', | |
357 | GNUNET_GETOPT_option_uint ('p', | 364 | "num-peers", |
358 | "num-peers", | 365 | "COUNT", |
359 | "COUNT", | 366 | gettext_noop("create COUNT number of peers"), |
360 | gettext_noop ("create COUNT number of peers"), | 367 | &num_peers), |
361 | &num_peers), | 368 | GNUNET_GETOPT_OPTION_END |
362 | GNUNET_GETOPT_OPTION_END}; | 369 | }; |
363 | 370 | ||
364 | int ret; | 371 | int ret; |
365 | 372 | ||
366 | exit_result = GNUNET_SYSERR; | 373 | exit_result = GNUNET_SYSERR; |
367 | ret = GNUNET_PROGRAM_run ( | 374 | ret = GNUNET_PROGRAM_run( |
368 | argc, | 375 | argc, |
369 | argv, | 376 | argv, |
370 | "gnunet-underlay-topology", | 377 | "gnunet-underlay-topology", |
371 | _ ( | 378 | _( |
372 | "Generates SQLite3 database representing a given underlay topology.\n" | 379 | "Generates SQLite3 database representing a given underlay topology.\n" |
373 | "Usage: gnunet-underlay-topology [OPTIONS] db-filename TOPO [TOPOOPTS]\n" | 380 | "Usage: gnunet-underlay-topology [OPTIONS] db-filename TOPO [TOPOOPTS]\n" |
374 | "The following options are available for TOPO followed by TOPOOPTS if applicable:\n" | 381 | "The following options are available for TOPO followed by TOPOOPTS if applicable:\n" |
@@ -391,9 +398,9 @@ main (int argc, char *const argv[]) | |||
391 | &run, | 398 | &run, |
392 | NULL); | 399 | NULL); |
393 | if (NULL != stmt_insert) | 400 | if (NULL != stmt_insert) |
394 | sqlite3_finalize (stmt_insert); | 401 | sqlite3_finalize(stmt_insert); |
395 | if (NULL != db) | 402 | if (NULL != db) |
396 | GNUNET_break (SQLITE_OK == sqlite3_close (db)); | 403 | GNUNET_break(SQLITE_OK == sqlite3_close(db)); |
397 | if ((GNUNET_OK != ret) || (GNUNET_OK != exit_result)) | 404 | if ((GNUNET_OK != ret) || (GNUNET_OK != exit_result)) |
398 | return 1; | 405 | return 1; |
399 | return 0; | 406 | return 0; |