ping: one Unix ping parser and one reply builder #12

Open
opened 2026-10-06 17:31:30 +00:00 by christianmanivong · 1 comment
Owner

Six drivers build NAPALM ping() replies themselves, and the results disagree.

  • openwrt (routing_mixin.py:63): the most tolerant parser, handling BusyBox and iputils.
  • linux (linux.py:914): requires iputils' "N received", so BusyBox output becomes an error. Filed as NAPALM/napalm-linux#15.
  • proxmox (routing_mixin.py:71): its per-probe regex never matches, so results is always empty. Filed as NAPALM/napalm-proxmox#12.
  • procurve (procurve.py:1385):
    • It reports success with 100 % loss on "unreachable", where the others return error.
    • It invents per-probe results ([{"ip_address": "", "rtt": avg}] * received).
  • netgear (netgear_smart.py:1779): no per-probe results.
  • opnsense (ping_mixin.py:327): builds the same reply from API rows.
    • Its _as_int is identical to ping_sweep.py:161.

PingSweepMixin._parse_ping_reply (ping_sweep.py:144) consumes all of these.

Proposal: parse_unix_ping(output, destination) for BusyBox and iputils, IPv4 and IPv6, plus a ping_reply(...) builder in ping_sweep.py. The drivers keep only the command line. tplink's Windows-style output keeps its own parsing but uses the builder.

Prio P4: the two real failures have their own issues.

From the NetOrk function index (NetOrk/netork#670); every location was checked against the current code. Paths are relative to each driver repo.

Six drivers build NAPALM `ping()` replies themselves, and the results disagree. - **openwrt** (`routing_mixin.py`:63): the most tolerant parser, handling BusyBox and iputils. - **linux** (`linux.py`:914): requires iputils' "N received", so BusyBox output becomes an error. Filed as NAPALM/napalm-linux#15. - **proxmox** (`routing_mixin.py`:71): its per-probe regex never matches, so `results` is always empty. Filed as NAPALM/napalm-proxmox#12. - **procurve** (`procurve.py`:1385): - It reports **success** with 100 % loss on "unreachable", where the others return `error`. - It invents per-probe results (`[{"ip_address": "", "rtt": avg}] * received`). - **netgear** (`netgear_smart.py`:1779): no per-probe results. - **opnsense** (`ping_mixin.py`:327): builds the same reply from API rows. - Its `_as_int` is identical to `ping_sweep.py`:161. `PingSweepMixin._parse_ping_reply` (`ping_sweep.py`:144) consumes all of these. **Proposal:** `parse_unix_ping(output, destination)` for BusyBox and iputils, IPv4 and IPv6, plus a `ping_reply(...)` builder in `ping_sweep.py`. The drivers keep only the command line. tplink's Windows-style output keeps its own parsing but uses the builder. Prio P4: the two real failures have their own issues. From the NetOrk function index (NetOrk/netork#670); every location was checked against the current code. Paths are relative to each driver repo.
Author
Owner

Re-homed by docs/STRUCTURE.md (NAPALM/napalm-device-types#37, NetOrk/netork#1105): a NAPALM ping() reply builder is agnostic and can stay here. The BusyBox/iputils parser goes to napalm-unix (#35). ping_sweep itself moves to the application (#34).

Re-homed by `docs/STRUCTURE.md` (NAPALM/napalm-device-types#37, NetOrk/netork#1105): a NAPALM `ping()` reply builder is agnostic and can stay here. The BusyBox/iputils parser goes to napalm-unix (#35). `ping_sweep` itself moves to the application (#34).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: NAPALM/napalm-device-types#12