Documentation ¶
Overview ¶
Package l3plugin implements the L3 plugin that handles L3 FIBs.
Index ¶
- type ArpConfigurator
- func (c *ArpConfigurator) AddArp(entry *l3.ArpTable_ArpEntry) error
- func (c *ArpConfigurator) ChangeArp(entry *l3.ArpTable_ArpEntry, prevEntry *l3.ArpTable_ArpEntry) error
- func (c *ArpConfigurator) Close() error
- func (c *ArpConfigurator) DeleteArp(entry *l3.ArpTable_ArpEntry) error
- func (c *ArpConfigurator) GetArpCache() l3idx.ARPIndexRW
- func (c *ArpConfigurator) GetArpDeleted() l3idx.ARPIndexRW
- func (c *ArpConfigurator) GetArpIndexes() l3idx.ARPIndexRW
- func (c *ArpConfigurator) Init(logger logging.PluginLogger, goVppMux govppmux.API, ...) (err error)
- func (c *ArpConfigurator) LogError(err error) error
- func (c *ArpConfigurator) ResolveCreatedInterface(ifName string) error
- func (c *ArpConfigurator) ResolveDeletedInterface(interfaceName string, interfaceIdx uint32) error
- func (c *ArpConfigurator) Resync(arpEntries []*l3.ArpTable_ArpEntry) error
- type IPNeighConfigurator
- func (c *IPNeighConfigurator) Close() error
- func (c *IPNeighConfigurator) Init(logger logging.PluginLogger, goVppMux govppmux.API) (err error)
- func (c *IPNeighConfigurator) LogError(err error) error
- func (c *IPNeighConfigurator) Resync(config *l3.IPScanNeighbor) error
- func (c *IPNeighConfigurator) Set(config *l3.IPScanNeighbor) error
- func (c *IPNeighConfigurator) Unset() error
- type ProxyArpConfigurator
- func (c *ProxyArpConfigurator) AddInterface(pArpIf *l3.ProxyArpInterfaces_InterfaceList) error
- func (c *ProxyArpConfigurator) AddRange(pArpRng *l3.ProxyArpRanges_RangeList) error
- func (c *ProxyArpConfigurator) Close() error
- func (c *ProxyArpConfigurator) DeleteInterface(pArpIf *l3.ProxyArpInterfaces_InterfaceList) error
- func (c *ProxyArpConfigurator) DeleteRange(pArpRng *l3.ProxyArpRanges_RangeList) error
- func (c *ProxyArpConfigurator) GetArpIfCache() []string
- func (c *ProxyArpConfigurator) GetArpIfIndexes() idxvpp.NameToIdxRW
- func (c *ProxyArpConfigurator) GetArpRngIndexes() idxvpp.NameToIdxRW
- func (c *ProxyArpConfigurator) Init(logger logging.PluginLogger, goVppMux govppmux.API, ...) (err error)
- func (c *ProxyArpConfigurator) LogError(err error) error
- func (c *ProxyArpConfigurator) ModifyInterface(newPArpIf, oldPArpIf *l3.ProxyArpInterfaces_InterfaceList) error
- func (c *ProxyArpConfigurator) ModifyRange(newPArpRng, oldPArpRng *l3.ProxyArpRanges_RangeList) error
- func (c *ProxyArpConfigurator) ResolveCreatedInterface(ifName string, ifIdx uint32) error
- func (c *ProxyArpConfigurator) ResolveDeletedInterface(ifName string) error
- func (c *ProxyArpConfigurator) ResyncInterfaces(nbProxyArpIfs []*l3.ProxyArpInterfaces_InterfaceList) error
- func (c *ProxyArpConfigurator) ResyncRanges(nbProxyArpRanges []*l3.ProxyArpRanges_RangeList) error
- type RouteConfigurator
- func (c *RouteConfigurator) Close() error
- func (c *RouteConfigurator) ConfigureRoute(route *l3.StaticRoutes_Route, vrfFromKey string) error
- func (c *RouteConfigurator) DeleteRoute(route *l3.StaticRoutes_Route, vrfFromKey string) (wasError error)
- func (c *RouteConfigurator) DiffRoutes(new, old []*l3.StaticRoutes_Route) (toBeDeleted, toBeAdded []*l3.StaticRoutes_Route)
- func (c *RouteConfigurator) GetCachedRouteIndexes() l3idx.RouteIndex
- func (c *RouteConfigurator) GetRouteIndexes() l3idx.RouteIndex
- func (c *RouteConfigurator) Init(logger logging.PluginLogger, goVppMux govppmux.API, ...) (err error)
- func (c *RouteConfigurator) LogError(err error) error
- func (c *RouteConfigurator) ModifyRoute(newConfig *l3.StaticRoutes_Route, oldConfig *l3.StaticRoutes_Route, ...) error
- func (c *RouteConfigurator) ResolveCreatedInterface(ifName string, swIdx uint32) error
- func (c *RouteConfigurator) ResolveDeletedInterface(ifName string, swIdx uint32) error
- func (c *RouteConfigurator) Resync(nbRoutes []*l3.StaticRoutes_Route) error
- type SortedRoutes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArpConfigurator ¶
type ArpConfigurator struct {
// contains filtered or unexported fields
}
ArpConfigurator runs in the background in its own goroutine where it watches for any changes in the configuration of L3 arp entries as modelled by the proto file "../model/l3/l3.proto" and stored in ETCD under the key "/vnf-agent/{vnf-agent}/vpp/config/v1/arp". Updates received from the northbound API are compared with the VPP run-time configuration and differences are applied through the VPP binary API.
func (*ArpConfigurator) AddArp ¶
func (c *ArpConfigurator) AddArp(entry *l3.ArpTable_ArpEntry) error
AddArp processes the NB config and propagates it to bin api call
func (*ArpConfigurator) ChangeArp ¶
func (c *ArpConfigurator) ChangeArp(entry *l3.ArpTable_ArpEntry, prevEntry *l3.ArpTable_ArpEntry) error
ChangeArp processes the NB config and propagates it to bin api call
func (*ArpConfigurator) DeleteArp ¶
func (c *ArpConfigurator) DeleteArp(entry *l3.ArpTable_ArpEntry) error
DeleteArp processes the NB config and propagates it to bin api call
func (*ArpConfigurator) GetArpCache ¶
func (c *ArpConfigurator) GetArpCache() l3idx.ARPIndexRW
GetArpCache exposes list of cached ARP entries (present in ETCD but not in VPP)
func (*ArpConfigurator) GetArpDeleted ¶
func (c *ArpConfigurator) GetArpDeleted() l3idx.ARPIndexRW
GetArpDeleted exposes arppDeleted mapping (unsuccessfully deleted ARP entries)
func (*ArpConfigurator) GetArpIndexes ¶
func (c *ArpConfigurator) GetArpIndexes() l3idx.ARPIndexRW
GetArpIndexes exposes arpIndexes mapping
func (*ArpConfigurator) Init ¶
func (c *ArpConfigurator) Init(logger logging.PluginLogger, goVppMux govppmux.API, swIfIndexes ifaceidx.SwIfIndex) (err error)
Init initializes ARP configurator
func (*ArpConfigurator) LogError ¶ added in v1.8.1
func (c *ArpConfigurator) 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 (*ArpConfigurator) ResolveCreatedInterface ¶
func (c *ArpConfigurator) ResolveCreatedInterface(ifName string) error
ResolveCreatedInterface handles case when new interface appears in the config
func (*ArpConfigurator) ResolveDeletedInterface ¶
func (c *ArpConfigurator) ResolveDeletedInterface(interfaceName string, interfaceIdx uint32) error
ResolveDeletedInterface handles case when interface is removed from the config
func (*ArpConfigurator) Resync ¶
func (c *ArpConfigurator) Resync(arpEntries []*l3.ArpTable_ArpEntry) error
Resync confgures the empty VPP (overwrites the arp entries)
type IPNeighConfigurator ¶ added in v1.8.1
type IPNeighConfigurator struct {
// contains filtered or unexported fields
}
IPNeighConfigurator runs in the background in its own goroutine where it watches for any changes in the configuration of L3 IP scan neighbor, as modelled by the proto file "../model/l3/l3.proto" and stored in ETCD under the key "/vnf-agent/{vnf-agent}/vpp/config/v1/ipneigh". Configuration uses single key, since the configuration is global-like.
func (*IPNeighConfigurator) Close ¶ added in v1.8.1
func (c *IPNeighConfigurator) Close() error
Close VPP channel
func (*IPNeighConfigurator) Init ¶ added in v1.8.1
func (c *IPNeighConfigurator) Init(logger logging.PluginLogger, goVppMux govppmux.API) (err error)
Init VPP channel and vppcalls handler
func (*IPNeighConfigurator) LogError ¶ added in v1.8.1
func (c *IPNeighConfigurator) 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 (*IPNeighConfigurator) Resync ¶ added in v1.8.1
func (c *IPNeighConfigurator) Resync(config *l3.IPScanNeighbor) error
Resync configures the empty VPP (adds IP scan neigh config)
func (*IPNeighConfigurator) Set ¶ added in v1.8.1
func (c *IPNeighConfigurator) Set(config *l3.IPScanNeighbor) error
Set puts desired IP scan neighbor configuration to the VPP
func (*IPNeighConfigurator) Unset ¶ added in v1.8.1
func (c *IPNeighConfigurator) Unset() error
Unset returns IP scan neighbor configuration to default
type ProxyArpConfigurator ¶
type ProxyArpConfigurator struct {
// contains filtered or unexported fields
}
ProxyArpConfigurator runs in the background in its own goroutine where it watches for any changes in the configuration of L3 proxy arp entries as modelled by the proto file "../model/l3/l3.proto" and stored in ETCD under the key "/vnf-agent/{vnf-agent}/vpp/config/v1/proxyarp". Configuration uses separate keys for proxy arp range and interfaces. Updates received from the northbound API are compared with the VPP run-time configuration and differences are applied through the VPP binary API.
func (*ProxyArpConfigurator) AddInterface ¶
func (c *ProxyArpConfigurator) AddInterface(pArpIf *l3.ProxyArpInterfaces_InterfaceList) error
AddInterface implements proxy arp handler.
func (*ProxyArpConfigurator) AddRange ¶
func (c *ProxyArpConfigurator) AddRange(pArpRng *l3.ProxyArpRanges_RangeList) error
AddRange configures new IP range for proxy ARP
func (*ProxyArpConfigurator) DeleteInterface ¶
func (c *ProxyArpConfigurator) DeleteInterface(pArpIf *l3.ProxyArpInterfaces_InterfaceList) error
DeleteInterface disables proxy ARP interface or removes it from cache
func (*ProxyArpConfigurator) DeleteRange ¶
func (c *ProxyArpConfigurator) DeleteRange(pArpRng *l3.ProxyArpRanges_RangeList) error
DeleteRange implements proxy arp handler.
func (*ProxyArpConfigurator) GetArpIfCache ¶
func (c *ProxyArpConfigurator) GetArpIfCache() []string
GetArpIfCache exposes list of cached ARP interfaces
func (*ProxyArpConfigurator) GetArpIfIndexes ¶
func (c *ProxyArpConfigurator) GetArpIfIndexes() idxvpp.NameToIdxRW
GetArpIfIndexes exposes list of proxy ARP interface indexes
func (*ProxyArpConfigurator) GetArpRngIndexes ¶
func (c *ProxyArpConfigurator) GetArpRngIndexes() idxvpp.NameToIdxRW
GetArpRngIndexes exposes list of proxy ARP range indexes
func (*ProxyArpConfigurator) Init ¶
func (c *ProxyArpConfigurator) Init(logger logging.PluginLogger, goVppMux govppmux.API, swIfIndexes ifaceidx.SwIfIndex) (err error)
Init VPP channel and vppcalls handler
func (*ProxyArpConfigurator) LogError ¶ added in v1.8.1
func (c *ProxyArpConfigurator) 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 (*ProxyArpConfigurator) ModifyInterface ¶
func (c *ProxyArpConfigurator) ModifyInterface(newPArpIf, oldPArpIf *l3.ProxyArpInterfaces_InterfaceList) error
ModifyInterface does nothing
func (*ProxyArpConfigurator) ModifyRange ¶
func (c *ProxyArpConfigurator) ModifyRange(newPArpRng, oldPArpRng *l3.ProxyArpRanges_RangeList) error
ModifyRange does nothing
func (*ProxyArpConfigurator) ResolveCreatedInterface ¶
func (c *ProxyArpConfigurator) ResolveCreatedInterface(ifName string, ifIdx uint32) error
ResolveCreatedInterface handles new registered interface for proxy ARP
func (*ProxyArpConfigurator) ResolveDeletedInterface ¶
func (c *ProxyArpConfigurator) ResolveDeletedInterface(ifName string) error
ResolveDeletedInterface handles new registered interface for proxy ARP
func (*ProxyArpConfigurator) ResyncInterfaces ¶
func (c *ProxyArpConfigurator) ResyncInterfaces(nbProxyArpIfs []*l3.ProxyArpInterfaces_InterfaceList) error
ResyncInterfaces confgures the empty VPP (overwrites the proxy arp entries)
func (*ProxyArpConfigurator) ResyncRanges ¶
func (c *ProxyArpConfigurator) ResyncRanges(nbProxyArpRanges []*l3.ProxyArpRanges_RangeList) error
ResyncRanges confgures the empty VPP (overwrites the proxy arp ranges)
type RouteConfigurator ¶
type RouteConfigurator struct {
// contains filtered or unexported fields
}
RouteConfigurator runs in the background in its own goroutine where it watches for any changes in the configuration of L3 routes as modelled by the proto file "../model/l3/l3.proto" and stored in ETCD under the key "/vnf-agent/{vnf-agent}/vpp/config/v1routes". Updates received from the northbound API are compared with the VPP run-time configuration and differences are applied through the VPP binary API.
func (*RouteConfigurator) ConfigureRoute ¶
func (c *RouteConfigurator) ConfigureRoute(route *l3.StaticRoutes_Route, vrfFromKey string) error
ConfigureRoute processes the NB config and propagates it to bin api calls.
func (*RouteConfigurator) DeleteRoute ¶
func (c *RouteConfigurator) DeleteRoute(route *l3.StaticRoutes_Route, vrfFromKey string) (wasError error)
DeleteRoute processes the NB config and propagates it to bin api calls.
func (*RouteConfigurator) DiffRoutes ¶ added in v1.8.1
func (c *RouteConfigurator) DiffRoutes(new, old []*l3.StaticRoutes_Route) (toBeDeleted, toBeAdded []*l3.StaticRoutes_Route)
DiffRoutes calculates route diff from two sets of routes and returns routes to be added and removed
func (*RouteConfigurator) GetCachedRouteIndexes ¶
func (c *RouteConfigurator) GetCachedRouteIndexes() l3idx.RouteIndex
GetCachedRouteIndexes exposes rtCachedIndexes mapping
func (*RouteConfigurator) GetRouteIndexes ¶
func (c *RouteConfigurator) GetRouteIndexes() l3idx.RouteIndex
GetRouteIndexes exposes rtIndexes mapping
func (*RouteConfigurator) Init ¶
func (c *RouteConfigurator) Init(logger logging.PluginLogger, goVppMux govppmux.API, swIfIndexes ifaceidx.SwIfIndex) (err error)
Init members (channels...) and start go routines.
func (*RouteConfigurator) LogError ¶ added in v1.8.1
func (c *RouteConfigurator) 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 (*RouteConfigurator) ModifyRoute ¶
func (c *RouteConfigurator) ModifyRoute(newConfig *l3.StaticRoutes_Route, oldConfig *l3.StaticRoutes_Route, vrfFromKey string) error
ModifyRoute processes the NB config and propagates it to bin api calls.
func (*RouteConfigurator) ResolveCreatedInterface ¶
func (c *RouteConfigurator) ResolveCreatedInterface(ifName string, swIdx uint32) error
ResolveCreatedInterface is responsible for reconfiguring cached routes and then from removing them from route cache
func (*RouteConfigurator) ResolveDeletedInterface ¶
func (c *RouteConfigurator) ResolveDeletedInterface(ifName string, swIdx uint32) error
ResolveDeletedInterface is responsible for moving routes of deleted interface to cache
func (*RouteConfigurator) Resync ¶
func (c *RouteConfigurator) Resync(nbRoutes []*l3.StaticRoutes_Route) error
Resync configures the VPP static routes.
type SortedRoutes ¶
type SortedRoutes []*l3.StaticRoutes_Route
SortedRoutes type is used to implement sort interface for slice of Route.
func (SortedRoutes) Len ¶
func (arr SortedRoutes) Len() int
Return length of slice. Implements sort.Interface
func (SortedRoutes) Less ¶
func (arr SortedRoutes) Less(i, j int) bool
Less returns true if the item at index i in slice should be sorted before the element with index j. Implements sort.Interface
func (SortedRoutes) Swap ¶
func (arr SortedRoutes) Swap(i, j int)
Swap swaps two items in slice identified by indices. Implements sort.Interface