---
title: "port_route_clear()"
description: "The port_route_clear() function clears all the routes in the routing table of the local port. This allows you to remove all existing routes at once."
url: "https://wasix.org/docs/api-reference/wasix/port_route_clear/"
markdown: "https://wasix.org/docs/api-reference/wasix/port_route_clear.md"
---

# `port_route_clear()`

Clears all the routes in the local port.

## Description

The `port_route_clear()` function clears all the routes in the routing table of the local port. This allows you to remove all existing routes at once.

## Syntax

```ebnf
  ;;; Clears all the routes in the local port
  (@interface func (export "port_route_clear")
    (result $error (expected (error $errno)))
  )
```

## Parameters

- `ctx`: A mutable reference to the function environment.

## 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_clear()` function clears all the routes in the routing table of the local port, effectively removing all existing routes.
- The behavior and limitations of the `port_route_clear()` 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.

---

[Documentation index](https://wasix.org/llms.txt) · [HTML version](https://wasix.org/docs/api-reference/wasix/port_route_clear/)
