blob: d842350579312081cbae07b9e305949958dfd9ef [file] [log] [blame]
Holger Hildebrandt4b5e73f2021-08-19 06:51:21 +00001/*
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
18package common
19
20import (
21 "context"
22 "time"
23
Holger Hildebrandt4b5e73f2021-08-19 06:51:21 +000024 "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"
khenaidoo42dcdfd2021-10-19 17:34:12 -040027 ia "github.com/opencord/voltha-protos/v5/go/inter_adapter"
Holger Hildebrandt4b5e73f2021-08-19 06:51:21 +000028 "github.com/opencord/voltha-protos/v5/go/openolt"
29 "github.com/opencord/voltha-protos/v5/go/voltha"
30)
31
32// IopenONUAC interface to openONUAC
33type 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
45type 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 Gowdrae95687a2021-09-08 16:30:58 -070078 GetFlowMonitoringIsRunning(uniID uint8) bool
79
Holger Hildebrandt4b5e73f2021-08-19 06:51:21 +000080 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 Hildebrandt4b5e73f2021-08-19 06:51:21 +000092 IsReconciling() bool
93 IsSkipOnuConfigReconciling() bool
94 PrepareReconcilingWithActiveAdapter(context.Context)
95 ReconcileDeviceTechProf(context.Context)
96 ReconcileDeviceFlowConfig(context.Context)
mpagenko101ac942021-11-16 15:01:29 +000097 GetReconcileExpiryVlanConfigAbort() time.Duration
98 SendChUniVlanConfigFinished(value uint16)
Holger Hildebrandt4b5e73f2021-08-19 06:51:21 +000099
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
khenaidoo42dcdfd2021-10-19 17:34:12 -0400115 SendOMCIRequest(context.Context, string, *ia.OmciMessage) error
Holger Hildebrandt4b5e73f2021-08-19 06:51:21 +0000116 CreatePortInCore(context.Context, *voltha.Port) error
Girish Gowdrae95687a2021-09-08 16:30:58 -0700117
118 PerOnuFlowHandlerRoutine(uniID uint8)
Holger Hildebrandt4b5e73f2021-08-19 06:51:21 +0000119}
120
121// IonuDeviceEntry interface to onuDeviceEntry
122type 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 Hildebrandt4b5e73f2021-08-19 06:51:21 +0000150}
151
152// IonuMetricsManager interface to onuMetricsManager
153type IonuMetricsManager interface {
154 AddGemPortForPerfMonitoring(context.Context, uint16)
155 RemoveGemPortForPerfMonitoring(context.Context, uint16)
156}
157
158// IonuAlarmManager interface to onuAlarmManager
159type 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
168type IonuUniTechProf interface {
169 GetAllBidirectionalGemPortIDsForOnu() []uint16
170 SetProfileToDelete(uint8, uint8, bool)
171}
172
173// IuniVlanConfigFsm interface to uniVlanConfigFsm
174type IuniVlanConfigFsm interface {
Holger Hildebrandtc192bc42021-10-28 14:38:31 +0000175 IsFlowRemovePending(context.Context, chan<- bool) bool
Holger Hildebrandt4b5e73f2021-08-19 06:51:21 +0000176}