diff options
author | Ondrej Fabry <ofabry@cisco.com> | 2019-06-26 16:28:20 +0200 |
---|---|---|
committer | Ondrej Fabry <ofabry@cisco.com> | 2019-06-27 07:33:14 +0200 |
commit | ef471318d66dd2832df4dc929d312f7cd5f7009a (patch) | |
tree | 49dda363eaa7ac3102425aba9f13a503b2a04f48 /examples/binapi/interfaces/interfaces.ba.go | |
parent | da15c397b3dbbba07d159b3af767aa13d443cfd6 (diff) |
Improvements for binapi-generator and support VPP 19.04 in statsclient
- RPC service client implementation for dumps requests
now streams responses
- RPC service generation is now enabled by default
- examples now allow setting binapi socket address
- input dir flag for binapi-generator will recursively look
into dirs to support core/plugins in /usr/share/vpp/api
- minor improvements in debug logs
- add support for VPP 19.04 for statsclient
Change-Id: I0939ee3aa6e9f850d073fc5c87aff4ccc56b0d70
Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Diffstat (limited to 'examples/binapi/interfaces/interfaces.ba.go')
-rw-r--r-- | examples/binapi/interfaces/interfaces.ba.go | 292 |
1 files changed, 155 insertions, 137 deletions
diff --git a/examples/binapi/interfaces/interfaces.ba.go b/examples/binapi/interfaces/interfaces.ba.go index e4ad5f5..958f78e 100644 --- a/examples/binapi/interfaces/interfaces.ba.go +++ b/examples/binapi/interfaces/interfaces.ba.go @@ -1,34 +1,24 @@ -// Code generated by GoVPP binapi-generator. DO NOT EDIT. +// Code generated by GoVPP's binapi-generator. DO NOT EDIT. // source: /usr/share/vpp/api/core/interface.api.json /* -Package interfaces is a generated from VPP binary API module 'interface'. +Package interfaces is a generated VPP binary API for 'interface' module. - The interface module consists of: +It consists of: 1 alias 51 messages 25 services */ package interfaces -import api "git.fd.io/govpp.git/api" -import bytes "bytes" -import context "context" -import strconv "strconv" -import struc "github.com/lunixbochs/struc" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = api.RegisterMessage -var _ = bytes.NewBuffer -var _ = context.Background -var _ = strconv.Itoa -var _ = struc.Pack - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the GoVPP api package it is being compiled against. -// A compilation error at this line likely means your copy of the -// GoVPP api package needs to be updated. -const _ = api.GoVppAPIPackageIsVersion1 // please upgrade the GoVPP api package +import ( + bytes "bytes" + context "context" + api "git.fd.io/govpp.git/api" + struc "github.com/lunixbochs/struc" + io "io" + strconv "strconv" +) const ( // ModuleName is the name of this module. @@ -39,14 +29,10 @@ const ( VersionCrc = 0x672de521 ) -/* Aliases */ - -// InterfaceIndex represents VPP binary API alias 'interface_index': +// InterfaceIndex represents VPP binary API alias 'interface_index'. type InterfaceIndex uint32 -/* Messages */ - -// CollectDetailedInterfaceStats represents VPP binary API message 'collect_detailed_interface_stats': +// CollectDetailedInterfaceStats represents VPP binary API message 'collect_detailed_interface_stats'. type CollectDetailedInterfaceStats struct { SwIfIndex uint32 EnableDisable uint8 @@ -62,7 +48,7 @@ func (*CollectDetailedInterfaceStats) GetMessageType() api.MessageType { return api.RequestMessage } -// CollectDetailedInterfaceStatsReply represents VPP binary API message 'collect_detailed_interface_stats_reply': +// CollectDetailedInterfaceStatsReply represents VPP binary API message 'collect_detailed_interface_stats_reply'. type CollectDetailedInterfaceStatsReply struct { Retval int32 } @@ -77,7 +63,7 @@ func (*CollectDetailedInterfaceStatsReply) GetMessageType() api.MessageType { return api.ReplyMessage } -// CreateLoopback represents VPP binary API message 'create_loopback': +// CreateLoopback represents VPP binary API message 'create_loopback'. type CreateLoopback struct { MacAddress []byte `struc:"[6]byte"` } @@ -92,7 +78,7 @@ func (*CreateLoopback) GetMessageType() api.MessageType { return api.RequestMessage } -// CreateLoopbackInstance represents VPP binary API message 'create_loopback_instance': +// CreateLoopbackInstance represents VPP binary API message 'create_loopback_instance'. type CreateLoopbackInstance struct { MacAddress []byte `struc:"[6]byte"` IsSpecified uint8 @@ -109,7 +95,7 @@ func (*CreateLoopbackInstance) GetMessageType() api.MessageType { return api.RequestMessage } -// CreateLoopbackInstanceReply represents VPP binary API message 'create_loopback_instance_reply': +// CreateLoopbackInstanceReply represents VPP binary API message 'create_loopback_instance_reply'. type CreateLoopbackInstanceReply struct { Retval int32 SwIfIndex uint32 @@ -125,7 +111,7 @@ func (*CreateLoopbackInstanceReply) GetMessageType() api.MessageType { return api.ReplyMessage } -// CreateLoopbackReply represents VPP binary API message 'create_loopback_reply': +// CreateLoopbackReply represents VPP binary API message 'create_loopback_reply'. type CreateLoopbackReply struct { Retval int32 SwIfIndex uint32 @@ -141,7 +127,7 @@ func (*CreateLoopbackReply) GetMessageType() api.MessageType { return api.ReplyMessage } -// CreateSubif represents VPP binary API message 'create_subif': +// CreateSubif represents VPP binary API message 'create_subif'. type CreateSubif struct { SwIfIndex uint32 SubID uint32 @@ -167,7 +153,7 @@ func (*CreateSubif) GetMessageType() api.MessageType { return api.RequestMessage } -// CreateSubifReply represents VPP binary API message 'create_subif_reply': +// CreateSubifReply represents VPP binary API message 'create_subif_reply'. type CreateSubifReply struct { Retval int32 SwIfIndex uint32 @@ -183,7 +169,7 @@ func (*CreateSubifReply) GetMessageType() api.MessageType { return api.ReplyMessage } -// CreateVlanSubif represents VPP binary API message 'create_vlan_subif': +// CreateVlanSubif represents VPP binary API message 'create_vlan_subif'. type CreateVlanSubif struct { SwIfIndex uint32 VlanID uint32 @@ -199,7 +185,7 @@ func (*CreateVlanSubif) GetMessageType() api.MessageType { return api.RequestMessage } -// CreateVlanSubifReply represents VPP binary API message 'create_vlan_subif_reply': +// CreateVlanSubifReply represents VPP binary API message 'create_vlan_subif_reply'. type CreateVlanSubifReply struct { Retval int32 SwIfIndex uint32 @@ -215,7 +201,7 @@ func (*CreateVlanSubifReply) GetMessageType() api.MessageType { return api.ReplyMessage } -// DeleteLoopback represents VPP binary API message 'delete_loopback': +// DeleteLoopback represents VPP binary API message 'delete_loopback'. type DeleteLoopback struct { SwIfIndex uint32 } @@ -230,7 +216,7 @@ func (*DeleteLoopback) GetMessageType() api.MessageType { return api.RequestMessage } -// DeleteLoopbackReply represents VPP binary API message 'delete_loopback_reply': +// DeleteLoopbackReply represents VPP binary API message 'delete_loopback_reply'. type DeleteLoopbackReply struct { Retval int32 } @@ -245,7 +231,7 @@ func (*DeleteLoopbackReply) GetMessageType() api.MessageType { return api.ReplyMessage } -// DeleteSubif represents VPP binary API message 'delete_subif': +// DeleteSubif represents VPP binary API message 'delete_subif'. type DeleteSubif struct { SwIfIndex uint32 } @@ -260,7 +246,7 @@ func (*DeleteSubif) GetMessageType() api.MessageType { return api.RequestMessage } -// DeleteSubifReply represents VPP binary API message 'delete_subif_reply': +// DeleteSubifReply represents VPP binary API message 'delete_subif_reply'. type DeleteSubifReply struct { Retval int32 } @@ -275,7 +261,7 @@ func (*DeleteSubifReply) GetMessageType() api.MessageType { return api.ReplyMessage } -// HwInterfaceSetMtu represents VPP binary API message 'hw_interface_set_mtu': +// HwInterfaceSetMtu represents VPP binary API message 'hw_interface_set_mtu'. type HwInterfaceSetMtu struct { SwIfIndex uint32 Mtu uint16 @@ -291,7 +277,7 @@ func (*HwInterfaceSetMtu) GetMessageType() api.MessageType { return api.RequestMessage } -// HwInterfaceSetMtuReply represents VPP binary API message 'hw_interface_set_mtu_reply': +// HwInterfaceSetMtuReply represents VPP binary API message 'hw_interface_set_mtu_reply'. type HwInterfaceSetMtuReply struct { Retval int32 } @@ -306,7 +292,7 @@ func (*HwInterfaceSetMtuReply) GetMessageType() api.MessageType { return api.ReplyMessage } -// InterfaceNameRenumber represents VPP binary API message 'interface_name_renumber': +// InterfaceNameRenumber represents VPP binary API message 'interface_name_renumber'. type InterfaceNameRenumber struct { SwIfIndex uint32 NewShowDevInstance uint32 @@ -322,7 +308,7 @@ func (*InterfaceNameRenumber) GetMessageType() api.MessageType { return api.RequestMessage } -// InterfaceNameRenumberReply represents VPP binary API message 'interface_name_renumber_reply': +// InterfaceNameRenumberReply represents VPP binary API message 'interface_name_renumber_reply'. type InterfaceNameRenumberReply struct { Retval int32 } @@ -337,7 +323,7 @@ func (*InterfaceNameRenumberReply) GetMessageType() api.MessageType { return api.ReplyMessage } -// SwInterfaceAddDelAddress represents VPP binary API message 'sw_interface_add_del_address': +// SwInterfaceAddDelAddress represents VPP binary API message 'sw_interface_add_del_address'. type SwInterfaceAddDelAddress struct { SwIfIndex uint32 IsAdd uint8 @@ -357,7 +343,7 @@ func (*SwInterfaceAddDelAddress) GetMessageType() api.MessageType { return api.RequestMessage } -// SwInterfaceAddDelAddressReply represents VPP binary API message 'sw_interface_add_del_address_reply': +// SwInterfaceAddDelAddressReply represents VPP binary API message 'sw_interface_add_del_address_reply'. type SwInterfaceAddDelAddressReply struct { Retval int32 } @@ -372,7 +358,7 @@ func (*SwInterfaceAddDelAddressReply) GetMessageType() api.MessageType { return api.ReplyMessage } -// SwInterfaceClearStats represents VPP binary API message 'sw_interface_clear_stats': +// SwInterfaceClearStats represents VPP binary API message 'sw_interface_clear_stats'. type SwInterfaceClearStats struct { SwIfIndex uint32 } @@ -387,7 +373,7 @@ func (*SwInterfaceClearStats) GetMessageType() api.MessageType { return api.RequestMessage } -// SwInterfaceClearStatsReply represents VPP binary API message 'sw_interface_clear_stats_reply': +// SwInterfaceClearStatsReply represents VPP binary API message 'sw_interface_clear_stats_reply'. type SwInterfaceClearStatsReply struct { Retval int32 } @@ -402,7 +388,7 @@ func (*SwInterfaceClearStatsReply) GetMessageType() api.MessageType { return api.ReplyMessage } -// SwInterfaceDetails represents VPP binary API message 'sw_interface_details': +// SwInterfaceDetails represents VPP binary API message 'sw_interface_details'. type SwInterfaceDetails struct { SwIfIndex uint32 SupSwIfIndex uint32 @@ -447,7 +433,7 @@ func (*SwInterfaceDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -// SwInterfaceDump represents VPP binary API message 'sw_interface_dump': +// SwInterfaceDump represents VPP binary API message 'sw_interface_dump'. type SwInterfaceDump struct { NameFilterValid uint8 NameFilter []byte `struc:"[49]byte"` @@ -463,7 +449,7 @@ func (*SwInterfaceDump) GetMessageType() api.MessageType { return api.RequestMessage } -// SwInterfaceEvent represents VPP binary API message 'sw_interface_event': +// SwInterfaceEvent represents VPP binary API message 'sw_interface_event'. type SwInterfaceEvent struct { PID uint32 SwIfIndex uint32 @@ -482,7 +468,7 @@ func (*SwInterfaceEvent) GetMessageType() api.MessageType { return api.EventMessage } -// SwInterfaceGetMacAddress represents VPP binary API message 'sw_interface_get_mac_address': +// SwInterfaceGetMacAddress represents VPP binary API message 'sw_interface_get_mac_address'. type SwInterfaceGetMacAddress struct { SwIfIndex uint32 } @@ -497,7 +483,7 @@ func (*SwInterfaceGetMacAddress) GetMessageType() api.MessageType { return api.RequestMessage } -// SwInterfaceGetMacAddressReply represents VPP binary API message 'sw_interface_get_mac_address_reply': +// SwInterfaceGetMacAddressReply represents VPP binary API message 'sw_interface_get_mac_address_reply'. type SwInterfaceGetMacAddressReply struct { Retval int32 MacAddress []byte `struc:"[6]byte"` @@ -513,7 +499,7 @@ func (*SwInterfaceGetMacAddressReply) GetMessageType() api.MessageType { return api.ReplyMessage } -// SwInterfaceGetTable represents VPP binary API message 'sw_interface_get_table': +// SwInterfaceGetTable represents VPP binary API message 'sw_interface_get_table'. type SwInterfaceGetTable struct { SwIfIndex uint32 IsIPv6 uint8 @@ -529,7 +515,7 @@ func (*SwInterfaceGetTable) GetMessageType() api.MessageType { return api.RequestMessage } -// SwInterfaceGetTableReply represents VPP binary API message 'sw_interface_get_table_reply': +// SwInterfaceGetTableReply represents VPP binary API message 'sw_interface_get_table_reply'. type SwInterfaceGetTableReply struct { Retval int32 VrfID uint32 @@ -545,7 +531,7 @@ func (*SwInterfaceGetTableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -// SwInterfaceRxPlacementDetails represents VPP binary API message 'sw_interface_rx_placement_details': +// SwInterfaceRxPlacementDetails represents VPP binary API message 'sw_interface_rx_placement_details'. type SwInterfaceRxPlacementDetails struct { SwIfIndex uint32 QueueID uint32 @@ -563,7 +549,7 @@ func (*SwInterfaceRxPlacementDetails) GetMessageType() api.MessageType { return api.RequestMessage } -// SwInterfaceRxPlacementDump represents VPP binary API message 'sw_interface_rx_placement_dump': +// SwInterfaceRxPlacementDump represents VPP binary API message 'sw_interface_rx_placement_dump'. type SwInterfaceRxPlacementDump struct { SwIfIndex uint32 } @@ -578,7 +564,7 @@ func (*SwInterfaceRxPlacementDump) GetMessageType() api.MessageType { return api.RequestMessage } -// SwInterfaceSetFlags represents VPP binary API message 'sw_interface_set_flags': +// SwInterfaceSetFlags represents VPP binary API message 'sw_interface_set_flags'. type SwInterfaceSetFlags struct { SwIfIndex uint32 AdminUpDown uint8 @@ -594,7 +580,7 @@ func (*SwInterfaceSetFlags) GetMessageType() api.MessageType { return api.RequestMessage } -// SwInterfaceSetFlagsReply represents VPP binary API message 'sw_interface_set_flags_reply': +// SwInterfaceSetFlagsReply represents VPP binary API message 'sw_interface_set_flags_reply'. type SwInterfaceSetFlagsReply struct { Retval int32 } @@ -609,7 +595,7 @@ func (*SwInterfaceSetFlagsReply) GetMessageType() api.MessageType { return api.ReplyMessage } -// SwInterfaceSetIPDirectedBroadcast represents VPP binary API message 'sw_interface_set_ip_directed_broadcast': +// SwInterfaceSetIPDirectedBroadcast represents VPP binary API message 'sw_interface_set_ip_directed_broadcast'. type SwInterfaceSetIPDirectedBroadcast struct { SwIfIndex uint32 Enable uint8 @@ -625,7 +611,7 @@ func (*SwInterfaceSetIPDirectedBroadcast) GetMessageType() api.MessageType { return api.RequestMessage } -// SwInterfaceSetIPDirectedBroadcastReply represents VPP binary API message 'sw_interface_set_ip_directed_broadcast_reply': +// SwInterfaceSetIPDirectedBroadcastReply represents VPP binary API message 'sw_interface_set_ip_directed_broadcast_reply'. type SwInterfaceSetIPDirectedBroadcastReply struct { Retval int32 } @@ -640,7 +626,7 @@ func (*SwInterfaceSetIPDirectedBroadcastReply) GetMessageType() api.MessageType return api.ReplyMessage } -// SwInterfaceSetMacAddress represents VPP binary API message 'sw_interface_set_mac_address': +// SwInterfaceSetMacAddress represents VPP binary API message 'sw_interface_set_mac_address'. type SwInterfaceSetMacAddress struct { SwIfIndex uint32 MacAddress []byte `struc:"[6]byte"` @@ -656,7 +642,7 @@ func (*SwInterfaceSetMacAddress) GetMessageType() api.MessageType { return api.RequestMessage } -// SwInterfaceSetMacAddressReply represents VPP binary API message 'sw_interface_set_mac_address_reply': +// SwInterfaceSetMacAddressReply represents VPP binary API message 'sw_interface_set_mac_address_reply'. type SwInterfaceSetMacAddressReply struct { Retval int32 } @@ -671,7 +657,7 @@ func (*SwInterfaceSetMacAddressReply) GetMessageType() api.MessageType { return api.ReplyMessage } -// SwInterfaceSetMtu represents VPP binary API message 'sw_interface_set_mtu': +// SwInterfaceSetMtu represents VPP binary API message 'sw_interface_set_mtu'. type SwInterfaceSetMtu struct { SwIfIndex uint32 Mtu []uint32 `struc:"[4]uint32"` @@ -687,7 +673,7 @@ func (*SwInterfaceSetMtu) GetMessageType() api.MessageType { return api.RequestMessage } -// SwInterfaceSetMtuReply represents VPP binary API message 'sw_interface_set_mtu_reply': +// SwInterfaceSetMtuReply represents VPP binary API message 'sw_interface_set_mtu_reply'. type SwInterfaceSetMtuReply struct { Retval int32 } @@ -702,7 +688,7 @@ func (*SwInterfaceSetMtuReply) GetMessageType() api.MessageType { return api.ReplyMessage } -// SwInterfaceSetRxMode represents VPP binary API message 'sw_interface_set_rx_mode': +// SwInterfaceSetRxMode represents VPP binary API message 'sw_interface_set_rx_mode'. type SwInterfaceSetRxMode struct { SwIfIndex uint32 QueueIDValid uint8 @@ -720,7 +706,7 @@ func (*SwInterfaceSetRxMode) GetMessageType() api.MessageType { return api.RequestMessage } -// SwInterfaceSetRxModeReply represents VPP binary API message 'sw_interface_set_rx_mode_reply': +// SwInterfaceSetRxModeReply represents VPP binary API message 'sw_interface_set_rx_mode_reply'. type SwInterfaceSetRxModeReply struct { Retval int32 } @@ -735,7 +721,7 @@ func (*SwInterfaceSetRxModeReply) GetMessageType() api.MessageType { return api.ReplyMessage } -// SwInterfaceSetRxPlacement represents VPP binary API message 'sw_interface_set_rx_placement': +// SwInterfaceSetRxPlacement represents VPP binary API message 'sw_interface_set_rx_placement'. type SwInterfaceSetRxPlacement struct { SwIfIndex uint32 QueueID uint32 @@ -753,7 +739,7 @@ func (*SwInterfaceSetRxPlacement) GetMessageType() api.MessageType { return api.RequestMessage } -// SwInterfaceSetRxPlacementReply represents VPP binary API message 'sw_interface_set_rx_placement_reply': +// SwInterfaceSetRxPlacementReply represents VPP binary API message 'sw_interface_set_rx_placement_reply'. type SwInterfaceSetRxPlacementReply struct { Retval int32 } @@ -768,7 +754,7 @@ func (*SwInterfaceSetRxPlacementReply) GetMessageType() api.MessageType { return api.ReplyMessage } -// SwInterfaceSetTable represents VPP binary API message 'sw_interface_set_table': +// SwInterfaceSetTable represents VPP binary API message 'sw_interface_set_table'. type SwInterfaceSetTable struct { SwIfIndex uint32 IsIPv6 uint8 @@ -785,7 +771,7 @@ func (*SwInterfaceSetTable) GetMessageType() api.MessageType { return api.RequestMessage } -// SwInterfaceSetTableReply represents VPP binary API message 'sw_interface_set_table_reply': +// SwInterfaceSetTableReply represents VPP binary API message 'sw_interface_set_table_reply'. type SwInterfaceSetTableReply struct { Retval int32 } @@ -800,7 +786,7 @@ func (*SwInterfaceSetTableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -// SwInterfaceSetUnnumbered represents VPP binary API message 'sw_interface_set_unnumbered': +// SwInterfaceSetUnnumbered represents VPP binary API message 'sw_interface_set_unnumbered'. type SwInterfaceSetUnnumbered struct { SwIfIndex uint32 UnnumberedSwIfIndex uint32 @@ -817,7 +803,7 @@ func (*SwInterfaceSetUnnumbered) GetMessageType() api.MessageType { return api.RequestMessage } -// SwInterfaceSetUnnumberedReply represents VPP binary API message 'sw_interface_set_unnumbered_reply': +// SwInterfaceSetUnnumberedReply represents VPP binary API message 'sw_interface_set_unnumbered_reply'. type SwInterfaceSetUnnumberedReply struct { Retval int32 } @@ -832,7 +818,7 @@ func (*SwInterfaceSetUnnumberedReply) GetMessageType() api.MessageType { return api.ReplyMessage } -// SwInterfaceTagAddDel represents VPP binary API message 'sw_interface_tag_add_del': +// SwInterfaceTagAddDel represents VPP binary API message 'sw_interface_tag_add_del'. type SwInterfaceTagAddDel struct { IsAdd uint8 SwIfIndex uint32 @@ -849,7 +835,7 @@ func (*SwInterfaceTagAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -// SwInterfaceTagAddDelReply represents VPP binary API message 'sw_interface_tag_add_del_reply': +// SwInterfaceTagAddDelReply represents VPP binary API message 'sw_interface_tag_add_del_reply'. type SwInterfaceTagAddDelReply struct { Retval int32 } @@ -864,7 +850,7 @@ func (*SwInterfaceTagAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -// WantInterfaceEvents represents VPP binary API message 'want_interface_events': +// WantInterfaceEvents represents VPP binary API message 'want_interface_events'. type WantInterfaceEvents struct { EnableDisable uint32 PID uint32 @@ -880,7 +866,7 @@ func (*WantInterfaceEvents) GetMessageType() api.MessageType { return api.RequestMessage } -// WantInterfaceEventsReply represents VPP binary API message 'want_interface_events_reply': +// WantInterfaceEventsReply represents VPP binary API message 'want_interface_events_reply'. type WantInterfaceEventsReply struct { Retval int32 } @@ -1006,10 +992,10 @@ func AllMessages() []api.Message { } } -// Service represents VPP binary API services in interface module. -type Service interface { - DumpSwInterface(ctx context.Context, in *SwInterfaceDump) ([]*SwInterfaceDetails, error) - DumpSwInterfaceRxPlacement(ctx context.Context, in *SwInterfaceRxPlacementDump) ([]*SwInterfaceRxPlacementDetails, error) +// RPCService represents RPC service API for interface module. +type RPCService interface { + DumpSwInterface(ctx context.Context, in *SwInterfaceDump) (RPCService_DumpSwInterfaceClient, error) + DumpSwInterfaceRxPlacement(ctx context.Context, in *SwInterfaceRxPlacementDump) (RPCService_DumpSwInterfaceRxPlacementClient, error) CollectDetailedInterfaceStats(ctx context.Context, in *CollectDetailedInterfaceStats) (*CollectDetailedInterfaceStatsReply, error) CreateLoopback(ctx context.Context, in *CreateLoopback) (*CreateLoopbackReply, error) CreateLoopbackInstance(ctx context.Context, in *CreateLoopbackInstance) (*CreateLoopbackInstanceReply, error) @@ -1035,49 +1021,67 @@ type Service interface { WantInterfaceEvents(ctx context.Context, in *WantInterfaceEvents) (*WantInterfaceEventsReply, error) } -type service struct { +type serviceClient struct { ch api.Channel } -func NewService(ch api.Channel) Service { - return &service{ch} +func NewServiceClient(ch api.Channel) RPCService { + return &serviceClient{ch} +} + +func (c *serviceClient) DumpSwInterface(ctx context.Context, in *SwInterfaceDump) (RPCService_DumpSwInterfaceClient, error) { + stream := c.ch.SendMultiRequest(in) + x := &serviceClient_DumpSwInterfaceClient{stream} + return x, nil +} + +type RPCService_DumpSwInterfaceClient interface { + Recv() (*SwInterfaceDetails, error) +} + +type serviceClient_DumpSwInterfaceClient struct { + api.MultiRequestCtx } -func (c *service) DumpSwInterface(ctx context.Context, in *SwInterfaceDump) ([]*SwInterfaceDetails, error) { - var dump []*SwInterfaceDetails - req := c.ch.SendMultiRequest(in) - for { - m := new(SwInterfaceDetails) - stop, err := req.ReceiveReply(m) - if stop { - break - } - if err != nil { - return nil, err - } - dump = append(dump, m) +func (c *serviceClient_DumpSwInterfaceClient) Recv() (*SwInterfaceDetails, error) { + m := new(SwInterfaceDetails) + stop, err := c.MultiRequestCtx.ReceiveReply(m) + if err != nil { + return nil, err } - return dump, nil -} - -func (c *service) DumpSwInterfaceRxPlacement(ctx context.Context, in *SwInterfaceRxPlacementDump) ([]*SwInterfaceRxPlacementDetails, error) { - var dump []*SwInterfaceRxPlacementDetails - req := c.ch.SendMultiRequest(in) - for { - m := new(SwInterfaceRxPlacementDetails) - stop, err := req.ReceiveReply(m) - if stop { - break - } - if err != nil { - return nil, err - } - dump = append(dump, m) + if stop { + return nil, io.EOF } - return dump, nil + return m, nil } -func (c *service) CollectDetailedInterfaceStats(ctx context.Context, in *CollectDetailedInterfaceStats) (*CollectDetailedInterfaceStatsReply, error) { +func (c *serviceClient) DumpSwInterfaceRxPlacement(ctx context.Context, in *SwInterfaceRxPlacementDump) (RPCService_DumpSwInterfaceRxPlacementClient, error) { + stream := c.ch.SendMultiRequest(in) + x := &serviceClient_DumpSwInterfaceRxPlacementClient{stream} + return x, nil +} + +type RPCService_DumpSwInterfaceRxPlacementClient interface { + Recv() (*SwInterfaceRxPlacementDetails, error) +} + +type serviceClient_DumpSwInterfaceRxPlacementClient struct { + api.MultiRequestCtx +} + +func (c *serviceClient_DumpSwInterfaceRxPlacementClient) Recv() (*SwInterfaceRxPlacementDetails, error) { + m := new(SwInterfaceRxPlacementDetails) + stop, err := c.MultiRequestCtx.ReceiveReply(m) + if err != nil { + return nil, err + } + if stop { + return nil, io.EOF + } + return m, nil +} + +func (c *serviceClient) CollectDetailedInterfaceStats(ctx context.Context, in *CollectDetailedInterfaceStats) (*CollectDetailedInterfaceStatsReply, error) { out := new(CollectDetailedInterfaceStatsReply) err := c.ch.SendRequest(in).ReceiveReply(out) if err != nil { @@ -1086,7 +1090,7 @@ func (c *service) CollectDetailedInterfaceStats(ctx context.Context, in *Collect return out, nil } -func (c *service) CreateLoopback(ctx context.Context, in *CreateLoopback) (*CreateLoopbackReply, error) { +func (c *serviceClient) CreateLoopback(ctx context.Context, in *CreateLoopback) (*CreateLoopbackReply, error) { out := new(CreateLoopbackReply) err := c.ch.SendRequest(in).ReceiveReply(out) if err != nil { @@ -1095,7 +1099,7 @@ func (c *service) CreateLoopback(ctx context.Context, in *CreateLoopback) (*Crea return out, nil } -func (c *service) CreateLoopbackInstance(ctx context.Context, in *CreateLoopbackInstance) (*CreateLoopbackInstanceReply, error) { +func (c *serviceClient) CreateLoopbackInstance(ctx context.Context, in *CreateLoopbackInstance) (*CreateLoopbackInstanceReply, error) { out := new(CreateLoopbackInstanceReply) err := c.ch.SendRequest(in).ReceiveReply(out) if err != nil { @@ -1104,7 +1108,7 @@ func (c *service) CreateLoopbackInstance(ctx context.Context, in *CreateLoopback return out, nil } -func (c *service) CreateSubif(ctx context.Context, in *CreateSubif) (*CreateSubifReply, error) { +func (c *serviceClient) CreateSubif(ctx context.Context, in *CreateSubif) (*CreateSubifReply, error) { out := new(CreateSubifReply) err := c.ch.SendRequest(in).ReceiveReply(out) if err != nil { @@ -1113,7 +1117,7 @@ func (c *service) CreateSubif(ctx context.Context, in *CreateSubif) (*CreateSubi return out, nil } -func (c *service) CreateVlanSubif(ctx context.Context, in *CreateVlanSubif) (*CreateVlanSubifReply, error) { +func (c *serviceClient) CreateVlanSubif(ctx context.Context, in *CreateVlanSubif) (*CreateVlanSubifReply, error) { out := new(CreateVlanSubifReply) err := c.ch.SendRequest(in).ReceiveReply(out) if err != nil { @@ -1122,7 +1126,7 @@ func (c *service) CreateVlanSubif(ctx context.Context, in *CreateVlanSubif) (*Cr return out, nil } -func (c *service) DeleteLoopback(ctx context.Context, in *DeleteLoopback) (*DeleteLoopbackReply, error) { +func (c *serviceClient) DeleteLoopback(ctx context.Context, in *DeleteLoopback) (*DeleteLoopbackReply, error) { out := new(DeleteLoopbackReply) err := c.ch.SendRequest(in).ReceiveReply(out) if err != nil { @@ -1131,7 +1135,7 @@ func (c *service) DeleteLoopback(ctx context.Context, in *DeleteLoopback) (*Dele return out, nil } -func (c *service) DeleteSubif(ctx context.Context, in *DeleteSubif) (*DeleteSubifReply, error) { +func (c *serviceClient) DeleteSubif(ctx context.Context, in *DeleteSubif) (*DeleteSubifReply, error) { out := new(DeleteSubifReply) err := c.ch.SendRequest(in).ReceiveReply(out) if err != nil { @@ -1140,7 +1144,7 @@ func (c *service) DeleteSubif(ctx context.Context, in *DeleteSubif) (*DeleteSubi return out, nil } -func (c *service) HwInterfaceSetMtu(ctx context.Context, in *HwInterfaceSetMtu) (*HwInterfaceSetMtuReply, error) { +func (c *serviceClient) HwInterfaceSetMtu(ctx context.Context, in *HwInterfaceSetMtu) (*HwInterfaceSetMtuReply, error) { out := new(HwInterfaceSetMtuReply) err := c.ch.SendRequest(in).ReceiveReply(out) if err != nil { @@ -1149,7 +1153,7 @@ func (c *service) HwInterfaceSetMtu(ctx context.Context, in *HwInterfaceSetMtu) return out, nil } -func (c *service) InterfaceNameRenumber(ctx context.Context, in *InterfaceNameRenumber) (*InterfaceNameRenumberReply, error) { +func (c *serviceClient) InterfaceNameRenumber(ctx context.Context, in *InterfaceNameRenumber) (*InterfaceNameRenumberReply, error) { out := new(InterfaceNameRenumberReply) err := c.ch.SendRequest(in).ReceiveReply(out) if err != nil { @@ -1158,7 +1162,7 @@ func (c *service) InterfaceNameRenumber(ctx context.Context, in *InterfaceNameRe return out, nil } -func (c *service) SwInterfaceAddDelAddress(ctx context.Context, in *SwInterfaceAddDelAddress) (*SwInterfaceAddDelAddressReply, error) { +func (c *serviceClient) SwInterfaceAddDelAddress(ctx context.Context, in *SwInterfaceAddDelAddress) (*SwInterfaceAddDelAddressReply, error) { out := new(SwInterfaceAddDelAddressReply) err := c.ch.SendRequest(in).ReceiveReply(out) if err != nil { @@ -1167,7 +1171,7 @@ func (c *service) SwInterfaceAddDelAddress(ctx context.Context, in *SwInterfaceA return out, nil } -func (c *service) SwInterfaceClearStats(ctx context.Context, in *SwInterfaceClearStats) (*SwInterfaceClearStatsReply, error) { +func (c *serviceClient) SwInterfaceClearStats(ctx context.Context, in *SwInterfaceClearStats) (*SwInterfaceClearStatsReply, error) { out := new(SwInterfaceClearStatsReply) err := c.ch.SendRequest(in).ReceiveReply(out) if err != nil { @@ -1176,7 +1180,7 @@ func (c *service) SwInterfaceClearStats(ctx context.Context, in *SwInterfaceClea return out, nil } -func (c *service) SwInterfaceGetMacAddress(ctx context.Context, in *SwInterfaceGetMacAddress) (*SwInterfaceGetMacAddressReply, error) { +func (c *serviceClient) SwInterfaceGetMacAddress(ctx context.Context, in *SwInterfaceGetMacAddress) (*SwInterfaceGetMacAddressReply, error) { out := new(SwInterfaceGetMacAddressReply) err := c.ch.SendRequest(in).ReceiveReply(out) if err != nil { @@ -1185,7 +1189,7 @@ func (c *service) SwInterfaceGetMacAddress(ctx context.Context, in *SwInterfaceG return out, nil } -func (c *service) SwInterfaceGetTable(ctx context.Context, in *SwInterfaceGetTable) (*SwInterfaceGetTableReply, error) { +func (c *serviceClient) SwInterfaceGetTable(ctx context.Context, in *SwInterfaceGetTable) (*SwInterfaceGetTableReply, error) { out := new(SwInterfaceGetTableReply) err := c.ch.SendRequest(in).ReceiveReply(out) if err != nil { @@ -1194,7 +1198,7 @@ func (c *service) SwInterfaceGetTable(ctx context.Context, in *SwInterfaceGetTab return out, nil } -func (c *service) SwInterfaceSetFlags(ctx context.Context, in *SwInterfaceSetFlags) (*SwInterfaceSetFlagsReply, error) { +func (c *serviceClient) SwInterfaceSetFlags(ctx context.Context, in *SwInterfaceSetFlags) (*SwInterfaceSetFlagsReply, error) { out := new(SwInterfaceSetFlagsReply) err := c.ch.SendRequest(in).ReceiveReply(out) if err != nil { @@ -1203,7 +1207,7 @@ func (c *service) SwInterfaceSetFlags(ctx context.Context, in *SwInterfaceSetFla return out, nil } -func (c *service) SwInterfaceSetIPDirectedBroadcast(ctx context.Context, in *SwInterfaceSetIPDirectedBroadcast) (*SwInterfaceSetIPDirectedBroadcastReply, error) { +func (c *serviceClient) SwInterfaceSetIPDirectedBroadcast(ctx context.Context, in *SwInterfaceSetIPDirectedBroadcast) (*SwInterfaceSetIPDirectedBroadcastReply, error) { out := new(SwInterfaceSetIPDirectedBroadcastReply) err := c.ch.SendRequest(in).ReceiveReply(out) if err != nil { @@ -1212,7 +1216,7 @@ func (c *service) SwInterfaceSetIPDirectedBroadcast(ctx context.Context, in *SwI return out, nil } -func (c *service) SwInterfaceSetMacAddress(ctx context.Context, in *SwInterfaceSetMacAddress) (*SwInterfaceSetMacAddressReply, error) { +func (c *serviceClient) SwInterfaceSetMacAddress(ctx context.Context, in *SwInterfaceSetMacAddress) (*SwInterfaceSetMacAddressReply, error) { out := new(SwInterfaceSetMacAddressReply) err := c.ch.SendRequest(in).ReceiveReply(out) if err != nil { @@ -1221,7 +1225,7 @@ func (c *service) SwInterfaceSetMacAddress(ctx context.Context, in *SwInterfaceS return out, nil } -func (c *service) SwInterfaceSetMtu(ctx context.Context, in *SwInterfaceSetMtu) (*SwInterfaceSetMtuReply, error) { +func (c *serviceClient) SwInterfaceSetMtu(ctx context.Context, in *SwInterfaceSetMtu) (*SwInterfaceSetMtuReply, error) { out := new(SwInterfaceSetMtuReply) err := c.ch.SendRequest(in).ReceiveReply(out) if err != nil { @@ -1230,7 +1234,7 @@ func (c *service) SwInterfaceSetMtu(ctx context.Context, in *SwInterfaceSetMtu) return out, nil } -func (c *service) SwInterfaceSetRxMode(ctx context.Context, in *SwInterfaceSetRxMode) (*SwInterfaceSetRxModeReply, error) { +func (c *serviceClient) SwInterfaceSetRxMode(ctx context.Context, in *SwInterfaceSetRxMode) (*SwInterfaceSetRxModeReply, error) { out := new(SwInterfaceSetRxModeReply) err := c.ch.SendRequest(in).ReceiveReply(out) if err != nil { @@ -1239,7 +1243,7 @@ func (c *service) SwInterfaceSetRxMode(ctx context.Context, in *SwInterfaceSetRx return out, nil } -func (c *service) SwInterfaceSetRxPlacement(ctx context.Context, in *SwInterfaceSetRxPlacement) (*SwInterfaceSetRxPlacementReply, error) { +func (c *serviceClient) SwInterfaceSetRxPlacement(ctx context.Context, in *SwInterfaceSetRxPlacement) (*SwInterfaceSetRxPlacementReply, error) { out := new(SwInterfaceSetRxPlacementReply) err := c.ch.SendRequest(in).ReceiveReply(out) if err != nil { @@ -1248,7 +1252,7 @@ func (c *service) SwInterfaceSetRxPlacement(ctx context.Context, in *SwInterface return out, nil } -func (c *service) SwInterfaceSetTable(ctx context.Context, in *SwInterfaceSetTable) (*SwInterfaceSetTableReply, error) { +func (c *serviceClient) SwInterfaceSetTable(ctx context.Context, in *SwInterfaceSetTable) (*SwInterfaceSetTableReply, error) { out := new(SwInterfaceSetTableReply) err := c.ch.SendRequest(in).ReceiveReply(out) if err != nil { @@ -1257,7 +1261,7 @@ func (c *service) SwInterfaceSetTable(ctx context.Context, in *SwInterfaceSetTab return out, nil } -func (c *service) SwInterfaceSetUnnumbered(ctx context.Context, in *SwInterfaceSetUnnumbered) (*SwInterfaceSetUnnumberedReply, error) { +func (c *serviceClient) SwInterfaceSetUnnumbered(ctx context.Context, in *SwInterfaceSetUnnumbered) (*SwInterfaceSetUnnumberedReply, error) { out := new(SwInterfaceSetUnnumberedReply) err := c.ch.SendRequest(in).ReceiveReply(out) if err != nil { @@ -1266,7 +1270,7 @@ func (c *service) SwInterfaceSetUnnumbered(ctx context.Context, in *SwInterfaceS return out, nil } -func (c *service) SwInterfaceTagAddDel(ctx context.Context, in *SwInterfaceTagAddDel) (*SwInterfaceTagAddDelReply, error) { +func (c *serviceClient) SwInterfaceTagAddDel(ctx context.Context, in *SwInterfaceTagAddDel) (*SwInterfaceTagAddDelReply, error) { out := new(SwInterfaceTagAddDelReply) err := c.ch.SendRequest(in).ReceiveReply(out) if err != nil { @@ -1275,7 +1279,7 @@ func (c *service) SwInterfaceTagAddDel(ctx context.Context, in *SwInterfaceTagAd return out, nil } -func (c *service) WantInterfaceEvents(ctx context.Context, in *WantInterfaceEvents) (*WantInterfaceEventsReply, error) { +func (c *serviceClient) WantInterfaceEvents(ctx context.Context, in *WantInterfaceEvents) (*WantInterfaceEventsReply, error) { out := new(WantInterfaceEventsReply) err := c.ch.SendRequest(in).ReceiveReply(out) if err != nil { @@ -1283,3 +1287,17 @@ func (c *service) WantInterfaceEvents(ctx context.Context, in *WantInterfaceEven } return out, nil } + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the GoVPP api package it is being compiled against. +// A compilation error at this line likely means your copy of the +// GoVPP api package needs to be updated. +const _ = api.GoVppAPIPackageIsVersion1 // please upgrade the GoVPP api package + +// Reference imports to suppress errors if they are not otherwise used. +var _ = api.RegisterMessage +var _ = bytes.NewBuffer +var _ = context.Background +var _ = io.Copy +var _ = strconv.Itoa +var _ = struc.Pack |