Documentation ¶
Index ¶
- Constants
- Variables
- func NewARPDescriptor(scheduler kvs.KVScheduler, ifPlugin ifplugin.API, nsPlugin nsplugin.API, ...) *kvs.KVDescriptor
- func NewRouteDescriptor(scheduler kvs.KVScheduler, ifPlugin ifplugin.API, nsPlugin nsplugin.API, ...) *kvs.KVDescriptor
- type ARPDescriptor
- func (d *ARPDescriptor) Create(key string, arp *l3.ARPEntry) (metadata interface{}, err error)
- func (d *ARPDescriptor) Delete(key string, arp *l3.ARPEntry, metadata interface{}) error
- func (d *ARPDescriptor) Dependencies(key string, arp *l3.ARPEntry) (deps []kvs.Dependency)
- func (d *ARPDescriptor) EquivalentARPs(key string, oldArp, NewArp *l3.ARPEntry) bool
- func (d *ARPDescriptor) Retrieve(correlate []adapter.ARPKVWithMetadata) ([]adapter.ARPKVWithMetadata, error)
- func (d *ARPDescriptor) Update(key string, oldARP, newARP *l3.ARPEntry, oldMetadata interface{}) (newMetadata interface{}, err error)
- func (d *ARPDescriptor) Validate(key string, arp *l3.ARPEntry) (err error)
- type RouteDescriptor
- func (d *RouteDescriptor) Create(key string, route *linux_l3.Route) (metadata interface{}, err error)
- func (d *RouteDescriptor) Delete(key string, route *linux_l3.Route, metadata interface{}) error
- func (d *RouteDescriptor) Dependencies(key string, route *linux_l3.Route) []kvs.Dependency
- func (d *RouteDescriptor) DerivedValues(key string, route *linux_l3.Route) (derValues []kvs.KeyValuePair)
- func (d *RouteDescriptor) EquivalentRoutes(key string, oldRoute, newRoute *linux_l3.Route) bool
- func (d *RouteDescriptor) Retrieve(correlate []adapter.RouteKVWithMetadata) ([]adapter.RouteKVWithMetadata, error)
- func (d *RouteDescriptor) Update(key string, oldRoute, newRoute *linux_l3.Route, oldMetadata interface{}) (newMetadata interface{}, err error)
- func (d *RouteDescriptor) Validate(key string, route *linux_l3.Route) (err error)
Constants ¶
const (
// ARPDescriptorName is the name of the descriptor for Linux ARP entries.
ARPDescriptorName = "linux-arp"
)
const (
// RouteDescriptorName is the name of the descriptor for Linux routes.
RouteDescriptorName = "linux-route"
)
Variables ¶
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:
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.
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 ¶
func (d *RouteDescriptor) Retrieve(correlate []adapter.RouteKVWithMetadata) ([]adapter.RouteKVWithMetadata, error)
Retrieve returns all routes associated with interfaces managed by this agent.