Skip to content

Commit

Permalink
bgpd: Remove deprecated RPKI command
Browse files Browse the repository at this point in the history
`rpki cache <A.B.C.D|WORD> ...`

Signed-off-by: Donatas Abraitis <[email protected]>
  • Loading branch information
ton31337 committed Sep 17, 2024
1 parent da96ad0 commit 6a7a83c
Showing 1 changed file with 0 additions and 77 deletions.
77 changes: 0 additions & 77 deletions bgpd/bgp_rpki.c
Original file line number Diff line number Diff line change
Expand Up @@ -1920,81 +1920,6 @@ DEFUN (no_rpki_retry_interval,
return CMD_SUCCESS;
}

#if CONFDATE > 20240916
CPP_NOTICE("Remove rpki_cache_cmd")
#endif
DEFPY(rpki_cache, rpki_cache_cmd,
"rpki cache <A.B.C.D|WORD> <TCPPORT|(1-65535)$sshport SSH_UNAME SSH_PRIVKEY [KNOWN_HOSTS_PATH]> [source <A.B.C.D>$bindaddr] preference (1-255)",
RPKI_OUTPUT_STRING
"Install a cache server to current group\n"
"IP address of cache server\n"
"Hostname of cache server\n"
"TCP port number\n"
"SSH port number\n"
"SSH user name\n"
"Path to own SSH private key\n"
"Path to the known hosts file\n"
"Configure source IP address of RPKI connection\n"
"Define a Source IP Address\n"
"Preference of the cache server\n"
"Preference value\n")
{
int return_value;
struct listnode *cache_node;
struct cache *current_cache;
struct rpki_vrf *rpki_vrf;
bool init;

if (vty->node == RPKI_VRF_NODE)
rpki_vrf = VTY_GET_CONTEXT_SUB(rpki_vrf);
else
rpki_vrf = VTY_GET_CONTEXT(rpki_vrf);

if (!rpki_vrf)
return CMD_WARNING_CONFIG_FAILED;

if (!rpki_vrf || !rpki_vrf->cache_list)
return CMD_WARNING;

init = !!list_isempty(rpki_vrf->cache_list);

for (ALL_LIST_ELEMENTS_RO(rpki_vrf->cache_list, cache_node,
current_cache)) {
if (current_cache->preference == preference) {
vty_out(vty,
"Cache with preference %ld is already configured\n",
preference);
return CMD_WARNING;
}
}

// use ssh connection
if (ssh_uname) {
#if defined(FOUND_SSH)
return_value = add_ssh_cache(rpki_vrf, cache, sshport, ssh_uname,
ssh_privkey, known_hosts_path,
preference, bindaddr_str);
#else
return_value = SUCCESS;
vty_out(vty,
"ssh sockets are not supported. Please recompile rtrlib and frr with ssh support. If you want to use it\n");
#endif
} else { // use tcp connection
return_value = add_tcp_cache(rpki_vrf, cache, tcpport,
preference, bindaddr_str);
}

if (return_value == ERROR) {
vty_out(vty, "Could not create new rpki cache\n");
return CMD_WARNING;
}

if (init)
start(rpki_vrf);

return CMD_SUCCESS;
}

DEFPY(rpki_cache_tcp, rpki_cache_tcp_cmd,
"rpki cache tcp <A.B.C.D|WORD>$cache TCPPORT [source <A.B.C.D>$bindaddr] preference (1-255)",
RPKI_OUTPUT_STRING
Expand Down Expand Up @@ -2820,7 +2745,6 @@ static void install_cli_commands(void)
/* Install rpki cache commands */
install_element(RPKI_NODE, &rpki_cache_tcp_cmd);
install_element(RPKI_NODE, &rpki_cache_ssh_cmd);
install_element(RPKI_NODE, &rpki_cache_cmd);
install_element(RPKI_NODE, &no_rpki_cache_cmd);

/* RPKI_VRF_NODE commands */
Expand All @@ -2844,7 +2768,6 @@ static void install_cli_commands(void)
/* Install rpki cache commands */
install_element(RPKI_VRF_NODE, &rpki_cache_tcp_cmd);
install_element(RPKI_VRF_NODE, &rpki_cache_ssh_cmd);
install_element(RPKI_VRF_NODE, &rpki_cache_cmd);
install_element(RPKI_VRF_NODE, &no_rpki_cache_cmd);

/* Install show commands */
Expand Down

0 comments on commit 6a7a83c

Please sign in to comment.