X-Git-Url: http://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Ftincctl.c;h=f3a73b77dd3e44e25979bd649d2ec548a7e9a265;hb=53735a9d964579829d089f4b7572aef50c4e1468;hp=8a3309556c3ef32c6c137593b289b0f4170a1e2b;hpb=3c7003893fe2f82023d0d4f54b488bb7a16d0007;p=tinc diff --git a/src/tincctl.c b/src/tincctl.c index 8a330955..f3a73b77 100644 --- a/src/tincctl.c +++ b/src/tincctl.c @@ -25,6 +25,7 @@ #include "protocol.h" #include "control_common.h" #include "ecdsagen.h" +#include "info.h" #include "rsagen.h" #include "utils.h" #include "tincctl.h" @@ -120,6 +121,7 @@ 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" + " info NODE|SUBNET|ADDRESS Give information about a particular NODE, SUBNET or ADDRESS.\n" " purge Purge unreachable nodes\n" " debug N Set debug level\n" " retry Retry all outgoing connections\n" @@ -1286,6 +1288,18 @@ static int cmd_version(int argc, char *argv[]) { return 0; } +static int cmd_info(int argc, char *argv[]) { + if(argc != 2) { + fprintf(stderr, "Invalid number of arguments.\n"); + return 1; + } + + if(!connect_tincd()) + return 1; + + return info(fd, argv[1]); +} + static const char *conffiles[] = { "tinc.conf", "tinc-up", @@ -1374,6 +1388,7 @@ static const struct { {"generate-ecdsa-keys", cmd_generate_ecdsa_keys}, {"help", cmd_help}, {"version", cmd_version}, + {"info", cmd_info}, {"edit", cmd_edit}, {NULL, NULL}, };