bgpd: Cleanup rpki indentation

Rework a couple functions to allow the indentation to be a bit
cleaner.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
Donald Sharp 2020-11-20 08:44:25 -05:00
parent 2332790973
commit 708b805361

View File

@ -900,7 +900,9 @@ static int config_write(struct vty *vty)
struct listnode *cache_node;
struct cache *cache;
if (listcount(cache_list)) {
if (!listcount(cache_list))
return 0;
if (rpki_debug)
vty_out(vty, "debug rpki\n");
@ -915,8 +917,8 @@ static int config_write(struct vty *vty)
#endif
case TCP:
tcp_config = cache->tr_config.tcp_config;
vty_out(vty, " rpki cache %s %s ",
tcp_config->host, tcp_config->port);
vty_out(vty, " rpki cache %s %s ", tcp_config->host,
tcp_config->port);
break;
#if defined(FOUND_SSH)
case SSH:
@ -926,8 +928,7 @@ static int config_write(struct vty *vty)
ssh_config->username,
ssh_config->client_privkey_path,
ssh_config->server_hostkey_path != NULL
? ssh_config
->server_hostkey_path
? ssh_config->server_hostkey_path
: " ");
break;
#endif
@ -938,10 +939,8 @@ static int config_write(struct vty *vty)
vty_out(vty, "preference %hhu\n", cache->preference);
}
vty_out(vty, " exit\n");
return 1;
} else {
return 0;
}
}
DEFUN_NOSH (rpki,
@ -1275,7 +1274,12 @@ DEFUN (show_rpki_cache_connection,
RPKI_OUTPUT_STRING
"Show to which RPKI Cache Servers we have a connection\n")
{
if (is_synchronized()) {
if (!is_synchronized()) {
vty_out(vty, "No connection to RPKI cache server.\n");
return CMD_SUCCESS;
}
struct listnode *cache_node;
struct cache *cache;
struct rtr_mgr_group *group = get_connected_group();
@ -1294,23 +1298,17 @@ DEFUN (show_rpki_cache_connection,
switch (cache->type) {
case TCP:
tcp_config =
cache->tr_config.tcp_config;
vty_out(vty,
"rpki tcp cache %s %s pref %hhu\n",
tcp_config->host,
tcp_config->port,
tcp_config = cache->tr_config.tcp_config;
vty_out(vty, "rpki tcp cache %s %s pref %hhu\n",
tcp_config->host, tcp_config->port,
cache->preference);
break;
#if defined(FOUND_SSH)
case SSH:
ssh_config =
cache->tr_config.ssh_config;
vty_out(vty,
"rpki ssh cache %s %u pref %hhu\n",
ssh_config->host,
ssh_config->port,
ssh_config = cache->tr_config.ssh_config;
vty_out(vty, "rpki ssh cache %s %u pref %hhu\n",
ssh_config->host, ssh_config->port,
cache->preference);
break;
#endif
@ -1320,9 +1318,6 @@ DEFUN (show_rpki_cache_connection,
}
}
}
} else {
vty_out(vty, "No connection to RPKI cache server.\n");
}
return CMD_SUCCESS;
}