Documentation ¶
Index ¶
- func ArpIdentifier(arp *netlink.Neigh) string
- func RouteIdentifier(route *netlink.Route) string
- type ArpToInterface
- type LinuxArpConfigurator
- func (c *LinuxArpConfigurator) Close() error
- func (c *LinuxArpConfigurator) ConfigureLinuxStaticArpEntry(arpEntry *l3.LinuxStaticArpEntries_ArpEntry) error
- func (c *LinuxArpConfigurator) DeleteLinuxStaticArpEntry(arpEntry *l3.LinuxStaticArpEntries_ArpEntry) (err error)
- func (c *LinuxArpConfigurator) GetArpIndexes() l3idx.LinuxARPIndexRW
- func (c *LinuxArpConfigurator) GetArpInterfaceCache() map[string]*ArpToInterface
- func (c *LinuxArpConfigurator) Init(logger logging.PluginLogger, l3Handler linuxcalls.NetlinkAPI, ...) error
- func (c *LinuxArpConfigurator) LogError(err error) error
- func (c *LinuxArpConfigurator) LookupLinuxArpEntries() error
- func (c *LinuxArpConfigurator) ModifyLinuxStaticArpEntry(newArpEntry *l3.LinuxStaticArpEntries_ArpEntry, ...) (err error)
- func (c *LinuxArpConfigurator) ResolveCreatedInterface(ifName string, ifIdx uint32) error
- func (c *LinuxArpConfigurator) ResolveDeletedInterface(ifName string, ifIdx uint32) error
- func (c *LinuxArpConfigurator) Resync(arpEntries []*l3.LinuxStaticArpEntries_ArpEntry) error
- type LinuxRouteConfigurator
- func (c *LinuxRouteConfigurator) Close() error
- func (c *LinuxRouteConfigurator) ConfigureLinuxStaticRoute(route *l3.LinuxStaticRoutes_Route) error
- func (c *LinuxRouteConfigurator) DeleteLinuxStaticRoute(route *l3.LinuxStaticRoutes_Route) error
- func (c *LinuxRouteConfigurator) GetAutoRouteIndexes() l3idx.LinuxRouteIndexRW
- func (c *LinuxRouteConfigurator) GetCachedGatewayRoutes() map[string]*l3.LinuxStaticRoutes_Route
- func (c *LinuxRouteConfigurator) GetCachedRoutes() l3idx.LinuxRouteIndexRW
- func (c *LinuxRouteConfigurator) GetRouteIndexes() l3idx.LinuxRouteIndexRW
- func (c *LinuxRouteConfigurator) Init(logger logging.PluginLogger, l3Handler linuxcalls.NetlinkAPI, ...) error
- func (c *LinuxRouteConfigurator) LogError(err error) error
- func (c *LinuxRouteConfigurator) ModifyLinuxStaticRoute(newRoute *l3.LinuxStaticRoutes_Route, oldRoute *l3.LinuxStaticRoutes_Route) error
- func (c *LinuxRouteConfigurator) ResolveCreatedInterface(ifName string, ifIdx uint32) error
- func (c *LinuxRouteConfigurator) ResolveDeletedInterface(ifName string, ifIdx uint32) error
- func (c *LinuxRouteConfigurator) Resync(nbRoutes []*l3.LinuxStaticRoutes_Route) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArpIdentifier ¶
ArpIdentifier generates unique ARP ID used in mapping
Types ¶
type ArpToInterface ¶
type ArpToInterface struct {
// contains filtered or unexported fields
}
ArpToInterface is an object which stores ARP-to-interface pairs used in cache. Field 'isAdd' marks whether the entry should be added or removed
type LinuxArpConfigurator ¶
type LinuxArpConfigurator struct {
// contains filtered or unexported fields
}
LinuxArpConfigurator watches for any changes in the configuration of static ARPs as modelled by the proto file "model/l3/l3.proto" and stored in ETCD under the key "/vnf-agent/{vnf-agent}/linux/config/v1/arp". Updates received from the northbound API are compared with the Linux network configuration and differences are applied through the Netlink AP
func (*LinuxArpConfigurator) Close ¶
func (c *LinuxArpConfigurator) Close() error
Close closes all goroutines started during Init
func (*LinuxArpConfigurator) ConfigureLinuxStaticArpEntry ¶
func (c *LinuxArpConfigurator) ConfigureLinuxStaticArpEntry(arpEntry *l3.LinuxStaticArpEntries_ArpEntry) error
ConfigureLinuxStaticArpEntry reacts to a new northbound Linux ARP entry config by creating and configuring the entry in the host network stack through Netlink API.
func (*LinuxArpConfigurator) DeleteLinuxStaticArpEntry ¶
func (c *LinuxArpConfigurator) DeleteLinuxStaticArpEntry(arpEntry *l3.LinuxStaticArpEntries_ArpEntry) (err error)
DeleteLinuxStaticArpEntry reacts to a removed NB configuration of a Linux ARP entry.
func (*LinuxArpConfigurator) GetArpIndexes ¶
func (c *LinuxArpConfigurator) GetArpIndexes() l3idx.LinuxARPIndexRW
GetArpIndexes returns arp in-memory indexes
func (*LinuxArpConfigurator) GetArpInterfaceCache ¶
func (c *LinuxArpConfigurator) GetArpInterfaceCache() map[string]*ArpToInterface
GetArpInterfaceCache returns internal non-configurable interface cache, mainly for testing purpose
func (*LinuxArpConfigurator) Init ¶
func (c *LinuxArpConfigurator) Init(logger logging.PluginLogger, l3Handler linuxcalls.NetlinkAPI, nsHandler nsplugin.NamespaceAPI, arpIndexes l3idx.LinuxARPIndexRW, ifIndexes ifaceidx.LinuxIfIndexRW) error
Init initializes ARP configurator and starts goroutines
func (*LinuxArpConfigurator) LogError ¶
func (c *LinuxArpConfigurator) LogError(err error) error
LogError prints error if not nil, including stack trace. The same value is also returned, so it can be easily propagated further
func (*LinuxArpConfigurator) LookupLinuxArpEntries ¶
func (c *LinuxArpConfigurator) LookupLinuxArpEntries() error
LookupLinuxArpEntries reads all ARP entries from all interfaces and registers them if needed
func (*LinuxArpConfigurator) ModifyLinuxStaticArpEntry ¶
func (c *LinuxArpConfigurator) ModifyLinuxStaticArpEntry(newArpEntry *l3.LinuxStaticArpEntries_ArpEntry, oldArpEntry *l3.LinuxStaticArpEntries_ArpEntry) (err error)
ModifyLinuxStaticArpEntry applies changes in the NB configuration of a Linux ARP through Netlink API.
func (*LinuxArpConfigurator) ResolveCreatedInterface ¶
func (c *LinuxArpConfigurator) ResolveCreatedInterface(ifName string, ifIdx uint32) error
ResolveCreatedInterface resolves a new linux interface from ARP perspective
func (*LinuxArpConfigurator) ResolveDeletedInterface ¶
func (c *LinuxArpConfigurator) ResolveDeletedInterface(ifName string, ifIdx uint32) error
ResolveDeletedInterface resolves removed linux interface from ARP perspective
func (*LinuxArpConfigurator) Resync ¶
func (c *LinuxArpConfigurator) Resync(arpEntries []*l3.LinuxStaticArpEntries_ArpEntry) error
Resync configures an initial set of ARPs. Existing Linux ARPs are registered and potentially re-configured.
type LinuxRouteConfigurator ¶
type LinuxRouteConfigurator struct {
// contains filtered or unexported fields
}
LinuxRouteConfigurator watches for any changes in the configuration of static routes as modelled by the proto file "model/l3/l3.proto" and stored in ETCD under the key "/vnf-agent/{vnf-agent}/linux/config/v1/route". Updates received from the northbound API are compared with the Linux network configuration and differences are applied through the Netlink AP
func (*LinuxRouteConfigurator) Close ¶
func (c *LinuxRouteConfigurator) Close() error
Close does nothing for route configurator
func (*LinuxRouteConfigurator) ConfigureLinuxStaticRoute ¶
func (c *LinuxRouteConfigurator) ConfigureLinuxStaticRoute(route *l3.LinuxStaticRoutes_Route) error
ConfigureLinuxStaticRoute reacts to a new northbound Linux static route config by creating and configuring the route in the host network stack through Netlink API.
func (*LinuxRouteConfigurator) DeleteLinuxStaticRoute ¶
func (c *LinuxRouteConfigurator) DeleteLinuxStaticRoute(route *l3.LinuxStaticRoutes_Route) error
DeleteLinuxStaticRoute reacts to a removed NB configuration of a Linux static route entry.
func (*LinuxRouteConfigurator) GetAutoRouteIndexes ¶
func (c *LinuxRouteConfigurator) GetAutoRouteIndexes() l3idx.LinuxRouteIndexRW
GetAutoRouteIndexes returns automatic route in-memory indexes
func (*LinuxRouteConfigurator) GetCachedGatewayRoutes ¶
func (c *LinuxRouteConfigurator) GetCachedGatewayRoutes() map[string]*l3.LinuxStaticRoutes_Route
GetCachedGatewayRoutes returns in-memory indexes of unreachable gateway routes
func (*LinuxRouteConfigurator) GetCachedRoutes ¶
func (c *LinuxRouteConfigurator) GetCachedRoutes() l3idx.LinuxRouteIndexRW
GetCachedRoutes returns cached route in-memory indexes
func (*LinuxRouteConfigurator) GetRouteIndexes ¶
func (c *LinuxRouteConfigurator) GetRouteIndexes() l3idx.LinuxRouteIndexRW
GetRouteIndexes returns route in-memory indexes
func (*LinuxRouteConfigurator) Init ¶
func (c *LinuxRouteConfigurator) Init(logger logging.PluginLogger, l3Handler linuxcalls.NetlinkAPI, nsHandler nsplugin.NamespaceAPI, rtIndexes l3idx.LinuxRouteIndexRW, ifIndexes ifaceidx.LinuxIfIndexRW) error
Init initializes static route configurator and starts goroutines
func (*LinuxRouteConfigurator) LogError ¶
func (c *LinuxRouteConfigurator) LogError(err error) error
LogError prints error if not nil, including stack trace. The same value is also returned, so it can be easily propagated further
func (*LinuxRouteConfigurator) ModifyLinuxStaticRoute ¶
func (c *LinuxRouteConfigurator) ModifyLinuxStaticRoute(newRoute *l3.LinuxStaticRoutes_Route, oldRoute *l3.LinuxStaticRoutes_Route) error
ModifyLinuxStaticRoute applies changes in the NB configuration of a Linux static route into the host network stack through Netlink API.
func (*LinuxRouteConfigurator) ResolveCreatedInterface ¶
func (c *LinuxRouteConfigurator) ResolveCreatedInterface(ifName string, ifIdx uint32) error
ResolveCreatedInterface manages static routes for new interface. Linux interface also creates its own route which can make other routes accessible and ready to create - the case is also resolved here.
func (*LinuxRouteConfigurator) ResolveDeletedInterface ¶
func (c *LinuxRouteConfigurator) ResolveDeletedInterface(ifName string, ifIdx uint32) error
ResolveDeletedInterface manages static routes for removed interface
func (*LinuxRouteConfigurator) Resync ¶
func (c *LinuxRouteConfigurator) Resync(nbRoutes []*l3.LinuxStaticRoutes_Route) error
Resync configures an initial set of static routes. Existing Linux static routes are registered and potentially re-configured. Resync does not remove any linux route.
Directories ¶
Path | Synopsis |
---|---|
Package l3idx implements name-to-index mapping registry and cache for Linux static arp entries and static routes.
|
Package l3idx implements name-to-index mapping registry and cache for Linux static arp entries and static routes. |