Skip to content

feat: add MACFilter for network interface classification#6

Merged
christiangda merged 2 commits intomainfrom
feat/network-interface-classification
Feb 14, 2026
Merged

feat: add MACFilter for network interface classification#6
christiangda merged 2 commits intomainfrom
feat/network-interface-classification

Conversation

@christiangda
Copy link
Contributor

@christiangda christiangda commented Feb 14, 2026

Summary

  • Add MACFilter type with three modes: MACFilterPhysical (default), MACFilterAll, and MACFilterVirtual to control which network interfaces contribute to machine ID generation
  • Update WithMAC() to accept an optional MACFilter parameter (backward compatible — no args = physical only)
  • Add -mac-filter CLI flag (physical, all, virtual)
  • Update documentation (doc.go, README.md) with MAC filtering examples and reference table

Test plan

  • All 120+ existing tests pass with -race enabled
  • New tests: TestCollectMACAddressesAllFilter, TestCollectMACAddressesVirtualFilter, TestMACFilterString, TestWithMACBackwardCompatibility, TestWithMACFilter, TestWithMACFilterAffectsID
  • go build ./... and go vet ./... clean
  • Verify CI passes on Linux and macOS
  • Manual test: go run ./cmd/machineid -mac -mac-filter all -diagnostics

🤖 Generated with Claude Code

Add MACFilter type (Physical, All, Virtual) to control which network
interfaces contribute to the machine ID. Physical-only (default) provides
the most stable IDs on bare metal; All includes virtual interfaces for
maximum uniqueness; Virtual-only supports container fingerprinting.

Backward compatible: WithMAC() with no args behaves identically to before.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@christiangda christiangda self-assigned this Feb 14, 2026
- Add missing periods to all doc comment sentences
- Use "reports whether" for bool-returning functions (Validate, isValidUUID,
  isValidSerial, isNonEmpty, isVirtualInterface)
- Add [Symbol] doc links for cross-references (FormatMode, DiagnosticInfo,
  Provider.ID)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@christiangda christiangda merged commit cd9b137 into main Feb 14, 2026
5 checks passed
@christiangda christiangda deleted the feat/network-interface-classification branch February 14, 2026 19:58
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.

1 participant

Comments