class representing a single kernel routing table entry.
More...
#include <route.hpp>
|
| | Route ()=delete |
| | create instance.
|
| |
| | ~Route ()=default |
| | destroy instance.
|
| |
| uint32_t | index () const noexcept |
| | get interface index.
|
| |
| const IpAddress & | dest () const noexcept |
| | get the destination network address.
|
| |
| uint32_t | prefix () const noexcept |
| | get the prefix length.
|
| |
| IpAddress | gateway () const |
| | get the gateway address.
|
| |
| uint32_t | metric () const |
| | get the route metric.
|
| |
| uint8_t | type () const |
| | get the route type.
|
| |
| uint8_t | scope () const |
| | get the route scope.
|
| |
| uint8_t | protocol () const |
| | get the route protocol.
|
| |
| bool | isUnicast () const noexcept |
| | check if route is a standard unicast route.
|
| |
| bool | isBlackhole () const noexcept |
| | check if route silently drops packets.
|
| |
| bool | isUnreachable () const noexcept |
| | check if route returns ICMP unreachable.
|
| |
| bool | isProhibit () const noexcept |
| | check if route returns ICMP prohibited.
|
| |
| bool | isLocal () const noexcept |
| | check if route is a local route.
|
| |
| bool | isScopeUniverse () const noexcept |
| | check if route is universe-scoped.
|
| |
| bool | isScopeLink () const noexcept |
| | check if route is link-scoped.
|
| |
| bool | isScopeHost () const noexcept |
| | check if route is host-scoped.
|
| |
| bool | isStatic () const noexcept |
| | check if route was added statically.
|
| |
| bool | isKernel () const noexcept |
| | check if route was added by the kernel.
|
| |
| bool | isDhcp () const noexcept |
| | check if route was added by a DHCP client.
|
| |
| bool | isBoot () const noexcept |
| | check if route was added at boot time.
|
| |
| int | set (const IpAddress &gateway, uint32_t metric=0, bool sync=false) const |
| | update this route entry in the kernel table.
|
| |
| int | remove (bool sync=false) const |
| | remove this route entry from the kernel table.
|
| |
class representing a single kernel routing table entry.
◆ List
◆ Ptr
◆ Route()
◆ ~Route()
◆ dest()
get the destination network address.
- Returns
- destination IP address.
◆ gateway()
get the gateway address.
- Returns
- gateway IP address.
◆ index()
| uint32_t Route::index |
( |
| ) |
const |
|
noexcept |
get interface index.
- Returns
- interface index.
◆ isBlackhole()
| bool Route::isBlackhole |
( |
| ) |
const |
|
noexcept |
check if route silently drops packets.
- Returns
- true if type is RTN_BLACKHOLE.
◆ isBoot()
| bool Route::isBoot |
( |
| ) |
const |
|
noexcept |
check if route was added at boot time.
- Returns
- true if protocol is RTPROT_BOOT.
◆ isDhcp()
| bool Route::isDhcp |
( |
| ) |
const |
|
noexcept |
check if route was added by a DHCP client.
- Returns
- true if protocol is RTPROT_DHCP.
◆ isKernel()
| bool Route::isKernel |
( |
| ) |
const |
|
noexcept |
check if route was added by the kernel.
- Returns
- true if protocol is RTPROT_KERNEL.
◆ isLocal()
| bool Route::isLocal |
( |
| ) |
const |
|
noexcept |
check if route is a local route.
- Returns
- true if type is RTN_LOCAL.
◆ isProhibit()
| bool Route::isProhibit |
( |
| ) |
const |
|
noexcept |
check if route returns ICMP prohibited.
- Returns
- true if type is RTN_PROHIBIT.
◆ isScopeHost()
| bool Route::isScopeHost |
( |
| ) |
const |
|
noexcept |
check if route is host-scoped.
- Returns
- true if scope is RT_SCOPE_HOST.
◆ isScopeLink()
| bool Route::isScopeLink |
( |
| ) |
const |
|
noexcept |
check if route is link-scoped.
- Returns
- true if scope is RT_SCOPE_LINK.
◆ isScopeUniverse()
| bool Route::isScopeUniverse |
( |
| ) |
const |
|
noexcept |
check if route is universe-scoped.
- Returns
- true if scope is RT_SCOPE_UNIVERSE.
◆ isStatic()
| bool Route::isStatic |
( |
| ) |
const |
|
noexcept |
check if route was added statically.
- Returns
- true if protocol is RTPROT_STATIC.
◆ isUnicast()
| bool Route::isUnicast |
( |
| ) |
const |
|
noexcept |
check if route is a standard unicast route.
- Returns
- true if type is RTN_UNICAST.
◆ isUnreachable()
| bool Route::isUnreachable |
( |
| ) |
const |
|
noexcept |
check if route returns ICMP unreachable.
- Returns
- true if type is RTN_UNREACHABLE.
◆ metric()
| uint32_t Route::metric |
( |
| ) |
const |
get the route metric.
- Returns
- metric value.
◆ prefix()
| uint32_t Route::prefix |
( |
| ) |
const |
|
noexcept |
get the prefix length.
- Returns
- prefix length.
◆ protocol()
| uint8_t Route::protocol |
( |
| ) |
const |
get the route protocol.
- Returns
- route protocol.
◆ remove()
| int Route::remove |
( |
bool | sync = false | ) |
const |
remove this route entry from the kernel table.
- Parameters
-
| sync | wait for operation completion if true. |
- Returns
- 0 on success, -1 on failure.
◆ scope()
| uint8_t Route::scope |
( |
| ) |
const |
get the route scope.
- Returns
- route scope.
◆ set()
| int Route::set |
( |
const IpAddress & | gateway, |
|
|
uint32_t | metric = 0, |
|
|
bool | sync = false ) const |
update this route entry in the kernel table.
- Parameters
-
| gateway | new gateway address. |
| metric | new metric value. |
| sync | wait for operation completion if true. |
- Returns
- 0 on success, -1 on failure.
◆ type()
| uint8_t Route::type |
( |
| ) |
const |
get the route type.
- Returns
- route type.
◆ operator<
compare two routes for ordering.
- Parameters
-
| lhs | left side route. |
| rhs | right side route. |
- Returns
- true if lhs is less than rhs.
◆ operator==
compare if two routes are equal.
- Parameters
-
| lhs | left side route. |
| rhs | right side route. |
- Returns
- true if both are equal.
◆ RouteManager
The documentation for this class was generated from the following files: