dsh-ptforge 0.1.0__py3-none-any.whl

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 (113) hide show
  1. dsh_ptforge-0.1.0.dist-info/METADATA +417 -0
  2. dsh_ptforge-0.1.0.dist-info/RECORD +113 -0
  3. dsh_ptforge-0.1.0.dist-info/WHEEL +5 -0
  4. dsh_ptforge-0.1.0.dist-info/entry_points.txt +3 -0
  5. dsh_ptforge-0.1.0.dist-info/licenses/LICENSE +28 -0
  6. dsh_ptforge-0.1.0.dist-info/licenses/NOTICE +28 -0
  7. dsh_ptforge-0.1.0.dist-info/top_level.txt +1 -0
  8. ptforge/__init__.py +3 -0
  9. ptforge/__main__.py +3 -0
  10. ptforge/assets/port_names.json +826 -0
  11. ptforge/assets/skeleton_8.1.1.xml +16629 -0
  12. ptforge/assets/templates/1841.xml +298 -0
  13. ptforge/assets/templates/1941.xml +488 -0
  14. ptforge/assets/templates/2620XM.xml +225 -0
  15. ptforge/assets/templates/2621XM.xml +264 -0
  16. ptforge/assets/templates/2811.xml +307 -0
  17. ptforge/assets/templates/2901.xml +378 -0
  18. ptforge/assets/templates/2911.xml +417 -0
  19. ptforge/assets/templates/2950-24.xml +557 -0
  20. ptforge/assets/templates/2950T-24.xml +617 -0
  21. ptforge/assets/templates/2960-24TT.xml +599 -0
  22. ptforge/assets/templates/3560-24PS.xml +1254 -0
  23. ptforge/assets/templates/5505.xml +525 -0
  24. ptforge/assets/templates/7960.xml +144 -0
  25. ptforge/assets/templates/819HG-4G-IOX.xml +2567 -0
  26. ptforge/assets/templates/819HGW.xml +806 -0
  27. ptforge/assets/templates/829.xml +3125 -0
  28. ptforge/assets/templates/AccessPoint-PT-A.xml +85 -0
  29. ptforge/assets/templates/AccessPoint-PT-N.xml +85 -0
  30. ptforge/assets/templates/AccessPoint-PT.xml +85 -0
  31. ptforge/assets/templates/Air Conditioner.xml +486 -0
  32. ptforge/assets/templates/Analog-Phone-PT.xml +75 -0
  33. ptforge/assets/templates/Appliance(0).xml +468 -0
  34. ptforge/assets/templates/Atm Pressure Monitor(0).xml +484 -0
  35. ptforge/assets/templates/Battery.xml +837 -0
  36. ptforge/assets/templates/Beacon.xml +410 -0
  37. ptforge/assets/templates/Bluetooth Speaker.xml +603 -0
  38. ptforge/assets/templates/CGR1240.xml +760 -0
  39. ptforge/assets/templates/CO Detector.xml +550 -0
  40. ptforge/assets/templates/Carbon Dioxide Detector.xml +533 -0
  41. ptforge/assets/templates/Cell-Tower.xml +191 -0
  42. ptforge/assets/templates/Central-Office-Server.xml +371 -0
  43. ptforge/assets/templates/Cloud-PT.xml +250 -0
  44. ptforge/assets/templates/DLC100.xml +473 -0
  45. ptforge/assets/templates/DSL-Modem-PT.xml +102 -0
  46. ptforge/assets/templates/Door.xml +701 -0
  47. ptforge/assets/templates/Fire Sprinkler.xml +507 -0
  48. ptforge/assets/templates/Furnace.xml +536 -0
  49. ptforge/assets/templates/Garage Door.xml +553 -0
  50. ptforge/assets/templates/Home Speaker.xml +609 -0
  51. ptforge/assets/templates/Home-VoIP-PT.xml +382 -0
  52. ptforge/assets/templates/HomeRouter-PT-AC.xml +603 -0
  53. ptforge/assets/templates/Hub-PT.xml +226 -0
  54. ptforge/assets/templates/Humidifier.xml +529 -0
  55. ptforge/assets/templates/Humidity Monitor.xml +446 -0
  56. ptforge/assets/templates/IE-2000.xml +334 -0
  57. ptforge/assets/templates/ISR4321.xml +601 -0
  58. ptforge/assets/templates/ISR4331.xml +664 -0
  59. ptforge/assets/templates/LAP-PT.xml +151 -0
  60. ptforge/assets/templates/LED.xml +405 -0
  61. ptforge/assets/templates/Laptop-PT.xml +451 -0
  62. ptforge/assets/templates/Light.xml +552 -0
  63. ptforge/assets/templates/Linksys-WRT300N.xml +289 -0
  64. ptforge/assets/templates/MCU-PT.xml +357 -0
  65. ptforge/assets/templates/Meraki-MX65W.xml +533 -0
  66. ptforge/assets/templates/Meraki-Server.xml +2371 -0
  67. ptforge/assets/templates/NetworkController.xml +1433 -0
  68. ptforge/assets/templates/Old Car.xml +452 -0
  69. ptforge/assets/templates/PC-PT.xml +622 -0
  70. ptforge/assets/templates/Portable Music Player.xml +591 -0
  71. ptforge/assets/templates/Potentiometer.xml +394 -0
  72. ptforge/assets/templates/Power Distribution Device.xml +49 -0
  73. ptforge/assets/templates/Power Meter.xml +517 -0
  74. ptforge/assets/templates/Push Button.xml +373 -0
  75. ptforge/assets/templates/RGB LED.xml +385 -0
  76. ptforge/assets/templates/Rocker Switch.xml +366 -0
  77. ptforge/assets/templates/Router-PT.xml +545 -0
  78. ptforge/assets/templates/SBC-PT.xml +388 -0
  79. ptforge/assets/templates/SMARTPHONE-PT.xml +551 -0
  80. ptforge/assets/templates/Server-PT.xml +1959 -0
  81. ptforge/assets/templates/Smart LED.xml +467 -0
  82. ptforge/assets/templates/Sniffer.xml +97 -0
  83. ptforge/assets/templates/Solar Panel.xml +567 -0
  84. ptforge/assets/templates/Switch-PT.xml +358 -0
  85. ptforge/assets/templates/TabletPC-PT.xml +537 -0
  86. ptforge/assets/templates/Thermostat.xml +789 -0
  87. ptforge/assets/templates/Thing.xml +461 -0
  88. ptforge/assets/templates/WLC-2504.xml +369 -0
  89. ptforge/assets/templates/WLC-3504.xml +447 -0
  90. ptforge/assets/templates/WLC-PT.xml +207 -0
  91. ptforge/assets/templates/Window.xml +569 -0
  92. ptforge/build.py +436 -0
  93. ptforge/catalog.py +192 -0
  94. ptforge/cli.py +520 -0
  95. ptforge/doctor.py +83 -0
  96. ptforge/edit.py +183 -0
  97. ptforge/gui.py +417 -0
  98. ptforge/guitool.py +213 -0
  99. ptforge/launch.py +108 -0
  100. ptforge/notes.py +137 -0
  101. ptforge/patch.py +164 -0
  102. ptforge/ptcrypto/__init__.py +6 -0
  103. ptforge/ptcrypto/cmac.py +58 -0
  104. ptforge/ptcrypto/ctr.py +33 -0
  105. ptforge/ptcrypto/eax.py +53 -0
  106. ptforge/ptcrypto/pt_crypto.py +46 -0
  107. ptforge/ptcrypto/ptfile.py +168 -0
  108. ptforge/ptcrypto/twofish.py +393 -0
  109. ptforge/report.py +136 -0
  110. ptforge/runtime.py +320 -0
  111. ptforge/spec.py +234 -0
  112. ptforge/state.py +276 -0
  113. ptforge/web.py +106 -0
