blob: e9847ca7ae512f4722a2a7bc98d4dbdabc456b6c [file] [log] [blame]
Shad Ansari1106b022019-01-16 22:22:35 -08001/*
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
17package core
18
19import (
20 "encoding/binary"
21 "errors"
Keita NISHIMOTO21853b32019-01-25 19:29:59 +090022 "fmt"
Zdravko Bozakovf56cca42019-04-29 10:06:47 +020023 "log"
Shad Ansari1106b022019-01-16 22:22:35 -080024)
25
26type OmciMsgHandler func(class OmciClass, content OmciContent, key OnuKey) ([]byte, error)
27
28var Handlers = map[OmciMsgType]OmciMsgHandler{
Zdravko Bozakovf56cca42019-04-29 10:06:47 +020029 MibReset: mibReset,
30 MibUpload: mibUpload,
31 MibUploadNext: mibUploadNext,
32 Set: set,
33 Create: create,
34 Get: get,
35 GetAllAlarms: getAllAlarms,
36 GetAllAlarmsNext: getAllAlarmsNext,
37 SynchronizeTime: syncTime,
38 Delete: delete,
Zdravko Bozakov8e9d85a2019-05-27 21:02:59 +020039 Reboot: reboot,
Shad Ansari1106b022019-01-16 22:22:35 -080040}
41
42func mibReset(class OmciClass, content OmciContent, key OnuKey) ([]byte, error) {
43 var pkt []byte
44
Zdravko Bozakovf56cca42019-04-29 10:06:47 +020045 log.Printf("%v - Omci MibReset", key)
46 if state, ok := OnuOmciStateMap[key]; ok {
47 log.Printf("%v - Reseting OnuOmciState", key)
Mahir Gunyeled7b07b2019-02-11 12:06:02 -080048 state.ResetOnuOmciState()
49 }
Shad Ansari1106b022019-01-16 22:22:35 -080050
51 pkt = []byte{
52 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
53 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
54 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
55 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
56 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
57 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
58 return pkt, nil
59}
60
61func mibUpload(class OmciClass, content OmciContent, key OnuKey) ([]byte, error) {
62 var pkt []byte
63
Zdravko Bozakovf56cca42019-04-29 10:06:47 +020064 log.Printf("%v - Omci MibUpload", key)
Shad Ansari1106b022019-01-16 22:22:35 -080065
66 pkt = []byte{
67 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
68 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
69 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
70 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
71 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
72 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
73
74 pkt[9] = NumMibUploads // Number of subsequent MibUploadNext cmds
75
76 return pkt, nil
77}
78
79func mibUploadNext(class OmciClass, content OmciContent, key OnuKey) ([]byte, error) {
80 var pkt []byte
81
82 state := OnuOmciStateMap[key]
83
Zdravko Bozakov8e9d85a2019-05-27 21:02:59 +020084 // commandNumber is the "Command number" attribute received in "MIB Upload Next" OMCI message
85 commandNumber := ( (uint16(content[1])) | (uint16(content[0])<<8) )
86 log.Printf("%v - Omci MibUploadNext %d", key, commandNumber)
Shad Ansari1106b022019-01-16 22:22:35 -080087
Zdravko Bozakov8e9d85a2019-05-27 21:02:59 +020088 switch commandNumber {
Shad Ansari1106b022019-01-16 22:22:35 -080089 case 0:
90 // ONT Data (2)
Zdravko Bozakov8e9d85a2019-05-27 21:02:59 +020091 log.Println("ONT DATA")
Shad Ansari1106b022019-01-16 22:22:35 -080092 pkt = []byte{
93 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
94 0x00, 0x02, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
95 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
96 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
97 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
98 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
99 case 1:
100 // Circuit Pack (6) - #1
Zdravko Bozakov8e9d85a2019-05-27 21:02:59 +0200101 log.Println("Circuit Pack")
Shad Ansari1106b022019-01-16 22:22:35 -0800102 pkt = []byte{
103 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
104 0x00, 0x06, 0x01, 0x01, 0xf0, 0x00, 0x2f, 0x04,
105 0x49, 0x53, 0x4b, 0x54, 0x71, 0xe8, 0x00, 0x80,
106 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
107 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00,
108 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
109 case 2:
110 // Circuit Pack (6) - #2
Zdravko Bozakov8e9d85a2019-05-27 21:02:59 +0200111 log.Println("Circuit Pack")
Shad Ansari1106b022019-01-16 22:22:35 -0800112 pkt = []byte{
113 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
114 0x00, 0x06, 0x01, 0x01, 0x0f, 0x00, 0x42, 0x52,
115 0x43, 0x4d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
116 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
117 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
118 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
119 case 3:
120 // Circuit Pack (6) - #3
Zdravko Bozakov8e9d85a2019-05-27 21:02:59 +0200121 log.Println("Circuit Pack")
Shad Ansari1106b022019-01-16 22:22:35 -0800122 pkt = []byte{
123 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
124 0x00, 0x06, 0x01, 0x01, 0x00, 0xf8, 0x20, 0x20,
125 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
126 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
127 0x20, 0x20, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
128 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
129 case 4:
130 // Circuit Pack (6) - #4
Zdravko Bozakov8e9d85a2019-05-27 21:02:59 +0200131 log.Println("Circuit Pack")
Shad Ansari1106b022019-01-16 22:22:35 -0800132 pkt = []byte{
133 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
134 0x00, 0x06, 0x01, 0x01, 0x00, 0x04, 0x00, 0x00,
135 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
136 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
137 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
138 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
139 case 5:
140 // Circuit Pack (6) - #5
Zdravko Bozakov8e9d85a2019-05-27 21:02:59 +0200141 log.Println("Circuit Pack")
Shad Ansari1106b022019-01-16 22:22:35 -0800142 pkt = []byte{
143 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
144 0x00, 0x06, 0x01, 0x80, 0xf0, 0x00, 0xee, 0x01,
145 0x49, 0x53, 0x4b, 0x54, 0x71, 0xe8, 0x00, 0x80,
146 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
147 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00,
148 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
149 case 6:
150 // Circuit Pack (6) - #6
Zdravko Bozakov8e9d85a2019-05-27 21:02:59 +0200151 log.Println("Circuit Pack")
Shad Ansari1106b022019-01-16 22:22:35 -0800152 pkt = []byte{
153 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
154 0x00, 0x06, 0x01, 0x80, 0x0f, 0x00, 0x42, 0x52,
155 0x43, 0x4d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
156 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
157 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
158 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
159 case 7:
160 // Circuit Pack (6) - #7
Zdravko Bozakov8e9d85a2019-05-27 21:02:59 +0200161 log.Println("Circuit Pack")
Shad Ansari1106b022019-01-16 22:22:35 -0800162 pkt = []byte{
163 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
164 0x00, 0x06, 0x01, 0x80, 0x00, 0xf8, 0x20, 0x20,
165 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
166 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
167 0x20, 0x20, 0x00, 0x08, 0x40, 0x10, 0x00, 0x00,
168 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
169 case 8:
170 // Circuit Pack (6) - #8
Zdravko Bozakov8e9d85a2019-05-27 21:02:59 +0200171 log.Println("Circuit Pack")
Shad Ansari1106b022019-01-16 22:22:35 -0800172 pkt = []byte{
173 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
174 0x00, 0x06, 0x01, 0x80, 0x00, 0x04, 0x00, 0x00,
175 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
176 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
177 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
178 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
179 case 9, 10, 11, 12:
180 // PPTP (11)
Zdravko Bozakov8e9d85a2019-05-27 21:02:59 +0200181 log.Println("PPTP")
Shad Ansari1106b022019-01-16 22:22:35 -0800182 pkt = []byte{
183 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
184 0x00, 0x0b, 0x01, 0x01, 0xff, 0xfe, 0x00, 0x2f,
185 0x00, 0x00, 0x00, 0x00, 0x03, 0x05, 0xee, 0x00,
186 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
187 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
188 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
189 pkt[11] = state.pptpInstance // ME Instance
190 state.pptpInstance++
191 case 13, 14, 15, 16, 17, 18, 19, 20:
192 // T-CONT (262)
Zdravko Bozakov8e9d85a2019-05-27 21:02:59 +0200193 log.Println("T-CONT")
Shad Ansari1106b022019-01-16 22:22:35 -0800194 pkt = []byte{
195 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
196 0x01, 0x06, 0x80, 0x00, 0xe0, 0x00, 0xff, 0xff,
197 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
198 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
199 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
200 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
201 pkt[11] = state.tcontInstance // TCONT ME Instance
202 state.tcontInstance++
203 case 21:
204 // ANI-G (263)
Zdravko Bozakov8e9d85a2019-05-27 21:02:59 +0200205 log.Println("ANI-G")
Shad Ansari1106b022019-01-16 22:22:35 -0800206 pkt = []byte{
207 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
208 0x01, 0x07, 0x80, 0x01, 0xff, 0xff, 0x01, 0x00,
209 0x08, 0x00, 0x30, 0x00, 0x00, 0x05, 0x09, 0x00,
210 0x00, 0xe0, 0x54, 0xff, 0xff, 0x00, 0x00, 0x0c,
211 0x63, 0x81, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00,
212 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
213 case 22, 23, 24, 25:
214 // UNI-G (264)
Zdravko Bozakov8e9d85a2019-05-27 21:02:59 +0200215 log.Println("UNI-G")
Shad Ansari1106b022019-01-16 22:22:35 -0800216 pkt = []byte{
217 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
218 0x01, 0x08, 0x01, 0x01, 0xf8, 0x00, 0x00, 0x00,
219 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
220 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
221 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
222 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
223 pkt[11] = state.uniGInstance // UNI-G ME Instance
224 state.uniGInstance++
Zdravko Bozakovf56cca42019-04-29 10:06:47 +0200225
226 case 26, 30, 34, 38, 42, 46, 50, 54:
227 // Prior-Q with mask downstream
228 log.Println("Mib-upload for prior-q with mask")
229 // For downstream PQ, pkt[10] is 0x00
230 // So the instanceId will be like 0x0001, 0x0002,... etc
231 pkt = []byte{
232 0x00, 0x42, 0x2e, 0x0a, 0x00, 0x02, 0x00, 0x00,
233 0x01, 0x15, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff,
234 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
235 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
236 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
237 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
238 }
239 state.priorQInstance++
240 pkt[11] = state.priorQInstance
241
242 case 27, 31, 35, 39, 43, 47, 51, 55:
243 // Prior-Q with attribute list downstream
244 log.Println("Mib-upload for prior-q with attribute list")
245 pkt = []byte{
246 0x00, 0x43, 0x2e, 0x0a, 0x00, 0x02, 0x00, 0x00,
247 0x01, 0x15, 0x00, 0x00, 0xff, 0xf0, 0x00, 0x01,
248 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
249 0x20, 0x00, 0x00, 0x01, 0x20, 0x01, 0x00, 0x01,
250 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
251 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
252 }
253
254 pkt[11] = state.priorQInstance
255 state.tcontInstance--
256 pkt[24] = state.tcontInstance // related port points to tcont
257 pkt[28] = state.tcontInstance
258
259 case 28, 32, 36, 40, 44, 48, 52, 56:
260 // Prior-Q with mask upstream
261 log.Println("Mib-upload for prior-q with mask")
262 pkt = []byte{
263 0x00, 0x42, 0x2e, 0x0a, 0x00, 0x02, 0x00, 0x00,
264 0x01, 0x15, 0x80, 0x00, 0x00, 0x0f, 0xff, 0xff,
265 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
266 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
267 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
268 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
269 }
270 pkt[11] = state.priorQInstance
271
272 case 29, 33, 37, 41, 45, 49, 53, 57:
273 // Prior-Q with attribute list upstream
274 log.Println("Mib-upload for prior-q with attribute list")
275 // For upstream pkt[10] is fixed as 80
276 // So for upstream PQ, instanceId will be like 0x8001, 0x8002 ... etc
277 pkt = []byte{
278 0x00, 0x43, 0x2e, 0x0a, 0x00, 0x02, 0x00, 0x00,
279 0x01, 0x15, 0x80, 0x00, 0xff, 0xf0, 0x00, 0x01,
280 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
281 0x20, 0x00, 0x00, 0x80, 0x20, 0x01, 0x00, 0x01,
282 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
283 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
284 }
285
286 pkt[11] = state.priorQInstance
287 pkt[24] = state.tcontInstance // related port points to tcont
288 pkt[28] = state.tcontInstance
289
290 case 58, 59, 60, 61, 62, 63, 64, 65:
291 // Traffic Scheduler
292 log.Println("Traffic Scheduler")
293 pkt = []byte{
294 0x02, 0xa4, 0x2e, 0x0a, 0x00, 0x02, 0x00, 0x00,
295 0x01, 0x16, 0x80, 0x00, 0xf0, 0x00, 0x80, 0x00,
296 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
297 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
298 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
299 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
300 }
301
302 pkt[15] = state.tcontInstance
303 state.tcontInstance++
304
305 case 66:
306 // ONT-2G
307 log.Println("ONT-2G")
308 pkt = []byte{
309 0x00, 0x16, 0x2e, 0x0a, 0x00, 0x02, 0x00, 0x00,
310 0x01, 0x01, 0x00, 0x00, 0x07, 0xfc, 0x00, 0x40,
311 0x08, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
312 0x00, 0x7f, 0x00, 0x00, 0x3f, 0x00, 0x01, 0x00,
313 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
314 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
315 }
316
Shad Ansari1106b022019-01-16 22:22:35 -0800317 default:
Mahir Gunyeled7b07b2019-02-11 12:06:02 -0800318 state.extraMibUploadCtr++
319 errstr := fmt.Sprintf("%v - Invalid MibUpload request: %d, extras: %d", key, state.mibUploadCtr, state.extraMibUploadCtr)
Keita NISHIMOTO21853b32019-01-25 19:29:59 +0900320 return nil, errors.New(errstr)
Shad Ansari1106b022019-01-16 22:22:35 -0800321 }
322
323 state.mibUploadCtr++
324 return pkt, nil
325}
326
327func set(class OmciClass, content OmciContent, key OnuKey) ([]byte, error) {
328 var pkt []byte
329
330 pkt = []byte{
331 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
332 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
333 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
334 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
335 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
336 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
337
Zdravko Bozakovf56cca42019-04-29 10:06:47 +0200338 log.Printf("%v - Omci Set", key)
Shad Ansari1106b022019-01-16 22:22:35 -0800339
340 return pkt, nil
341}
342
343func create(class OmciClass, content OmciContent, key OnuKey) ([]byte, error) {
344 var pkt []byte
345
346 if class == GEMPortNetworkCTP {
347 if onuOmciState, ok := OnuOmciStateMap[key]; !ok {
Zdravko Bozakovf56cca42019-04-29 10:06:47 +0200348 log.Printf("%v - ONU Key Error", key)
Shad Ansari1106b022019-01-16 22:22:35 -0800349 return nil, errors.New("ONU Key Error")
350 } else {
351 onuOmciState.gemPortId = binary.BigEndian.Uint16(content[:2])
Mahir Gunyeled7b07b2019-02-11 12:06:02 -0800352 log.Printf("%v - Gem Port Id %d", key, onuOmciState.gemPortId)
Shad Ansari1106b022019-01-16 22:22:35 -0800353 // FIXME
354 OnuOmciStateMap[key].state = DONE
355 }
356 }
357
358 pkt = []byte{
359 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x01,
360 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
361 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
362 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
363 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
364 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
365
Zdravko Bozakovf56cca42019-04-29 10:06:47 +0200366 log.Printf("%v - Omci Create", key)
Shad Ansari1106b022019-01-16 22:22:35 -0800367
368 return pkt, nil
369}
370
371func get(class OmciClass, content OmciContent, key OnuKey) ([]byte, error) {
372 var pkt []byte
373
374 pkt = []byte{
375 0x00, 0x00, 0x00, 0x00, 0x00, 0x2d, 0x02, 0x01,
376 0x00, 0x20, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00,
377 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
378 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
379 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
380 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
381
Zdravko Bozakovf56cca42019-04-29 10:06:47 +0200382 log.Printf("%v - Omci Get", key)
Shad Ansari1106b022019-01-16 22:22:35 -0800383
384 return pkt, nil
385}
386
387func getAllAlarms(class OmciClass, content OmciContent, key OnuKey) ([]byte, error) {
388 var pkt []byte
389
390 pkt = []byte{
391 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
392 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
393 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
394 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
395 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
396 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
397
Zdravko Bozakovf56cca42019-04-29 10:06:47 +0200398 log.Printf("%v - Omci GetAllAlarms", key)
Shad Ansari1106b022019-01-16 22:22:35 -0800399
400 return pkt, nil
401}
Mahir Gunyel5b89e5e2019-02-15 09:34:14 -0800402
Mahir Gunyel5b89e5e2019-02-15 09:34:14 -0800403func syncTime(class OmciClass, content OmciContent, key OnuKey) ([]byte, error) {
404 var pkt []byte
405
406 pkt = []byte{
407 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
408 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
409 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
410 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
411 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
412 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
413
Zdravko Bozakovf56cca42019-04-29 10:06:47 +0200414 log.Printf("%v - Omci syncTime", key)
Mahir Gunyel5b89e5e2019-02-15 09:34:14 -0800415
416 return pkt, nil
417}
418
419func getAllAlarmsNext(class OmciClass, content OmciContent, key OnuKey) ([]byte, error) {
420 var pkt []byte
421
422 pkt = []byte{
423 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
424 0x00, 0x0b, 0x01, 0x02, 0x80, 0x00, 0x00, 0x00,
425 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
426 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
427 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
428 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
429
Zdravko Bozakovf56cca42019-04-29 10:06:47 +0200430 log.Printf("%v - Omci GetAllAlarmsNext", key)
431
432 return pkt, nil
433}
434
435func delete(class OmciClass, content OmciContent, key OnuKey) ([]byte, error) {
436 var pkt []byte
437
438 pkt = []byte{
439 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
440 0x00, 0x0b, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
441 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
442 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
443 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
444 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
445
446 log.Printf("%v - Omci Delete", key)
Mahir Gunyel5b89e5e2019-02-15 09:34:14 -0800447
448 return pkt, nil
449}
Zdravko Bozakov8e9d85a2019-05-27 21:02:59 +0200450
451func reboot(class OmciClass, content OmciContent, key OnuKey) ([]byte, error) {
452 var pkt []byte
453 pkt = []byte{
454 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
455 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
456 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
457 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
458 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
459 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
460
461 log.Printf("%v - Omci Reboot", key)
462 return pkt, nil
463}