Skip to content

Commit

Permalink
initialize abf plugin handler in configurator (#1371)
Browse files Browse the repository at this point in the history
Signed-off-by: Vladimir Lavor <[email protected]>
  • Loading branch information
VladoLavor authored and ondrej-fabry committed Jun 5, 2019
1 parent 9cdeed7 commit 840f0ce
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 2 additions & 0 deletions plugins/configurator/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"github.com/ligato/cn-infra/rpc/grpc"
"github.com/ligato/vpp-agent/plugins/govppmux"
"github.com/ligato/vpp-agent/plugins/orchestrator"
"github.com/ligato/vpp-agent/plugins/vpp/aclplugin"
"github.com/ligato/vpp-agent/plugins/vpp/ifplugin"
"github.com/ligato/vpp-agent/plugins/vpp/l2plugin"
)
Expand All @@ -33,6 +34,7 @@ func NewPlugin(opts ...Option) *Plugin {
p.GRPCServer = &grpc.DefaultPlugin
p.Dispatch = &orchestrator.DefaultPlugin
p.GoVppmux = &govppmux.DefaultPlugin
p.VPPACLPlugin = &aclplugin.DefaultPlugin
p.VPPIfPlugin = &ifplugin.DefaultPlugin
p.VPPL2Plugin = &l2plugin.DefaultPlugin

Expand Down
15 changes: 10 additions & 5 deletions plugins/configurator/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import (
"git.fd.io/govpp.git/api"
"github.com/ligato/vpp-agent/api/models/vpp"
"github.com/ligato/vpp-agent/plugins/orchestrator"
abfvppcalls "github.com/ligato/vpp-agent/plugins/vpp/abfplugin/vppcalls"
"github.com/ligato/vpp-agent/plugins/vpp/aclplugin"
ipsecvppcalls "github.com/ligato/vpp-agent/plugins/vpp/ipsecplugin/vppcalls"
puntvppcalls "github.com/ligato/vpp-agent/plugins/vpp/puntplugin/vppcalls"

Expand Down Expand Up @@ -51,11 +53,12 @@ type Plugin struct {
// Deps - dependencies of Plugin
type Deps struct {
infra.PluginDeps
GRPCServer grpc.Server
Dispatch orchestrator.Dispatcher
GoVppmux govppmux.StatsAPI
VPPIfPlugin ifplugin.API
VPPL2Plugin *l2plugin.L2Plugin
GRPCServer grpc.Server
Dispatch orchestrator.Dispatcher
GoVppmux govppmux.StatsAPI
VPPACLPlugin aclplugin.API
VPPIfPlugin ifplugin.API
VPPL2Plugin *l2plugin.L2Plugin
}

// Init sets plugin child loggers
Expand Down Expand Up @@ -103,11 +106,13 @@ func (p *Plugin) initHandlers() (err error) {
}

// VPP Indexes
aclIndexes := p.VPPACLPlugin.GetACLIndex()
ifIndexes := p.VPPIfPlugin.GetInterfaceIndex()
bdIndexes := p.VPPL2Plugin.GetBDIndex()
dhcpIndexes := p.VPPIfPlugin.GetDHCPIndex()

// Initialize VPP handlers
p.configurator.abfHandler = abfvppcalls.CompatibleABFVppHandler(p.vppChan, p.dumpChan, aclIndexes, ifIndexes, p.Log)
p.configurator.aclHandler = aclvppcalls.CompatibleACLVppHandler(p.vppChan, p.dumpChan, ifIndexes, p.Log)
p.configurator.ifHandler = ifvppcalls.CompatibleInterfaceVppHandler(p.vppChan, p.Log)
p.configurator.natHandler = natvppcalls.CompatibleNatVppHandler(p.vppChan, ifIndexes, dhcpIndexes, p.Log)
Expand Down

0 comments on commit 840f0ce

Please sign in to comment.