diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/exit/gnunet-helper-exit-windows.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/exit/gnunet-helper-exit-windows.c b/src/exit/gnunet-helper-exit-windows.c index a2235bf38..e6ade4ba3 100644 --- a/src/exit/gnunet-helper-exit-windows.c +++ b/src/exit/gnunet-helper-exit-windows.c | |||
@@ -29,6 +29,7 @@ | |||
29 | * have your name added to the list): | 29 | * have your name added to the list): |
30 | * | 30 | * |
31 | */ | 31 | */ |
32 | |||
32 | #include <stdio.h> | 33 | #include <stdio.h> |
33 | #include <windows.h> | 34 | #include <windows.h> |
34 | #include <setupapi.h> | 35 | #include <setupapi.h> |
@@ -61,6 +62,10 @@ | |||
61 | #define LOG_DEBUG(msg) do {} while (0) | 62 | #define LOG_DEBUG(msg) do {} while (0) |
62 | #endif | 63 | #endif |
63 | 64 | ||
65 | /** | ||
66 | * Will this binary be run in dryrun-mode? | ||
67 | */ | ||
68 | static BOOL dryrun = FALSE; | ||
64 | 69 | ||
65 | /** | 70 | /** |
66 | * Maximum size of a GNUnet message (GNUNET_SERVER_MAX_MESSAGE_SIZE) | 71 | * Maximum size of a GNUnet message (GNUNET_SERVER_MAX_MESSAGE_SIZE) |
@@ -1407,6 +1412,8 @@ run (HANDLE tap_handle) | |||
1407 | goto teardown; | 1412 | goto teardown; |
1408 | } | 1413 | } |
1409 | #endif | 1414 | #endif |
1415 | if (dryrun) | ||
1416 | goto teardown; | ||
1410 | 1417 | ||
1411 | fprintf (stderr, "DEBUG: mainloop has begun\n"); | 1418 | fprintf (stderr, "DEBUG: mainloop has begun\n"); |
1412 | 1419 | ||
@@ -1428,10 +1435,9 @@ run (HANDLE tap_handle) | |||
1428 | if (std_out.path_open && (! attempt_write (&std_out, &tap_read))) | 1435 | if (std_out.path_open && (! attempt_write (&std_out, &tap_read))) |
1429 | break; | 1436 | break; |
1430 | } | 1437 | } |
1431 | |||
1432 | teardown: | ||
1433 | |||
1434 | fprintf (stderr, "DEBUG: teardown initiated\n"); | 1438 | fprintf (stderr, "DEBUG: teardown initiated\n"); |
1439 | |||
1440 | teardown: | ||
1435 | 1441 | ||
1436 | CancelIo (tap_handle); | 1442 | CancelIo (tap_handle); |
1437 | CancelIo (std_in.handle); | 1443 | CancelIo (std_in.handle); |
@@ -1463,10 +1469,16 @@ main (int argc, char **argv) | |||
1463 | BOOL have_ip4 = FALSE; | 1469 | BOOL have_ip4 = FALSE; |
1464 | BOOL have_ip6 = FALSE; | 1470 | BOOL have_ip6 = FALSE; |
1465 | BOOL have_nat44 = FALSE; | 1471 | BOOL have_nat44 = FALSE; |
1466 | 1472 | ||
1473 | if ( (1 < argc) && (0 != strcmp (argv[1], "-d"))){ | ||
1474 | dryrun = TRUE; | ||
1475 | fprintf (stderr, "DEBUG: Running binary in dryrun mode.", argv[0]); | ||
1476 | argv++; | ||
1477 | argc--; | ||
1478 | } | ||
1467 | if (6 != argc) | 1479 | if (6 != argc) |
1468 | { | 1480 | { |
1469 | fprintf (stderr, "FATAL: must supply 6 arguments\nUsage:\ngnunet-helper-exit <if name prefix> <uplink-interface name> <address6 or \"-\"> <netbits6> <address4 or \"-\"> <netmask4>\n", argv[0]); | 1481 | fprintf (stderr, "FATAL: must supply 6 arguments\nUsage:\ngnunet-helper-exit [-d] <if name prefix> <uplink-interface name> <address6 or \"-\"> <netbits6> <address4 or \"-\"> <netmask4>\n", argv[0]); |
1470 | return 1; | 1482 | return 1; |
1471 | } | 1483 | } |
1472 | 1484 | ||
@@ -1601,7 +1613,6 @@ main (int argc, char **argv) | |||
1601 | } | 1613 | } |
1602 | 1614 | ||
1603 | run (handle); | 1615 | run (handle); |
1604 | global_ret = 0; | ||
1605 | cleanup: | 1616 | cleanup: |
1606 | 1617 | ||
1607 | if (have_ip4) { | 1618 | if (have_ip4) { |