descriptor

package
v2.0.0-alpha+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2018 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ARPDescriptorName is the name of the descriptor for Linux ARP entries.
	ARPDescriptorName = "linux-arp"
)
View Source
const (
	// RouteDescriptorName is the name of the descriptor for Linux routes.
	RouteDescriptorName = "linux-route"
)

Variables

View Source
var (
	// ErrARPWithoutInterface is returned when Linux ARP configuration is missing
	// interface reference.
	ErrARPWithoutInterface = errors.New("Linux ARP entry defined without interface reference")

	// ErrARPWithoutIP is returned when Linux ARP configuration is missing IP address.
	ErrARPWithoutIP = errors.New("Linux ARP entry defined without IP address")

	// ErrARPWithInvalidIP is returned when Linux ARP configuration contains IP address that cannot be parsed.
	ErrARPWithInvalidIP = errors.New("Linux ARP entry defined with invalid IP address")

	// ErrARPWithoutHwAddr is returned when Linux ARP configuration is missing
	// MAC address.
	ErrARPWithoutHwAddr = errors.New("Linux ARP entry defined without MAC address")

	// ErrARPWithInvalidHwAddr is returned when Linux ARP configuration contains MAC address that cannot be parsed.
	ErrARPWithInvalidHwAddr = errors.New("Linux ARP entry defined with invalid MAC address")
)

A list of non-retriable errors:

View Source
var (
	// ErrRouteWithoutInterface is returned when Linux Route configuration is missing
	// outgoing interface reference.
	ErrRouteWithoutInterface = errors.New("Linux Route defined without outgoing interface reference")

	// ErrRouteWithoutDestination is returned when Linux Route configuration is missing destination network.
	ErrRouteWithoutDestination = errors.New("Linux Route defined without destination network")

	// ErrRouteWithUndefinedScope is returned when Linux Route is configured without scope.
	ErrRouteWithUndefinedScope = errors.New("Linux Route defined without scope")

	// ErrRouteWithInvalidDst is returned when Linux Route configuration contains destination
	// network that cannot be parsed.
	ErrRouteWithInvalidDst = errors.New("Linux Route defined with invalid destination network")

	// ErrRouteWithInvalidGW is returned when Linux Route configuration contains gateway
	// address that cannot be parsed.
	ErrRouteWithInvalidGw = errors.New("Linux Route defined with invalid GW address")

	// ErrRouteLinkWithGw is returned when link-local Linux route has gateway address
	// specified - it shouldn't be since destination is already neighbour by definition.
	ErrRouteLinkWithGw = errors.New("Link-local Linux Route was defined with non-empty GW address")
)

A list of non-retriable errors:

Functions

This section is empty.

Types

type ARPDescriptor

type ARPDescriptor struct {
	// contains filtered or unexported fields
}

ARPDescriptor teaches KVScheduler how to configure Linux ARP entries.

func NewARPDescriptor

func NewARPDescriptor(
	scheduler scheduler.KVScheduler, ifPlugin ifplugin.API, nsPlugin nsplugin.API,
	l3Handler l3linuxcalls.NetlinkAPI, log logging.PluginLogger) *ARPDescriptor

NewARPDescriptor creates a new instance of the ARP descriptor.

func (*ARPDescriptor) Add

func (d *ARPDescriptor) Add(key string, arp *l3.LinuxStaticARPEntry) (metadata interface{}, err error)

Add creates ARP entry.

func (*ARPDescriptor) Delete

func (d *ARPDescriptor) Delete(key string, arp *l3.LinuxStaticARPEntry, metadata interface{}) error

Delete removes ARP entry.

func (*ARPDescriptor) Dependencies

func (d *ARPDescriptor) Dependencies(key string, arp *l3.LinuxStaticARPEntry) []scheduler.Dependency

Dependencies lists dependencies for a Linux ARP entry.

func (*ARPDescriptor) Dump

