Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

op-mode: T6601: move "reset ip(v6) arp|neighbor" to "clear ip(v6) arp|neighbor" #3885

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ op_mode_definitions: $(op_xml_obj)

find $(BUILD_DIR)/op-mode-definitions/ -type f -name "*.xml" | xargs -I {} $(CURDIR)/scripts/build-command-op-templates {} $(CURDIR)/schema/op-mode-definition.rng $(OP_TMPL_DIR) || exit 1

# XXX: create a symbolic reference from "show ip arp" -> "show ip neighbor"
ln -s neighbors $(OP_TMPL_DIR)/show/ip/arp

# XXX: tcpdump, ping, traceroute and mtr must be able to recursivly call themselves as the
# options are provided from the scripts themselves
ln -s ../node.tag $(OP_TMPL_DIR)/ping/node.tag/node.tag/
Expand Down
53 changes: 53 additions & 0 deletions op-mode-definitions/clear-ip.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,37 @@
<help>Clear Internet Protocol (IP) statistics or status</help>
</properties>
<children>
<node name="arp">
<properties>
<help>Reset Address Resolution Protocol (ARP) cache</help>
</properties>
<children>
<tagNode name="address">
<properties>
<help>Reset ARP cache for an IPv4 address</help>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there also be a clear ARP cache?

<completionHelp>
<list>&lt;x.x.x.x&gt;</list>
</completionHelp>
</properties>
<command>sudo ${vyos_op_scripts_dir}/neighbor.py reset --family inet --address "$5"</command>
</tagNode>
<tagNode name="interface">
<properties>
<help>Reset ARP cache for interface</help>
<completionHelp>
<script>${vyos_completion_dir}/list_interfaces</script>
</completionHelp>
</properties>
<command>sudo ${vyos_op_scripts_dir}/neighbor.py reset --family inet --interface "$5"</command>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there be a clear option instead of reset

</tagNode>
<node name="table">
<properties>
<help>Flush entire ARP cache</help>
</properties>
<command>sudo ${vyos_op_scripts_dir}/neighbor.py reset --family inet</command>
</node>
</children>
</node>
<node name="prefix-list">
<properties>
<help>Clear prefix-list statistics or status</help>
Expand All @@ -33,6 +64,28 @@
</leafNode>
</children>
</tagNode>
<node name="route">
<properties>
<help>Reset IP route</help>
</properties>
<children>
<leafNode name= "cache">
<properties>
<help>Flush the kernel route cache</help>
</properties>
<command>sudo ip route flush cache</command>
</leafNode>
<tagNode name="cache">
<properties>
<help>Flush the kernel route cache for a given route</help>
<completionHelp>
<list>&lt;x.x.x.x&gt; &lt;x.x.x.x/x&gt;</list>
</completionHelp>
</properties>
<command>sudo ip route flush cache "$5"</command>
</tagNode>
</children>
</node>
</children>
</node>
</children>
Expand Down
53 changes: 53 additions & 0 deletions op-mode-definitions/clear-ipv6.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,37 @@
<help>Clear Internet Protocol (IPv6) statistics or status</help>
</properties>
<children>
<node name="neighbors">
<properties>
<help>Reset IPv6 Neighbor Discovery (ND) cache</help>
</properties>
<children>
<tagNode name="address">
<properties>
<help>Reset ND cache for an IPv6 address</help>
<completionHelp>
<list>&lt;h:h:h:h:h:h:h:h&gt;</list>
</completionHelp>
</properties>
<command>sudo ${vyos_op_scripts_dir}/neighbor.py reset --family inet6 --address "$5"</command>
</tagNode>
<tagNode name="interface">
<properties>
<help>Reset IPv6 ND cache for interface</help>
<completionHelp>
<script>${vyos_completion_dir}/list_interfaces</script>
</completionHelp>
</properties>
<command>sudo ${vyos_op_scripts_dir}/neighbor.py reset --family inet6 --interface "$5"</command>
</tagNode>
<node name="table">
<properties>
<help>Flush entire IPv6 ND cache</help>
</properties>
<command>sudo ${vyos_op_scripts_dir}/neighbor.py reset --family inet6</command>
</node>
</children>
</node>
<node name="prefix-list">
<properties>
<help>Clear prefix-list statistics or status</help>
Expand All @@ -33,6 +64,28 @@
</leafNode>
</children>
</tagNode>
<node name="route">
<properties>
<help>Reset IPv6 route</help>
</properties>
<children>
<leafNode name= "cache">
<properties>
<help>Flush the kernel IPv6 route cache</help>
</properties>
<command>sudo ip -f inet6 route flush cache</command>
</leafNode>
<tagNode name="cache">
<properties>
<help>Flush the kernel IPv6 route cache for a given route</help>
<completionHelp>
<list>&lt;h:h:h:h:h:h:h:h&gt; &lt;h:h:h:h:h:h:h:h/x&gt;</list>
</completionHelp>
</properties>
<command>sudo ip -f inet6 route flush cache "$5"</command>
</tagNode>
</children>
</node>
</children>
</node>
</children>
Expand Down
87 changes: 0 additions & 87 deletions op-mode-definitions/ipv4-route.xml.in

This file was deleted.

107 changes: 0 additions & 107 deletions op-mode-definitions/ipv6-route.xml.in

This file was deleted.

6 changes: 6 additions & 0 deletions op-mode-definitions/reset-ip-bgp.xml.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
<?xml version="1.0"?>
<interfaceDefinition>
<node name="reset">
<properties>
<help>Reset a service</help>
</properties>
<children>
<node name="ip">
<properties>
<help>Reset Internet Protocol (IP) parameters</help>
</properties>
<children>
<node name="bgp">
<properties>
Expand Down
6 changes: 6 additions & 0 deletions op-mode-definitions/show-ip.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
<help>Show IPv4 networking information</help>
</properties>
<children>
<leafNode name="groups">
<properties>
<help>Show IP multicast group membership</help>
</properties>
<command>netstat -gn4</command>
</leafNode>
<node name="neighbors">
<properties>
<help>Show IPv4 neighbor (ARP) table</help>
Expand Down
Loading
Loading