cli: show lldp neighbors prints the box's five columns, and cuts a Device ID at 20 #2286

Merged
jaylouisw merged 1 commit from rev/1120-0912 into main 2026-11-20 09:38:13 +00:00
Owner

The view printed a table no box prints: a LLDP neighbours on <device>: heading over Neighbour / Local port / Port ID / Mgmt address, with widths taken from the data.

A preserved IOS capture (networktocode/ntc-templates, tests/cisco_ios/show_lldp_neighbors/cisco_ios_show_lldp_neighbors.raw) shows the vendor shape: a four-line capability legend, a blank line, then Device ID at 0, Local Intf at 20, Hold-time at 35, Capability at 46, Port ID at 62, a blank line, and Total entries displayed: N.

Two rules ride on the widths:

  • a Device ID longer than 20 characters is cut at 20 and runs flush against its port (IOS XR field table; ntc-templates issue #375);
  • Capability is the System Capabilities TLV in bit order - S host, B L2, R router, B,R L3 switch - so the LLDPDU now carries that TLV (type 7, six bytes) rather than leaving the column invented. A neighbour that advertised none prints a blank cell, as the capture does.

The management address leaves the table (it stays on the neighbour record and on the port's own block); a neighbour whose local port cannot carry a frame keeps its reason after the last column.

research/show-lldp-neighbors-columns.md records the captures, the width measurement, and what stays unresolved (NX-OS does not truncate; the empty-state sentence is this console's own).

Tests: 408 suites, 13542 assertions, 0 failed. New suite test/show-lldp-neighbors-columns.test.js (27 checks).

The view printed a table no box prints: a `LLDP neighbours on <device>:` heading over Neighbour / Local port / Port ID / Mgmt address, with widths taken from the data. A preserved IOS capture (networktocode/ntc-templates, `tests/cisco_ios/show_lldp_neighbors/cisco_ios_show_lldp_neighbors.raw`) shows the vendor shape: a four-line capability legend, a blank line, then Device ID at 0, Local Intf at 20, Hold-time at 35, Capability at 46, Port ID at 62, a blank line, and `Total entries displayed: N`. Two rules ride on the widths: - a Device ID longer than 20 characters is cut at 20 and runs flush against its port (IOS XR field table; ntc-templates issue #375); - Capability is the System Capabilities TLV in bit order - `S` host, `B` L2, `R` router, `B,R` L3 switch - so the LLDPDU now carries that TLV (type 7, six bytes) rather than leaving the column invented. A neighbour that advertised none prints a blank cell, as the capture does. The management address leaves the table (it stays on the neighbour record and on the port's own block); a neighbour whose local port cannot carry a frame keeps its reason after the last column. `research/show-lldp-neighbors-columns.md` records the captures, the width measurement, and what stays unresolved (NX-OS does not truncate; the empty-state sentence is this console's own). Tests: 408 suites, 13542 assertions, 0 failed. New suite `test/show-lldp-neighbors-columns.test.js` (27 checks).
cli: show lldp neighbors prints the box's five columns, and cuts a Device ID at 20
All checks were successful
CI / Classify the change (pull_request) Successful in 13s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 13s
CI / Server smoke and Docker build (pull_request) Successful in 26s
CI / Test (Node 22) (pull_request) Successful in 58s
CI / Test (Node 20) (pull_request) Successful in 1m0s
CI / Test (Node 18) (pull_request) Successful in 1m3s
CI / Arm auto-merge (pull_request) Successful in 4s
4e00e5815c
The view printed a table no box prints - a `LLDP neighbours on <device>:` heading over
Neighbour / Local port / Port ID / Mgmt address, widths taken from the data. A preserved IOS
capture (networktocode/ntc-templates' cisco_ios_show_lldp_neighbors.raw) shows the vendor's
shape: a four-line capability legend, a blank line, then Device ID at 0, Local Intf at 20,
Hold-time at 35, Capability at 46, Port ID at 62, a blank line and `Total entries displayed: N`.

Two rules ride on the widths. A Device ID longer than 20 characters is cut at 20 and runs flush
against its port (IOS XR field table; ntc-templates issue #375). And Capability is the System
Capabilities TLV's letters in bit order - S for a host, B for an L2 box, R for a router, B,R for
an L3 switch - so the LLDPDU now carries that TLV (type 7, six bytes) instead of leaving the
column to be invented. A neighbour that advertised none prints a blank cell, as the capture does.

The management address leaves the table (it stays on the record and on the port's block); a
neighbour whose local port cannot carry a frame keeps its reason after the last column.

research/show-lldp-neighbors-columns.md has the captures, the width measurement and what stays
unresolved (NX-OS does not truncate; the empty-state sentence is this console's own).
jaylouisw changed title from cli: show lldp neighbors prints the box's five columns, and cuts a Device ID at 20 to cli: show lldp neighbors prints the box's five columns, and cuts a Device ID at 20 2026-11-20 09:28:14 +00:00
forgejo-actions scheduled this pull request to auto merge when all checks succeed 2026-11-20 09:29:14 +00:00
jaylouisw deleted branch rev/1120-0912 2026-11-20 09:38:14 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jaylouisw/packetforge!2286
No description provided.