go.ligato.io/vpp-agent/v3@v3.5.0/plugins/govppmux/vppcalls/vpp2202/vppcalls_handler.go (about)

     1  //  Copyright (c) 2022 Cisco and/or its affiliates.
     2  //
     3  //  Licensed under the Apache License, Version 2.0 (the "License");
     4  //  you may not use this file except in compliance with the License.
     5  //  You may obtain a copy of the License at:
     6  //
     7  //      http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  //  Unless required by applicable law or agreed to in writing, software
    10  //  distributed under the License is distributed on an "AS IS" BASIS,
    11  //  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  //  See the License for the specific language governing permissions and
    13  //  limitations under the License.
    14  
    15  package vpp2202
    16  
    17  import (
    18  	"go.ligato.io/vpp-agent/v3/plugins/govppmux/vppcalls"
    19  	"go.ligato.io/vpp-agent/v3/plugins/vpp"
    20  	"go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2202"
    21  	"go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2202/memclnt"
    22  	"go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2202/vlib"
    23  	"go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2202/vpe"
    24  )
    25  
    26  func init() {
    27  	msgs := vpp.Messages(
    28  		vpe.AllMessages,
    29  		memclnt.AllMessages,
    30  		vlib.AllMessages,
    31  	)
    32  	vppcalls.AddVersion(vpp2202.Version, msgs.AllMessages(), NewVpeHandler)
    33  }
    34  
    35  type VpeHandler struct {
    36  	memclnt memclnt.RPCService
    37  	vlib    vlib.RPCService
    38  	vpe     vpe.RPCService
    39  }
    40  
    41  func NewVpeHandler(c vpp.Client) vppcalls.VppCoreAPI {
    42  	return &VpeHandler{
    43  		memclnt: memclnt.NewServiceClient(c),
    44  		vlib:    vlib.NewServiceClient(c),
    45  		vpe:     vpe.NewServiceClient(c),
    46  	}
    47  }