descriptor

package
v2.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 9, 2019 License: Apache-2.0 Imports: 17 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 kvs.KVScheduler, ifPlugin ifplugin.API, nsPlugin nsplugin.API,
	l3Handler l3linuxcalls.NetlinkAPI, log logging.PluginLogger, goRoutinesCnt int) *ARPDescriptor

NewARPDescriptor creates a new instance of the ARP descriptor.

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) []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.

func (*ARPDescriptor) GetDescriptor

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

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

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 NewRouteDescriptor

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

NewRouteDescriptor creates a new instance of the Route descriptor.

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

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

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

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