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) |
Holger Hildebrandt | 4b5e73f | 2021-08-19 06:51:21 +0000 | [diff] [blame] | 92 | IsReconciling() bool |
| 93 | IsSkipOnuConfigReconciling() bool |
| 94 | PrepareReconcilingWithActiveAdapter(context.Context) |
| 95 | ReconcileDeviceTechProf(context.Context) |
| 96 | ReconcileDeviceFlowConfig(context.Context) |
mpagenko | 101ac94 | 2021-11-16 15:01:29 +0000 | [diff] [blame] | 97 | GetReconcileExpiryVlanConfigAbort() time.Duration |
| 98 | SendChUniVlanConfigFinished(value uint16) |
Holger Hildebrandt | 4b5e73f | 2021-08-19 06:51:21 +0000 | [diff] [blame] | 99 | |
| 100 | VerifyUniVlanConfigRequest(context.Context, *OnuUniPort, uint8) |
| 101 | VerifyVlanConfigRequest(context.Context, uint8, uint8) |
| 102 | AddAllUniPorts(context.Context) |
| 103 | RemoveVlanFilterFsm(context.Context, *OnuUniPort) |
| 104 | |
| 105 | EnableUniPortStateUpdate(context.Context) |
| 106 | DisableUniPortStateUpdate(context.Context) |
| 107 | |
| 108 | SetBackend(context.Context, string) *db.Backend |
| 109 | GetBackendPathPrefix() string |
| 110 | |
| 111 | RLockMutexDeletionInProgressFlag() |
| 112 | RUnlockMutexDeletionInProgressFlag() |
| 113 | GetDeletionInProgress() bool |
| 114 | |
khenaidoo | 42dcdfd | 2021-10-19 17:34:12 -0400 | [diff] [blame] | 115 | SendOMCIRequest(context.Context, string, *ia.OmciMessage) error |
Holger Hildebrandt | 4b5e73f | 2021-08-19 06:51:21 +0000 | [diff] [blame] | 116 | CreatePortInCore(context.Context, *voltha.Port) error |
Girish Gowdra | e95687a | 2021-09-08 16:30:58 -0700 | [diff] [blame] | 117 | |
| 118 | PerOnuFlowHandlerRoutine(uniID uint8) |
Holger Hildebrandt | 4b5e73f | 2021-08-19 06:51:21 +0000 | [diff] [blame] | 119 | } |
| 120 | |
| 121 | // IonuDeviceEntry interface to onuDeviceEntry |
| 122 | type IonuDeviceEntry interface { |
| 123 | GetDevOmciCC() *OmciCC |
| 124 | GetOnuDB() *devdb.OnuDeviceDB |
| 125 | GetPersSerialNumber() string |
| 126 | GetPersVendorID() string |
| 127 | GetPersEquipmentID() string |
| 128 | |
| 129 | GetMibUploadFsmCommChan() chan Message |
| 130 | GetMibDownloadFsmCommChan() chan Message |
| 131 | |
| 132 | GetOmciRebootMsgRevChan() chan Message |
| 133 | WaitForRebootResponse(context.Context, chan Message) error |
| 134 | |
| 135 | IncrementMibDataSync(context.Context) |
| 136 | |
| 137 | GetActiveImageMeID(context.Context) (uint16, error) |
| 138 | LockMutexOnuSwImageIndications() |
| 139 | UnlockMutexOnuSwImageIndications() |
| 140 | GetOnuSwImageIndications() SswImageIndications |
| 141 | SetOnuSwImageIndications(SswImageIndications) |
| 142 | GetPersActiveSwVersion() string |
| 143 | SetPersActiveSwVersion(string) |
| 144 | GetActiveImageVersion(context.Context) string |
| 145 | ModifySwImageInactiveVersion(context.Context, string) |
| 146 | ModifySwImageActiveCommit(context.Context, uint8) |
| 147 | |
| 148 | AllocateFreeTcont(context.Context, uint16) (uint16, bool, error) |
| 149 | FreeTcont(context.Context, uint16) |
Holger Hildebrandt | 4b5e73f | 2021-08-19 06:51:21 +0000 | [diff] [blame] | 150 | } |
| 151 | |
| 152 | // IonuMetricsManager interface to onuMetricsManager |
| 153 | type IonuMetricsManager interface { |
| 154 | AddGemPortForPerfMonitoring(context.Context, uint16) |
| 155 | RemoveGemPortForPerfMonitoring(context.Context, uint16) |
| 156 | } |
| 157 | |
| 158 | // IonuAlarmManager interface to onuAlarmManager |
| 159 | type IonuAlarmManager interface { |
| 160 | HandleOmciAlarmNotificationMessage(context.Context, OmciMessage) |
| 161 | ResetAlarmUploadCounters() |
| 162 | GetAlarmMgrEventChannel() chan Message |
| 163 | GetAlarmUploadSeqNo() uint16 |
| 164 | IncrementAlarmUploadSeqNo() |
| 165 | } |
| 166 | |
| 167 | // IonuUniTechProf interface to onuUniTechProf |
| 168 | type IonuUniTechProf interface { |
| 169 | GetAllBidirectionalGemPortIDsForOnu() []uint16 |
| 170 | SetProfileToDelete(uint8, uint8, bool) |
| 171 | } |
| 172 | |
| 173 | // IuniVlanConfigFsm interface to uniVlanConfigFsm |
| 174 | type IuniVlanConfigFsm interface { |
Holger Hildebrandt | c192bc4 | 2021-10-28 14:38:31 +0000 | [diff] [blame] | 175 | IsFlowRemovePending(context.Context, chan<- bool) bool |
Holger Hildebrandt | 4b5e73f | 2021-08-19 06:51:21 +0000 | [diff] [blame] | 176 | } |