From 4102c72bce694babd94a481b1201d33895a6f9c5 Mon Sep 17 00:00:00 2001 From: Nathan Skrzypczak Date: Wed, 27 Apr 2022 18:39:03 +0200 Subject: Update generated binapi to v22.02 & makefile changes This patch does some small updates to the Makefile. * `make gen-binapi-from-code` is removed, and moves to `gen-binapi-local` * `make build` is patched to build cmd & examples * `make binapi-generator` to build the api-generator without other binaries, as they typically require its output to build. * `make gen-binapi-local` runs the locally built binapi-generator to update the local bindings. It expects ${VPP_DIR} to be set and to point to a local vpp repository checked out with the right version * `make gen-binapi-internal` runs the locally built binapi-generator to update the bindings in `internal/testbinapi/binapi2001` Regarding VPP, notable changes when moving to v22.02 are : - ControlPing moved from vpe to memclnt - CliInband went from vpe to vlib Signed-off-by: Nathan Skrzypczak Change-Id: Ie5cd2d5ded7ecaffd9abc3ca675df40be272b1fa --- binapi/vxlan_gpe/vxlan_gpe.ba.go | 242 ++++++++++++++++++++++++++++++++++- binapi/vxlan_gpe/vxlan_gpe_rpc.ba.go | 60 ++++++++- 2 files changed, 295 insertions(+), 7 deletions(-) (limited to 'binapi/vxlan_gpe') diff --git a/binapi/vxlan_gpe/vxlan_gpe.ba.go b/binapi/vxlan_gpe/vxlan_gpe.ba.go index aa68eb5..e07ad3a 100644 --- a/binapi/vxlan_gpe/vxlan_gpe.ba.go +++ b/binapi/vxlan_gpe/vxlan_gpe.ba.go @@ -1,13 +1,13 @@ // Code generated by GoVPP's binapi-generator. DO NOT EDIT. // versions: // binapi-generator: v0.5.0-dev -// VPP: 21.06-release +// VPP: 22.02-release // source: /usr/share/vpp/api/core/vxlan_gpe.api.json // Package vxlan_gpe contains generated bindings for API file vxlan_gpe.api. // // Contents: -// 6 messages +// 10 messages // package vxlan_gpe @@ -26,8 +26,8 @@ const _ = api.GoVppAPIPackageIsVersion2 const ( APIFile = "vxlan_gpe" - APIVersion = "2.0.0" - VersionCrc = 0x7a970d0b + APIVersion = "2.1.0" + VersionCrc = 0x3bc06278 ) // SwInterfaceSetVxlanGpeBypass defines message 'sw_interface_set_vxlan_gpe_bypass'. @@ -212,6 +212,120 @@ func (m *VxlanGpeAddDelTunnelReply) Unmarshal(b []byte) error { return nil } +// VxlanGpeAddDelTunnelV2 defines message 'vxlan_gpe_add_del_tunnel_v2'. +type VxlanGpeAddDelTunnelV2 struct { + Local ip_types.Address `binapi:"address,name=local" json:"local,omitempty"` + Remote ip_types.Address `binapi:"address,name=remote" json:"remote,omitempty"` + LocalPort uint16 `binapi:"u16,name=local_port" json:"local_port,omitempty"` + RemotePort uint16 `binapi:"u16,name=remote_port" json:"remote_port,omitempty"` + McastSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=mcast_sw_if_index" json:"mcast_sw_if_index,omitempty"` + EncapVrfID uint32 `binapi:"u32,name=encap_vrf_id" json:"encap_vrf_id,omitempty"` + DecapVrfID uint32 `binapi:"u32,name=decap_vrf_id" json:"decap_vrf_id,omitempty"` + Protocol ip_types.IPProto `binapi:"ip_proto,name=protocol" json:"protocol,omitempty"` + Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"` + IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"` +} + +func (m *VxlanGpeAddDelTunnelV2) Reset() { *m = VxlanGpeAddDelTunnelV2{} } +func (*VxlanGpeAddDelTunnelV2) GetMessageName() string { return "vxlan_gpe_add_del_tunnel_v2" } +func (*VxlanGpeAddDelTunnelV2) GetCrcString() string { return "d62fdb35" } +func (*VxlanGpeAddDelTunnelV2) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *VxlanGpeAddDelTunnelV2) Size() (size int) { + if m == nil { + return 0 + } + size += 1 // m.Local.Af + size += 1 * 16 // m.Local.Un + size += 1 // m.Remote.Af + size += 1 * 16 // m.Remote.Un + size += 2 // m.LocalPort + size += 2 // m.RemotePort + size += 4 // m.McastSwIfIndex + size += 4 // m.EncapVrfID + size += 4 // m.DecapVrfID + size += 1 // m.Protocol + size += 4 // m.Vni + size += 1 // m.IsAdd + return size +} +func (m *VxlanGpeAddDelTunnelV2) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint8(uint8(m.Local.Af)) + buf.EncodeBytes(m.Local.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(uint8(m.Remote.Af)) + buf.EncodeBytes(m.Remote.Un.XXX_UnionData[:], 16) + buf.EncodeUint16(m.LocalPort) + buf.EncodeUint16(m.RemotePort) + buf.EncodeUint32(uint32(m.McastSwIfIndex)) + buf.EncodeUint32(m.EncapVrfID) + buf.EncodeUint32(m.DecapVrfID) + buf.EncodeUint8(uint8(m.Protocol)) + buf.EncodeUint32(m.Vni) + buf.EncodeBool(m.IsAdd) + return buf.Bytes(), nil +} +func (m *VxlanGpeAddDelTunnelV2) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Local.Af = ip_types.AddressFamily(buf.DecodeUint8()) + copy(m.Local.Un.XXX_UnionData[:], buf.DecodeBytes(16)) + m.Remote.Af = ip_types.AddressFamily(buf.DecodeUint8()) + copy(m.Remote.Un.XXX_UnionData[:], buf.DecodeBytes(16)) + m.LocalPort = buf.DecodeUint16() + m.RemotePort = buf.DecodeUint16() + m.McastSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.EncapVrfID = buf.DecodeUint32() + m.DecapVrfID = buf.DecodeUint32() + m.Protocol = ip_types.IPProto(buf.DecodeUint8()) + m.Vni = buf.DecodeUint32() + m.IsAdd = buf.DecodeBool() + return nil +} + +// VxlanGpeAddDelTunnelV2Reply defines message 'vxlan_gpe_add_del_tunnel_v2_reply'. +type VxlanGpeAddDelTunnelV2Reply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` +} + +func (m *VxlanGpeAddDelTunnelV2Reply) Reset() { *m = VxlanGpeAddDelTunnelV2Reply{} } +func (*VxlanGpeAddDelTunnelV2Reply) GetMessageName() string { + return "vxlan_gpe_add_del_tunnel_v2_reply" +} +func (*VxlanGpeAddDelTunnelV2Reply) GetCrcString() string { return "5383d31f" } +func (*VxlanGpeAddDelTunnelV2Reply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *VxlanGpeAddDelTunnelV2Reply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + size += 4 // m.SwIfIndex + return size +} +func (m *VxlanGpeAddDelTunnelV2Reply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(uint32(m.SwIfIndex)) + return buf.Bytes(), nil +} +func (m *VxlanGpeAddDelTunnelV2Reply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + return nil +} + // VxlanGpeTunnelDetails defines message 'vxlan_gpe_tunnel_details'. type VxlanGpeTunnelDetails struct { SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` @@ -316,14 +430,130 @@ func (m *VxlanGpeTunnelDump) Unmarshal(b []byte) error { return nil } +// VxlanGpeTunnelV2Details defines message 'vxlan_gpe_tunnel_v2_details'. +type VxlanGpeTunnelV2Details struct { + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` + Local ip_types.Address `binapi:"address,name=local" json:"local,omitempty"` + Remote ip_types.Address `binapi:"address,name=remote" json:"remote,omitempty"` + LocalPort uint16 `binapi:"u16,name=local_port" json:"local_port,omitempty"` + RemotePort uint16 `binapi:"u16,name=remote_port" json:"remote_port,omitempty"` + Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"` + Protocol ip_types.IPProto `binapi:"ip_proto,name=protocol" json:"protocol,omitempty"` + McastSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=mcast_sw_if_index" json:"mcast_sw_if_index,omitempty"` + EncapVrfID uint32 `binapi:"u32,name=encap_vrf_id" json:"encap_vrf_id,omitempty"` + DecapVrfID uint32 `binapi:"u32,name=decap_vrf_id" json:"decap_vrf_id,omitempty"` + IsIPv6 bool `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"` +} + +func (m *VxlanGpeTunnelV2Details) Reset() { *m = VxlanGpeTunnelV2Details{} } +func (*VxlanGpeTunnelV2Details) GetMessageName() string { return "vxlan_gpe_tunnel_v2_details" } +func (*VxlanGpeTunnelV2Details) GetCrcString() string { return "06be4870" } +func (*VxlanGpeTunnelV2Details) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *VxlanGpeTunnelV2Details) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.SwIfIndex + size += 1 // m.Local.Af + size += 1 * 16 // m.Local.Un + size += 1 // m.Remote.Af + size += 1 * 16 // m.Remote.Un + size += 2 // m.LocalPort + size += 2 // m.RemotePort + size += 4 // m.Vni + size += 1 // m.Protocol + size += 4 // m.McastSwIfIndex + size += 4 // m.EncapVrfID + size += 4 // m.DecapVrfID + size += 1 // m.IsIPv6 + return size +} +func (m *VxlanGpeTunnelV2Details) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(uint32(m.SwIfIndex)) + buf.EncodeUint8(uint8(m.Local.Af)) + buf.EncodeBytes(m.Local.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(uint8(m.Remote.Af)) + buf.EncodeBytes(m.Remote.Un.XXX_UnionData[:], 16) + buf.EncodeUint16(m.LocalPort) + buf.EncodeUint16(m.RemotePort) + buf.EncodeUint32(m.Vni) + buf.EncodeUint8(uint8(m.Protocol)) + buf.EncodeUint32(uint32(m.McastSwIfIndex)) + buf.EncodeUint32(m.EncapVrfID) + buf.EncodeUint32(m.DecapVrfID) + buf.EncodeBool(m.IsIPv6) + return buf.Bytes(), nil +} +func (m *VxlanGpeTunnelV2Details) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.Local.Af = ip_types.AddressFamily(buf.DecodeUint8()) + copy(m.Local.Un.XXX_UnionData[:], buf.DecodeBytes(16)) + m.Remote.Af = ip_types.AddressFamily(buf.DecodeUint8()) + copy(m.Remote.Un.XXX_UnionData[:], buf.DecodeBytes(16)) + m.LocalPort = buf.DecodeUint16() + m.RemotePort = buf.DecodeUint16() + m.Vni = buf.DecodeUint32() + m.Protocol = ip_types.IPProto(buf.DecodeUint8()) + m.McastSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.EncapVrfID = buf.DecodeUint32() + m.DecapVrfID = buf.DecodeUint32() + m.IsIPv6 = buf.DecodeBool() + return nil +} + +// VxlanGpeTunnelV2Dump defines message 'vxlan_gpe_tunnel_v2_dump'. +type VxlanGpeTunnelV2Dump struct { + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` +} + +func (m *VxlanGpeTunnelV2Dump) Reset() { *m = VxlanGpeTunnelV2Dump{} } +func (*VxlanGpeTunnelV2Dump) GetMessageName() string { return "vxlan_gpe_tunnel_v2_dump" } +func (*VxlanGpeTunnelV2Dump) GetCrcString() string { return "f9e6675e" } +func (*VxlanGpeTunnelV2Dump) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *VxlanGpeTunnelV2Dump) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.SwIfIndex + return size +} +func (m *VxlanGpeTunnelV2Dump) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(uint32(m.SwIfIndex)) + return buf.Bytes(), nil +} +func (m *VxlanGpeTunnelV2Dump) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + return nil +} + func init() { file_vxlan_gpe_binapi_init() } func file_vxlan_gpe_binapi_init() { api.RegisterMessage((*SwInterfaceSetVxlanGpeBypass)(nil), "sw_interface_set_vxlan_gpe_bypass_65247409") api.RegisterMessage((*SwInterfaceSetVxlanGpeBypassReply)(nil), "sw_interface_set_vxlan_gpe_bypass_reply_e8d4e804") api.RegisterMessage((*VxlanGpeAddDelTunnel)(nil), "vxlan_gpe_add_del_tunnel_a645b2b0") api.RegisterMessage((*VxlanGpeAddDelTunnelReply)(nil), "vxlan_gpe_add_del_tunnel_reply_5383d31f") + api.RegisterMessage((*VxlanGpeAddDelTunnelV2)(nil), "vxlan_gpe_add_del_tunnel_v2_d62fdb35") + api.RegisterMessage((*VxlanGpeAddDelTunnelV2Reply)(nil), "vxlan_gpe_add_del_tunnel_v2_reply_5383d31f") api.RegisterMessage((*VxlanGpeTunnelDetails)(nil), "vxlan_gpe_tunnel_details_0968fc8b") api.RegisterMessage((*VxlanGpeTunnelDump)(nil), "vxlan_gpe_tunnel_dump_f9e6675e") + api.RegisterMessage((*VxlanGpeTunnelV2Details)(nil), "vxlan_gpe_tunnel_v2_details_06be4870") + api.RegisterMessage((*VxlanGpeTunnelV2Dump)(nil), "vxlan_gpe_tunnel_v2_dump_f9e6675e") } // Messages returns list of all messages in this module. @@ -333,7 +563,11 @@ func AllMessages() []api.Message { (*SwInterfaceSetVxlanGpeBypassReply)(nil), (*VxlanGpeAddDelTunnel)(nil), (*VxlanGpeAddDelTunnelReply)(nil), + (*VxlanGpeAddDelTunnelV2)(nil), + (*VxlanGpeAddDelTunnelV2Reply)(nil), (*VxlanGpeTunnelDetails)(nil), (*VxlanGpeTunnelDump)(nil), + (*VxlanGpeTunnelV2Details)(nil), + (*VxlanGpeTunnelV2Dump)(nil), } } diff --git a/binapi/vxlan_gpe/vxlan_gpe_rpc.ba.go b/binapi/vxlan_gpe/vxlan_gpe_rpc.ba.go index c5010c7..5234a7d 100644 --- a/binapi/vxlan_gpe/vxlan_gpe_rpc.ba.go +++ b/binapi/vxlan_gpe/vxlan_gpe_rpc.ba.go @@ -8,14 +8,16 @@ import ( "io" api "git.fd.io/govpp.git/api" - vpe "git.fd.io/govpp.git/binapi/vpe" + memclnt "git.fd.io/govpp.git/binapi/memclnt" ) // RPCService defines RPC service vxlan_gpe. type RPCService interface { SwInterfaceSetVxlanGpeBypass(ctx context.Context, in *SwInterfaceSetVxlanGpeBypass) (*SwInterfaceSetVxlanGpeBypassReply, error) VxlanGpeAddDelTunnel(ctx context.Context, in *VxlanGpeAddDelTunnel) (*VxlanGpeAddDelTunnelReply, error) + VxlanGpeAddDelTunnelV2(ctx context.Context, in *VxlanGpeAddDelTunnelV2) (*VxlanGpeAddDelTunnelV2Reply, error) VxlanGpeTunnelDump(ctx context.Context, in *VxlanGpeTunnelDump) (RPCService_VxlanGpeTunnelDumpClient, error) + VxlanGpeTunnelV2Dump(ctx context.Context, in *VxlanGpeTunnelV2Dump) (RPCService_VxlanGpeTunnelV2DumpClient, error) } type serviceClient struct { @@ -44,6 +46,15 @@ func (c *serviceClient) VxlanGpeAddDelTunnel(ctx context.Context, in *VxlanGpeAd return out, api.RetvalToVPPApiError(out.Retval) } +func (c *serviceClient) VxlanGpeAddDelTunnelV2(ctx context.Context, in *VxlanGpeAddDelTunnelV2) (*VxlanGpeAddDelTunnelV2Reply, error) { + out := new(VxlanGpeAddDelTunnelV2Reply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} + func (c *serviceClient) VxlanGpeTunnelDump(ctx context.Context, in *VxlanGpeTunnelDump) (RPCService_VxlanGpeTunnelDumpClient, error) { stream, err := c.conn.NewStream(ctx) if err != nil { @@ -53,7 +64,7 @@ func (c *serviceClient) VxlanGpeTunnelDump(ctx context.Context, in *VxlanGpeTunn if err := x.Stream.SendMsg(in); err != nil { return nil, err } - if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil { + if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil { return nil, err } return x, nil @@ -76,7 +87,50 @@ func (c *serviceClient_VxlanGpeTunnelDumpClient) Recv() (*VxlanGpeTunnelDetails, switch m := msg.(type) { case *VxlanGpeTunnelDetails: return m, nil - case *vpe.ControlPingReply: + case *memclnt.ControlPingReply: + err = c.Stream.Close() + if err != nil { + return nil, err + } + return nil, io.EOF + default: + return nil, fmt.Errorf("unexpected message: %T %v", m, m) + } +} + +func (c *serviceClient) VxlanGpeTunnelV2Dump(ctx context.Context, in *VxlanGpeTunnelV2Dump) (RPCService_VxlanGpeTunnelV2DumpClient, error) { + stream, err := c.conn.NewStream(ctx) + if err != nil { + return nil, err + } + x := &serviceClient_VxlanGpeTunnelV2DumpClient{stream} + if err := x.Stream.SendMsg(in); err != nil { + return nil, err + } + if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil { + return nil, err + } + return x, nil +} + +type RPCService_VxlanGpeTunnelV2DumpClient interface { + Recv() (*VxlanGpeTunnelV2Details, error) + api.Stream +} + +type serviceClient_VxlanGpeTunnelV2DumpClient struct { + api.Stream +} + +func (c *serviceClient_VxlanGpeTunnelV2DumpClient) Recv() (*VxlanGpeTunnelV2Details, error) { + msg, err := c.Stream.RecvMsg() + if err != nil { + return nil, err + } + switch m := msg.(type) { + case *VxlanGpeTunnelV2Details: + return m, nil + case *memclnt.ControlPingReply: err = c.Stream.Close() if err != nil { return nil, err -- cgit 1.2.3-korg