Holger Hildebrandt | 0f9b88d | 2020-04-20 13:33:25 +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 | |
Holger Hildebrandt | 4b5e73f | 2021-08-19 06:51:21 +0000 | [diff] [blame] | 17 | //Package core provides the utility for onu devices, flows and statistics |
| 18 | package core |
Holger Hildebrandt | 0f9b88d | 2020-04-20 13:33:25 +0000 | [diff] [blame] | 19 | |
| 20 | import ( |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 21 | "context" |
Holger Hildebrandt | 0f9b88d | 2020-04-20 13:33:25 +0000 | [diff] [blame] | 22 | "errors" |
Holger Hildebrandt | 0f9b88d | 2020-04-20 13:33:25 +0000 | [diff] [blame] | 23 | ) |
| 24 | |
| 25 | /* |
| 26 | OpenOmciAgentDefaults = { |
| 27 | 'mib-synchronizer': { |
| 28 | 'state-machine': MibSynchronizer, # Implements the MIB synchronization state machine |
| 29 | 'database': MibDbVolatileDict, # Implements volatile ME MIB database |
| 30 | # 'database': MibDbExternal, # Implements persistent ME MIB database |
| 31 | 'advertise-events': True, # Advertise events on OpenOMCI event bus |
| 32 | 'audit-delay': 60, # Time to wait between MIB audits. 0 to disable audits. |
| 33 | 'tasks': { |
| 34 | 'mib-upload': MibUploadTask, |
| 35 | 'mib-template': MibTemplateTask, |
| 36 | 'get-mds': GetMdsTask, |
| 37 | 'mib-audit': GetMdsTask, |
| 38 | 'mib-resync': MibResyncTask, |
| 39 | 'mib-reconcile': MibReconcileTask |
| 40 | } |
| 41 | }, |
| 42 | 'omci-capabilities': { |
| 43 | 'state-machine': OnuOmciCapabilities, # Implements OMCI capabilities state machine |
| 44 | 'advertise-events': False, # Advertise events on OpenOMCI event bus |
| 45 | 'tasks': { |
| 46 | 'get-capabilities': OnuCapabilitiesTask # Get supported ME and Commands |
| 47 | } |
| 48 | }, |
| 49 | 'performance-intervals': { |
| 50 | 'state-machine': PerformanceIntervals, # Implements PM Intervals State machine |
| 51 | 'advertise-events': False, # Advertise events on OpenOMCI event bus |
| 52 | 'tasks': { |
| 53 | 'sync-time': SyncTimeTask, |
| 54 | 'collect-data': IntervalDataTask, |
| 55 | 'create-pm': OmciCreatePMRequest, |
| 56 | 'delete-pm': OmciDeletePMRequest, |
| 57 | }, |
| 58 | }, |
| 59 | 'alarm-synchronizer': { |
| 60 | 'state-machine': AlarmSynchronizer, # Implements the Alarm sync state machine |
| 61 | 'database': AlarmDbExternal, # For any State storage needs |
| 62 | 'advertise-events': True, # Advertise events on OpenOMCI event bus |
| 63 | 'tasks': { |
| 64 | 'alarm-resync': AlarmResyncTask |
| 65 | } |
| 66 | }, |
| 67 | 'image_downloader': { |
| 68 | 'state-machine': ImageDownloadeSTM, |
| 69 | 'advertise-event': True, |
| 70 | 'tasks': { |
| 71 | 'download-file': FileDownloadTask |
| 72 | } |
| 73 | }, |
| 74 | 'image_upgrader': { |
| 75 | 'state-machine': OmciSoftwareImageDownloadSTM, |
| 76 | 'advertise-event': True, |
| 77 | 'tasks': { |
| 78 | 'omci_upgrade_task': OmciSwImageUpgradeTask |
| 79 | } |
| 80 | } |
| 81 | # 'image_activator': { |
| 82 | # 'state-machine': OmciSoftwareImageActivateSTM, |
| 83 | # 'advertise-event': True, |
| 84 | # } |
| 85 | } |
| 86 | */ |
| 87 | |
Holger Hildebrandt | 0f9b88d | 2020-04-20 13:33:25 +0000 | [diff] [blame] | 88 | //suppose global methods per adapter ... |
dbainbri | 4d3a0dc | 2020-12-02 00:33:42 +0000 | [diff] [blame] | 89 | func mibDbVolatileDictImpl(ctx context.Context) error { |
| 90 | logger.Debug(ctx, "MibVolatileDict-called") |
Holger Hildebrandt | 0f9b88d | 2020-04-20 13:33:25 +0000 | [diff] [blame] | 91 | return errors.New("not_implemented") |
| 92 | } |
| 93 | |
Himani Chawla | 6d2ae15 | 2020-09-02 13:11:20 +0530 | [diff] [blame] | 94 | /* |
| 95 | func alarmDbDictImpl() error { |
Holger Hildebrandt | 0f9b88d | 2020-04-20 13:33:25 +0000 | [diff] [blame] | 96 | logger.Debug("AlarmDb-called") |
| 97 | return errors.New("not_implemented") |
| 98 | } |
Himani Chawla | 6d2ae15 | 2020-09-02 13:11:20 +0530 | [diff] [blame] | 99 | */ |