cli: Also show local IP

This commit is contained in:
Samuel Thibault 2024-01-17 20:01:27 +01:00
parent 58e04d8f08
commit 640590a252

4
cli.c
View file

@ -657,9 +657,11 @@ static int cmd_show_tunnels(struct cli_def *cli, const char *command, char **arg
continue;
}
cli_print(cli, "\r\nTunnel %d:", t);
cli_print(cli, "\tRemote ID:\t%d", tunnel[t].far);
cli_print(cli, "\tState:\t\t%s", states[tunnel[t].state]);
if (config->nbmultiaddress > 1)
cli_print(cli, "\tLocal IP:\t%s", fmtaddr(htonl(config->iftun_n_address[tunnel[t].indexudp]), 0));
cli_print(cli, "\tHostname:\t%s", tunnel[t].hostname[0] ? tunnel[t].hostname : "(none)");
cli_print(cli, "\tRemote ID:\t%d", tunnel[t].far);
cli_print(cli, "\tRemote IP:\t%s", fmtaddr(htonl(tunnel[t].ip), 0));
cli_print(cli, "\tRemote Port:\t%d", tunnel[t].port);
cli_print(cli, "\tLocal UDP index:\t%d", tunnel[t].indexudp);