descriptor

package
v2.5.0-alpha+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2019 License: Apache-2.0 Imports: 22 Imported by: 9

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")

	// 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")

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

	// 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

func NewARPDescriptor

func NewARPDescriptor(
	scheduler kvs.KVScheduler, ifPlugin ifplugin.API, nsPlugin nsplugin.API, addrAlloc netalloc.AddressAllocator,
	l3Handler l3linuxcalls.NetlinkAPI, log logging.PluginLogger, goRoutinesCnt int) *kvs.KVDescriptor

NewARPDescriptor creates a new instance of the ARP descriptor.

func NewRouteDescriptor

func NewRouteDescriptor(
	scheduler kvs.KVScheduler, ifPlugin ifplugin.API, nsPlugin nsplugin.API, addrAlloc netalloc.AddressAllocator,
	l3Handler l3linuxcalls.NetlinkAPI, log logging.PluginLogger, goRoutinesCnt int) *kvs.KVDescriptor

NewRouteDescriptor creates a new instance of the Route descriptor.

Types

type ARPDescriptor

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

ARPDescriptor teaches KVScheduler how to configure Linux ARP entries.

func (*ARPDescriptor) Create

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

Create creates ARP entry.

func (*ARPDescriptor) Delete

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

Delete removes ARP entry.

func (*ARPDescriptor) Dependencies

func (d *ARPDescriptor) Dependencies(key string, arp *l3.ARPEntry) (deps []kvs.Dependency)

Dependencies lists dependencies for a Linux ARP entry.

func (*ARPDescriptor) EquivalentARPs

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

EquivalentARPs is case-insensitive comparison function for l3.LinuxARPEntry. Only MAC addresses are compared - interface and IP address are part of the key which is already given to be the same for the two values.

func (*ARPDescriptor) Retrieve

func (d *ARPDescriptor) Retrieve(correlate []adapter.ARPKVWithMetadata) ([]adapter.ARPKVWithMetadata, error)

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

func (*ARPDescriptor) Update

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

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

func (*ARPDescriptor) Validate

func (d *ARPDescriptor) Validate(key string, arp *l3.ARPEntry) (err error)

Validate validates ARP entry configuration.

type RouteDescriptor

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

RouteDescriptor teaches KVScheduler how to configure Linux routes.

func (*RouteDescriptor) Create

func (d *RouteDescriptor) Create(key string, route *linux_l3.Route) (metadata interface{}, err error)

Create adds Linux route.

func (*RouteDescriptor) Delete

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

Delete removes Linux route.

func (*RouteDescriptor) Dependencies

func (d *RouteDescriptor) Dependencies(key string, route *linux_l3.Route) []kvs.Dependency

Dependencies lists dependencies for a Linux route.

func (*RouteDescriptor) DerivedValues

func (d *RouteDescriptor) DerivedValues(key string, route *linux_l3.Route) (derValues []kvs.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) EquivalentRoutes

func (d *RouteDescriptor) EquivalentRoutes(key string, oldRoute, newRoute *linux_l3.Route) bool

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

func (*RouteDescriptor) Retrieve

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

func (*RouteDescriptor) Update

func (d *RouteDescriptor) Update(key string, oldRoute, newRoute *linux_l3.Route, oldMetadata interface{}) (newMetadata interface{}, err error)

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

func (*RouteDescriptor) Validate

func (d *RouteDescriptor) Validate(key string, route *linux_l3.Route) (err error)

Validate validates static route configuration.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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