anjana_sreekumar@infosys.com | 991c206 | 2020-01-08 11:42:57 +0530 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2019-present Infosys Limited |
| 3 | * |
| 4 | * SPDX-License-Identifier: Apache-2.0 |
| 5 | */ |
| 6 | |
| 7 | /****************************************************************************** |
| 8 | * |
| 9 | * This is an auto generated file. |
| 10 | * Please do not edit this file. |
| 11 | * All edits to be made through template source file |
| 12 | * <TOP-DIR/scripts/GtpV2StackCodeGen/tts/msgtemplate.cpp.tt> |
| 13 | ******************************************************************************/ |
| 14 | |
| 15 | #include "downlinkDataNotificationMsg.h" |
| 16 | #include "../ieClasses/manual/gtpV2Ie.h" |
| 17 | #include "../ieClasses/gtpV2IeFactory.h" |
| 18 | #include "../ieClasses/causeIe.h" |
| 19 | #include "../ieClasses/ebiIe.h" |
| 20 | #include "../ieClasses/arpIe.h" |
| 21 | #include "../ieClasses/imsiIe.h" |
| 22 | #include "../ieClasses/fTeidIe.h" |
| 23 | #include "../ieClasses/indicationIe.h" |
| 24 | #include "../ieClasses/loadControlInformationIe.h" |
| 25 | #include "../ieClasses/sgwsNodeLevelLoadControlInformationInDownlinkDataNotification.h" |
| 26 | #include "../ieClasses/overloadControlInformationIe.h" |
| 27 | #include "../ieClasses/sgwsOverloadControlInformationInDownlinkDataNotification.h" |
| 28 | #include "../ieClasses/pagingAndServiceInformationIe.h" |
| 29 | |
| 30 | DownlinkDataNotificationMsg::DownlinkDataNotificationMsg() |
| 31 | { |
| 32 | msgType = DownlinkDataNotificationMsgType; |
| 33 | |
| 34 | } |
| 35 | |
| 36 | DownlinkDataNotificationMsg::~DownlinkDataNotificationMsg() |
| 37 | { |
| 38 | |
| 39 | } |
| 40 | |
| 41 | bool DownlinkDataNotificationMsg::encodeDownlinkDataNotificationMsg(MsgBuffer &buffer, |
| 42 | DownlinkDataNotificationMsgData |
| 43 | const &data) |
| 44 | { |
| 45 | bool rc = false; |
| 46 | GtpV2IeHeader header; |
| 47 | Uint16 startIndex = 0; |
| 48 | Uint16 endIndex = 0; |
| 49 | Uint16 length = 0; |
| 50 | |
| 51 | if (data.causeIePresent) |
| 52 | { |
| 53 | |
| 54 | // Encode the Ie Header |
| 55 | header.ieType = CauseIeType; |
| 56 | header.instance = 0; |
| 57 | header.length = 0; // We will encode the IE first and then update the length |
| 58 | GtpV2Ie::encodeGtpV2IeHeader(buffer, header); |
| 59 | startIndex = buffer.getCurrentIndex(); |
| 60 | CauseIe cause= |
| 61 | dynamic_cast< |
| 62 | CauseIe&>(GtpV2IeFactory::getInstance().getIeObject(CauseIeType)); |
| 63 | rc = cause.encodeCauseIe(buffer, data.cause); |
| 64 | endIndex = buffer.getCurrentIndex(); |
| 65 | length = endIndex - startIndex; |
| 66 | |
| 67 | // encode the length value now |
| 68 | buffer.goToIndex(startIndex - 3); |
| 69 | buffer.writeUint16(length, false); |
| 70 | buffer.goToIndex(endIndex); |
| 71 | |
| 72 | if (!(rc)) |
| 73 | { |
| 74 | errorStream.add((char *)"Failed to encode IE: cause\n"); |
| 75 | return false; |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | if (data.epsBearerIdIePresent) |
| 80 | { |
| 81 | |
| 82 | // Encode the Ie Header |
| 83 | header.ieType = EbiIeType; |
| 84 | header.instance = 0; |
| 85 | header.length = 0; // We will encode the IE first and then update the length |
| 86 | GtpV2Ie::encodeGtpV2IeHeader(buffer, header); |
| 87 | startIndex = buffer.getCurrentIndex(); |
| 88 | EbiIe ebi= |
| 89 | dynamic_cast< |
| 90 | EbiIe&>(GtpV2IeFactory::getInstance().getIeObject(EbiIeType)); |
| 91 | rc = ebi.encodeEbiIe(buffer, data.epsBearerId); |
| 92 | endIndex = buffer.getCurrentIndex(); |
| 93 | length = endIndex - startIndex; |
| 94 | |
| 95 | // encode the length value now |
| 96 | buffer.goToIndex(startIndex - 3); |
| 97 | buffer.writeUint16(length, false); |
| 98 | buffer.goToIndex(endIndex); |
| 99 | |
| 100 | if (!(rc)) |
| 101 | { |
| 102 | errorStream.add((char *)"Failed to encode IE: epsBearerId\n"); |
| 103 | return false; |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | if (data.allocationRetentionPriorityIePresent) |
| 108 | { |
| 109 | |
| 110 | // Encode the Ie Header |
| 111 | header.ieType = ArpIeType; |
| 112 | header.instance = 0; |
| 113 | header.length = 0; // We will encode the IE first and then update the length |
| 114 | GtpV2Ie::encodeGtpV2IeHeader(buffer, header); |
| 115 | startIndex = buffer.getCurrentIndex(); |
| 116 | ArpIe arp= |
| 117 | dynamic_cast< |
| 118 | ArpIe&>(GtpV2IeFactory::getInstance().getIeObject(ArpIeType)); |
| 119 | rc = arp.encodeArpIe(buffer, data.allocationRetentionPriority); |
| 120 | endIndex = buffer.getCurrentIndex(); |
| 121 | length = endIndex - startIndex; |
| 122 | |
| 123 | // encode the length value now |
| 124 | buffer.goToIndex(startIndex - 3); |
| 125 | buffer.writeUint16(length, false); |
| 126 | buffer.goToIndex(endIndex); |
| 127 | |
| 128 | if (!(rc)) |
| 129 | { |
| 130 | errorStream.add((char *)"Failed to encode IE: allocationRetentionPriority\n"); |
| 131 | return false; |
| 132 | } |
| 133 | } |
| 134 | |
| 135 | if (data.imsiIePresent) |
| 136 | { |
| 137 | |
| 138 | // Encode the Ie Header |
| 139 | header.ieType = ImsiIeType; |
| 140 | header.instance = 0; |
| 141 | header.length = 0; // We will encode the IE first and then update the length |
| 142 | GtpV2Ie::encodeGtpV2IeHeader(buffer, header); |
| 143 | startIndex = buffer.getCurrentIndex(); |
| 144 | ImsiIe imsi= |
| 145 | dynamic_cast< |
| 146 | ImsiIe&>(GtpV2IeFactory::getInstance().getIeObject(ImsiIeType)); |
| 147 | rc = imsi.encodeImsiIe(buffer, data.imsi); |
| 148 | endIndex = buffer.getCurrentIndex(); |
| 149 | length = endIndex - startIndex; |
| 150 | |
| 151 | // encode the length value now |
| 152 | buffer.goToIndex(startIndex - 3); |
| 153 | buffer.writeUint16(length, false); |
| 154 | buffer.goToIndex(endIndex); |
| 155 | |
| 156 | if (!(rc)) |
| 157 | { |
| 158 | errorStream.add((char *)"Failed to encode IE: imsi\n"); |
| 159 | return false; |
| 160 | } |
| 161 | } |
| 162 | |
| 163 | if (data.senderFTeidForControlPlaneIePresent) |
| 164 | { |
| 165 | |
| 166 | // Encode the Ie Header |
| 167 | header.ieType = FTeidIeType; |
| 168 | header.instance = 0; |
| 169 | header.length = 0; // We will encode the IE first and then update the length |
| 170 | GtpV2Ie::encodeGtpV2IeHeader(buffer, header); |
| 171 | startIndex = buffer.getCurrentIndex(); |
| 172 | FTeidIe fTeid= |
| 173 | dynamic_cast< |
| 174 | FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType)); |
| 175 | rc = fTeid.encodeFTeidIe(buffer, data.senderFTeidForControlPlane); |
| 176 | endIndex = buffer.getCurrentIndex(); |
| 177 | length = endIndex - startIndex; |
| 178 | |
| 179 | // encode the length value now |
| 180 | buffer.goToIndex(startIndex - 3); |
| 181 | buffer.writeUint16(length, false); |
| 182 | buffer.goToIndex(endIndex); |
| 183 | |
| 184 | if (!(rc)) |
| 185 | { |
| 186 | errorStream.add((char *)"Failed to encode IE: senderFTeidForControlPlane\n"); |
| 187 | return false; |
| 188 | } |
| 189 | } |
| 190 | |
| 191 | if (data.indicationFlagsIePresent) |
| 192 | { |
| 193 | |
| 194 | // Encode the Ie Header |
| 195 | header.ieType = IndicationIeType; |
| 196 | header.instance = 0; |
| 197 | header.length = 0; // We will encode the IE first and then update the length |
| 198 | GtpV2Ie::encodeGtpV2IeHeader(buffer, header); |
| 199 | startIndex = buffer.getCurrentIndex(); |
| 200 | IndicationIe indication= |
| 201 | dynamic_cast< |
| 202 | IndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(IndicationIeType)); |
| 203 | rc = indication.encodeIndicationIe(buffer, data.indicationFlags); |
| 204 | endIndex = buffer.getCurrentIndex(); |
| 205 | length = endIndex - startIndex; |
| 206 | |
| 207 | // encode the length value now |
| 208 | buffer.goToIndex(startIndex - 3); |
| 209 | buffer.writeUint16(length, false); |
| 210 | buffer.goToIndex(endIndex); |
| 211 | |
| 212 | if (!(rc)) |
| 213 | { |
| 214 | errorStream.add((char *)"Failed to encode IE: indicationFlags\n"); |
| 215 | return false; |
| 216 | } |
| 217 | } |
| 218 | |
| 219 | if (data.sgwsNodeLevelLoadControlInformationIePresent) |
| 220 | { |
| 221 | |
| 222 | // Encode the Ie Header |
| 223 | header.ieType = LoadControlInformationIeType; |
| 224 | header.instance = 0; |
| 225 | header.length = 0; // We will encode the IE first and then update the length |
| 226 | GtpV2Ie::encodeGtpV2IeHeader(buffer, header); |
| 227 | startIndex = buffer.getCurrentIndex(); |
| 228 | LoadControlInformationIe loadControlInformation= |
| 229 | dynamic_cast< |
| 230 | LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType)); |
| 231 | SgwsNodeLevelLoadControlInformationInDownlinkDataNotification groupedIeInstance = |
| 232 | dynamic_cast< |
| 233 | SgwsNodeLevelLoadControlInformationInDownlinkDataNotification&>(loadControlInformation.getGroupedIe(msgType, 0)); |
| 234 | rc = groupedIeInstance.encodeSgwsNodeLevelLoadControlInformationInDownlinkDataNotification(buffer, data.sgwsNodeLevelLoadControlInformation); |
| 235 | endIndex = buffer.getCurrentIndex(); |
| 236 | length = endIndex - startIndex; |
| 237 | |
| 238 | // encode the length value now |
| 239 | buffer.goToIndex(startIndex - 3); |
| 240 | buffer.writeUint16(length, false); |
| 241 | buffer.goToIndex(endIndex); |
| 242 | |
| 243 | if (!(rc)) |
| 244 | { |
| 245 | errorStream.add((char *)"Failed to encode IE: sgwsNodeLevelLoadControlInformation\n"); |
| 246 | return false; |
| 247 | } |
| 248 | } |
| 249 | |
| 250 | if (data.sgwsOverloadControlInformationIePresent) |
| 251 | { |
| 252 | |
| 253 | // Encode the Ie Header |
| 254 | header.ieType = OverloadControlInformationIeType; |
| 255 | header.instance = 0; |
| 256 | header.length = 0; // We will encode the IE first and then update the length |
| 257 | GtpV2Ie::encodeGtpV2IeHeader(buffer, header); |
| 258 | startIndex = buffer.getCurrentIndex(); |
| 259 | OverloadControlInformationIe overloadControlInformation= |
| 260 | dynamic_cast< |
| 261 | OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType)); |
| 262 | SgwsOverloadControlInformationInDownlinkDataNotification groupedIeInstance = |
| 263 | dynamic_cast< |
| 264 | SgwsOverloadControlInformationInDownlinkDataNotification&>(overloadControlInformation.getGroupedIe(msgType, 0)); |
| 265 | rc = groupedIeInstance.encodeSgwsOverloadControlInformationInDownlinkDataNotification(buffer, data.sgwsOverloadControlInformation); |
| 266 | endIndex = buffer.getCurrentIndex(); |
| 267 | length = endIndex - startIndex; |
| 268 | |
| 269 | // encode the length value now |
| 270 | buffer.goToIndex(startIndex - 3); |
| 271 | buffer.writeUint16(length, false); |
| 272 | buffer.goToIndex(endIndex); |
| 273 | |
| 274 | if (!(rc)) |
| 275 | { |
| 276 | errorStream.add((char *)"Failed to encode IE: sgwsOverloadControlInformation\n"); |
| 277 | return false; |
| 278 | } |
| 279 | } |
| 280 | |
| 281 | if (data.pagingAndServiceInformationIePresent) |
| 282 | { |
| 283 | |
| 284 | // Encode the Ie Header |
| 285 | header.ieType = PagingAndServiceInformationIeType; |
| 286 | header.instance = 0; |
| 287 | header.length = 0; // We will encode the IE first and then update the length |
| 288 | GtpV2Ie::encodeGtpV2IeHeader(buffer, header); |
| 289 | startIndex = buffer.getCurrentIndex(); |
| 290 | PagingAndServiceInformationIe pagingAndServiceInformation= |
| 291 | dynamic_cast< |
| 292 | PagingAndServiceInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(PagingAndServiceInformationIeType)); |
| 293 | rc = pagingAndServiceInformation.encodePagingAndServiceInformationIe(buffer, data.pagingAndServiceInformation); |
| 294 | endIndex = buffer.getCurrentIndex(); |
| 295 | length = endIndex - startIndex; |
| 296 | |
| 297 | // encode the length value now |
| 298 | buffer.goToIndex(startIndex - 3); |
| 299 | buffer.writeUint16(length, false); |
| 300 | buffer.goToIndex(endIndex); |
| 301 | |
| 302 | if (!(rc)) |
| 303 | { |
| 304 | errorStream.add((char *)"Failed to encode IE: pagingAndServiceInformation\n"); |
| 305 | return false; |
| 306 | } |
| 307 | } |
| 308 | return rc; |
| 309 | |
| 310 | } |
| 311 | |
| 312 | bool DownlinkDataNotificationMsg::decodeDownlinkDataNotificationMsg(MsgBuffer &buffer, |
| 313 | DownlinkDataNotificationMsgData |
| 314 | &data, Uint16 length) |
| 315 | { |
| 316 | |
| 317 | bool rc = false; |
| 318 | GtpV2IeHeader ieHeader; |
| 319 | |
| 320 | set<Uint16> mandatoryIeLocalList = mandatoryIeSet; |
| 321 | while (buffer.lengthLeft() > IE_HEADER_SIZE) |
| 322 | { |
| 323 | GtpV2Ie::decodeGtpV2IeHeader(buffer, ieHeader); |
| 324 | if (ieHeader.length > buffer.lengthLeft()) |
| 325 | { |
| 326 | // We do not have enough bytes left in the message for this IE |
| 327 | errorStream.add((char *)"IE Length exceeds beyond message boundary\n"); |
| 328 | errorStream.add((char *)" Offending IE Type: "); |
| 329 | errorStream.add(ieHeader.ieType); |
| 330 | errorStream.add((char *)"\n Ie Length in Header: "); |
| 331 | errorStream.add(ieHeader.length); |
| 332 | errorStream.add((char *)"\n Bytes left in message: "); |
| 333 | errorStream.add(buffer.lengthLeft()); |
| 334 | errorStream.endOfLine(); |
| 335 | return false; |
| 336 | } |
| 337 | |
| 338 | switch (ieHeader.ieType){ |
| 339 | |
| 340 | case CauseIeType: |
| 341 | { |
| 342 | CauseIe ieObject = |
| 343 | dynamic_cast< |
| 344 | CauseIe&>(GtpV2IeFactory::getInstance().getIeObject(CauseIeType)); |
| 345 | |
| 346 | if(ieHeader.instance == 0) |
| 347 | { |
| 348 | rc = ieObject.decodeCauseIe(buffer, data.cause, ieHeader.length); |
| 349 | |
| 350 | data.causeIePresent = true; |
| 351 | if (!(rc)) |
| 352 | { |
| 353 | errorStream.add((char *)"Failed to decode IE: cause\n"); |
| 354 | return false; |
| 355 | } |
| 356 | } |
| 357 | |
| 358 | else |
| 359 | { |
| 360 | // Unknown IE instance print error |
| 361 | errorStream.add((char *)"Unknown IE Type: "); |
| 362 | errorStream.add(ieHeader.ieType); |
| 363 | errorStream.endOfLine(); |
| 364 | buffer.skipBytes(ieHeader.length); |
| 365 | } |
| 366 | break; |
| 367 | } |
| 368 | |
| 369 | case EbiIeType: |
| 370 | { |
| 371 | EbiIe ieObject = |
| 372 | dynamic_cast< |
| 373 | EbiIe&>(GtpV2IeFactory::getInstance().getIeObject(EbiIeType)); |
| 374 | |
| 375 | if(ieHeader.instance == 0) |
| 376 | { |
| 377 | rc = ieObject.decodeEbiIe(buffer, data.epsBearerId, ieHeader.length); |
| 378 | |
| 379 | data.epsBearerIdIePresent = true; |
| 380 | if (!(rc)) |
| 381 | { |
| 382 | errorStream.add((char *)"Failed to decode IE: epsBearerId\n"); |
| 383 | return false; |
| 384 | } |
| 385 | } |
| 386 | |
| 387 | else |
| 388 | { |
| 389 | // Unknown IE instance print error |
| 390 | errorStream.add((char *)"Unknown IE Type: "); |
| 391 | errorStream.add(ieHeader.ieType); |
| 392 | errorStream.endOfLine(); |
| 393 | buffer.skipBytes(ieHeader.length); |
| 394 | } |
| 395 | break; |
| 396 | } |
| 397 | |
| 398 | case ArpIeType: |
| 399 | { |
| 400 | ArpIe ieObject = |
| 401 | dynamic_cast< |
| 402 | ArpIe&>(GtpV2IeFactory::getInstance().getIeObject(ArpIeType)); |
| 403 | |
| 404 | if(ieHeader.instance == 0) |
| 405 | { |
| 406 | rc = ieObject.decodeArpIe(buffer, data.allocationRetentionPriority, ieHeader.length); |
| 407 | |
| 408 | data.allocationRetentionPriorityIePresent = true; |
| 409 | if (!(rc)) |
| 410 | { |
| 411 | errorStream.add((char *)"Failed to decode IE: allocationRetentionPriority\n"); |
| 412 | return false; |
| 413 | } |
| 414 | } |
| 415 | |
| 416 | else |
| 417 | { |
| 418 | // Unknown IE instance print error |
| 419 | errorStream.add((char *)"Unknown IE Type: "); |
| 420 | errorStream.add(ieHeader.ieType); |
| 421 | errorStream.endOfLine(); |
| 422 | buffer.skipBytes(ieHeader.length); |
| 423 | } |
| 424 | break; |
| 425 | } |
| 426 | |
| 427 | case ImsiIeType: |
| 428 | { |
| 429 | ImsiIe ieObject = |
| 430 | dynamic_cast< |
| 431 | ImsiIe&>(GtpV2IeFactory::getInstance().getIeObject(ImsiIeType)); |
| 432 | |
| 433 | if(ieHeader.instance == 0) |
| 434 | { |
| 435 | rc = ieObject.decodeImsiIe(buffer, data.imsi, ieHeader.length); |
| 436 | |
| 437 | data.imsiIePresent = true; |
| 438 | if (!(rc)) |
| 439 | { |
| 440 | errorStream.add((char *)"Failed to decode IE: imsi\n"); |
| 441 | return false; |
| 442 | } |
| 443 | } |
| 444 | |
| 445 | else |
| 446 | { |
| 447 | // Unknown IE instance print error |
| 448 | errorStream.add((char *)"Unknown IE Type: "); |
| 449 | errorStream.add(ieHeader.ieType); |
| 450 | errorStream.endOfLine(); |
| 451 | buffer.skipBytes(ieHeader.length); |
| 452 | } |
| 453 | break; |
| 454 | } |
| 455 | |
| 456 | case FTeidIeType: |
| 457 | { |
| 458 | FTeidIe ieObject = |
| 459 | dynamic_cast< |
| 460 | FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType)); |
| 461 | |
| 462 | if(ieHeader.instance == 0) |
| 463 | { |
| 464 | rc = ieObject.decodeFTeidIe(buffer, data.senderFTeidForControlPlane, ieHeader.length); |
| 465 | |
| 466 | data.senderFTeidForControlPlaneIePresent = true; |
| 467 | if (!(rc)) |
| 468 | { |
| 469 | errorStream.add((char *)"Failed to decode IE: senderFTeidForControlPlane\n"); |
| 470 | return false; |
| 471 | } |
| 472 | } |
| 473 | |
| 474 | else |
| 475 | { |
| 476 | // Unknown IE instance print error |
| 477 | errorStream.add((char *)"Unknown IE Type: "); |
| 478 | errorStream.add(ieHeader.ieType); |
| 479 | errorStream.endOfLine(); |
| 480 | buffer.skipBytes(ieHeader.length); |
| 481 | } |
| 482 | break; |
| 483 | } |
| 484 | |
| 485 | case IndicationIeType: |
| 486 | { |
| 487 | IndicationIe ieObject = |
| 488 | dynamic_cast< |
| 489 | IndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(IndicationIeType)); |
| 490 | |
| 491 | if(ieHeader.instance == 0) |
| 492 | { |
| 493 | rc = ieObject.decodeIndicationIe(buffer, data.indicationFlags, ieHeader.length); |
| 494 | |
| 495 | data.indicationFlagsIePresent = true; |
| 496 | if (!(rc)) |
| 497 | { |
| 498 | errorStream.add((char *)"Failed to decode IE: indicationFlags\n"); |
| 499 | return false; |
| 500 | } |
| 501 | } |
| 502 | |
| 503 | else |
| 504 | { |
| 505 | // Unknown IE instance print error |
| 506 | errorStream.add((char *)"Unknown IE Type: "); |
| 507 | errorStream.add(ieHeader.ieType); |
| 508 | errorStream.endOfLine(); |
| 509 | buffer.skipBytes(ieHeader.length); |
| 510 | } |
| 511 | break; |
| 512 | } |
| 513 | |
| 514 | case LoadControlInformationIeType: |
| 515 | { |
| 516 | LoadControlInformationIe ieObject = |
| 517 | dynamic_cast< |
| 518 | LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType)); |
| 519 | |
| 520 | if(ieHeader.instance == 0) |
| 521 | { |
| 522 | SgwsNodeLevelLoadControlInformationInDownlinkDataNotification groupedIeInstance = |
| 523 | dynamic_cast< |
| 524 | SgwsNodeLevelLoadControlInformationInDownlinkDataNotification&>(ieObject.getGroupedIe(msgType, 0)); |
| 525 | rc = groupedIeInstance.decodeSgwsNodeLevelLoadControlInformationInDownlinkDataNotification(buffer, data.sgwsNodeLevelLoadControlInformation, ieHeader.length); |
| 526 | |
| 527 | data.sgwsNodeLevelLoadControlInformationIePresent = true; |
| 528 | if (!(rc)) |
| 529 | { |
| 530 | errorStream.add((char *)"Failed to decode IE: sgwsNodeLevelLoadControlInformation\n"); |
| 531 | return false; |
| 532 | } |
| 533 | } |
| 534 | |
| 535 | else |
| 536 | { |
| 537 | // Unknown IE instance print error |
| 538 | errorStream.add((char *)"Unknown IE Type: "); |
| 539 | errorStream.add(ieHeader.ieType); |
| 540 | errorStream.endOfLine(); |
| 541 | buffer.skipBytes(ieHeader.length); |
| 542 | } |
| 543 | break; |
| 544 | } |
| 545 | |
| 546 | case OverloadControlInformationIeType: |
| 547 | { |
| 548 | OverloadControlInformationIe ieObject = |
| 549 | dynamic_cast< |
| 550 | OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType)); |
| 551 | |
| 552 | if(ieHeader.instance == 0) |
| 553 | { |
| 554 | SgwsOverloadControlInformationInDownlinkDataNotification groupedIeInstance = |
| 555 | dynamic_cast< |
| 556 | SgwsOverloadControlInformationInDownlinkDataNotification&>(ieObject.getGroupedIe(msgType, 0)); |
| 557 | rc = groupedIeInstance.decodeSgwsOverloadControlInformationInDownlinkDataNotification(buffer, data.sgwsOverloadControlInformation, ieHeader.length); |
| 558 | |
| 559 | data.sgwsOverloadControlInformationIePresent = true; |
| 560 | if (!(rc)) |
| 561 | { |
| 562 | errorStream.add((char *)"Failed to decode IE: sgwsOverloadControlInformation\n"); |
| 563 | return false; |
| 564 | } |
| 565 | } |
| 566 | |
| 567 | else |
| 568 | { |
| 569 | // Unknown IE instance print error |
| 570 | errorStream.add((char *)"Unknown IE Type: "); |
| 571 | errorStream.add(ieHeader.ieType); |
| 572 | errorStream.endOfLine(); |
| 573 | buffer.skipBytes(ieHeader.length); |
| 574 | } |
| 575 | break; |
| 576 | } |
| 577 | |
| 578 | case PagingAndServiceInformationIeType: |
| 579 | { |
| 580 | PagingAndServiceInformationIe ieObject = |
| 581 | dynamic_cast< |
| 582 | PagingAndServiceInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(PagingAndServiceInformationIeType)); |
| 583 | |
| 584 | if(ieHeader.instance == 0) |
| 585 | { |
| 586 | rc = ieObject.decodePagingAndServiceInformationIe(buffer, data.pagingAndServiceInformation, ieHeader.length); |
| 587 | |
| 588 | data.pagingAndServiceInformationIePresent = true; |
| 589 | if (!(rc)) |
| 590 | { |
| 591 | errorStream.add((char *)"Failed to decode IE: pagingAndServiceInformation\n"); |
| 592 | return false; |
| 593 | } |
| 594 | } |
| 595 | |
| 596 | else |
| 597 | { |
| 598 | // Unknown IE instance print error |
| 599 | errorStream.add((char *)"Unknown IE Type: "); |
| 600 | errorStream.add(ieHeader.ieType); |
| 601 | errorStream.endOfLine(); |
| 602 | buffer.skipBytes(ieHeader.length); |
| 603 | } |
| 604 | break; |
| 605 | } |
| 606 | |
| 607 | default: |
| 608 | { |
| 609 | // Unknown IE print error |
| 610 | errorStream.add((char *)"Unknown IE Type: "); |
| 611 | errorStream.add(ieHeader.ieType); |
| 612 | errorStream.endOfLine(); |
| 613 | buffer.skipBytes(ieHeader.length); |
| 614 | } |
| 615 | } |
| 616 | } |
| 617 | return rc; // TODO validations |
| 618 | } |
| 619 | |
| 620 | void DownlinkDataNotificationMsg:: |
| 621 | displayDownlinkDataNotificationMsgData_v(DownlinkDataNotificationMsgData const &data, Debug &stream) |
| 622 | { |
| 623 | stream.incrIndent(); |
| 624 | stream.add((char *)"DownlinkDataNotificationMsg:"); |
| 625 | stream.endOfLine(); |
| 626 | stream.incrIndent(); |
| 627 | |
| 628 | |
| 629 | if (data.causeIePresent) |
| 630 | { |
| 631 | |
| 632 | |
| 633 | stream.add((char *)"IE - cause:"); |
| 634 | stream.endOfLine(); |
| 635 | CauseIe cause= |
| 636 | dynamic_cast< |
| 637 | CauseIe&>(GtpV2IeFactory::getInstance().getIeObject(CauseIeType)); |
| 638 | cause.displayCauseIe_v(data.cause, stream); |
| 639 | |
| 640 | } |
| 641 | if (data.epsBearerIdIePresent) |
| 642 | { |
| 643 | |
| 644 | |
| 645 | stream.add((char *)"IE - epsBearerId:"); |
| 646 | stream.endOfLine(); |
| 647 | EbiIe ebi= |
| 648 | dynamic_cast< |
| 649 | EbiIe&>(GtpV2IeFactory::getInstance().getIeObject(EbiIeType)); |
| 650 | ebi.displayEbiIe_v(data.epsBearerId, stream); |
| 651 | |
| 652 | } |
| 653 | if (data.allocationRetentionPriorityIePresent) |
| 654 | { |
| 655 | |
| 656 | |
| 657 | stream.add((char *)"IE - allocationRetentionPriority:"); |
| 658 | stream.endOfLine(); |
| 659 | ArpIe arp= |
| 660 | dynamic_cast< |
| 661 | ArpIe&>(GtpV2IeFactory::getInstance().getIeObject(ArpIeType)); |
| 662 | arp.displayArpIe_v(data.allocationRetentionPriority, stream); |
| 663 | |
| 664 | } |
| 665 | if (data.imsiIePresent) |
| 666 | { |
| 667 | |
| 668 | |
| 669 | stream.add((char *)"IE - imsi:"); |
| 670 | stream.endOfLine(); |
| 671 | ImsiIe imsi= |
| 672 | dynamic_cast< |
| 673 | ImsiIe&>(GtpV2IeFactory::getInstance().getIeObject(ImsiIeType)); |
| 674 | imsi.displayImsiIe_v(data.imsi, stream); |
| 675 | |
| 676 | } |
| 677 | if (data.senderFTeidForControlPlaneIePresent) |
| 678 | { |
| 679 | |
| 680 | |
| 681 | stream.add((char *)"IE - senderFTeidForControlPlane:"); |
| 682 | stream.endOfLine(); |
| 683 | FTeidIe fTeid= |
| 684 | dynamic_cast< |
| 685 | FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType)); |
| 686 | fTeid.displayFTeidIe_v(data.senderFTeidForControlPlane, stream); |
| 687 | |
| 688 | } |
| 689 | if (data.indicationFlagsIePresent) |
| 690 | { |
| 691 | |
| 692 | |
| 693 | stream.add((char *)"IE - indicationFlags:"); |
| 694 | stream.endOfLine(); |
| 695 | IndicationIe indication= |
| 696 | dynamic_cast< |
| 697 | IndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(IndicationIeType)); |
| 698 | indication.displayIndicationIe_v(data.indicationFlags, stream); |
| 699 | |
| 700 | } |
| 701 | if (data.sgwsNodeLevelLoadControlInformationIePresent) |
| 702 | { |
| 703 | |
| 704 | |
| 705 | stream.add((char *)"IE - sgwsNodeLevelLoadControlInformation:"); |
| 706 | stream.endOfLine(); |
| 707 | LoadControlInformationIe loadControlInformation= |
| 708 | dynamic_cast< |
| 709 | LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType)); |
| 710 | SgwsNodeLevelLoadControlInformationInDownlinkDataNotification groupedIeInstance = |
| 711 | dynamic_cast< |
| 712 | SgwsNodeLevelLoadControlInformationInDownlinkDataNotification&>(loadControlInformation.getGroupedIe(msgType, 0)); |
| 713 | groupedIeInstance.displaySgwsNodeLevelLoadControlInformationInDownlinkDataNotificationData_v(data.sgwsNodeLevelLoadControlInformation, stream); |
| 714 | |
| 715 | } |
| 716 | if (data.sgwsOverloadControlInformationIePresent) |
| 717 | { |
| 718 | |
| 719 | |
| 720 | stream.add((char *)"IE - sgwsOverloadControlInformation:"); |
| 721 | stream.endOfLine(); |
| 722 | OverloadControlInformationIe overloadControlInformation= |
| 723 | dynamic_cast< |
| 724 | OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType)); |
| 725 | SgwsOverloadControlInformationInDownlinkDataNotification groupedIeInstance = |
| 726 | dynamic_cast< |
| 727 | SgwsOverloadControlInformationInDownlinkDataNotification&>(overloadControlInformation.getGroupedIe(msgType, 0)); |
| 728 | groupedIeInstance.displaySgwsOverloadControlInformationInDownlinkDataNotificationData_v(data.sgwsOverloadControlInformation, stream); |
| 729 | |
| 730 | } |
| 731 | if (data.pagingAndServiceInformationIePresent) |
| 732 | { |
| 733 | |
| 734 | |
| 735 | stream.add((char *)"IE - pagingAndServiceInformation:"); |
| 736 | stream.endOfLine(); |
| 737 | PagingAndServiceInformationIe pagingAndServiceInformation= |
| 738 | dynamic_cast< |
| 739 | PagingAndServiceInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(PagingAndServiceInformationIeType)); |
| 740 | pagingAndServiceInformation.displayPagingAndServiceInformationIe_v(data.pagingAndServiceInformation, stream); |
| 741 | |
| 742 | } |
| 743 | |
| 744 | stream.decrIndent(); |
| 745 | stream.decrIndent(); |
| 746 | } |
| 747 | |
| 748 | |