show ip interface brief: a port with no address has no method, and every row lands under its heading #1562
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge!1562
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "rev/1115-2301"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The question
What does
show ip interface briefput in its Method column when a port holds no address — and do therows line up with their own header?
Evidence
show ip interface brieffield table: Method ismanual- "manually changed by the command-line interface",DHCP- "ip address dhcp",unset-"unset". https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/ipaddr/command/ipaddr-cr-book/ipaddr-r1.html
header:
GigabitEthernet1/0/2 unassigned YES unset down down.http://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst9200/software/release/17-18/command_reference/b_1718_9200_cr/interface_and_hardware_commands.pdf
Serial1 unassigned YES unset administratively down down.https://www.cisco.com/E-Learning/bulk/public/tac/cim/cib/using_cisco_ios_software/cmdrefs/show_ip_interface.htm
GigabitEthernet0/0/0 unassigned YES unset administratively down down,Gi0/0/1.10 192.168.10.1 YES manual up up.https://www.ciscopress.com/articles/article.asp?p=3089357&seqNum=7
What changed
manualonly when the port holds a static address,DHCPwhen it asks(even before a lease),
unsetwhen it holds nothing. A port nobody configured used to readunassigned YES manual— a claim that a person set an address that is not there.by hand:
OK?was four columns in the header andYESfive in the rows, soMethodandStatusheadings sat one column right of their values. Widths are IOS's own (23/16/4/7/22), and a name wider than
its column shifts the row rather than colliding with the address.
test/interface-brief-columns.test.jspins both: the header against Cisco's string character for character,each heading against the column its value starts in,
manual/DHCP/unsetin each state,unsetrestoredby
no ip address, a shut port keeping its method, an over-wide name, and a sweep over every port of aswitch. 17 checks.
Suites
node scripts/syntax-check.js— 326 files OK.npm test— 256 suites, 9314 assertions, 0 failed(408 s), including the new suite.
Deliberately not changed
The IP-Address column still carries the prefix (
10.0.0.1/24) where IOS prints the bare address and keepsthe mask in
show interfaces. That is a separate question with its own trade-off — the prefix is what makesthe row answer "which subnet is this port in" — and is left for its own increment rather than smuggled in here.
Rebase blocked:
engine/cli.jsconflict — needs Jay's decisionI tried to rebase
rev/1115-2301ontoorigin/main(15f8532a) in a scratch worktree. One file conflicts:engine/cli.js, in theshow ip interface briefrow builder. I did not resolve it — both sides fix the same defect and the choice between them is a code-ownership call, not a mechanical merge.Main's side (from #1286,
3dbf74fd"A VLAN parameter is not a mode change, and a port has one method"):This PR's side (same commit):
plus new module-level
BRIEF_COLUMNS(Interface 23, IP-Address 16, OK? 4, Method 7, Status 22) andbriefLine()/briefMethod(), whose bodies are behaviourally identical to main's inline ternary (DHCP/manual/unset).What is already superseded and what is not
3dbf74fd(#1286), includingtest/interface-method.test.js. That half needs no merge.BRIEF_COLUMNS.headwhile rows are hand-padded (pad(name,22),'YES '= 5 wide against a 4-wideOK?head,pad(method,8)against a 7-wideMethodhead), so rows are off by one fromStatusonward exactly as this PR describes.test/interface-brief-columns.test.js(160 lines) is new on this branch and has no counterpart on main.Decision required
Two implementations of the same eight lines now exist:
const method = ...+out.push(...)block, keepbriefLine/briefMethod/BRIEF_COLUMNSand the PR's test. Keeps main's behaviour byte-for-byte and fixes the header alignment; loses the #1286 comment rationale unless the comment is moved ontobriefMethod().engine/cli.jshunk — keep main's code, re-scope the PR to the alignment fix alone (which then has to pad rows from the same widths, i.e. it becomes the same change anyway).I have not touched
engine/— that content belongs to the reverse loop and to whoever owns #1286's wording. needs Jay's decision (or an explicit go-ahead for me to take option 1).Other
rev/1115-2301facts: 1 commit ahead, 7 behind15f8532a,mergeable=false, head86bc4bdawith 0/7 checks and no run rows — so CI has not evaluated it either.86bc4bdad34ef24d40bbResolved and rebased — the earlier escalation is withdrawn
I said this needed Jay's decision. On a second look it does not: the two sides are the same rule, so keeping both is mechanical, not a judgement call.
What I verified before touching it:
briefMethod()on this branch is— character-for-character the behaviour of main's inline
i.dhcp ? 'DHCP' : (i.ip ? 'manual' : 'unset'). There is no disagreement to arbitrate; main has the sentence explaining whyunsetis the answer and this branch has the row builder that lands every row under its heading.Resolution (
engine/cli.js, one hunk): main's comment kept verbatim, and the row printed through the branch's builder:Rebased + pushed:
86bc4bda→4ef24d40onrev/1115-2301(base7e89f959),--force-with-lease.mergeableis now true.Checks run locally on the rebased tree:
test/interface-brief-columns.test.js17/17; the 13 suites that mentioninterface brief(brief-method-unset, interface-method, interface-status, show-ip-spellings, help-completeness, report-sweep, …) 0 failures;npm run syntax328 files OK;npm run check:bytesclean.No source change was made beyond the conflict hunk. If you would rather the column work wait and the
unsetrule stand alone, say so and I will close this PR instead — main already has the method half from #1557 (42c60c1d).4ef24d40bbb38e0c5d5a