X-Git-Url: http://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Ftincctl.c;h=9b16a7b7a33beba1d3468d5bb5a7b56b8e36e7c5;hb=f0a57eab4cfd64d4f8261b1885a2072177f9e76b;hp=4982e6b25fe3fb2f6773e5b24c8afb98d0a2a30f;hpb=6eaefb4dbce240334e35f67d9f3db5d4f44e49c9;p=tinc diff --git a/src/tincctl.c b/src/tincctl.c index 4982e6b2..9b16a7b7 100644 --- a/src/tincctl.c +++ b/src/tincctl.c @@ -89,6 +89,9 @@ static void usage(bool status) { " subnets - all known subnets in the VPN\n" " connections - all meta connections with ourself\n" " graph - graph of the VPN in dotty format\n" + " purge Purge unreachable nodes\n" + " debug N Set debug level\n" + " retry Retry all outgoing connections\n" "\n")); printf(_("Report bugs to tinc@tinc-vpn.org.\n")); } @@ -578,6 +581,26 @@ int main(int argc, char *argv[], char *envp[]) { return 1; } + if(!strcasecmp(argv[optind], "purge")) { + return send_ctl_request_cooked(fd, REQ_PURGE, NULL, 0) != -1; + } + + if(!strcasecmp(argv[optind], "debug")) { + int debuglevel; + + if(argc != optind + 2) { + fprintf(stderr, "Invalid arguments.\n"); + return 1; + } + debuglevel = atoi(argv[optind+1]); + return send_ctl_request_cooked(fd, REQ_SET_DEBUG, &debuglevel, + sizeof(debuglevel)) != -1; + } + + if(!strcasecmp(argv[optind], "retry")) { + return send_ctl_request_cooked(fd, REQ_RETRY, NULL, 0) != -1; + } + fprintf(stderr, _("Unknown command `%s'.\n"), argv[optind]); usage(true);