network-infra-utility 0.6.0 → 1.0.0

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 (79) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +6 -0
  3. data/CHANGELOG.md +31 -0
  4. data/GUIDE.md +201 -212
  5. data/README.md +1 -6
  6. data/Rakefile +1 -1
  7. data/bin/gen-get +144 -0
  8. data/bin/geo-api +40 -1
  9. data/bin/geo-get +18 -36
  10. data/bin/ngeo-get +253 -0
  11. data/bin/packbit +227 -0
  12. data/bin/probe +134 -0
  13. data/document/reference/DNS/346/212/200/346/234/257/346/226/207/346/241/243.md +912 -0
  14. data/network-infra-utility.gemspec +6 -4
  15. data/network.rb +19 -1
  16. data/service/geodb/GeoAPI.md +64 -0
  17. data/service/geodb/api.rb +77 -19
  18. data/service/geoquery/GeoQuery.md +309 -0
  19. data/service/geoquery/cache.rb +78 -0
  20. data/service/geoquery/geo_cache.rb +233 -0
  21. data/service/geoquery/geoquery.rb +327 -0
  22. data/service/geoquery/local.rb +151 -0
  23. data/service/geoquery/merge.rb +52 -0
  24. data/service/geoquery/normalize.rb +102 -0
  25. data/service/geoquery/online.rb +136 -0
  26. data/service/simlab/SimLab.md +140 -0
  27. data/service/simlab/bin/simctl +152 -0
  28. data/service/simlab/lib/simlab.rb +124 -0
  29. data/service/simlab/lib/simlab_engine.rb +146 -0
  30. data/service/simlab/lib/simlab_observer.rb +176 -0
  31. data/service/simlab/lib/simlab_router.rb +330 -0
  32. data/service/simlab/lib/simlab_scenario.rb +200 -0
  33. data/service/simlab/lib/simlab_switch.rb +182 -0
  34. data/service/simlab/lib/simlab_topology.rb +196 -0
  35. data/service/simlab/lib/simlab_traffic.rb +167 -0
  36. data/support/basic/packet.rb +167 -0
  37. data/support/routing/bgp.rb +279 -0
  38. data/support/routing/lpm_trie.rb +145 -0
  39. data/support/routing/ospf.rb +243 -0
  40. data/support/routing/prefix.rb +155 -0
  41. data/support/routing/rib.rb +167 -0
  42. data/support/routing/rip.rb +223 -0
  43. data/support/routing/static_route.rb +102 -0
  44. data/support/switching/frame_forward.rb +87 -0
  45. data/support/switching/mac_table.rb +127 -0
  46. data/support/switching/stp.rb +230 -0
  47. data/support/switching/vlan.rb +155 -0
  48. data/tool/packbit/README.md +136 -0
  49. data/tool/packbit/config/five-tuple.yml +25 -0
  50. data/tool/packbit/config/flow.yml +17 -0
  51. data/tool/packbit/config/packbit.yml +41 -0
  52. data/tool/packbit/erl/packbit.erl +588 -0
  53. data/tool/probe/README.md +88 -0
  54. data/tool/probe/lib/probe.rb +54 -0
  55. data/tool/probe/lib/probe_base.rb +98 -0
  56. data/tool/probe/lib/probe_dns.rb +64 -0
  57. data/tool/probe/lib/probe_icmp.rb +71 -0
  58. data/tool/probe/lib/probe_ntp.rb +51 -0
  59. data/tool/probe/lib/probe_radius.rb +58 -0
  60. data/tool/probe/lib/probe_registry.rb +44 -0
  61. data/tool/probe/lib/probe_result.rb +75 -0
  62. data/tool/probe/lib/probe_snmp.rb +114 -0
  63. data/tool/probe/lib/probe_tcp.rb +82 -0
  64. data/tool/probe/lib/probe_version.rb +7 -0
  65. data/tool/webssh/README.md +42 -0
  66. data/tool/webssh/app.py +788 -0
  67. data/tool/webssh/cli.bat +17 -0
  68. data/tool/webssh/config.yml.template +84 -0
  69. data/tool/webssh/extension//350/256/276/345/244/207/350/257/212/346/226/255.md +103 -0
  70. data/tool/webssh/requirements.txt +7 -0
  71. data/tool/webssh/ssh_cli.py +449 -0
  72. data/tool/webssh/ssh_worker.py +782 -0
  73. data/tool/webssh/static/vendor/xterm-addon-fit.min.js +8 -0
  74. data/tool/webssh/static/vendor/xterm.css +209 -0
  75. data/tool/webssh/static/vendor/xterm.min.js +8 -0
  76. data/tool/webssh/templates/index.html +2674 -0
  77. data/tool/webssh/web.bat +41 -0
  78. data/version.rb +1 -1
  79. metadata +87 -2
