From 58da9ac6e691a8c660eb8ca838a154e11da0db68 Mon Sep 17 00:00:00 2001 From: Ondrej Fabry Date: Wed, 22 Jul 2020 04:40:55 +0200 Subject: Fix binapigen decoding and minor improvements - fixed allocating byte slices before copying decoded data - simplified encoding functions - several minor improvements Change-Id: I6669424b89eb86333805cb1b57e4551169980cc2 Signed-off-by: Ondrej Fabry --- internal/testbinapi/binapi2001/bond/bond.ba.go | 976 +++++++++++++++++++++ internal/testbinapi/binapi2001/bond/bond_rpc.ba.go | 153 ++++ 2 files changed, 1129 insertions(+) create mode 100644 internal/testbinapi/binapi2001/bond/bond.ba.go create mode 100644 internal/testbinapi/binapi2001/bond/bond_rpc.ba.go (limited to 'internal/testbinapi/binapi2001/bond') diff --git a/internal/testbinapi/binapi2001/bond/bond.ba.go b/internal/testbinapi/binapi2001/bond/bond.ba.go new file mode 100644 index 0000000..acee8b8 --- /dev/null +++ b/internal/testbinapi/binapi2001/bond/bond.ba.go @@ -0,0 +1,976 @@ +// Code generated by GoVPP's binapi-generator. DO NOT EDIT. +// versions: +// binapi-generator: v0.4.0-dev +// VPP: 20.01 +// source: .vppapi/core/bond.api.json + +// Package bond contains generated bindings for API file bond.api. +// +// Contents: +// 2 aliases +// 8 enums +// 14 messages +// +package bond + +import ( + api "git.fd.io/govpp.git/api" + codec "git.fd.io/govpp.git/codec" + "net" + "strconv" +) + +// 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.GoVppAPIPackageIsVersion2 + +const ( + APIFile = "bond" + APIVersion = "2.0.0" + VersionCrc = 0x69f583ad +) + +// BondLbAlgo defines enum 'bond_lb_algo'. +type BondLbAlgo uint32 + +const ( + BOND_API_LB_ALGO_L2 BondLbAlgo = 0 + BOND_API_LB_ALGO_L34 BondLbAlgo = 1 + BOND_API_LB_ALGO_L23 BondLbAlgo = 2 + BOND_API_LB_ALGO_RR BondLbAlgo = 3 + BOND_API_LB_ALGO_BC BondLbAlgo = 4 + BOND_API_LB_ALGO_AB BondLbAlgo = 5 +) + +var ( + BondLbAlgo_name = map[uint32]string{ + 0: "BOND_API_LB_ALGO_L2", + 1: "BOND_API_LB_ALGO_L34", + 2: "BOND_API_LB_ALGO_L23", + 3: "BOND_API_LB_ALGO_RR", + 4: "BOND_API_LB_ALGO_BC", + 5: "BOND_API_LB_ALGO_AB", + } + BondLbAlgo_value = map[string]uint32{ + "BOND_API_LB_ALGO_L2": 0, + "BOND_API_LB_ALGO_L34": 1, + "BOND_API_LB_ALGO_L23": 2, + "BOND_API_LB_ALGO_RR": 3, + "BOND_API_LB_ALGO_BC": 4, + "BOND_API_LB_ALGO_AB": 5, + } +) + +func (x BondLbAlgo) String() string { + s, ok := BondLbAlgo_name[uint32(x)] + if ok { + return s + } + return "BondLbAlgo(" + strconv.Itoa(int(x)) + ")" +} + +// BondMode defines enum 'bond_mode'. +type BondMode uint32 + +const ( + BOND_API_MODE_ROUND_ROBIN BondMode = 1 + BOND_API_MODE_ACTIVE_BACKUP BondMode = 2 + BOND_API_MODE_XOR BondMode = 3 + BOND_API_MODE_BROADCAST BondMode = 4 + BOND_API_MODE_LACP BondMode = 5 +) + +var ( + BondMode_name = map[uint32]string{ + 1: "BOND_API_MODE_ROUND_ROBIN", + 2: "BOND_API_MODE_ACTIVE_BACKUP", + 3: "BOND_API_MODE_XOR", + 4: "BOND_API_MODE_BROADCAST", + 5: "BOND_API_MODE_LACP", + } + BondMode_value = map[string]uint32{ + "BOND_API_MODE_ROUND_ROBIN": 1, + "BOND_API_MODE_ACTIVE_BACKUP": 2, + "BOND_API_MODE_XOR": 3, + "BOND_API_MODE_BROADCAST": 4, + "BOND_API_MODE_LACP": 5, + } +) + +func (x BondMode) String() string { + s, ok := BondMode_name[uint32(x)] + if ok { + return s + } + return "BondMode(" + strconv.Itoa(int(x)) + ")" +} + +// IfStatusFlags defines enum 'if_status_flags'. +type IfStatusFlags uint32 + +const ( + IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1 + IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2 +) + +var ( + IfStatusFlags_name = map[uint32]string{ + 1: "IF_STATUS_API_FLAG_ADMIN_UP", + 2: "IF_STATUS_API_FLAG_LINK_UP", + } + IfStatusFlags_value = map[string]uint32{ + "IF_STATUS_API_FLAG_ADMIN_UP": 1, + "IF_STATUS_API_FLAG_LINK_UP": 2, + } +) + +func (x IfStatusFlags) String() string { + s, ok := IfStatusFlags_name[uint32(x)] + if ok { + return s + } + str := func(n uint32) string { + s, ok := IfStatusFlags_name[uint32(n)] + if ok { + return s + } + return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")" + } + for i := uint32(0); i <= 32; i++ { + val := uint32(x) + if val&(1<