summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWild Kat <wk@users.noreply.github.com>2018-05-11 21:27:39 +0200
committerGitHub <noreply@github.com>2018-05-11 21:27:39 +0200
commitdd2695bbb47ceee3cf677e49d24ac1b43c923e8e (patch)
treea9967ee18fc2c474ee5cefd3736638e8a620c37d
parent58c99b0fd9320eef4c73a0e25ea52eac87266fde (diff)
parent9273e5feee159040622348d922512dd6b2f097b9 (diff)
Merge pull request #1336 from macaty/master
Create stoneos.rb
-rw-r--r--CHANGELOG.md1
-rw-r--r--docs/Supported-OS-Types.md2
-rw-r--r--lib/oxidized/model/stoneos.rb32
3 files changed, 35 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4e7f09e..90456d0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,7 @@
## Master
+* FEATURE: stoneos model (@macaty)
* FEATURE: openwrt model (@z00nx)
## 0.21.0
diff --git a/docs/Supported-OS-Types.md b/docs/Supported-OS-Types.md
index 75845b9..ce0f9c6 100644
--- a/docs/Supported-OS-Types.md
+++ b/docs/Supported-OS-Types.md
@@ -95,6 +95,8 @@
* [Broadband Network Platform Software](/lib/oxidized/model/gcombnps.rb)
* Hatteras
* [Hatteras](/lib/oxidized/model/hatteras.rb)
+* Hillstone Networks
+ * [StoneOS](/lib/oxidized/model/stoneos.rb)
* Hirschmann
* [HiOS](/lib/oxidized/model/hirschmann.rb)
* HP
diff --git a/lib/oxidized/model/stoneos.rb b/lib/oxidized/model/stoneos.rb
new file mode 100644
index 0000000..d2bc017
--- /dev/null
+++ b/lib/oxidized/model/stoneos.rb
@@ -0,0 +1,32 @@
+class StoneOS < Oxidized::Model
+ # Hillstone Networks StoneOS software
+
+ prompt /^\r?[\w.()-]+[#>](\s)?$/
+ comment '# '
+
+ expect /^\s.*--More--.*$/ do |data, re|
+ send ' '
+ data.sub re, ''
+ end
+
+ cmd :all do |cfg|
+ cfg.each_line.to_a[1..-2].join
+ end
+
+ cmd 'show configuration running'
+
+ cmd 'show version' do |cfg|
+ comment cfg
+ end
+
+ cfg :telnet do
+ username(/^login:/)
+ password(/^Password:/)
+ end
+
+ cfg :telnet, :ssh do
+ post_login 'terminal length 256'
+ post_login 'terminal width 512'
+ pre_logout 'exit'
+ end
+end