Temporarily increases debug level to 5.
Send this signal again to revert to the original level.
-@item WINCH
-Purges all information remembered about unreachable nodes.
-
@end table
@c ==================================================================
@item dump graph
Dump a graph of the VPN in dotty format.
+@item purge
+Purges all information remembered about unreachable nodes.
+
@end table
Dump a graph of the VPN in
.Xr dotty 1
format.
+.It purge
+Purges all information remembered about unreachable nodes.
.El
.Sh BUGS
The "start", "restart", and "reload" commands are not yet implemented.
.It INT
Temporarily increases debug level to 5.
Send this signal again to revert to the original level.
-.It WINCH
-Purges all information remembered about unreachable nodes.
.El
.Sh DEBUG LEVELS
The tinc daemon can send a lot of messages to the syslog.
goto respond;
}
+ if(req.type == REQ_PURGE) {
+ logger(LOG_NOTICE, _("Got '%s' command"), "purge");
+ purge();
+ goto respond;
+ }
+
logger(LOG_DEBUG, _("Malformed control command received"));
res.res_errno = EINVAL;
REQ_DUMP_SUBNETS,
REQ_DUMP_CONNECTIONS,
REQ_DUMP_GRAPH,
+ REQ_PURGE,
};
#define TINC_CTL_VERSION_CURRENT 0
/* Purge edges and subnets of unreachable nodes. Use carefully. */
-static void purge(void) {
+void purge(void) {
splay_node_t *nnode, *nnext, *enode, *enext, *snode, *snext;
node_t *n;
edge_t *e;
}
}
-static void sigwinch_handler(int signal, short events, void *data) {
- logger(LOG_NOTICE, _("Got %s signal"), strsignal(signal));
- purge();
-}
-
static void sighup_handler(int signal, short events, void *data) {
connection_t *c;
splay_node_t *node, *next;
struct event sigint_event;
struct event sigterm_event;
struct event sigquit_event;
- struct event sigwinch_event;
struct event sigalrm_event;
cp();
signal_add(&sigterm_event, NULL);
signal_set(&sigquit_event, SIGQUIT, sigterm_handler, NULL);
signal_add(&sigquit_event, NULL);
- signal_set(&sigwinch_event, SIGWINCH, sigwinch_handler, NULL);
- signal_add(&sigwinch_event, NULL);
signal_set(&sigalrm_event, SIGALRM, sigalrm_handler, NULL);
signal_add(&sigalrm_event, NULL);
signal_del(&sigint_event);
signal_del(&sigterm_event);
signal_del(&sigquit_event);
- signal_del(&sigwinch_event);
signal_del(&sigalrm_event);
event_del(&timeout_event);
extern int listen_sockets;
extern int keylifetime;
extern bool do_prune;
-extern bool do_purge;
extern char *myport;
extern EVP_CIPHER_CTX packet_ctx;
extern void handle_device_data(int, short, void *);
extern void handle_meta_connection_data(int, short, void *);
extern void regenerate_key();
+extern void purge(void);
#ifndef HAVE_MINGW
#define closesocket(s) close(s)
" 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"
"\n"));
printf(_("Report bugs to tinc@tinc-vpn.org.\n"));
}
return 1;
}
+ if(!strcasecmp(argv[optind], "purge")) {
+ return send_ctl_request_cooked(fd, REQ_PURGE, NULL, 0) != -1;
+ }
+
fprintf(stderr, _("Unknown command `%s'.\n"), argv[optind]);
usage(true);