blob: a5d5aff9bf468296fcc9cdbd728cc8030418c732 [file] [log] [blame]
Holger Hildebrandtfa074992020-03-27 15:42:06 +00001/*
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 Hildebrandt0f9b88d2020-04-20 13:33:25 +000017//Package adaptercoreonu provides the utility for onu devices, flows and statistics
18package adaptercoreonu
Holger Hildebrandtfa074992020-03-27 15:42:06 +000019
20import (
21 gp "github.com/google/gopacket"
22 "github.com/opencord/omci-lib-go"
23)
24
Holger Hildebrandtccd390c2020-05-29 13:49:04 +000025type MessageType uint8
Holger Hildebrandtfa074992020-03-27 15:42:06 +000026
27const (
Holger Hildebrandtccd390c2020-05-29 13:49:04 +000028 TestMsg MessageType = iota
29 OMCI
Holger Hildebrandtfa074992020-03-27 15:42:06 +000030)
31
32func (m MessageType) String() string {
33 names := [...]string{
34 "TestMsg",
35 "OMCI",
36 }
37 return names[m]
38}
39
40type Message struct {
41 Type MessageType
42 Data interface{}
43}
44
Holger Hildebrandtccd390c2020-05-29 13:49:04 +000045type TestMessageType uint8
46
Holger Hildebrandtfa074992020-03-27 15:42:06 +000047const (
Holger Hildebrandtccd390c2020-05-29 13:49:04 +000048 noOperation TestMessageType = iota
49 LoadMibTemplateOk
50 LoadMibTemplateFailed
51 TimeOutOccurred
52 AbortMessageProcessing
Holger Hildebrandtfa074992020-03-27 15:42:06 +000053)
54
55//TODO: place holder to have a second interface variant - to be replaced by real variant later on
56type TestMessage struct {
Holger Hildebrandtccd390c2020-05-29 13:49:04 +000057 TestMessageVal TestMessageType
Holger Hildebrandtfa074992020-03-27 15:42:06 +000058}
59
60type OmciMessage struct {
61 //OnuSN *openolt.SerialNumber
62 //OnuID uint32
63 OmciMsg *omci.OMCI
64 OmciPacket *gp.Packet
65}