Hi Jafar, Response inline..
On Tue, Nov 17, 2015 at 9:25 AM, Jafar Al-Gharaibeh <[email protected]> wrote: > Question inline... > > > On 11/13/2015 1:19 PM, Donald Sharp wrote: > >> From: Vipin Kumar <[email protected]> >> >> Signed-off-by: Vipin Kumar <[email protected]> >> --- >> ospfd/ospf_main.c | 1 + >> ospfd/ospf_vty.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ >> ospfd/ospf_vty.h | 1 + >> 3 files changed, 47 insertions(+) >> >> diff --git a/ospfd/ospf_main.c b/ospfd/ospf_main.c >> index 1e4184f..dae0b8a 100644 >> --- a/ospfd/ospf_main.c >> +++ b/ospfd/ospf_main.c >> @@ -303,6 +303,7 @@ main (int argc, char **argv) >> /* OSPF vty inits. */ >> ospf_vty_init (); >> ospf_vty_show_init (); >> + ospf_vty_clear_init (); >> ospf_route_map_init (); >> #ifdef HAVE_SNMP >> diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c >> index 45a19c0..179b734 100644 >> --- a/ospfd/ospf_vty.c >> +++ b/ospfd/ospf_vty.c >> @@ -7769,6 +7769,51 @@ static struct cmd_node ospf_node = >> 1 >> }; >> +static void >> +ospf_interface_clear (struct interface *ifp) >> +{ >> + if (!if_is_operative (ifp)) return; >> + >> + if (IS_DEBUG_OSPF (ism, ISM_EVENTS)) >> + zlog (NULL, LOG_DEBUG, "ISM[%s]: clear by reset", ifp->name); >> + >> + ospf_if_reset(ifp); >> +} >> + >> +DEFUN (clear_ip_ospf_interface, >> + clear_ip_ospf_interface_cmd, >> + "clear ip ospf interface [IFNAME]", >> + CLEAR_STR >> + IP_STR >> + "OSPF information\n" >> + "Interface information\n" >> + "Interface name\n") >> +{ >> + struct interface *ifp; >> + struct listnode *node; >> + >> + if (argc == 0) /* Clear all the ospfv2 interfaces. */ >> + { >> + for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp)) >> + ospf_interface_clear(ifp); >> + } >> + else /* Interface name is specified. */ >> + { >> + if ((ifp = if_lookup_by_name (argv[0])) == NULL) >> + vty_out (vty, "No such interface name%s", VTY_NEWLINE); >> + else >> + ospf_interface_clear(ifp); >> + } >> > > If I am reading this correctly, it clears all of the interfaces if an > interface name was not given explicitly, right? > > If this is the case, isn't there a danger of accidentally clearing all of > the interfaces? should the "clear all" behavior be explicitly asked for by > something like: > > clear ip ospf interface all Use of 'all' isn't quite consistent in quagga at the moment. r1# clea isis neighbor <cr> WORD System id r1# clear bgp * Clear all peers <1-4294967295> Clear peers with the AS number A.B.C.D BGP neighbor address to clear WORD BGP neighbor on interface to clear X:X::X:X BGP IPv6 neighbor to clear external Clear all external peers ipv6 Address family peer-group Clear all members of peer-group view BGP view r1# r1# show interface <cr> IFNAME Inteface name description Interface description vrf Specify the VRF r1# show interface vrf <0-65535> The VRF ID all All VRFs r1# show interface vrf therefore, i don't see an immediate need of 'all' here. Fine by me if explicit 'all' is made norm. VRF lib has introduced 'all' as well for show 'vrf all' Vipin > Regards, > Jafar > > > + >> + return CMD_SUCCESS; >> +} >> + >> +void >> +ospf_vty_clear_init (void) >> +{ >> + install_element (ENABLE_NODE, &clear_ip_ospf_interface_cmd); >> +} >> + >> /* Install OSPF related vty commands. */ >> void >> diff --git a/ospfd/ospf_vty.h b/ospfd/ospf_vty.h >> index da0ed1c..28bb419 100644 >> --- a/ospfd/ospf_vty.h >> +++ b/ospfd/ospf_vty.h >> @@ -53,5 +53,6 @@ >> /* Prototypes. */ >> extern void ospf_vty_init (void); >> extern void ospf_vty_show_init (void); >> +extern void ospf_vty_clear_init (void); >> #endif /* _QUAGGA_OSPF_VTY_H */ >> > >
_______________________________________________ Quagga-dev mailing list [email protected] https://lists.quagga.net/mailman/listinfo/quagga-dev
