Shad Ansari | 2eac6a4 | 2018-11-14 22:35:39 -0800 | [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 | |
| 17 | package core |
| 18 | |
Shad Ansari | 4580617 | 2018-11-19 17:13:08 -0800 | [diff] [blame] | 19 | import ( |
Shad Ansari | a5c7989 | 2018-11-29 16:32:59 -0800 | [diff] [blame] | 20 | "bytes" |
| 21 | "encoding/binary" |
| 22 | |
Shad Ansari | 4580617 | 2018-11-19 17:13:08 -0800 | [diff] [blame] | 23 | "gerrit.opencord.org/voltha-bbsim/common/logger" |
Shad Ansari | a5c7989 | 2018-11-29 16:32:59 -0800 | [diff] [blame] | 24 | "gerrit.opencord.org/voltha-bbsim/protos" |
Shad Ansari | 4580617 | 2018-11-19 17:13:08 -0800 | [diff] [blame] | 25 | ) |
| 26 | |
Shad Ansari | a5c7989 | 2018-11-29 16:32:59 -0800 | [diff] [blame] | 27 | // |
| 28 | // OMCI definitions |
| 29 | // |
| 30 | |
| 31 | // OmciMsgType represents a OMCI message-type |
| 32 | type OmciMsgType byte |
| 33 | |
| 34 | const ( |
| 35 | // Message Types |
| 36 | _ = iota |
| 37 | Create OmciMsgType = 4 |
| 38 | Delete OmciMsgType = 6 |
| 39 | Set OmciMsgType = 8 |
| 40 | Get OmciMsgType = 9 |
| 41 | GetAllAlarms OmciMsgType = 11 |
| 42 | GetAllAlarmsNext OmciMsgType = 12 |
| 43 | MibUpload OmciMsgType = 13 |
| 44 | MibUploadNext OmciMsgType = 14 |
| 45 | MibReset OmciMsgType = 15 |
| 46 | AlarmNotification OmciMsgType = 16 |
| 47 | AttributeValueChange OmciMsgType = 17 |
| 48 | Test OmciMsgType = 18 |
| 49 | StartSoftwareDownload OmciMsgType = 19 |
| 50 | DownloadSection OmciMsgType = 20 |
| 51 | EndSoftwareDownload OmciMsgType = 21 |
| 52 | ActivateSoftware OmciMsgType = 22 |
| 53 | CommitSoftware OmciMsgType = 23 |
| 54 | SynchronizeTime OmciMsgType = 24 |
| 55 | Reboot OmciMsgType = 25 |
| 56 | GetNext OmciMsgType = 26 |
| 57 | TestResult OmciMsgType = 27 |
| 58 | GetCurrentData OmciMsgType = 28 |
| 59 | SetTable OmciMsgType = 29 // Defined in Extended Message Set Only |
| 60 | ) |
| 61 | |
| 62 | const ( |
| 63 | // Managed Entity Class values |
| 64 | GEMPortNetworkCTP OmciClass = 268 |
| 65 | ) |
| 66 | |
| 67 | // OMCI Managed Entity Class |
| 68 | type OmciClass uint16 |
| 69 | |
| 70 | // OMCI Message Identifier |
| 71 | type OmciMessageIdentifier struct { |
| 72 | Class OmciClass |
| 73 | Instance uint16 |
| 74 | } |
| 75 | |
| 76 | type OmciContent [32]byte |
| 77 | |
| 78 | type OmciMessage struct { |
| 79 | TransactionId uint16 |
| 80 | MessageType OmciMsgType |
| 81 | DeviceId uint8 |
| 82 | MessageId OmciMessageIdentifier |
| 83 | Content OmciContent |
Shad Ansari | 2eac6a4 | 2018-11-14 22:35:39 -0800 | [diff] [blame] | 84 | } |
| 85 | |
Shad Ansari | 4580617 | 2018-11-19 17:13:08 -0800 | [diff] [blame] | 86 | const NumMibUploads byte = 9 |
| 87 | |
| 88 | type OnuKey struct { |
| 89 | IntfId, OnuId uint32 |
| 90 | } |
| 91 | |
| 92 | type OnuState struct { |
Shad Ansari | a5c7989 | 2018-11-29 16:32:59 -0800 | [diff] [blame] | 93 | gemPortId uint16 |
Shad Ansari | 4580617 | 2018-11-19 17:13:08 -0800 | [diff] [blame] | 94 | mibUploadCtr uint16 |
| 95 | uniGInstance uint8 |
| 96 | pptpInstance uint8 |
| 97 | } |
| 98 | |
Shad Ansari | 8213c53 | 2018-12-11 13:53:34 -0800 | [diff] [blame^] | 99 | type OmciMsgHandler func(class OmciClass, content OmciContent, key OnuKey) []byte |
| 100 | |
| 101 | var Handlers = map[OmciMsgType]OmciMsgHandler{ |
| 102 | MibReset: mibReset, |
| 103 | MibUpload: mibUpload, |
| 104 | MibUploadNext: mibUploadNext, |
| 105 | Set: set, |
| 106 | Create: create, |
| 107 | Get: get, |
| 108 | GetAllAlarms: getAllAlarms, |
| 109 | } |
| 110 | |
Shad Ansari | a5c7989 | 2018-11-29 16:32:59 -0800 | [diff] [blame] | 111 | var Onus = map[OnuKey]*OnuState{} |
Shad Ansari | 4580617 | 2018-11-19 17:13:08 -0800 | [diff] [blame] | 112 | |
Shad Ansari | a5c7989 | 2018-11-29 16:32:59 -0800 | [diff] [blame] | 113 | func OmciRun(omciOut chan openolt.OmciMsg, omciIn chan openolt.OmciIndication) { |
Shad Ansari | 4580617 | 2018-11-19 17:13:08 -0800 | [diff] [blame] | 114 | |
Shad Ansari | 2eac6a4 | 2018-11-14 22:35:39 -0800 | [diff] [blame] | 115 | for { |
Shad Ansari | a5c7989 | 2018-11-29 16:32:59 -0800 | [diff] [blame] | 116 | var resp openolt.OmciIndication |
Shad Ansari | 5bb48db | 2018-11-17 22:03:41 -0800 | [diff] [blame] | 117 | |
Shad Ansari | 4580617 | 2018-11-19 17:13:08 -0800 | [diff] [blame] | 118 | m := <-omciOut |
Shad Ansari | 5bb48db | 2018-11-17 22:03:41 -0800 | [diff] [blame] | 119 | |
Shad Ansari | a5c7989 | 2018-11-29 16:32:59 -0800 | [diff] [blame] | 120 | transactionId, deviceId, msgType, class, instance, content := ParsePkt(m.Pkt) |
Shad Ansari | 5bb48db | 2018-11-17 22:03:41 -0800 | [diff] [blame] | 121 | |
Shad Ansari | 4580617 | 2018-11-19 17:13:08 -0800 | [diff] [blame] | 122 | logger.Debug("OmciRun - transactionId: %d msgType: %d, ME Class: %d, ME Instance: %d", |
Shad Ansari | a5c7989 | 2018-11-29 16:32:59 -0800 | [diff] [blame] | 123 | transactionId, msgType, class, instance) |
Shad Ansari | 4580617 | 2018-11-19 17:13:08 -0800 | [diff] [blame] | 124 | |
| 125 | key := OnuKey{m.IntfId, m.OnuId} |
Shad Ansari | a5c7989 | 2018-11-29 16:32:59 -0800 | [diff] [blame] | 126 | if _, ok := Onus[key]; !ok { |
| 127 | Onus[key] = NewOnuState() |
Shad Ansari | 4580617 | 2018-11-19 17:13:08 -0800 | [diff] [blame] | 128 | } |
Shad Ansari | 8213c53 | 2018-12-11 13:53:34 -0800 | [diff] [blame^] | 129 | |
| 130 | if _, ok := Handlers[msgType]; !ok { |
| 131 | logger.Warn("Ignore omci msg (msgType %d not handled)", msgType) |
Shad Ansari | ab44c21 | 2018-11-26 11:54:26 -0800 | [diff] [blame] | 132 | continue |
Shad Ansari | 4580617 | 2018-11-19 17:13:08 -0800 | [diff] [blame] | 133 | } |
| 134 | |
Shad Ansari | 8213c53 | 2018-12-11 13:53:34 -0800 | [diff] [blame^] | 135 | resp.Pkt = Handlers[msgType](class, content, key) |
| 136 | |
Shad Ansari | 4580617 | 2018-11-19 17:13:08 -0800 | [diff] [blame] | 137 | resp.Pkt[0] = byte(transactionId >> 8) |
| 138 | resp.Pkt[1] = byte(transactionId & 0xFF) |
Shad Ansari | a5c7989 | 2018-11-29 16:32:59 -0800 | [diff] [blame] | 139 | resp.Pkt[2] = 0x2<<4 | byte(msgType) |
| 140 | resp.Pkt[3] = deviceId |
Shad Ansari | 4580617 | 2018-11-19 17:13:08 -0800 | [diff] [blame] | 141 | resp.IntfId = m.IntfId |
| 142 | resp.OnuId = m.OnuId |
Shad Ansari | 5bb48db | 2018-11-17 22:03:41 -0800 | [diff] [blame] | 143 | omciIn <- resp |
Shad Ansari | 2eac6a4 | 2018-11-14 22:35:39 -0800 | [diff] [blame] | 144 | } |
| 145 | } |
Shad Ansari | 4580617 | 2018-11-19 17:13:08 -0800 | [diff] [blame] | 146 | |
Shad Ansari | a5c7989 | 2018-11-29 16:32:59 -0800 | [diff] [blame] | 147 | func ParsePkt(pkt []byte) (uint16, uint8, OmciMsgType, OmciClass, uint16, OmciContent) { |
| 148 | var m OmciMessage |
| 149 | |
| 150 | r := bytes.NewReader(HexDecode(pkt)) |
| 151 | |
| 152 | if err := binary.Read(r, binary.BigEndian, &m); err != nil { |
| 153 | logger.Error("binary.Read failed: %s", err) |
| 154 | } |
| 155 | logger.Debug("OmciRun - TransactionId: %d MessageType: %d, ME Class: %d, ME Instance: %d, Content: %x", |
| 156 | m.TransactionId, m.MessageType&0x0F, m.MessageId.Class, m.MessageId.Instance, m.Content) |
| 157 | |
| 158 | return m.TransactionId, m.DeviceId, m.MessageType & 0x0F, m.MessageId.Class, m.MessageId.Instance, m.Content |
| 159 | |
| 160 | } |
| 161 | |
| 162 | func HexDecode(pkt []byte) []byte { |
| 163 | // Convert the hex encoding to binary |
| 164 | // TODO - Change openolt adapter to send raw binary instead of hex encoded |
Shad Ansari | 4580617 | 2018-11-19 17:13:08 -0800 | [diff] [blame] | 165 | p := make([]byte, len(pkt)/2) |
| 166 | for i, j := 0, 0; i < len(pkt); i, j = i+2, j+1 { |
Shad Ansari | a5c7989 | 2018-11-29 16:32:59 -0800 | [diff] [blame] | 167 | // Go figure this ;) |
Shad Ansari | 4580617 | 2018-11-19 17:13:08 -0800 | [diff] [blame] | 168 | u := (pkt[i] & 15) + (pkt[i]>>6)*9 |
| 169 | l := (pkt[i+1] & 15) + (pkt[i+1]>>6)*9 |
| 170 | p[j] = u<<4 + l |
| 171 | } |
| 172 | logger.Debug("Omci decoded: %x.", p) |
Shad Ansari | a5c7989 | 2018-11-29 16:32:59 -0800 | [diff] [blame] | 173 | return p |
Shad Ansari | 4580617 | 2018-11-19 17:13:08 -0800 | [diff] [blame] | 174 | } |
| 175 | |
| 176 | func NewOnuState() *OnuState { |
Shad Ansari | a5c7989 | 2018-11-29 16:32:59 -0800 | [diff] [blame] | 177 | return &OnuState{gemPortId: 0, mibUploadCtr: 0, uniGInstance: 1, pptpInstance: 1} |
Shad Ansari | 4580617 | 2018-11-19 17:13:08 -0800 | [diff] [blame] | 178 | } |
| 179 | |
Shad Ansari | 8213c53 | 2018-12-11 13:53:34 -0800 | [diff] [blame^] | 180 | func mibReset(class OmciClass, content OmciContent, key OnuKey) []byte { |
Shad Ansari | 4580617 | 2018-11-19 17:13:08 -0800 | [diff] [blame] | 181 | var pkt []byte |
| 182 | |
| 183 | logger.Debug("Omci MibReset") |
| 184 | |
| 185 | pkt = []byte{ |
Shad Ansari | a5c7989 | 2018-11-29 16:32:59 -0800 | [diff] [blame] | 186 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, |
Shad Ansari | 4580617 | 2018-11-19 17:13:08 -0800 | [diff] [blame] | 187 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 188 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 189 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 190 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
Shad Ansari | a5c7989 | 2018-11-29 16:32:59 -0800 | [diff] [blame] | 191 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} |
Shad Ansari | 4580617 | 2018-11-19 17:13:08 -0800 | [diff] [blame] | 192 | return pkt |
| 193 | } |
| 194 | |
Shad Ansari | 8213c53 | 2018-12-11 13:53:34 -0800 | [diff] [blame^] | 195 | func mibUpload(class OmciClass, content OmciContent, key OnuKey) []byte { |
Shad Ansari | 4580617 | 2018-11-19 17:13:08 -0800 | [diff] [blame] | 196 | var pkt []byte |
| 197 | |
| 198 | logger.Debug("Omci MibUpload") |
| 199 | |
| 200 | pkt = []byte{ |
Shad Ansari | a5c7989 | 2018-11-29 16:32:59 -0800 | [diff] [blame] | 201 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, |
Shad Ansari | 4580617 | 2018-11-19 17:13:08 -0800 | [diff] [blame] | 202 | 0x00, 0x00, 0x00, 0x00, 0x00, 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, |
Shad Ansari | a5c7989 | 2018-11-29 16:32:59 -0800 | [diff] [blame] | 206 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} |
Shad Ansari | 4580617 | 2018-11-19 17:13:08 -0800 | [diff] [blame] | 207 | |
| 208 | pkt[9] = NumMibUploads // Number of subsequent MibUploadNext cmds |
| 209 | |
| 210 | return pkt |
| 211 | } |
| 212 | |
Shad Ansari | 8213c53 | 2018-12-11 13:53:34 -0800 | [diff] [blame^] | 213 | func mibUploadNext(class OmciClass, content OmciContent, key OnuKey) []byte { |
Shad Ansari | 4580617 | 2018-11-19 17:13:08 -0800 | [diff] [blame] | 214 | var pkt []byte |
| 215 | |
| 216 | logger.Debug("Omci MibUploadNext") |
| 217 | |
Shad Ansari | 8213c53 | 2018-12-11 13:53:34 -0800 | [diff] [blame^] | 218 | state := Onus[key] |
| 219 | |
Shad Ansari | 4580617 | 2018-11-19 17:13:08 -0800 | [diff] [blame] | 220 | switch state.mibUploadCtr { |
| 221 | case 0: |
| 222 | // ANI-G |
| 223 | pkt = []byte{ |
Shad Ansari | a5c7989 | 2018-11-29 16:32:59 -0800 | [diff] [blame] | 224 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, |
Shad Ansari | 4580617 | 2018-11-19 17:13:08 -0800 | [diff] [blame] | 225 | 0x01, 0x07, 0x80, 0x01, 0xff, 0xff, 0x01, 0x00, |
| 226 | 0x08, 0x00, 0x30, 0x00, 0x00, 0x05, 0x09, 0x00, |
| 227 | 0x00, 0xe0, 0x54, 0xff, 0xff, 0x00, 0x00, 0x0c, |
| 228 | 0x63, 0x81, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, |
Shad Ansari | a5c7989 | 2018-11-29 16:32:59 -0800 | [diff] [blame] | 229 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} |
Shad Ansari | 4580617 | 2018-11-19 17:13:08 -0800 | [diff] [blame] | 230 | case 1, 2, 3, 4: |
| 231 | // UNI-G |
| 232 | pkt = []byte{ |
Shad Ansari | a5c7989 | 2018-11-29 16:32:59 -0800 | [diff] [blame] | 233 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, |
Shad Ansari | 4580617 | 2018-11-19 17:13:08 -0800 | [diff] [blame] | 234 | 0x01, 0x08, 0x01, 0x01, 0xf8, 0x00, 0x00, 0x00, |
| 235 | 0x00, 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, |
Shad Ansari | a5c7989 | 2018-11-29 16:32:59 -0800 | [diff] [blame] | 238 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} |
Shad Ansari | 4580617 | 2018-11-19 17:13:08 -0800 | [diff] [blame] | 239 | pkt[11] = state.uniGInstance // ME Instance |
| 240 | state.uniGInstance++ |
| 241 | case 5, 6, 7, 8: |
| 242 | pkt = []byte{ |
Shad Ansari | a5c7989 | 2018-11-29 16:32:59 -0800 | [diff] [blame] | 243 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, |
Shad Ansari | 4580617 | 2018-11-19 17:13:08 -0800 | [diff] [blame] | 244 | 0x00, 0x0b, 0x01, 0x01, 0xff, 0xfe, 0x00, 0x2f, |
| 245 | 0x00, 0x00, 0x00, 0x00, 0x03, 0x05, 0xee, 0x00, |
| 246 | 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 247 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
Shad Ansari | a5c7989 | 2018-11-29 16:32:59 -0800 | [diff] [blame] | 248 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} |
Shad Ansari | 4580617 | 2018-11-19 17:13:08 -0800 | [diff] [blame] | 249 | pkt[11] = state.pptpInstance // ME Instance |
| 250 | state.pptpInstance++ |
| 251 | default: |
| 252 | logger.Error("Invalid MibUpload request %d", state.mibUploadCtr) |
| 253 | } |
| 254 | |
| 255 | state.mibUploadCtr++ |
| 256 | |
| 257 | return pkt |
| 258 | } |
| 259 | |
Shad Ansari | 8213c53 | 2018-12-11 13:53:34 -0800 | [diff] [blame^] | 260 | func set(class OmciClass, content OmciContent, key OnuKey) []byte { |
Shad Ansari | 4580617 | 2018-11-19 17:13:08 -0800 | [diff] [blame] | 261 | var pkt []byte |
| 262 | |
| 263 | pkt = []byte{ |
Shad Ansari | a5c7989 | 2018-11-29 16:32:59 -0800 | [diff] [blame] | 264 | 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, |
Shad Ansari | 4580617 | 2018-11-19 17:13:08 -0800 | [diff] [blame] | 265 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 266 | 0x00, 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, |
Shad Ansari | a5c7989 | 2018-11-29 16:32:59 -0800 | [diff] [blame] | 269 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} |
Shad Ansari | 4580617 | 2018-11-19 17:13:08 -0800 | [diff] [blame] | 270 | |
| 271 | logger.Debug("Omci Set") |
| 272 | |
| 273 | return pkt |
| 274 | } |
| 275 | |
Shad Ansari | a5c7989 | 2018-11-29 16:32:59 -0800 | [diff] [blame] | 276 | func create(class OmciClass, content OmciContent, key OnuKey) []byte { |
Shad Ansari | 4580617 | 2018-11-19 17:13:08 -0800 | [diff] [blame] | 277 | var pkt []byte |
| 278 | |
Shad Ansari | a5c7989 | 2018-11-29 16:32:59 -0800 | [diff] [blame] | 279 | if class == GEMPortNetworkCTP { |
| 280 | if onuState, ok := Onus[key]; !ok { |
| 281 | logger.Error("ONU Key Error - IntfId: %d, OnuId:", key.IntfId, key.OnuId) |
| 282 | } else { |
| 283 | onuState.gemPortId = binary.BigEndian.Uint16(content[:2]) |
| 284 | logger.Debug("Gem Port Id %d", onuState.gemPortId) |
| 285 | } |
| 286 | } |
| 287 | |
Shad Ansari | 4580617 | 2018-11-19 17:13:08 -0800 | [diff] [blame] | 288 | pkt = []byte{ |
Shad Ansari | a5c7989 | 2018-11-29 16:32:59 -0800 | [diff] [blame] | 289 | 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x01, |
Shad Ansari | 4580617 | 2018-11-19 17:13:08 -0800 | [diff] [blame] | 290 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 291 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 292 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 293 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
Shad Ansari | a5c7989 | 2018-11-29 16:32:59 -0800 | [diff] [blame] | 294 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} |
Shad Ansari | 4580617 | 2018-11-19 17:13:08 -0800 | [diff] [blame] | 295 | |
| 296 | logger.Debug("Omci Create") |
| 297 | |
| 298 | return pkt |
| 299 | } |
| 300 | |
Shad Ansari | 8213c53 | 2018-12-11 13:53:34 -0800 | [diff] [blame^] | 301 | func get(class OmciClass, content OmciContent, key OnuKey) []byte { |
Shad Ansari | 4580617 | 2018-11-19 17:13:08 -0800 | [diff] [blame] | 302 | var pkt []byte |
| 303 | |
| 304 | pkt = []byte{ |
Shad Ansari | a5c7989 | 2018-11-29 16:32:59 -0800 | [diff] [blame] | 305 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x2d, 0x02, 0x01, |
Shad Ansari | 4580617 | 2018-11-19 17:13:08 -0800 | [diff] [blame] | 306 | 0x00, 0x20, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 307 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 308 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 309 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
Shad Ansari | a5c7989 | 2018-11-29 16:32:59 -0800 | [diff] [blame] | 310 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} |
Shad Ansari | 4580617 | 2018-11-19 17:13:08 -0800 | [diff] [blame] | 311 | |
| 312 | logger.Debug("Omci Get") |
| 313 | |
| 314 | return pkt |
| 315 | } |
Shad Ansari | a5c7989 | 2018-11-29 16:32:59 -0800 | [diff] [blame] | 316 | |
Shad Ansari | 8213c53 | 2018-12-11 13:53:34 -0800 | [diff] [blame^] | 317 | func getAllAlarms(class OmciClass, content OmciContent, key OnuKey) []byte { |
Shad Ansari | a5c7989 | 2018-11-29 16:32:59 -0800 | [diff] [blame] | 318 | var pkt []byte |
| 319 | |
| 320 | pkt = []byte{ |
| 321 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, |
| 322 | 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 323 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 324 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 325 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 326 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} |
| 327 | |
| 328 | logger.Debug("Omci GetAllAlarms") |
| 329 | |
| 330 | return pkt |
| 331 | } |