Dump returns all ARP entries associated with interfaces managed by this agent.

func (*ARPDescriptor) EquivalentARPs

func (d *ARPDescriptor) EquivalentARPs(key string, oldArp, NewArp *l3.LinuxStaticARPEntry) bool

EquivalentARPs is case-insensitive comparison function for l3.LinuxStaticARPEntry.

func (*ARPDescriptor) GetDescriptor

func (d *ARPDescriptor) GetDescriptor() *adapter.ARPDescriptor

GetDescriptor returns descriptor suitable for registration (via adapter) with the KVScheduler.

func (*ARPDescriptor) IsARPKey

func (d *ARPDescriptor) IsARPKey(key string) bool

IsARPKey returns <true> if the key identifies a Linux ARP configuration.

func (*ARPDescriptor) IsRetriableFailure

func (d *ARPDescriptor) IsRetriableFailure(err error) bool

IsRetriableFailure returns <false> for errors related to invalid configuration.

func (*ARPDescriptor) Modify

func (d *ARPDescriptor) Modify(key string, oldARP, newARP *l3.LinuxStaticARPEntry, oldMetadata interface{}) (newMetadata interface{}, err error)

Modify is able to change MAC address of the ARP entry.

type RouteDescriptor

type RouteDescriptor struct {
	// contains filtered or unexported fields
}

RouteDescriptor teaches KVScheduler how to configure Linux routes.

func NewRouteDescriptor

func NewRouteDescriptor(
	scheduler scheduler.KVScheduler, ifPlugin ifplugin.API, nsPlugin nsplugin.API,
	l3Handler l3linuxcalls.NetlinkAPI, log logging.PluginLogger) *RouteDescriptor

NewRouteDescriptor creates a new instance of the Route descriptor.

func (*RouteDescriptor) Add

func (d *RouteDescriptor) Add(key string, route *l3.LinuxStaticRoute) (metadata interface{}, err error)

Add adds Linux route.

func (*RouteDescriptor) Delete

func (d *RouteDescriptor) Delete(key string, route *l3.LinuxStaticRoute, metadata interface{}) error

Delete removes Linux route.

func (*RouteDescriptor) Dependencies

func (d *RouteDescriptor) Dependencies(key string, route *l3.LinuxStaticRoute) []scheduler.Dependency

Dependencies lists dependencies for a Linux route.

func (*RouteDescriptor) DerivedValues

func (d *RouteDescriptor) DerivedValues(key string, route *l3.LinuxStaticRoute) (derValues []scheduler.KeyValuePair)

DerivedValues derives empty value under StaticLinkLocalRouteKey if route is link-local. It is used in dependencies for network reachability of a route gateway (see above).

func (*RouteDescriptor) Dump

Dump returns all routes associated with interfaces managed by this agent.

func (*RouteDescriptor) EquivalentRoutes

func (d *RouteDescriptor) EquivalentRoutes(key string, oldRoute, newRoute *l3.LinuxStaticRoute) bool

EquivalentRoutes is case-insensitive comparison function for l3.LinuxStaticRoute.

func (*RouteDescriptor) GetDescriptor

func (d *RouteDescriptor) GetDescriptor() *adapter.RouteDescriptor

GetDescriptor returns descriptor suitable for registration (via adapter) with the KVScheduler.

func (*RouteDescriptor) IsRetriableFailure

func (d *RouteDescriptor) IsRetriableFailure(err error) bool

IsRetriableFailure returns <false> for errors related to invalid configuration.

func (*RouteDescriptor) IsRouteKey

func (d *RouteDescriptor) IsRouteKey(key string) bool

IsRouteKey returns <true> if the key identifies a Linux Route configuration.

func (*RouteDescriptor) Modify

func (d *RouteDescriptor) Modify(key string, oldRoute, newRoute *l3.LinuxStaticRoute, oldMetadata interface{}) (newMetadata interface{}, err error)

Modify is able to change route scope, metric and GW address.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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