rttables

package
v3.0.0-rc21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 1, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Index

func Index(name string) (int, error)

Types

type L

type L []T

func List

func List() (L, error)

List parses routing table files and returns a list of routing table entries (L). It scans predefined file paths sequentially.

Extract from man ip-route:

Route tables: Linux-2.x can pack routes into several routing tables identified by a number in the range
from 1 to 2^32-1 or by name from /usr/share/iproute2/rt_tables or /etc/iproute2/rt_tables (has precedence
if exists).

TODO: add support for rt_tables.d ? (also use <CONF_USR_DIR>/iproute2/rt_tables.d/X.conf files unless <CONF_ETC_DIR>/iproute2/rt_tables.d/X.conf exists)

func (L) ByName

func (t L) ByName(name string) (T, error)

type T

type T struct {
	Index int
	Name  string
}

func ByName

func ByName(name string) (T, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL