ariel_os::identity

Function interface_eui48

pub fn interface_eui48(if_index: u32) -> Result<Eui48, impl Error>
Expand description

Generates an EUI-48 identifier (“6-byte MAC address”) based on the device identity.

The argument if_index allows the system to generate addresses for consecutive interfaces.

The default implementation creates a static random identifier based on the board name, the device ID bytes, incrementing by the interface index (following the common scheme of sequential MAC addresses being assigned to multi-interface hardware). Those take the shape ?2-??-??-??-??-??: Their bits set to individual (I/G, unicast), administratively locally administered (U/L, not indicating any particular manufacturer), and following the SLAP (Structured Local Address Plan) semantics, they fall into the AII (Administratively Assigned Identifier) quadrant. Wikipedia has a good description of those address details.

The randomly generated identifiers aim to appear random, but can be traced back to the device ID it is calculated from.

On devices that have access to globally unique EUI-48 identifiers, those are returned for interface indices up to the number of available identifiers.

§Errors

Same as in device_id_bytes().