{"modulePath":"github.com/EMnify/vpp-agent","version":"v1.4.1","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package defaultplugins\n\nPackage defaultplugins is the parent package for all \"default\" VPP-related plugins.\n\n## Types\n\n```go\ntype API interface {\n\n\t// DisableResync for one or more VPP plugins. Use in Init() phase.\n\tDisableResync(keyPrefix ...string)\n\n\t// GetSwIfIndexes gives access to mapping of logical names (used in ETCD configuration) to sw_if_index.\n\t// This mapping is helpful if other plugins need to configure VPP by the Binary API that uses sw_if_index input.\n\t//\n\t// Example of is_sw_index lookup by logical name of the port \"vswitch_ingres\" of the network interface:\n\t//\n\t//   func Init() error {\n\t//      swIfIndexes := defaultplugins.GetSwIfIndexes()\n\t//      swIfIndexes.LookupByName(\"vswitch_ingres\")\n\t//\n\tGetSwIfIndexes() ifaceidx.SwIfIndex\n\n\t// GetSwIfIndexes gives access to mapping of logical names (used in ETCD configuration) to dhcp_index.\n\t// This mapping is helpful if other plugins need to know about the DHCP configuration given to interface.\n\tGetDHCPIndices() ifaceidx.DhcpIndex\n\n\t// GetBfdSessionIndexes gives access to mapping of logical names (used in ETCD configuration) to bfd_session_indexes.\n\t// The mapping consists of the interface (its name), generated index and the BFDSessionMeta with an authentication key\n\t// used for the particular session.\n\tGetBfdSessionIndexes() idxvpp.NameToIdx\n\n\t// GetBfdAuthKeyIndexes gives access to mapping of logical names (used in ETCD configuration) to bfd_auth_keys.\n\t// The authentication key has its own unique ID - the value is as a string stored in the mapping. Unique index is generated\n\t// uint32 number.\n\tGetBfdAuthKeyIndexes() idxvpp.NameToIdx\n\n\t// GetBfdEchoFunctionIndexes gives access to mapping of logical names (used in ETCD configuration) to bfd_echo_function\n\t// The echo function uses the interface name as an unique ID - this value is as a string stored in the mapping. The index\n\t// is generated uint32 number.\n\tGetBfdEchoFunctionIndexes() idxvpp.NameToIdx\n\n\t// GetBDIndexes gives access to mapping of logical names (used in ETCD configuration) as bd_indexes. The mapping consists\n\t// from the unique Bridge domain name and the bridge domain ID.\n\tGetBDIndexes() l2idx.BDIndex\n\n\t// GetFIBIndexes gives access to mapping of logical names (used in ETCD configuration) as fib_indexes. The FIB's physical\n\t// address is the name in the mapping. The key is generated. The FIB mapping also contains a metadata, FIBMeta with various\n\t// info about the Interface/Bridge domain where this fib belongs to:\n\t// - InterfaceName\n\t// - Bridge domain name\n\t// - BVI (bool flag for interface)\n\t// - Static config\n\tGetFIBIndexes() l2idx.FIBIndexRW\n\n\t// GetXConnectIndexes gives access to mapping of logical names (used in ETCD configuration) as xc_indexes. The mapping\n\t// uses the name and the index of receive interface (the one all packets are received on). XConnectMeta is a container\n\t// for the transmit interface name.\n\tGetXConnectIndexes() l2idx.XcIndexRW\n\n\t// GetAppNsIndexes gives access to mapping of app-namespace logical names (used in ETCD configuration)\n\t// to their respective indices as assigned by VPP.\n\tGetAppNsIndexes() nsidx.AppNsIndex\n\n\t// DumpACL returns a list of all configured ACLs.\n\tDumpACL() (acls []*acl.AccessLists_Acl, err error)\n\n\t// DumpNat44Global returns the current NAT44 global config\n\tDumpNat44Global() (*nat.Nat44Global, error)\n\n\t// DumpNat44DNat returns the current NAT44 DNAT config\n\tDumpNat44DNat() (*nat.Nat44DNat, error)\n\n\t// GetIPSecSAIndexes\n\tGetIPSecSAIndexes() idxvpp.NameToIdx\n\n\t// GetIPSecSPDIndexes\n\tGetIPSecSPDIndexes() idxvpp.NameToIdx\n}\n```\nAPI of VPP Plugin\n\n```go\ntype DPConfig struct {\n\tMtu              uint32   `json:\"mtu\"`\n\tStopwatch        bool     `json:\"stopwatch\"`\n\tStrategy         string   `json:\"strategy\"`\n\tStatusPublishers []string `json:\"status-publishers\"`\n}\n```\nDPConfig holds the defaultpluigns configuration.\n\n```go\ntype DataResyncReq struct {\n\t// ACLs is a list af all access lists that are expected to be in VPP after RESYNC.\n\tACLs []*acl.AccessLists_Acl\n\t// Interfaces is a list af all interfaces that are expected to be in VPP after RESYNC.\n\tInterfaces []*interfaces.Interfaces_Interface\n\t// SingleHopBFDSession is a list af all BFD sessions that are expected to be in VPP after RESYNC.\n\tSingleHopBFDSession []*bfd.SingleHopBFD_Session\n\t// SingleHopBFDKey is a list af all BFD authentication keys that are expected to be in VPP after RESYNC.\n\tSingleHopBFDKey []*bfd.SingleHopBFD_Key\n\t// SingleHopBFDEcho is a list af all BFD echo functions that are expected to be in VPP after RESYNC.\n\tSingleHopBFDEcho []*bfd.SingleHopBFD_EchoFunction\n\t// BridgeDomains is a list af all BDs that are expected to be in VPP after RESYNC.\n\tBridgeDomains []*l2.BridgeDomains_BridgeDomain\n\t// FibTableEntries is a list af all FIBs that are expected to be in VPP after RESYNC.\n\tFibTableEntries []*l2.FibTable_FibEntry\n\t// XConnects is a list af all XCons that are expected to be in VPP after RESYNC.\n\tXConnects []*l2.XConnectPairs_XConnectPair\n\t// StaticRoutes is a list af all Static Routes that are expected to be in VPP after RESYNC.\n\tStaticRoutes []*l3.StaticRoutes_Route\n\t// ArpEntries is a list af all ARP entries that are expected to be in VPP after RESYNC.\n\tArpEntries []*l3.ArpTable_ArpEntry\n\t// ProxyArpInterfaces is a list af all proxy ARP interface entries that are expected to be in VPP after RESYNC.\n\tProxyArpInterfaces []*l3.ProxyArpInterfaces_InterfaceList\n\t// ProxyArpRanges is a list af all proxy ARP ranges that are expected to be in VPP after RESYNC.\n\tProxyArpRanges []*l3.ProxyArpRanges_RangeList\n\t// L4Features is a bool flag that is expected to be set in VPP after RESYNC.\n\tL4Features *l4.L4Features\n\t// AppNamespaces is a list af all App Namespaces that are expected to be in VPP after RESYNC.\n\tAppNamespaces []*l4.AppNamespaces_AppNamespace\n\t// StnRules is a list of all STN Rules that are expected to be in VPP after RESYNC\n\tStnRules []*stn.STN_Rule\n\t// NatGlobal is a definition of global NAT config\n\tNat44Global *nat.Nat44Global\n\t// Nat44SNat is a list of all SNAT configurations expected to be in VPP after RESYNC\n\tNat44SNat []*nat.Nat44SNat_SNatConfig\n\t// Nat44DNat is a list of all DNAT configurations expected to be in VPP after RESYNC\n\tNat44DNat []*nat.Nat44DNat_DNatConfig\n\t// IPSecSPDs is a list of all IPSec Security Policy Databases expected to be in VPP after RESYNC\n\tIPSecSPDs []*ipsec.SecurityPolicyDatabases_SPD\n\t// IPSecSAs is a list of all IPSec Security Associations expected to be in VPP after RESYNC\n\tIPSecSAs []*ipsec.SecurityAssociations_SA\n\t// IPSecTunnels is a list of all IPSec Tunnel interfaces expected to be in VPP after RESYNC\n\tIPSecTunnels []*ipsec.TunnelInterfaces_Tunnel\n\t// LocalSids is a list of all segment routing local SIDs expected to be in VPP after RESYNC\n\tLocalSids []*srv6.LocalSID\n\t// SrPolicies is a list of all segment routing policies expected to be in VPP after RESYNC\n\tSrPolicies []*srv6.Policy\n\t// SrPolicySegments is a list of all segment routing policy segments (with identifiable name) expected to be in VPP after RESYNC\n\tSrPolicySegments []*srplugin.NamedPolicySegment\n\t// SrSteerings is a list of all segment routing steerings (with identifiable name) expected to be in VPP after RESYNC\n\tSrSteerings []*srplugin.NamedSteering\n}\n```\nDataResyncReq is used to transfer expected configuration of the VPP to the plugins.\n\n```go\nfunc NewDataResyncReq() *DataResyncReq\n```\nNewDataResyncReq is a constructor.\n\n```go\ntype Deps struct {\n\t// inject all below\n\tlocal.PluginInfraDeps\n\n\tPublish           datasync.KeyProtoValWriter\n\tPublishStatistics datasync.KeyProtoValWriter\n\tWatch             datasync.KeyValProtoWatcher\n\tIfStatePub        datasync.KeyProtoValWriter\n\tGoVppmux          govppmux.API\n\tLinux             linuxpluginAPI\n\tGRPCSvc           rpc.GRPCService\n\n\tDataSyncs        map[string]datasync.KeyProtoValWriter\n\tWatchEventsMutex *sync.Mutex\n}\n```\nDeps groups injected dependencies of plugin so that they do not mix with other plugin fieldsMtu.\n\n```go\ntype ErrCtx struct {\n\t// contains filtered or unexported fields\n}\n```\nErrCtx is an error context struct which stores an event change with object identifier (name, etc.) and returns an error (can be nil).\n\n```go\ntype Plugin struct {\n\tDeps\n\t// contains filtered or unexported fields\n}\n```\nPlugin implements Plugin interface, therefore it can be loaded with other plugins.\n\n```go\nfunc (plugin *Plugin) AfterInit() error\n```\nAfterInit delegates the call to ifStateUpdater.\n\n```go\nfunc (plugin *Plugin) Close() error\n```\nClose cleans up the resources.\n\n```go\nfunc (plugin *Plugin) DisableResync(keyPrefix ...string)\n```\nDisableResync can be used to disable resync for one or more key prefixes\n\n```go\nfunc (plugin *Plugin) DumpACL() (acls []*acl.AccessLists_Acl, err error)\n```\nDumpACL returns a list of all configured ACL entires\n\n```go\nfunc (plugin *Plugin) DumpNat44DNat() (*nat.Nat44DNat, error)\n```\nDumpNat44DNat returns the current NAT44 DNAT config\n\n```go\nfunc (plugin *Plugin) DumpNat44Global() (*nat.Nat44Global, error)\n```\nDumpNat44Global returns the current NAT44 global config\n\n```go\nfunc (plugin *Plugin) GetAppNsIndexes() nsidx.AppNsIndex\n```\nGetAppNsIndexes gives access to mapping of app-namespace logical names (used in ETCD configuration) to their respective indices as assigned by VPP.\n\n```go\nfunc (plugin *Plugin) GetBDIndexes() l2idx.BDIndex\n```\nGetBDIndexes gives access to mapping of logical names (used in ETCD configuration) as bd\\_indexes.\n\n```go\nfunc (plugin *Plugin) GetBfdAuthKeyIndexes() idxvpp.NameToIdx\n```\nGetBfdAuthKeyIndexes gives access to mapping of logical names (used in ETCD configuration) to bfd\\_auth\\_keys.\n\n```go\nfunc (plugin *Plugin) GetBfdEchoFunctionIndexes() idxvpp.NameToIdx\n```\nGetBfdEchoFunctionIndexes gives access to mapping of logical names (used in ETCD configuration) to bfd\\_echo\\_function\n\n```go\nfunc (plugin *Plugin) GetBfdSessionIndexes() idxvpp.NameToIdx\n```\nGetBfdSessionIndexes gives access to mapping of logical names (used in ETCD configuration) to bfd\\_session\\_indexes.\n\n```go\nfunc (plugin *Plugin) GetDHCPIndices() ifaceidx.DhcpIndex\n```\nGetDHCPIndices gives access to mapping of logical names (used in ETCD configuration) to dhcp\\_index. This mapping is helpful if other plugins need to know about the DHCP configuration set by VPP.\n\n```go\nfunc (plugin *Plugin) GetFIBIndexes() l2idx.FIBIndexRW\n```\nGetFIBIndexes gives access to mapping of logical names (used in ETCD configuration) as fib\\_indexes.\n\n```go\nfunc (plugin *Plugin) GetIPSecSAIndexes() idxvpp.NameToIdx\n```\nGetIPSecSAIndexes\n\n```go\nfunc (plugin *Plugin) GetIPSecSPDIndexes() idxvpp.NameToIdx\n```\nGetIPSecSPDIndexes\n\n```go\nfunc (plugin *Plugin) GetSwIfIndexes() ifaceidx.SwIfIndex\n```\nGetSwIfIndexes gives access to mapping of logical names (used in ETCD configuration) to sw\\_if\\_index. This mapping is helpful if other plugins need to configure VPP by the Binary API that uses sw\\_if\\_index input.\n\n```go\nfunc (plugin *Plugin) GetXConnectIndexes() l2idx.XcIndexRW\n```\nGetXConnectIndexes gives access to mapping of logical names (used in ETCD configuration) as xc\\_indexes.\n\n```go\nfunc (plugin *Plugin) Init() error\n```\nInit gets handlers for ETCD and Messaging and delegates them to ifConfigurator \u0026 ifStateUpdater.\n\n","path":"github.com/EMnify/vpp-agent/plugins/defaultplugins","name":"defaultplugins","synopsis":"Package defaultplugins is the parent package for all \"default\" VPP-related plugins.","isRedistributable":true}
