summaryrefslogtreecommitdiff
path: root/op-mode-definitions
diff options
context:
space:
mode:
Diffstat (limited to 'op-mode-definitions')
-rw-r--r--op-mode-definitions/execute-bandwidth-test.xml.in (renamed from op-mode-definitions/monitor-bandwidth-test.xml.in)6
-rw-r--r--op-mode-definitions/execute-port-scan.xml.in34
-rw-r--r--op-mode-definitions/execute-shell.xml.in32
-rw-r--r--op-mode-definitions/execute-wamp.xml.in (renamed from op-mode-definitions/force-wamp.xml.in)2
-rw-r--r--op-mode-definitions/force-netns.xml.in16
-rw-r--r--op-mode-definitions/force-vrf.xml.in16
-rw-r--r--op-mode-definitions/ntp.xml.in8
-rw-r--r--op-mode-definitions/show-interfaces-macsec.xml.in8
-rw-r--r--op-mode-definitions/telnet.xml.in35
-rw-r--r--op-mode-definitions/wake-on-lan.xml.in32
10 files changed, 120 insertions, 69 deletions
diff --git a/op-mode-definitions/monitor-bandwidth-test.xml.in b/op-mode-definitions/execute-bandwidth-test.xml.in
index 965591280..1581d5c25 100644
--- a/op-mode-definitions/monitor-bandwidth-test.xml.in
+++ b/op-mode-definitions/execute-bandwidth-test.xml.in
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<interfaceDefinition>
- <node name="monitor">
+ <node name="execute">
<children>
<node name="bandwidth-test">
<properties>
@@ -39,7 +39,7 @@
<list>&lt;hostname&gt; &lt;x.x.x.x&gt; &lt;h:h:h:h:h:h:h:h&gt;</list>
</completionHelp>
</properties>
- <command>${vyos_op_scripts_dir}/monitor_bandwidth_test.sh "$5"</command>
+ <command>${vyos_op_scripts_dir}/execute_bandwidth_test.sh "$5"</command>
</tagNode>
<tagNode name="udp">
<properties>
@@ -48,7 +48,7 @@
<list>&lt;hostname&gt; &lt;x.x.x.x&gt; &lt;h:h:h:h:h:h:h:h&gt;</list>
</completionHelp>
</properties>
- <command>${vyos_op_scripts_dir}/monitor_bandwidth_test.sh "$5" "-u"</command>
+ <command>${vyos_op_scripts_dir}/execute_bandwidth_test.sh "$5" "-u"</command>
</tagNode>
</children>
</node>
diff --git a/op-mode-definitions/execute-port-scan.xml.in b/op-mode-definitions/execute-port-scan.xml.in
new file mode 100644
index 000000000..52cdab5f0
--- /dev/null
+++ b/op-mode-definitions/execute-port-scan.xml.in
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+<interfaceDefinition>
+ <node name="execute">
+ <children>
+ <node name="port-scan">
+ <properties>
+ <help>Scan network for open ports</help>
+ </properties>
+ <children>
+ <tagNode name="host">
+ <properties>
+ <help>IP address or domain name of the host to scan (scan all ports 1-65535)</help>
+ <completionHelp>
+ <list>&lt;hostname&gt; &lt;x.x.x.x&gt; &lt;h:h:h:h:h:h:h:h&gt;</list>
+ </completionHelp>
+ </properties>
+ <command>nmap -p- -T4 --max-retries=1 --host-timeout=30s "$4"</command>
+ <children>
+ <leafNode name="node.tag">
+ <properties>
+ <help>Port scan options</help>
+ <completionHelp>
+ <script>${vyos_op_scripts_dir}/execute_port-scan.py --get-options-nested "${COMP_WORDS[@]}"</script>
+ </completionHelp>
+ </properties>
+ <command>${vyos_op_scripts_dir}/execute_port-scan.py "${@:4}"</command>
+ </leafNode>
+ </children>
+ </tagNode>
+ </children>
+ </node>
+ </children>
+ </node>
+</interfaceDefinition>
diff --git a/op-mode-definitions/execute-shell.xml.in b/op-mode-definitions/execute-shell.xml.in
new file mode 100644
index 000000000..dfdc1e371
--- /dev/null
+++ b/op-mode-definitions/execute-shell.xml.in
@@ -0,0 +1,32 @@
+<?xml version="1.0"?>
+<interfaceDefinition>
+ <node name="execute">
+ <children>
+ <node name="shell">
+ <properties>
+ <help>Execute shell</help>
+ </properties>
+ <children>
+ <tagNode name="netns">
+ <properties>
+ <help>Execute shell in given Network Namespace</help>
+ <completionHelp>
+ <path>netns name</path>
+ </completionHelp>
+ </properties>
+ <command>sudo ip netns exec $4 su - $(whoami)</command>
+ </tagNode>
+ <tagNode name="vrf">
+ <properties>
+ <help>Execute shell in given VRF instance</help>
+ <completionHelp>
+ <path>vrf name</path>
+ </completionHelp>
+ </properties>
+ <command>sudo ip vrf exec $4 su - $(whoami)</command>
+ </tagNode>
+ </children>
+ </node>
+ </children>
+ </node>
+</interfaceDefinition>
diff --git a/op-mode-definitions/force-wamp.xml.in b/op-mode-definitions/execute-wamp.xml.in
index dbb205c6b..bcceedc53 100644
--- a/op-mode-definitions/force-wamp.xml.in
+++ b/op-mode-definitions/execute-wamp.xml.in
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<interfaceDefinition>
- <node name="force">
+ <node name="execute">
<children>
<tagNode name="owping">
<properties>
diff --git a/op-mode-definitions/force-netns.xml.in b/op-mode-definitions/force-netns.xml.in
deleted file mode 100644
index b9dc2c1e8..000000000
--- a/op-mode-definitions/force-netns.xml.in
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0"?>
-<interfaceDefinition>
- <node name="force">
- <children>
- <tagNode name="netns">
- <properties>
- <help>Execute shell in given Network Namespace</help>
- <completionHelp>
- <path>netns name</path>
- </completionHelp>
- </properties>
- <command>sudo ip netns exec $3 su - $(whoami)</command>
- </tagNode>
- </children>
- </node>
-</interfaceDefinition>
diff --git a/op-mode-definitions/force-vrf.xml.in b/op-mode-definitions/force-vrf.xml.in
deleted file mode 100644
index 71f50b0d2..000000000
--- a/op-mode-definitions/force-vrf.xml.in
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0"?>
-<interfaceDefinition>
- <node name="force">
- <children>
- <tagNode name="vrf">
- <properties>
- <help>Execute shell in given VRF instance</help>
- <completionHelp>
- <path>vrf name</path>
- </completionHelp>
- </properties>
- <command>sudo ip vrf exec $3 su - $(whoami)</command>
- </tagNode>
- </children>
- </node>
-</interfaceDefinition>
diff --git a/op-mode-definitions/ntp.xml.in b/op-mode-definitions/ntp.xml.in
index 17250a45e..565a5edb5 100644
--- a/op-mode-definitions/ntp.xml.in
+++ b/op-mode-definitions/ntp.xml.in
@@ -6,25 +6,25 @@
<properties>
<help>Show peer status of NTP daemon</help>
</properties>
- <command>${vyos_op_scripts_dir}/ntp.py show_sourcestats</command>
+ <command>sudo ${vyos_op_scripts_dir}/ntp.py show_sourcestats</command>
<children>
<node name="activity">
<properties>
<help>Report the number of servers and peers that are online and offline</help>
</properties>
- <command>${vyos_op_scripts_dir}/ntp.py show_activity</command>
+ <command>sudo ${vyos_op_scripts_dir}/ntp.py show_activity</command>
</node>
<node name="sources">
<properties>
<help>Show information about the current time sources being accessed</help>
</properties>
- <command>${vyos_op_scripts_dir}/ntp.py show_sources</command>
+ <command>sudo ${vyos_op_scripts_dir}/ntp.py show_sources</command>
</node>
<node name="system">
<properties>
<help>Show parameters about the system clock performance</help>
</properties>
- <command>${vyos_op_scripts_dir}/ntp.py show_tracking</command>
+ <command>sudo ${vyos_op_scripts_dir}/ntp.py show_tracking</command>
</node>
</children>
</node>
diff --git a/op-mode-definitions/show-interfaces-macsec.xml.in b/op-mode-definitions/show-interfaces-macsec.xml.in
index a264ff22e..28264d252 100644
--- a/op-mode-definitions/show-interfaces-macsec.xml.in
+++ b/op-mode-definitions/show-interfaces-macsec.xml.in
@@ -12,6 +12,14 @@
</completionHelp>
</properties>
<command>ip macsec show</command>
+ <children>
+ <leafNode name="detail">
+ <properties>
+ <help>Show detailed MACsec interface information</help>
+ </properties>
+ <command>ip -s macsec show</command>
+ </leafNode>
+ </children>
</node>
<tagNode name="macsec">
<properties>
diff --git a/op-mode-definitions/telnet.xml.in b/op-mode-definitions/telnet.xml.in
index c5bb6d283..2cacc6a26 100644
--- a/op-mode-definitions/telnet.xml.in
+++ b/op-mode-definitions/telnet.xml.in
@@ -1,30 +1,35 @@
<?xml version="1.0"?>
<interfaceDefinition>
- <node name="telnet">
- <properties>
- <help>Telnet to a node</help>
- </properties>
+ <node name="execute">
<children>
- <tagNode name="to">
+ <node name="telnet">
<properties>
- <help>Telnet to a host</help>
- <completionHelp>
- <list>&lt;hostname&gt; &lt;x.x.x.x&gt; &lt;h:h:h:h:h:h:h:h&gt;</list>
- </completionHelp>
+ <help>Telnet to a node</help>
</properties>
- <command>/usr/bin/telnet $3</command>
<children>
- <tagNode name="port">
+ <tagNode name="to">
<properties>
- <help>Telnet to a host:port</help>
+ <help>Telnet to a host</help>
<completionHelp>
- <list>&lt;0-65535&gt;</list>
+ <list>&lt;hostname&gt; &lt;x.x.x.x&gt; &lt;h:h:h:h:h:h:h:h&gt;</list>
</completionHelp>
</properties>
- <command>/usr/bin/telnet $3 $5</command>
+ <command>/usr/bin/telnet $4</command>
+ <children>
+ <tagNode name="port">
+ <properties>
+ <help>Telnet to a host:port</help>
+ <completionHelp>
+ <list>&lt;0-65535&gt;</list>
+ </completionHelp>
+ </properties>
+ <command>/usr/bin/telnet $4 $6</command>
+ </tagNode>
+ </children>
</tagNode>
</children>
- </tagNode>
+ </node>
</children>
</node>
</interfaceDefinition>
+
diff --git a/op-mode-definitions/wake-on-lan.xml.in b/op-mode-definitions/wake-on-lan.xml.in
index 7119eeb65..d4589c868 100644
--- a/op-mode-definitions/wake-on-lan.xml.in
+++ b/op-mode-definitions/wake-on-lan.xml.in
@@ -1,26 +1,30 @@
<?xml version="1.0"?>
<interfaceDefinition>
- <node name="wake-on-lan">
- <properties>
- <help>Send Wake-On-LAN (WOL) Magic Packet</help>
- </properties>
+ <node name="execute">
<children>
- <tagNode name="interface">
+ <node name="wake-on-lan">
<properties>
- <help>Interface where the station is connected</help>
- <completionHelp>
- <script>${vyos_completion_dir}/list_interfaces</script>
- </completionHelp>
+ <help>Send Wake-On-LAN (WOL) Magic Packet</help>
</properties>
<children>
- <tagNode name="host">
+ <tagNode name="interface">
<properties>
- <help>Station (MAC) address to wake up</help>
+ <help>Interface where the station is connected</help>
+ <completionHelp>
+ <script>${vyos_completion_dir}/list_interfaces</script>
+ </completionHelp>
</properties>
- <command>sudo /usr/sbin/etherwake -i "$3" "$5"</command>
- </tagNode>
+ <children>
+ <tagNode name="host">
+ <properties>
+ <help>Station (MAC) address to wake up</help>
+ </properties>
+ <command>sudo /usr/sbin/etherwake -i "$4" "$6"</command>
+ </tagNode>
+ </children>
+ </tagNode>
</children>
- </tagNode>
+ </node>
</children>
</node>
</interfaceDefinition>