+// BfdUDPSessionEvent defines message 'bfd_udp_session_event'.
+type BfdUDPSessionEvent struct {
+ PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"`
+ SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ LocalAddr ip_types.Address `binapi:"address,name=local_addr" json:"local_addr,omitempty"`
+ PeerAddr ip_types.Address `binapi:"address,name=peer_addr" json:"peer_addr,omitempty"`
+ State BfdState `binapi:"bfd_state,name=state" json:"state,omitempty"`
+ IsAuthenticated bool `binapi:"bool,name=is_authenticated" json:"is_authenticated,omitempty"`
+ BfdKeyID uint8 `binapi:"u8,name=bfd_key_id" json:"bfd_key_id,omitempty"`
+ ConfKeyID uint32 `binapi:"u32,name=conf_key_id" json:"conf_key_id,omitempty"`
+ RequiredMinRx uint32 `binapi:"u32,name=required_min_rx" json:"required_min_rx,omitempty"`
+ DesiredMinTx uint32 `binapi:"u32,name=desired_min_tx" json:"desired_min_tx,omitempty"`
+ DetectMult uint8 `binapi:"u8,name=detect_mult" json:"detect_mult,omitempty"`
+}
+
+func (m *BfdUDPSessionEvent) Reset() { *m = BfdUDPSessionEvent{} }
+func (*BfdUDPSessionEvent) GetMessageName() string { return "bfd_udp_session_event" }
+func (*BfdUDPSessionEvent) GetCrcString() string { return "8eaaf062" }
+func (*BfdUDPSessionEvent) GetMessageType() api.MessageType {
+ return api.EventMessage
+}
+
+func (m *BfdUDPSessionEvent) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.PID
+ size += 4 // m.SwIfIndex
+ size += 1 // m.LocalAddr.Af
+ size += 1 * 16 // m.LocalAddr.Un
+ size += 1 // m.PeerAddr.Af
+ size += 1 * 16 // m.PeerAddr.Un
+ size += 4 // m.State
+ size += 1 // m.IsAuthenticated
+ size += 1 // m.BfdKeyID
+ size += 4 // m.ConfKeyID
+ size += 4 // m.RequiredMinRx
+ size += 4 // m.DesiredMinTx
+ size += 1 // m.DetectMult
+ return size
+}
+func (m *BfdUDPSessionEvent) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.PID)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint8(uint8(m.LocalAddr.Af))
+ buf.EncodeBytes(m.LocalAddr.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint8(uint8(m.PeerAddr.Af))
+ buf.EncodeBytes(m.PeerAddr.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.State))
+ buf.EncodeBool(m.IsAuthenticated)
+ 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 *BfdUDPSessionEvent) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.PID = buf.DecodeUint32()
+ m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
+ m.LocalAddr.Af = ip_types.AddressFamily(buf.DecodeUint8())
+ copy(m.LocalAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.PeerAddr.Af = ip_types.AddressFamily(buf.DecodeUint8())
+ copy(m.PeerAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.State = BfdState(buf.DecodeUint32())
+ m.IsAuthenticated = buf.DecodeBool()
+ m.BfdKeyID = buf.DecodeUint8()
+ m.ConfKeyID = buf.DecodeUint32()
+ m.RequiredMinRx = buf.DecodeUint32()
+ m.DesiredMinTx = buf.DecodeUint32()
+ m.DetectMult = buf.DecodeUint8()
+ return nil
+}
+