Code Review
/
govpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fix binapigen decoding and minor improvements
[govpp.git]
/
binapi
/
ioam_cache
/
ioam_cache.ba.go
diff --git
a/binapi/ioam_cache/ioam_cache.ba.go
b/binapi/ioam_cache/ioam_cache.ba.go
index
d48b15b
..
2f9f0ef
100644
(file)
--- a/
binapi/ioam_cache/ioam_cache.ba.go
+++ b/
binapi/ioam_cache/ioam_cache.ba.go
@@
-40,21
+40,18
@@
func (*IoamCacheIP6EnableDisable) GetMessageType() api.MessageType {
return api.RequestMessage
}
return api.RequestMessage
}
-func (m *IoamCacheIP6EnableDisable) Size()
int
{
+func (m *IoamCacheIP6EnableDisable) Size()
(size int)
{
if m == nil {
return 0
}
if m == nil {
return 0
}
- var size int
size += 1 // m.IsDisable
return size
}
func (m *IoamCacheIP6EnableDisable) Marshal(b []byte) ([]byte, error) {
size += 1 // m.IsDisable
return size
}
func (m *IoamCacheIP6EnableDisable) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
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)
return buf.Bytes(), nil
}
buf.EncodeBool(m.IsDisable)
return buf.Bytes(), nil
}
@@
-78,27
+75,24
@@
func (*IoamCacheIP6EnableDisableReply) GetMessageType() api.MessageType {
return api.ReplyMessage
}
return api.ReplyMessage
}
-func (m *IoamCacheIP6EnableDisableReply) Size()
int
{
+func (m *IoamCacheIP6EnableDisableReply) Size()
(size int)
{
if m == nil {
return 0
}
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *IoamCacheIP6EnableDisableReply) Marshal(b []byte) ([]byte, error) {
size += 4 // m.Retval
return size
}
func (m *IoamCacheIP6EnableDisableReply) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
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 *IoamCacheIP6EnableDisableReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
return buf.Bytes(), nil
}
func (m *IoamCacheIP6EnableDisableReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval =
int32(buf.DecodeUint32()
)
+ m.Retval =
buf.DecodeInt32(
)
return nil
}
return nil
}