@@ -0,0 +1,41 @@
1
+ @echo off
2
+ cd /d "%~dp0"
3
+
4
+ REM ---- Check Python ----
5
+ python --version >nul 2>&1
6
+ if errorlevel 1 (
7
+ echo Error: Python not found. Please install Python 3.8+ from https://python.org
8
+ pause
9
+ exit /b 1
10
+ )
11
+
12
+ REM ---- Check & install dependencies ----
13
+ python -c "import flask, flask_sock, paramiko, yaml, psutil" 2>nul
14
+ if errorlevel 1 (
15
+ echo Installing dependencies...
16
+ python -m pip install -r requirements.txt
17
+ if errorlevel 1 (
18
+ echo Error: Failed to install dependencies.
19
+ pause
20
+ exit /b 1
21
+ )
22
+ echo.
23
+ )
24
+
25
+ REM ---- Read port from config.yml ----
26
+ for /f "tokens=2 delims=: " %%p in ('python -c "import yaml; c=yaml.safe_load(open('config.yml','r',encoding='utf-8')); print(c.get('web',{}).get('port',9999))" 2^>nul') do set WEBPORT=%%p
27
+ if not defined WEBPORT set WEBPORT=9999
28
+
29
+ echo ============================================
30
+ echo WebSSH - Port Auto-Detect Web Terminal
31
+ echo Starting at http://127.0.0.1:%WEBPORT%
32
+ echo Press Ctrl+C to stop
33
+ echo ============================================
34
+ echo.
35
+
36
+ REM ---- Open browser after 2 seconds ----
37
+ start "" cmd /c "timeout /t 2 >nul & start http://127.0.0.1:%WEBPORT%"
38
+
39
+ REM ---- Start server ----
40
+ python app.py
41
+ pause
data/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NetworkInfraUtility
4
- VERSION = "0.6.0"
4
+ VERSION = "1.0.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: network-infra-utility
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt
@@ -9,6 +9,20 @@ bindir: bin
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: yaml
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - "~>"
17
+ - !ruby/object:Gem::Version
18
+ version: '0.1'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - "~>"
24
+ - !ruby/object:Gem::Version
25
+ version: '0.1'
12
26
  - !ruby/object:Gem::Dependency
13
27
  name: roda
14
28
  requirement: !ruby/object:Gem::Requirement
@@ -85,11 +99,15 @@ email:
85
99
  - 18995691365@189.cn
86
100
  executables:
87
101
  - dns-query
102
+ - gen-get
88
103
  - geo-api
89
104
  - geo-doc
90
105
  - geo-get
91
106
  - geo-load
92
107
  - geo-update
108
+ - ngeo-get
109
+ - packbit
110
+ - probe
93
111
  extensions: []
94
112
  extra_rdoc_files: []
95
113
  files:
@@ -107,11 +125,15 @@ files:
107
125
  - Rakefile
108
126
  - bin/console
109
127
  - bin/dns-query
128
+ - bin/gen-get
110
129
  - bin/geo-api
111
130
  - bin/geo-doc
112
131
  - bin/geo-get
113
132
  - bin/geo-load
114
133
  - bin/geo-update
134
+ - bin/ngeo-get
135
+ - bin/packbit
136
+ - bin/probe
115
137
  - bin/setup
116
138
  - document/ASNum模块功能说明.md
117
139
  - document/DNSQuery工具使用方法.md
@@ -119,12 +141,31 @@ files:
119
141
  - document/IP模块功能说明.md
120
142
  - document/MAC模块功能说明.md
121
143
  - document/SSH连接客户端使用方法.md
144
+ - document/reference/DNS技术文档.md
122
145
  - network-infra-utility.gemspec
123
146
  - network.rb
124
147
  - service/geodb/GeoAPI.md
125
148
  - service/geodb/api.rb
126
149
  - service/geodb/config.ru
127
150
  - service/geodb/geodb.rb
