blob: d5ce6d74217113057a5b61d87d51ef8c28a3498d [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,
Shad Ansari1106b022019-01-16 22:22:35 -080039}
40
41func mibReset(class OmciClass, content OmciContent, key OnuKey) ([]byte, error) {
42 var pkt []byte
43
Zdravko Bozakovf56cca42019-04-29 10:06:47 +020044 log.Printf("%v - Omci MibReset", key)
45 if state, ok := OnuOmciStateMap[key]; ok {
46 log.Printf("%v - Reseting OnuOmciState", key)
Mahir Gunyeled7b07b2019-02-11 12:06:02 -080047 state.ResetOnuOmciState()
48 }
Shad Ansari1106b022019-01-16 22:22:35 -080049
50 pkt = []byte{
51 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
52 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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 return pkt, nil
58}
59
60func mibUpload(class OmciClass, content OmciContent, key OnuKey) ([]byte, error) {
61 var pkt []byte
62
Zdravko Bozakovf56cca42019-04-29 10:06:47 +020063 log.Printf("%v - Omci MibUpload", key)
Shad Ansari1106b022019-01-16 22:22:35 -080064
65 pkt = []byte{
66 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
67 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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
73 pkt[9] = NumMibUploads // Number of subsequent MibUploadNext cmds
74
75 return pkt, nil
76}
77
78func mibUploadNext(class OmciClass, content OmciContent, key OnuKey) ([]byte, error) {
79 var pkt []byte
80
81 state := OnuOmciStateMap[key]
82
Mahir Gunyeled7b07b2019-02-11 12:06:02 -080083 log.Printf("%v - Omci MibUploadNext %d", key, state.mibUploadCtr)
Shad Ansari1106b022019-01-16 22:22:35 -080084
85 switch state.mibUploadCtr {
86 case 0:
87 // ONT Data (2)
88 pkt = []byte{
89 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
90 0x00, 0x02, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
91 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
92 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
93 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
94 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
95 case 1:
96 // Circuit Pack (6) - #1
97 pkt = []byte{
98 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
99 0x00, 0x06, 0x01, 0x01, 0xf0, 0x00, 0x2f, 0x04,
100 0x49, 0x53, 0x4b, 0x54, 0x71, 0xe8, 0x00, 0x80,
101 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
102 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00,
103 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
104 case 2:
105 // Circuit Pack (6) - #2
106 pkt = []byte{
107 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
108 0x00, 0x06, 0x01, 0x01, 0x0f, 0x00, 0x42, 0x52,
109 0x43, 0x4d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
110 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
111 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
112 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
113 case 3:
114 // Circuit Pack (6) - #3
115 pkt = []byte{
116 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
117 0x00, 0x06, 0x01, 0x01, 0x00, 0xf8, 0x20, 0x20,
118 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
119 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120 0x20, 0x20, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
121 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
122 case 4:
123 // Circuit Pack (6) - #4
124 pkt = []byte{
125 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
126 0x00, 0x06, 0x01, 0x01, 0x00, 0x04, 0x00, 0x00,
127 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
128 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
129 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
130 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
131 case 5:
132 // Circuit Pack (6) - #5
133 pkt = []byte{
134 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
135 0x00, 0x06, 0x01, 0x80, 0xf0, 0x00, 0xee, 0x01,
136 0x49, 0x53, 0x4b, 0x54, 0x71, 0xe8, 0x00, 0x80,
137 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
138 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00,
139 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
140 case 6:
141 // Circuit Pack (6) - #6
142 pkt = []byte{
143 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
144 0x00, 0x06, 0x01, 0x80, 0x0f, 0x00, 0x42, 0x52,
145 0x43, 0x4d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
146 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
147 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
148 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
149 case 7:
150 // Circuit Pack (6) - #7
151 pkt = []byte{
152 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
153 0x00, 0x06, 0x01, 0x80, 0x00, 0xf8, 0x20, 0x20,
154 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
155 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
156 0x20, 0x20, 0x00, 0x08, 0x40, 0x10, 0x00, 0x00,
157 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
158 case 8:
159 // Circuit Pack (6) - #8
160 pkt = []byte{
161 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
162 0x00, 0x06, 0x01, 0x80, 0x00, 0x04, 0x00, 0x00,
163 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
164 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
165 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
166 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
167 case 9, 10, 11, 12:
168 // PPTP (11)
169 pkt = []byte{
170 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
171 0x00, 0x0b, 0x01, 0x01, 0xff, 0xfe, 0x00, 0x2f,
172 0x00, 0x00, 0x00, 0x00, 0x03, 0x05, 0xee, 0x00,
173 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
174 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
175 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
176 pkt[11] = state.pptpInstance // ME Instance
177 state.pptpInstance++
178 case 13, 14, 15, 16, 17, 18, 19, 20:
179 // T-CONT (262)
180 pkt = []byte{
181 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
182 0x01, 0x06, 0x80, 0x00, 0xe0, 0x00, 0xff, 0xff,
183 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
184 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
185 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
186 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
187 pkt[11] = state.tcontInstance // TCONT ME Instance
188 state.tcontInstance++
189 case 21:
190 // ANI-G (263)
191 pkt = []byte{
192 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
193 0x01, 0x07, 0x80, 0x01, 0xff, 0xff, 0x01, 0x00,
194 0x08, 0x00, 0x30, 0x00, 0x00, 0x05, 0x09, 0x00,
195 0x00, 0xe0, 0x54, 0xff, 0xff, 0x00, 0x00, 0x0c,
196 0x63, 0x81, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00,
197 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
198 case 22, 23, 24, 25:
199 // UNI-G (264)
200 pkt = []byte{
201 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
202 0x01, 0x08, 0x01, 0x01, 0xf8, 0x00, 0x00, 0x00,
203 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
204 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
205 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
206 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
207 pkt[11] = state.uniGInstance // UNI-G ME Instance
208 state.uniGInstance++
Zdravko Bozakovf56cca42019-04-29 10:06:47 +0200209
210 case 26, 30, 34, 38, 42, 46, 50, 54:
211 // Prior-Q with mask downstream
212 log.Println("Mib-upload for prior-q with mask")
213 // For downstream PQ, pkt[10] is 0x00
214 // So the instanceId will be like 0x0001, 0x0002,... etc
215 pkt = []byte{
216 0x00, 0x42, 0x2e, 0x0a, 0x00, 0x02, 0x00, 0x00,
217 0x01, 0x15, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff,
218 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
219 0x09, 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 }
223 state.priorQInstance++
224 pkt[11] = state.priorQInstance
225
226 case 27, 31, 35, 39, 43, 47, 51, 55:
227 // Prior-Q with attribute list downstream
228 log.Println("Mib-upload for prior-q with attribute list")
229 pkt = []byte{
230 0x00, 0x43, 0x2e, 0x0a, 0x00, 0x02, 0x00, 0x00,
231 0x01, 0x15, 0x00, 0x00, 0xff, 0xf0, 0x00, 0x01,
232 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
233 0x20, 0x00, 0x00, 0x01, 0x20, 0x01, 0x00, 0x01,
234 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
235 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
236 }
237
238 pkt[11] = state.priorQInstance
239 state.tcontInstance--
240 pkt[24] = state.tcontInstance // related port points to tcont
241 pkt[28] = state.tcontInstance
242
243 case 28, 32, 36, 40, 44, 48, 52, 56:
244 // Prior-Q with mask upstream
245 log.Println("Mib-upload for prior-q with mask")
246 pkt = []byte{
247 0x00, 0x42, 0x2e, 0x0a, 0x00, 0x02, 0x00, 0x00,
248 0x01, 0x15, 0x80, 0x00, 0x00, 0x0f, 0xff, 0xff,
249 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
250 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
251 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
252 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
253 }
254 pkt[11] = state.priorQInstance
255
256 case 29, 33, 37, 41, 45, 49, 53, 57:
257 // Prior-Q with attribute list upstream
258 log.Println("Mib-upload for prior-q with attribute list")
259 // For upstream pkt[10] is fixed as 80
260 // So for upstream PQ, instanceId will be like 0x8001, 0x8002 ... etc
261 pkt = []byte{
262 0x00, 0x43, 0x2e, 0x0a, 0x00, 0x02, 0x00, 0x00,
263 0x01, 0x15, 0x80, 0x00, 0xff, 0xf0, 0x00, 0x01,
264 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
265 0x20, 0x00, 0x00, 0x80, 0x20, 0x01, 0x00, 0x01,
266 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
267 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
268 }
269
270 pkt[11] = state.priorQInstance
271 pkt[24] = state.tcontInstance // related port points to tcont
272 pkt[28] = state.tcontInstance
273
274 case 58, 59, 60, 61, 62, 63, 64, 65:
275 // Traffic Scheduler
276 log.Println("Traffic Scheduler")
277 pkt = []byte{
278 0x02, 0xa4, 0x2e, 0x0a, 0x00, 0x02, 0x00, 0x00,
279 0x01, 0x16, 0x80, 0x00, 0xf0, 0x00, 0x80, 0x00,
280 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
281 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
282 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
283 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
284 }
285
286 pkt[15] = state.tcontInstance
287 state.tcontInstance++
288
289 case 66:
290 // ONT-2G
291 log.Println("ONT-2G")
292 pkt = []byte{
293 0x00, 0x16, 0x2e, 0x0a, 0x00, 0x02, 0x00, 0x00,
294 0x01, 0x01, 0x00, 0x00, 0x07, 0xfc, 0x00, 0x40,
295 0x08, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
296 0x00, 0x7f, 0x00, 0x00, 0x3f, 0x00, 0x01, 0x00,
297 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
298 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
299 }
300
Shad Ansari1106b022019-01-16 22:22:35 -0800301 default:
Mahir Gunyeled7b07b2019-02-11 12:06:02 -0800302 state.extraMibUploadCtr++
303 errstr := fmt.Sprintf("%v - Invalid MibUpload request: %d, extras: %d", key, state.mibUploadCtr, state.extraMibUploadCtr)
Keita NISHIMOTO21853b32019-01-25 19:29:59 +0900304 return nil, errors.New(errstr)
Shad Ansari1106b022019-01-16 22:22:35 -0800305 }
306
307 state.mibUploadCtr++
308 return pkt, nil
309}
310
311func set(class OmciClass, content OmciContent, key OnuKey) ([]byte, error) {
312 var pkt []byte
313
314 pkt = []byte{
315 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
316 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
317 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
318 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
319 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
320 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
321
Zdravko Bozakovf56cca42019-04-29 10:06:47 +0200322 log.Printf("%v - Omci Set", key)
Shad Ansari1106b022019-01-16 22:22:35 -0800323
324 return pkt, nil
325}
326
327func create(class OmciClass, content OmciContent, key OnuKey) ([]byte, error) {
328 var pkt []byte
329
330 if class == GEMPortNetworkCTP {
331 if onuOmciState, ok := OnuOmciStateMap[key]; !ok {
Zdravko Bozakovf56cca42019-04-29 10:06:47 +0200332 log.Printf("%v - ONU Key Error", key)
Shad Ansari1106b022019-01-16 22:22:35 -0800333 return nil, errors.New("ONU Key Error")
334 } else {
335 onuOmciState.gemPortId = binary.BigEndian.Uint16(content[:2])
Mahir Gunyeled7b07b2019-02-11 12:06:02 -0800336 log.Printf("%v - Gem Port Id %d", key, onuOmciState.gemPortId)
Shad Ansari1106b022019-01-16 22:22:35 -0800337 // FIXME
338 OnuOmciStateMap[key].state = DONE
339 }
340 }
341
342 pkt = []byte{
343 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x01,
344 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
345 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
346 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
347 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
348 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
349
Zdravko Bozakovf56cca42019-04-29 10:06:47 +0200350 log.Printf("%v - Omci Create", key)
Shad Ansari1106b022019-01-16 22:22:35 -0800351
352 return pkt, nil
353}
354
355func get(class OmciClass, content OmciContent, key OnuKey) ([]byte, error) {
356 var pkt []byte
357
358 pkt = []byte{
359 0x00, 0x00, 0x00, 0x00, 0x00, 0x2d, 0x02, 0x01,
360 0x00, 0x20, 0xc0, 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 Get", key)
Shad Ansari1106b022019-01-16 22:22:35 -0800367
368 return pkt, nil
369}
370
371func getAllAlarms(class OmciClass, content OmciContent, key OnuKey) ([]byte, error) {
372 var pkt []byte
373
374 pkt = []byte{
375 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
376 0x00, 0x03, 0x00, 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 GetAllAlarms", key)
Shad Ansari1106b022019-01-16 22:22:35 -0800383
384 return pkt, nil
385}
Mahir Gunyel5b89e5e2019-02-15 09:34:14 -0800386
Mahir Gunyel5b89e5e2019-02-15 09:34:14 -0800387func syncTime(class OmciClass, content OmciContent, key OnuKey) ([]byte, error) {
388 var pkt []byte
389
390 pkt = []byte{
391 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
392 0x00, 0x00, 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 syncTime", key)
Mahir Gunyel5b89e5e2019-02-15 09:34:14 -0800399
400 return pkt, nil
401}
402
403func getAllAlarmsNext(class OmciClass, content OmciContent, key OnuKey) ([]byte, error) {
404 var pkt []byte
405
406 pkt = []byte{
407 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
408 0x00, 0x0b, 0x01, 0x02, 0x80, 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 GetAllAlarmsNext", key)
415
416 return pkt, nil
417}
418
419func delete(class OmciClass, content OmciContent, key OnuKey) ([]byte, error) {
420 var pkt []byte
421
422 pkt = []byte{
423 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
424 0x00, 0x0b, 0x00, 0x00, 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
430 log.Printf("%v - Omci Delete", key)
Mahir Gunyel5b89e5e2019-02-15 09:34:14 -0800431
432 return pkt, nil
433}