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