network-utility 1.1.55 → 1.1.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/document/bgp-CR16010H-F.md +112 -1
  3. data/document/bgp-CR16018-F.md +112 -2
  4. data/document/bgp-CR19000-20.md +112 -2
  5. data/document/bgp-CRS-16.md +178 -2
  6. data/document/bgp-M6000-16E.md +112 -2
  7. data/document/bgp-M6000-18S.md +112 -2
  8. data/document/bgp-M6000-8.md +112 -2
  9. data/document/bgp-M6000-8E.md +112 -2
  10. data/document/bgp-ME60-16.md +112 -2
  11. data/document/bgp-ME60-X16.md +112 -2
  12. data/document/bgp-NE40E-X16.md +112 -2
  13. data/document/bgp-NE40E-X16A.md +112 -2
  14. data/document/bgp-NE40E-X8.md +112 -2
  15. data/document/bgp-NE5000E-20.md +112 -2
  16. data/document/bgp-NE5000E-X16.md +112 -2
  17. data/document/bgp-NE5000E-X16A.md +112 -2
  18. data/document/bgp-T8000-18.md +112 -1
  19. data/document/config.md +31 -27
  20. data/document/if-ALCATEL7750.md +24 -0
  21. data/document/if-CRS-16.md +28 -0
  22. data/document/if-NE40E-X16.md +11 -11
  23. data/document/if-Nokia7750.md +24 -0
  24. data/document/isis-ALCATEL7750.md +73 -0
  25. data/document/isis-CR16010H-F.md +66 -0
  26. data/document/isis-CR16018-F.md +66 -0
  27. data/document/isis-CR19000-20.md +66 -0
  28. data/document/isis-CRS-16.md +110 -0
  29. data/document/isis-CX600-X16A.md +1 -0
  30. data/document/isis-CX600-X8A.md +1 -0
  31. data/document/isis-M6000-16E.md +99 -0
  32. data/document/isis-M6000-18S.md +99 -0
  33. data/document/isis-M6000-8E.md +99 -0
  34. data/document/isis-NE40E-X16.md +141 -0
  35. data/document/isis-NE40E-X16A.md +1 -0
  36. data/document/isis-NE5000E-20.md +1 -0
  37. data/document/isis-NE5000E-X16.md +1 -0
  38. data/document/isis-NE5000E-X16A.md +1 -0
  39. data/document/isis-NE8000E-X8.md +1 -0
  40. data/document/isis-NE8100-X8.md +1 -0
  41. data/document/isis-Nokia7750.md +75 -0
  42. data/document/isis-T8000-18.md +99 -0
  43. data/network.rb +1 -1
  44. metadata +12 -1
