X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=binapi%2Fgso%2Fgso.ba.go;h=78e7536e893975b8908247dbdc350e24b1892c22;hb=58da9ac6e691a8c660eb8ca838a154e11da0db68;hp=2b2d45ac4d0604845b2cd621c13fe4d40cbe41e5;hpb=a155cd438c6558da266c1c5931361ea088b35653;p=govpp.git diff --git a/binapi/gso/gso.ba.go b/binapi/gso/gso.ba.go index 2b2d45a..78e7536 100644 --- a/binapi/gso/gso.ba.go +++ b/binapi/gso/gso.ba.go @@ -42,22 +42,19 @@ func (*FeatureGsoEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *FeatureGsoEnableDisable) Size() int { +func (m *FeatureGsoEnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.EnableDisable return size } func (m *FeatureGsoEnableDisable) 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)) buf.EncodeBool(m.EnableDisable) return buf.Bytes(), nil @@ -83,27 +80,24 @@ func (*FeatureGsoEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *FeatureGsoEnableDisableReply) Size() int { +func (m *FeatureGsoEnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *FeatureGsoEnableDisableReply) 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 *FeatureGsoEnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil }