summaryrefslogtreecommitdiffstats
path: root/binapi/pg
diff options
context:
space:
mode:
authorNathan Skrzypczak <nathan.skrzypczak@gmail.com>2022-04-27 18:39:03 +0200
committerNathan Skrzypczak <nathan.skrzypczak@gmail.com>2022-05-30 18:49:13 +0200
commit4102c72bce694babd94a481b1201d33895a6f9c5 (patch)
tree1b11238ca4706008c88712f26942dd74ab9c14a6 /binapi/pg
parenta4112fac7b86fe09650d2bb57969fe46404edd7d (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/pg')
-rw-r--r--binapi/pg/pg.ba.go125
-rw-r--r--binapi/pg/pg_rpc.ba.go10
2 files changed, 132 insertions, 3 deletions
diff --git a/binapi/pg/pg.ba.go b/binapi/pg/pg.ba.go
index 7b182ba..67134bd 100644
--- a/binapi/pg/pg.ba.go
+++ b/binapi/pg/pg.ba.go
@@ -1,17 +1,20 @@
// 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/pg.api.json
// Package pg contains generated bindings for API file pg.api.
//
// Contents:
-// 8 messages
+// 1 enum
+// 10 messages
//
package pg
import (
+ "strconv"
+
api "git.fd.io/govpp.git/api"
interface_types "git.fd.io/govpp.git/binapi/interface_types"
codec "git.fd.io/govpp.git/codec"
@@ -26,9 +29,39 @@ const _ = api.GoVppAPIPackageIsVersion2
const (
APIFile = "pg"
APIVersion = "2.0.0"
- VersionCrc = 0x3a037a0e
+ VersionCrc = 0x32a1ad3b
+)
+
+// PgInterfaceMode defines enum 'pg_interface_mode'.
+type PgInterfaceMode uint8
+
+const (
+ PG_API_MODE_ETHERNET PgInterfaceMode = 0
+ PG_API_MODE_IP4 PgInterfaceMode = 1
+ PG_API_MODE_IP6 PgInterfaceMode = 2
+)
+
+var (
+ PgInterfaceMode_name = map[uint8]string{
+ 0: "PG_API_MODE_ETHERNET",
+ 1: "PG_API_MODE_IP4",
+ 2: "PG_API_MODE_IP6",
+ }
+ PgInterfaceMode_value = map[string]uint8{
+ "PG_API_MODE_ETHERNET": 0,
+ "PG_API_MODE_IP4": 1,
+ "PG_API_MODE_IP6": 2,
+ }
)
+func (x PgInterfaceMode) String() string {
+ s, ok := PgInterfaceMode_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "PgInterfaceMode(" + strconv.Itoa(int(x)) + ")"
+}
+
// PgCapture defines message 'pg_capture'.
type PgCapture struct {
InterfaceID interface_types.InterfaceIndex `binapi:"interface_index,name=interface_id" json:"interface_id,omitempty"`
@@ -185,6 +218,88 @@ func (m *PgCreateInterfaceReply) Unmarshal(b []byte) error {
return nil
}
+// PgCreateInterfaceV2 defines message 'pg_create_interface_v2'.
+type PgCreateInterfaceV2 struct {
+ InterfaceID interface_types.InterfaceIndex `binapi:"interface_index,name=interface_id" json:"interface_id,omitempty"`
+ GsoEnabled bool `binapi:"bool,name=gso_enabled" json:"gso_enabled,omitempty"`
+ GsoSize uint32 `binapi:"u32,name=gso_size" json:"gso_size,omitempty"`
+ Mode PgInterfaceMode `binapi:"pg_interface_mode,name=mode" json:"mode,omitempty"`
+}
+
+func (m *PgCreateInterfaceV2) Reset() { *m = PgCreateInterfaceV2{} }
+func (*PgCreateInterfaceV2) GetMessageName() string { return "pg_create_interface_v2" }
+func (*PgCreateInterfaceV2) GetCrcString() string { return "8657466a" }
+func (*PgCreateInterfaceV2) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *PgCreateInterfaceV2) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.InterfaceID
+ size += 1 // m.GsoEnabled
+ size += 4 // m.GsoSize
+ size += 1 // m.Mode
+ return size
+}
+func (m *PgCreateInterfaceV2) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.InterfaceID))
+ buf.EncodeBool(m.GsoEnabled)
+ buf.EncodeUint32(m.GsoSize)
+ buf.EncodeUint8(uint8(m.Mode))
+ return buf.Bytes(), nil
+}
+func (m *PgCreateInterfaceV2) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.InterfaceID = interface_types.InterfaceIndex(buf.DecodeUint32())
+ m.GsoEnabled = buf.DecodeBool()
+ m.GsoSize = buf.DecodeUint32()
+ m.Mode = PgInterfaceMode(buf.DecodeUint8())
+ return nil
+}
+
+// PgCreateInterfaceV2Reply defines message 'pg_create_interface_v2_reply'.
+type PgCreateInterfaceV2Reply 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 *PgCreateInterfaceV2Reply) Reset() { *m = PgCreateInterfaceV2Reply{} }
+func (*PgCreateInterfaceV2Reply) GetMessageName() string { return "pg_create_interface_v2_reply" }
+func (*PgCreateInterfaceV2Reply) GetCrcString() string { return "5383d31f" }
+func (*PgCreateInterfaceV2Reply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *PgCreateInterfaceV2Reply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *PgCreateInterfaceV2Reply) 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 *PgCreateInterfaceV2Reply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
// PgEnableDisable defines message 'pg_enable_disable'.
type PgEnableDisable struct {
IsEnabled bool `binapi:"bool,name=is_enabled,default=true" json:"is_enabled,omitempty"`
@@ -337,6 +452,8 @@ func file_pg_binapi_init() {
api.RegisterMessage((*PgCaptureReply)(nil), "pg_capture_reply_e8d4e804")
api.RegisterMessage((*PgCreateInterface)(nil), "pg_create_interface_b7c893d7")
api.RegisterMessage((*PgCreateInterfaceReply)(nil), "pg_create_interface_reply_5383d31f")
+ api.RegisterMessage((*PgCreateInterfaceV2)(nil), "pg_create_interface_v2_8657466a")
+ api.RegisterMessage((*PgCreateInterfaceV2Reply)(nil), "pg_create_interface_v2_reply_5383d31f")
api.RegisterMessage((*PgEnableDisable)(nil), "pg_enable_disable_01f94f3a")
api.RegisterMessage((*PgEnableDisableReply)(nil), "pg_enable_disable_reply_e8d4e804")
api.RegisterMessage((*PgInterfaceEnableDisableCoalesce)(nil), "pg_interface_enable_disable_coalesce_a2ef99e7")
@@ -350,6 +467,8 @@ func AllMessages() []api.Message {
(*PgCaptureReply)(nil),
(*PgCreateInterface)(nil),
(*PgCreateInterfaceReply)(nil),
+ (*PgCreateInterfaceV2)(nil),
+ (*PgCreateInterfaceV2Reply)(nil),
(*PgEnableDisable)(nil),
(*PgEnableDisableReply)(nil),
(*PgInterfaceEnableDisableCoalesce)(nil),
diff --git a/binapi/pg/pg_rpc.ba.go b/binapi/pg/pg_rpc.ba.go
index 1a46cc3..967958a 100644
--- a/binapi/pg/pg_rpc.ba.go
+++ b/binapi/pg/pg_rpc.ba.go
@@ -12,6 +12,7 @@ import (
type RPCService interface {
PgCapture(ctx context.Context, in *PgCapture) (*PgCaptureReply, error)
PgCreateInterface(ctx context.Context, in *PgCreateInterface) (*PgCreateInterfaceReply, error)
+ PgCreateInterfaceV2(ctx context.Context, in *PgCreateInterfaceV2) (*PgCreateInterfaceV2Reply, error)
PgEnableDisable(ctx context.Context, in *PgEnableDisable) (*PgEnableDisableReply, error)
PgInterfaceEnableDisableCoalesce(ctx context.Context, in *PgInterfaceEnableDisableCoalesce) (*PgInterfaceEnableDisableCoalesceReply, error)
}
@@ -42,6 +43,15 @@ func (c *serviceClient) PgCreateInterface(ctx context.Context, in *PgCreateInter
return out, api.RetvalToVPPApiError(out.Retval)
}
+func (c *serviceClient) PgCreateInterfaceV2(ctx context.Context, in *PgCreateInterfaceV2) (*PgCreateInterfaceV2Reply, error) {
+ out := new(PgCreateInterfaceV2Reply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, api.RetvalToVPPApiError(out.Retval)
+}
+
func (c *serviceClient) PgEnableDisable(ctx context.Context, in *PgEnableDisable) (*PgEnableDisableReply, error) {
out := new(PgEnableDisableReply)
err := c.conn.Invoke(ctx, in, out)