@@ -0,0 +1,66 @@
1
+
2
+ # CR16010H-F isis
3
+
4
+ ```ruby
5
+ @sign << ['CR16010H-F', '接口isis']
6
+ @sign << ['CR16010H-F', 'isis']
7
+
8
+ module CR16010H_F
9
+ module_function
10
+
11
+ def 接口isis 接口配置
12
+ isis = {}
13
+ port_name = self.端口识别(接口配置.split("\n").first.to_s).join()
14
+ lines = 接口配置.split("\n").select{|line|line.strip[0..4]=='isis '}
15
+ lines.each do|line|
16
+ isis['authentication-mode'] = line.strip.split('mode ').last if line.include?('authentication-mode')
17
+ isis['pid'] = line.strip.split(' ').last.to_i if line.include?('isis enable')
18
+ isis['ipv6-pid'] = line.strip.split(' ').last.to_i if line.include?('isis ipv6 enable')
19
+ isis['circuit-level'] = line.split('circuit-level').last.strip if line.include?('isis circuit-level')
20
+ isis['cost'] = line.strip.split(' ').last.to_i if line.include?('isis cost')
21
+ isis['ipv6-level'] = line.split(' ').find{|s|s.include?('level')} if line.include?('isis ipv6 cost')
22
+ isis['ipv6-cost'] = line.strip.split(' ').last.to_i if line.include?('isis ipv6 cost')
23
+ isis['small-hello'] = 'enable' if line.include?('isis small-hello')
24
+ end
25
+ return { port_name => isis }
26
+ end
27
+
28
+ def isis isis配置
29
+ isis = {};addr_flag = false;af_name = nil
30
+ isis配置.split("\n").each do|line|
31
+ if line.include?('address-family')
32
+ af_name = line.split('address-family ').last.strip.gsub('-','')
33
+ addr_flag = true
34
+ end
35
+ if line.strip=='#'
36
+ af_name = nil
37
+ addr_flag = false
38
+ end
39
+ if addr_flag
40
+ isis['address-family'] ||= {}
41
+ isis['address-family'][af_name] ||= {}
42
+ isis['address-family'][af_name]['preference'] = line.split(' ').last if line.include?('preference')
43
+ isis['address-family'][af_name]['max-load-balancing'] = line.split(' ').last if line.include?('maximum load-balancing')
44
+ isis['address-family'][af_name]['multi-topology'] = 'enable' if line.include?('multi-topology')
45
+ if line.include?('import-route')
46
+ isis['address-family'][af_name]['import-route'] ||= []
47
+ isis['address-family'][af_name]['import-route'] << line.split(' ')[1..-1].join(" ")
48
+ end
49
+ else
50
+ isis['pid'] = line.split(' ').last.strip if line[0..4]=='isis '
51
+ isis['level'] = line.split(' ').last.strip if line.include?('is-level')
52
+ isis['flash-flood'] = line.split(' ').last.strip if line.include?('flash-flood')
53
+ isis['cost-style'] = line.split(' ').last.strip if line.include?('cost-style')
54
+ if line.include?('timer lsp')
55
+ isis['lsp-timer'] ||= {}
56
+ isis['lsp-timer']['max-age'] = line.split(' ').last if line.include?('lsp-max-age')
57
+ isis['lsp-timer']['refresh'] = line.split(' ').last if line.include?('lsp-refresh')
58
+ end
59
+ isis['net'] = line.split(' ').last if line.include?('network-entity')
60
+ isis['is-name'] = line.split(' ').last if line.include?('is-name')
61
+ end
62
+ end
63
+ return isis
64
+ end
65
+ end
66
+ ```
@@ -0,0 +1,66 @@
1
+
2
+ # CR16018-F isis
3
+
4
+ ```ruby
5
+ @sign << ['CR16018-F', '接口isis']
6
+ @sign << ['CR16018-F', 'isis']
7
+
8
+ module CR16018_F
9
+ module_function
10
+
11
+ def 接口isis 接口配置
12
+ isis = {}
13
+ port_name = self.端口识别(接口配置.split("\n").first.to_s).join()
14
+ lines = 接口配置.split("\n").select{|line|line.strip[0..4]=='isis '}
15
+ lines.each do|line|
16
+ isis['authentication-mode'] = line.strip.split('mode ').last if line.include?('authentication-mode')
17
+ isis['pid'] = line.strip.split(' ').last.to_i if line.include?('isis enable')
18
+ isis['ipv6-pid'] = line.strip.split(' ').last.to_i if line.include?('isis ipv6 enable')
19
+ isis['circuit-level'] = line.split('circuit-level').last.strip if line.include?('isis circuit-level')
20
+ isis['cost'] = line.strip.split(' ').last.to_i if line.include?('isis cost')
21
+ isis['ipv6-level'] = line.split(' ').find{|s|s.include?('level')} if line.include?('isis ipv6 cost')
22
+ isis['ipv6-cost'] = line.strip.split(' ').last.to_i if line.include?('isis ipv6 cost')
23
+ isis['small-hello'] = 'enable' if line.include?('isis small-hello')
24
+ end
25
+ return { port_name => isis }
26
+ end
27
+
28
+ def isis isis配置
29
+ isis = {};addr_flag = false;af_name = nil
30
+ isis配置.split("\n").each do|line|
31
+ if line.include?('address-family')
32
+ af_name = line.split('address-family ').last.strip.gsub('-','')
33
+ addr_flag = true
34
+ end
35
+ if line.strip=='#'
36
+ af_name = nil
37
+ addr_flag = false
38
+ end
39
+ if addr_flag
40
+ isis['address-family'] ||= {}
41
+ isis['address-family'][af_name] ||= {}
42
+ isis['address-family'][af_name]['preference'] = line.split(' ').last if line.include?('preference')
43
+ isis['address-family'][af_name]['max-load-balancing'] = line.split(' ').last if line.include?('maximum load-balancing')
44
+ isis['address-family'][af_name]['multi-topology'] = 'enable' if line.include?('multi-topology')
45
+ if line.include?('import-route')
46
+ isis['address-family'][af_name]['import-route'] ||= []
47
+ isis['address-family'][af_name]['import-route'] << line.split(' ')[1..-1].join(" ")
48
+ end
49
+ else
50
+ isis['pid'] = line.split(' ').last.strip if line[0..4]=='isis '
51
+ isis['level'] = line.split(' ').last.strip if line.include?('is-level')
52
+ isis['flash-flood'] = line.split(' ').last.strip if line.include?('flash-flood')
53
+ isis['cost-style'] = line.split(' ').last.strip if line.include?('cost-style')
54
+ if line.include?('timer lsp')
55
+ isis['lsp-timer'] ||= {}
56
+ isis['lsp-timer']['max-age'] = line.split(' ').last if line.include?('lsp-max-age')
57
+ isis['lsp-timer']['refresh'] = line.split(' ').last if line.include?('lsp-refresh')
58
+ end
59
+ isis['net'] = line.split(' ').last if line.include?('network-entity')
60
+ isis['is-name'] = line.split(' ').last if line.include?('is-name')
61
+ end
62
+ end
63
+ return isis
64
+ end
65
+ end
66
+ ```
@@ -0,0 +1,66 @@
1
+
2
+ # CR19000-20 isis
3
+
4
+ ```ruby
5
+ @sign << ['CR19000-20', '接口isis']
6
+ @sign << ['CR19000-20', 'isis']
7
+
8
+ module CR19000_20
9
+ module_function
10
+
11
+ def 接口isis 接口配置
12
+ isis = {}
13
+ port_name = self.端口识别(接口配置.split("\n").first.to_s).join()
14
+ lines = 接口配置.split("\n").select{|line|line.strip[0..4]=='isis '}
15
+ lines.each do|line|
16
+ isis['authentication-mode'] = line.strip.split('mode ').last if line.include?('authentication-mode')
17
+ isis['pid'] = line.strip.split(' ').last.to_i if line.include?('isis enable')
18
+ isis['ipv6-pid'] = line.strip.split(' ').last.to_i if line.include?('isis ipv6 enable')
19
+ isis['circuit-level'] = line.split('circuit-level').last.strip if line.include?('isis circuit-level')
20
+ isis['cost'] = line.strip.split(' ').last.to_i if line.include?('isis cost')
21
+ isis['ipv6-level'] = line.split(' ').find{|s|s.include?('level')} if line.include?('isis ipv6 cost')
22
+ isis['ipv6-cost'] = line.strip.split(' ').last.to_i if line.include?('isis ipv6 cost')
23
+ isis['small-hello'] = 'enable' if line.include?('isis small-hello')
24
+ end
25
+ return { port_name => isis }
26
+ end
27
+
28
+ def isis isis配置
29
+ isis = {};addr_flag = false;af_name = nil
30
+ isis配置.split("\n").each do|line|
31
+ if line.include?('address-family')
32
+ af_name = line.split('address-family ').last.strip.gsub('-','')
33
+ addr_flag = true
34
+ end
35
+ if line.strip=='#'
36
+ af_name = nil
37
+ addr_flag = false
38
+ end
39
+ if addr_flag
40
+ isis['address-family'] ||= {}
41
+ isis['address-family'][af_name] ||= {}
42
+ isis['address-family'][af_name]['preference'] = line.split(' ').last if line.include?('preference')
43
+ isis['address-family'][af_name]['max-load-balancing'] = line.split(' ').last if line.include?('maximum load-balancing')
44
+ isis['address-family'][af_name]['multi-topology'] = 'enable' if line.include?('multi-topology')
45
+ if line.include?('import-route')
46
+ isis['address-family'][af_name]['import-route'] ||= []
47
+ isis['address-family'][af_name]['import-route'] << line.split(' ')[1..-1].join(" ")
48
+ end
49
+ else
50
+ isis['pid'] = line.split(' ').last.strip if line[0..4]=='isis '
51
+ isis['level'] = line.split(' ').last.strip if line.include?('is-level')
52
+ isis['flash-flood'] = line.split(' ').last.strip if line.include?('flash-flood')
53
+ isis['cost-style'] = line.split(' ').last.strip if line.include?('cost-style')
54
+ if line.include?('timer lsp')
55
+ isis['lsp-timer'] ||= {}
56
+ isis['lsp-timer']['max-age'] = line.split(' ').last if line.include?('lsp-max-age')
57
+ isis['lsp-timer']['refresh'] = line.split(' ').last if line.include?('lsp-refresh')
58
+ end
59
+ isis['net'] = line.split(' ').last if line.include?('network-entity')
60
+ isis['is-name'] = line.split(' ').last if line.include?('is-name')
61
+ end
62
+ end
63
+ return isis
64
+ end
65
+ end
66
+ ```
@@ -0,0 +1,110 @@
1
+
2
+ # CRS-16 isis
3
+
4
+ ```ruby
5
+ @sign << ['CRS-16', '接口isis']
6
+ @sign << ['CRS-16', 'isis接口']
7
+ @sign << ['CRS-16', 'isis配置']
8
+ @sign << ['CRS-16', 'isis']
9
+
10
+ module CRS_16
11
+ module_function
12
+
13
+ def 接口isis 接口配置
14
+ isis = {};addr_flag = false;af_name = nil
15
+ port_name = self.端口识别(接口配置.split("\n").first.to_s).join()
16
+ 接口配置.split("\n").each do|line|
17
+ if line.include?('address-family')
18
+ af_name = line.split(" ")[1..-1].join('-')
19
+ addr_flag = true
20
+ end
21
+ if line[0..2]==' !'
22
+ af_name = nil
23
+ addr_flag = false
24
+ end
25
+ if addr_flag
26
+ words = line.strip.split(' ')
27
+ isis['address-family'] ||= {}
28
+ isis['address-family'][af_name] ||= {}
29
+ isis['address-family'][af_name]['metric'] = words[words.index('metric')+1] if words.include?('metric')
30
+ isis['address-family'][af_name]['level'] = words[words.index('level')+1] if words.include?('level')
31
+ else
32
+ isis['authentication-mode'] = line.strip.split('password ').last if line.include?('hello-password')
33
+ isis['hello-interval'] = line.strip.split(' ').last if line.include?('hello-interval')
34
+ isis['hello-padding'] = line.strip.split(' ').last if line.include?('hello-padding')
35
+ isis['circuit-type'] = line.split('circuit-type').last.strip if line.include?('circuit-type')
36
+ isis['point-to-point'] = 'enable' if line.include?('point-to-point')
37
+ end
38
+ end
39
+ return { port_name => isis }
40
+ end
41
+
42
+ def isis接口 配置
43
+ (self.isis配置 配置).join("\n").match_paragraph("\n interface ", "\n !")
44
+ end
45
+
46
+ def isis配置 配置
47
+ fragment = []
48
+ 配置['router'].each do|part|
49
+ flag = false
50
+ part.split("\n").each do|line|
51
+ flag = true if line[0..11]=='router isis '
52
+ if flag
53
+ if line[0..11]=='snmp-server '
54
+ flag = false;break
55
+ else
56
+ fragment << line
57
+ end
58
+ end
59
+ end
60
+ end
61
+ return fragment
62
+ end
63
+
64
+ def isis 配置
65
+ isis = {};addr_flag = false; af_name = nil; intf_flag = false
66
+ (self.isis配置 配置).each do|line|
67
+ if line[0..10]==' interface '
68
+ intf_flag = true
69
+ end
70
+ if line[0..1]==' !'
71
+ intf_flag = false
72
+ end
73
+ next if line=='!'
74
+ next if intf_flag
75
+
76
+ if line[0..15]==' address-family '
77
+ af_name = line.split(" ")[1..-1].join('-')
78
+ addr_flag = true
79
+ end
80
+ if line[0..1]==' !' && addr_flag==true
81
+ af_name = nil
82
+ addr_flag = false
83
+ end
84
+ if addr_flag
85
+ words = line.strip.split(' ')
86
+ isis['address-family'] ||= {}
87
+ isis['address-family'][af_name] ||= {}
88
+ isis['address-family'][af_name]['metric-style'] = words.last if words.include?('metric-style')
89
+ isis['address-family'][af_name]['metric'] = words[words.index('metric')+1] if words.include?('metric ')
90
+ isis['address-family'][af_name]['level'] = words[words.index('level')+1] if words.include?('level')
91
+ isis['address-family'][af_name]['ispf'] = words[1..-1].join(' ') if words.include?('ispf')
92
+ isis['address-family'][af_name]['maximum-paths'] = words.last if words.include?('maximum-paths')
93
+ else
94
+ isis['pname'] = line.split(' ').last.strip if line.include? 'router isis '
95
+ isis['is-type'] = line.split(' ').last if line.include?('is-type')
96
+ isis['net'] = line.split(' ').last if line.include?('network-entity')
97
+ isis['nsf'] = line.split(' ').last.strip if line.include?('nsf')
98
+ isis['log'] = line.split(' ')[1..-1].join(" ") if line.include?('log')
99
+ if line.include?('set-overload')
100
+ isis['set-overload'] ||= {}
101
+ if line.include?('on-startup')
102
+ isis['set-overload']['on-startup'] = line.split(' ').last
103
+ end
104
+ end
105
+ end
106
+ end
107
+ return isis
108
+ end
109
+ end
110
+ ```
@@ -12,6 +12,7 @@ module CX600_X16A
12
12
  port_name = self.端口识别(接口配置.split("\n").first.to_s).join()
