mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-29 09:44:26 +00:00
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:
parent
2332790973
commit
708b805361
149
bgpd/bgp_rpki.c
149
bgpd/bgp_rpki.c
@ -900,48 +900,47 @@ static int config_write(struct vty *vty)
|
|||||||
struct listnode *cache_node;
|
struct listnode *cache_node;
|
||||||
struct cache *cache;
|
struct cache *cache;
|
||||||
|
|
||||||
if (listcount(cache_list)) {
|
if (!listcount(cache_list))
|
||||||
if (rpki_debug)
|
|
||||||
vty_out(vty, "debug rpki\n");
|
|
||||||
|
|
||||||
vty_out(vty, "!\n");
|
|
||||||
vty_out(vty, "rpki\n");
|
|
||||||
vty_out(vty, " rpki polling_period %d\n", polling_period);
|
|
||||||
for (ALL_LIST_ELEMENTS_RO(cache_list, cache_node, cache)) {
|
|
||||||
switch (cache->type) {
|
|
||||||
struct tr_tcp_config *tcp_config;
|
|
||||||
#if defined(FOUND_SSH)
|
|
||||||
struct tr_ssh_config *ssh_config;
|
|
||||||
#endif
|
|
||||||
case TCP:
|
|
||||||
tcp_config = cache->tr_config.tcp_config;
|
|
||||||
vty_out(vty, " rpki cache %s %s ",
|
|
||||||
tcp_config->host, tcp_config->port);
|
|
||||||
break;
|
|
||||||
#if defined(FOUND_SSH)
|
|
||||||
case SSH:
|
|
||||||
ssh_config = cache->tr_config.ssh_config;
|
|
||||||
vty_out(vty, " rpki cache %s %u %s %s %s ",
|
|
||||||
ssh_config->host, ssh_config->port,
|
|
||||||
ssh_config->username,
|
|
||||||
ssh_config->client_privkey_path,
|
|
||||||
ssh_config->server_hostkey_path != NULL
|
|
||||||
? ssh_config
|
|
||||||
->server_hostkey_path
|
|
||||||
: " ");
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
vty_out(vty, "preference %hhu\n", cache->preference);
|
|
||||||
}
|
|
||||||
vty_out(vty, " exit\n");
|
|
||||||
return 1;
|
|
||||||
} else {
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
if (rpki_debug)
|
||||||
|
vty_out(vty, "debug rpki\n");
|
||||||
|
|
||||||
|
vty_out(vty, "!\n");
|
||||||
|
vty_out(vty, "rpki\n");
|
||||||
|
vty_out(vty, " rpki polling_period %d\n", polling_period);
|
||||||
|
for (ALL_LIST_ELEMENTS_RO(cache_list, cache_node, cache)) {
|
||||||
|
switch (cache->type) {
|
||||||
|
struct tr_tcp_config *tcp_config;
|
||||||
|
#if defined(FOUND_SSH)
|
||||||
|
struct tr_ssh_config *ssh_config;
|
||||||
|
#endif
|
||||||
|
case TCP:
|
||||||
|
tcp_config = cache->tr_config.tcp_config;
|
||||||
|
vty_out(vty, " rpki cache %s %s ", tcp_config->host,
|
||||||
|
tcp_config->port);
|
||||||
|
break;
|
||||||
|
#if defined(FOUND_SSH)
|
||||||
|
case SSH:
|
||||||
|
ssh_config = cache->tr_config.ssh_config;
|
||||||
|
vty_out(vty, " rpki cache %s %u %s %s %s ",
|
||||||
|
ssh_config->host, ssh_config->port,
|
||||||
|
ssh_config->username,
|
||||||
|
ssh_config->client_privkey_path,
|
||||||
|
ssh_config->server_hostkey_path != NULL
|
||||||
|
? ssh_config->server_hostkey_path
|
||||||
|
: " ");
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
vty_out(vty, "preference %hhu\n", cache->preference);
|
||||||
}
|
}
|
||||||
|
vty_out(vty, " exit\n");
|
||||||
|
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFUN_NOSH (rpki,
|
DEFUN_NOSH (rpki,
|
||||||
@ -1275,53 +1274,49 @@ DEFUN (show_rpki_cache_connection,
|
|||||||
RPKI_OUTPUT_STRING
|
RPKI_OUTPUT_STRING
|
||||||
"Show to which RPKI Cache Servers we have a connection\n")
|
"Show to which RPKI Cache Servers we have a connection\n")
|
||||||
{
|
{
|
||||||
if (is_synchronized()) {
|
if (!is_synchronized()) {
|
||||||
struct listnode *cache_node;
|
vty_out(vty, "No connection to RPKI cache server.\n");
|
||||||
struct cache *cache;
|
|
||||||
struct rtr_mgr_group *group = get_connected_group();
|
|
||||||
|
|
||||||
if (!group) {
|
return CMD_SUCCESS;
|
||||||
vty_out(vty, "Cannot find a connected group.\n");
|
}
|
||||||
return CMD_SUCCESS;
|
|
||||||
}
|
struct listnode *cache_node;
|
||||||
vty_out(vty, "Connected to group %d\n", group->preference);
|
struct cache *cache;
|
||||||
for (ALL_LIST_ELEMENTS_RO(cache_list, cache_node, cache)) {
|
struct rtr_mgr_group *group = get_connected_group();
|
||||||
if (cache->preference == group->preference) {
|
|
||||||
struct tr_tcp_config *tcp_config;
|
if (!group) {
|
||||||
|
vty_out(vty, "Cannot find a connected group.\n");
|
||||||
|
return CMD_SUCCESS;
|
||||||
|
}
|
||||||
|
vty_out(vty, "Connected to group %d\n", group->preference);
|
||||||
|
for (ALL_LIST_ELEMENTS_RO(cache_list, cache_node, cache)) {
|
||||||
|
if (cache->preference == group->preference) {
|
||||||
|
struct tr_tcp_config *tcp_config;
|
||||||
#if defined(FOUND_SSH)
|
#if defined(FOUND_SSH)
|
||||||
struct tr_ssh_config *ssh_config;
|
struct tr_ssh_config *ssh_config;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
switch (cache->type) {
|
switch (cache->type) {
|
||||||
case TCP:
|
case TCP:
|
||||||
tcp_config =
|
tcp_config = cache->tr_config.tcp_config;
|
||||||
cache->tr_config.tcp_config;
|
vty_out(vty, "rpki tcp cache %s %s pref %hhu\n",
|
||||||
vty_out(vty,
|
tcp_config->host, tcp_config->port,
|
||||||
"rpki tcp cache %s %s pref %hhu\n",
|
cache->preference);
|
||||||
tcp_config->host,
|
break;
|
||||||
tcp_config->port,
|
|
||||||
cache->preference);
|
|
||||||
break;
|
|
||||||
|
|
||||||
#if defined(FOUND_SSH)
|
#if defined(FOUND_SSH)
|
||||||
case SSH:
|
case SSH:
|
||||||
ssh_config =
|
ssh_config = cache->tr_config.ssh_config;
|
||||||
cache->tr_config.ssh_config;
|
vty_out(vty, "rpki ssh cache %s %u pref %hhu\n",
|
||||||
vty_out(vty,
|
ssh_config->host, ssh_config->port,
|
||||||
"rpki ssh cache %s %u pref %hhu\n",
|
cache->preference);
|
||||||
ssh_config->host,
|
break;
|
||||||
ssh_config->port,
|
|
||||||
cache->preference);
|
|
||||||
break;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
vty_out(vty, "No connection to RPKI cache server.\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
|
Loading…
Reference in New Issue
Block a user