A library for manipulation of MAC address representations.
Raised when parsing of MAC address syntax fails.
Type of the hardware address (MAC) of an ethernet interface.
Functions converting MAC addresses to bytes/string and vice versa.
of_bytes_exn buf
is the hardware address extracted from
buf
. Raises Parse_error
if buf
has not length 6.
Same as above but returns an option type instead of raising an exception.
of_string_exn mac_string
is the hardware address represented by
mac_string
. Raises Parse_error
if mac_string
is not a
valid representation of a MAC address.
Same as above but returns an option type instead of raising an exception.
to_string ?(sep=':') mac_addr
is the sep
-separated string representation
of mac_addr
, i.e. xx:xx:xx:xx:xx:xx.
make_local bytegen
creates a unicast, locally administered MAC
address given a function mapping octet offset to octet value.