port_route_remove()
Removes an existing route from the local port.
Description
The port_route_remove()
function removes an existing route from the routing table of the local port. This allows you to remove a route that is no longer needed or that needs to be updated.
Syntax
;;; Removes an existing route from the local port
(@interface func (export "port_route_remove")
(param $cidr (@witx const_pointer $addr))
(result $error (expected (error $errno)))
)
Parameters
ctx
: A mutable reference to the function environment.ip
: AWasmPtr
pointing to the memory location where the IP address of the route to be removed is stored.
Return Value
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.
Notes
- The
port_route_remove()
function removes an existing route from the routing table of the local port based on the specified IP address. - The IP address of the route to be removed is provided through the
ip
parameter, which should point to a memory location that stores the IP address in the__wasi_addr_t
format. - The behavior and limitations of the
port_route_remove()
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.