diff options
author | 2022-04-27 18:39:03 +0200 | |
---|---|---|
committer | 2022-05-30 18:49:13 +0200 | |
commit | 4102c72bce694babd94a481b1201d33895a6f9c5 (patch) | |
tree | 1b11238ca4706008c88712f26942dd74ab9c14a6 /binapi/ipfix_export | |
parent | a4112fac7b86fe09650d2bb57969fe46404edd7d (diff) |
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 <nathan.skrzypczak@gmail.com>
Change-Id: Ie5cd2d5ded7ecaffd9abc3ca675df40be272b1fa
Diffstat (limited to 'binapi/ipfix_export')
-rw-r--r-- | binapi/ipfix_export/ipfix_export.ba.go | 255 | ||||
-rw-r--r-- | binapi/ipfix_export/ipfix_export_rpc.ba.go | 65 |
2 files changed, 310 insertions, 10 deletions
diff --git a/binapi/ipfix_export/ipfix_export.ba.go b/binapi/ipfix_export/ipfix_export.ba.go index 5809135..c7c923a 100644 --- a/binapi/ipfix_export/ipfix_export.ba.go +++ b/binapi/ipfix_export/ipfix_export.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/ipfix_export.api.json // Package ipfix_export contains generated bindings for API file ipfix_export.api. // // Contents: -// 14 messages +// 19 messages // package ipfix_export @@ -26,9 +26,142 @@ const _ = api.GoVppAPIPackageIsVersion2 const ( APIFile = "ipfix_export" APIVersion = "2.0.3" - VersionCrc = 0x6ae99522 + VersionCrc = 0x63e0810a ) +// IpfixAllExporterDetails defines message 'ipfix_all_exporter_details'. +type IpfixAllExporterDetails struct { + CollectorAddress ip_types.Address `binapi:"address,name=collector_address" json:"collector_address,omitempty"` + CollectorPort uint16 `binapi:"u16,name=collector_port" json:"collector_port,omitempty"` + SrcAddress ip_types.Address `binapi:"address,name=src_address" json:"src_address,omitempty"` + VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"` + PathMtu uint32 `binapi:"u32,name=path_mtu" json:"path_mtu,omitempty"` + TemplateInterval uint32 `binapi:"u32,name=template_interval" json:"template_interval,omitempty"` + UDPChecksum bool `binapi:"bool,name=udp_checksum" json:"udp_checksum,omitempty"` +} + +func (m *IpfixAllExporterDetails) Reset() { *m = IpfixAllExporterDetails{} } +func (*IpfixAllExporterDetails) GetMessageName() string { return "ipfix_all_exporter_details" } +func (*IpfixAllExporterDetails) GetCrcString() string { return "0dedbfe4" } +func (*IpfixAllExporterDetails) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *IpfixAllExporterDetails) Size() (size int) { + if m == nil { + return 0 + } + size += 1 // m.CollectorAddress.Af + size += 1 * 16 // m.CollectorAddress.Un + size += 2 // m.CollectorPort + size += 1 // m.SrcAddress.Af + size += 1 * 16 // m.SrcAddress.Un + size += 4 // m.VrfID + size += 4 // m.PathMtu + size += 4 // m.TemplateInterval + size += 1 // m.UDPChecksum + return size +} +func (m *IpfixAllExporterDetails) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint8(uint8(m.CollectorAddress.Af)) + buf.EncodeBytes(m.CollectorAddress.Un.XXX_UnionData[:], 16) + buf.EncodeUint16(m.CollectorPort) + buf.EncodeUint8(uint8(m.SrcAddress.Af)) + buf.EncodeBytes(m.SrcAddress.Un.XXX_UnionData[:], 16) + buf.EncodeUint32(m.VrfID) + buf.EncodeUint32(m.PathMtu) + buf.EncodeUint32(m.TemplateInterval) + buf.EncodeBool(m.UDPChecksum) + return buf.Bytes(), nil +} +func (m *IpfixAllExporterDetails) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.CollectorAddress.Af = ip_types.AddressFamily(buf.DecodeUint8()) + copy(m.CollectorAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16)) + m.CollectorPort = buf.DecodeUint16() + m.SrcAddress.Af = ip_types.AddressFamily(buf.DecodeUint8()) + copy(m.SrcAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16)) + m.VrfID = buf.DecodeUint32() + m.PathMtu = buf.DecodeUint32() + m.TemplateInterval = buf.DecodeUint32() + m.UDPChecksum = buf.DecodeBool() + return nil +} + +// IpfixAllExporterGet defines message 'ipfix_all_exporter_get'. +type IpfixAllExporterGet struct { + Cursor uint32 `binapi:"u32,name=cursor" json:"cursor,omitempty"` +} + +func (m *IpfixAllExporterGet) Reset() { *m = IpfixAllExporterGet{} } +func (*IpfixAllExporterGet) GetMessageName() string { return "ipfix_all_exporter_get" } +func (*IpfixAllExporterGet) GetCrcString() string { return "f75ba505" } +func (*IpfixAllExporterGet) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *IpfixAllExporterGet) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Cursor + return size +} +func (m *IpfixAllExporterGet) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Cursor) + return buf.Bytes(), nil +} +func (m *IpfixAllExporterGet) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Cursor = buf.DecodeUint32() + return nil +} + +// IpfixAllExporterGetReply defines message 'ipfix_all_exporter_get_reply'. +type IpfixAllExporterGetReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` + Cursor uint32 `binapi:"u32,name=cursor" json:"cursor,omitempty"` +} + +func (m *IpfixAllExporterGetReply) Reset() { *m = IpfixAllExporterGetReply{} } +func (*IpfixAllExporterGetReply) GetMessageName() string { return "ipfix_all_exporter_get_reply" } +func (*IpfixAllExporterGetReply) GetCrcString() string { return "53b48f5d" } +func (*IpfixAllExporterGetReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *IpfixAllExporterGetReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + size += 4 // m.Cursor + return size +} +func (m *IpfixAllExporterGetReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.Cursor) + return buf.Bytes(), nil +} +func (m *IpfixAllExporterGetReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + m.Cursor = buf.DecodeUint32() + return nil +} + // IpfixClassifyStreamDetails defines message 'ipfix_classify_stream_details'. type IpfixClassifyStreamDetails struct { DomainID uint32 `binapi:"u32,name=domain_id" json:"domain_id,omitempty"` @@ -241,6 +374,112 @@ func (m *IpfixClassifyTableDump) Unmarshal(b []byte) error { return nil } +// IpfixExporterCreateDelete defines message 'ipfix_exporter_create_delete'. +type IpfixExporterCreateDelete struct { + IsCreate bool `binapi:"bool,name=is_create" json:"is_create,omitempty"` + CollectorAddress ip_types.Address `binapi:"address,name=collector_address" json:"collector_address,omitempty"` + CollectorPort uint16 `binapi:"u16,name=collector_port" json:"collector_port,omitempty"` + SrcAddress ip_types.Address `binapi:"address,name=src_address" json:"src_address,omitempty"` + VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"` + PathMtu uint32 `binapi:"u32,name=path_mtu" json:"path_mtu,omitempty"` + TemplateInterval uint32 `binapi:"u32,name=template_interval" json:"template_interval,omitempty"` + UDPChecksum bool `binapi:"bool,name=udp_checksum" json:"udp_checksum,omitempty"` +} + +func (m *IpfixExporterCreateDelete) Reset() { *m = IpfixExporterCreateDelete{} } +func (*IpfixExporterCreateDelete) GetMessageName() string { return "ipfix_exporter_create_delete" } +func (*IpfixExporterCreateDelete) GetCrcString() string { return "0753a768" } +func (*IpfixExporterCreateDelete) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *IpfixExporterCreateDelete) Size() (size int) { + if m == nil { + return 0 + } + size += 1 // m.IsCreate + size += 1 // m.CollectorAddress.Af + size += 1 * 16 // m.CollectorAddress.Un + size += 2 // m.CollectorPort + size += 1 // m.SrcAddress.Af + size += 1 * 16 // m.SrcAddress.Un + size += 4 // m.VrfID + size += 4 // m.PathMtu + size += 4 // m.TemplateInterval + size += 1 // m.UDPChecksum + return size +} +func (m *IpfixExporterCreateDelete) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeBool(m.IsCreate) + buf.EncodeUint8(uint8(m.CollectorAddress.Af)) + buf.EncodeBytes(m.CollectorAddress.Un.XXX_UnionData[:], 16) + buf.EncodeUint16(m.CollectorPort) + buf.EncodeUint8(uint8(m.SrcAddress.Af)) + buf.EncodeBytes(m.SrcAddress.Un.XXX_UnionData[:], 16) + buf.EncodeUint32(m.VrfID) + buf.EncodeUint32(m.PathMtu) + buf.EncodeUint32(m.TemplateInterval) + buf.EncodeBool(m.UDPChecksum) + return buf.Bytes(), nil +} +func (m *IpfixExporterCreateDelete) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.IsCreate = buf.DecodeBool() + m.CollectorAddress.Af = ip_types.AddressFamily(buf.DecodeUint8()) + copy(m.CollectorAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16)) + m.CollectorPort = buf.DecodeUint16() + m.SrcAddress.Af = ip_types.AddressFamily(buf.DecodeUint8()) + copy(m.SrcAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16)) + m.VrfID = buf.DecodeUint32() + m.PathMtu = buf.DecodeUint32() + m.TemplateInterval = buf.DecodeUint32() + m.UDPChecksum = buf.DecodeBool() + return nil +} + +// IpfixExporterCreateDeleteReply defines message 'ipfix_exporter_create_delete_reply'. +type IpfixExporterCreateDeleteReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` + StatIndex uint32 `binapi:"u32,name=stat_index" json:"stat_index,omitempty"` +} + +func (m *IpfixExporterCreateDeleteReply) Reset() { *m = IpfixExporterCreateDeleteReply{} } +func (*IpfixExporterCreateDeleteReply) GetMessageName() string { + return "ipfix_exporter_create_delete_reply" +} +func (*IpfixExporterCreateDeleteReply) GetCrcString() string { return "9ffac24b" } +func (*IpfixExporterCreateDeleteReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *IpfixExporterCreateDeleteReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + size += 4 // m.StatIndex + return size +} +func (m *IpfixExporterCreateDeleteReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.StatIndex) + return buf.Bytes(), nil +} +func (m *IpfixExporterCreateDeleteReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + m.StatIndex = buf.DecodeUint32() + return nil +} + // IpfixExporterDetails defines message 'ipfix_exporter_details'. type IpfixExporterDetails struct { CollectorAddress ip_types.Address `binapi:"address,name=collector_address" json:"collector_address,omitempty"` @@ -559,12 +798,17 @@ func (m *SetIpfixExporterReply) Unmarshal(b []byte) error { func init() { file_ipfix_export_binapi_init() } func file_ipfix_export_binapi_init() { + api.RegisterMessage((*IpfixAllExporterDetails)(nil), "ipfix_all_exporter_details_0dedbfe4") + api.RegisterMessage((*IpfixAllExporterGet)(nil), "ipfix_all_exporter_get_f75ba505") + api.RegisterMessage((*IpfixAllExporterGetReply)(nil), "ipfix_all_exporter_get_reply_53b48f5d") api.RegisterMessage((*IpfixClassifyStreamDetails)(nil), "ipfix_classify_stream_details_2903539d") api.RegisterMessage((*IpfixClassifyStreamDump)(nil), "ipfix_classify_stream_dump_51077d14") api.RegisterMessage((*IpfixClassifyTableAddDel)(nil), "ipfix_classify_table_add_del_3e449bb9") api.RegisterMessage((*IpfixClassifyTableAddDelReply)(nil), "ipfix_classify_table_add_del_reply_e8d4e804") api.RegisterMessage((*IpfixClassifyTableDetails)(nil), "ipfix_classify_table_details_1af8c28c") api.RegisterMessage((*IpfixClassifyTableDump)(nil), "ipfix_classify_table_dump_51077d14") + api.RegisterMessage((*IpfixExporterCreateDelete)(nil), "ipfix_exporter_create_delete_0753a768") + api.RegisterMessage((*IpfixExporterCreateDeleteReply)(nil), "ipfix_exporter_create_delete_reply_9ffac24b") api.RegisterMessage((*IpfixExporterDetails)(nil), "ipfix_exporter_details_0dedbfe4") api.RegisterMessage((*IpfixExporterDump)(nil), "ipfix_exporter_dump_51077d14") api.RegisterMessage((*IpfixFlush)(nil), "ipfix_flush_51077d14") @@ -578,12 +822,17 @@ func file_ipfix_export_binapi_init() { // Messages returns list of all messages in this module. func AllMessages() []api.Message { return []api.Message{ + (*IpfixAllExporterDetails)(nil), + (*IpfixAllExporterGet)(nil), + (*IpfixAllExporterGetReply)(nil), (*IpfixClassifyStreamDetails)(nil), (*IpfixClassifyStreamDump)(nil), (*IpfixClassifyTableAddDel)(nil), (*IpfixClassifyTableAddDelReply)(nil), (*IpfixClassifyTableDetails)(nil), (*IpfixClassifyTableDump)(nil), + (*IpfixExporterCreateDelete)(nil), + (*IpfixExporterCreateDeleteReply)(nil), (*IpfixExporterDetails)(nil), (*IpfixExporterDump)(nil), (*IpfixFlush)(nil), diff --git a/binapi/ipfix_export/ipfix_export_rpc.ba.go b/binapi/ipfix_export/ipfix_export_rpc.ba.go index bd4fc13..ba154a5 100644 --- a/binapi/ipfix_export/ipfix_export_rpc.ba.go +++ b/binapi/ipfix_export/ipfix_export_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 ipfix_export. type RPCService interface { + IpfixAllExporterGet(ctx context.Context, in *IpfixAllExporterGet) (RPCService_IpfixAllExporterGetClient, error) IpfixClassifyStreamDump(ctx context.Context, in *IpfixClassifyStreamDump) (RPCService_IpfixClassifyStreamDumpClient, error) IpfixClassifyTableAddDel(ctx context.Context, in *IpfixClassifyTableAddDel) (*IpfixClassifyTableAddDelReply, error) IpfixClassifyTableDump(ctx context.Context, in *IpfixClassifyTableDump) (RPCService_IpfixClassifyTableDumpClient, error) + IpfixExporterCreateDelete(ctx context.Context, in *IpfixExporterCreateDelete) (*IpfixExporterCreateDeleteReply, error) IpfixExporterDump(ctx context.Context, in *IpfixExporterDump) (RPCService_IpfixExporterDumpClient, error) IpfixFlush(ctx context.Context, in *IpfixFlush) (*IpfixFlushReply, error) SetIpfixClassifyStream(ctx context.Context, in *SetIpfixClassifyStream) (*SetIpfixClassifyStreamReply, error) @@ -30,6 +32,46 @@ func NewServiceClient(conn api.Connection) RPCService { return &serviceClient{conn} } +func (c *serviceClient) IpfixAllExporterGet(ctx context.Context, in *IpfixAllExporterGet) (RPCService_IpfixAllExporterGetClient, error) { + stream, err := c.conn.NewStream(ctx) + if err != nil { + return nil, err + } + x := &serviceClient_IpfixAllExporterGetClient{stream} + if err := x.Stream.SendMsg(in); err != nil { + return nil, err + } + return x, nil +} + +type RPCService_IpfixAllExporterGetClient interface { + Recv() (*IpfixAllExporterDetails, error) + api.Stream +} + +type serviceClient_IpfixAllExporterGetClient struct { + api.Stream +} + +func (c *serviceClient_IpfixAllExporterGetClient) Recv() (*IpfixAllExporterDetails, error) { + msg, err := c.Stream.RecvMsg() + if err != nil { + return nil, err + } + switch m := msg.(type) { + case *IpfixAllExporterDetails: + return m, nil + case *IpfixAllExporterGetReply: + 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) IpfixClassifyStreamDump(ctx context.Context, in *IpfixClassifyStreamDump) (RPCService_IpfixClassifyStreamDumpClient, error) { stream, err := c.conn.NewStream(ctx) if err != nil { @@ -39,7 +81,7 @@ func (c *serviceClient) IpfixClassifyStreamDump(ctx context.Context, in *IpfixCl 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 @@ -62,7 +104,7 @@ func (c *serviceClient_IpfixClassifyStreamDumpClient) Recv() (*IpfixClassifyStre switch m := msg.(type) { case *IpfixClassifyStreamDetails: return m, nil - case *vpe.ControlPingReply: + case *memclnt.ControlPingReply: err = c.Stream.Close() if err != nil { return nil, err @@ -91,7 +133,7 @@ func (c *serviceClient) IpfixClassifyTableDump(ctx context.Context, in *IpfixCla 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 @@ -114,7 +156,7 @@ func (c *serviceClient_IpfixClassifyTableDumpClient) Recv() (*IpfixClassifyTable switch m := msg.(type) { case *IpfixClassifyTableDetails: return m, nil - case *vpe.ControlPingReply: + case *memclnt.ControlPingReply: err = c.Stream.Close() if err != nil { return nil, err @@ -125,6 +167,15 @@ func (c *serviceClient_IpfixClassifyTableDumpClient) Recv() (*IpfixClassifyTable } } +func (c *serviceClient) IpfixExporterCreateDelete(ctx context.Context, in *IpfixExporterCreateDelete) (*IpfixExporterCreateDeleteReply, error) { + out := new(IpfixExporterCreateDeleteReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} + func (c *serviceClient) IpfixExporterDump(ctx context.Context, in *IpfixExporterDump) (RPCService_IpfixExporterDumpClient, error) { stream, err := c.conn.NewStream(ctx) if err != nil { @@ -134,7 +185,7 @@ func (c *serviceClient) IpfixExporterDump(ctx context.Context, in *IpfixExporter 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 @@ -157,7 +208,7 @@ func (c *serviceClient_IpfixExporterDumpClient) Recv() (*IpfixExporterDetails, e switch m := msg.(type) { case *IpfixExporterDetails: return m, nil - case *vpe.ControlPingReply: + case *memclnt.ControlPingReply: err = c.Stream.Close() if err != nil { return nil, err |