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
/* 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 */
/* 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 */