13
13
  lines = 接口配置.split("\n").select{|line|line.strip[0..4]=='isis '}
14
14
  lines.each do|line|
15
+ isis['authentication-mode'] = line.strip.split('mode ').last if line.include?('authentication-mode')
15
16
  isis['pid'] = line.strip.split(' ').last.to_i if line.include?('isis enable')
16
17
  isis['ipv6-pid'] = line.strip.split(' ').last.to_i if line.include?('isis ipv6 enable')
17
18
  isis['circuit-type'] = line.split('circuit-type').last.strip if line.include?('isis circuit-type')
@@ -13,6 +13,7 @@ module CX600_X8A
13
13
  port_name = self.端口识别(接口配置.split("\n").first.to_s).join()
14
14
  lines = 接口配置.split("\n").select{|line|line.strip[0..4]=='isis '}
15
15
  lines.each do|line|
16
+ isis['authentication-mode'] = line.strip.split('mode ').last if line.include?('authentication-mode')
16
17
  isis['pid'] = line.strip.split(' ').last.to_i if line.include?('isis enable')
17
18
  isis['ipv6-pid'] = line.strip.split(' ').last.to_i if line.include?('isis ipv6 enable')
18
19
  isis['circuit-type'] = line.split('circuit-type').last.strip if line.include?('isis circuit-type')
