Adds a default gateway to the port.
port_gateway_set() function sets the default gateway for the local port to the specified address.
;;; Adds a default gateway to the local port (@interface func (export "port_gateway_set") ;;; Address of the default gateway (param $addr (@witx const_pointer $addr)) (result $error (expected (error $errno))) )
ctx: A mutable reference to the function environment.
WasmPtrpointing to the memory location where the IP address of the default gateway is 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_gateway_set()function sets the default gateway for the local port, which is the address that is used for routing packets when the destination IP address is outside of the local network.
- The IP address of the default gateway is provided through the
ipparameter, which should point to a memory location that stores the IP address in the
- The behavior and limitations of the
port_gateway_set()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.