Documentation ¶
Overview ¶
Package route contains the OS specific route manipulation implementation.
Index ¶
Constants ¶
View Source
const ( // MetadataRouteDestination is the destination of the route to the metadata // server. MetadataRouteDestination = "169.254.169.254" // MetadataRouteGateway is the gateway of the route to the metadata server. MetadataRouteGateway = "0.0.0.0" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Handle ¶
type Handle struct { // Destination is the destination of the route. Destination *address.IPAddr // Gateway is the gateway of the route. Gateway *address.IPAddr // InterfaceIndex is the interface index of the route. InterfaceIndex uint32 // InterfaceName is the name of the interface the route should be added to. // It's only relevant for linux backend implementation. InterfaceName string // Metric is the metric of the route. Metric uint32 // Type is the type of the route. On linux systems it's the type of the route // (e.g. local, remote, etc). It's only relevant for linux backend // implementation. Type string // Table is the table of the route. It's only relevant for linux backend // implementation. Table string // Persistent indicates whether the route is persistent. It's mostly relevant // for windows backend implementation. Persistent bool // Proto is the proto of the route. It's only relevant for linux backend // implementation. Proto string // Source is the source of the route. It's only relevant for linux backend // implementation. Source *address.IPAddr // Scope is the scope of the route. It's only relevant for linux backend // implementation. Scope string }
Handle represents a network route.
func MissingRoutes ¶
func MissingRoutes(ctx context.Context, iface string, wantedRoutes address.IPAddressMap) ([]Handle, error)
MissingRoutes given a map of wanted routes addresses returns the routes that are missing from the system.
type Options ¶
type Options struct { // Type is the type of the route. Type string // Table is the table of the route. Table string // Scope is the scope of the route. Scope string // Proto is the proto of the route. Proto string // Device is the device of the route. Device string }
Options wraps route operations options.
Click to show internal directories.
Click to hide internal directories.