summaryrefslogtreecommitdiffstats
path: root/ospf6d
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2017-08-28 19:38:42 +0200
committerQuentin Young <qlyoung@cumulusnetworks.com>2017-08-28 19:50:21 +0200
commit5d1a2ee87bf0bd343a9f90ff3c37267137be83a4 (patch)
treeaa170866bd6f0ee139d33d5626b0ecaefd7ac278 /ospf6d
parentMerge pull request #1045 from opensourcerouting/clippy-coverity (diff)
downloadfrr-5d1a2ee87bf0bd343a9f90ff3c37267137be83a4.tar.xz
frr-5d1a2ee87bf0bd343a9f90ff3c37267137be83a4.zip
ospf6d, ospfd: add `no ospf6 router-id ...`
* Deprecate `router-id A.B.C.D` for ospf6d * Add `ospf6 router-id A.B.C.D` * Add `no ospf6 router-id [A.B.C.D]` * Add deprecation notices for previously deprecated ospf commands Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'ospf6d')
-rw-r--r--ospf6d/ospf6_top.c54
1 files changed, 48 insertions, 6 deletions
diff --git a/ospf6d/ospf6_top.c b/ospf6d/ospf6_top.c
index 387690bc8..dc5792aa1 100644
--- a/ospf6d/ospf6_top.c
+++ b/ospf6d/ospf6_top.c
@@ -308,19 +308,24 @@ DEFUN (no_router_ospf6,
/* change Router_ID commands. */
DEFUN (ospf6_router_id,
ospf6_router_id_cmd,
- "router-id A.B.C.D",
- "Configure OSPF Router-ID\n"
+ "ospf6 router-id A.B.C.D",
+ OSPF6_STR
+ "Configure OSPF6 Router-ID\n"
V4NOTATION_STR)
{
VTY_DECLVAR_CONTEXT(ospf6, o);
- int idx_ipv4 = 1;
+ int idx = 0;
int ret;
+ const char *router_id_str;
u_int32_t router_id;
- ret = inet_pton(AF_INET, argv[idx_ipv4]->arg, &router_id);
+ argv_find(argv, argc, "A.B.C.D", &idx);
+ router_id_str = argv[idx]->arg;
+
+ ret = inet_pton(AF_INET, router_id_str, &router_id);
if (ret == 0) {
vty_out(vty, "malformed OSPF Router-ID: %s\n",
- argv[idx_ipv4]->arg);
+ router_id_str);
return CMD_SUCCESS;
}
@@ -331,6 +336,40 @@ DEFUN (ospf6_router_id,
return CMD_SUCCESS;
}
+DEFUN (no_ospf6_router_id,
+ no_ospf6_router_id_cmd,
+ "no ospf6 router-id [A.B.C.D]",
+ NO_STR
+ OSPF6_STR
+ "Configure OSPF6 Router-ID\n"
+ V4NOTATION_STR)
+{
+ VTY_DECLVAR_CONTEXT(ospf6, o);
+ o->router_id_static = 0;
+ o->router_id = 0;
+
+ return CMD_SUCCESS;
+}
+
+#if CONFDATE > 20180828
+CPP_NOTICE("ospf6: `router-id A.B.C.D` deprecated 2017/08/28")
+#endif
+ALIAS_HIDDEN(ospf6_router_id,
+ ospf6_router_id_hdn_cmd,
+ "router-id A.B.C.D",
+ "Configure OSPF6 Router-ID\n"
+ V4NOTATION_STR)
+
+#if CONFDATE > 20180828
+CPP_NOTICE("ospf6: `no router-id A.B.C.D` deprecated 2017/08/28")
+#endif
+ALIAS_HIDDEN(no_ospf6_router_id,
+ no_ospf6_router_id_hdn_cmd,
+ "no router-id [A.B.C.D]",
+ NO_STR
+ "Configure OSPF6 Router-ID\n"
+ V4NOTATION_STR)
+
DEFUN (ospf6_log_adjacency_changes,
ospf6_log_adjacency_changes_cmd,
"log-adjacency-changes",
@@ -974,7 +1013,7 @@ static int config_write_ospf6(struct vty *vty)
sizeof(router_id));
vty_out(vty, "router ospf6\n");
if (ospf6->router_id_static != 0)
- vty_out(vty, " router-id %s\n", router_id);
+ vty_out(vty, " ospf6 router-id %s\n", router_id);
/* log-adjacency-changes flag print. */
if (CHECK_FLAG(ospf6->config_flags, OSPF6_LOG_ADJACENCY_CHANGES)) {
@@ -1032,6 +1071,9 @@ void ospf6_top_init(void)
install_default(OSPF6_NODE);
install_element(OSPF6_NODE, &ospf6_router_id_cmd);
+ install_element(OSPF6_NODE, &no_ospf6_router_id_cmd);
+ install_element(OSPF6_NODE, &ospf6_router_id_hdn_cmd);
+ install_element(OSPF6_NODE, &no_ospf6_router_id_hdn_cmd);
install_element(OSPF6_NODE, &ospf6_log_adjacency_changes_cmd);
install_element(OSPF6_NODE, &ospf6_log_adjacency_changes_detail_cmd);
install_element(OSPF6_NODE, &no_ospf6_log_adjacency_changes_cmd);