show access-lists reports which rule matched (#1267) #1268
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!1268
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/acl-match-counters"
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?
show access-listsreports which rule matchedFixes #1267.
The gap
show access-listslisted rules and said nothing about them.show interfacessaid5 drops (ACL 101 denied (in) x5)— so the console could tell you an ACL was denying and never which linewas doing it, which is the whole reason the table is opened. And the drop summary cannot answer the follow-up
because it names the list, not the rule.
The information was already there:
aclLib.evaluate()returnsmatchedIndex, and the implicit deny isflagged, and the only consumer threw both away.
Now
Simulator._countAclHit()tallies every evaluation inside_aclCheck()— the funnel both directionspass through — so a permit is counted as well as a deny, and a call site added later is counted by
construction. Same discipline
_emit()uses for drops (#1257);show access-listsprints(N matches)per rule, singular/plural, and nothing at all for a rule thathas not matched —
(0 matches)on every line of a twenty-line list is noise, and absence says the samething;
traffic that matched nothing;
the previous rule's traffic after a list was rewritten. That was found by the test written for it, and
fixed rather than asserted around;
no access-list <id>deletes the counters with the list;matches" — the same three-way distinction
show interfacesmakes (#1252).Evidence
test/show-access-lists.test.js— 23 checks:counters: not measured (no simulation run); simulator but no traffic →counters: no packet has been tested against this list; neither invents zero counts;show interfacesreports the same five over the same list — the two tables read together must agree;(1 match)singular;(implicit deny all: 2 matches), while the non-matching rule staysuncounted;
Reverting
engine/simulator.jsfails 6;engine/cli.jsfails 9.docs/CLI.mdgains "Readingshow access-lists" and the command in the table.Suite: 147 suites, 6,240 assertions, 0 failed.
show access-listsreports which rule matched (#1267)