LLDP: one row table, two projections (neighbors and detail) #10

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

Projecting rows into NAPALM dicts

  • get_lldp_neighbors is identical apart from docstrings in napalm_openwrt/lldp_mixin.py:22 and napalm_tplink_jetstream/tplink_jetstream.py:680. netgear (netgear_smart.py:1035) is the same plus a mac key.
  • get_lldp_neighbors_detail is identical in lldp_mixin.py:111 and tplink_jetstream.py:753.

Parsing

  • The lldpctl -f keyvalue grouping loop in lldp_mixin.py:84–95 is a copy of napalm_linux/linux.py:599–609.
  • The detail label to NAPALM field mapping exists in netgear_smart.py:1163, procurve/parsers.py:482 and tplink_jetstream.py:780. The tplink copy, _parse_lldp_detail, has no caller.

Proposal: an LldpTableMixin with a _get_lldp_table() hook that returns rows. Concrete get_lldp_neighbors/get_lldp_neighbors_detail project them. Add pure helpers parse_lldpctl_keyvalue() and lldp_detail_from_pairs(), and delete the unused tplink parser. procurve's double read is part of this (NAPALM/napalm-hpe-aruba-procurve#6).

Prio P4.

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

**Projecting rows into NAPALM dicts** - `get_lldp_neighbors` is identical apart from docstrings in `napalm_openwrt/lldp_mixin.py`:22 and `napalm_tplink_jetstream/tplink_jetstream.py`:680. netgear (`netgear_smart.py`:1035) is the same plus a `mac` key. - `get_lldp_neighbors_detail` is identical in `lldp_mixin.py`:111 and `tplink_jetstream.py`:753. **Parsing** - The `lldpctl -f keyvalue` grouping loop in `lldp_mixin.py`:84–95 is a copy of `napalm_linux/linux.py`:599–609. - The detail label to NAPALM field mapping exists in `netgear_smart.py`:1163, `procurve/parsers.py`:482 and `tplink_jetstream.py`:780. The tplink copy, `_parse_lldp_detail`, has no caller. **Proposal:** an `LldpTableMixin` with a `_get_lldp_table()` hook that returns rows. Concrete `get_lldp_neighbors`/`get_lldp_neighbors_detail` project them. Add pure helpers `parse_lldpctl_keyvalue()` and `lldp_detail_from_pairs()`, and delete the unused tplink parser. procurve's double read is part of this (NAPALM/napalm-hpe-aruba-procurve#6). Prio P4. 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): the projection of LLDP rows into NAPALM's two shapes is agnostic and can stay here. The lldpctl -f keyvalue parser goes to napalm-unix (#35).

Re-homed by `docs/STRUCTURE.md` (NAPALM/napalm-device-types#37, NetOrk/netork#1105): the projection of LLDP rows into NAPALM's two shapes is agnostic and can stay here. The `lldpctl -f keyvalue` parser goes to napalm-unix (#35).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: NAPALM/napalm-device-types#10