Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018-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 | 0f9b88d | 2020-04-20 13:33:25 +0000 | [diff] [blame] | 17 | //Package adaptercoreonu provides the utility for onu devices, flows and statistics |
| 18 | package adaptercoreonu |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 19 | |
| 20 | import ( |
| 21 | gp "github.com/google/gopacket" |
| 22 | "github.com/opencord/omci-lib-go" |
| 23 | ) |
| 24 | |
Holger Hildebrandt | ccd390c | 2020-05-29 13:49:04 +0000 | [diff] [blame] | 25 | type MessageType uint8 |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 26 | |
| 27 | const ( |
Holger Hildebrandt | ccd390c | 2020-05-29 13:49:04 +0000 | [diff] [blame] | 28 | TestMsg MessageType = iota |
| 29 | OMCI |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 30 | ) |
| 31 | |
| 32 | func (m MessageType) String() string { |
| 33 | names := [...]string{ |
| 34 | "TestMsg", |
| 35 | "OMCI", |
| 36 | } |
| 37 | return names[m] |
| 38 | } |
| 39 | |
| 40 | type Message struct { |
| 41 | Type MessageType |
| 42 | Data interface{} |
| 43 | } |
| 44 | |
Holger Hildebrandt | ccd390c | 2020-05-29 13:49:04 +0000 | [diff] [blame] | 45 | type TestMessageType uint8 |
| 46 | |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 47 | const ( |
Himani Chawla | 4d90833 | 2020-08-31 12:30:20 +0530 | [diff] [blame^] | 48 | LoadMibTemplateOk TestMessageType = iota + 1 |
Holger Hildebrandt | ccd390c | 2020-05-29 13:49:04 +0000 | [diff] [blame] | 49 | LoadMibTemplateFailed |
| 50 | TimeOutOccurred |
| 51 | AbortMessageProcessing |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 52 | ) |
| 53 | |
| 54 | //TODO: place holder to have a second interface variant - to be replaced by real variant later on |
| 55 | type TestMessage struct { |
Holger Hildebrandt | ccd390c | 2020-05-29 13:49:04 +0000 | [diff] [blame] | 56 | TestMessageVal TestMessageType |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 57 | } |
| 58 | |
| 59 | type OmciMessage struct { |
| 60 | //OnuSN *openolt.SerialNumber |
| 61 | //OnuID uint32 |
| 62 | OmciMsg *omci.OMCI |
| 63 | OmciPacket *gp.Packet |
| 64 | } |