X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=binapi%2Fioam_export%2Fioam_export.ba.go;h=47dd4e2d560269bddd8b77109191b472973a70db;hb=43cd23926d5eec359d4b554a4330e1aa596c76de;hp=b95f5068ca39107c46c27c05e5ee7ad645ae24a7;hpb=d1f24d37bd447b64e402298bb8eb2479681facf9;p=govpp.git diff --git a/binapi/ioam_export/ioam_export.ba.go b/binapi/ioam_export/ioam_export.ba.go index b95f506..47dd4e2 100644 --- a/binapi/ioam_export/ioam_export.ba.go +++ b/binapi/ioam_export/ioam_export.ba.go @@ -43,23 +43,20 @@ func (*IoamExportIP6EnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IoamExportIP6EnableDisable) Size() int { +func (m *IoamExportIP6EnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsDisable size += 1 * 4 // m.CollectorAddress size += 1 * 4 // m.SrcAddress return size } func (m *IoamExportIP6EnableDisable) 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.IsDisable) buf.EncodeBytes(m.CollectorAddress[:], 4) buf.EncodeBytes(m.SrcAddress[:], 4) @@ -87,27 +84,24 @@ func (*IoamExportIP6EnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IoamExportIP6EnableDisableReply) Size() int { +func (m *IoamExportIP6EnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *IoamExportIP6EnableDisableReply) 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 *IoamExportIP6EnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil }