package bfd
import (
+ "strconv"
+
api "git.fd.io/govpp.git/api"
interface_types "git.fd.io/govpp.git/binapi/interface_types"
ip_types "git.fd.io/govpp.git/binapi/ip_types"
codec "git.fd.io/govpp.git/codec"
- "strconv"
)
// This is a compile-time assertion to ensure that this generated file
return api.RequestMessage
}
-func (m *BfdAuthDelKey) Size() int {
+func (m *BfdAuthDelKey) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.ConfKeyID
return size
}
func (m *BfdAuthDelKey) 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.ConfKeyID))
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.ConfKeyID)
return buf.Bytes(), nil
}
func (m *BfdAuthDelKey) Unmarshal(b []byte) error {
return api.ReplyMessage
}
-func (m *BfdAuthDelKeyReply) Size() int {
+func (m *BfdAuthDelKeyReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *BfdAuthDelKeyReply) 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 *BfdAuthDelKeyReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
return api.ReplyMessage
}
-func (m *BfdAuthKeysDetails) Size() int {
+func (m *BfdAuthKeysDetails) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.ConfKeyID
size += 4 // m.UseCount
size += 1 // m.AuthType
return size
}
func (m *BfdAuthKeysDetails) 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.ConfKeyID))
- buf.EncodeUint32(uint32(m.UseCount))
- buf.EncodeUint8(uint8(m.AuthType))
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.ConfKeyID)
+ buf.EncodeUint32(m.UseCount)
+ buf.EncodeUint8(m.AuthType)
return buf.Bytes(), nil
}
func (m *BfdAuthKeysDetails) Unmarshal(b []byte) error {
return api.RequestMessage
}
-func (m *BfdAuthKeysDump) Size() int {
+func (m *BfdAuthKeysDump) Size() (size int) {
if m == nil {
return 0
}
- var size int
return size
}
func (m *BfdAuthKeysDump) 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 *BfdAuthKeysDump) Unmarshal(b []byte) error {
return api.RequestMessage
}
-func (m *BfdAuthSetKey) Size() int {
+func (m *BfdAuthSetKey) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.ConfKeyID
size += 1 // m.KeyLen
size += 1 // m.AuthType
return size
}
func (m *BfdAuthSetKey) 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.ConfKeyID))
- buf.EncodeUint8(uint8(m.KeyLen))
- buf.EncodeUint8(uint8(m.AuthType))
- buf.EncodeBytes(m.Key[:], 20)
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.ConfKeyID)
+ buf.EncodeUint8(m.KeyLen)
+ buf.EncodeUint8(m.AuthType)
+ buf.EncodeBytes(m.Key, 20)
return buf.Bytes(), nil
}
func (m *BfdAuthSetKey) Unmarshal(b []byte) error {
m.ConfKeyID = buf.DecodeUint32()
m.KeyLen = buf.DecodeUint8()
m.AuthType = buf.DecodeUint8()
- copy(m.Key[:], buf.DecodeBytes(20))
+ m.Key = make([]byte, 20)
+ copy(m.Key, buf.DecodeBytes(len(m.Key)))
return nil
}
return api.ReplyMessage
}
-func (m *BfdAuthSetKeyReply) Size() int {
+func (m *BfdAuthSetKeyReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *BfdAuthSetKeyReply) 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 *BfdAuthSetKeyReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
return api.RequestMessage
}
-func (m *BfdUDPAdd) Size() int {
+func (m *BfdUDPAdd) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.SwIfIndex
size += 4 // m.DesiredMinTx
size += 4 // m.RequiredMinRx
return size
}
func (m *BfdUDPAdd) 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.EncodeUint32(uint32(m.DesiredMinTx))
- buf.EncodeUint32(uint32(m.RequiredMinRx))
+ buf.EncodeUint32(m.DesiredMinTx)
+ buf.EncodeUint32(m.RequiredMinRx)
buf.EncodeUint8(uint8(m.LocalAddr.Af))
- buf.EncodeBytes(m.LocalAddr.Un.XXX_UnionData[:], 0)
+ buf.EncodeBytes(m.LocalAddr.Un.XXX_UnionData[:], 16)
buf.EncodeUint8(uint8(m.PeerAddr.Af))
- buf.EncodeBytes(m.PeerAddr.Un.XXX_UnionData[:], 0)
- buf.EncodeUint8(uint8(m.DetectMult))
+ buf.EncodeBytes(m.PeerAddr.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint8(m.DetectMult)
buf.EncodeBool(m.IsAuthenticated)
- buf.EncodeUint8(uint8(m.BfdKeyID))
- buf.EncodeUint32(uint32(m.ConfKeyID))
+ buf.EncodeUint8(m.BfdKeyID)
+ buf.EncodeUint32(m.ConfKeyID)
return buf.Bytes(), nil
}
func (m *BfdUDPAdd) Unmarshal(b []byte) error {
return api.ReplyMessage
}
-func (m *BfdUDPAddReply) Size() int {
+func (m *BfdUDPAddReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *BfdUDPAddReply) 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 *BfdUDPAddReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
return api.RequestMessage
}
-func (m *BfdUDPAuthActivate) Size() int {
+func (m *BfdUDPAuthActivate) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.SwIfIndex
size += 1 // m.LocalAddr.Af
size += 1 * 16 // m.LocalAddr.Un
return size
}
func (m *BfdUDPAuthActivate) 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.EncodeUint8(uint8(m.LocalAddr.Af))
- buf.EncodeBytes(m.LocalAddr.Un.XXX_UnionData[:], 0)
+ buf.EncodeBytes(m.LocalAddr.Un.XXX_UnionData[:], 16)
buf.EncodeUint8(uint8(m.PeerAddr.Af))
- buf.EncodeBytes(m.PeerAddr.Un.XXX_UnionData[:], 0)
+ buf.EncodeBytes(m.PeerAddr.Un.XXX_UnionData[:], 16)
buf.EncodeBool(m.IsDelayed)
- buf.EncodeUint8(uint8(m.BfdKeyID))
- buf.EncodeUint32(uint32(m.ConfKeyID))
+ buf.EncodeUint8(m.BfdKeyID)
+ buf.EncodeUint32(m.ConfKeyID)
return buf.Bytes(), nil
}
func (m *BfdUDPAuthActivate) Unmarshal(b []byte) error {
return api.ReplyMessage
}
-func (m *BfdUDPAuthActivateReply) Size() int {
+func (m *BfdUDPAuthActivateReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *BfdUDPAuthActivateReply) 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 *BfdUDPAuthActivateReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
return api.RequestMessage
}
-func (m *BfdUDPAuthDeactivate) Size() int {
+func (m *BfdUDPAuthDeactivate) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.SwIfIndex
size += 1 // m.LocalAddr.Af
size += 1 * 16 // m.LocalAddr.Un
return size
}
func (m *BfdUDPAuthDeactivate) 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.EncodeUint8(uint8(m.LocalAddr.Af))
- buf.EncodeBytes(m.LocalAddr.Un.XXX_UnionData[:], 0)
+ buf.EncodeBytes(m.LocalAddr.Un.XXX_UnionData[:], 16)
buf.EncodeUint8(uint8(m.PeerAddr.Af))
- buf.EncodeBytes(m.PeerAddr.Un.XXX_UnionData[:], 0)
+ buf.EncodeBytes(m.PeerAddr.Un.XXX_UnionData[:], 16)
buf.EncodeBool(m.IsDelayed)
return buf.Bytes(), nil
}
return api.ReplyMessage
}
-func (m *BfdUDPAuthDeactivateReply) Size() int {
+func (m *BfdUDPAuthDeactivateReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *BfdUDPAuthDeactivateReply) 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 *BfdUDPAuthDeactivateReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
return api.RequestMessage
}
-func (m *BfdUDPDel) Size() int {
+func (m *BfdUDPDel) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.SwIfIndex
size += 1 // m.LocalAddr.Af
size += 1 * 16 // m.LocalAddr.Un
return size
}
func (m *BfdUDPDel) 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.EncodeUint8(uint8(m.LocalAddr.Af))
- buf.EncodeBytes(m.LocalAddr.Un.XXX_UnionData[:], 0)
+ buf.EncodeBytes(m.LocalAddr.Un.XXX_UnionData[:], 16)
buf.EncodeUint8(uint8(m.PeerAddr.Af))
- buf.EncodeBytes(m.PeerAddr.Un.XXX_UnionData[:], 0)
+ buf.EncodeBytes(m.PeerAddr.Un.XXX_UnionData[:], 16)
return buf.Bytes(), nil
}
func (m *BfdUDPDel) Unmarshal(b []byte) error {
return api.RequestMessage
}
-func (m *BfdUDPDelEchoSource) Size() int {
+func (m *BfdUDPDelEchoSource) Size() (size int) {
if m == nil {
return 0
}
- var size int
return size
}
func (m *BfdUDPDelEchoSource) 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 *BfdUDPDelEchoSource) Unmarshal(b []byte) error {
return api.ReplyMessage
}
-func (m *BfdUDPDelEchoSourceReply) Size() int {
+func (m *BfdUDPDelEchoSourceReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *BfdUDPDelEchoSourceReply) 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 *BfdUDPDelEchoSourceReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
return api.ReplyMessage
}
-func (m *BfdUDPDelReply) Size() int {
+func (m *BfdUDPDelReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *BfdUDPDelReply) 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 *BfdUDPDelReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
return api.RequestMessage
}
-func (m *BfdUDPGetEchoSource) Size() int {
+func (m *BfdUDPGetEchoSource) Size() (size int) {
if m == nil {
return 0
}
- var size int
return size
}
func (m *BfdUDPGetEchoSource) 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 *BfdUDPGetEchoSource) Unmarshal(b []byte) error {
return api.ReplyMessage
}
-func (m *BfdUDPGetEchoSourceReply) Size() int {
+func (m *BfdUDPGetEchoSourceReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
size += 4 // m.SwIfIndex
size += 1 // m.IsSet
return size
}
func (m *BfdUDPGetEchoSourceReply) 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)
buf.EncodeUint32(uint32(m.SwIfIndex))
buf.EncodeBool(m.IsSet)
buf.EncodeBool(m.HaveUsableIP4)
}
func (m *BfdUDPGetEchoSourceReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
m.IsSet = buf.DecodeBool()
m.HaveUsableIP4 = buf.DecodeBool()
return api.RequestMessage
}
-func (m *BfdUDPMod) Size() int {
+func (m *BfdUDPMod) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.SwIfIndex
size += 4 // m.DesiredMinTx
size += 4 // m.RequiredMinRx
return size
}
func (m *BfdUDPMod) 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.EncodeUint32(uint32(m.DesiredMinTx))
- buf.EncodeUint32(uint32(m.RequiredMinRx))
+ buf.EncodeUint32(m.DesiredMinTx)
+ buf.EncodeUint32(m.RequiredMinRx)
buf.EncodeUint8(uint8(m.LocalAddr.Af))
- buf.EncodeBytes(m.LocalAddr.Un.XXX_UnionData[:], 0)
+ buf.EncodeBytes(m.LocalAddr.Un.XXX_UnionData[:], 16)
buf.EncodeUint8(uint8(m.PeerAddr.Af))
- buf.EncodeBytes(m.PeerAddr.Un.XXX_UnionData[:], 0)
- buf.EncodeUint8(uint8(m.DetectMult))
+ buf.EncodeBytes(m.PeerAddr.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint8(m.DetectMult)
return buf.Bytes(), nil
}
func (m *BfdUDPMod) Unmarshal(b []byte) error {
return api.ReplyMessage
}
-func (m *BfdUDPModReply) Size() int {
+func (m *BfdUDPModReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *BfdUDPModReply) 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 *BfdUDPModReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
return api.ReplyMessage
}
-func (m *BfdUDPSessionDetails) Size() int {
+func (m *BfdUDPSessionDetails) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.SwIfIndex
size += 1 // m.LocalAddr.Af
size += 1 * 16 // m.LocalAddr.Un
return size
}
func (m *BfdUDPSessionDetails) 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.EncodeUint8(uint8(m.LocalAddr.Af))
- buf.EncodeBytes(m.LocalAddr.Un.XXX_UnionData[:], 0)
+ buf.EncodeBytes(m.LocalAddr.Un.XXX_UnionData[:], 16)
buf.EncodeUint8(uint8(m.PeerAddr.Af))
- buf.EncodeBytes(m.PeerAddr.Un.XXX_UnionData[:], 0)
+ buf.EncodeBytes(m.PeerAddr.Un.XXX_UnionData[:], 16)
buf.EncodeUint32(uint32(m.State))
buf.EncodeBool(m.IsAuthenticated)
- buf.EncodeUint8(uint8(m.BfdKeyID))
- buf.EncodeUint32(uint32(m.ConfKeyID))
- buf.EncodeUint32(uint32(m.RequiredMinRx))
- buf.EncodeUint32(uint32(m.DesiredMinTx))
- buf.EncodeUint8(uint8(m.DetectMult))
+ buf.EncodeUint8(m.BfdKeyID)
+ buf.EncodeUint32(m.ConfKeyID)
+ buf.EncodeUint32(m.RequiredMinRx)
+ buf.EncodeUint32(m.DesiredMinTx)
+ buf.EncodeUint8(m.DetectMult)
return buf.Bytes(), nil
}
func (m *BfdUDPSessionDetails) Unmarshal(b []byte) error {
return api.RequestMessage
}
-func (m *BfdUDPSessionDump) Size() int {
+func (m *BfdUDPSessionDump) Size() (size int) {
if m == nil {
return 0
}
- var size int
return size
}
func (m *BfdUDPSessionDump) 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 *BfdUDPSessionDump) Unmarshal(b []byte) error {
return api.RequestMessage
}
-func (m *BfdUDPSessionSetFlags) Size() int {
+func (m *BfdUDPSessionSetFlags) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.SwIfIndex
size += 1 // m.LocalAddr.Af
size += 1 * 16 // m.LocalAddr.Un
return size
}
func (m *BfdUDPSessionSetFlags) 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.EncodeUint8(uint8(m.LocalAddr.Af))
- buf.EncodeBytes(m.LocalAddr.Un.XXX_UnionData[:], 0)
+ buf.EncodeBytes(m.LocalAddr.Un.XXX_UnionData[:], 16)
buf.EncodeUint8(uint8(m.PeerAddr.Af))
- buf.EncodeBytes(m.PeerAddr.Un.XXX_UnionData[:], 0)
+ buf.EncodeBytes(m.PeerAddr.Un.XXX_UnionData[:], 16)
buf.EncodeUint32(uint32(m.Flags))
return buf.Bytes(), nil
}
return api.ReplyMessage
}
-func (m *BfdUDPSessionSetFlagsReply) Size() int {
+func (m *BfdUDPSessionSetFlagsReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *BfdUDPSessionSetFlagsReply) 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 *BfdUDPSessionSetFlagsReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
return api.RequestMessage
}
-func (m *BfdUDPSetEchoSource) Size() int {
+func (m *BfdUDPSetEchoSource) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.SwIfIndex
return size
}
func (m *BfdUDPSetEchoSource) 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))
return buf.Bytes(), nil
}
return api.ReplyMessage
}
-func (m *BfdUDPSetEchoSourceReply) Size() int {
+func (m *BfdUDPSetEchoSourceReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *BfdUDPSetEchoSourceReply) 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 *BfdUDPSetEchoSourceReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
return api.RequestMessage
}
-func (m *WantBfdEvents) Size() int {
+func (m *WantBfdEvents) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 1 // m.EnableDisable
size += 4 // m.PID
return size
}
func (m *WantBfdEvents) 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.EnableDisable)
- buf.EncodeUint32(uint32(m.PID))
+ buf.EncodeUint32(m.PID)
return buf.Bytes(), nil
}
func (m *WantBfdEvents) Unmarshal(b []byte) error {
return api.ReplyMessage
}
-func (m *WantBfdEventsReply) Size() int {
+func (m *WantBfdEventsReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *WantBfdEventsReply) 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 *WantBfdEventsReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}