Repository navigation
p4net 1.8.0
中文
p4net 1.8.0 新增 Network.astart()、Network.astop(),支持在事件循环中等待网络启停和清理完成;CLI 新增 值&&&掩码 三态匹配与 下界..上界 范围匹配。本版本还修复编译缓存、连接回收、Unicode 接口名、跨命名空间接口复用、拓扑地址判重和 P4Runtime 编码问题,并更新中英文文档。
从 1.7 升级时,请检查这些变化:
- 异步场景使用
await net.astart()、await net.astop(),保持客户端所属循环运行到关闭完成。 - 导入拓扑快照需提供完整端口和接口名。地址、整数、布尔及匹配字段按其类型和格式校验;LPM 主机位和 TERNARY 掩码外值位必须清零。
- OPTIONAL、TERNARY、RANGE 表项的插入和删除需要合法的正整数优先级。异常处理按修正后的 RPC 错误类别调整。
- ping 支持小数超时,发送次数受
count限制,至少一次应答即成功。tc 字符串使用10mbit、1.5ms等数值紧邻单位的 ASCII 格式。
Python 3.10.20、3.12.3 各通过 3685 项测试,均以 root 启用 p4c 和 BMv2。四个独立安装环境的同步与异步网络验证共覆盖 12 个原生场景、16 次有向 ping。具体环境、警告及未执行项见附件 VALIDATION.md。
English
p4net 1.8.0 adds awaitable network startup and shutdown with Network.astart() and Network.astop(), plus CLI ternary (value&&&mask) and range (low..high) matches. It fixes compiler caches, connection cleanup, Unicode interfaces, interface reuse across namespaces, effective-IP collision checks and P4Runtime encodings, and updates the English and Chinese documentation.
When upgrading from 1.7:
- Await network lifecycle operations in an event loop and keep each async client's owning loop running through shutdown.
- Supply complete ports and interface names in imported snapshots. Use correctly typed topology and match values, canonical LPM prefixes and ternary values with zero bits outside the mask.
- Supply valid positive priorities for inserting and deleting optional, ternary and range entries. Review handlers that relied on previous RPC error classifications.
- Ping supports fractional timeouts, bounds requests by
countand succeeds after any reply. Use adjacent ASCII numbers and units for traffic-control strings, such as10mbitand1.5ms.
Python 3.10.20 and 3.12.3 each passed 3,685 tests as root with p4c and BMv2 enabled. Four clean installations also passed 12 native scenarios and 16 directional pings. See VALIDATION.md for environments, warnings and checks not run.
Full changelog · Changes since 1.7.0
Source revision: 0268483570acbf70d394fe535841173be622fc12.
The wheel, source distribution, REVISION, CHANGELOG.md, VALIDATION.md and SHA256SUMS are attached. Run sha256sum --check SHA256SUMS with all six files in the same directory.