Expand description
Hardware Address
§Installation
[dependencies]
hardware-address = "0.1"
§Pedigree
This code is inspired and modified based on Golang’s mac implementation.
§License
hardware-address
is under the terms of both the MIT license and the
Apache License (Version 2.0).
See LICENSE-APACHE, LICENSE-MIT for details.
Copyright (c) 2025 Al Liu.
Macros§
- addr_ty
- A macro for defining address types.
Structs§
- Eui64
Addr - Represents a physical EUI-64 format address.
- Infini
Band Addr - Represents a physical 20-octet InfiniBand format address.
- MacAddr
- Represents a physical hardware address (MAC address).
Enums§
- Parse
Error - ParseError represents an error that occurred while parsing hex address.
Functions§
- parse
- Parses s as an IEEE 802 MAC-48, EUI-48, EUI-64, or a 20-octet IP over InfiniBand link-layer address and etc using one of the following formats:
- xtoi
- Converts a hexadecimal slice to an integer. Returns a tuple containing:
- xtoi2
- Converts the next two hex digits of s into a byte. If s is longer than 2 bytes then the third byte must match e.
Type Aliases§
- Parse
Eui64 Addr Error - Represents an error that occurred while parsing
Eui64Addr
. - Parse
Infini Band Addr Error - Represents an error that occurred while parsing
InfiniBandAddr
. - Parse
MacAddr Error - Represents an error that occurred while parsing
MacAddr
.