return api.RequestMessage
}
-func (m *MapAddDelRule) Size() int {
+func (m *MapAddDelRule) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Index
size += 1 // m.IsAdd
size += 1 * 16 // m.IP6Dst
return size
}
func (m *MapAddDelRule) 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.Index))
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Index)
buf.EncodeBool(m.IsAdd)
buf.EncodeBytes(m.IP6Dst[:], 16)
- buf.EncodeUint16(uint16(m.Psid))
+ buf.EncodeUint16(m.Psid)
return buf.Bytes(), nil
}
func (m *MapAddDelRule) Unmarshal(b []byte) error {
return api.ReplyMessage
}
-func (m *MapAddDelRuleReply) Size() int {
+func (m *MapAddDelRuleReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *MapAddDelRuleReply) 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 *MapAddDelRuleReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
EaBitsLen uint8 `binapi:"u8,name=ea_bits_len" json:"ea_bits_len,omitempty"`
PsidOffset uint8 `binapi:"u8,name=psid_offset" json:"psid_offset,omitempty"`
PsidLength uint8 `binapi:"u8,name=psid_length" json:"psid_length,omitempty"`
- Mtu uint16 `binapi:"u16,name=mtu,default=%!s(float64=1280)" json:"mtu,omitempty"`
+ Mtu uint16 `binapi:"u16,name=mtu,default=1280" json:"mtu,omitempty"`
Tag string `binapi:"string[64],name=tag" json:"tag,omitempty"`
}
return api.RequestMessage
}
-func (m *MapAddDomain) Size() int {
+func (m *MapAddDomain) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 1 * 16 // m.IP6Prefix.Address
size += 1 // m.IP6Prefix.Len
size += 1 * 4 // m.IP4Prefix.Address
return size
}
func (m *MapAddDomain) 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.EncodeBytes(m.IP6Prefix.Address[:], 16)
- buf.EncodeUint8(uint8(m.IP6Prefix.Len))
+ buf.EncodeUint8(m.IP6Prefix.Len)
buf.EncodeBytes(m.IP4Prefix.Address[:], 4)
- buf.EncodeUint8(uint8(m.IP4Prefix.Len))
+ buf.EncodeUint8(m.IP4Prefix.Len)
buf.EncodeBytes(m.IP6Src.Address[:], 16)
- buf.EncodeUint8(uint8(m.IP6Src.Len))
- buf.EncodeUint8(uint8(m.EaBitsLen))
- buf.EncodeUint8(uint8(m.PsidOffset))
- buf.EncodeUint8(uint8(m.PsidLength))
- buf.EncodeUint16(uint16(m.Mtu))
+ buf.EncodeUint8(m.IP6Src.Len)
+ buf.EncodeUint8(m.EaBitsLen)
+ buf.EncodeUint8(m.PsidOffset)
+ buf.EncodeUint8(m.PsidLength)
+ buf.EncodeUint16(m.Mtu)
buf.EncodeString(m.Tag, 64)
return buf.Bytes(), nil
}
return api.ReplyMessage
}
-func (m *MapAddDomainReply) Size() int {
+func (m *MapAddDomainReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Index
size += 4 // m.Retval
return size
}
func (m *MapAddDomainReply) 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.Index))
- buf.EncodeUint32(uint32(m.Retval))
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Index)
+ buf.EncodeInt32(m.Retval)
return buf.Bytes(), nil
}
func (m *MapAddDomainReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
m.Index = buf.DecodeUint32()
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
return api.RequestMessage
}
-func (m *MapDelDomain) Size() int {
+func (m *MapDelDomain) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Index
return size
}
func (m *MapDelDomain) 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.Index))
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Index)
return buf.Bytes(), nil
}
func (m *MapDelDomain) Unmarshal(b []byte) error {
return api.ReplyMessage
}
-func (m *MapDelDomainReply) Size() int {
+func (m *MapDelDomainReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *MapDelDomainReply) 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 *MapDelDomainReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
return api.ReplyMessage
}
-func (m *MapDomainDetails) Size() int {
+func (m *MapDomainDetails) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.DomainIndex
size += 1 * 16 // m.IP6Prefix.Address
size += 1 // m.IP6Prefix.Len
return size
}
func (m *MapDomainDetails) 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.DomainIndex))
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.DomainIndex)
buf.EncodeBytes(m.IP6Prefix.Address[:], 16)
- buf.EncodeUint8(uint8(m.IP6Prefix.Len))
+ buf.EncodeUint8(m.IP6Prefix.Len)
buf.EncodeBytes(m.IP4Prefix.Address[:], 4)
- buf.EncodeUint8(uint8(m.IP4Prefix.Len))
+ buf.EncodeUint8(m.IP4Prefix.Len)
buf.EncodeBytes(m.IP6Src.Address[:], 16)
- buf.EncodeUint8(uint8(m.IP6Src.Len))
- buf.EncodeUint8(uint8(m.EaBitsLen))
- buf.EncodeUint8(uint8(m.PsidOffset))
- buf.EncodeUint8(uint8(m.PsidLength))
- buf.EncodeUint8(uint8(m.Flags))
- buf.EncodeUint16(uint16(m.Mtu))
+ buf.EncodeUint8(m.IP6Src.Len)
+ buf.EncodeUint8(m.EaBitsLen)
+ buf.EncodeUint8(m.PsidOffset)
+ buf.EncodeUint8(m.PsidLength)
+ buf.EncodeUint8(m.Flags)
+ buf.EncodeUint16(m.Mtu)
buf.EncodeString(m.Tag, 64)
return buf.Bytes(), nil
}
return api.RequestMessage
}
-func (m *MapDomainDump) Size() int {
+func (m *MapDomainDump) Size() (size int) {
if m == nil {
return 0
}
- var size int
return size
}
func (m *MapDomainDump) 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)
return buf.Bytes(), nil
}
func (m *MapDomainDump) Unmarshal(b []byte) error {
return api.RequestMessage
}
-func (m *MapIfEnableDisable) Size() int {
+func (m *MapIfEnableDisable) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.SwIfIndex
size += 1 // m.IsEnable
size += 1 // m.IsTranslation
return size
}
func (m *MapIfEnableDisable) 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.IsEnable)
buf.EncodeBool(m.IsTranslation)
return api.ReplyMessage
}
-func (m *MapIfEnableDisableReply) Size() int {
+func (m *MapIfEnableDisableReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *MapIfEnableDisableReply) 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 *MapIfEnableDisableReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
return api.RequestMessage
}
-func (m *MapParamAddDelPreResolve) Size() int {
+func (m *MapParamAddDelPreResolve) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 1 // m.IsAdd
size += 1 * 4 // m.IP4NhAddress
size += 1 * 16 // m.IP6NhAddress
return size
}
func (m *MapParamAddDelPreResolve) 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.IsAdd)
buf.EncodeBytes(m.IP4NhAddress[:], 4)
buf.EncodeBytes(m.IP6NhAddress[:], 16)
return api.ReplyMessage
}
-func (m *MapParamAddDelPreResolveReply) Size() int {
+func (m *MapParamAddDelPreResolveReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *MapParamAddDelPreResolveReply) 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 *MapParamAddDelPreResolveReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
return api.RequestMessage
}
-func (m *MapParamGet) Size() int {
+func (m *MapParamGet) Size() (size int) {
if m == nil {
return 0
}
- var size int
return size
}
func (m *MapParamGet) 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)
return buf.Bytes(), nil
}
func (m *MapParamGet) Unmarshal(b []byte) error {
return api.ReplyMessage
}
-func (m *MapParamGetReply) Size() int {
+func (m *MapParamGetReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
size += 1 // m.FragInner
size += 1 // m.FragIgnoreDf
return size
}
func (m *MapParamGetReply) 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.EncodeUint8(uint8(m.FragInner))
- buf.EncodeUint8(uint8(m.FragIgnoreDf))
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeUint8(m.FragInner)
+ buf.EncodeUint8(m.FragIgnoreDf)
buf.EncodeBytes(m.ICMPIP4ErrRelaySrc[:], 4)
buf.EncodeBool(m.ICMP6EnableUnreachable)
buf.EncodeBytes(m.IP4NhAddress[:], 4)
buf.EncodeBytes(m.IP6NhAddress[:], 16)
- buf.EncodeUint16(uint16(m.IP4LifetimeMs))
- buf.EncodeUint16(uint16(m.IP4PoolSize))
- buf.EncodeUint32(uint32(m.IP4Buffers))
- buf.EncodeFloat64(float64(m.IP4HtRatio))
+ buf.EncodeUint16(m.IP4LifetimeMs)
+ buf.EncodeUint16(m.IP4PoolSize)
+ buf.EncodeUint32(m.IP4Buffers)
+ buf.EncodeFloat64(m.IP4HtRatio)
buf.EncodeBool(m.SecCheckEnable)
buf.EncodeBool(m.SecCheckFragments)
buf.EncodeBool(m.TcCopy)
- buf.EncodeUint8(uint8(m.TcClass))
+ buf.EncodeUint8(m.TcClass)
return buf.Bytes(), nil
}
func (m *MapParamGetReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
m.FragInner = buf.DecodeUint8()
m.FragIgnoreDf = buf.DecodeUint8()
copy(m.ICMPIP4ErrRelaySrc[:], buf.DecodeBytes(4))
m.IP4LifetimeMs = buf.DecodeUint16()
m.IP4PoolSize = buf.DecodeUint16()
m.IP4Buffers = buf.DecodeUint32()
- m.IP4HtRatio = float64(buf.DecodeFloat64())
+ m.IP4HtRatio = buf.DecodeFloat64()
m.SecCheckEnable = buf.DecodeBool()
m.SecCheckFragments = buf.DecodeBool()
m.TcCopy = buf.DecodeBool()
return api.RequestMessage
}
-func (m *MapParamSetFragmentation) Size() int {
+func (m *MapParamSetFragmentation) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 1 // m.Inner
size += 1 // m.IgnoreDf
return size
}
func (m *MapParamSetFragmentation) 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.Inner)
buf.EncodeBool(m.IgnoreDf)
return buf.Bytes(), nil
return api.ReplyMessage
}
-func (m *MapParamSetFragmentationReply) Size() int {
+func (m *MapParamSetFragmentationReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *MapParamSetFragmentationReply) 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 *MapParamSetFragmentationReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
return api.RequestMessage
}
-func (m *MapParamSetICMP) Size() int {
+func (m *MapParamSetICMP) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 1 * 4 // m.IP4ErrRelaySrc
return size
}
func (m *MapParamSetICMP) 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.EncodeBytes(m.IP4ErrRelaySrc[:], 4)
return buf.Bytes(), nil
}
return api.RequestMessage
}
-func (m *MapParamSetICMP6) Size() int {
+func (m *MapParamSetICMP6) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 1 // m.EnableUnreachable
return size
}
func (m *MapParamSetICMP6) 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.EnableUnreachable)
return buf.Bytes(), nil
}
return api.ReplyMessage
}
-func (m *MapParamSetICMP6Reply) Size() int {
+func (m *MapParamSetICMP6Reply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *MapParamSetICMP6Reply) 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 *MapParamSetICMP6Reply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
return api.ReplyMessage
}
-func (m *MapParamSetICMPReply) Size() int {
+func (m *MapParamSetICMPReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *MapParamSetICMPReply) 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 *MapParamSetICMPReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
return api.RequestMessage
}
-func (m *MapParamSetSecurityCheck) Size() int {
+func (m *MapParamSetSecurityCheck) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 1 // m.Enable
size += 1 // m.Fragments
return size
}
func (m *MapParamSetSecurityCheck) 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.Enable)
buf.EncodeBool(m.Fragments)
return buf.Bytes(), nil
return api.ReplyMessage
}
-func (m *MapParamSetSecurityCheckReply) Size() int {
+func (m *MapParamSetSecurityCheckReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *MapParamSetSecurityCheckReply) 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 *MapParamSetSecurityCheckReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
return api.RequestMessage
}
-func (m *MapParamSetTCP) Size() int {
+func (m *MapParamSetTCP) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 2 // m.TCPMss
return size
}
func (m *MapParamSetTCP) 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.EncodeUint16(uint16(m.TCPMss))
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint16(m.TCPMss)
return buf.Bytes(), nil
}
func (m *MapParamSetTCP) Unmarshal(b []byte) error {
return api.ReplyMessage
}
-func (m *MapParamSetTCPReply) Size() int {
+func (m *MapParamSetTCPReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *MapParamSetTCPReply) 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 *MapParamSetTCPReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
return api.RequestMessage
}
-func (m *MapParamSetTrafficClass) Size() int {
+func (m *MapParamSetTrafficClass) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 1 // m.Copy
size += 1 // m.TcClass
return size
}
func (m *MapParamSetTrafficClass) 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.Copy)
- buf.EncodeUint8(uint8(m.TcClass))
+ buf.EncodeUint8(m.TcClass)
return buf.Bytes(), nil
}
func (m *MapParamSetTrafficClass) Unmarshal(b []byte) error {
return api.ReplyMessage
}
-func (m *MapParamSetTrafficClassReply) Size() int {
+func (m *MapParamSetTrafficClassReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *MapParamSetTrafficClassReply) 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 *MapParamSetTrafficClassReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
return api.ReplyMessage
}
-func (m *MapRuleDetails) Size() int {
+func (m *MapRuleDetails) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 1 * 16 // m.IP6Dst
size += 2 // m.Psid
return size
}
func (m *MapRuleDetails) 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.EncodeBytes(m.IP6Dst[:], 16)
- buf.EncodeUint16(uint16(m.Psid))
+ buf.EncodeUint16(m.Psid)
return buf.Bytes(), nil
}
func (m *MapRuleDetails) Unmarshal(b []byte) error {
return api.RequestMessage
}
-func (m *MapRuleDump) Size() int {
+func (m *MapRuleDump) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.DomainIndex
return size
}
func (m *MapRuleDump) 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.DomainIndex))
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.DomainIndex)
return buf.Bytes(), nil
}
func (m *MapRuleDump) Unmarshal(b []byte) error {
return api.RequestMessage
}
-func (m *MapSummaryStats) Size() int {
+func (m *MapSummaryStats) Size() (size int) {
if m == nil {
return 0
}
- var size int
return size
}
func (m *MapSummaryStats) 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)
return buf.Bytes(), nil
}
func (m *MapSummaryStats) Unmarshal(b []byte) error {
return api.ReplyMessage
}
-func (m *MapSummaryStatsReply) Size() int {
+func (m *MapSummaryStatsReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
size += 8 // m.TotalBindings
size += 8 * 2 // m.TotalPkts
return size
}
func (m *MapSummaryStatsReply) 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.EncodeUint64(uint64(m.TotalBindings))
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeUint64(m.TotalBindings)
for i := 0; i < 2; i++ {
var x uint64
if i < len(m.TotalPkts) {
x = uint64(m.TotalPkts[i])
}
- buf.EncodeUint64(uint64(x))
+ buf.EncodeUint64(x)
}
for i := 0; i < 2; i++ {
var x uint64
if i < len(m.TotalBytes) {
x = uint64(m.TotalBytes[i])
}
- buf.EncodeUint64(uint64(x))
+ buf.EncodeUint64(x)
}
- buf.EncodeUint64(uint64(m.TotalIP4Fragments))
+ buf.EncodeUint64(m.TotalIP4Fragments)
for i := 0; i < 2; i++ {
var x uint64
if i < len(m.TotalSecurityCheck) {
x = uint64(m.TotalSecurityCheck[i])
}
- buf.EncodeUint64(uint64(x))
+ buf.EncodeUint64(x)
}
return buf.Bytes(), nil
}
func (m *MapSummaryStatsReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
m.TotalBindings = buf.DecodeUint64()
m.TotalPkts = make([]uint64, 2)
for i := 0; i < len(m.TotalPkts); i++ {