{"modulePath":"github.com/EMnify/vpp-agent","version":"v1.4.1","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package aclplugin\n\nPackage aclplugin implements the ACL Plugin that handles management of VPP Access lists.\n\n## Constants\n\n```go\nconst (\n\tINGRESS = \"ingress\"\n\tEGRESS  = \"egress\"\n\tL2      = \"l2\"\n)\n```\nInterface attribute according to the configuration\n\n## Types\n\n```go\ntype ACLConfigurator struct {\n\tLog            logging.Logger\n\tGoVppmux       govppmux.API\n\tACLL3L4Indexes aclidx.AclIndexRW\n\tACLL2Indexes   aclidx.AclIndexRW // mapping for L2 ACLs\n\tSwIfIndexes    ifaceidx.SwIfIndex\n\tStopwatch      *measure.Stopwatch // timer used to measure and store time\n\n\tACLIfCache []*ACLIfCacheEntry // cache for ACL un-configured interfaces\n\t// contains filtered or unexported fields\n}\n```\nACLConfigurator runs in the background in its own goroutine where it watches for any changes in the configuration of ACLs as modelled by the proto file \"../model/acl/acl.proto\" and stored in ETCD under the key \"/vnf-agent/{agent-label}/vpp/config/v1/acl/\". 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 *ACLConfigurator) Close() error\n```\nClose GOVPP channel.\n\n```go\nfunc (plugin *ACLConfigurator) ConfigureACL(acl *acl.AccessLists_Acl) error\n```\nConfigureACL creates access list with provided rules and sets this list to every relevant interface.\n\n```go\nfunc (plugin *ACLConfigurator) DeleteACL(acl *acl.AccessLists_Acl) (err error)\n```\nDeleteACL removes existing ACL. To detach ACL from interfaces, list of interfaces has to be provided.\n\n```go\nfunc (plugin *ACLConfigurator) DumpACL() (acls []*acl.AccessLists_Acl, err error)\n```\nDumpACL returns all configured ACLs in proto format\n\n```go\nfunc (plugin *ACLConfigurator) Init() (err error)\n```\nInit goroutines, channels and mappings.\n\n```go\nfunc (plugin *ACLConfigurator) ModifyACL(oldACL, newACL *acl.AccessLists_Acl) (err error)\n```\nModifyACL modifies previously created access list. L2 access list is removed and recreated, L3/L4 access list is modified directly. List of interfaces is refreshed as well.\n\n```go\nfunc (plugin *ACLConfigurator) ResolveCreatedInterface(ifName string, ifIdx uint32) error\n```\nResolveCreatedInterface configures new interface for every ACL found in cache\n\n```go\nfunc (plugin *ACLConfigurator) ResolveDeletedInterface(ifName string, ifIdx uint32) error\n```\nResolveDeletedInterface puts removed interface to cache, including acl index. Note: it's not needed to remove ACL from interface manually, VPP handles it itself and such an behavior would cause errors (ACLs cannot be dumped from non-existing interface)\n\n```go\nfunc (plugin *ACLConfigurator) Resync(nbACLs []*acl.AccessLists_Acl, log logging.Logger) error\n```\nResync writes ACLs to the empty VPP.\n\n```go\ntype ACLIfCacheEntry struct {\n\t// contains filtered or unexported fields\n}\n```\nACLIfCacheEntry contains info about interface, aclID and whether it is MAC IP address. Used as a cache for missing interfaces while configuring ACL\n\n","path":"github.com/EMnify/vpp-agent/plugins/defaultplugins/aclplugin","name":"aclplugin","synopsis":"Package aclplugin implements the ACL Plugin that handles management of VPP Access lists.","isRedistributable":true}
