Refactoring and fixes
[govpp.git] / binapi / oddbuf / oddbuf.ba.go
index ceceaae..cab5b78 100644 (file)
@@ -1,7 +1,7 @@
 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
 // versions:
 //  binapi-generator: v0.4.0-dev
-//  VPP:              20.05-release
+//  VPP:              21.06-release
 // source: /usr/share/vpp/api/plugins/oddbuf.api.json
 
 // Package oddbuf contains generated bindings for API file oddbuf.api.
@@ -26,10 +26,11 @@ const _ = api.GoVppAPIPackageIsVersion2
 const (
        APIFile    = "oddbuf"
        APIVersion = "0.1.0"
-       VersionCrc = 0x95757869
+       VersionCrc = 0x3a1a2c50
 )
 
 // OddbufEnableDisable defines message 'oddbuf_enable_disable'.
+// InProgress: the message form may change in the future versions
 type OddbufEnableDisable struct {
        EnableDisable bool                           `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"`
        SwIfIndex     interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
@@ -42,22 +43,19 @@ func (*OddbufEnableDisable) GetMessageType() api.MessageType {
        return api.RequestMessage
 }
 
-func (m *OddbufEnableDisable) Size() int {
+func (m *OddbufEnableDisable) Size() (size int) {
        if m == nil {
                return 0
        }
-       var size int
        size += 1 // m.EnableDisable
        size += 4 // m.SwIfIndex
        return size
 }
 func (m *OddbufEnableDisable) 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.EncodeBool(m.EnableDisable)
        buf.EncodeUint32(uint32(m.SwIfIndex))
        return buf.Bytes(), nil
@@ -70,6 +68,7 @@ func (m *OddbufEnableDisable) Unmarshal(b []byte) error {
 }
 
 // OddbufEnableDisableReply defines message 'oddbuf_enable_disable_reply'.
+// InProgress: the message form may change in the future versions
 type OddbufEnableDisableReply struct {
        Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
 }
@@ -81,27 +80,24 @@ func (*OddbufEnableDisableReply) GetMessageType() api.MessageType {
        return api.ReplyMessage
 }
 
-func (m *OddbufEnableDisableReply) Size() int {
+func (m *OddbufEnableDisableReply) Size() (size int) {
        if m == nil {
                return 0
        }
-       var size int
        size += 4 // m.Retval
        return size
 }
 func (m *OddbufEnableDisableReply) 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 *OddbufEnableDisableReply) Unmarshal(b []byte) error {
        buf := codec.NewBuffer(b)
-       m.Retval = int32(buf.DecodeUint32())
+       m.Retval = buf.DecodeInt32()
        return nil
 }