summaryrefslogtreecommitdiffstats
path: root/internal/testbinapi/binapi2001/sr_mpls/sr_mpls.ba.go
diff options
context:
space:
mode:
authorOndrej Fabry <ofabry@cisco.com>2020-07-22 04:40:55 +0200
committerOndrej Fabry <ofabry@cisco.com>2020-07-22 04:40:55 +0200
commit58da9ac6e691a8c660eb8ca838a154e11da0db68 (patch)
treea1bbda04c6d0621ce0fc20779276620f1820190b /internal/testbinapi/binapi2001/sr_mpls/sr_mpls.ba.go
parenta155cd438c6558da266c1c5931361ea088b35653 (diff)
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 <ofabry@cisco.com>
Diffstat (limited to 'internal/testbinapi/binapi2001/sr_mpls/sr_mpls.ba.go')
-rw-r--r--internal/testbinapi/binapi2001/sr_mpls/sr_mpls.ba.go502
1 files changed, 502 insertions, 0 deletions
diff --git a/internal/testbinapi/binapi2001/sr_mpls/sr_mpls.ba.go b/internal/testbinapi/binapi2001/sr_mpls/sr_mpls.ba.go
new file mode 100644
index 0000000..2c8f388
--- /dev/null
+++ b/internal/testbinapi/binapi2001/sr_mpls/sr_mpls.ba.go
@@ -0,0 +1,502 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/sr_mpls.api.json
+
+// Package sr_mpls contains generated bindings for API file sr_mpls.api.
+//
+// Contents:
+// 10 messages
+//
+package sr_mpls
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+)
+
+// 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 = "sr_mpls"
+ APIVersion = "1.0.0"
+ VersionCrc = 0x933a0861
+)
+
+// SrMplsPolicyAdd defines message 'sr_mpls_policy_add'.
+type SrMplsPolicyAdd struct {
+ Bsid uint32 `binapi:"u32,name=bsid" json:"bsid,omitempty"`
+ Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"`
+ Type uint8 `binapi:"u8,name=type" json:"type,omitempty"`
+ NSegments uint8 `binapi:"u8,name=n_segments" json:"-"`
+ Segments []uint32 `binapi:"u32[n_segments],name=segments" json:"segments,omitempty"`
+}
+
+func (m *SrMplsPolicyAdd) Reset() { *m = SrMplsPolicyAdd{} }
+func (*SrMplsPolicyAdd) GetMessageName() string { return "sr_mpls_policy_add" }
+func (*SrMplsPolicyAdd) GetCrcString() string { return "6f5b21cc" }
+func (*SrMplsPolicyAdd) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SrMplsPolicyAdd) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Bsid
+ size += 4 // m.Weight
+ size += 1 // m.Type
+ size += 1 // m.NSegments
+ size += 4 * len(m.Segments) // m.Segments
+ return size
+}
+func (m *SrMplsPolicyAdd) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Bsid)
+ buf.EncodeUint32(m.Weight)
+ buf.EncodeUint8(m.Type)
+ buf.EncodeUint8(uint8(len(m.Segments)))
+ for i := 0; i < len(m.Segments); i++ {
+ var x uint32
+ if i < len(m.Segments) {
+ x = uint32(m.Segments[i])
+ }
+ buf.EncodeUint32(x)
+ }
+ return buf.Bytes(), nil
+}
+func (m *SrMplsPolicyAdd) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Bsid = buf.DecodeUint32()
+ m.Weight = buf.DecodeUint32()
+ m.Type = buf.DecodeUint8()
+ m.NSegments = buf.DecodeUint8()
+ m.Segments = make([]uint32, m.NSegments)
+ for i := 0; i < len(m.Segments); i++ {
+ m.Segments[i] = buf.DecodeUint32()
+ }
+ return nil
+}
+
+// SrMplsPolicyAddReply defines message 'sr_mpls_policy_add_reply'.
+type SrMplsPolicyAddReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SrMplsPolicyAddReply) Reset() { *m = SrMplsPolicyAddReply{} }
+func (*SrMplsPolicyAddReply) GetMessageName() string { return "sr_mpls_policy_add_reply" }
+func (*SrMplsPolicyAddReply) GetCrcString() string { return "e8d4e804" }
+func (*SrMplsPolicyAddReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SrMplsPolicyAddReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SrMplsPolicyAddReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ return buf.Bytes(), nil
+}
+func (m *SrMplsPolicyAddReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ return nil
+}
+
+// SrMplsPolicyAssignEndpointColor defines message 'sr_mpls_policy_assign_endpoint_color'.
+type SrMplsPolicyAssignEndpointColor struct {
+ Bsid uint32 `binapi:"u32,name=bsid" json:"bsid,omitempty"`
+ Endpoint []byte `binapi:"u8[16],name=endpoint" json:"endpoint,omitempty"`
+ EndpointType uint8 `binapi:"u8,name=endpoint_type" json:"endpoint_type,omitempty"`
+ Color uint32 `binapi:"u32,name=color" json:"color,omitempty"`
+}
+
+func (m *SrMplsPolicyAssignEndpointColor) Reset() { *m = SrMplsPolicyAssignEndpointColor{} }
+func (*SrMplsPolicyAssignEndpointColor) GetMessageName() string {
+ return "sr_mpls_policy_assign_endpoint_color"
+}
+func (*SrMplsPolicyAssignEndpointColor) GetCrcString() string { return "6c82a6da" }
+func (*SrMplsPolicyAssignEndpointColor) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SrMplsPolicyAssignEndpointColor) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Bsid
+ size += 1 * 16 // m.Endpoint
+ size += 1 // m.EndpointType
+ size += 4 // m.Color
+ return size
+}
+func (m *SrMplsPolicyAssignEndpointColor) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Bsid)
+ buf.EncodeBytes(m.Endpoint, 16)
+ buf.EncodeUint8(m.EndpointType)
+ buf.EncodeUint32(m.Color)
+ return buf.Bytes(), nil
+}
+func (m *SrMplsPolicyAssignEndpointColor) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Bsid = buf.DecodeUint32()
+ m.Endpoint = make([]byte, 16)
+ copy(m.Endpoint, buf.DecodeBytes(len(m.Endpoint)))
+ m.EndpointType = buf.DecodeUint8()
+ m.Color = buf.DecodeUint32()
+ return nil
+}
+
+// SrMplsPolicyAssignEndpointColorReply defines message 'sr_mpls_policy_assign_endpoint_color_reply'.
+type SrMplsPolicyAssignEndpointColorReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SrMplsPolicyAssignEndpointColorReply) Reset() { *m = SrMplsPolicyAssignEndpointColorReply{} }
+func (*SrMplsPolicyAssignEndpointColorReply) GetMessageName() string {
+ return "sr_mpls_policy_assign_endpoint_color_reply"
+}
+func (*SrMplsPolicyAssignEndpointColorReply) GetCrcString() string { return "e8d4e804" }
+func (*SrMplsPolicyAssignEndpointColorReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SrMplsPolicyAssignEndpointColorReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SrMplsPolicyAssignEndpointColorReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ return buf.Bytes(), nil
+}
+func (m *SrMplsPolicyAssignEndpointColorReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ return nil
+}
+
+// SrMplsPolicyDel defines message 'sr_mpls_policy_del'.
+type SrMplsPolicyDel struct {
+ Bsid uint32 `binapi:"u32,name=bsid" json:"bsid,omitempty"`
+}
+
+func (m *SrMplsPolicyDel) Reset() { *m = SrMplsPolicyDel{} }
+func (*SrMplsPolicyDel) GetMessageName() string { return "sr_mpls_policy_del" }
+func (*SrMplsPolicyDel) GetCrcString() string { return "e29d34fa" }
+func (*SrMplsPolicyDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SrMplsPolicyDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Bsid
+ return size
+}
+func (m *SrMplsPolicyDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Bsid)
+ return buf.Bytes(), nil
+}
+func (m *SrMplsPolicyDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Bsid = buf.DecodeUint32()
+ return nil
+}
+
+// SrMplsPolicyDelReply defines message 'sr_mpls_policy_del_reply'.
+type SrMplsPolicyDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SrMplsPolicyDelReply) Reset() { *m = SrMplsPolicyDelReply{} }
+func (*SrMplsPolicyDelReply) GetMessageName() string { return "sr_mpls_policy_del_reply" }
+func (*SrMplsPolicyDelReply) GetCrcString() string { return "e8d4e804" }
+func (*SrMplsPolicyDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SrMplsPolicyDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SrMplsPolicyDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ return buf.Bytes(), nil
+}
+func (m *SrMplsPolicyDelReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ return nil
+}
+
+// SrMplsPolicyMod defines message 'sr_mpls_policy_mod'.
+type SrMplsPolicyMod struct {
+ Bsid uint32 `binapi:"u32,name=bsid" json:"bsid,omitempty"`
+ Operation uint8 `binapi:"u8,name=operation" json:"operation,omitempty"`
+ SlIndex uint32 `binapi:"u32,name=sl_index" json:"sl_index,omitempty"`
+ Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"`
+ NSegments uint8 `binapi:"u8,name=n_segments" json:"-"`
+ Segments []uint32 `binapi:"u32[n_segments],name=segments" json:"segments,omitempty"`
+}
+
+func (m *SrMplsPolicyMod) Reset() { *m = SrMplsPolicyMod{} }
+func (*SrMplsPolicyMod) GetMessageName() string { return "sr_mpls_policy_mod" }
+func (*SrMplsPolicyMod) GetCrcString() string { return "09d338ac" }
+func (*SrMplsPolicyMod) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SrMplsPolicyMod) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Bsid
+ size += 1 // m.Operation
+ size += 4 // m.SlIndex
+ size += 4 // m.Weight
+ size += 1 // m.NSegments
+ size += 4 * len(m.Segments) // m.Segments
+ return size
+}
+func (m *SrMplsPolicyMod) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Bsid)
+ buf.EncodeUint8(m.Operation)
+ buf.EncodeUint32(m.SlIndex)
+ buf.EncodeUint32(m.Weight)
+ buf.EncodeUint8(uint8(len(m.Segments)))
+ for i := 0; i < len(m.Segments); i++ {
+ var x uint32
+ if i < len(m.Segments) {
+ x = uint32(m.Segments[i])
+ }
+ buf.EncodeUint32(x)
+ }
+ return buf.Bytes(), nil
+}
+func (m *SrMplsPolicyMod) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Bsid = buf.DecodeUint32()
+ m.Operation = buf.DecodeUint8()
+ m.SlIndex = buf.DecodeUint32()
+ m.Weight = buf.DecodeUint32()
+ m.NSegments = buf.DecodeUint8()
+ m.Segments = make([]uint32, m.NSegments)
+ for i := 0; i < len(m.Segments); i++ {
+ m.Segments[i] = buf.DecodeUint32()
+ }
+ return nil
+}
+
+// SrMplsPolicyModReply defines message 'sr_mpls_policy_mod_reply'.
+type SrMplsPolicyModReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SrMplsPolicyModReply) Reset() { *m = SrMplsPolicyModReply{} }
+func (*SrMplsPolicyModReply) GetMessageName() string { return "sr_mpls_policy_mod_reply" }
+func (*SrMplsPolicyModReply) GetCrcString() string { return "e8d4e804" }
+func (*SrMplsPolicyModReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SrMplsPolicyModReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SrMplsPolicyModReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ return buf.Bytes(), nil
+}
+func (m *SrMplsPolicyModReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ return nil
+}
+
+// SrMplsSteeringAddDel defines message 'sr_mpls_steering_add_del'.
+type SrMplsSteeringAddDel struct {
+ IsDel uint8 `binapi:"u8,name=is_del" json:"is_del,omitempty"`
+ Bsid uint32 `binapi:"u32,name=bsid" json:"bsid,omitempty"`
+ TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
+ PrefixAddr []byte `binapi:"u8[16],name=prefix_addr" json:"prefix_addr,omitempty"`
+ MaskWidth uint32 `binapi:"u32,name=mask_width" json:"mask_width,omitempty"`
+ TrafficType uint8 `binapi:"u8,name=traffic_type" json:"traffic_type,omitempty"`
+ NextHop []byte `binapi:"u8[16],name=next_hop" json:"next_hop,omitempty"`
+ NhType uint8 `binapi:"u8,name=nh_type" json:"nh_type,omitempty"`
+ Color uint32 `binapi:"u32,name=color" json:"color,omitempty"`
+ CoBits uint8 `binapi:"u8,name=co_bits" json:"co_bits,omitempty"`
+ VPNLabel uint32 `binapi:"u32,name=vpn_label" json:"vpn_label,omitempty"`
+}
+
+func (m *SrMplsSteeringAddDel) Reset() { *m = SrMplsSteeringAddDel{} }
+func (*SrMplsSteeringAddDel) GetMessageName() string { return "sr_mpls_steering_add_del" }
+func (*SrMplsSteeringAddDel) GetCrcString() string { return "1591f94a" }
+func (*SrMplsSteeringAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SrMplsSteeringAddDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsDel
+ size += 4 // m.Bsid
+ size += 4 // m.TableID
+ size += 1 * 16 // m.PrefixAddr
+ size += 4 // m.MaskWidth
+ size += 1 // m.TrafficType
+ size += 1 * 16 // m.NextHop
+ size += 1 // m.NhType
+ size += 4 // m.Color
+ size += 1 // m.CoBits
+ size += 4 // m.VPNLabel
+ return size
+}
+func (m *SrMplsSteeringAddDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsDel)
+ buf.EncodeUint32(m.Bsid)
+ buf.EncodeUint32(m.TableID)
+ buf.EncodeBytes(m.PrefixAddr, 16)
+ buf.EncodeUint32(m.MaskWidth)
+ buf.EncodeUint8(m.TrafficType)
+ buf.EncodeBytes(m.NextHop, 16)
+ buf.EncodeUint8(m.NhType)
+ buf.EncodeUint32(m.Color)
+ buf.EncodeUint8(m.CoBits)
+ buf.EncodeUint32(m.VPNLabel)
+ return buf.Bytes(), nil
+}
+func (m *SrMplsSteeringAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsDel = buf.DecodeUint8()
+ m.Bsid = buf.DecodeUint32()
+ m.TableID = buf.DecodeUint32()
+ m.PrefixAddr = make([]byte, 16)
+ copy(m.PrefixAddr, buf.DecodeBytes(len(m.PrefixAddr)))
+ m.MaskWidth = buf.DecodeUint32()
+ m.TrafficType = buf.DecodeUint8()
+ m.NextHop = make([]byte, 16)
+ copy(m.NextHop, buf.DecodeBytes(len(m.NextHop)))
+ m.NhType = buf.DecodeUint8()
+ m.Color = buf.DecodeUint32()
+ m.CoBits = buf.DecodeUint8()
+ m.VPNLabel = buf.DecodeUint32()
+ return nil
+}
+
+// SrMplsSteeringAddDelReply defines message 'sr_mpls_steering_add_del_reply'.
+type SrMplsSteeringAddDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SrMplsSteeringAddDelReply) Reset() { *m = SrMplsSteeringAddDelReply{} }
+func (*SrMplsSteeringAddDelReply) GetMessageName() string { return "sr_mpls_steering_add_del_reply" }
+func (*SrMplsSteeringAddDelReply) GetCrcString() string { return "e8d4e804" }
+func (*SrMplsSteeringAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SrMplsSteeringAddDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SrMplsSteeringAddDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ return buf.Bytes(), nil
+}
+func (m *SrMplsSteeringAddDelReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_sr_mpls_binapi_init() }
+func file_sr_mpls_binapi_init() {
+ api.RegisterMessage((*SrMplsPolicyAdd)(nil), "sr_mpls_policy_add_6f5b21cc")
+ api.RegisterMessage((*SrMplsPolicyAddReply)(nil), "sr_mpls_policy_add_reply_e8d4e804")
+ api.RegisterMessage((*SrMplsPolicyAssignEndpointColor)(nil), "sr_mpls_policy_assign_endpoint_color_6c82a6da")
+ api.RegisterMessage((*SrMplsPolicyAssignEndpointColorReply)(nil), "sr_mpls_policy_assign_endpoint_color_reply_e8d4e804")
+ api.RegisterMessage((*SrMplsPolicyDel)(nil), "sr_mpls_policy_del_e29d34fa")
+ api.RegisterMessage((*SrMplsPolicyDelReply)(nil), "sr_mpls_policy_del_reply_e8d4e804")
+ api.RegisterMessage((*SrMplsPolicyMod)(nil), "sr_mpls_policy_mod_09d338ac")
+ api.RegisterMessage((*SrMplsPolicyModReply)(nil), "sr_mpls_policy_mod_reply_e8d4e804")
+ api.RegisterMessage((*SrMplsSteeringAddDel)(nil), "sr_mpls_steering_add_del_1591f94a")
+ api.RegisterMessage((*SrMplsSteeringAddDelReply)(nil), "sr_mpls_steering_add_del_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*SrMplsPolicyAdd)(nil),
+ (*SrMplsPolicyAddReply)(nil),
+ (*SrMplsPolicyAssignEndpointColor)(nil),
+ (*SrMplsPolicyAssignEndpointColorReply)(nil),
+ (*SrMplsPolicyDel)(nil),
+ (*SrMplsPolicyDelReply)(nil),
+ (*SrMplsPolicyMod)(nil),
+ (*SrMplsPolicyModReply)(nil),
+ (*SrMplsSteeringAddDel)(nil),
+ (*SrMplsSteeringAddDelReply)(nil),
+ }
+}