Skip to content

feat(p2): parse the full ifXTable (64-bit HC counters) - #24

Merged
stakach merged 1 commit into
spider-gazelle:masterfrom
n-rodriguez:feat/p2-hc-counters
Jul 12, 2026
Merged

feat(p2): parse the full ifXTable (64-bit HC counters)#24
stakach merged 1 commit into
spider-gazelle:masterfrom
n-rodriguez:feat/p2-hc-counters

Conversation

@n-rodriguez

Copy link
Copy Markdown
Contributor

Fourth slice of the P2 (protocol completeness) group (#7). Follows #21, #22, #23.

Problem

IfEntry only read the 32-bit ifTable counters, so ifInOctets/ifOutOctets wrap in seconds on Gbit links, and none of the ifXTable identity or high-capacity fields were exposed.

Change

  • Replace the growing per-column case with a COLUMNS lookup table (column-object OID → setter), dropping the # ameba:disable Metrics/CyclomaticComplexity.
  • Add all 19 ifXTable columns (RFC 2863): the 64-bit HC in/out octet + packet counters (hc_in_octets, hc_out_octets, …), ifName/ifAlias/ifHighSpeed, and the ifLinkUpDownTrapEnable/ifPromiscuousMode/ifConnectorPresent flags (exposed as …? predicates).

The >2^32 HC counters decode correctly thanks to the earlier get_unsigned64 fix.

Note

This is the lookup-table refactor, so it also rewrites the existing ifTable parsing into the same table — covered by the pre-existing helpers_spec regression (still green) plus a new regression case.

Tests

if_xtable_spec covers the new fields across all four value types (incl. a hc_in_octets above 2^32) and a classic-ifTable regression. Deterministic 77/77, multi-threaded 77/77, legacy 3/3, ameba clean, format clean.

Tracked in #7. Last P2 slice after this: trap/inform sending.

🤖 Generated with Claude Code

IfEntry only read the 32-bit ifTable counters, so ifInOctets/ifOutOctets wrap in
seconds on Gbit links, and none of the ifXTable identity/HC fields were exposed.

- if_entry: replace the growing per-column case with a COLUMNS lookup table
  (OID-object => setter), dropping the CyclomaticComplexity disable
- add all 19 ifXTable columns (RFC 2863): 64-bit HC in/out octet + packet
  counters, ifName/ifAlias/ifHighSpeed, and the trap-enable/promiscuous/
  connector flags
- spec: if_xtable_spec covers the new fields (incl. a >2^32 HC counter) and a
  classic-ifTable regression

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@stakach
stakach merged commit 83cea73 into spider-gazelle:master Jul 12, 2026
6 checks passed
@n-rodriguez
n-rodriguez deleted the feat/p2-hc-counters branch July 12, 2026 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants