You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[vendor-info] generalize vendor OUI to support variable lengths (openthread#13258)
This commit generalizes the Vendor OUI (Organizationally Unique
Identifier) handling to support IEEE MAC Address Block Large
(MA-L, 24-bit), Medium(MA-M, 28-bit), and Small (MA-S, 36-bit)
assignments.
Key enhancements:
- Backward-Compatible Config Parsing: The
`OPENTHREAD_CONFIG_NET_DIAG_VENDOR_OUI` configuration remains fully
backward compatible. If the macro is set to a traditional 24-bit
integer (e.g., `0x641666`), it is implicitly parsed as a 24-bit
OUI.
For larger or variable-length OUIs, a new explicit 48-bit format is
supported: `0x[BitLengthInHex][5 OUI Bytes]` (e.g. `0x1c001a2b3000ULL`
for 28-bit, and `0x24001a2b3c40ULL` for 36-bit). This format
encodes both prefix length and value into a single integer, making
it trivial to pass through command-line flags (e.g. `-D...`).
- Compile-Time Validation: Introduced `VendorInfo::OuiParser` template
class to parse and validate the configured OUI at compile-time
(`static_assert`). It ensures invalid lengths, out-of-range
configurations, or non-zero trailing bits fail the build
immediately.
- New APIs: Replaced legacy `uint32_t` representations with the
`otThreadVendorOui` containing `mBitLength` and a 5-byte buffer
`mBytes`. Added new public APIs `otThreadGetVendorOuiInfo()` and
`otThreadSetVendorOuiInfo()`, while deprecating the older 24-bit OUI
getters and setters.
- Border Agent & CLI Updates:
- Updated Border Agent TXT data generation (`vo` key) and parsing
to correctly handling of new OUI lengths.
- Updated CLI command utilities to output variable-length OUI bytes
formatted correctly.
- Added new `test_vendor_oui.cpp` unit tests to thoroughly validate
compile-time parsing and runtime class logic.
0 commit comments