@@ -0,0 +1,417 @@
1
+ Metadata-Version: 2.4
2
+ Name: dsh-ptforge
3
+ Version: 0.1.0
4
+ Summary: Declarative Cisco Packet Tracer automation: offline .pkt codec, topology builder, state assertions, and a minimal Win32 runtime.
5
+ Author: chiyan11
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/chiyan11/dsh-ptforge
8
+ Project-URL: Issues, https://github.com/chiyan11/dsh-ptforge/issues
9
+ Project-URL: Documentation, https://github.com/chiyan11/dsh-ptforge/blob/main/docs/TOOLS.md
10
+ Keywords: packet-tracer,cisco,network-simulation,automation,deepseek-harness
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Education
14
+ Classifier: Intended Audience :: Telecommunications Industry
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Operating System :: Microsoft :: Windows
17
+ Classifier: Operating System :: POSIX :: Linux
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Topic :: Education
23
+ Classifier: Topic :: System :: Networking
24
+ Requires-Python: >=3.10
25
+ Description-Content-Type: text/markdown
26
+ License-File: LICENSE
27
+ License-File: NOTICE
28
+ Provides-Extra: gui
29
+ Requires-Dist: Pillow>=10.0; extra == "gui"
30
+ Provides-Extra: dev
31
+ Requires-Dist: pytest>=8.0; extra == "dev"
32
+ Dynamic: license-file
33
+
34
+ # ptforge
35
+
36
+ **Cisco Packet Tracer 自动化引擎 · DeepSeek Harness 插件**
37
+
38
+ [![ci](https://github.com/chiyan11/dsh-ptforge/actions/workflows/ci.yml/badge.svg)](https://github.com/chiyan11/dsh-ptforge/actions/workflows/ci.yml)
39
+ [![python](https://img.shields.io/badge/python-3.10%2B-blue)](pyproject.toml)
40
+ [![license](https://img.shields.io/badge/license-MIT-green)](LICENSE)
41
+
42
+ > Packet Tracer 没有公开的自动化 API,也没有可编程接口进它的 CLI 引擎。ptforge 用两条互补的路径把这件事做通:
43
+ > **容器级离线编辑**(直接读写 `.pkt`,覆盖拓扑、连线、配置、网页、标注)+ **最小 GUI 运行时**(在真窗口里执行命令、拿到回显、做断言)。
44
+
45
+ `ptforge` 提供 18 个 `pt_*` 工具,覆盖「造拓扑 → 配设备 → 离线验收 → 真机验收 → 出报告」的完整闭环;
46
+ 它同时是一个可 `pip install` 的纯 Python 包和一个可在 Linux 容器里跑的离线工具链。
47
+
48
+ ---
49
+
50
+ ## 目录
51
+
52
+ - [为什么需要它](#为什么需要它)
53
+ - [能力矩阵](#能力矩阵)
54
+ - [架构](#架构)
55
+ - [安装](#安装)
56
+ - [打包与容器化](#打包与容器化)
57
+ - [快速开始](#快速开始)
58
+ - [工具参考](#工具参考)
59
+ - [命令行](#命令行)
60
+ - [验收与测试](#验收与测试)
61
+ - [已知边界](#已知边界)
62
+ - [目录结构](#目录结构)
63
+ - [第三方代码](#第三方代码)
64
+
65
+ ---
66
+
67
+ ## 为什么需要它
68
+
69
+ Packet Tracer 8.x 的 `PacketTracer.exe` 里没有 `PTAPI`、没有 socket 服务,`plugins/` 只接受 Cisco 签名的二进制插件,`extensions/*.pts` 是加密脚本。官方没有给外部程序留任何编程入口。
70
+
71
+ 因此自动化只有两种可能:
72
+
73
+ | 路径 | 可行性 | ptforge 的取舍 |
74
+ | --- | --- | --- |
75
+ | GUI 自动化(点击画布、敲终端) | 可行但脆弱:需要窗口焦点、坐标随缩放/滚动变化、终端只能逐键输入 | 只保留**必要**的运行时能力(执行命令、回显、断言、业务动作),其余全部走离线 |
76
+ | 直接读写 `.pkt` | 可行:容器是 Twofish-EAX + zlib 压缩的 `<PACKETTRACER5>` XML | 作为主力:拓扑、连线、配置、网页、标注都在这里完成 |
77
+
78
+ 等价地说:**能离线证明的,绝不开窗口;只有运行时才有的状态(路由表、NAT 翻译、连通性、页面内容),才走 GUI。**
79
+
80
+ ---
81
+
82
+ ## 能力矩阵
83
+
84
+ | 能力 | 方式 | 工具 |
85
+ | --- | --- | --- |
86
+ | 查询型号与接口名 | 离线 | `pt_models` |
87
+ | 从 JSON spec 生成拓扑 | 离线 | `pt_build` |
88
+ | 增量修改(IP / 配置 / 改名 / VLAN / 删配置) | 离线 | `pt_patch` |
89
+ | 给单台设备写 IOS 配置 | 离线 | `pt_apply` |
90
+ | 拓扑清单与端口解析 | 离线 | `pt_inspect` |
91
+ | 结构化状态读取(接口、静态路由、NAT、ACL、VLAN) | 离线 | `pt_state` |
92
+ | 对 `.pkt` 做断言 | 离线 | `pt_check` |
93
+ | 画布标注 | 离线 | `pt_note` |
94
+ | 读写 Server-PT 网页 | 离线 | `pt_server_page` |
95
+ | 环境与版本体检 | 离线 | `pt_doctor` |
96
+ | 报告素材(图 + 图注 + 表格) | 离线 | `pt_report` |
97
+ | 打开文件并置前 | 运行时 | `pt_open` |
98
+ | 窗口焦点 / 点击 / 输入 / 截图(逃生舱) | 运行时 | `pt_gui` |
99
+ | 执行命令并回读 transcript | 运行时 | `pt_exec` |
100
+ | 带断言执行命令 | 运行时 | `pt_assert` |
101
+ | ping 与统计解析 | 运行时 | `pt_ping` |
102
+ | 浏览器取页面正文 | 运行时 | `pt_http_get` |
103
+ | FTP 会话 | 运行时 | `pt_ftp` |
104
+
105
+ ---
106
+
107
+ ## 架构
108
+
109
+ ```
110
+ spec.json
111
+ │
112
+ ┌──────▼──────┐
113
+ │ spec.py │ 解析 / 自动布局 / 自动选线 / 自动配端口
114
+ └──────┬──────┘
115
+ │
116
+ ┌──────▼──────┐ ptforge/assets/
117
+ │ build.py │◄─────── skeleton_8.1.1.xml
118
+ │ catalog.py │ templates/*.xml (80 型号)
119
+ └──────┬──────┘ port_names.json
120
+ │ ElementTree
121
+ ┌──────▼──────┐
122
+ │ ptfile.py │ Twofish-EAX(zlib(level 6)) ⇄ <PACKETTRACER5>
123
+ └──────┬──────┘
124
+ │ .pkt
125
+ ┌────────────┴─────────────┐
126
+ │ │
127
+ edit/state/patch/notes/ gui.py → 真 PT 窗口
128
+ web/report/doctor runtime.py(exec/assert/ping/http/ftp)
129
+ ```
130
+
131
+ - **容器层**:`ptcrypto/`(twofish、CMAC、CTR、EAX 的 vendored 实现)+ `ptfile.py` 负责加解密与压缩;`build.py` 用 8.1.1 骨架和 80 个设备模板拼装文档,并维护物理工作区节点、SAVE_REF_ID、端口顺序、`FROM/PORT/TO/PORT` 等 PT 强制约束。
132
+ - **语义层**:`state.py`、`patch.py`、`edit.py`、`notes.py`、`web.py`、`report.py` 只依赖 ElementTree,可以做增量修改与断言。
133
+ - **运行时层**:`gui.py` 只用 ctypes 调 Win32,`runtime.py` 在其上实现「粘贴命令 → 回车 → 拖选 → 右键 Copy」的控制台读回。PT 终端不接受合成逐键输入,但接受**右键 Paste**;回读只能取可见区域,因此长会话会保留过程中最长的一次快照。
134
+
135
+ ---
136
+
137
+ ## 安装
138
+
139
+ ### 依赖
140
+
141
+ | 部分 | 要求 |
142
+ | --- | --- |
143
+ | 核心引擎(构建 / 修改 / 断言 / 报告) | Python 3.10+,**无第三方依赖** |
144
+ | 运行时工具(`pt_exec` / `pt_ping` / `pt_http_get` / `pt_ftp` / `pt_gui`) | Windows 10/11 + Pillow,且桌面可交互 |
145
+ | Packet Tracer 本体 | **8.1.x**(`pt_doctor` 会校验文件版本;运行时工具需要 `PacketTracer.exe`) |
146
+ | DSH 插件形态 | DeepSeek Harness(bundle 宿主) |
147
+
148
+ ### 方式一:pip 安装
149
+
150
+ PyPI 上的分发名是 **`dsh-ptforge`**(`ptforge` 已被另一个无关项目占用),import 包名仍是 `ptforge`,命令仍是 `ptforge` / `ptforge-gui`:
151
+
152
+ ```powershell
153
+ pip install dsh-ptforge # 纯离线引擎,无依赖
154
+ pip install "dsh-ptforge[gui]" # 含 Pillow,可用 Windows 运行时工具
155
+ pip install "dsh-ptforge[gui,dev]" # 另含 pytest
156
+ ```
157
+
158
+ 安装后可直接使用两个入口:
159
+
160
+ ```powershell
161
+ ptforge doctor
162
+ ptforge build lab.json -o lab.pkt
163
+ ptforge-gui exec R1 "show ip route"
164
+ ```
165
+
166
+ ### 方式二:以 DSH bundle 安装
167
+
168
+ ```powershell
169
+ # 在 DSH 会话中
170
+ plugin_manager install_bundle target="D:\coding\daily\dsh-ptforge\packages\dsh-ptforge"
171
+ ```
172
+
173
+ 安装后 18 个 `pt_*` 工具会出现在工具列表里。插件把引擎副本打进包内,运行时不依赖仓库目录。
174
+
175
+ ### 方式三:容器(仅离线引擎)
176
+
177
+ ```bash
178
+ docker build -t ptforge:0.1.0 .
179
+ docker run --rm -v "$PWD:/work" ptforge:0.1.0 build lab.json -o lab.pkt
180
+ ```
181
+
182
+ 容器只包含离线引擎:Packet Tracer 是 Windows GUI 程序,`pt_exec` 这类运行时工具无法在 Linux 容器内工作(调用会给出明确错误)。
183
+
184
+ ### 从源码调试
185
+
186
+ ```powershell
187
+ cd D:\coding\daily\dsh-ptforge
188
+ $env:PYTHONPATH = (Get-Location).Path
189
+ python -m ptforge doctor
190
+ python -m ptforge models --query 2960
191
+ python -m unittest discover -s tests
192
+ ```
193
+
194
+ ---
195
+
196
+ ## 打包与容器化
197
+
198
+ ### Python 包
199
+
200
+ `pyproject.toml` 使用 setuptools 后端,包数据随 wheel 一起发布(8.1.1 骨架、80 个设备模板、端口命名表,约 2.7 MB):
201
+
202
+ ```
203
+ ptforge/assets/skeleton_8.1.1.xml
204
+ ptforge/assets/templates/*.xml
205
+ ptforge/assets/port_names.json
206
+ ```
207
+
208
+ 构建与检查:
209
+
210
+ ```powershell
211
+ python -m pip install build
212
+ python -m build # dist/*.whl + *.tar.gz
213
+ python -m twine check dist/* # 元数据校验
214
+ ```
215
+
216
+ 两个 console script 由 `[project.scripts]` 提供:`ptforge`(引擎 CLI)与 `ptforge-gui`(Win32 运行时 CLI)。版本号在 `pyproject.toml` 与 `ptforge/__init__.py` 两处维护。
217
+
218
+ ### Docker 镜像
219
+
220
+ ```bash
221
+ docker build -t ptforge:0.1.0 .
222
+ docker run --rm -v "$PWD:/work" ptforge:0.1.0 --help
223
+ docker run --rm -v "$PWD:/work" ptforge:0.1.0 build lab.json -o lab.pkt
224
+ docker run --rm -v "$PWD:/work" ptforge:0.1.0 inspect lab.pkt
225
+ ```
226
+
227
+ 设计要点:
228
+
229
+ - 基于 `python:3.12-slim`,以非 root 用户(uid 10001)运行,工作目录固定为 `/work`。
230
+ - 只 `COPY pyproject.toml README.md LICENSE ptforge/`,`.dockerignore` 排除测试、fixtures、bundle 与截图,镜像层保持最小。
231
+ - 入口为 `ptforge`,默认 `--help`;卷挂载当前目录即可读写 `.pkt`。
232
+ - 镜像内**不包含**运行时能力:`pt_exec`、`pt_ping`、`pt_http_get`、`pt_ftp`、`pt_gui` 依赖真实 Windows 窗口,容器内调用会直接报错而不是假装成功。
233
+
234
+ `docker-compose.yml` 提供了等价的一行式调用:
235
+
236
+ ```bash
237
+ docker compose run --rm ptforge build lab.json -o lab.pkt
238
+ ```
239
+
240
+ ### CI
241
+
242
+ `.github/workflows/ci.yml` 在每次 push / PR 时执行三个 job:
243
+
244
+ | job | 内容 |
245
+ | --- | --- |
246
+ | `test` | Python 3.10 / 3.11 / 3.12 矩阵,跑 20 个单测 + `build → inspect → doctor → report` 冒烟 |
247
+ | `package` | 构建 wheel/sdist,并断言 wheel 内含骨架与 ≥80 个模板,产物作为 artifact 上传 |
248
+ | `docker` | 构建镜像并执行 `--help` |
249
+
250
+ ### 发布到 PyPI(Trusted Publishing)
251
+
252
+ 仓库自带 [`.github/workflows/publish.yml`](.github/workflows/publish.yml),用 OIDC 发布,**不需要在仓库里存 PyPI token**。首次发布前在 PyPI 的 *Publishing → Add a new pending publisher* 填:
253
+
254
+ | 字段 | 值 |
255
+ | --- | --- |
256
+ | PyPI Project Name | `dsh-ptforge` |
257
+ | Owner | `chiyan11` |
258
+ | Repository name | `dsh-ptforge` |
259
+ | Workflow name | `publish.yml` |
260
+ | Environment name | `pypi` |
261
+
262
+ 然后在 GitHub 仓库 *Settings → Environments* 建一个名为 `pypi` 的环境(可选,但推荐,可加人工审批)。发布时二选一:
263
+
264
+ - 在 GitHub 创建 Release(tag 形如 `v0.1.0`)→ 自动构建并上传;
265
+ - 或手动跑 `publish` workflow。
266
+
267
+ 构建 job 会再次断言 wheel 内含 8.1.1 骨架与 ≥80 个模板,避免发布一个缺资产的包。
268
+
269
+ ---
270
+
271
+ ## 快速开始
272
+
273
+ ### 1. 用 spec 生成拓扑
274
+
275
+ ```json
276
+ {
277
+ "name": "office_lan",
278
+ "devices": [
279
+ {"model": "2911", "name": "R1",
280
+ "config": ["hostname R1", "ip route 0.0.0.0 0.0.0.0 192.168.10.254"]},
281
+ {"model": "2960-24TT", "name": "SW1",
282
+ "config": ["hostname SW1", "vlan 10", "name USERS",
283
+ "interface FastEthernet0/1", "switchport mode access",
284
+ "switchport access vlan 10"]},
285
+ {"model": "PC-PT", "name": "PC0", "ipv4": "192.168.10.10/24,192.168.10.1"},
286
+ {"model": "PC-PT", "name": "PC1", "ipv4": "192.168.10.11/24,192.168.10.1"}
287
+ ],
288
+ "links": [
289
+ {"from": "R1", "to": "SW1"},
290
+ {"from": "PC0", "to": "SW1"},
291
+ {"from": "PC1", "to": "SW1"}
292
+ ]
293
+ }
294
+ ```
295
+
296
+ ```powershell
297
+ python -m ptforge build fixtures\specs\office_lan.json -o office_lan.pkt
298
+ python -m ptforge inspect office_lan.pkt
299
+ ```
300
+
301
+ - 不写端口 → 自动找空闲口;不写 `cable` → 同类设备交叉线、异类直通线;不写坐标 → 自动布局。
302
+ - `ipv4` 支持 `"ip/prefix,gw"`、`"ip mask gw"`、`[ip, mask, gw]`、`{address, mask, gateway}`。
303
+
304
+ ### 2. 离线验收
305
+
306
+ ```powershell
307
+ python -m ptforge check office_lan.pkt --expect '[{"device":"R1","interface":"Gi0/0","ip":"192.168.10.1"}]'
308
+ python -m ptforge state office_lan.pkt
309
+ ```
310
+
311
+ ### 3. 真机验收(可选)
312
+
313
+ 先 `python -m ptforge open office_lan.pkt`,双击设备打开控制台,然后:
314
+
315
+ ```powershell
316
+ python -m ptforge.guitool exec R1 "show ip route" --out route.png
317
+ python -m ptforge.guitool assert PC0 --checks '[{"command":"ipconfig","contains":"192.168.10.10"}]'
318
+ ```
319
+
320
+ ### 4. 出报告素材
321
+
322
+ ```powershell
323
+ python -m ptforge report office_lan.pkt -o report --title "实验室验收报告" `
324
+ --figure '{"path":"figures/topology.png","caption":"逻辑拓扑"}'
325
+ ```
326
+
327
+ 产出 `report/figures/`、`report/captions.json`、`report/report.md`。
328
+
329
+ ---
330
+
331
+ ## 工具参考
332
+
333
+ 完整的参数、例子与流水线见 **[docs/TOOLS.md](docs/TOOLS.md)**。离线与运行时的分工:
334
+
335
+ | 类别 | 工具 |
336
+ | --- | --- |
337
+ | 构建 | `pt_models` `pt_build` `pt_open` |
338
+ | 修改 | `pt_patch` `pt_apply` `pt_note` `pt_server_page` |
339
+ | 读取 / 校验 | `pt_inspect` `pt_state` `pt_check` `pt_doctor` `pt_report` |
340
+ | 运行时 | `pt_gui` `pt_exec` `pt_assert` `pt_ping` `pt_http_get` `pt_ftp` |
341
+
342
+ ---
343
+
344
+ ## 命令行
345
+
346
+ `python -m ptforge` 子命令:`models` `build` `inspect` `apply` `patch` `state` `check` `note` `web` `doctor` `report` `demo` `open`,全部支持 `--json`。
347
+
348
+ `python -m ptforge.guitool` 子命令:`focus` `click` `type` `key` `shot` `paste` `copy` `clipboard` `exec` `assert` `ping` `http` `ftp`。
349
+
350
+ ---
351
+
352
+ ## 验收与测试
353
+
354
+ ```powershell
355
+ python -m unittest discover -s tests # 20 tests, OK
356
+ ```
357
+
358
+ | 场景 | 结果 |
359
+ | --- | --- |
360
+ | 容器往返(真实 8.3.pkt,252 708 B) | 解密 → 重新加密 → PT 正常打开,22 台设备完整渲染 |
361
+ | 8.1.1 空骨架 | `fixtures/empty81.pkt` 34 234 B → 668 605 B XML,作为生成器基线 |
362
+ | 生成拓扑 + PT 重存 + 重开 | 通过(物理工作区节点、GUID 链、`FROM/PORT/TO/PORT` 顺序均已修正) |
363
+ | 端口命名 | 2911 `Gi0/0..0/2`、2960-24TT `FE0/1..0/24 + Gi0/1..0/2`、ISR4331 `Gi0/0/0..0/0/2`、PC-PT `FastEthernet0` |
364
+ | 命令行执行 | PC0 `ipconfig` 取回 305 字符;`ping 192.1.1.254` 回 4/4、0% 丢包 |
365
+ | 断言 | `show ip route` 命中 `O 192.1.3.0/24`、`[110/4] via 192.1.2.253`;故意断言不存在网段得到明确 FAIL |
366
+ | NAT 实验(`nat_lab.pkt`) | 6/6 离线断言 PASS;RIP 路由 `R 172.18.20.0 [120/2]`;静态 NAT `tcp 200.1.13.1:80 → 172.16.10.4:80`;PC4 访问 `http://200.1.13.1` 返回 Web1_Server 页面 |
367
+
368
+ ---
369
+
370
+ ## 已知边界
371
+
372
+ 1. **没有官方 API**:运行时能力建立在窗口自动化上,要求 PT 窗口可见、可交互,且桌面前台可被抢占。
373
+ 2. **终端只回读可见区域**:超长输出会滚出屏幕,`ftp`/长配置会保留会话中最长的一次快照;逐条命令建议加 `wait_ms`。
374
+ 3. **同名设备歧义**:多个 PT 实例里存在同名设备时,需要先关闭重复实例或改名。
375
+ 4. **文件版本**:只保证 `8.1.x`;其他版本的容器参数可能不同(`pt_doctor` 会先检查)。
376
+ 5. **图形界面差异**:不同 PT 版本/缩放比例下,设备窗口内的相对坐标(标签页、URL 栏、Go 按钮)可能需要微调。
377
+
378
+ ---
379
+
380
+ ## 目录结构
381
+
382
+ ```
383
+ dsh-ptforge/
384
+ ├── pyproject.toml # 打包元数据、入口点、包数据
385
+ ├── Dockerfile # 离线引擎镜像(非 root、/work 卷)
386
+ ├── docker-compose.yml # 一行式容器调用
387
+ ├── .github/workflows/ # ci.yml(测试/打包/镜像)+ publish.yml(PyPI)
388
+ ├── ptforge/ # 引擎(可独立作为 Python 包使用)
389
+ │ ├── ptcrypto/ # Twofish / CMAC / CTR / EAX / 容器格式
390
+ │ ├── assets/ # 8.1.1 骨架、80 个设备模板、端口命名表
391
+ │ ├── build.py # spec → ElementTree → .pkt
392
+ │ ├── state.py # 结构化状态与断言
393
+ │ ├── patch.py # 增量修改
394
+ │ ├── notes.py # 画布标注
395
+ │ ├── web.py # Server-PT 网页读写
396
+ │ ├── report.py # 报告素材
397
+ │ ├── gui.py / runtime.py # Win32 运行时
398
+ │ └── cli.py / guitool.py # 命令行入口
399
+ ├── packages/dsh-ptforge/ # DSH bundle(含引擎副本)
400
+ ├── docs/TOOLS.md # 18 个工具速查表
401
+ ├── tests/ # 20 个单测
402
+ ├── fixtures/ # 样例与 spec
403
+ ├── LICENSE / NOTICE # MIT(本项目)与第三方代码范围说明
404
+ └── scripts/sync_engine.ps1 # 把引擎同步进 bundle
405
+ ```
406
+
407
+ ---
408
+
409
+ ## 第三方代码
410
+
411
+ `ptforge/ptcrypto/twofish.py` 来自 [strykey/pka-decipher](https://github.com/strykey/pka-decipher),其内部保留了原始 Twofish 实现的版权声明(Gladman / Paulo S. L. M. Barreto)。`ptcrypto/` 下的 CMAC/CTR/EAX 与容器格式实现同样源自该仓库。
412
+
413
+ 上游仓库未提供 LICENSE 文件;`LICENSE` 里的 MIT 只覆盖本项目自己写的代码,vendored 的密码学实现不在授权范围内(详见 [`NOTICE`](NOTICE))。如果你要商业分发或换许可证,请先用有明确授权的替代实现替换 `ptcrypto/`,或联系上游作者取得许可。
414
+
415
+ 本项目与 Cisco 无关,Packet Tracer 是其商标;这里使用的 `.pkt` 容器格式与 IOS 命令语法均为未公开接口,仅用于教学/研究场景的互操作。
416
+
417
+
@@ -0,0 +1,113 @@
1
+ dsh_ptforge-0.1.0.dist-info/licenses/LICENSE,sha256=7n-KDnD9Ve2XT0X6_2PXT09IAAyDlZCOnQSIAm8eCfo,1365
2
+ dsh_ptforge-0.1.0.dist-info/licenses/NOTICE,sha256=ZQgnchpsfn_vlgAI-SULo2hmvCJ9Tt-E3x16LTOBPR8,1314
3
+ ptforge/__init__.py,sha256=GEkm_f4SEBFzVYMdzOHgMdnuDlrA6op3W-EIVRdRMjY,106
4
+ ptforge/__main__.py,sha256=k1ocEWawweo1qCJWNFAAvyxz3tcY13dzvCenHszij30,48
5
+ ptforge/build.py,sha256=8Yd3B8ffeqvTDs_ZVqlfv9HBc-r_h7umj690yX9RQEE,16075
6
+ ptforge/catalog.py,sha256=eohXbGfKCK3LmOWhprPfa_zEbZ2UZuMhhRyiZDeIy3c,5983
7
+ ptforge/cli.py,sha256=qbUemlKb4SYSfWdZECcNGnHxDboQbs62bwJlBtRI8Ww,18840
8
+ ptforge/doctor.py,sha256=c6LY48r47MVMNTDwlqCoKfYj0KD3rFdjy814PLnPhJw,2763
9
+ ptforge/edit.py,sha256=5phpj70sVt4zV1PuLcq4eid_hTvx_C0o259St9U7JGk,6124
10
+ ptforge/gui.py,sha256=JBkH0la__byHGO6E455hA8TCpoOINw4W53GHym7_woQ,12917
11
+ ptforge/guitool.py,sha256=JkpV3PZK3CHE0I31lBp4RjNj-yvzk0YL5hJHgODQFxE,6940
12
+ ptforge/launch.py,sha256=e-kZ7hsSs1M7hSIUqbYvNEFIzPVq2ZQ7FkbxH2NVNBQ,3630
13
+ ptforge/notes.py,sha256=qvSArAWfiulpbkv__Z3MDpENqdpN3-AqzqvMnQyRfwI,4481
14
+ ptforge/patch.py,sha256=x7DKNeZPaLHp9zNSzqMoswvjEOl8U3d9jgkP0Rq4UEc,6345
15
+ ptforge/report.py,sha256=Xlcm2FOw0iSVu1YKtIc5vs7xu9bkKYGljhHMFT8Babc,4747
16
+ ptforge/runtime.py,sha256=7W1zhB_alUE5hLdfUU8eCp0WA0LM09qqwWGho1jX5ok,10625
17
+ ptforge/spec.py,sha256=dw-N-_0xNDAErCv_1gLKYw9QGQjWqxQ2abil-Q-7Vh4,8632
18
+ ptforge/state.py,sha256=CYK3_YHSO2pujLsjGPSdX60zNnoOAZ7FL8kD4-Dgo3E,9623
19
+ ptforge/web.py,sha256=wsLa-HX_HTzyLNlgGIrsma290IE3aO19O0p1dflWkic,3296
20
+ ptforge/assets/port_names.json,sha256=yCIgSojM3Yfe1KGpSsqu3Y2Ubl-xJD7z3JvtqMIhqmA,8547
21
+ ptforge/assets/skeleton_8.1.1.xml,sha256=b109lb5VEzejM9Blg_Keygfskbg_vz83uyK4knLwnFg,668605
22
+ ptforge/assets/templates/1841.xml,sha256=j1j6QPnJrKBDLbDPuc8--ROK23Kn4O7KjlQY49CdieQ,9594
23
+ ptforge/assets/templates/1941.xml,sha256=gr0p2M2e_QT-w1rSczcBhVfq30O_dL2QoI4P0uMWjHw,17693
24
+ ptforge/assets/templates/2620XM.xml,sha256=Rev1KEmQoNl9ysteZ5-QRlc0mxwGQaNNwJDrNoXqViE,7018
25
+ ptforge/assets/templates/2621XM.xml,sha256=SbA0jzQzTWcJ7quUNxBbG5wKQaqLn3uwhG2RY8sYuX8,8539
26
+ ptforge/assets/templates/2811.xml,sha256=jFiQSIRWFTKkBZXqLDVE9I1r9PhgCK58RJ3hjx2hrhY,9834
27
+ ptforge/assets/templates/2901.xml,sha256=wbST1w2KyE24pud7AAa4GtFDN8lURWX464avoTPJ8vo,12766
28
+ ptforge/assets/templates/2911.xml,sha256=Hnkcm9YzCKWyc86jnINN_n15mYptMjz_d0j5l_0Z5wQ,14284
29
+ ptforge/assets/templates/2950-24.xml,sha256=-wokzUYYzjLvRhuSDcD4KFVcKx76EVawTcWn1WDHW-4,19526
30
+ ptforge/assets/templates/2950T-24.xml,sha256=c4dMm8-l16n2ck45021MiCdJWCP7oCuw9NPwx8QmDEM,22164
31
+ ptforge/assets/templates/2960-24TT.xml,sha256=p8rNX1fcZySo16mYSWbyw3zWkkZiEVMRIoZa-Ahp49A,21187
32
+ ptforge/assets/templates/3560-24PS.xml,sha256=8r9P_AysShmQ_tUhnbidKlU4lG-rENAxb3CaiNBRIrs,46556
33
+ ptforge/assets/templates/5505.xml,sha256=dk-MDs0prSiO_cjw-krqEQJ5sePYgOmMff4SYJH5vMI,18975
34
+ ptforge/assets/templates/7960.xml,sha256=8TrtKLUmITmET3VAzzrgFDCPkhNTDP8bYkl8KXrzhn8,5034
35
+ ptforge/assets/templates/819HG-4G-IOX.xml,sha256=e7YU4KcbaZh72zvGMuvtSjHOyyCdz1t_zCgHSC9ukkk,153656
36
+ ptforge/assets/templates/819HGW.xml,sha256=hbkPjGGhbp6gCUgntsRhTU8qq_Ls6y5HbAwKQRQQhTE,28764
37
+ ptforge/assets/templates/829.xml,sha256=7ziM4kPZjw98zLYRmuHwJpN82P_kx-Vvg75ykPTGHZk,153289
38
+ ptforge/assets/templates/AccessPoint-PT-A.xml,sha256=-2goF0amse1YrFssLJkgta_JXW5ZL22_G-NZQAuPnf4,2647
39
+ ptforge/assets/templates/AccessPoint-PT-N.xml,sha256=uCSAq2u0oWJMbEpMuhyBz64p3QPJ68ym-7ZU5WsP6Uo,2647
40
+ ptforge/assets/templates/AccessPoint-PT.xml,sha256=k-cQ2zlO65XhiAvFFsyi-EiImxyBY6cHI_sHUNpRd8c,2652
41
+ ptforge/assets/templates/Air Conditioner.xml,sha256=2acOKSINMpDvEV1Ha3LaVCmunTtB2P_OZTW5rsg4iSg,17810
42
+ ptforge/assets/templates/Analog-Phone-PT.xml,sha256=LXkWGaM4i4xb9Bf_rCK1qVXE097jcRndhxdzhnk7Bu4,2594
43
+ ptforge/assets/templates/Appliance(0).xml,sha256=XRISjxc7Pn_Otn4JHpmqGEd_4X1h6EDwPgwsy2eNm7g,13314
44
+ ptforge/assets/templates/Atm Pressure Monitor(0).xml,sha256=UHqytAwwhrODvV34K9rd3nC11Isq8ybs-9cGnDFAhCg,17952
45
+ ptforge/assets/templates/Battery.xml,sha256=IPA5n4A8chZ5Ja1-VtLNysARaU_-qC5kTHPeNJ1kvgo,35921
46
+ ptforge/assets/templates/Beacon.xml,sha256=Ybm2U1QeiBpsDPixQUGmw7a0hNAFP7H1IhAEiALJmu0,13846
47
+ ptforge/assets/templates/Bluetooth Speaker.xml,sha256=BBdXHHfvIgcdN5xD5t1w4U77PFqn2rY5fxgIPDEjjtQ,20617
48
+ ptforge/assets/templates/CGR1240.xml,sha256=H7S1oqCMZqF2vCLS43KjDOQQ2xlCxjwpw-SJ-ikKqFU,26155
49
+ ptforge/assets/templates/CO Detector.xml,sha256=MQ2jgX50FwGT63viHXW-pmNQzGvhbORATPQTVctKpvs,20559
50
+ ptforge/assets/templates/Carbon Dioxide Detector.xml,sha256=4_92uvA4lUVK49oRLyN6y7qKAVJY_Nh-JEIuZi4Flng,19073
51
+ ptforge/assets/templates/Cell-Tower.xml,sha256=4qSJCkvNPdbUYwkgys0VfPjdTY5MHKMPYnp3BW3DZQQ,6301
52
+ ptforge/assets/templates/Central-Office-Server.xml,sha256=zBgXs1wle4RGkgPPXv4GQ5mhiZPloIMLcK9rtyAFYv0,13128
53
+ ptforge/assets/templates/Cloud-PT.xml,sha256=oJMf5ozrUAI6JPYGsUstlPHpYbdL9F9m1C_Cz_MIYoY,7596
54
+ ptforge/assets/templates/DLC100.xml,sha256=RXX3Nry25zoJHGeNNgLjHLaoefXZXReM4f6Skph9rxQ,15667
55
+ ptforge/assets/templates/DSL-Modem-PT.xml,sha256=Hwwn_6NjXQoNW44ef_QOsXsiLDAoTW-pbche23ILqeg,3535
56
+ ptforge/assets/templates/Door.xml,sha256=sqjKk9kWkqZFgtMIYpQDle-3zlW-htunxnxa1HYhPlc,24492
57
+ ptforge/assets/templates/Fire Sprinkler.xml,sha256=hgFodjlVEinIRO70_gMcSqrA7-aFkN8a3SDgh9ADtO8,17906
58
+ ptforge/assets/templates/Furnace.xml,sha256=_cme70qnS15vSv1MHS3dBulJTo2Uc33TROAUBO8i9Ms,20270
59
+ ptforge/assets/templates/Garage Door.xml,sha256=iEBk0P1mmB6XCPswpdRxGQmlsU2agVZpgz5Ifuwf3Vo,19751
60
+ ptforge/assets/templates/Home Speaker.xml,sha256=7ZNfsVsROy9ZhQpFGiGxC1jjYCNIz5OncIJaspXbyGc,22411
61
+ ptforge/assets/templates/Home-VoIP-PT.xml,sha256=VFkm6psTG3BubpmVCKz8v0HemacMr_3--Dz10cnatQs,12149
62
+ ptforge/assets/templates/HomeRouter-PT-AC.xml,sha256=_cJjnrJ1ND_EOUayUsa6yQFNaTPoKjBFsT3hyumRxNA,21650
63
+ ptforge/assets/templates/Hub-PT.xml,sha256=pAt_8k7JpSK65cWvyUjmnm7c2xEo6Ln5mjY0RVfTHqU,7720
64
+ ptforge/assets/templates/Humidifier.xml,sha256=TnuYPFqTt8HdwhAK7llAoyXbRvvz19ba8CDZ_8UZnX4,18556
65
+ ptforge/assets/templates/Humidity Monitor.xml,sha256=48gO57nLgD1b_xSDfZAMlNxyY7P13a6YJvFWft5XL30,15364
66
+ ptforge/assets/templates/IE-2000.xml,sha256=974YwMgMxYL5c0Cadim4VL9bfx7z0LxD36V4TRHhp2c,11431
67
+ ptforge/assets/templates/ISR4321.xml,sha256=-spVbH39Y3PpqqUzidLvPuVcZeNe17MRk_alHkF16Kc,22006
68
+ ptforge/assets/templates/ISR4331.xml,sha256=JBhFce_zCdEnG8NxWGh6hCL3iZE2g1WCiHXS_YErRDM,24340
69
+ ptforge/assets/templates/LAP-PT.xml,sha256=6nGYRvAGaENQrT2px-jLeHZSrIWG5Nwokqq_mitzzSI,5532
70
+ ptforge/assets/templates/LED.xml,sha256=gapzHFgQOVRPxbv47XbU_1QawJWSf9qTZkIvCYm2-3A,15013
71
+ ptforge/assets/templates/Laptop-PT.xml,sha256=h1lmhZt_WBhgngnl71VGRBLRfDsStVPjjPkHFJytBC4,14373
72
+ ptforge/assets/templates/Light.xml,sha256=_CknoMwUwBRpTvIVNTc3kXKpFcS76AsSDGMvP3OwGa8,20342
73
+ ptforge/assets/templates/Linksys-WRT300N.xml,sha256=f4TDYtaIWRnEJUOqvQzg2U9xVNKM59I4uCmq86DETrg,9810
74
+ ptforge/assets/templates/MCU-PT.xml,sha256=5lWTjPp_48mw3ojbMqdCjZpvaNQHXahuD3XGkvke26A,10984
75
+ ptforge/assets/templates/Meraki-MX65W.xml,sha256=SLyTxbnKXEjQHtySbGxtHsGq90rajRfjaApFOe_Szl4,19290
76
+ ptforge/assets/templates/Meraki-Server.xml,sha256=2U4XgnXFSnkbkX7INUnb2tDcjWhfoKUckaaGg6v2bE4,84821
77
+ ptforge/assets/templates/NetworkController.xml,sha256=a40Cqh133GAihiyR9BK_Btz_9QENtA1i-SlhCjqSJ2c,45733
78
+ ptforge/assets/templates/Old Car.xml,sha256=6nofakRpz2UBuZ9uZwjbZkUc1OBJf5fXpR1S7mrfG2w,17141
79
+ ptforge/assets/templates/PC-PT.xml,sha256=L5xGIa9Z1njAC6su8jm-2y8kpLo_yfnxUX5ROZNwlRI,19597
80
+ ptforge/assets/templates/Portable Music Player.xml,sha256=2NXmqlwDJEs7fBRoBuxAqYJoITB49DjPmaMYTv5LIiA,19604
81
+ ptforge/assets/templates/Potentiometer.xml,sha256=RIt7Yby9Jk1RNoyOlvnyUmz6S2rrYUIX1ypENQG7r-w,14482
82
+ ptforge/assets/templates/Power Distribution Device.xml,sha256=wnUlGCI0ki_IobsWnmOZkPNkgFeQYhMAnsLR4P8PUWI,1775
83
+ ptforge/assets/templates/Power Meter.xml,sha256=JZb5fPDtQ-yukW9wMT5h4jtMKrxgttl0Odl5LXuu6LU,20539
84
+ ptforge/assets/templates/Push Button.xml,sha256=JR8iSVnkmRk-FZ6-6AxrI8RHw6hQPfKcXKlJiy6PtUw,13367
85
+ ptforge/assets/templates/RGB LED.xml,sha256=zQioN5_ranaxTwB6SZDzvF0AIUiRXyCyRrdIVC78Ge4,15048
86
+ ptforge/assets/templates/Rocker Switch.xml,sha256=3YnrtGoQL0xZZR1028gj3utpYemunO8RJovJfgDX52Y,14102
87
+ ptforge/assets/templates/Router-PT.xml,sha256=QzdOj8b97j24dxAUnt71ziDbMZWrDSBTKJOmt9GaM8U,18933
88
+ ptforge/assets/templates/SBC-PT.xml,sha256=7dFYXEaVLeDX1uoLRWO-bP4GK-xZSnIxLiimahlCRUE,11754
89
+ ptforge/assets/templates/SMARTPHONE-PT.xml,sha256=GmvS-eJSV0fBhLvjn9YggR_R6JINchK58A0yE1dGve4,18042
90
+ ptforge/assets/templates/Server-PT.xml,sha256=yeaPU-a1o7mKc4Zou14vdWW7NCb0kV5cemuYMBhHNjY,128568
91
+ ptforge/assets/templates/Smart LED.xml,sha256=nq1zA6RPFpda-qNoM-GjdG24ZDuX5piw1dfNrVXzuPE,16587
92
+ ptforge/assets/templates/Sniffer.xml,sha256=ocjcAnIAYWQB56w2a-t9VQP7CpRfoZ46xyRNntED5SQ,3790
93
+ ptforge/assets/templates/Solar Panel.xml,sha256=bUVZiFdYyTgJw_rrZlwEVHy5dI3jYqvy80qObDPdcQg,21332
94
+ ptforge/assets/templates/Switch-PT.xml,sha256=GcL-v7eiQmJ628LybmOeQ7p3hcRXIuQA0zINFknTBXU,12009
95
+ ptforge/assets/templates/TabletPC-PT.xml,sha256=NcjmWu9ymtu6yY7SY1CFA9PJrTLzCpPA3VJeWwKOrbA,17608
96
+ ptforge/assets/templates/Thermostat.xml,sha256=htMmrt7cj8c7-GLOo0BqkYxZwU6rdfzxUsrf4Q1w95M,26397
97
+ ptforge/assets/templates/Thing.xml,sha256=N_0GVSnBzNDRKLbcCksXptVYbWx64gXIp8vcG0yX9bk,12944
98
+ ptforge/assets/templates/WLC-2504.xml,sha256=V_9GsnERar7yP-Fpz5IfX_dQKg1Nt1qp5GcdQVaEi5k,12737
99
+ ptforge/assets/templates/WLC-3504.xml,sha256=9YT8HqyZYqHs-3xLoc6Ak8BYWwR7ClbpuOXSGYXo3hs,15702
100
+ ptforge/assets/templates/WLC-PT.xml,sha256=9aSe08NKBkzNNe67wrxnDPQ85bRTKXQ1hHvv_NzZTu8,6729
101
+ ptforge/assets/templates/Window.xml,sha256=EPTuiXq0VkqhjPc-glgXn--pPmLchRkedtuJq2-Txtk,20976
102
+ ptforge/ptcrypto/__init__.py,sha256=74TRklKNr2ave0gRwnlHIagQd7TOx51la3LtOtjUKm8,302
103
+ ptforge/ptcrypto/cmac.py,sha256=8nU5JohFvonwxyqny9RAJFGrfV1NYV6erp-7_c4U4pE,1782
104
+ ptforge/ptcrypto/ctr.py,sha256=J_PQZzLoOjd2W5wkUpVJ2dkUdzR38cHCmpiyyA89_g4,992
105
+ ptforge/ptcrypto/eax.py,sha256=80uvaIzgZBNUlTUsx-yTurY6LYIWapFFM96Fr2WbGbc,1728
106
+ ptforge/ptcrypto/pt_crypto.py,sha256=GRiANdapXdFFV27igaTiBxKznYurt3Z6EeUlZaE1rtI,1130
107
+ ptforge/ptcrypto/ptfile.py,sha256=kIuZrJ7RCAkBmdigXHvITkN8FrQI6Or_SVxdqHEyqYA,5327
108
+ ptforge/ptcrypto/twofish.py,sha256=MA2AnV6srybEFYp6sajmwO8FfPR4HzSr_0JFgW9D_hQ,15601
109
+ dsh_ptforge-0.1.0.dist-info/METADATA,sha256=B4z-htcomeuefJQHF-ODI966oxqCTvr8xzY-MD26r04,18048
110
+ dsh_ptforge-0.1.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
111
+ dsh_ptforge-0.1.0.dist-info/entry_points.txt,sha256=f49Fc1KjWlLzgDr-J6UtrrtR4uHYGcvXBgR3gcGwOas,80
112
+ dsh_ptforge-0.1.0.dist-info/top_level.txt,sha256=AdaoR-f_lTdnlq9rErqFB45DIagj-Aff5RKSO3BRaQA,8
113
+ dsh_ptforge-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.2.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ ptforge = ptforge.cli:main
3
+ ptforge-gui = ptforge.guitool:main
@@ -0,0 +1,28 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 chiyan11
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ ---
24
+
25
+ Scope note: this license covers the code written for ptforge. The Twofish
26
+ implementation under ptforge/ptcrypto/twofish.py is a vendored third-party work
27
+ (Gladman/Paulo Barreto reference implementation, redistributed via
28
+ pshvatov/pka-decipher) and is NOT relicensed by this notice; see NOTICE.
@@ -0,0 +1,28 @@
1
+ # Third-party notices
2
+
3
+ ## Twofish / CMAC / CTR / EAX
4
+
5
+ Files under `ptforge/ptcrypto/`:
6
+
7
+ - `twofish.py` — Twofish reference implementation by Paulo Barreto and
8
+ Vincent Rijmen, as distributed by pshvatov/pka-decipher. The file carries the
9
+ original Gladman-style copyright header; keep it intact when redistributing.
10
+ - `cmac.py`, `ctr.py`, `eax.py`, `pt_crypto.py` — thin helpers derived from the
11
+ same upstream repository.
12
+
13
+ The upstream repository (https://github.com/pshvatov/pka-decipher) does not ship
14
+ a top-level LICENSE file at the time of writing. That means the cryptographic
15
+ code is redistributed **without an explicit license grant**. The MIT license in
16
+ this repository covers only the code authored for ptforge. If you intend to
17
+ redistribute ptforge commercially or under a different license, replace the
18
+ vendored cipher with a properly licensed implementation (for example the
19
+ `twofish` package on PyPI) or obtain permission from the upstream authors.
20
+
21
+ ## Everything else
22
+
23
+ `ptforge/`, `packages/dsh-ptforge/`, `docs/`, `tests/` and `scripts/` are
24
+ original work, MIT licensed (see LICENSE).
25
+
26
+ The `.pkt` container format and the Cisco IOS command syntax emulated here are
27
+ undocumented/proprietary interfaces of Cisco Packet Tracer. This project is not
28
+ affiliated with or endorsed by Cisco Systems.
@@ -0,0 +1 @@
1
+ ptforge
ptforge/__init__.py ADDED
@@ -0,0 +1,3 @@
1
+ """ptforge - declarative topology/configuration engine for Cisco Packet Tracer."""
2
+
3
+ __version__ = "0.1.0"
ptforge/__main__.py ADDED
@@ -0,0 +1,3 @@
1
+ from .cli import main
2
+
3
+ raise SystemExit(main())