route

package
v0.0.0-...-1e5a665 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseCIDR

func ParseCIDR(cidr string) *net.IPNet

Types

type Route

type Route struct {
	Prefix  net.IPNet
	Nexthop net.IP
}

Route represents a single route

type Table

type Table struct {
	Routes      map[string]net.IP
	SyncCh      chan bool
	DefaultIntf string
	DefaultIP   net.IP
}

Table is a list of routes

func New

func New(syncCh chan bool) *Table

New returns new route table

func (*Table) Exists

func (rt *Table) Exists(route Route) bool

Exists returns true if the route is in the table

func (*Table) String

func (rt *Table) String() string

String returns pretty route table

func (*Table) Update

func (rt *Table) Update(currentRoutes map[string]net.IP) error

Update in-memory route table

Jump to

Keyboard shortcuts

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