aboutsummaryrefslogtreecommitdiffstats
path: root/binapi/rd_cp/rd_cp.ba.go
diff options
context:
space:
mode:
Diffstat (limited to 'binapi/rd_cp/rd_cp.ba.go')
-rw-r--r--binapi/rd_cp/rd_cp.ba.go22
1 files changed, 8 insertions, 14 deletions
diff --git a/binapi/rd_cp/rd_cp.ba.go b/binapi/rd_cp/rd_cp.ba.go
index 7fefd79..8cafa0f 100644
--- a/binapi/rd_cp/rd_cp.ba.go
+++ b/binapi/rd_cp/rd_cp.ba.go
@@ -43,23 +43,20 @@ func (*IP6NdAddressAutoconfig) GetMessageType() api.MessageType {
return api.RequestMessage
}
-func (m *IP6NdAddressAutoconfig) Size() int {
+func (m *IP6NdAddressAutoconfig) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.SwIfIndex
size += 1 // m.Enable
size += 1 // m.InstallDefaultRoutes
return size
}
func (m *IP6NdAddressAutoconfig) 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.Enable)
buf.EncodeBool(m.InstallDefaultRoutes)
@@ -85,27 +82,24 @@ func (*IP6NdAddressAutoconfigReply) GetMessageType() api.MessageType {
return api.ReplyMessage
}
-func (m *IP6NdAddressAutoconfigReply) Size() int {
+func (m *IP6NdAddressAutoconfigReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *IP6NdAddressAutoconfigReply) 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 *IP6NdAddressAutoconfigReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}