X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=binapi%2Favf%2Favf.ba.go;h=6f93d23f4074346294c59531e4b455806ddd0582;hb=c94a962279858fb13eaacc689f47aed358373e44;hp=436223b8e104bd7ab28b1edc373b7343d72614f2;hpb=d1f24d37bd447b64e402298bb8eb2479681facf9;p=govpp.git diff --git a/binapi/avf/avf.ba.go b/binapi/avf/avf.ba.go index 436223b..6f93d23 100644 --- a/binapi/avf/avf.ba.go +++ b/binapi/avf/avf.ba.go @@ -2,7 +2,6 @@ // versions: // binapi-generator: v0.4.0-dev // VPP: 20.05-release -// source: /usr/share/vpp/api/plugins/avf.api.json // Package avf contains generated bindings for API file avf.api. // @@ -45,11 +44,10 @@ func (*AvfCreate) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *AvfCreate) Size() int { +func (m *AvfCreate) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.PciAddr size += 4 // m.EnableElog size += 2 // m.RxqNum @@ -58,23 +56,21 @@ func (m *AvfCreate) Size() int { return size } func (m *AvfCreate) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.PciAddr)) - buf.EncodeUint32(uint32(m.EnableElog)) - buf.EncodeUint16(uint16(m.RxqNum)) - buf.EncodeUint16(uint16(m.RxqSize)) - buf.EncodeUint16(uint16(m.TxqSize)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.PciAddr) + buf.EncodeInt32(m.EnableElog) + buf.EncodeUint16(m.RxqNum) + buf.EncodeUint16(m.RxqSize) + buf.EncodeUint16(m.TxqSize) return buf.Bytes(), nil } func (m *AvfCreate) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.PciAddr = buf.DecodeUint32() - m.EnableElog = int32(buf.DecodeUint32()) + m.EnableElog = buf.DecodeInt32() m.RxqNum = buf.DecodeUint16() m.RxqSize = buf.DecodeUint16() m.TxqSize = buf.DecodeUint16() @@ -94,29 +90,26 @@ func (*AvfCreateReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *AvfCreateReply) Size() int { +func (m *AvfCreateReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.SwIfIndex return size } func (m *AvfCreateReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } func (m *AvfCreateReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) return nil } @@ -133,21 +126,18 @@ func (*AvfDelete) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *AvfDelete) Size() int { +func (m *AvfDelete) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *AvfDelete) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -169,27 +159,24 @@ func (*AvfDeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *AvfDeleteReply) Size() int { +func (m *AvfDeleteReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *AvfDeleteReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *AvfDeleteReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil }