{"modulePath":"github.com/EMnify/vpp-agent","version":"v1.4.1","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package l3plugin\n\nPackage l3plugin implements the L3 plugin that handles L3 FIBs.\n\n## Functions\n\n```go\nfunc TransformRoute(routeInput *l3.StaticRoutes_Route, swIndex uint32, log logging.Logger) (*vppcalls.Route, error)\n```\nTransformRoute converts raw route data to Route object.\n\n## Types\n\n```go\ntype ArpConfigurator struct {\n\tLog logging.Logger\n\n\tGoVppmux govppmux.API\n\n\t// ARPIndexes is a list of ARP entries which are successfully configured on the VPP\n\tARPIndexes l3idx.ARPIndexRW\n\t// ARPCache is a list of ARP entries with are present in the ETCD, but not on VPP\n\t// due to missing interface\n\tARPCache l3idx.ARPIndexRW\n\t// ARPDeleted is a list of unsuccessfully deleted ARP entries. ARP entry cannot be removed\n\t// if the interface is missing (it runs into 'unnassigned' state). If the interface re-appears,\n\t// such an ARP have to be removed\n\tARPDeleted l3idx.ARPIndexRW\n\n\tARPIndexSeq uint32\n\tSwIfIndexes ifaceidx.SwIfIndex\n\n\tStopwatch *measure.Stopwatch\n\t// contains filtered or unexported fields\n}\n```\nArpConfigurator 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.\n\n```go\nfunc (plugin *ArpConfigurator) AddArp(entry *l3.ArpTable_ArpEntry) error\n```\nAddArp processes the NB config and propagates it to bin api call\n\n```go\nfunc (plugin *ArpConfigurator) ChangeArp(entry *l3.ArpTable_ArpEntry, prevEntry *l3.ArpTable_ArpEntry) error\n```\nChangeArp processes the NB config and propagates it to bin api call\n\n```go\nfunc (plugin *ArpConfigurator) Close() error\n```\nClose GOVPP channel\n\n```go\nfunc (plugin *ArpConfigurator) DeleteArp(entry *l3.ArpTable_ArpEntry) error\n```\nDeleteArp processes the NB config and propagates it to bin api call\n\n```go\nfunc (plugin *ArpConfigurator) Init() (err error)\n```\nInit initializes ARP configurator\n\n```go\nfunc (plugin *ArpConfigurator) ResolveCreatedInterface(interfaceName string) error\n```\nResolveCreatedInterface handles case when new interface appears in the config\n\n```go\nfunc (plugin *ArpConfigurator) ResolveDeletedInterface(interfaceName string, interfaceIdx uint32) error\n```\nResolveDeletedInterface handles case when interface is removed from the config\n\n```go\nfunc (plugin *ArpConfigurator) Resync(arpEntries []*l3.ArpTable_ArpEntry) error\n```\nResync confgures the empty VPP (overwrites the arp entries)\n\n```go\ntype ProxyArpConfigurator struct {\n\tLog logging.Logger\n\n\tGoVppmux govppmux.API\n\n\t// ProxyArpIndices is a list of proxy ARP interface entries which are successfully configured on the VPP\n\tProxyArpIfIndices idxvpp.NameToIdxRW\n\t// ProxyArpRngIndices is a list of proxy ARP range entries which are successfully configured on the VPP\n\tProxyArpRngIndices idxvpp.NameToIdxRW\n\t// Cached interfaces\n\tProxyARPIfCache []string\n\n\tProxyARPIndexSeq uint32\n\tSwIfIndexes      ifaceidx.SwIfIndex\n\n\tStopwatch *measure.Stopwatch\n\t// contains filtered or unexported fields\n}\n```\nProxyArpConfigurator 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.\n\n```go\nfunc (plugin *ProxyArpConfigurator) AddInterface(pArpIf *l3.ProxyArpInterfaces_InterfaceList) error\n```\n\n```go\nfunc (plugin *ProxyArpConfigurator) AddRange(pArpRng *l3.ProxyArpRanges_RangeList) error\n```\nAddRange configures new IP range for proxy ARP\n\n```go\nfunc (plugin *ProxyArpConfigurator) Close() error\n```\nClose VPP channel\n\n```go\nfunc (plugin *ProxyArpConfigurator) DeleteInterface(pArpIf *l3.ProxyArpInterfaces_InterfaceList) error\n```\nDeleteInterface disables proxy ARP interface or removes it from cache\n\n```go\nfunc (plugin *ProxyArpConfigurator) DeleteRange(pArpRng *l3.ProxyArpRanges_RangeList) error\n```\n\n```go\nfunc (plugin *ProxyArpConfigurator) Init() error\n```\nInit VPP channel and check message compatibility\n\n```go\nfunc (plugin *ProxyArpConfigurator) ModifyInterface(newPArpIf, oldPArpIf *l3.ProxyArpInterfaces_InterfaceList) error\n```\nModifyInterface does nothing\n\n```go\nfunc (plugin *ProxyArpConfigurator) ModifyRange(newPArpRng, oldPArpRng *l3.ProxyArpRanges_RangeList) error\n```\nModifyRange does nothing\n\n```go\nfunc (plugin *ProxyArpConfigurator) ResolveCreatedInterface(ifName string, ifIdx uint32) error\n```\nResolveCreatedInterface handles new registered interface for proxy ARP\n\n```go\nfunc (plugin *ProxyArpConfigurator) ResolveDeletedInterface(ifName string) error\n```\nResolveDeletedInterface handles new registered interface for proxy ARP\n\n```go\nfunc (plugin *ProxyArpConfigurator) ResyncInterfaces(nbProxyArpIfs []*l3.ProxyArpInterfaces_InterfaceList) error\n```\nResync confgures the empty VPP (overwrites the proxy arp entries)\n\n```go\nfunc (plugin *ProxyArpConfigurator) ResyncRanges(nbProxyArpRanges []*l3.ProxyArpRanges_RangeList) error\n```\nResync confgures the empty VPP (overwrites the proxy arp ranges)\n\n```go\ntype RouteConfigurator struct {\n\tLog              logging.Logger\n\tGoVppmux         govppmux.API\n\tRouteIndexes     l3idx.RouteIndexRW\n\tRouteIndexSeq    uint32\n\tSwIfIndexes      ifaceidx.SwIfIndex\n\tRouteCachedIndex l3idx.RouteIndexRW\n\n\tStopwatch *measure.Stopwatch // timer used to measure and store time\n\t// contains filtered or unexported fields\n}\n```\nRouteConfigurator 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.\n\n```go\nfunc (plugin *RouteConfigurator) Close() error\n```\nClose GOVPP channel.\n\n```go\nfunc (plugin *RouteConfigurator) ConfigureRoute(config *l3.StaticRoutes_Route, vrfFromKey string) error\n```\nConfigureRoute processes the NB config and propagates it to bin api calls.\n\n```go\nfunc (plugin *RouteConfigurator) DeleteRoute(config *l3.StaticRoutes_Route, vrfFromKey string) (wasError error)\n```\nDeleteRoute processes the NB config and propagates it to bin api calls.\n\n```go\nfunc (plugin *RouteConfigurator) Init() (err error)\n```\nInit members (channels...) and start go routines.\n\n```go\nfunc (plugin *RouteConfigurator) ModifyRoute(newConfig *l3.StaticRoutes_Route, oldConfig *l3.StaticRoutes_Route, vrfFromKey string) error\n```\nModifyRoute processes the NB config and propagates it to bin api calls.\n\n```go\nfunc (plugin *RouteConfigurator) ResolveCreatedInterface(ifName string, swIdx uint32)\n```\nResolveCreatedInterface is responsible for reconfiguring cached routes and then from removing them from route cache\n\n```go\nfunc (plugin *RouteConfigurator) ResolveDeletedInterface(ifName string, swIdx uint32)\n```\nResolveDeletedInterface is responsible for moving routes of deleted interface to cache\n\n```go\nfunc (plugin *RouteConfigurator) Resync(nbRoutes []*l3.StaticRoutes_Route) error\n```\nResync configures the VPP static routes.\n\n```go\ntype SortedRoutes []*vppcalls.Route\n```\nSortedRoutes type is used to implement sort interface for slice of Route.\n\n```go\nfunc (arr SortedRoutes) Len() int\n```\nReturn length of slice. Implements sort.Interface\n\n```go\nfunc (arr SortedRoutes) Less(i, j int) bool\n```\nLess returns true if the item at index i in slice should be sorted before the element with index j. Implements sort.Interface\n\n```go\nfunc (arr SortedRoutes) Swap(i, j int)\n```\nSwap swaps two items in slice identified by indices. Implements sort.Interface\n\n","path":"github.com/EMnify/vpp-agent/plugins/defaultplugins/l3plugin","name":"l3plugin","synopsis":"Package l3plugin implements the L3 plugin that handles L3 FIBs.","isRedistributable":true}
