The port-naming table exists twice, and the engine is stricter than the console #1247
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge#1247
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
What
engine/iface-name.jsholds the rules that fold a console spelling onto the panel spelling (ether1→eth1,sfp-sfpplus1→SFP+1).engine/cli.jsholds a hand-copied second version ofPORT_NAME_RULES,portKeyandresolvePortName.They agree today, character for character, by luck. Two copies of one rule is the failure mode this repo
has already been bitten by twice:
engine/fabric.jsvsweb/app.jsneededtest/fabric-agreement.test.jsafter they diverged, and the port-state rule needed the same treatment in #1238. When a vendor spelling is
added for the next MikroTik, it will be added to whichever copy the author happens to open, and the console
and the engine will disagree about what a port is called.
The asymmetry it hides
Device.resolveIface()accepts exact names only:So the engine is stricter than the console that writes the config. A topology file that stores a VRRP
group (or a link, or a DHCP binding) under the spelling an engineer typed resolves to nothing in the engine:
the group takes part in no election, and
show vrrpreports it asInit— a static naming problem presentedas a dynamic state.
Expected
Device.resolveIface()resolves through that table: exact name, then case, then the vendor fold, andnullwhen nothing matches or two ports fold together;cli.resolvePortName === ifaceName.resolvePortName),and a sweep proving every port in the catalogue resolves by its own name, in any case, and by its console
spelling.
Scope
De-duplication and one resolver. No new commands, no naming changes, no renaming of any port.