Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018-present Open Networking Foundation |
| 3 | |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Scott Baker | dbd960e | 2020-02-28 08:57:51 -0800 | [diff] [blame] | 17 | // Package core provides APIs for the openOLT adapter |
| 18 | package core |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 19 | |
| 20 | import ( |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 21 | "context" |
Devmalya Paul | a1efa64 | 2020-04-20 01:36:43 -0400 | [diff] [blame] | 22 | "errors" |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 23 | "fmt" |
Naga Manjunath | 9546b91 | 2019-11-28 20:56:20 +0530 | [diff] [blame] | 24 | "strconv" |
Naga Manjunath | a8dc937 | 2019-10-31 23:01:18 +0530 | [diff] [blame] | 25 | |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 26 | ic "github.com/opencord/voltha-protos/v5/go/inter_container" |
| 27 | |
| 28 | "github.com/opencord/voltha-lib-go/v7/pkg/events/eventif" |
| 29 | "github.com/opencord/voltha-lib-go/v7/pkg/log" |
Thomas Lee S | 94109f1 | 2020-03-03 16:39:29 +0530 | [diff] [blame] | 30 | "github.com/opencord/voltha-openolt-adapter/internal/pkg/olterrors" |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 31 | "github.com/opencord/voltha-protos/v5/go/common" |
| 32 | oop "github.com/opencord/voltha-protos/v5/go/openolt" |
| 33 | "github.com/opencord/voltha-protos/v5/go/voltha" |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 34 | ) |
| 35 | |
| 36 | const ( |
Devmalya Paul | 41a762d | 2020-03-01 18:56:54 -0500 | [diff] [blame] | 37 | onuDiscoveryEvent = "ONU_DISCOVERY" |
| 38 | onuLosEvent = "ONU_LOSS_OF_SIGNAL" |
| 39 | onuLobEvent = "ONU_LOSS_OF_BURST" |
| 40 | onuLopcMissEvent = "ONU_LOPC_MISS" |
| 41 | onuLopcMicErrorEvent = "ONU_LOPC_MIC_ERROR" |
| 42 | oltLosEvent = "OLT_LOSS_OF_SIGNAL" |
Gamze Abaka | 07868a5 | 2020-12-17 14:19:28 +0000 | [diff] [blame] | 43 | oltCommFailure = "OLT_COMMUNICATION_FAILURE" |
Devmalya Paul | 41a762d | 2020-03-01 18:56:54 -0500 | [diff] [blame] | 44 | oltIndicationDown = "OLT_DOWN_INDICATION" |
| 45 | onuDyingGaspEvent = "ONU_DYING_GASP" |
| 46 | onuSignalsFailEvent = "ONU_SIGNALS_FAIL" |
| 47 | onuStartupFailEvent = "ONU_STARTUP_FAIL" |
| 48 | onuSignalDegradeEvent = "ONU_SIGNAL_DEGRADE" |
| 49 | onuDriftOfWindowEvent = "ONU_DRIFT_OF_WINDOW" |
| 50 | onuActivationFailEvent = "ONU_ACTIVATION_FAIL" |
Devmalya Paul | 41a762d | 2020-03-01 18:56:54 -0500 | [diff] [blame] | 51 | onuLossOmciEvent = "ONU_LOSS_OF_OMCI_CHANNEL" |
| 52 | onuLossOfKeySyncEvent = "ONU_LOSS_OF_KEY_SYNC" |
| 53 | onuLossOfFrameEvent = "ONU_LOSS_OF_FRAME" |
| 54 | onuLossOfPloamEvent = "ONU_LOSS_OF_PLOAM" |
| 55 | ponIntfDownIndiction = "OLT_PON_INTERFACE_DOWN" |
| 56 | onuDeactivationFailureEvent = "ONU_DEACTIVATION_FAILURE" |
| 57 | onuRemoteDefectIndication = "ONU_REMOTE_DEFECT" |
| 58 | onuLossOfGEMChannelDelineationEvent = "ONU_LOSS_OF_GEM_CHANNEL_DELINEATION" |
| 59 | onuPhysicalEquipmentErrorEvent = "ONU_PHYSICAL_EQUIPMENT_ERROR" |
| 60 | onuLossOfAcknowledgementEvent = "ONU_LOSS_OF_ACKNOWLEDGEMENT" |
Devmalya Paul | eb5294e | 2020-03-19 03:01:39 -0400 | [diff] [blame] | 61 | onuDifferentialReachExceededEvent = "ONU_DIFFERENTIAL_REACH_EXCEEDED" |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 62 | ) |
| 63 | |
| 64 | const ( |
Naga Manjunath | 9546b91 | 2019-11-28 20:56:20 +0530 | [diff] [blame] | 65 | // statusCheckOn represents status check On |
| 66 | statusCheckOn = "on" |
| 67 | // statusCheckOff represents status check Off |
| 68 | statusCheckOff = "off" |
| 69 | // operationStateUp represents operation state Up |
| 70 | operationStateUp = "up" |
| 71 | // operationStateDown represents operation state Down |
| 72 | operationStateDown = "down" |
| 73 | // base10 represents base 10 conversion |
| 74 | base10 = 10 |
| 75 | ) |
| 76 | |
Amit Ghosh | 502056b | 2020-07-15 09:15:48 +0100 | [diff] [blame] | 77 | const ( |
Gamze Abaka | 07868a5 | 2020-12-17 14:19:28 +0000 | [diff] [blame] | 78 | // ContextOltAdminState is for the admin state of the Olt in the context of the event |
| 79 | ContextOltAdminState = "admin-state" |
| 80 | // ContextOltConnectState is for the connect state of the Olt in the context of the event |
| 81 | ContextOltConnectState = "connect-state" |
Amit Ghosh | 502056b | 2020-07-15 09:15:48 +0100 | [diff] [blame] | 82 | // ContextOltOperState is for the operational state of the Olt in the context of the event |
| 83 | ContextOltOperState = "oper-state" |
Gamze Abaka | 07868a5 | 2020-12-17 14:19:28 +0000 | [diff] [blame] | 84 | // ContextOltVendor is for the Olt vendor in the context of the event |
| 85 | ContextOltVendor = "vendor" |
| 86 | // ContextOltType is for the Olt type in the context of the event |
| 87 | ContextOltType = "type" |
| 88 | // ContextOltParentID is for the Olt parent id in the context of the event |
| 89 | ContextOltParentID = "parent-id" |
| 90 | // ContextOltParentPortNo is for the Olt parent port no in the context of the event |
| 91 | ContextOltParentPortNo = "parent-port-no" |
| 92 | // ContextOltFirmwareVersion is for the Olt firmware version in the context of the event |
| 93 | ContextOltFirmwareVersion = "firmware-version" |
| 94 | // ContextOltHardwareVersion is for the Olt hardware version in the context of the event |
| 95 | ContextOltHardwareVersion = "hardware-version" |
| 96 | // ContextOltSerialNumber is for the serial number of the OLT |
| 97 | ContextOltSerialNumber = "serial-number" |
| 98 | // ContextOltMacAddress is for the OLT mac address |
| 99 | ContextOltMacAddress = "mac-address" |
| 100 | // ContextDeviceID is for the device id in the context of the event |
| 101 | ContextDeviceID = "id" |
Amit Ghosh | 502056b | 2020-07-15 09:15:48 +0100 | [diff] [blame] | 102 | // ContextOnuOnuID is for the Onu Id in the context of the event |
| 103 | ContextOnuOnuID = "onu-id" |
| 104 | // ContextOnuPonIntfID is for the PON interface Id on which the Onu Event occurred |
| 105 | ContextOnuPonIntfID = "intf-id" |
| 106 | // ContextOnuSerialNumber is for the serial number of the ONU |
| 107 | ContextOnuSerialNumber = "serial-number" |
| 108 | // ContextOnuDeviceID is for the device id of the ONU generated by VOLTHA |
| 109 | ContextOnuDeviceID = "onu-device-id" |
| 110 | // ContextOltPonIntfID is for the PON interface Id on an OLT event |
| 111 | ContextOltPonIntfID = "intf-id" |
| 112 | // ContextOnuFailureReaseon is for the reason of failure of/at ONU indicated by the event |
| 113 | ContextOnuFailureReaseon = "fail-reason" |
| 114 | // ContextOnuDrift is for the drift of an ONU in the context of an event |
| 115 | ContextOnuDrift = "drift" |
| 116 | // ContextOnuNewEqd is for the New Eqd of an ONU in the context of an event |
| 117 | ContextOnuNewEqd = "new-eqd" |
| 118 | // ContextOnuInverseBitErrorRate is for the inverse bit error rate in the context of an ONU event |
| 119 | ContextOnuInverseBitErrorRate = "inverse-bit-error-rate" |
| 120 | // ContextOltPonIntfOperState is for the operational state of a PON port in the context of an OLT event |
| 121 | ContextOltPonIntfOperState = "oper-state" |
| 122 | // ContextOnuRemoteDefectIndicatorCount is for the rdi in the context of an ONU event |
| 123 | ContextOnuRemoteDefectIndicatorCount = "rdi-count" |
| 124 | // ContextOnuDelineationErrors is for the delineation errors if present in an ONU events context |
| 125 | ContextOnuDelineationErrors = "delineation-errors" |
| 126 | // ContextOnuDifferentialDistance is for the differential distance in an ONU event context |
| 127 | ContextOnuDifferentialDistance = "differential-distance" |
ssiddiqui | 04386ee | 2021-08-23 21:58:25 +0530 | [diff] [blame] | 128 | // ContextOltPonTechnology is to indicate the pon-technology type, ie, 'GPON' or 'XGS-PON' (TODO check for combo?) |
| 129 | ContextOltPonTechnology = "pon-technology" |
| 130 | // ContextOltPortLabel is to indicate the string label of the pon-port, example: pon-0 |
| 131 | ContextOltPortLabel = "port-label" |
Amit Ghosh | 502056b | 2020-07-15 09:15:48 +0100 | [diff] [blame] | 132 | ) |
| 133 | |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 134 | // OpenOltEventMgr struct contains |
| 135 | type OpenOltEventMgr struct { |
Himani Chawla | cd40780 | 2020-12-10 12:08:59 +0530 | [diff] [blame] | 136 | eventProxy eventif.EventProxy |
Devmalya Paul | 90ca301 | 2019-09-02 21:55:45 -0400 | [diff] [blame] | 137 | handler *DeviceHandler |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 138 | } |
| 139 | |
| 140 | // NewEventMgr is a Function to get a new event manager struct for the OpenOLT to process and publish OpenOLT event |
Himani Chawla | cd40780 | 2020-12-10 12:08:59 +0530 | [diff] [blame] | 141 | func NewEventMgr(eventProxy eventif.EventProxy, handler *DeviceHandler) *OpenOltEventMgr { |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 142 | var em OpenOltEventMgr |
| 143 | em.eventProxy = eventProxy |
Devmalya Paul | 90ca301 | 2019-09-02 21:55:45 -0400 | [diff] [blame] | 144 | em.handler = handler |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 145 | return &em |
| 146 | } |
| 147 | |
| 148 | // ProcessEvents is function to process and publish OpenOLT event |
Devmalya Paul | 41a762d | 2020-03-01 18:56:54 -0500 | [diff] [blame] | 149 | // nolint: gocyclo |
Kent Hagerman | e6ff101 | 2020-07-14 15:07:53 -0400 | [diff] [blame] | 150 | func (em *OpenOltEventMgr) ProcessEvents(ctx context.Context, alarmInd *oop.AlarmIndication, deviceID string, raisedTs int64) { |
Naga Manjunath | 9546b91 | 2019-11-28 20:56:20 +0530 | [diff] [blame] | 151 | var err error |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 152 | switch alarmInd.Data.(type) { |
| 153 | case *oop.AlarmIndication_LosInd: |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 154 | logger.Debugw(ctx, "received-los-indication", log.Fields{"alarm-ind": alarmInd}) |
| 155 | err = em.oltLosIndication(ctx, alarmInd.GetLosInd(), deviceID, raisedTs) |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 156 | case *oop.AlarmIndication_OnuAlarmInd: |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 157 | logger.Debugw(ctx, "received-onu-alarm-indication ", log.Fields{"alarm-ind": alarmInd}) |
| 158 | err = em.onuAlarmIndication(ctx, alarmInd.GetOnuAlarmInd(), deviceID, raisedTs) |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 159 | case *oop.AlarmIndication_DyingGaspInd: |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 160 | logger.Debugw(ctx, "received-dying-gasp-indication", log.Fields{"alarm-ind": alarmInd}) |
| 161 | err = em.onuDyingGaspIndication(ctx, alarmInd.GetDyingGaspInd(), deviceID, raisedTs) |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 162 | case *oop.AlarmIndication_OnuLossOmciInd: |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 163 | logger.Debugw(ctx, "received-onu-loss-omci-indication ", log.Fields{"alarm-ind": alarmInd}) |
| 164 | err = em.onuLossOmciIndication(ctx, alarmInd.GetOnuLossOmciInd(), deviceID, raisedTs) |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 165 | case *oop.AlarmIndication_OnuDriftOfWindowInd: |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 166 | logger.Debugw(ctx, "received-onu-drift-of-window-indication ", log.Fields{"alarm-ind": alarmInd}) |
| 167 | err = em.onuDriftOfWindowIndication(ctx, alarmInd.GetOnuDriftOfWindowInd(), deviceID, raisedTs) |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 168 | case *oop.AlarmIndication_OnuSignalDegradeInd: |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 169 | logger.Debugw(ctx, "received-onu-signal-degrade-indication ", log.Fields{"alarm-ind": alarmInd}) |
| 170 | err = em.onuSignalDegradeIndication(ctx, alarmInd.GetOnuSignalDegradeInd(), deviceID, raisedTs) |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 171 | case *oop.AlarmIndication_OnuSignalsFailInd: |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 172 | logger.Debugw(ctx, "received-onu-signal-fail-indication ", log.Fields{"alarm-ind": alarmInd}) |
| 173 | err = em.onuSignalsFailIndication(ctx, alarmInd.GetOnuSignalsFailInd(), deviceID, raisedTs) |
Naga Manjunath | f6f7464 | 2020-01-13 21:37:28 +0530 | [diff] [blame] | 174 | case *oop.AlarmIndication_OnuStartupFailInd: |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 175 | logger.Debugw(ctx, "received-onu-startup-fail-indication ", log.Fields{"alarm-ind": alarmInd}) |
| 176 | err = em.onuStartupFailedIndication(ctx, alarmInd.GetOnuStartupFailInd(), deviceID, raisedTs) |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 177 | case *oop.AlarmIndication_OnuTiwiInd: |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 178 | logger.Debugw(ctx, "received-onu-transmission-warning-indication ", log.Fields{"alarm-ind": alarmInd}) |
| 179 | logger.Warnw(ctx, "not-implemented-yet", log.Fields{"alarm-ind": "Onu-Transmission-indication"}) |
Naga Manjunath | 9546b91 | 2019-11-28 20:56:20 +0530 | [diff] [blame] | 180 | case *oop.AlarmIndication_OnuLossOfSyncFailInd: |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 181 | logger.Debugw(ctx, "received-onu-loss-of-sync-fail-indication ", log.Fields{"alarm-ind": alarmInd}) |
| 182 | err = em.onuLossOfSyncIndication(ctx, alarmInd.GetOnuLossOfSyncFailInd(), deviceID, raisedTs) |
Naga Manjunath | 9546b91 | 2019-11-28 20:56:20 +0530 | [diff] [blame] | 183 | case *oop.AlarmIndication_OnuItuPonStatsInd: |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 184 | logger.Debugw(ctx, "received-onu-itu-pon-stats-indication ", log.Fields{"alarm-ind": alarmInd}) |
| 185 | err = em.onuItuPonStatsIndication(ctx, alarmInd.GetOnuItuPonStatsInd(), deviceID, raisedTs) |
Devmalya Paul | 1abc34e | 2020-02-04 20:48:06 -0500 | [diff] [blame] | 186 | case *oop.AlarmIndication_OnuDeactivationFailureInd: |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 187 | logger.Debugw(ctx, "received-onu-deactivation-failure-indication ", log.Fields{"alarm-ind": alarmInd}) |
| 188 | err = em.onuDeactivationFailureIndication(ctx, alarmInd.GetOnuDeactivationFailureInd(), deviceID, raisedTs) |
Devmalya Paul | 41a762d | 2020-03-01 18:56:54 -0500 | [diff] [blame] | 189 | case *oop.AlarmIndication_OnuLossGemDelineationInd: |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 190 | logger.Debugw(ctx, "received-onu-loss-of-gem-channel-delineation-indication ", log.Fields{"alarm-ind": alarmInd}) |
| 191 | err = em.onuLossOfGEMChannelDelineationIndication(ctx, alarmInd.GetOnuLossGemDelineationInd(), deviceID, raisedTs) |
Devmalya Paul | 41a762d | 2020-03-01 18:56:54 -0500 | [diff] [blame] | 192 | case *oop.AlarmIndication_OnuPhysicalEquipmentErrorInd: |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 193 | logger.Debugw(ctx, "received-onu-physical-equipment-error-indication ", log.Fields{"alarm-ind": alarmInd}) |
| 194 | err = em.onuPhysicalEquipmentErrorIndication(ctx, alarmInd.GetOnuPhysicalEquipmentErrorInd(), deviceID, raisedTs) |
Devmalya Paul | 41a762d | 2020-03-01 18:56:54 -0500 | [diff] [blame] | 195 | case *oop.AlarmIndication_OnuLossOfAckInd: |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 196 | logger.Debugw(ctx, "received-onu-loss-of-acknowledgement-indication ", log.Fields{"alarm-ind": alarmInd}) |
| 197 | err = em.onuLossOfAcknowledgementIndication(ctx, alarmInd.GetOnuLossOfAckInd(), deviceID, raisedTs) |
Devmalya Paul | eb5294e | 2020-03-19 03:01:39 -0400 | [diff] [blame] | 198 | case *oop.AlarmIndication_OnuDiffReachExceededInd: |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 199 | logger.Debugw(ctx, "received-onu-differential-reach-exceeded-indication ", log.Fields{"alarm-ind": alarmInd}) |
| 200 | err = em.onuDifferentialReachExceededIndication(ctx, alarmInd.GetOnuDiffReachExceededInd(), deviceID, raisedTs) |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 201 | default: |
Thomas Lee S | 94109f1 | 2020-03-03 16:39:29 +0530 | [diff] [blame] | 202 | err = olterrors.NewErrInvalidValue(log.Fields{"indication-type": alarmInd}, nil) |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 203 | } |
Naga Manjunath | 9546b91 | 2019-11-28 20:56:20 +0530 | [diff] [blame] | 204 | if err != nil { |
Kent Hagerman | e6ff101 | 2020-07-14 15:07:53 -0400 | [diff] [blame] | 205 | _ = olterrors.NewErrCommunication("publish-message", log.Fields{"indication-type": alarmInd}, err).LogAt(log.WarnLevel) |
Naga Manjunath | 9546b91 | 2019-11-28 20:56:20 +0530 | [diff] [blame] | 206 | } |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 207 | } |
| 208 | |
Gamze Abaka | 07868a5 | 2020-12-17 14:19:28 +0000 | [diff] [blame] | 209 | func (em *OpenOltEventMgr) oltCommunicationEvent(ctx context.Context, device *voltha.Device, raisedTs int64) { |
| 210 | if device == nil { |
| 211 | logger.Warn(ctx, "device-is-nil-can't-send-olt-communication-failure-event") |
| 212 | return |
| 213 | } |
| 214 | var de voltha.DeviceEvent |
| 215 | context := make(map[string]string) |
| 216 | context[ContextOltOperState] = device.OperStatus.String() |
| 217 | context[ContextOltAdminState] = device.AdminState.String() |
| 218 | context[ContextOltVendor] = device.Vendor |
| 219 | context[ContextOltConnectState] = device.ConnectStatus.String() |
| 220 | context[ContextOltType] = device.Type |
| 221 | context[ContextOltParentID] = device.ParentId |
| 222 | context[ContextOltParentPortNo] = fmt.Sprintf("%d", device.ParentPortNo) |
| 223 | context[ContextDeviceID] = device.Id |
| 224 | context[ContextOltFirmwareVersion] = device.FirmwareVersion |
| 225 | context[ContextOltHardwareVersion] = device.HardwareVersion |
| 226 | context[ContextOltSerialNumber] = device.SerialNumber |
| 227 | context[ContextOltMacAddress] = device.MacAddress |
| 228 | de.Context = context |
| 229 | de.ResourceId = device.Id |
| 230 | |
| 231 | if device.ConnectStatus == voltha.ConnectStatus_UNREACHABLE { |
| 232 | de.DeviceEventName = fmt.Sprintf("%s_%s", oltCommFailure, "RAISE_EVENT") |
| 233 | } else { |
| 234 | de.DeviceEventName = fmt.Sprintf("%s_%s", oltCommFailure, "CLEAR_EVENT") |
| 235 | } |
| 236 | |
| 237 | if err := em.eventProxy.SendDeviceEvent(ctx, &de, voltha.EventCategory_COMMUNICATION, voltha.EventSubCategory_OLT, raisedTs); err != nil { |
| 238 | logger.Errorw(ctx, "failed-to-send-olt-comm-failure-event", log.Fields{"err": err}) |
| 239 | } |
| 240 | logger.Debugw(ctx, "olt-comm-failure-event-sent-to-kafka", |
| 241 | log.Fields{ |
| 242 | "device-id": device.Id, |
| 243 | "connect-status": device.ConnectStatus, |
| 244 | }) |
| 245 | } |
| 246 | |
Daniele Rossi | 051466a | 2019-07-26 13:39:37 +0000 | [diff] [blame] | 247 | // oltUpDownIndication handles Up and Down state of an OLT |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 248 | func (em *OpenOltEventMgr) oltUpDownIndication(ctx context.Context, oltIndication *oop.OltIndication, deviceID string, raisedTs int64) error { |
Daniele Rossi | 051466a | 2019-07-26 13:39:37 +0000 | [diff] [blame] | 249 | var de voltha.DeviceEvent |
| 250 | context := make(map[string]string) |
| 251 | /* Populating event context */ |
Amit Ghosh | 502056b | 2020-07-15 09:15:48 +0100 | [diff] [blame] | 252 | context[ContextOltOperState] = oltIndication.OperState |
Daniele Rossi | 051466a | 2019-07-26 13:39:37 +0000 | [diff] [blame] | 253 | /* Populating device event body */ |
| 254 | de.Context = context |
| 255 | de.ResourceId = deviceID |
Naga Manjunath | 9546b91 | 2019-11-28 20:56:20 +0530 | [diff] [blame] | 256 | if oltIndication.OperState == operationStateDown { |
Daniele Rossi | 051466a | 2019-07-26 13:39:37 +0000 | [diff] [blame] | 257 | de.DeviceEventName = fmt.Sprintf("%s_%s", oltIndicationDown, "RAISE_EVENT") |
Naga Manjunath | 9546b91 | 2019-11-28 20:56:20 +0530 | [diff] [blame] | 258 | } else if oltIndication.OperState == operationStateUp { |
Daniele Rossi | 051466a | 2019-07-26 13:39:37 +0000 | [diff] [blame] | 259 | de.DeviceEventName = fmt.Sprintf("%s_%s", oltIndicationDown, "CLEAR_EVENT") |
| 260 | } |
| 261 | /* Send event to KAFKA */ |
Kent Hagerman | e6ff101 | 2020-07-14 15:07:53 -0400 | [diff] [blame] | 262 | if err := em.eventProxy.SendDeviceEvent(ctx, &de, voltha.EventCategory_COMMUNICATION, voltha.EventSubCategory_OLT, raisedTs); err != nil { |
Girish Kumar | f26e488 | 2020-03-05 06:49:10 +0000 | [diff] [blame] | 263 | return olterrors.NewErrCommunication("send-olt-event", log.Fields{"device-id": deviceID}, err) |
Daniele Rossi | 051466a | 2019-07-26 13:39:37 +0000 | [diff] [blame] | 264 | } |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 265 | logger.Debugw(ctx, "olt-updown-event-sent-to-kafka", log.Fields{}) |
Naga Manjunath | 9546b91 | 2019-11-28 20:56:20 +0530 | [diff] [blame] | 266 | return nil |
Daniele Rossi | 051466a | 2019-07-26 13:39:37 +0000 | [diff] [blame] | 267 | } |
| 268 | |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 269 | // OnuDiscoveryIndication is an exported method to handle ONU discovery event |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 270 | func (em *OpenOltEventMgr) OnuDiscoveryIndication(ctx context.Context, onuDisc *oop.OnuDiscIndication, oltDeviceID string, onuDeviceID string, OnuID uint32, serialNumber string, raisedTs int64) error { |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 271 | var de voltha.DeviceEvent |
| 272 | context := make(map[string]string) |
| 273 | /* Populating event context */ |
Amit Ghosh | 502056b | 2020-07-15 09:15:48 +0100 | [diff] [blame] | 274 | context[ContextOnuOnuID] = strconv.FormatUint(uint64(OnuID), base10) |
| 275 | context[ContextOnuPonIntfID] = strconv.FormatUint(uint64(onuDisc.IntfId), base10) |
| 276 | context[ContextOnuSerialNumber] = serialNumber |
| 277 | context[ContextOnuDeviceID] = onuDeviceID |
ssiddiqui | 04386ee | 2021-08-23 21:58:25 +0530 | [diff] [blame] | 278 | context[ContextOltPonTechnology] = em.handler.getPonTechnology(onuDisc.IntfId) |
| 279 | context[ContextOltPortLabel], _ = GetportLabel(onuDisc.GetIntfId(), voltha.Port_PON_OLT) |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 280 | /* Populating device event body */ |
| 281 | de.Context = context |
Amit Ghosh | 75f0e29 | 2020-05-14 11:31:54 +0100 | [diff] [blame] | 282 | de.ResourceId = oltDeviceID |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 283 | de.DeviceEventName = fmt.Sprintf("%s_%s", onuDiscoveryEvent, "RAISE_EVENT") |
| 284 | /* Send event to KAFKA */ |
Kent Hagerman | e6ff101 | 2020-07-14 15:07:53 -0400 | [diff] [blame] | 285 | if err := em.eventProxy.SendDeviceEvent(ctx, &de, voltha.EventCategory_EQUIPMENT, voltha.EventSubCategory_PON, raisedTs); err != nil { |
Shrey Baid | 2691297 | 2020-04-16 21:02:31 +0530 | [diff] [blame] | 286 | return olterrors.NewErrCommunication("send-onu-discovery-event", |
| 287 | log.Fields{ |
| 288 | "serial-number": serialNumber, |
| 289 | "intf-id": onuDisc.IntfId}, err) |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 290 | } |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 291 | logger.Debugw(ctx, "onu-discovery-event-sent-to-kafka", |
Shrey Baid | 2691297 | 2020-04-16 21:02:31 +0530 | [diff] [blame] | 292 | log.Fields{ |
| 293 | "serial-number": serialNumber, |
| 294 | "intf-id": onuDisc.IntfId}) |
Naga Manjunath | 9546b91 | 2019-11-28 20:56:20 +0530 | [diff] [blame] | 295 | return nil |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 296 | } |
| 297 | |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 298 | func (em *OpenOltEventMgr) oltLosIndication(ctx context.Context, oltLos *oop.LosIndication, deviceID string, raisedTs int64) error { |
Thiyagarajan Subramani | 34a0028 | 2020-03-10 20:19:31 +0530 | [diff] [blame] | 299 | var err error = nil |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 300 | var de voltha.DeviceEvent |
Thiyagarajan Subramani | 34a0028 | 2020-03-10 20:19:31 +0530 | [diff] [blame] | 301 | var alarmInd oop.OnuAlarmIndication |
| 302 | ponIntdID := PortNoToIntfID(oltLos.IntfId, voltha.Port_PON_OLT) |
| 303 | |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 304 | context := make(map[string]string) |
| 305 | /* Populating event context */ |
Amit Ghosh | 502056b | 2020-07-15 09:15:48 +0100 | [diff] [blame] | 306 | context[ContextOltPonIntfID] = strconv.FormatUint(uint64(oltLos.IntfId), base10) |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 307 | /* Populating device event body */ |
| 308 | de.Context = context |
| 309 | de.ResourceId = deviceID |
Naga Manjunath | 9546b91 | 2019-11-28 20:56:20 +0530 | [diff] [blame] | 310 | if oltLos.Status == statusCheckOn { |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 311 | de.DeviceEventName = fmt.Sprintf("%s_%s", oltLosEvent, "RAISE_EVENT") |
Thiyagarajan Subramani | 34a0028 | 2020-03-10 20:19:31 +0530 | [diff] [blame] | 312 | |
| 313 | /* When PON cable disconnected from OLT, it was expected OnuAlarmIndication |
| 314 | with "los_status: on" should be raised for each Onu connected to the PON |
| 315 | but BAL does not raise this Alarm hence manually sending OnuLosRaise event |
| 316 | for all the ONU's connected to PON on receiving LoSIndication for PON */ |
| 317 | em.handler.onus.Range(func(Onukey interface{}, onuInCache interface{}) bool { |
| 318 | if onuInCache.(*OnuDevice).intfID == ponIntdID { |
| 319 | alarmInd.IntfId = ponIntdID |
| 320 | alarmInd.OnuId = onuInCache.(*OnuDevice).onuID |
| 321 | alarmInd.LosStatus = statusCheckOn |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 322 | err = em.onuAlarmIndication(ctx, &alarmInd, deviceID, raisedTs) |
Thiyagarajan Subramani | 34a0028 | 2020-03-10 20:19:31 +0530 | [diff] [blame] | 323 | } |
| 324 | return true |
| 325 | }) |
| 326 | if err != nil { |
| 327 | /* Return if any error encountered while processing ONU LoS Event*/ |
| 328 | return err |
| 329 | } |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 330 | } else { |
| 331 | de.DeviceEventName = fmt.Sprintf("%s_%s", oltLosEvent, "CLEAR_EVENT") |
| 332 | } |
| 333 | /* Send event to KAFKA */ |
Andrea Campanella | 4dea631 | 2021-02-23 10:06:18 +0100 | [diff] [blame] | 334 | if err := em.eventProxy.SendDeviceEvent(ctx, &de, voltha.EventCategory_COMMUNICATION, voltha.EventSubCategory_PON, raisedTs); err != nil { |
Naga Manjunath | 9546b91 | 2019-11-28 20:56:20 +0530 | [diff] [blame] | 335 | return err |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 336 | } |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 337 | logger.Debugw(ctx, "olt-los-event-sent-to-kafka", log.Fields{"intf-id": oltLos.IntfId}) |
Naga Manjunath | 9546b91 | 2019-11-28 20:56:20 +0530 | [diff] [blame] | 338 | return nil |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 339 | } |
| 340 | |
Amit Ghosh | 502056b | 2020-07-15 09:15:48 +0100 | [diff] [blame] | 341 | func (em *OpenOltEventMgr) populateContextWithSerialDeviceID(context map[string]string, intfID, onuID uint32) { |
| 342 | var serialNumber = "" |
| 343 | var onuDeviceID = "" |
| 344 | onu := em.handler.formOnuKey(intfID, onuID) |
Naga Manjunath | a8dc937 | 2019-10-31 23:01:18 +0530 | [diff] [blame] | 345 | if onu, ok := em.handler.onus.Load(onu); ok { |
| 346 | serialNumber = onu.(*OnuDevice).serialNumber |
Amit Ghosh | 502056b | 2020-07-15 09:15:48 +0100 | [diff] [blame] | 347 | onuDeviceID = onu.(*OnuDevice).deviceID |
Devmalya Paul | 90ca301 | 2019-09-02 21:55:45 -0400 | [diff] [blame] | 348 | } |
Amit Ghosh | 502056b | 2020-07-15 09:15:48 +0100 | [diff] [blame] | 349 | |
ssiddiqui | 04386ee | 2021-08-23 21:58:25 +0530 | [diff] [blame] | 350 | context[ContextOltPortLabel], _ = GetportLabel(intfID, voltha.Port_PON_OLT) |
Amit Ghosh | 502056b | 2020-07-15 09:15:48 +0100 | [diff] [blame] | 351 | context[ContextOnuSerialNumber] = serialNumber |
| 352 | context[ContextOnuDeviceID] = onuDeviceID |
| 353 | } |
| 354 | |
| 355 | func (em *OpenOltEventMgr) onuDyingGaspIndication(ctx context.Context, dgi *oop.DyingGaspIndication, deviceID string, raisedTs int64) error { |
| 356 | var de voltha.DeviceEvent |
| 357 | context := make(map[string]string) |
| 358 | /* Populating event context */ |
| 359 | em.populateContextWithSerialDeviceID(context, dgi.IntfId, dgi.OnuId) |
| 360 | |
| 361 | context[ContextOnuPonIntfID] = strconv.FormatUint(uint64(dgi.IntfId), base10) |
| 362 | context[ContextOnuOnuID] = strconv.FormatUint(uint64(dgi.OnuId), base10) |
| 363 | |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 364 | /* Populating device event body */ |
| 365 | de.Context = context |
| 366 | de.ResourceId = deviceID |
Thomas Lee S | f68399e | 2020-02-11 15:41:38 +0530 | [diff] [blame] | 367 | de.DeviceEventName = fmt.Sprintf("%s_%s", onuDyingGaspEvent, "EVENT") |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 368 | /* Send event to KAFKA */ |
Andrea Campanella | 4dea631 | 2021-02-23 10:06:18 +0100 | [diff] [blame] | 369 | if err := em.eventProxy.SendDeviceEvent(ctx, &de, voltha.EventCategory_COMMUNICATION, voltha.EventSubCategory_ONU, raisedTs); err != nil { |
Naga Manjunath | 9546b91 | 2019-11-28 20:56:20 +0530 | [diff] [blame] | 370 | return err |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 371 | } |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 372 | logger.Debugw(ctx, "onu-dying-gasp-event-sent-to-kafka", log.Fields{"intf-id": dgi.IntfId}) |
Naga Manjunath | 9546b91 | 2019-11-28 20:56:20 +0530 | [diff] [blame] | 373 | return nil |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 374 | } |
| 375 | |
Thiyagarajan Subramani | 34a0028 | 2020-03-10 20:19:31 +0530 | [diff] [blame] | 376 | //wasLosRaised checks whether los raised already. If already raised returns true else false |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 377 | func (em *OpenOltEventMgr) wasLosRaised(ctx context.Context, onuAlarm *oop.OnuAlarmIndication) bool { |
Thiyagarajan Subramani | 34a0028 | 2020-03-10 20:19:31 +0530 | [diff] [blame] | 378 | onuKey := em.handler.formOnuKey(onuAlarm.IntfId, onuAlarm.OnuId) |
| 379 | if onuInCache, ok := em.handler.onus.Load(onuKey); ok { |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 380 | logger.Debugw(ctx, "onu-device-found-in-cache.", log.Fields{"intfID": onuAlarm.IntfId, "onuID": onuAlarm.OnuId}) |
Thiyagarajan Subramani | 34a0028 | 2020-03-10 20:19:31 +0530 | [diff] [blame] | 381 | |
| 382 | if onuAlarm.LosStatus == statusCheckOn { |
| 383 | if onuInCache.(*OnuDevice).losRaised { |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 384 | logger.Warnw(ctx, "onu-los-raised-already", log.Fields{"onu_id": onuAlarm.OnuId, |
Thiyagarajan Subramani | 34a0028 | 2020-03-10 20:19:31 +0530 | [diff] [blame] | 385 | "intf_id": onuAlarm.IntfId, "LosStatus": onuAlarm.LosStatus}) |
| 386 | return true |
| 387 | } |
| 388 | return false |
| 389 | } |
| 390 | } |
| 391 | return true |
| 392 | } |
| 393 | |
| 394 | //wasLosCleared checks whether los cleared already. If already cleared returns true else false |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 395 | func (em *OpenOltEventMgr) wasLosCleared(ctx context.Context, onuAlarm *oop.OnuAlarmIndication) bool { |
Thiyagarajan Subramani | 34a0028 | 2020-03-10 20:19:31 +0530 | [diff] [blame] | 396 | onuKey := em.handler.formOnuKey(onuAlarm.IntfId, onuAlarm.OnuId) |
| 397 | if onuInCache, ok := em.handler.onus.Load(onuKey); ok { |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 398 | logger.Debugw(ctx, "onu-device-found-in-cache.", log.Fields{"intfID": onuAlarm.IntfId, "onuID": onuAlarm.OnuId}) |
Thiyagarajan Subramani | 34a0028 | 2020-03-10 20:19:31 +0530 | [diff] [blame] | 399 | |
| 400 | if onuAlarm.LosStatus == statusCheckOff { |
| 401 | if !onuInCache.(*OnuDevice).losRaised { |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 402 | logger.Warnw(ctx, "onu-los-cleared-already", log.Fields{"onu_id": onuAlarm.OnuId, |
Thiyagarajan Subramani | 34a0028 | 2020-03-10 20:19:31 +0530 | [diff] [blame] | 403 | "intf_id": onuAlarm.IntfId, "LosStatus": onuAlarm.LosStatus}) |
| 404 | return true |
| 405 | } |
| 406 | return false |
| 407 | } |
| 408 | } |
| 409 | return true |
| 410 | } |
| 411 | |
| 412 | func (em *OpenOltEventMgr) getDeviceEventName(onuAlarm *oop.OnuAlarmIndication) string { |
| 413 | var deviceEventName string |
| 414 | if onuAlarm.LosStatus == statusCheckOn { |
| 415 | deviceEventName = fmt.Sprintf("%s_%s", onuLosEvent, "RAISE_EVENT") |
| 416 | } else if onuAlarm.LosStatus == statusCheckOff { |
| 417 | deviceEventName = fmt.Sprintf("%s_%s", onuLosEvent, "CLEAR_EVENT") |
| 418 | } else if onuAlarm.LobStatus == statusCheckOn { |
| 419 | deviceEventName = fmt.Sprintf("%s_%s", onuLobEvent, "RAISE_EVENT") |
| 420 | } else if onuAlarm.LobStatus == statusCheckOff { |
| 421 | deviceEventName = fmt.Sprintf("%s_%s", onuLobEvent, "CLEAR_EVENT") |
| 422 | } else if onuAlarm.LopcMissStatus == statusCheckOn { |
| 423 | deviceEventName = fmt.Sprintf("%s_%s", onuLopcMissEvent, "RAISE_EVENT") |
| 424 | } else if onuAlarm.LopcMissStatus == statusCheckOff { |
| 425 | deviceEventName = fmt.Sprintf("%s_%s", onuLopcMissEvent, "CLEAR_EVENT") |
| 426 | } else if onuAlarm.LopcMicErrorStatus == statusCheckOn { |
| 427 | deviceEventName = fmt.Sprintf("%s_%s", onuLopcMicErrorEvent, "RAISE_EVENT") |
| 428 | } else if onuAlarm.LopcMicErrorStatus == statusCheckOff { |
| 429 | deviceEventName = fmt.Sprintf("%s_%s", onuLopcMicErrorEvent, "CLEAR_EVENT") |
| 430 | } else if onuAlarm.LofiStatus == statusCheckOn { |
| 431 | deviceEventName = fmt.Sprintf("%s_%s", onuLossOfFrameEvent, "RAISE_EVENT") |
| 432 | } else if onuAlarm.LofiStatus == statusCheckOff { |
| 433 | deviceEventName = fmt.Sprintf("%s_%s", onuLossOfFrameEvent, "CLEAR_EVENT") |
| 434 | } else if onuAlarm.LoamiStatus == statusCheckOn { |
| 435 | deviceEventName = fmt.Sprintf("%s_%s", onuLossOfPloamEvent, "RAISE_EVENT") |
| 436 | } else if onuAlarm.LoamiStatus == statusCheckOff { |
| 437 | deviceEventName = fmt.Sprintf("%s_%s", onuLossOfPloamEvent, "CLEAR_EVENT") |
| 438 | } |
| 439 | return deviceEventName |
| 440 | } |
| 441 | |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 442 | func (em *OpenOltEventMgr) onuAlarmIndication(ctx context.Context, onuAlarm *oop.OnuAlarmIndication, deviceID string, raisedTs int64) error { |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 443 | var de voltha.DeviceEvent |
Amit Ghosh | 502056b | 2020-07-15 09:15:48 +0100 | [diff] [blame] | 444 | |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 445 | context := make(map[string]string) |
| 446 | /* Populating event context */ |
Amit Ghosh | 502056b | 2020-07-15 09:15:48 +0100 | [diff] [blame] | 447 | context[ContextOnuPonIntfID] = strconv.FormatUint(uint64(onuAlarm.IntfId), base10) |
| 448 | context[ContextOnuOnuID] = strconv.FormatUint(uint64(onuAlarm.OnuId), base10) |
| 449 | em.populateContextWithSerialDeviceID(context, onuAlarm.IntfId, onuAlarm.OnuId) |
Thiyagarajan Subramani | 34a0028 | 2020-03-10 20:19:31 +0530 | [diff] [blame] | 450 | |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 451 | /* Populating device event body */ |
| 452 | de.Context = context |
| 453 | de.ResourceId = deviceID |
Thiyagarajan Subramani | 34a0028 | 2020-03-10 20:19:31 +0530 | [diff] [blame] | 454 | de.DeviceEventName = em.getDeviceEventName(onuAlarm) |
| 455 | |
| 456 | switch onuAlarm.LosStatus { |
| 457 | case statusCheckOn: |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 458 | if em.wasLosRaised(ctx, onuAlarm) { |
Thiyagarajan Subramani | 34a0028 | 2020-03-10 20:19:31 +0530 | [diff] [blame] | 459 | /* No need to raise Onu Los Event as it might have already raised |
| 460 | or Onu might have deleted */ |
| 461 | return nil |
| 462 | } |
| 463 | onuKey := em.handler.formOnuKey(onuAlarm.IntfId, onuAlarm.OnuId) |
| 464 | if onuInCache, ok := em.handler.onus.Load(onuKey); ok { |
| 465 | /* Update onu device with LoS raised state as true */ |
| 466 | em.handler.onus.Store(onuKey, NewOnuDevice(onuInCache.(*OnuDevice).deviceID, onuInCache.(*OnuDevice).deviceType, |
| 467 | onuInCache.(*OnuDevice).serialNumber, onuInCache.(*OnuDevice).onuID, onuInCache.(*OnuDevice).intfID, |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 468 | onuInCache.(*OnuDevice).proxyDeviceID, true, onuInCache.(*OnuDevice).adapterEndpoint)) |
Thiyagarajan Subramani | 34a0028 | 2020-03-10 20:19:31 +0530 | [diff] [blame] | 469 | } |
| 470 | case statusCheckOff: |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 471 | if em.wasLosCleared(ctx, onuAlarm) { |
Thiyagarajan Subramani | 34a0028 | 2020-03-10 20:19:31 +0530 | [diff] [blame] | 472 | /* No need to clear Onu Los Event as it might have already cleared |
| 473 | or Onu might have deleted */ |
| 474 | return nil |
| 475 | } |
| 476 | onuKey := em.handler.formOnuKey(onuAlarm.IntfId, onuAlarm.OnuId) |
| 477 | if onuInCache, ok := em.handler.onus.Load(onuKey); ok { |
| 478 | /* Update onu device with LoS raised state as false */ |
| 479 | em.handler.onus.Store(onuKey, NewOnuDevice(onuInCache.(*OnuDevice).deviceID, onuInCache.(*OnuDevice).deviceType, |
| 480 | onuInCache.(*OnuDevice).serialNumber, onuInCache.(*OnuDevice).onuID, onuInCache.(*OnuDevice).intfID, |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 481 | onuInCache.(*OnuDevice).proxyDeviceID, false, onuInCache.(*OnuDevice).adapterEndpoint)) |
Thiyagarajan Subramani | 34a0028 | 2020-03-10 20:19:31 +0530 | [diff] [blame] | 482 | } |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 483 | } |
Thiyagarajan Subramani | 34a0028 | 2020-03-10 20:19:31 +0530 | [diff] [blame] | 484 | |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 485 | /* Send event to KAFKA */ |
Kent Hagerman | e6ff101 | 2020-07-14 15:07:53 -0400 | [diff] [blame] | 486 | if err := em.eventProxy.SendDeviceEvent(ctx, &de, voltha.EventCategory_COMMUNICATION, voltha.EventSubCategory_ONU, raisedTs); err != nil { |
Naga Manjunath | 9546b91 | 2019-11-28 20:56:20 +0530 | [diff] [blame] | 487 | return err |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 488 | } |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 489 | logger.Debugw(ctx, "onu-los-event-sent-to-kafka", log.Fields{"onu-id": onuAlarm.OnuId, "intf-id": onuAlarm.IntfId}) |
Naga Manjunath | 9546b91 | 2019-11-28 20:56:20 +0530 | [diff] [blame] | 490 | return nil |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 491 | } |
| 492 | |
kesavand | 7cf3a05 | 2020-08-28 12:49:18 +0530 | [diff] [blame] | 493 | func (em *OpenOltEventMgr) onuActivationIndication(ctx context.Context, eventName string, onuInd *oop.OnuIndication, deviceID string, raisedTs int64) error { |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 494 | var de voltha.DeviceEvent |
| 495 | context := make(map[string]string) |
| 496 | /* Populating event context */ |
kesavand | 7cf3a05 | 2020-08-28 12:49:18 +0530 | [diff] [blame] | 497 | context[ContextOnuPonIntfID] = strconv.FormatUint(uint64(onuInd.IntfId), base10) |
| 498 | context[ContextOnuOnuID] = strconv.FormatUint(uint64(onuInd.OnuId), base10) |
| 499 | context[ContextOnuFailureReaseon] = onuInd.FailReason.String() |
Amit Ghosh | 502056b | 2020-07-15 09:15:48 +0100 | [diff] [blame] | 500 | |
kesavand | 7cf3a05 | 2020-08-28 12:49:18 +0530 | [diff] [blame] | 501 | em.populateContextWithSerialDeviceID(context, onuInd.IntfId, onuInd.OnuId) |
Amit Ghosh | 502056b | 2020-07-15 09:15:48 +0100 | [diff] [blame] | 502 | |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 503 | /* Populating device event body */ |
| 504 | de.Context = context |
| 505 | de.ResourceId = deviceID |
kesavand | 7cf3a05 | 2020-08-28 12:49:18 +0530 | [diff] [blame] | 506 | de.DeviceEventName = eventName |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 507 | /* Send event to KAFKA */ |
Kent Hagerman | e6ff101 | 2020-07-14 15:07:53 -0400 | [diff] [blame] | 508 | if err := em.eventProxy.SendDeviceEvent(ctx, &de, voltha.EventCategory_EQUIPMENT, voltha.EventSubCategory_PON, raisedTs); err != nil { |
Naga Manjunath | 9546b91 | 2019-11-28 20:56:20 +0530 | [diff] [blame] | 509 | return err |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 510 | } |
kesavand | 7cf3a05 | 2020-08-28 12:49:18 +0530 | [diff] [blame] | 511 | logger.Debugw(ctx, "onu-activation-failure-event-sent-to-kafka", log.Fields{"onu-id": onuInd.OnuId, "intf-id": onuInd.IntfId}) |
Naga Manjunath | 9546b91 | 2019-11-28 20:56:20 +0530 | [diff] [blame] | 512 | return nil |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 513 | } |
| 514 | |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 515 | func (em *OpenOltEventMgr) onuLossOmciIndication(ctx context.Context, onuLossOmci *oop.OnuLossOfOmciChannelIndication, deviceID string, raisedTs int64) error { |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 516 | var de voltha.DeviceEvent |
| 517 | context := make(map[string]string) |
| 518 | /* Populating event context */ |
Amit Ghosh | 502056b | 2020-07-15 09:15:48 +0100 | [diff] [blame] | 519 | context[ContextOnuPonIntfID] = strconv.FormatUint(uint64(onuLossOmci.IntfId), base10) |
| 520 | context[ContextOnuOnuID] = strconv.FormatUint(uint64(onuLossOmci.OnuId), base10) |
| 521 | |
| 522 | em.populateContextWithSerialDeviceID(context, onuLossOmci.IntfId, onuLossOmci.OnuId) |
| 523 | |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 524 | /* Populating device event body */ |
| 525 | de.Context = context |
| 526 | de.ResourceId = deviceID |
Naga Manjunath | 9546b91 | 2019-11-28 20:56:20 +0530 | [diff] [blame] | 527 | if onuLossOmci.Status == statusCheckOn { |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 528 | de.DeviceEventName = fmt.Sprintf("%s_%s", onuLossOmciEvent, "RAISE_EVENT") |
| 529 | } else { |
| 530 | de.DeviceEventName = fmt.Sprintf("%s_%s", onuLossOmciEvent, "CLEAR_EVENT") |
| 531 | } |
| 532 | /* Send event to KAFKA */ |
Andrea Campanella | 4dea631 | 2021-02-23 10:06:18 +0100 | [diff] [blame] | 533 | if err := em.eventProxy.SendDeviceEvent(ctx, &de, voltha.EventCategory_COMMUNICATION, voltha.EventSubCategory_ONU, raisedTs); err != nil { |
Naga Manjunath | 9546b91 | 2019-11-28 20:56:20 +0530 | [diff] [blame] | 534 | return err |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 535 | } |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 536 | logger.Debugw(ctx, "onu-loss-of-omci-channel-event-sent-to-kafka", log.Fields{"onu-id": onuLossOmci.OnuId, "intf-id": onuLossOmci.IntfId}) |
Naga Manjunath | 9546b91 | 2019-11-28 20:56:20 +0530 | [diff] [blame] | 537 | return nil |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 538 | } |
| 539 | |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 540 | func (em *OpenOltEventMgr) onuDriftOfWindowIndication(ctx context.Context, onuDriftWindow *oop.OnuDriftOfWindowIndication, deviceID string, raisedTs int64) error { |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 541 | var de voltha.DeviceEvent |
| 542 | context := make(map[string]string) |
| 543 | /* Populating event context */ |
Amit Ghosh | 502056b | 2020-07-15 09:15:48 +0100 | [diff] [blame] | 544 | context[ContextOnuPonIntfID] = strconv.FormatUint(uint64(onuDriftWindow.IntfId), base10) |
| 545 | context[ContextOnuOnuID] = strconv.FormatUint(uint64(onuDriftWindow.OnuId), base10) |
| 546 | context[ContextOnuDrift] = strconv.FormatUint(uint64(onuDriftWindow.Drift), base10) |
| 547 | context[ContextOnuNewEqd] = strconv.FormatUint(uint64(onuDriftWindow.NewEqd), base10) |
| 548 | |
| 549 | em.populateContextWithSerialDeviceID(context, onuDriftWindow.IntfId, onuDriftWindow.OnuId) |
| 550 | |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 551 | /* Populating device event body */ |
| 552 | de.Context = context |
| 553 | de.ResourceId = deviceID |
Naga Manjunath | 9546b91 | 2019-11-28 20:56:20 +0530 | [diff] [blame] | 554 | if onuDriftWindow.Status == statusCheckOn { |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 555 | de.DeviceEventName = fmt.Sprintf("%s_%s", onuDriftOfWindowEvent, "RAISE_EVENT") |
| 556 | } else { |
| 557 | de.DeviceEventName = fmt.Sprintf("%s_%s", onuDriftOfWindowEvent, "CLEAR_EVENT") |
| 558 | } |
| 559 | /* Send event to KAFKA */ |
Andrea Campanella | 4dea631 | 2021-02-23 10:06:18 +0100 | [diff] [blame] | 560 | if err := em.eventProxy.SendDeviceEvent(ctx, &de, voltha.EventCategory_COMMUNICATION, voltha.EventSubCategory_ONU, raisedTs); err != nil { |
Naga Manjunath | 9546b91 | 2019-11-28 20:56:20 +0530 | [diff] [blame] | 561 | return err |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 562 | } |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 563 | logger.Debugw(ctx, "onu-drift-of-window-event-sent-to-kafka", log.Fields{"onu-id": onuDriftWindow.OnuId, "intf-id": onuDriftWindow.IntfId}) |
Naga Manjunath | 9546b91 | 2019-11-28 20:56:20 +0530 | [diff] [blame] | 564 | return nil |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 565 | } |
| 566 | |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 567 | func (em *OpenOltEventMgr) onuSignalDegradeIndication(ctx context.Context, onuSignalDegrade *oop.OnuSignalDegradeIndication, deviceID string, raisedTs int64) error { |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 568 | var de voltha.DeviceEvent |
| 569 | context := make(map[string]string) |
| 570 | /* Populating event context */ |
Amit Ghosh | 502056b | 2020-07-15 09:15:48 +0100 | [diff] [blame] | 571 | context[ContextOnuPonIntfID] = strconv.FormatUint(uint64(onuSignalDegrade.IntfId), base10) |
| 572 | context[ContextOnuOnuID] = strconv.FormatUint(uint64(onuSignalDegrade.OnuId), base10) |
| 573 | context[ContextOnuInverseBitErrorRate] = strconv.FormatUint(uint64(onuSignalDegrade.InverseBitErrorRate), base10) |
| 574 | |
| 575 | em.populateContextWithSerialDeviceID(context, onuSignalDegrade.IntfId, onuSignalDegrade.OnuId) |
| 576 | |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 577 | /* Populating device event body */ |
| 578 | de.Context = context |
| 579 | de.ResourceId = deviceID |
Naga Manjunath | 9546b91 | 2019-11-28 20:56:20 +0530 | [diff] [blame] | 580 | if onuSignalDegrade.Status == statusCheckOn { |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 581 | de.DeviceEventName = fmt.Sprintf("%s_%s", onuSignalDegradeEvent, "RAISE_EVENT") |
| 582 | } else { |
| 583 | de.DeviceEventName = fmt.Sprintf("%s_%s", onuSignalDegradeEvent, "CLEAR_EVENT") |
| 584 | } |
| 585 | /* Send event to KAFKA */ |
Andrea Campanella | 4dea631 | 2021-02-23 10:06:18 +0100 | [diff] [blame] | 586 | if err := em.eventProxy.SendDeviceEvent(ctx, &de, voltha.EventCategory_COMMUNICATION, voltha.EventSubCategory_ONU, raisedTs); err != nil { |
Naga Manjunath | 9546b91 | 2019-11-28 20:56:20 +0530 | [diff] [blame] | 587 | return err |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 588 | } |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 589 | logger.Debugw(ctx, "onu-signal-degrade-event-sent-to-kafka", log.Fields{"onu-id": onuSignalDegrade.OnuId, "intf-id": onuSignalDegrade.IntfId}) |
Naga Manjunath | 9546b91 | 2019-11-28 20:56:20 +0530 | [diff] [blame] | 590 | return nil |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 591 | } |
| 592 | |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 593 | func (em *OpenOltEventMgr) onuSignalsFailIndication(ctx context.Context, onuSignalsFail *oop.OnuSignalsFailureIndication, deviceID string, raisedTs int64) error { |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 594 | var de voltha.DeviceEvent |
| 595 | context := make(map[string]string) |
| 596 | /* Populating event context */ |
Amit Ghosh | 502056b | 2020-07-15 09:15:48 +0100 | [diff] [blame] | 597 | em.populateContextWithSerialDeviceID(context, onuSignalsFail.IntfId, onuSignalsFail.OnuId) |
| 598 | |
| 599 | context[ContextOnuOnuID] = strconv.FormatUint(uint64(onuSignalsFail.OnuId), base10) |
| 600 | context[ContextOnuPonIntfID] = strconv.FormatUint(uint64(onuSignalsFail.IntfId), base10) |
| 601 | context[ContextOnuInverseBitErrorRate] = strconv.FormatUint(uint64(onuSignalsFail.InverseBitErrorRate), base10) |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 602 | /* Populating device event body */ |
| 603 | de.Context = context |
| 604 | de.ResourceId = deviceID |
Naga Manjunath | 9546b91 | 2019-11-28 20:56:20 +0530 | [diff] [blame] | 605 | if onuSignalsFail.Status == statusCheckOn { |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 606 | de.DeviceEventName = fmt.Sprintf("%s_%s", onuSignalsFailEvent, "RAISE_EVENT") |
| 607 | } else { |
| 608 | de.DeviceEventName = fmt.Sprintf("%s_%s", onuSignalsFailEvent, "CLEAR_EVENT") |
| 609 | } |
| 610 | /* Send event to KAFKA */ |
Andrea Campanella | 4dea631 | 2021-02-23 10:06:18 +0100 | [diff] [blame] | 611 | if err := em.eventProxy.SendDeviceEvent(ctx, &de, voltha.EventCategory_COMMUNICATION, voltha.EventSubCategory_ONU, raisedTs); err != nil { |
Naga Manjunath | 9546b91 | 2019-11-28 20:56:20 +0530 | [diff] [blame] | 612 | return err |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 613 | } |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 614 | logger.Debugw(ctx, "onu-signals-fail-event-sent-to-kafka", log.Fields{"onu-id": onuSignalsFail.OnuId, "intf-id": onuSignalsFail.IntfId}) |
Naga Manjunath | 9546b91 | 2019-11-28 20:56:20 +0530 | [diff] [blame] | 615 | return nil |
| 616 | } |
| 617 | |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 618 | func (em *OpenOltEventMgr) onuStartupFailedIndication(ctx context.Context, onuStartupFail *oop.OnuStartupFailureIndication, deviceID string, raisedTs int64) error { |
Naga Manjunath | f6f7464 | 2020-01-13 21:37:28 +0530 | [diff] [blame] | 619 | var de voltha.DeviceEvent |
| 620 | context := make(map[string]string) |
| 621 | /* Populating event context */ |
Amit Ghosh | 502056b | 2020-07-15 09:15:48 +0100 | [diff] [blame] | 622 | em.populateContextWithSerialDeviceID(context, onuStartupFail.IntfId, onuStartupFail.OnuId) |
| 623 | |
| 624 | context[ContextOnuOnuID] = strconv.FormatUint(uint64(onuStartupFail.OnuId), base10) |
| 625 | context[ContextOnuPonIntfID] = strconv.FormatUint(uint64(onuStartupFail.IntfId), base10) |
Naga Manjunath | f6f7464 | 2020-01-13 21:37:28 +0530 | [diff] [blame] | 626 | |
| 627 | /* Populating device event body */ |
| 628 | de.Context = context |
| 629 | de.ResourceId = deviceID |
| 630 | if onuStartupFail.Status == statusCheckOn { |
| 631 | de.DeviceEventName = fmt.Sprintf("%s_%s", onuStartupFailEvent, "RAISE_EVENT") |
| 632 | } else { |
| 633 | de.DeviceEventName = fmt.Sprintf("%s_%s", onuStartupFailEvent, "CLEAR_EVENT") |
| 634 | } |
| 635 | /* Send event to KAFKA */ |
Kent Hagerman | e6ff101 | 2020-07-14 15:07:53 -0400 | [diff] [blame] | 636 | if err := em.eventProxy.SendDeviceEvent(ctx, &de, voltha.EventCategory_COMMUNICATION, voltha.EventSubCategory_PON, raisedTs); err != nil { |
Naga Manjunath | f6f7464 | 2020-01-13 21:37:28 +0530 | [diff] [blame] | 637 | return err |
| 638 | } |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 639 | logger.Debugw(ctx, "onu-startup-fail-event-sent-to-kafka", log.Fields{"onu-id": onuStartupFail.OnuId, "intf-id": onuStartupFail.IntfId}) |
Naga Manjunath | f6f7464 | 2020-01-13 21:37:28 +0530 | [diff] [blame] | 640 | return nil |
| 641 | } |
| 642 | |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 643 | func (em *OpenOltEventMgr) onuLossOfSyncIndication(ctx context.Context, onuLOKI *oop.OnuLossOfKeySyncFailureIndication, deviceID string, raisedTs int64) error { |
Naga Manjunath | 9546b91 | 2019-11-28 20:56:20 +0530 | [diff] [blame] | 644 | var de voltha.DeviceEvent |
| 645 | context := make(map[string]string) |
| 646 | /* Populating event context */ |
Amit Ghosh | 502056b | 2020-07-15 09:15:48 +0100 | [diff] [blame] | 647 | em.populateContextWithSerialDeviceID(context, onuLOKI.IntfId, onuLOKI.OnuId) |
| 648 | |
| 649 | context[ContextOnuOnuID] = strconv.FormatUint(uint64(onuLOKI.OnuId), base10) |
| 650 | context[ContextOnuPonIntfID] = strconv.FormatUint(uint64(onuLOKI.IntfId), base10) |
Naga Manjunath | 9546b91 | 2019-11-28 20:56:20 +0530 | [diff] [blame] | 651 | /* Populating device event body */ |
| 652 | de.Context = context |
| 653 | de.ResourceId = deviceID |
| 654 | if onuLOKI.Status == statusCheckOn { |
| 655 | de.DeviceEventName = fmt.Sprintf("%s_%s", onuLossOfKeySyncEvent, "RAISE_EVENT") |
| 656 | } else { |
| 657 | de.DeviceEventName = fmt.Sprintf("%s_%s", onuLossOfKeySyncEvent, "CLEAR_EVENT") |
| 658 | } |
| 659 | |
| 660 | /* Send event to KAFKA */ |
Kent Hagerman | e6ff101 | 2020-07-14 15:07:53 -0400 | [diff] [blame] | 661 | if err := em.eventProxy.SendDeviceEvent(ctx, &de, voltha.EventCategory_SECURITY, voltha.EventSubCategory_ONU, raisedTs); err != nil { |
Naga Manjunath | 9546b91 | 2019-11-28 20:56:20 +0530 | [diff] [blame] | 662 | return err |
| 663 | } |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 664 | logger.Debugw(ctx, "onu-loss-of-key-sync-event-sent-to-kafka", log.Fields{"onu-id": onuLOKI.OnuId, "intf-id": onuLOKI.IntfId}) |
Naga Manjunath | 9546b91 | 2019-11-28 20:56:20 +0530 | [diff] [blame] | 665 | return nil |
Devmalya Paul | fb990a5 | 2019-07-09 10:01:49 -0400 | [diff] [blame] | 666 | } |
kesavand | 39e0aa3 | 2020-01-28 20:58:50 -0500 | [diff] [blame] | 667 | |
| 668 | // oltIntfOperIndication handles Up and Down state of an OLT PON ports |
Kent Hagerman | e6ff101 | 2020-07-14 15:07:53 -0400 | [diff] [blame] | 669 | func (em *OpenOltEventMgr) oltIntfOperIndication(ctx context.Context, ifindication *oop.IntfOperIndication, deviceID string, raisedTs int64) { |
Kent Hagerman | f1db18b | 2020-07-08 13:38:15 -0400 | [diff] [blame] | 670 | portNo := IntfIDToPortNo(ifindication.IntfId, voltha.Port_PON_OLT) |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 671 | if port, err := em.handler.getPortFromCore(ctx, &ic.PortFilter{ |
| 672 | DeviceId: deviceID, |
| 673 | Port: portNo, |
| 674 | }); err != nil { |
Girish Gowdra | 8a0bdcd | 2021-05-13 12:31:04 -0700 | [diff] [blame] | 675 | logger.Warnw(ctx, "Error while fetching port object", log.Fields{"device-id": deviceID, "err": err}) |
Kent Hagerman | f1db18b | 2020-07-08 13:38:15 -0400 | [diff] [blame] | 676 | } else if port.AdminState != common.AdminState_ENABLED { |
| 677 | logger.Debugw(ctx, "port-disable/enable-event-not-generated--the-port-is-not-enabled-by-operator", log.Fields{"device-id": deviceID, "port": port}) |
Kent Hagerman | e6ff101 | 2020-07-14 15:07:53 -0400 | [diff] [blame] | 678 | return |
kesavand | 39e0aa3 | 2020-01-28 20:58:50 -0500 | [diff] [blame] | 679 | } |
| 680 | /* Populating event context */ |
Kent Hagerman | f1db18b | 2020-07-08 13:38:15 -0400 | [diff] [blame] | 681 | context := map[string]string{ContextOltPonIntfOperState: ifindication.GetOperState()} |
kesavand | 39e0aa3 | 2020-01-28 20:58:50 -0500 | [diff] [blame] | 682 | /* Populating device event body */ |
Kent Hagerman | f1db18b | 2020-07-08 13:38:15 -0400 | [diff] [blame] | 683 | var de voltha.DeviceEvent |
kesavand | 39e0aa3 | 2020-01-28 20:58:50 -0500 | [diff] [blame] | 684 | de.Context = context |
| 685 | de.ResourceId = deviceID |
| 686 | |
| 687 | if ifindication.GetOperState() == operationStateDown { |
| 688 | de.DeviceEventName = fmt.Sprintf("%s_%s", ponIntfDownIndiction, "RAISE_EVENT") |
| 689 | } else if ifindication.OperState == operationStateUp { |
| 690 | de.DeviceEventName = fmt.Sprintf("%s_%s", ponIntfDownIndiction, "CLEAR_EVENT") |
| 691 | } |
| 692 | /* Send event to KAFKA */ |
Kent Hagerman | e6ff101 | 2020-07-14 15:07:53 -0400 | [diff] [blame] | 693 | if err := em.eventProxy.SendDeviceEvent(ctx, &de, voltha.EventCategory_COMMUNICATION, voltha.EventSubCategory_OLT, raisedTs); err != nil { |
| 694 | _ = olterrors.NewErrCommunication("send-olt-intf-oper-status-event", log.Fields{"device-id": deviceID, "intf-id": ifindication.IntfId, "oper-state": ifindication.OperState}, err).LogAt(log.WarnLevel) |
| 695 | return |
kesavand | 39e0aa3 | 2020-01-28 20:58:50 -0500 | [diff] [blame] | 696 | } |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 697 | logger.Debug(ctx, "sent-olt-intf-oper-status-event-to-kafka") |
kesavand | 39e0aa3 | 2020-01-28 20:58:50 -0500 | [diff] [blame] | 698 | } |
Devmalya Paul | 1abc34e | 2020-02-04 20:48:06 -0500 | [diff] [blame] | 699 | |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 700 | func (em *OpenOltEventMgr) onuDeactivationFailureIndication(ctx context.Context, onuDFI *oop.OnuDeactivationFailureIndication, deviceID string, raisedTs int64) error { |
Devmalya Paul | 1abc34e | 2020-02-04 20:48:06 -0500 | [diff] [blame] | 701 | var de voltha.DeviceEvent |
| 702 | context := make(map[string]string) |
| 703 | /* Populating event context */ |
Amit Ghosh | 502056b | 2020-07-15 09:15:48 +0100 | [diff] [blame] | 704 | em.populateContextWithSerialDeviceID(context, onuDFI.IntfId, onuDFI.OnuId) |
| 705 | |
| 706 | context[ContextOnuOnuID] = strconv.FormatUint(uint64(onuDFI.OnuId), base10) |
| 707 | context[ContextOnuPonIntfID] = strconv.FormatUint(uint64(onuDFI.IntfId), base10) |
Devmalya Paul | 1abc34e | 2020-02-04 20:48:06 -0500 | [diff] [blame] | 708 | /* Populating device event body */ |
| 709 | de.Context = context |
| 710 | de.ResourceId = deviceID |
Devmalya Paul | a1efa64 | 2020-04-20 01:36:43 -0400 | [diff] [blame] | 711 | if onuDFI.Status == statusCheckOn { |
| 712 | de.DeviceEventName = fmt.Sprintf("%s_%s", onuDeactivationFailureEvent, "RAISE_EVENT") |
| 713 | } else { |
| 714 | de.DeviceEventName = fmt.Sprintf("%s_%s", onuDeactivationFailureEvent, "CLEAR_EVENT") |
| 715 | } |
Devmalya Paul | 1abc34e | 2020-02-04 20:48:06 -0500 | [diff] [blame] | 716 | /* Send event to KAFKA */ |
Kent Hagerman | e6ff101 | 2020-07-14 15:07:53 -0400 | [diff] [blame] | 717 | if err := em.eventProxy.SendDeviceEvent(ctx, &de, voltha.EventCategory_EQUIPMENT, voltha.EventSubCategory_ONU, raisedTs); err != nil { |
Devmalya Paul | 1abc34e | 2020-02-04 20:48:06 -0500 | [diff] [blame] | 718 | return err |
| 719 | } |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 720 | logger.Debugw(ctx, "onu-deactivation-failure-event-sent-to-kafka", log.Fields{"onu-id": onuDFI.OnuId, "intf-id": onuDFI.IntfId}) |
Devmalya Paul | 1abc34e | 2020-02-04 20:48:06 -0500 | [diff] [blame] | 721 | return nil |
| 722 | } |
Amit Ghosh | 502056b | 2020-07-15 09:15:48 +0100 | [diff] [blame] | 723 | |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 724 | func (em *OpenOltEventMgr) onuRemoteDefectIndication(ctx context.Context, onuID uint32, intfID uint32, rdiCount uint64, status string, deviceID string, raisedTs int64) error { |
Devmalya Paul | 6f063a6 | 2020-02-19 19:19:06 -0500 | [diff] [blame] | 725 | /* Populating event context */ |
| 726 | context := map[string]string{ |
Amit Ghosh | 502056b | 2020-07-15 09:15:48 +0100 | [diff] [blame] | 727 | ContextOnuOnuID: strconv.FormatUint(uint64(onuID), base10), |
| 728 | ContextOnuPonIntfID: strconv.FormatUint(uint64(intfID), base10), |
| 729 | ContextOnuRemoteDefectIndicatorCount: strconv.FormatUint(rdiCount, base10), |
Devmalya Paul | 6f063a6 | 2020-02-19 19:19:06 -0500 | [diff] [blame] | 730 | } |
Amit Ghosh | 502056b | 2020-07-15 09:15:48 +0100 | [diff] [blame] | 731 | em.populateContextWithSerialDeviceID(context, intfID, onuID) |
| 732 | |
Devmalya Paul | 6f063a6 | 2020-02-19 19:19:06 -0500 | [diff] [blame] | 733 | /* Populating device event body */ |
| 734 | de := &voltha.DeviceEvent{ |
Devmalya Paul | a1efa64 | 2020-04-20 01:36:43 -0400 | [diff] [blame] | 735 | Context: context, |
| 736 | ResourceId: deviceID, |
| 737 | } |
| 738 | if status == statusCheckOn { |
| 739 | de.DeviceEventName = fmt.Sprintf("%s_%s", onuRemoteDefectIndication, "RAISE_EVENT") |
| 740 | } else { |
| 741 | de.DeviceEventName = fmt.Sprintf("%s_%s", onuRemoteDefectIndication, "CLEAR_EVENT") |
Devmalya Paul | 6f063a6 | 2020-02-19 19:19:06 -0500 | [diff] [blame] | 742 | } |
| 743 | /* Send event to KAFKA */ |
Kent Hagerman | e6ff101 | 2020-07-14 15:07:53 -0400 | [diff] [blame] | 744 | if err := em.eventProxy.SendDeviceEvent(ctx, de, voltha.EventCategory_EQUIPMENT, voltha.EventSubCategory_ONU, raisedTs); err != nil { |
Devmalya Paul | 6f063a6 | 2020-02-19 19:19:06 -0500 | [diff] [blame] | 745 | return err |
| 746 | } |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 747 | logger.Debugw(ctx, "onu-remote-defect-event-sent-to-kafka", log.Fields{"onu-id": onuID, "intf-id": intfID}) |
Devmalya Paul | a1efa64 | 2020-04-20 01:36:43 -0400 | [diff] [blame] | 748 | return nil |
| 749 | } |
| 750 | |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 751 | func (em *OpenOltEventMgr) onuItuPonStatsIndication(ctx context.Context, onuIPS *oop.OnuItuPonStatsIndication, deviceID string, raisedTs int64) error { |
Devmalya Paul | a1efa64 | 2020-04-20 01:36:43 -0400 | [diff] [blame] | 752 | onuDevice, found := em.handler.onus.Load(em.handler.formOnuKey(onuIPS.IntfId, onuIPS.OnuId)) |
| 753 | if !found { |
| 754 | return errors.New("unknown-onu-device") |
| 755 | } |
| 756 | if onuIPS.GetRdiErrorInd().Status == statusCheckOn { |
| 757 | if !onuDevice.(*OnuDevice).rdiRaised { |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 758 | if err := em.onuRemoteDefectIndication(ctx, onuIPS.OnuId, onuIPS.IntfId, onuIPS.GetRdiErrorInd().RdiErrorCount, statusCheckOn, deviceID, raisedTs); err != nil { |
Devmalya Paul | a1efa64 | 2020-04-20 01:36:43 -0400 | [diff] [blame] | 759 | return err |
| 760 | } |
| 761 | onuDevice.(*OnuDevice).rdiRaised = true |
| 762 | return nil |
| 763 | } |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 764 | logger.Debugw(ctx, "onu-remote-defect-already-raised", log.Fields{"onu-id": onuIPS.OnuId, "intf-id": onuIPS.IntfId}) |
Devmalya Paul | a1efa64 | 2020-04-20 01:36:43 -0400 | [diff] [blame] | 765 | } else { |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 766 | if err := em.onuRemoteDefectIndication(ctx, onuIPS.OnuId, onuIPS.IntfId, onuIPS.GetRdiErrorInd().RdiErrorCount, statusCheckOff, deviceID, raisedTs); err != nil { |
Devmalya Paul | a1efa64 | 2020-04-20 01:36:43 -0400 | [diff] [blame] | 767 | return err |
| 768 | } |
| 769 | onuDevice.(*OnuDevice).rdiRaised = false |
| 770 | } |
Devmalya Paul | 41a762d | 2020-03-01 18:56:54 -0500 | [diff] [blame] | 771 | return nil |
| 772 | } |
| 773 | |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 774 | func (em *OpenOltEventMgr) onuLossOfGEMChannelDelineationIndication(ctx context.Context, onuGCD *oop.OnuLossOfGEMChannelDelineationIndication, deviceID string, raisedTs int64) error { |
Devmalya Paul | 41a762d | 2020-03-01 18:56:54 -0500 | [diff] [blame] | 775 | /* Populating event context */ |
| 776 | context := map[string]string{ |
Amit Ghosh | 502056b | 2020-07-15 09:15:48 +0100 | [diff] [blame] | 777 | ContextOnuOnuID: strconv.FormatUint(uint64(onuGCD.OnuId), base10), |
| 778 | ContextOnuPonIntfID: strconv.FormatUint(uint64(onuGCD.IntfId), base10), |
| 779 | ContextOnuDelineationErrors: strconv.FormatUint(uint64(onuGCD.DelineationErrors), base10), |
Devmalya Paul | 41a762d | 2020-03-01 18:56:54 -0500 | [diff] [blame] | 780 | } |
Amit Ghosh | 502056b | 2020-07-15 09:15:48 +0100 | [diff] [blame] | 781 | em.populateContextWithSerialDeviceID(context, onuGCD.IntfId, onuGCD.OnuId) |
| 782 | |
Devmalya Paul | 41a762d | 2020-03-01 18:56:54 -0500 | [diff] [blame] | 783 | /* Populating device event body */ |
| 784 | de := &voltha.DeviceEvent{ |
| 785 | Context: context, |
| 786 | ResourceId: deviceID, |
| 787 | } |
| 788 | if onuGCD.Status == statusCheckOn { |
| 789 | de.DeviceEventName = fmt.Sprintf("%s_%s", onuLossOfGEMChannelDelineationEvent, "RAISE_EVENT") |
| 790 | } else { |
| 791 | de.DeviceEventName = fmt.Sprintf("%s_%s", onuLossOfGEMChannelDelineationEvent, "CLEAR_EVENT") |
| 792 | } |
| 793 | /* Send event to KAFKA */ |
Kent Hagerman | e6ff101 | 2020-07-14 15:07:53 -0400 | [diff] [blame] | 794 | if err := em.eventProxy.SendDeviceEvent(ctx, de, voltha.EventCategory_COMMUNICATION, voltha.EventSubCategory_ONU, raisedTs); err != nil { |
Devmalya Paul | 41a762d | 2020-03-01 18:56:54 -0500 | [diff] [blame] | 795 | return err |
| 796 | } |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 797 | logger.Debugw(ctx, "onu-loss-of-gem-channel-delineation-event-sent-to-kafka", log.Fields{"onu-id": onuGCD.OnuId, "intf-id": onuGCD.IntfId}) |
Devmalya Paul | 41a762d | 2020-03-01 18:56:54 -0500 | [diff] [blame] | 798 | return nil |
| 799 | } |
| 800 | |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 801 | func (em *OpenOltEventMgr) onuPhysicalEquipmentErrorIndication(ctx context.Context, onuErr *oop.OnuPhysicalEquipmentErrorIndication, deviceID string, raisedTs int64) error { |
Devmalya Paul | 41a762d | 2020-03-01 18:56:54 -0500 | [diff] [blame] | 802 | /* Populating event context */ |
| 803 | context := map[string]string{ |
Amit Ghosh | 502056b | 2020-07-15 09:15:48 +0100 | [diff] [blame] | 804 | ContextOnuOnuID: strconv.FormatUint(uint64(onuErr.OnuId), base10), |
| 805 | ContextOnuPonIntfID: strconv.FormatUint(uint64(onuErr.IntfId), base10), |
Devmalya Paul | 41a762d | 2020-03-01 18:56:54 -0500 | [diff] [blame] | 806 | } |
Amit Ghosh | 502056b | 2020-07-15 09:15:48 +0100 | [diff] [blame] | 807 | em.populateContextWithSerialDeviceID(context, onuErr.IntfId, onuErr.OnuId) |
Devmalya Paul | 41a762d | 2020-03-01 18:56:54 -0500 | [diff] [blame] | 808 | /* Populating device event body */ |
| 809 | de := &voltha.DeviceEvent{ |
| 810 | Context: context, |
| 811 | ResourceId: deviceID, |
| 812 | } |
| 813 | if onuErr.Status == statusCheckOn { |
| 814 | de.DeviceEventName = fmt.Sprintf("%s_%s", onuPhysicalEquipmentErrorEvent, "RAISE_EVENT") |
| 815 | } else { |
| 816 | de.DeviceEventName = fmt.Sprintf("%s_%s", onuPhysicalEquipmentErrorEvent, "CLEAR_EVENT") |
| 817 | } |
| 818 | /* Send event to KAFKA */ |
Kent Hagerman | e6ff101 | 2020-07-14 15:07:53 -0400 | [diff] [blame] | 819 | if err := em.eventProxy.SendDeviceEvent(ctx, de, voltha.EventCategory_EQUIPMENT, voltha.EventSubCategory_ONU, raisedTs); err != nil { |
Devmalya Paul | 41a762d | 2020-03-01 18:56:54 -0500 | [diff] [blame] | 820 | return err |
| 821 | } |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 822 | logger.Debugw(ctx, "onu-physical-equipment-error-event-sent-to-kafka", log.Fields{"onu-id": onuErr.OnuId, "intf-id": onuErr.IntfId}) |
Devmalya Paul | 41a762d | 2020-03-01 18:56:54 -0500 | [diff] [blame] | 823 | return nil |
| 824 | } |
| 825 | |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 826 | func (em *OpenOltEventMgr) onuLossOfAcknowledgementIndication(ctx context.Context, onuLOA *oop.OnuLossOfAcknowledgementIndication, deviceID string, raisedTs int64) error { |
Devmalya Paul | 41a762d | 2020-03-01 18:56:54 -0500 | [diff] [blame] | 827 | /* Populating event context */ |
| 828 | context := map[string]string{ |
Amit Ghosh | 502056b | 2020-07-15 09:15:48 +0100 | [diff] [blame] | 829 | ContextOnuOnuID: strconv.FormatUint(uint64(onuLOA.OnuId), base10), |
| 830 | ContextOnuPonIntfID: strconv.FormatUint(uint64(onuLOA.IntfId), base10), |
Devmalya Paul | 41a762d | 2020-03-01 18:56:54 -0500 | [diff] [blame] | 831 | } |
Amit Ghosh | 502056b | 2020-07-15 09:15:48 +0100 | [diff] [blame] | 832 | em.populateContextWithSerialDeviceID(context, onuLOA.IntfId, onuLOA.OnuId) |
| 833 | |
Devmalya Paul | 41a762d | 2020-03-01 18:56:54 -0500 | [diff] [blame] | 834 | /* Populating device event body */ |
| 835 | de := &voltha.DeviceEvent{ |
| 836 | Context: context, |
| 837 | ResourceId: deviceID, |
| 838 | } |
| 839 | if onuLOA.Status == statusCheckOn { |
| 840 | de.DeviceEventName = fmt.Sprintf("%s_%s", onuLossOfAcknowledgementEvent, "RAISE_EVENT") |
| 841 | } else { |
| 842 | de.DeviceEventName = fmt.Sprintf("%s_%s", onuLossOfAcknowledgementEvent, "CLEAR_EVENT") |
| 843 | } |
| 844 | /* Send event to KAFKA */ |
Kent Hagerman | e6ff101 | 2020-07-14 15:07:53 -0400 | [diff] [blame] | 845 | if err := em.eventProxy.SendDeviceEvent(ctx, de, voltha.EventCategory_EQUIPMENT, voltha.EventSubCategory_ONU, raisedTs); err != nil { |
Devmalya Paul | 41a762d | 2020-03-01 18:56:54 -0500 | [diff] [blame] | 846 | return err |
| 847 | } |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 848 | logger.Debugw(ctx, "onu-physical-equipment-error-event-sent-to-kafka", log.Fields{"onu-id": onuLOA.OnuId, "intf-id": onuLOA.IntfId}) |
Devmalya Paul | 6f063a6 | 2020-02-19 19:19:06 -0500 | [diff] [blame] | 849 | return nil |
| 850 | } |
Devmalya Paul | eb5294e | 2020-03-19 03:01:39 -0400 | [diff] [blame] | 851 | |
Neha Sharma | 96b7bf2 | 2020-06-15 10:37:32 +0000 | [diff] [blame] | 852 | func (em *OpenOltEventMgr) onuDifferentialReachExceededIndication(ctx context.Context, onuDRE *oop.OnuDifferentialReachExceededIndication, deviceID string, raisedTs int64) error { |
Devmalya Paul | eb5294e | 2020-03-19 03:01:39 -0400 | [diff] [blame] | 853 | /* Populating event context */ |
| 854 | context := map[string]string{ |
Amit Ghosh | 502056b | 2020-07-15 09:15:48 +0100 | [diff] [blame] | 855 | ContextOnuOnuID: strconv.FormatUint(uint64(onuDRE.OnuId), base10), |
| 856 | ContextOnuPonIntfID: strconv.FormatUint(uint64(onuDRE.IntfId), base10), |
| 857 | ContextOnuDifferentialDistance: strconv.FormatUint(uint64(onuDRE.Distance), base10), |
Devmalya Paul | eb5294e | 2020-03-19 03:01:39 -0400 | [diff] [blame] | 858 | } |
Amit Ghosh | 502056b | 2020-07-15 09:15:48 +0100 | [diff] [blame] | 859 | em.populateContextWithSerialDeviceID(context, onuDRE.IntfId, onuDRE.OnuId) |
| 860 | |
Devmalya Paul | eb5294e | 2020-03-19 03:01:39 -0400 | [diff] [blame] | 861 | /* Populating device event body */ |
| 862 | de := &voltha.DeviceEvent{ |
| 863 | Context: context, |
| 864 | ResourceId: deviceID, |
| 865 | } |
| 866 | if onuDRE.Status == statusCheckOn { |
| 867 | de.DeviceEventName = fmt.Sprintf("%s_%s", onuDifferentialReachExceededEvent, "RAISE_EVENT") |
| 868 | } else { |
| 869 | de.DeviceEventName = fmt.Sprintf("%s_%s", onuDifferentialReachExceededEvent, "CLEAR_EVENT") |
| 870 | } |
| 871 | /* Send event to KAFKA */ |
Kent Hagerman | e6ff101 | 2020-07-14 15:07:53 -0400 | [diff] [blame] | 872 | if err := em.eventProxy.SendDeviceEvent(ctx, de, voltha.EventCategory_EQUIPMENT, voltha.EventSubCategory_ONU, raisedTs); err != nil { |
Devmalya Paul | eb5294e | 2020-03-19 03:01:39 -0400 | [diff] [blame] | 873 | return err |
| 874 | } |
Girish Kumar | a1ea2aa | 2020-08-19 18:14:22 +0000 | [diff] [blame] | 875 | logger.Debugw(ctx, "onu-differential-reach-exceeded–event-sent-to-kafka", log.Fields{"onu-id": onuDRE.OnuId, "intf-id": onuDRE.IntfId}) |
Devmalya Paul | eb5294e | 2020-03-19 03:01:39 -0400 | [diff] [blame] | 876 | return nil |
| 877 | } |