Documentation ¶
Overview ¶
Package vpp is the parent package for all "default" VPP-related plugins.
Index ¶
- type API
- type Config
- type DataResyncReq
- type Deps
- type ErrCtx
- type LinuxPluginAPI
- type Option
- type Plugin
- func (plugin *Plugin) AfterInit() error
- func (plugin *Plugin) Close() error
- func (plugin *Plugin) DisableResync(keyPrefix ...string)
- func (plugin *Plugin) DumpIPACL() (acls []*acl.AccessLists_Acl, err error)
- func (plugin *Plugin) DumpMACIPACL() (acls []*acl.AccessLists_Acl, err error)
- func (plugin *Plugin) DumpNat44DNat() (*nat.Nat44DNat, error)
- func (plugin *Plugin) DumpNat44Global() (*nat.Nat44Global, error)
- func (plugin *Plugin) GetAppNsIndexes() nsidx.AppNsIndex
- func (plugin *Plugin) GetBDIndexes() l2idx.BDIndex
- func (plugin *Plugin) GetBfdAuthKeyIndexes() idxvpp.NameToIdx
- func (plugin *Plugin) GetBfdEchoFunctionIndexes() idxvpp.NameToIdx
- func (plugin *Plugin) GetBfdSessionIndexes() idxvpp.NameToIdx
- func (plugin *Plugin) GetDHCPIndices() ifaceidx.DhcpIndex
- func (plugin *Plugin) GetFIBIndexes() l2idx.FIBIndexRW
- func (plugin *Plugin) GetIPSecSAIndexes() idxvpp.NameToIdx
- func (plugin *Plugin) GetIPSecSPDIndexes() ipsecidx.SPDIndex
- func (plugin *Plugin) GetPuntIndexes() puntidx.PuntIndexRW
- func (plugin *Plugin) GetSwIfIndexes() ifaceidx.SwIfIndex
- func (plugin *Plugin) GetXConnectIndexes() l2idx.XcIndexRW
- func (plugin *Plugin) Init() error
- func (plugin *Plugin) SetGRPCNotificationService(notify func(ctx context.Context, notification *intf.InterfaceNotification))
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface { // DisableResync for one or more VPP plugins. Use in Init() phase. DisableResync(keyPrefix ...string) // GetSwIfIndexes 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. // // Example of is_sw_index lookup by logical name of the port "vswitch_ingres" of the network interface: // // func Init() error { // swIfIndexes := vppplugin.GetSwIfIndexes() // swIfIndexes.LookupByName("vswitch_ingres") // GetSwIfIndexes() ifaceidx.SwIfIndex // GetSwIfIndexes 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 given to interface. GetDHCPIndices() ifaceidx.DhcpIndex // GetBfdSessionIndexes gives access to mapping of logical names (used in ETCD configuration) to bfd_session_indexes. // The mapping consists of the interface (its name), generated index and the BFDSessionMeta with an authentication key // used for the particular session. GetBfdSessionIndexes() idxvpp.NameToIdx // GetBfdAuthKeyIndexes gives access to mapping of logical names (used in ETCD configuration) to bfd_auth_keys. // The authentication key has its own unique ID - the value is as a string stored in the mapping. Unique index is generated // uint32 number. GetBfdAuthKeyIndexes() idxvpp.NameToIdx // GetBfdEchoFunctionIndexes gives access to mapping of logical names (used in ETCD configuration) to bfd_echo_function // The echo function uses the interface name as an unique ID - this value is as a string stored in the mapping. The index // is generated uint32 number. GetBfdEchoFunctionIndexes() idxvpp.NameToIdx // GetBDIndexes gives access to mapping of logical names (used in ETCD configuration) as bd_indexes. The mapping consists // from the unique Bridge domain name and the bridge domain ID. GetBDIndexes() l2idx.BDIndex // GetFIBIndexes gives access to mapping of logical names (used in ETCD configuration) as fib_indexes. The FIB's physical // address is the name in the mapping. The key is generated. The FIB mapping also contains a metadata, FIBMeta with various // info about the Interface/Bridge domain where this fib belongs to: // - InterfaceName // - Bridge domain name // - BVI (bool flag for interface) // - Static config GetFIBIndexes() l2idx.FIBIndexRW // GetXConnectIndexes gives access to mapping of logical names (used in ETCD configuration) as xc_indexes. The mapping // uses the name and the index of receive interface (the one all packets are received on). XConnectMeta is a container // for the transmit interface name. GetXConnectIndexes() l2idx.XcIndexRW // GetPuntIndexes gives access to mapping of the punt socket register logical names (used in ETCD configuration) // to their respective indexes. GetPuntIndexes() puntidx.PuntIndexRW // GetAppNsIndexes gives access to mapping of app-namespace logical names (used in ETCD configuration) // to their respective indices as assigned by VPP. GetAppNsIndexes() nsidx.AppNsIndex // DumpIPACL returns a list of all configured IP ACLs. DumpIPACL() (acls []*acl.AccessLists_Acl, err error) // DumpMACIPACL returns a list of all configured MACIP ACLs. DumpMACIPACL() (acls []*acl.AccessLists_Acl, err error) // DumpNat44Global returns the current NAT44 global config DumpNat44Global() (*nat.Nat44Global, error) // DumpNat44DNat returns the current NAT44 DNAT config DumpNat44DNat() (*nat.Nat44DNat, error) // GetIPSecSAIndexes GetIPSecSAIndexes() idxvpp.NameToIdx // GetIPSecSPDIndexes GetIPSecSPDIndexes() ipsecidx.SPDIndex // SetGRPCNotificationService allows to pass function for updating interface notifications SetGRPCNotificationService(notify func(ctx context.Context, notification *interfaces.InterfaceNotification)) }
API of VPP Plugin
type Config ¶ added in v1.8.1
type Config struct { Mtu uint32 `json:"mtu"` Strategy string `json:"strategy"` StatusPublishers []string `json:"status-publishers"` }
Config holds the vpp-plugin configuration.
type DataResyncReq ¶
type DataResyncReq struct { // ACLs is a list af all access lists that are expected to be in VPP after RESYNC. ACLs []*acl.AccessLists_Acl // Interfaces is a list af all interfaces that are expected to be in VPP after RESYNC. Interfaces []*interfaces.Interfaces_Interface // SingleHopBFDSession is a list af all BFD sessions that are expected to be in VPP after RESYNC. SingleHopBFDSession []*bfd.SingleHopBFD_Session // SingleHopBFDKey is a list af all BFD authentication keys that are expected to be in VPP after RESYNC. SingleHopBFDKey []*bfd.SingleHopBFD_Key // SingleHopBFDEcho is a list af all BFD echo functions that are expected to be in VPP after RESYNC. SingleHopBFDEcho []*bfd.SingleHopBFD_EchoFunction // BridgeDomains is a list af all BDs that are expected to be in VPP after RESYNC. BridgeDomains []*l2.BridgeDomains_BridgeDomain // FibTableEntries is a list af all FIBs that are expected to be in VPP after RESYNC. FibTableEntries []*l2.FibTable_FibEntry // XConnects is a list af all XCons that are expected to be in VPP after RESYNC. XConnects []*l2.XConnectPairs_XConnectPair // StaticRoutes is a list af all Static Routes that are expected to be in VPP after RESYNC. StaticRoutes []*l3.StaticRoutes_Route // ArpEntries is a list af all ARP entries that are expected to be in VPP after RESYNC. ArpEntries []*l3.ArpTable_ArpEntry // ProxyArpInterfaces is a list af all proxy ARP interface entries that are expected to be in VPP after RESYNC. ProxyArpInterfaces []*l3.ProxyArpInterfaces_InterfaceList // ProxyArpRanges is a list af all proxy ARP ranges that are expected to be in VPP after RESYNC. ProxyArpRanges []*l3.ProxyArpRanges_RangeList // IPScanNeigh is a IP scan neighbor config that is expected to be set in VPP after RESYNC. IPScanNeigh *l3.IPScanNeighbor // L4Features is a bool flag that is expected to be set in VPP after RESYNC. L4Features *l4.L4Features // AppNamespaces is a list af all App Namespaces that are expected to be in VPP after RESYNC. AppNamespaces []*l4.AppNamespaces_AppNamespace // StnRules is a list of all STN Rules that are expected to be in VPP after RESYNC StnRules []*stn.STN_Rule // NatGlobal is a definition of global NAT config Nat44Global *nat.Nat44Global // Nat44SNat is a list of all SNAT configurations expected to be in VPP after RESYNC Nat44SNat []*nat.Nat44SNat_SNatConfig // Nat44DNat is a list of all DNAT configurations expected to be in VPP after RESYNC Nat44DNat []*nat.Nat44DNat_DNatConfig // Punt is a list of all punt configurations expected to be in VPP after RESYNC Punt []*punt.Punt // IPSecSPDs is a list of all IPSec Security Policy Databases expected to be in VPP after RESYNC IPSecSPDs []*ipsec.SecurityPolicyDatabases_SPD // IPSecSAs is a list of all IPSec Security Associations expected to be in VPP after RESYNC IPSecSAs []*ipsec.SecurityAssociations_SA // IPSecTunnels is a list of all IPSec Tunnel interfaces expected to be in VPP after RESYNC IPSecTunnels []*ipsec.TunnelInterfaces_Tunnel // LocalSids is a list of all segment routing local SIDs expected to be in VPP after RESYNC LocalSids []*srv6.LocalSID // SrPolicies is a list of all segment routing policies expected to be in VPP after RESYNC SrPolicies []*srv6.Policy // SrPolicySegments is a list of all segment routing policy segments (with identifiable name) expected to be in VPP after RESYNC SrPolicySegments []*srplugin.NamedPolicySegment // SrSteerings is a list of all segment routing steerings (with identifiable name) expected to be in VPP after RESYNC SrSteerings []*srplugin.NamedSteering }
DataResyncReq is used to transfer expected configuration of the VPP to the plugins.
type Deps ¶
type Deps struct { infra.PluginDeps StatusCheck statuscheck.PluginStatusWriter ServiceLabel servicelabel.ReaderAPI Publish datasync.KeyProtoValWriter PublishStatistics datasync.KeyProtoValWriter Watcher datasync.KeyValProtoWatcher IfStatePub datasync.KeyProtoValWriter GoVppmux govppmux.StatsAPI Linux LinuxPluginAPI DataSyncs map[string]datasync.KeyProtoValWriter WatchEventsMutex *sync.Mutex }
Deps groups injected dependencies of plugin so that they do not mix with other plugin fieldsMtu.
type ErrCtx ¶
type ErrCtx struct {
// contains filtered or unexported fields
}
ErrCtx is an error context struct which stores an event change with object identifier (name, etc.) and returns an error (can be nil).
type LinuxPluginAPI ¶ added in v1.8.1
type LinuxPluginAPI interface { // IsDisabled returns true if the plugin is disabled. IsDisabled() bool // GetLinuxIfIndexes gives access to mapping of logical names (used in ETCD configuration) to corresponding Linux // interface indexes. This mapping is especially helpful for plugins that need to watch for newly added or deleted // Linux interfaces. GetLinuxIfIndexes() ifaceLinux.LinuxIfIndex // Inject VPP interface indexes directly instead of letting Linux plugin to get them itself, // so they are available at resync time. InjectVppIfIndexes(index ifaceidx.SwIfIndex) }
LinuxPluginAPI is interface for Linux plugin.
type Option ¶ added in v1.8.1
type Option func(*Plugin)
Option is a function that can be used in NewPlugin to customize Plugin.
type Plugin ¶
type Plugin struct { Deps // contains filtered or unexported fields }
Plugin implements Plugin interface, therefore it can be loaded with other plugins.
func (*Plugin) DisableResync ¶
DisableResync can be used to disable resync for one or more key prefixes
func (*Plugin) DumpIPACL ¶
func (plugin *Plugin) DumpIPACL() (acls []*acl.AccessLists_Acl, err error)
DumpIPACL returns a list of all configured IP ACL entires
func (*Plugin) DumpMACIPACL ¶
func (plugin *Plugin) DumpMACIPACL() (acls []*acl.AccessLists_Acl, err error)
DumpMACIPACL returns a list of all configured MACIP ACL entires
func (*Plugin) DumpNat44DNat ¶
DumpNat44DNat returns the current NAT44 DNAT config
func (*Plugin) DumpNat44Global ¶
func (plugin *Plugin) DumpNat44Global() (*nat.Nat44Global, error)
DumpNat44Global returns the current NAT44 global config
func (*Plugin) GetAppNsIndexes ¶
func (plugin *Plugin) GetAppNsIndexes() nsidx.AppNsIndex
GetAppNsIndexes gives access to mapping of app-namespace logical names (used in ETCD configuration) to their respective indices as assigned by VPP.
func (*Plugin) GetBDIndexes ¶
GetBDIndexes gives access to mapping of logical names (used in ETCD configuration) as bd_indexes.
func (*Plugin) GetBfdAuthKeyIndexes ¶
GetBfdAuthKeyIndexes gives access to mapping of logical names (used in ETCD configuration) to bfd_auth_keys.
func (*Plugin) GetBfdEchoFunctionIndexes ¶
GetBfdEchoFunctionIndexes gives access to mapping of logical names (used in ETCD configuration) to bfd_echo_function
func (*Plugin) GetBfdSessionIndexes ¶
GetBfdSessionIndexes gives access to mapping of logical names (used in ETCD configuration) to bfd_session_indexes.
func (*Plugin) GetDHCPIndices ¶
GetDHCPIndices 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.
func (*Plugin) GetFIBIndexes ¶
func (plugin *Plugin) GetFIBIndexes() l2idx.FIBIndexRW
GetFIBIndexes gives access to mapping of logical names (used in ETCD configuration) as fib_indexes.
func (*Plugin) GetIPSecSAIndexes ¶
GetIPSecSAIndexes returns SA indexes.
func (*Plugin) GetIPSecSPDIndexes ¶
GetIPSecSPDIndexes returns SPD indexes.
func (*Plugin) GetPuntIndexes ¶ added in v1.8.1
func (plugin *Plugin) GetPuntIndexes() puntidx.PuntIndexRW
GetPuntIndexes gives access to mapping of logical names (used in ETCD configuration) as punt_indexes.
func (*Plugin) GetSwIfIndexes ¶
GetSwIfIndexes 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.
func (*Plugin) GetXConnectIndexes ¶
GetXConnectIndexes gives access to mapping of logical names (used in ETCD configuration) as xc_indexes.
func (*Plugin) Init ¶
Init gets handlers for ETCD and Messaging and delegates them to ifConfigurator & ifStateUpdater.
func (*Plugin) SetGRPCNotificationService ¶ added in v1.8.1
func (plugin *Plugin) SetGRPCNotificationService(notify func(ctx context.Context, notification *intf.InterfaceNotification))
SetGRPCNotificationService sets GRPC notification function
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package aclplugin implements the ACL Plugin that handles management of VPP Access lists.
|
Package aclplugin implements the ACL Plugin that handles management of VPP Access lists. |
vppcalls
Package vppcalls contains wrappers over VPP ACL binary APIs and helpers to dump ACLs configured in VPP - per interface and total.
|
Package vppcalls contains wrappers over VPP ACL binary APIs and helpers to dump ACLs configured in VPP - per interface and total. |
Package binapi defines southbound API of the default plugins.
|
Package binapi defines southbound API of the default plugins. |
acl
Package acl is a generated from VPP binary API module 'acl'.
|
Package acl is a generated from VPP binary API module 'acl'. |
af_packet
Package af_packet is a generated from VPP binary API module 'af_packet'.
|
Package af_packet is a generated from VPP binary API module 'af_packet'. |
bfd
Package bfd is a generated from VPP binary API module 'bfd'.
|
Package bfd is a generated from VPP binary API module 'bfd'. |
dhcp
Package dhcp is a generated from VPP binary API module 'dhcp'.
|
Package dhcp is a generated from VPP binary API module 'dhcp'. |
interfaces
Package interfaces is a generated from VPP binary API module 'interface'.
|
Package interfaces is a generated from VPP binary API module 'interface'. |
ip
Package ip is a generated from VPP binary API module 'ip'.
|
Package ip is a generated from VPP binary API module 'ip'. |
ipsec
Package ipsec is a generated from VPP binary API module 'ipsec'.
|
Package ipsec is a generated from VPP binary API module 'ipsec'. |
l2
Package l2 is a generated from VPP binary API module 'l2'.
|
Package l2 is a generated from VPP binary API module 'l2'. |
memif
Package memif is a generated from VPP binary API module 'memif'.
|
Package memif is a generated from VPP binary API module 'memif'. |
nat
Package nat is a generated from VPP binary API module 'nat'.
|
Package nat is a generated from VPP binary API module 'nat'. |
punt
Package punt is a generated from VPP binary API module 'punt'.
|
Package punt is a generated from VPP binary API module 'punt'. |
session
Package session is a generated from VPP binary API module 'session'.
|
Package session is a generated from VPP binary API module 'session'. |
sr
Package sr is a generated from VPP binary API module 'sr'.
|
Package sr is a generated from VPP binary API module 'sr'. |
stats
Package stats is a generated from VPP binary API module 'stats'.
|
Package stats is a generated from VPP binary API module 'stats'. |
stn
Package stn is a generated from VPP binary API module 'stn'.
|
Package stn is a generated from VPP binary API module 'stn'. |
tap
Package tap is a generated from VPP binary API module 'tap'.
|
Package tap is a generated from VPP binary API module 'tap'. |
tapv2
Package tapv2 is a generated from VPP binary API module 'tapv2'.
|
Package tapv2 is a generated from VPP binary API module 'tapv2'. |
vmxnet3
Package vmxnet3 is a generated from VPP binary API module 'vmxnet3'.
|
Package vmxnet3 is a generated from VPP binary API module 'vmxnet3'. |
vpe
Package vpe is a generated from VPP binary API module 'vpe'.
|
Package vpe is a generated from VPP binary API module 'vpe'. |
vxlan
Package vxlan is a generated from VPP binary API module 'vxlan'.
|
Package vxlan is a generated from VPP binary API module 'vxlan'. |
Package ifplugin implements the Interface plugin that handles management of VPP interfaces.
|
Package ifplugin implements the Interface plugin that handles management of VPP interfaces. |
ifaceidx
Package ifaceidx implements name-to-index mapping registry and cache for VPP interfaces.
|
Package ifaceidx implements name-to-index mapping registry and cache for VPP interfaces. |
vppcalls
Package vppcalls contains wrappers over VPP binary APIs for all supported interface types and for dumping all interfaces configured in VPP.
|
Package vppcalls contains wrappers over VPP binary APIs for all supported interface types and for dumping all interfaces configured in VPP. |
Package ipsecplugin implements the IPSec plugin that handles management of IPSec for VPP.
|
Package ipsecplugin implements the IPSec plugin that handles management of IPSec for VPP. |
Package l2plugin implements the L2 plugin that handles Bridge Domains and L2 FIBs.
|
Package l2plugin implements the L2 plugin that handles Bridge Domains and L2 FIBs. |
l2idx
Package l2idx implements name-to-index mapping registry and cache for bridge-domains.
|
Package l2idx implements name-to-index mapping registry and cache for bridge-domains. |
vppcalls
Package vppcalls contains wrappers over VPP binary APIs for bridge-domains, and L2 FIBs and XConnect pairs and helpers for dumping them.
|
Package vppcalls contains wrappers over VPP binary APIs for bridge-domains, and L2 FIBs and XConnect pairs and helpers for dumping them. |
Package l3plugin implements the L3 plugin that handles L3 FIBs.
|
Package l3plugin implements the L3 plugin that handles L3 FIBs. |
vppcalls
Package vppcalls contains wrappers over VPP binary APIs for ARPs, proxy ARPs, L3 FIBs and helpers for dumping them.
|
Package vppcalls contains wrappers over VPP binary APIs for ARPs, proxy ARPs, L3 FIBs and helpers for dumping them. |
nsidx
Package nsidx implements name-to-index mapping registry and cache for app namespaces
|
Package nsidx implements name-to-index mapping registry and cache for app namespaces |
Package model defines the northbound API of the default plugins.
|
Package model defines the northbound API of the default plugins. |
rpc
Package rpc is the parent for packages defining various GRPC services generated from protobuf data models.
|
Package rpc is the parent for packages defining various GRPC services generated from protobuf data models. |
cache
Package cache contains caches for certain modeled types.
|
Package cache contains caches for certain modeled types. |
vppcalls
Package vppcalls contains wrappers over VPP binary APIs to simplify their usage
|
Package vppcalls contains wrappers over VPP binary APIs to simplify their usage |