151
+ - service/geoquery/GeoQuery.md
152
+ - service/geoquery/cache.rb
153
+ - service/geoquery/geo_cache.rb
154
+ - service/geoquery/geoquery.rb
155
+ - service/geoquery/local.rb
156
+ - service/geoquery/merge.rb
157
+ - service/geoquery/normalize.rb
158
+ - service/geoquery/online.rb
159
+ - service/simlab/SimLab.md
160
+ - service/simlab/bin/simctl
161
+ - service/simlab/lib/simlab.rb
162
+ - service/simlab/lib/simlab_engine.rb
163
+ - service/simlab/lib/simlab_observer.rb
164
+ - service/simlab/lib/simlab_router.rb
165
+ - service/simlab/lib/simlab_scenario.rb
166
+ - service/simlab/lib/simlab_switch.rb
167
+ - service/simlab/lib/simlab_topology.rb
168
+ - service/simlab/lib/simlab_traffic.rb
128
169
  - service/ssh/README.md
129
170
  - service/ssh/bin/ssh-client
130
171
  - service/ssh/design/SSH连接客户端功能需求文档.md
@@ -226,6 +267,48 @@ files:
226
267
  - support/basic/ipv4_address.rb
227
268
  - support/basic/ipv6_address.rb
228
269
  - support/basic/mac_address.rb
270
+ - support/basic/packet.rb
271
+ - support/routing/bgp.rb
272
+ - support/routing/lpm_trie.rb
273
+ - support/routing/ospf.rb
274
+ - support/routing/prefix.rb
275
+ - support/routing/rib.rb
276
+ - support/routing/rip.rb
277
+ - support/routing/static_route.rb
278
+ - support/switching/frame_forward.rb
279
+ - support/switching/mac_table.rb
280
+ - support/switching/stp.rb
281
+ - support/switching/vlan.rb
282
+ - tool/packbit/README.md
283
+ - tool/packbit/config/five-tuple.yml
284
+ - tool/packbit/config/flow.yml
285
+ - tool/packbit/config/packbit.yml
286
+ - tool/packbit/erl/packbit.erl
287
+ - tool/probe/README.md
288
+ - tool/probe/lib/probe.rb
289
+ - tool/probe/lib/probe_base.rb
290
+ - tool/probe/lib/probe_dns.rb
291
+ - tool/probe/lib/probe_icmp.rb
292
+ - tool/probe/lib/probe_ntp.rb
293
+ - tool/probe/lib/probe_radius.rb
294
+ - tool/probe/lib/probe_registry.rb
295
+ - tool/probe/lib/probe_result.rb
296
+ - tool/probe/lib/probe_snmp.rb
297
+ - tool/probe/lib/probe_tcp.rb
298
+ - tool/probe/lib/probe_version.rb
299
+ - tool/webssh/README.md
300
+ - tool/webssh/app.py
301
+ - tool/webssh/cli.bat
302
+ - tool/webssh/config.yml.template
303
+ - tool/webssh/extension/设备诊断.md
304
+ - tool/webssh/requirements.txt
305
+ - tool/webssh/ssh_cli.py
306
+ - tool/webssh/ssh_worker.py
307
+ - tool/webssh/static/vendor/xterm-addon-fit.min.js
308
+ - tool/webssh/static/vendor/xterm.css
309
+ - tool/webssh/static/vendor/xterm.min.js
310
+ - tool/webssh/templates/index.html
311
+ - tool/webssh/web.bat
229
312
  - version.rb
230
313
  homepage: https://github.com/ChenMeng1365/network-infra-utility
231
314
  licenses:
@@ -239,8 +322,10 @@ require_paths:
239
322
  - document
240
323
  - service
241
324
  - service/ssh/lib
325
+ - service/simlab/lib
242
326
  - support
243
327
  - tool
328
+ - tool/probe/lib
244
329
  - "."
245
330
  required_ruby_version: !ruby/object:Gem::Requirement
246
331
  requirements:
@@ -253,7 +338,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
253
338
  - !ruby/object:Gem::Version
254
339
  version: '0'
255
340
  requirements: []
256
- rubygems_version: 4.0.10
341
+ rubygems_version: 4.0.19
257
342
  specification_version: 4
258
343
  summary: 这是`gem:network-utility`的AIGC重编码版
259
344
  test_files: []