@@ -0,0 +1,99 @@
1
+ # M6000-16E isis
2
+
3
+ ```ruby
4
+ @sign << ['M6000-16E', '接口isis']
5
+ @sign << ['M6000-16E', 'isis接口']
6
+ @sign << ['M6000-16E', 'isis']
7
+
8
+ module M6000_16E
9
+ module_function
10
+
11
+ def 接口isis 接口配置 # from isis module
12
+ isis = {}
13
+ port_name = self.端口识别(接口配置.split("\n").first.to_s).join()
14
+ 接口配置.split("\n").each do|line|
15
+ isis['isis'] = 'enable' if line.include?('ip router isis')
16
+ isis['isis-ipv6'] = 'enable' if line.include?('ipv6 router isis')
17
+ if line.include?('metric') && line.include?('level') && !line.include?('ipv6')
18
+ isis['metric'] = {
19
+ 'value' => line.split('metric ').last.split(' ').first,
20
+ 'type' => line.split(' ').find{|w|w.include?('level')}
21
+ }
22
+ elsif line.include?('metric') && line.include?('level') && line.include?('ipv6')
23
+ isis['metric-ipv6'] = {
24
+ 'value' => line.split('metric ').last.split(' ').first,
25
+ 'type' => line.split(' ').find{|w|w.include?('level')}
26
+ }
27
+ end
28
+ isis['circuit-type'] = line.split('circuit-type').last.strip if line.include?('circuit-type')
29
+ isis['network'] = line.split('network').last.strip if line.include?('network')
30
+ if line.include?('authentication')
31
+ isis['authentication'] ||= {}
32
+ if line.include?('authentication-type')
33
+ isis['authentication']['type'] = line.split('authentication-type').last.strip
34
+ elsif line.include?('authentication encrypted')
35
+ isis['authentication']['password'] = line.split('authentication').last.strip
36
+ end
37
+ end
38
+ end
39
+ return { port_name => isis }
40
+ end
41
+
42
+ def isis接口 isis配置
43
+ isis配置.match_paragraph("\n interface ", "\n $")
44
+ end
45
+
46
+ def isis isis配置
47
+ isis = {};aflag,iflag = false, false;af_name = nil
48
+ isis配置.split("\n").each do|line|
49
+ if line.include?('address-family ')
50
+ aflag = true
51
+ isis['address-family'] ||= {}
52
+ af_name = line.split(' ').last
53
+ isis['address-family'][af_name] ||= {}
54
+ elsif line.include?('interface ')
55
+ bflag = true
56
+ end
57
+ (aflag = false;af_name=nil) if aflag && line.strip=='$'
58
+ iflag = false if iflag && line.strip=='$'
59
+ if aflag
60
+ isis['address-family'][af_name]['distance'] = line.split('distance').last.strip if line.include?('distance')
61
+ isis['address-family'][af_name]['maximum-paths'] = line.split('maximum-paths').last.strip if line.include?('maximum-paths')
62
+ isis['address-family'][af_name]['multi-topology'] = line.split('multi-topology').last.strip if line.include?('multi-topology')
63
+ if line.include?('metric')
64
+ isis['address-family'][af_name]['metric'] = {
65
+ 'value' => line.split("metric").last.split(' ').first.strip,
66
+ 'type' => line.split(' ').find{|s|s.include?('level')}.to_s.strip
67
+ }
68
+ end
69
+ end
70
+ if !aflag && !iflag
71
+ isis['pid'] = line.split(' ').last.strip if line.include?('router isis ')
72
+ isis['area'] = line.split(' ').last.strip if line.include?('area ')
73
+ isis['system-id'] = line.split(' ').last.strip if line.include?('system-id ')
74
+ isis['is-type'] = line.split(' ').last.strip if line.include?('is-type ')
75
+ isis['distance'] = line.split(' ').last.strip if line.include?('distance ')
76
+ isis['lsp-refresh-time'] = line.split(' ').last.strip if line.include?('lsp-refresh-time')
77
+ isis['max-lsp-lifetime'] = line.split(' ').last.strip if line.include?('max-lsp-lifetime')
78
+ isis['maximum-paths'] = line.split(' ').last.strip if line.include?('maximum-paths')
79
+ if line.include?('metric')
80
+ isis['metric'] ||= {}
81
+ if line.include?('metric-style ')
82
+ isis['metric']['style'] = line.split(' ').last.strip
83
+ else
84
+ isis['metric'].merge!(
85
+ 'value' => line.split("metric").last.split(' ').first.strip,
86
+ 'type' => line.split(' ').find{|s|s.include?('level')}.to_s.strip
87
+ )
88
+ end
89
+ end
90
+ if line.include?('redistribute')
91
+ isis['redistribute'] ||= []
92
+ isis['redistribute'] << line.split(' ')[1..-1].join(' ')
93
+ end
94
+ end
95
+ end
96
+ return isis
97
+ end
98
+ end
99
+ ```
@@ -0,0 +1,99 @@
1
+ # M6000-18S isis
2
+
3
+ ```ruby
4
+ @sign << ['M6000-18S', '接口isis']
5
+ @sign << ['M6000-18S', 'isis接口']
6
+ @sign << ['M6000-18S', 'isis']
7
+
8
+ module M6000_18S
9
+ module_function
10
+
11
+ def 接口isis 接口配置 # from isis module
12
+ isis = {}
13
+ port_name = self.端口识别(接口配置.split("\n").first.to_s).join()
14
+ 接口配置.split("\n").each do|line|
15
+ isis['isis'] = 'enable' if line.include?('ip router isis')
16
+ isis['isis-ipv6'] = 'enable' if line.include?('ipv6 router isis')
17
+ if line.include?('metric') && line.include?('level') && !line.include?('ipv6')
18
+ isis['metric'] = {
19
+ 'value' => line.split('metric ').last.split(' ').first,
20
+ 'type' => line.split(' ').find{|w|w.include?('level')}
21
+ }
22
+ elsif line.include?('metric') && line.include?('level') && line.include?('ipv6')
23
+ isis['metric-ipv6'] = {
24
+ 'value' => line.split('metric ').last.split(' ').first,
25
+ 'type' => line.split(' ').find{|w|w.include?('level')}
26
+ }
27
+ end
28
+ isis['circuit-type'] = line.split('circuit-type').last.strip if line.include?('circuit-type')
29
+ isis['network'] = line.split('network').last.strip if line.include?('network')
30
+ if line.include?('authentication')
31
+ isis['authentication'] ||= {}
32
+ if line.include?('authentication-type')
33
+ isis['authentication']['type'] = line.split('authentication-type').last.strip
34
+ elsif line.include?('authentication encrypted')
35
+ isis['authentication']['password'] = line.split('authentication').last.strip
36
+ end
37
+ end
38
+ end
39
+ return { port_name => isis }
40
+ end
41
+
42
+ def isis接口 isis配置
43
+ isis配置.match_paragraph("\n interface ", "\n $")
44
+ end
45
+
46
+ def isis isis配置
47
+ isis = {};aflag,iflag = false, false;af_name = nil
48
+ isis配置.split("\n").each do|line|
49
+ if line.include?('address-family ')
50
+ aflag = true
51
+ isis['address-family'] ||= {}
52
+ af_name = line.split(' ').last
53
+ isis['address-family'][af_name] ||= {}
54
+ elsif line.include?('interface ')
55
+ bflag = true
56
+ end
57
+ (aflag = false;af_name=nil) if aflag && line.strip=='$'
58
+ iflag = false if iflag && line.strip=='$'
59
+ if aflag
60
+ isis['address-family'][af_name]['distance'] = line.split('distance').last.strip if line.include?('distance')
61
+ isis['address-family'][af_name]['maximum-paths'] = line.split('maximum-paths').last.strip if line.include?('maximum-paths')
62
+ isis['address-family'][af_name]['multi-topology'] = line.split('multi-topology').last.strip if line.include?('multi-topology')
63
+ if line.include?('metric')
64
+ isis['address-family'][af_name]['metric'] = {
65
+ 'value' => line.split("metric").last.split(' ').first.strip,
66
+ 'type' => line.split(' ').find{|s|s.include?('level')}.to_s.strip
67
+ }
68
+ end
69
+ end
70
+ if !aflag && !iflag
71
+ isis['pid'] = line.split(' ').last.strip if line.include?('router isis ')
72
+ isis['area'] = line.split(' ').last.strip if line.include?('area ')
73
+ isis['system-id'] = line.split(' ').last.strip if line.include?('system-id ')
74
+ isis['is-type'] = line.split(' ').last.strip if line.include?('is-type ')
75
+ isis['distance'] = line.split(' ').last.strip if line.include?('distance ')
76
+ isis['lsp-refresh-time'] = line.split(' ').last.strip if line.include?('lsp-refresh-time')
77
+ isis['max-lsp-lifetime'] = line.split(' ').last.strip if line.include?('max-lsp-lifetime')
78
+ isis['maximum-paths'] = line.split(' ').last.strip if line.include?('maximum-paths')
79
+ if line.include?('metric')
80
+ isis['metric'] ||= {}
81
+ if line.include?('metric-style ')
82
+ isis['metric']['style'] = line.split(' ').last.strip
83
+ else
84
+ isis['metric'].merge!(
85
+ 'value' => line.split("metric").last.split(' ').first.strip,
86
+ 'type' => line.split(' ').find{|s|s.include?('level')}.to_s.strip
87
+ )
88
+ end
89
+ end
90
+ if line.include?('redistribute')
91
+ isis['redistribute'] ||= []
92
+ isis['redistribute'] << line.split(' ')[1..-1].join(' ')
93
+ end
94
+ end
95
+ end
96
+ return isis
97
+ end
98
+ end
99
+ ```
@@ -0,0 +1,99 @@
1
+ # M6000-8E isis
2
+
3
+ ```ruby
4
+ @sign << ['M6000-8E', '接口isis']
5
+ @sign << ['M6000-8E', 'isis接口']
6
+ @sign << ['M6000-8E', 'isis']
7
+
8
+ module M6000_8E
9
+ module_function
10
+
11
+ def 接口isis 接口配置 # from isis module
12
+ isis = {}
13
+ port_name = self.端口识别(接口配置.split("\n").first.to_s).join()
14
+ 接口配置.split("\n").each do|line|
15
+ isis['isis'] = 'enable' if line.include?('ip router isis')
16
+ isis['isis-ipv6'] = 'enable' if line.include?('ipv6 router isis')
17
+ if line.include?('metric') && line.include?('level') && !line.include?('ipv6')
18
+ isis['metric'] = {
19
+ 'value' => line.split('metric ').last.split(' ').first,
20
+ 'type' => line.split(' ').find{|w|w.include?('level')}
21
+ }
22
+ elsif line.include?('metric') && line.include?('level') && line.include?('ipv6')
23
+ isis['metric-ipv6'] = {
24
+ 'value' => line.split('metric ').last.split(' ').first,
25
+ 'type' => line.split(' ').find{|w|w.include?('level')}
26
+ }
27
+ end
28
+ isis['circuit-type'] = line.split('circuit-type').last.strip if line.include?('circuit-type')
29
+ isis['network'] = line.split('network').last.strip if line.include?('network')
30
+ if line.include?('authentication')
31
+ isis['authentication'] ||= {}
32
+ if line.include?('authentication-type')
33
+ isis['authentication']['type'] = line.split('authentication-type').last.strip
34
+ elsif line.include?('authentication encrypted')
35
+ isis['authentication']['password'] = line.split('authentication').last.strip
36
+ end
37
+ end
38
+ end
39
+ return { port_name => isis }
40
+ end
41
+
42
+ def isis接口 isis配置
43
+ isis配置.match_paragraph("\n interface ", "\n $")
44
+ end
45
+
46
+ def isis isis配置
47
+ isis = {};aflag,iflag = false, false;af_name = nil
48
+ isis配置.split("\n").each do|line|
49
+ if line.include?('address-family ')
50
+ aflag = true
51
+ isis['address-family'] ||= {}
52
+ af_name = line.split(' ').last
53
+ isis['address-family'][af_name] ||= {}
54
+ elsif line.include?('interface ')
55
+ bflag = true
56
+ end
57
+ (aflag = false;af_name=nil) if aflag && line.strip=='$'
58
+ iflag = false if iflag && line.strip=='$'
59
+ if aflag
60
+ isis['address-family'][af_name]['distance'] = line.split('distance').last.strip if line.include?('distance')
61
+ isis['address-family'][af_name]['maximum-paths'] = line.split('maximum-paths').last.strip if line.include?('maximum-paths')
62
+ isis['address-family'][af_name]['multi-topology'] = line.split('multi-topology').last.strip if line.include?('multi-topology')
63
+ if line.include?('metric')
64
+ isis['address-family'][af_name]['metric'] = {
65
+ 'value' => line.split("metric").last.split(' ').first.strip,
66
+ 'type' => line.split(' ').find{|s|s.include?('level')}.to_s.strip
67
+ }
68
+ end
69
+ end
70
+ if !aflag && !iflag
71
+ isis['pid'] = line.split(' ').last.strip if line.include?('router isis ')
72
+ isis['area'] = line.split(' ').last.strip if line.include?('area ')
73
+ isis['system-id'] = line.split(' ').last.strip if line.include?('system-id ')
74
+ isis['is-type'] = line.split(' ').last.strip if line.include?('is-type ')
75
+ isis['distance'] = line.split(' ').last.strip if line.include?('distance ')
76
+ isis['lsp-refresh-time'] = line.split(' ').last.strip if line.include?('lsp-refresh-time')
77
+ isis['max-lsp-lifetime'] = line.split(' ').last.strip if line.include?('max-lsp-lifetime')
78
+ isis['maximum-paths'] = line.split(' ').last.strip if line.include?('maximum-paths')
79
+ if line.include?('metric')
80
+ isis['metric'] ||= {}
81
+ if line.include?('metric-style ')
82
+ isis['metric']['style'] = line.split(' ').last.strip
83
+ else
84
+ isis['metric'].merge!(
85
+ 'value' => line.split("metric").last.split(' ').first.strip,
86
+ 'type' => line.split(' ').find{|s|s.include?('level')}.to_s.strip
87
+ )
88
+ end
89
+ end
90
+ if line.include?('redistribute')
91
+ isis['redistribute'] ||= []
92
+ isis['redistribute'] << line.split(' ')[1..-1].join(' ')
93
+ end
94
+ end
95
+ end
96
+ return isis
97
+ end
98
+ end
99
+ ```