summaryrefslogtreecommitdiffstats
path: root/ospf6d/ospf6_interface.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2017-08-22 18:29:53 +0200
committerQuentin Young <qlyoung@cumulusnetworks.com>2017-08-22 22:07:30 +0200
commitd23d6de866561418be6aab0298301a4aa558b538 (patch)
tree38b9e3fe1f6cdc5088d5b9b4315ea0b6888848af /ospf6d/ospf6_interface.c
parentospfd, ospf6d: cleanup some `no` commands (diff)
downloadfrr-d23d6de866561418be6aab0298301a4aa558b538.tar.xz
frr-d23d6de866561418be6aab0298301a4aa558b538.zip
ospf6d: add `no` forms for interface commands
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'ospf6d/ospf6_interface.c')
-rw-r--r--ospf6d/ospf6_interface.c108
1 files changed, 87 insertions, 21 deletions
diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c
index c970e990c..bb63fb966 100644
--- a/ospf6d/ospf6_interface.c
+++ b/ospf6d/ospf6_interface.c
@@ -1291,8 +1291,7 @@ DEFUN (ipv6_ospf6_hellointerval,
IP6_STR
OSPF6_STR
"Time between HELLO packets\n"
- SECONDS_STR
- )
+ SECONDS_STR)
{
VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_number = 3;
@@ -1304,10 +1303,21 @@ DEFUN (ipv6_ospf6_hellointerval,
oi = ospf6_interface_create(ifp);
assert(oi);
- oi->hello_interval = strtol(argv[idx_number]->arg, NULL, 10);
+ oi->hello_interval = strmatch(argv[0]->text, "no")
+ ? OSPF_HELLO_INTERVAL_DEFAULT
+ : strtoul(argv[idx_number]->arg, NULL, 10);
return CMD_SUCCESS;
}
+ALIAS (ipv6_ospf6_hellointerval,
+ no_ipv6_ospf6_hellointerval_cmd,
+ "no ipv6 ospf6 hello-interval [(1-65535)]",
+ NO_STR
+ IP6_STR
+ OSPF6_STR
+ "Time between HELLO packets\n"
+ SECONDS_STR)
+
/* interface variable set command */
DEFUN (ipv6_ospf6_deadinterval,
ipv6_ospf6_deadinterval_cmd,
@@ -1315,8 +1325,7 @@ DEFUN (ipv6_ospf6_deadinterval,
IP6_STR
OSPF6_STR
"Interval time after which a neighbor is declared down\n"
- SECONDS_STR
- )
+ SECONDS_STR)
{
VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_number = 3;
@@ -1328,10 +1337,21 @@ DEFUN (ipv6_ospf6_deadinterval,
oi = ospf6_interface_create(ifp);
assert(oi);
- oi->dead_interval = strtol(argv[idx_number]->arg, NULL, 10);
+ oi->dead_interval = strmatch(argv[0]->arg, "no")
+ ? OSPF_ROUTER_DEAD_INTERVAL_DEFAULT
+ : strtoul(argv[idx_number]->arg, NULL, 10);
return CMD_SUCCESS;
}
+ALIAS (ipv6_ospf6_deadinterval,
+ no_ipv6_ospf6_deadinterval_cmd,
+ "no ipv6 ospf6 dead-interval [(1-65535)]",
+ NO_STR
+ IP6_STR
+ OSPF6_STR
+ "Interval time after which a neighbor is declared down\n"
+ SECONDS_STR)
+
/* interface variable set command */
DEFUN (ipv6_ospf6_transmitdelay,
ipv6_ospf6_transmitdelay_cmd,
@@ -1351,10 +1371,21 @@ DEFUN (ipv6_ospf6_transmitdelay,
oi = ospf6_interface_create(ifp);
assert(oi);
- oi->transdelay = strtol(argv[idx_number]->arg, NULL, 10);
+ oi->transdelay = strmatch(argv[0]->text, "no")
+ ? OSPF6_INTERFACE_TRANSDELAY
+ : strtoul(argv[idx_number]->arg, NULL, 10);
return CMD_SUCCESS;
}
+ALIAS (ipv6_ospf6_transmitdelay,
+ no_ipv6_ospf6_transmitdelay_cmd,
+ "no ipv6 ospf6 transmit-delay [(1-3600)]",
+ NO_STR
+ IP6_STR
+ OSPF6_STR
+ "Link state transmit delay\n"
+ SECONDS_STR)
+
/* interface variable set command */
DEFUN (ipv6_ospf6_retransmitinterval,
ipv6_ospf6_retransmitinterval_cmd,
@@ -1362,8 +1393,7 @@ DEFUN (ipv6_ospf6_retransmitinterval,
IP6_STR
OSPF6_STR
"Time between retransmitting lost link state advertisements\n"
- SECONDS_STR
- )
+ SECONDS_STR)
{
VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_number = 3;
@@ -1375,10 +1405,21 @@ DEFUN (ipv6_ospf6_retransmitinterval,
oi = ospf6_interface_create(ifp);
assert(oi);
- oi->rxmt_interval = strtol(argv[idx_number]->arg, NULL, 10);
+ oi->rxmt_interval = strmatch(argv[0]->text, "no")
+ ? OSPF_RETRANSMIT_INTERVAL_DEFAULT
+ : strtoul(argv[idx_number]->arg, NULL, 10);
return CMD_SUCCESS;
}
+ALIAS (ipv6_ospf6_retransmitinterval,
+ no_ipv6_ospf6_retransmitinterval_cmd,
+ "no ipv6 ospf6 retransmit-interval [(1-65535)]",
+ NO_STR
+ IP6_STR
+ OSPF6_STR
+ "Time between retransmitting lost link state advertisements\n"
+ SECONDS_STR)
+
/* interface variable set command */
DEFUN (ipv6_ospf6_priority,
ipv6_ospf6_priority_cmd,
@@ -1386,8 +1427,7 @@ DEFUN (ipv6_ospf6_priority,
IP6_STR
OSPF6_STR
"Router priority\n"
- "Priority value\n"
- )
+ "Priority value\n")
{
VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_number = 3;
@@ -1399,7 +1439,9 @@ DEFUN (ipv6_ospf6_priority,
oi = ospf6_interface_create(ifp);
assert(oi);
- oi->priority = strtol(argv[idx_number]->arg, NULL, 10);
+ oi->priority = strmatch(argv[0]->text, "no")
+ ? OSPF6_INTERFACE_PRIORITY
+ : strtoul(argv[idx_number]->arg, NULL, 10);
if (oi->area && (oi->state == OSPF6_INTERFACE_DROTHER
|| oi->state == OSPF6_INTERFACE_BDR
@@ -1409,14 +1451,22 @@ DEFUN (ipv6_ospf6_priority,
return CMD_SUCCESS;
}
+ALIAS (ipv6_ospf6_priority,
+ no_ipv6_ospf6_priority_cmd,
+ "no ipv6 ospf6 priority [(0-255)]",
+ NO_STR
+ IP6_STR
+ OSPF6_STR
+ "Router priority\n"
+ "Priority value\n")
+
DEFUN (ipv6_ospf6_instance,
ipv6_ospf6_instance_cmd,
"ipv6 ospf6 instance-id (0-255)",
IP6_STR
OSPF6_STR
"Instance ID for this interface\n"
- "Instance ID value\n"
- )
+ "Instance ID value\n")
{
VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_number = 3;
@@ -1428,10 +1478,21 @@ DEFUN (ipv6_ospf6_instance,
oi = ospf6_interface_create(ifp);
assert(oi);
- oi->instance_id = strtol(argv[idx_number]->arg, NULL, 10);
+ oi->instance_id = strmatch(argv[0]->text, "no")
+ ? OSPF6_INTERFACE_INSTANCE_ID
+ : strtoul(argv[idx_number]->arg, NULL, 10);
return CMD_SUCCESS;
}
+ALIAS (ipv6_ospf6_instance,
+ no_ipv6_ospf6_instance_cmd,
+ "no ipv6 ospf6 instance-id [(0-255)]",
+ NO_STR
+ IP6_STR
+ OSPF6_STR
+ "Instance ID for this interface\n"
+ "Instance ID value\n")
+
DEFUN (ipv6_ospf6_passive,
ipv6_ospf6_passive_cmd,
"ipv6 ospf6 passive",
@@ -1575,13 +1636,13 @@ DEFUN (ipv6_ospf6_advertise_prefix_list,
DEFUN (no_ipv6_ospf6_advertise_prefix_list,
no_ipv6_ospf6_advertise_prefix_list_cmd,
- "no ipv6 ospf6 advertise prefix-list",
+ "no ipv6 ospf6 advertise prefix-list [WORD]",
NO_STR
IP6_STR
OSPF6_STR
"Advertising options\n"
"Filter prefix using prefix-list\n"
- )
+ "Prefix list name\n")
{
VTY_DECLVAR_CONTEXT(interface, ifp);
struct ospf6_interface *oi;
@@ -1592,10 +1653,8 @@ DEFUN (no_ipv6_ospf6_advertise_prefix_list,
oi = ospf6_interface_create(ifp);
assert(oi);
- if (oi->plist_name) {
+ if (oi->plist_name)
XFREE(MTYPE_CFG_PLIST_NAME, oi->plist_name);
- oi->plist_name = NULL;
- }
ospf6_interface_connected_route_update(oi->interface);
@@ -1773,12 +1832,19 @@ void ospf6_interface_init(void)
install_element(INTERFACE_NODE, &no_ipv6_ospf6_cost_cmd);
install_element(INTERFACE_NODE, &ipv6_ospf6_ifmtu_cmd);
install_element(INTERFACE_NODE, &no_ipv6_ospf6_ifmtu_cmd);
+
install_element(INTERFACE_NODE, &ipv6_ospf6_deadinterval_cmd);
install_element(INTERFACE_NODE, &ipv6_ospf6_hellointerval_cmd);
install_element(INTERFACE_NODE, &ipv6_ospf6_priority_cmd);
install_element(INTERFACE_NODE, &ipv6_ospf6_retransmitinterval_cmd);
install_element(INTERFACE_NODE, &ipv6_ospf6_transmitdelay_cmd);
install_element(INTERFACE_NODE, &ipv6_ospf6_instance_cmd);
+ install_element(INTERFACE_NODE, &no_ipv6_ospf6_deadinterval_cmd);
+ install_element(INTERFACE_NODE, &no_ipv6_ospf6_hellointerval_cmd);
+ install_element(INTERFACE_NODE, &no_ipv6_ospf6_priority_cmd);
+ install_element(INTERFACE_NODE, &no_ipv6_ospf6_retransmitinterval_cmd);
+ install_element(INTERFACE_NODE, &no_ipv6_ospf6_transmitdelay_cmd);
+ install_element(INTERFACE_NODE, &no_ipv6_ospf6_instance_cmd);
install_element(INTERFACE_NODE, &ipv6_ospf6_passive_cmd);
install_element(INTERFACE_NODE, &no_ipv6_ospf6_passive_cmd);