Code Review
/
govpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
binapigen: fix union size
[govpp.git]
/
binapi
/
dhcp6_ia_na_client_cp
/
dhcp6_ia_na_client_cp.ba.go
diff --git
a/binapi/dhcp6_ia_na_client_cp/dhcp6_ia_na_client_cp.ba.go
b/binapi/dhcp6_ia_na_client_cp/dhcp6_ia_na_client_cp.ba.go
index
41ea756
..
4fcb012
100644
(file)
--- a/
binapi/dhcp6_ia_na_client_cp/dhcp6_ia_na_client_cp.ba.go
+++ b/
binapi/dhcp6_ia_na_client_cp/dhcp6_ia_na_client_cp.ba.go
@@
-42,22
+42,19
@@
func (*DHCP6ClientEnableDisable) GetMessageType() api.MessageType {
return api.RequestMessage
}
return api.RequestMessage
}
-func (m *DHCP6ClientEnableDisable) Size()
int
{
+func (m *DHCP6ClientEnableDisable) Size()
(size int)
{
if m == nil {
return 0
}
if m == nil {
return 0
}
- var size int
size += 4 // m.SwIfIndex
size += 1 // m.Enable
return size
}
func (m *DHCP6ClientEnableDisable) Marshal(b []byte) ([]byte, error) {
size += 4 // m.SwIfIndex
size += 1 // m.Enable
return size
}
func (m *DHCP6ClientEnableDisable) 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.EncodeUint32(uint32(m.SwIfIndex))
buf.EncodeBool(m.Enable)
return buf.Bytes(), nil
buf.EncodeUint32(uint32(m.SwIfIndex))
buf.EncodeBool(m.Enable)
return buf.Bytes(), nil
@@
-83,27
+80,24
@@
func (*DHCP6ClientEnableDisableReply) GetMessageType() api.MessageType {
return api.ReplyMessage
}
return api.ReplyMessage
}
-func (m *DHCP6ClientEnableDisableReply) Size()
int
{
+func (m *DHCP6ClientEnableDisableReply) Size()
(size int)
{
if m == nil {
return 0
}
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *DHCP6ClientEnableDisableReply) Marshal(b []byte) ([]byte, error) {
size += 4 // m.Retval
return size
}
func (m *DHCP6ClientEnableDisableReply) 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 *DHCP6ClientEnableDisableReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
return buf.Bytes(), nil
}
func (m *DHCP6ClientEnableDisableReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval =
int32(buf.DecodeUint32()
)
+ m.Retval =
buf.DecodeInt32(
)
return nil
}
return nil
}