Holger Hildebrandt | 4b5e73f | 2021-08-19 06:51:21 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2020-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 | |
| 17 | //Package common provides global definitions |
| 18 | package common |
| 19 | |
| 20 | import ( |
| 21 | "context" |
| 22 | "time" |
| 23 | |
Holger Hildebrandt | 94688c7 | 2021-12-17 12:13:02 +0000 | [diff] [blame] | 24 | me "github.com/opencord/omci-lib-go/v2/generated" |
Holger Hildebrandt | 4b5e73f | 2021-08-19 06:51:21 +0000 | [diff] [blame] | 25 | "github.com/opencord/voltha-lib-go/v7/pkg/db" |
| 26 | "github.com/opencord/voltha-lib-go/v7/pkg/events/eventif" |
| 27 | "github.com/opencord/voltha-openonu-adapter-go/internal/pkg/devdb" |
khenaidoo | 42dcdfd | 2021-10-19 17:34:12 -0400 | [diff] [blame] | 28 | ia "github.com/opencord/voltha-protos/v5/go/inter_adapter" |
Holger Hildebrandt | 4b5e73f | 2021-08-19 06:51:21 +0000 | [diff] [blame] | 29 | "github.com/opencord/voltha-protos/v5/go/openolt" |
| 30 | "github.com/opencord/voltha-protos/v5/go/voltha" |
| 31 | ) |
| 32 | |
| 33 | // IopenONUAC interface to openONUAC |
| 34 | type IopenONUAC interface { |
| 35 | GetSupportedFsms() *OmciDeviceFsms |
| 36 | LockMutexMibTemplateGenerated() |
| 37 | UnlockMutexMibTemplateGenerated() |
| 38 | GetMibTemplatesGenerated(string) (bool, bool) |
| 39 | SetMibTemplatesGenerated(string, bool) |
| 40 | RLockMutexDeviceHandlersMap() |
| 41 | RUnlockMutexDeviceHandlersMap() |
| 42 | GetDeviceHandler(string) (IdeviceHandler, bool) |
| 43 | } |
| 44 | |
| 45 | // IdeviceHandler interface to deviceHandler |
| 46 | type IdeviceHandler interface { |
| 47 | GetDeviceID() string |
| 48 | GetLogicalDeviceID() string |
| 49 | GetDevice() *voltha.Device |
| 50 | GetDeviceType() string |
| 51 | GetProxyAddressID() string |
| 52 | GetProxyAddressType() string |
| 53 | GetProxyAddress() *voltha.Device_ProxyAddress |
| 54 | GetEventProxy() eventif.EventProxy |
| 55 | GetOmciTimeout() int |
| 56 | GetAlarmAuditInterval() time.Duration |
| 57 | GetDlToOnuTimeout4M() time.Duration |
| 58 | GetUniEntityMap() *OnuUniPortMap |
| 59 | GetUniPortMask() int |
| 60 | GetPonPortNumber() *uint32 |
| 61 | GetOnuIndication() *openolt.OnuIndication |
| 62 | GetUniVlanConfigFsm(uint8) IuniVlanConfigFsm |
Holger Hildebrandt | 9afc158 | 2021-11-30 16:10:19 +0000 | [diff] [blame] | 63 | GetTechProfileInstanceFromParentAdapter(context.Context, uint8, string) (*ia.TechProfileDownloadMessage, error) |
Holger Hildebrandt | 4b5e73f | 2021-08-19 06:51:21 +0000 | [diff] [blame] | 64 | |
| 65 | GetDeviceReasonString() string |
mpagenko | e478208 | 2021-11-25 12:04:26 +0000 | [diff] [blame] | 66 | ReasonUpdate(context.Context, uint8, bool) error |
Holger Hildebrandt | 4b5e73f | 2021-08-19 06:51:21 +0000 | [diff] [blame] | 67 | |
| 68 | GetCollectorIsRunning() bool |
| 69 | StartCollector(context.Context) |
| 70 | InitPmConfigs() |
| 71 | GetPmConfigs() *voltha.PmConfigs |
| 72 | GetMetricsEnabled() bool |
| 73 | GetOnuMetricsManager() IonuMetricsManager |
| 74 | GetOnuAlarmManager() IonuAlarmManager |
| 75 | GetOnuTP() IonuUniTechProf |
| 76 | |
| 77 | GetAlarmManagerIsRunning(context.Context) bool |
| 78 | StartAlarmManager(context.Context) |
| 79 | |
Girish Gowdra | e95687a | 2021-09-08 16:30:58 -0700 | [diff] [blame] | 80 | GetFlowMonitoringIsRunning(uniID uint8) bool |
| 81 | |
Holger Hildebrandt | 4b5e73f | 2021-08-19 06:51:21 +0000 | [diff] [blame] | 82 | CheckAuditStartCondition(context.Context, UsedOmciConfigFsms) bool |
| 83 | |
| 84 | RemoveOnuUpgradeFsm(context.Context, *voltha.ImageState) |
| 85 | DeviceProcStatusUpdate(context.Context, OnuDeviceEvent) |
| 86 | |
| 87 | SetReadyForOmciConfig(bool) |
| 88 | IsReadyForOmciConfig() bool |
| 89 | |
| 90 | StorePersistentData(context.Context) error |
| 91 | StorePersUniFlowConfig(context.Context, uint8, *[]UniVlanFlowParams, bool) error |
| 92 | |
| 93 | StartReconciling(context.Context, bool) |
Holger Hildebrandt | 4b5e73f | 2021-08-19 06:51:21 +0000 | [diff] [blame] | 94 | IsReconciling() bool |
| 95 | IsSkipOnuConfigReconciling() bool |
Holger Hildebrandt | 9afc158 | 2021-11-30 16:10:19 +0000 | [diff] [blame] | 96 | SetReconcilingReasonUpdate(bool) |
| 97 | IsReconcilingReasonUpdate() bool |
Holger Hildebrandt | 4b5e73f | 2021-08-19 06:51:21 +0000 | [diff] [blame] | 98 | PrepareReconcilingWithActiveAdapter(context.Context) |
Holger Hildebrandt | b314f44 | 2021-11-24 12:03:10 +0000 | [diff] [blame] | 99 | ReconcileDeviceTechProf(context.Context) bool |
Holger Hildebrandt | 4b5e73f | 2021-08-19 06:51:21 +0000 | [diff] [blame] | 100 | ReconcileDeviceFlowConfig(context.Context) |
mpagenko | 101ac94 | 2021-11-16 15:01:29 +0000 | [diff] [blame] | 101 | GetReconcileExpiryVlanConfigAbort() time.Duration |
| 102 | SendChUniVlanConfigFinished(value uint16) |
Holger Hildebrandt | 4b5e73f | 2021-08-19 06:51:21 +0000 | [diff] [blame] | 103 | |
| 104 | VerifyUniVlanConfigRequest(context.Context, *OnuUniPort, uint8) |
| 105 | VerifyVlanConfigRequest(context.Context, uint8, uint8) |
| 106 | AddAllUniPorts(context.Context) |
| 107 | RemoveVlanFilterFsm(context.Context, *OnuUniPort) |
| 108 | |
| 109 | EnableUniPortStateUpdate(context.Context) |
| 110 | DisableUniPortStateUpdate(context.Context) |
| 111 | |
| 112 | SetBackend(context.Context, string) *db.Backend |
| 113 | GetBackendPathPrefix() string |
| 114 | |
| 115 | RLockMutexDeletionInProgressFlag() |
| 116 | RUnlockMutexDeletionInProgressFlag() |
| 117 | GetDeletionInProgress() bool |
| 118 | |
khenaidoo | 42dcdfd | 2021-10-19 17:34:12 -0400 | [diff] [blame] | 119 | SendOMCIRequest(context.Context, string, *ia.OmciMessage) error |
kesavand | 011d516 | 2021-11-25 19:21:06 +0530 | [diff] [blame] | 120 | SendOnuSwSectionsOfWindow(context.Context, string, *ia.OmciMessages) error |
| 121 | |
Holger Hildebrandt | 4b5e73f | 2021-08-19 06:51:21 +0000 | [diff] [blame] | 122 | CreatePortInCore(context.Context, *voltha.Port) error |
Girish Gowdra | e95687a | 2021-09-08 16:30:58 -0700 | [diff] [blame] | 123 | |
| 124 | PerOnuFlowHandlerRoutine(uniID uint8) |
Holger Hildebrandt | 4b5e73f | 2021-08-19 06:51:21 +0000 | [diff] [blame] | 125 | } |
| 126 | |
| 127 | // IonuDeviceEntry interface to onuDeviceEntry |
| 128 | type IonuDeviceEntry interface { |
| 129 | GetDevOmciCC() *OmciCC |
| 130 | GetOnuDB() *devdb.OnuDeviceDB |
| 131 | GetPersSerialNumber() string |
| 132 | GetPersVendorID() string |
| 133 | GetPersEquipmentID() string |
| 134 | |
| 135 | GetMibUploadFsmCommChan() chan Message |
| 136 | GetMibDownloadFsmCommChan() chan Message |
| 137 | |
| 138 | GetOmciRebootMsgRevChan() chan Message |
| 139 | WaitForRebootResponse(context.Context, chan Message) error |
| 140 | |
| 141 | IncrementMibDataSync(context.Context) |
| 142 | |
| 143 | GetActiveImageMeID(context.Context) (uint16, error) |
Holger Hildebrandt | 94688c7 | 2021-12-17 12:13:02 +0000 | [diff] [blame] | 144 | HandleSwImageIndications(context.Context, uint16, me.AttributeValueMap) |
Holger Hildebrandt | 4b5e73f | 2021-08-19 06:51:21 +0000 | [diff] [blame] | 145 | GetPersActiveSwVersion() string |
| 146 | SetPersActiveSwVersion(string) |
| 147 | GetActiveImageVersion(context.Context) string |
| 148 | ModifySwImageInactiveVersion(context.Context, string) |
| 149 | ModifySwImageActiveCommit(context.Context, uint8) |
| 150 | |
| 151 | AllocateFreeTcont(context.Context, uint16) (uint16, bool, error) |
| 152 | FreeTcont(context.Context, uint16) |
Holger Hildebrandt | 4b5e73f | 2021-08-19 06:51:21 +0000 | [diff] [blame] | 153 | } |
| 154 | |
| 155 | // IonuMetricsManager interface to onuMetricsManager |
| 156 | type IonuMetricsManager interface { |
| 157 | AddGemPortForPerfMonitoring(context.Context, uint16) |
| 158 | RemoveGemPortForPerfMonitoring(context.Context, uint16) |
| 159 | } |
| 160 | |
| 161 | // IonuAlarmManager interface to onuAlarmManager |
| 162 | type IonuAlarmManager interface { |
| 163 | HandleOmciAlarmNotificationMessage(context.Context, OmciMessage) |
| 164 | ResetAlarmUploadCounters() |
| 165 | GetAlarmMgrEventChannel() chan Message |
| 166 | GetAlarmUploadSeqNo() uint16 |
| 167 | IncrementAlarmUploadSeqNo() |
| 168 | } |
| 169 | |
| 170 | // IonuUniTechProf interface to onuUniTechProf |
| 171 | type IonuUniTechProf interface { |
| 172 | GetAllBidirectionalGemPortIDsForOnu() []uint16 |
| 173 | SetProfileToDelete(uint8, uint8, bool) |
| 174 | } |
| 175 | |
| 176 | // IuniVlanConfigFsm interface to uniVlanConfigFsm |
| 177 | type IuniVlanConfigFsm interface { |
Holger Hildebrandt | c192bc4 | 2021-10-28 14:38:31 +0000 | [diff] [blame] | 178 | IsFlowRemovePending(context.Context, chan<- bool) bool |
Holger Hildebrandt | 4b5e73f | 2021-08-19 06:51:21 +0000 | [diff] [blame] | 179 | } |