Returns the MAC address of the local port.
port_mac() function retrieves the MAC address of the local port and stores it in the memory location pointed to by
;;; Returns the MAC address of the local port (@interface func (export "port_mac") (result $error (expected $hardware_address (error $errno))) )
ctx: A mutable reference to the function environment.
WasmPtrpointing to the memory location where the MAC address will be stored.
The function returns a
Result indicating the outcome of the operation. If the operation is successful,
Ok(Errno::Success) is returned. If an error occurs, an appropriate
WasiError is returned.
port_mac()function retrieves the MAC address of the local port, which is a unique identifier assigned to the network interface.
- The MAC address is typically represented as a sequence of hexadecimal digits separated by colons (e.g.,
- The retrieved MAC address is stored in the memory location pointed to by
ret_mac, which should have enough space to accommodate the MAC address.
- The behavior and limitations of the
port_mac()function may vary depending on the specific runtime environment and underlying networking implementation. It is important to consult the documentation or specifications of the specific environment to understand its behavior in that context.