aboutsummaryrefslogtreecommitdiffstats
path: root/binapi/gso/gso.ba.go
diff options
context:
space:
mode:
Diffstat (limited to 'binapi/gso/gso.ba.go')
-rw-r--r--binapi/gso/gso.ba.go22
1 files changed, 8 insertions, 14 deletions
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
}