X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Ftincctl.c;h=bff122b0efc5518f0403272a9226f153b73bceb3;hb=a62a6825a8a69e279ee0688a4cd9e51fbc52054b;hp=56179c6ec19d3576246463c54493b80220cd2c3f;hpb=1065879c8c6e8cdf8d3755024241f31eaabd4138;p=oweals%2Ftinc.git diff --git a/src/tincctl.c b/src/tincctl.c index 56179c6..bff122b 100644 --- a/src/tincctl.c +++ b/src/tincctl.c @@ -90,6 +90,7 @@ static void usage(bool status) { " 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" "\n")); printf(_("Report bugs to tinc@tinc-vpn.org.\n")); } @@ -583,6 +584,18 @@ int main(int argc, char *argv[], char *envp[]) { 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; + } + fprintf(stderr, _("Unknown command `%s'.\n"), argv[optind]); usage(true);