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 "createSessionResponseMsg.h" |
| 16 | #include "../ieClasses/manual/gtpV2Ie.h" |
| 17 | #include "../ieClasses/gtpV2IeFactory.h" |
| 18 | #include "../ieClasses/causeIe.h" |
| 19 | #include "../ieClasses/changeReportingActionIe.h" |
| 20 | #include "../ieClasses/csgInformationReportingActionIe.h" |
| 21 | #include "../ieClasses/fTeidIe.h" |
| 22 | #include "../ieClasses/apnRestrictionIe.h" |
| 23 | #include "../ieClasses/ambrIe.h" |
| 24 | #include "../ieClasses/ebiIe.h" |
| 25 | #include "../ieClasses/bearerContextIe.h" |
| 26 | #include "../ieClasses/bearerContextsCreatedInCreateSessionResponse.h" |
| 27 | #include "../ieClasses/bearerContextIe.h" |
| 28 | #include "../ieClasses/bearerContextsMarkedForRemovalInCreateSessionResponse.h" |
| 29 | #include "../ieClasses/recoveryIe.h" |
| 30 | #include "../ieClasses/fqdnIe.h" |
| 31 | #include "../ieClasses/ipAddressIe.h" |
| 32 | #include "../ieClasses/fqCsidIe.h" |
| 33 | #include "../ieClasses/fqCsidIe.h" |
| 34 | #include "../ieClasses/localDistinguishedNameIe.h" |
| 35 | #include "../ieClasses/localDistinguishedNameIe.h" |
| 36 | #include "../ieClasses/epcTimerIe.h" |
| 37 | #include "../ieClasses/henbInformationReportingIe.h" |
| 38 | #include "../ieClasses/fTeidIe.h" |
| 39 | #include "../ieClasses/paaIe.h" |
| 40 | #include "../ieClasses/pcoIe.h" |
| 41 | #include "../ieClasses/additionalProtocolConfigurationOptionsIe.h" |
| 42 | #include "../ieClasses/ip4cpIe.h" |
| 43 | #include "../ieClasses/indicationIe.h" |
| 44 | #include "../ieClasses/presenceReportingAreaActionIe.h" |
| 45 | #include "../ieClasses/loadControlInformationIe.h" |
| 46 | #include "../ieClasses/pgwsNodeLevelLoadControlInformationInCreateSessionResponse.h" |
| 47 | #include "../ieClasses/loadControlInformationIe.h" |
| 48 | #include "../ieClasses/pgwsApnLevelLoadControlInformationInCreateSessionResponse.h" |
| 49 | #include "../ieClasses/loadControlInformationIe.h" |
| 50 | #include "../ieClasses/sgwsNodeLevelLoadControlInformationInCreateSessionResponse.h" |
| 51 | #include "../ieClasses/overloadControlInformationIe.h" |
| 52 | #include "../ieClasses/pgwsOverloadControlInformationInCreateSessionResponse.h" |
| 53 | #include "../ieClasses/overloadControlInformationIe.h" |
| 54 | #include "../ieClasses/sgwsOverloadControlInformationInCreateSessionResponse.h" |
| 55 | #include "../ieClasses/fContainerIe.h" |
| 56 | #include "../ieClasses/chargingIdIe.h" |
| 57 | #include "../ieClasses/epcoIe.h" |
| 58 | |
| 59 | CreateSessionResponseMsg::CreateSessionResponseMsg() |
| 60 | { |
| 61 | msgType = CreateSessionResponseMsgType; |
| 62 | Uint16 mandIe; |
| 63 | mandIe = CauseIeType; |
| 64 | mandIe = (mandIe << 8) | 0; // cause |
| 65 | mandatoryIeSet.insert(mandIe); mandIe = BearerContextIeType; |
| 66 | mandIe = (mandIe << 8) | 0; // bearerContextsCreated |
| 67 | mandatoryIeSet.insert(mandIe); |
| 68 | } |
| 69 | |
| 70 | CreateSessionResponseMsg::~CreateSessionResponseMsg() |
| 71 | { |
| 72 | |
| 73 | } |
| 74 | |
| 75 | bool CreateSessionResponseMsg::encodeCreateSessionResponseMsg(MsgBuffer &buffer, |
| 76 | CreateSessionResponseMsgData |
| 77 | const &data) |
| 78 | { |
| 79 | bool rc = false; |
| 80 | GtpV2IeHeader header; |
| 81 | Uint16 startIndex = 0; |
| 82 | Uint16 endIndex = 0; |
| 83 | Uint16 length = 0; |
| 84 | |
| 85 | |
| 86 | // Encode the Ie Header |
| 87 | header.ieType = CauseIeType; |
| 88 | header.instance = 0; |
| 89 | header.length = 0; // We will encode the IE first and then update the length |
| 90 | GtpV2Ie::encodeGtpV2IeHeader(buffer, header); |
| 91 | startIndex = buffer.getCurrentIndex(); |
| 92 | CauseIe cause= |
| 93 | dynamic_cast< |
| 94 | CauseIe&>(GtpV2IeFactory::getInstance().getIeObject(CauseIeType)); |
| 95 | rc = cause.encodeCauseIe(buffer, data.cause); |
| 96 | endIndex = buffer.getCurrentIndex(); |
| 97 | length = endIndex - startIndex; |
| 98 | |
| 99 | // encode the length value now |
| 100 | buffer.goToIndex(startIndex - 3); |
| 101 | buffer.writeUint16(length, false); |
| 102 | buffer.goToIndex(endIndex); |
| 103 | |
| 104 | if (!(rc)) |
| 105 | { |
| 106 | errorStream.add((char *)"Failed to encode IE: cause\n"); |
| 107 | return false; |
| 108 | } |
| 109 | |
| 110 | if (data.changeReportingActionIePresent) |
| 111 | { |
| 112 | |
| 113 | // Encode the Ie Header |
| 114 | header.ieType = ChangeReportingActionIeType; |
| 115 | header.instance = 0; |
| 116 | header.length = 0; // We will encode the IE first and then update the length |
| 117 | GtpV2Ie::encodeGtpV2IeHeader(buffer, header); |
| 118 | startIndex = buffer.getCurrentIndex(); |
| 119 | ChangeReportingActionIe changeReportingAction= |
| 120 | dynamic_cast< |
| 121 | ChangeReportingActionIe&>(GtpV2IeFactory::getInstance().getIeObject(ChangeReportingActionIeType)); |
| 122 | rc = changeReportingAction.encodeChangeReportingActionIe(buffer, data.changeReportingAction); |
| 123 | endIndex = buffer.getCurrentIndex(); |
| 124 | length = endIndex - startIndex; |
| 125 | |
| 126 | // encode the length value now |
| 127 | buffer.goToIndex(startIndex - 3); |
| 128 | buffer.writeUint16(length, false); |
| 129 | buffer.goToIndex(endIndex); |
| 130 | |
| 131 | if (!(rc)) |
| 132 | { |
| 133 | errorStream.add((char *)"Failed to encode IE: changeReportingAction\n"); |
| 134 | return false; |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | if (data.csgInformationReportingActionIePresent) |
| 139 | { |
| 140 | |
| 141 | // Encode the Ie Header |
| 142 | header.ieType = CsgInformationReportingActionIeType; |
| 143 | header.instance = 0; |
| 144 | header.length = 0; // We will encode the IE first and then update the length |
| 145 | GtpV2Ie::encodeGtpV2IeHeader(buffer, header); |
| 146 | startIndex = buffer.getCurrentIndex(); |
| 147 | CsgInformationReportingActionIe csgInformationReportingAction= |
| 148 | dynamic_cast< |
| 149 | CsgInformationReportingActionIe&>(GtpV2IeFactory::getInstance().getIeObject(CsgInformationReportingActionIeType)); |
| 150 | rc = csgInformationReportingAction.encodeCsgInformationReportingActionIe(buffer, data.csgInformationReportingAction); |
| 151 | endIndex = buffer.getCurrentIndex(); |
| 152 | length = endIndex - startIndex; |
| 153 | |
| 154 | // encode the length value now |
| 155 | buffer.goToIndex(startIndex - 3); |
| 156 | buffer.writeUint16(length, false); |
| 157 | buffer.goToIndex(endIndex); |
| 158 | |
| 159 | if (!(rc)) |
| 160 | { |
| 161 | errorStream.add((char *)"Failed to encode IE: csgInformationReportingAction\n"); |
| 162 | return false; |
| 163 | } |
| 164 | } |
| 165 | |
| 166 | if (data.senderFTeidForControlPlaneIePresent) |
| 167 | { |
| 168 | |
| 169 | // Encode the Ie Header |
| 170 | header.ieType = FTeidIeType; |
| 171 | header.instance = 0; |
| 172 | header.length = 0; // We will encode the IE first and then update the length |
| 173 | GtpV2Ie::encodeGtpV2IeHeader(buffer, header); |
| 174 | startIndex = buffer.getCurrentIndex(); |
| 175 | FTeidIe fTeid= |
| 176 | dynamic_cast< |
| 177 | FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType)); |
| 178 | rc = fTeid.encodeFTeidIe(buffer, data.senderFTeidForControlPlane); |
| 179 | endIndex = buffer.getCurrentIndex(); |
| 180 | length = endIndex - startIndex; |
| 181 | |
| 182 | // encode the length value now |
| 183 | buffer.goToIndex(startIndex - 3); |
| 184 | buffer.writeUint16(length, false); |
| 185 | buffer.goToIndex(endIndex); |
| 186 | |
| 187 | if (!(rc)) |
| 188 | { |
| 189 | errorStream.add((char *)"Failed to encode IE: senderFTeidForControlPlane\n"); |
| 190 | return false; |
| 191 | } |
| 192 | } |
| 193 | |
| 194 | if (data.apnRestrictionIePresent) |
| 195 | { |
| 196 | |
| 197 | // Encode the Ie Header |
| 198 | header.ieType = ApnRestrictionIeType; |
| 199 | header.instance = 0; |
| 200 | header.length = 0; // We will encode the IE first and then update the length |
| 201 | GtpV2Ie::encodeGtpV2IeHeader(buffer, header); |
| 202 | startIndex = buffer.getCurrentIndex(); |
| 203 | ApnRestrictionIe apnRestriction= |
| 204 | dynamic_cast< |
| 205 | ApnRestrictionIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnRestrictionIeType)); |
| 206 | rc = apnRestriction.encodeApnRestrictionIe(buffer, data.apnRestriction); |
| 207 | endIndex = buffer.getCurrentIndex(); |
| 208 | length = endIndex - startIndex; |
| 209 | |
| 210 | // encode the length value now |
| 211 | buffer.goToIndex(startIndex - 3); |
| 212 | buffer.writeUint16(length, false); |
| 213 | buffer.goToIndex(endIndex); |
| 214 | |
| 215 | if (!(rc)) |
| 216 | { |
| 217 | errorStream.add((char *)"Failed to encode IE: apnRestriction\n"); |
| 218 | return false; |
| 219 | } |
| 220 | } |
| 221 | |
| 222 | if (data.aggregateMaximumBitRateIePresent) |
| 223 | { |
| 224 | |
| 225 | // Encode the Ie Header |
| 226 | header.ieType = AmbrIeType; |
| 227 | header.instance = 0; |
| 228 | header.length = 0; // We will encode the IE first and then update the length |
| 229 | GtpV2Ie::encodeGtpV2IeHeader(buffer, header); |
| 230 | startIndex = buffer.getCurrentIndex(); |
| 231 | AmbrIe ambr= |
| 232 | dynamic_cast< |
| 233 | AmbrIe&>(GtpV2IeFactory::getInstance().getIeObject(AmbrIeType)); |
| 234 | rc = ambr.encodeAmbrIe(buffer, data.aggregateMaximumBitRate); |
| 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: aggregateMaximumBitRate\n"); |
| 246 | return false; |
| 247 | } |
| 248 | } |
| 249 | |
| 250 | if (data.linkedEpsBearerIdIePresent) |
| 251 | { |
| 252 | |
| 253 | // Encode the Ie Header |
| 254 | header.ieType = EbiIeType; |
| 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 | EbiIe ebi= |
| 260 | dynamic_cast< |
| 261 | EbiIe&>(GtpV2IeFactory::getInstance().getIeObject(EbiIeType)); |
| 262 | rc = ebi.encodeEbiIe(buffer, data.linkedEpsBearerId); |
| 263 | endIndex = buffer.getCurrentIndex(); |
| 264 | length = endIndex - startIndex; |
| 265 | |
| 266 | // encode the length value now |
| 267 | buffer.goToIndex(startIndex - 3); |
| 268 | buffer.writeUint16(length, false); |
| 269 | buffer.goToIndex(endIndex); |
| 270 | |
| 271 | if (!(rc)) |
| 272 | { |
| 273 | errorStream.add((char *)"Failed to encode IE: linkedEpsBearerId\n"); |
| 274 | return false; |
| 275 | } |
| 276 | } |
| 277 | |
| 278 | // First validate if the applicatoin provided more than the expected cardinality |
| 279 | if (data.bearerContextsCreatedCount > 11) |
| 280 | { |
| 281 | errorStream.add((char *)"Number of entries of bearerContextsCreated exceeded\n"); |
| 282 | errorStream.add((char *)"Expected count: 11 Received count: "); |
| 283 | errorStream.add((char *)"data.bearerContextsCreatedCount"); |
| 284 | errorStream.endOfLine(); |
| 285 | return false; |
| 286 | } |
| 287 | for (Uint8 i = 0; i < data.bearerContextsCreatedCount; i++) |
| 288 | { |
| 289 | // Encode the Ie Header |
| 290 | header.ieType = BearerContextIeType; |
| 291 | header.instance = 0; |
| 292 | header.length = 0; // We will encode the IE first and then update the length |
| 293 | GtpV2Ie::encodeGtpV2IeHeader(buffer, header); |
| 294 | startIndex = buffer.getCurrentIndex(); |
| 295 | BearerContextIe bearerContext= |
| 296 | dynamic_cast< |
| 297 | BearerContextIe&>(GtpV2IeFactory::getInstance(). |
| 298 | getIeObject(BearerContextIeType)); |
| 299 | BearerContextsCreatedInCreateSessionResponse groupedIeInstance = dynamic_cast<BearerContextsCreatedInCreateSessionResponse&>(bearerContext.getGroupedIe(msgType, 0)); |
| 300 | rc = groupedIeInstance.encodeBearerContextsCreatedInCreateSessionResponse(buffer, data.bearerContextsCreated[i]); |
| 301 | endIndex = buffer.getCurrentIndex(); |
| 302 | length = endIndex - startIndex; |
| 303 | |
| 304 | // encode the length value now |
| 305 | buffer.goToIndex(startIndex - 3); |
| 306 | buffer.writeUint16(length, false); |
| 307 | buffer.goToIndex(endIndex); |
| 308 | } |
| 309 | |
| 310 | if (!(rc)) |
| 311 | { |
| 312 | errorStream.add((char *)"Failed to encode IE: bearerContextsCreated\n"); |
| 313 | return false; |
| 314 | } |
| 315 | |
| 316 | // First validate if the applicatoin provided more than the expected cardinality |
| 317 | if (data.bearerContextsMarkedForRemovalCount > 11) |
| 318 | { |
| 319 | errorStream.add((char *)"Number of entries of bearerContextsMarkedForRemoval exceeded\n"); |
| 320 | errorStream.add((char *)"Expected count: 11 Received count: "); |
| 321 | errorStream.add((char *)"data.bearerContextsMarkedForRemovalCount"); |
| 322 | errorStream.endOfLine(); |
| 323 | return false; |
| 324 | } |
| 325 | for (Uint8 i = 0; i < data.bearerContextsMarkedForRemovalCount; i++) |
| 326 | { |
| 327 | // Encode the Ie Header |
| 328 | header.ieType = BearerContextIeType; |
| 329 | header.instance = 1; |
| 330 | header.length = 0; // We will encode the IE first and then update the length |
| 331 | GtpV2Ie::encodeGtpV2IeHeader(buffer, header); |
| 332 | startIndex = buffer.getCurrentIndex(); |
| 333 | BearerContextIe bearerContext= |
| 334 | dynamic_cast< |
| 335 | BearerContextIe&>(GtpV2IeFactory::getInstance(). |
| 336 | getIeObject(BearerContextIeType)); |
| 337 | BearerContextsMarkedForRemovalInCreateSessionResponse groupedIeInstance = dynamic_cast<BearerContextsMarkedForRemovalInCreateSessionResponse&>(bearerContext.getGroupedIe(msgType, 1)); |
| 338 | rc = groupedIeInstance.encodeBearerContextsMarkedForRemovalInCreateSessionResponse(buffer, data.bearerContextsMarkedForRemoval[i]); |
| 339 | endIndex = buffer.getCurrentIndex(); |
| 340 | length = endIndex - startIndex; |
| 341 | |
| 342 | // encode the length value now |
| 343 | buffer.goToIndex(startIndex - 3); |
| 344 | buffer.writeUint16(length, false); |
| 345 | buffer.goToIndex(endIndex); |
| 346 | } |
| 347 | |
| 348 | if (!(rc)) |
| 349 | { |
| 350 | errorStream.add((char *)"Failed to encode IE: bearerContextsMarkedForRemoval\n"); |
| 351 | return false; |
| 352 | } |
| 353 | |
| 354 | if (data.recoveryIePresent) |
| 355 | { |
| 356 | |
| 357 | // Encode the Ie Header |
| 358 | header.ieType = RecoveryIeType; |
| 359 | header.instance = 0; |
| 360 | header.length = 0; // We will encode the IE first and then update the length |
| 361 | GtpV2Ie::encodeGtpV2IeHeader(buffer, header); |
| 362 | startIndex = buffer.getCurrentIndex(); |
| 363 | RecoveryIe recovery= |
| 364 | dynamic_cast< |
| 365 | RecoveryIe&>(GtpV2IeFactory::getInstance().getIeObject(RecoveryIeType)); |
| 366 | rc = recovery.encodeRecoveryIe(buffer, data.recovery); |
| 367 | endIndex = buffer.getCurrentIndex(); |
| 368 | length = endIndex - startIndex; |
| 369 | |
| 370 | // encode the length value now |
| 371 | buffer.goToIndex(startIndex - 3); |
| 372 | buffer.writeUint16(length, false); |
| 373 | buffer.goToIndex(endIndex); |
| 374 | |
| 375 | if (!(rc)) |
| 376 | { |
| 377 | errorStream.add((char *)"Failed to encode IE: recovery\n"); |
| 378 | return false; |
| 379 | } |
| 380 | } |
| 381 | |
| 382 | if (data.chargingGatewayNameIePresent) |
| 383 | { |
| 384 | |
| 385 | // Encode the Ie Header |
| 386 | header.ieType = FqdnIeType; |
| 387 | header.instance = 0; |
| 388 | header.length = 0; // We will encode the IE first and then update the length |
| 389 | GtpV2Ie::encodeGtpV2IeHeader(buffer, header); |
| 390 | startIndex = buffer.getCurrentIndex(); |
| 391 | FqdnIe fqdn= |
| 392 | dynamic_cast< |
| 393 | FqdnIe&>(GtpV2IeFactory::getInstance().getIeObject(FqdnIeType)); |
| 394 | rc = fqdn.encodeFqdnIe(buffer, data.chargingGatewayName); |
| 395 | endIndex = buffer.getCurrentIndex(); |
| 396 | length = endIndex - startIndex; |
| 397 | |
| 398 | // encode the length value now |
| 399 | buffer.goToIndex(startIndex - 3); |
| 400 | buffer.writeUint16(length, false); |
| 401 | buffer.goToIndex(endIndex); |
| 402 | |
| 403 | if (!(rc)) |
| 404 | { |
| 405 | errorStream.add((char *)"Failed to encode IE: chargingGatewayName\n"); |
| 406 | return false; |
| 407 | } |
| 408 | } |
| 409 | |
| 410 | if (data.chargingGatewayAddressIePresent) |
| 411 | { |
| 412 | |
| 413 | // Encode the Ie Header |
| 414 | header.ieType = IpAddressIeType; |
| 415 | header.instance = 0; |
| 416 | header.length = 0; // We will encode the IE first and then update the length |
| 417 | GtpV2Ie::encodeGtpV2IeHeader(buffer, header); |
| 418 | startIndex = buffer.getCurrentIndex(); |
| 419 | IpAddressIe ipAddress= |
| 420 | dynamic_cast< |
| 421 | IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType)); |
| 422 | rc = ipAddress.encodeIpAddressIe(buffer, data.chargingGatewayAddress); |
| 423 | endIndex = buffer.getCurrentIndex(); |
| 424 | length = endIndex - startIndex; |
| 425 | |
| 426 | // encode the length value now |
| 427 | buffer.goToIndex(startIndex - 3); |
| 428 | buffer.writeUint16(length, false); |
| 429 | buffer.goToIndex(endIndex); |
| 430 | |
| 431 | if (!(rc)) |
| 432 | { |
| 433 | errorStream.add((char *)"Failed to encode IE: chargingGatewayAddress\n"); |
| 434 | return false; |
| 435 | } |
| 436 | } |
| 437 | |
| 438 | if (data.pgwFqCsidIePresent) |
| 439 | { |
| 440 | |
| 441 | // Encode the Ie Header |
| 442 | header.ieType = FqCsidIeType; |
| 443 | header.instance = 0; |
| 444 | header.length = 0; // We will encode the IE first and then update the length |
| 445 | GtpV2Ie::encodeGtpV2IeHeader(buffer, header); |
| 446 | startIndex = buffer.getCurrentIndex(); |
| 447 | FqCsidIe fqCsid= |
| 448 | dynamic_cast< |
| 449 | FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType)); |
| 450 | rc = fqCsid.encodeFqCsidIe(buffer, data.pgwFqCsid); |
| 451 | endIndex = buffer.getCurrentIndex(); |
| 452 | length = endIndex - startIndex; |
| 453 | |
| 454 | // encode the length value now |
| 455 | buffer.goToIndex(startIndex - 3); |
| 456 | buffer.writeUint16(length, false); |
| 457 | buffer.goToIndex(endIndex); |
| 458 | |
| 459 | if (!(rc)) |
| 460 | { |
| 461 | errorStream.add((char *)"Failed to encode IE: pgwFqCsid\n"); |
| 462 | return false; |
| 463 | } |
| 464 | } |
| 465 | |
| 466 | if (data.sgwFqCsidIePresent) |
| 467 | { |
| 468 | |
| 469 | // Encode the Ie Header |
| 470 | header.ieType = FqCsidIeType; |
| 471 | header.instance = 1; |
| 472 | header.length = 0; // We will encode the IE first and then update the length |
| 473 | GtpV2Ie::encodeGtpV2IeHeader(buffer, header); |
| 474 | startIndex = buffer.getCurrentIndex(); |
| 475 | FqCsidIe fqCsid= |
| 476 | dynamic_cast< |
| 477 | FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType)); |
| 478 | rc = fqCsid.encodeFqCsidIe(buffer, data.sgwFqCsid); |
| 479 | endIndex = buffer.getCurrentIndex(); |
| 480 | length = endIndex - startIndex; |
| 481 | |
| 482 | // encode the length value now |
| 483 | buffer.goToIndex(startIndex - 3); |
| 484 | buffer.writeUint16(length, false); |
| 485 | buffer.goToIndex(endIndex); |
| 486 | |
| 487 | if (!(rc)) |
| 488 | { |
| 489 | errorStream.add((char *)"Failed to encode IE: sgwFqCsid\n"); |
| 490 | return false; |
| 491 | } |
| 492 | } |
| 493 | |
| 494 | if (data.sgwLdnIePresent) |
| 495 | { |
| 496 | |
| 497 | // Encode the Ie Header |
| 498 | header.ieType = LocalDistinguishedNameIeType; |
| 499 | header.instance = 0; |
| 500 | header.length = 0; // We will encode the IE first and then update the length |
| 501 | GtpV2Ie::encodeGtpV2IeHeader(buffer, header); |
| 502 | startIndex = buffer.getCurrentIndex(); |
| 503 | LocalDistinguishedNameIe localDistinguishedName= |
| 504 | dynamic_cast< |
| 505 | LocalDistinguishedNameIe&>(GtpV2IeFactory::getInstance().getIeObject(LocalDistinguishedNameIeType)); |
| 506 | rc = localDistinguishedName.encodeLocalDistinguishedNameIe(buffer, data.sgwLdn); |
| 507 | endIndex = buffer.getCurrentIndex(); |
| 508 | length = endIndex - startIndex; |
| 509 | |
| 510 | // encode the length value now |
| 511 | buffer.goToIndex(startIndex - 3); |
| 512 | buffer.writeUint16(length, false); |
| 513 | buffer.goToIndex(endIndex); |
| 514 | |
| 515 | if (!(rc)) |
| 516 | { |
| 517 | errorStream.add((char *)"Failed to encode IE: sgwLdn\n"); |
| 518 | return false; |
| 519 | } |
| 520 | } |
| 521 | |
| 522 | if (data.pgwLdnIePresent) |
| 523 | { |
| 524 | |
| 525 | // Encode the Ie Header |
| 526 | header.ieType = LocalDistinguishedNameIeType; |
| 527 | header.instance = 1; |
| 528 | header.length = 0; // We will encode the IE first and then update the length |
| 529 | GtpV2Ie::encodeGtpV2IeHeader(buffer, header); |
| 530 | startIndex = buffer.getCurrentIndex(); |
| 531 | LocalDistinguishedNameIe localDistinguishedName= |
| 532 | dynamic_cast< |
| 533 | LocalDistinguishedNameIe&>(GtpV2IeFactory::getInstance().getIeObject(LocalDistinguishedNameIeType)); |
| 534 | rc = localDistinguishedName.encodeLocalDistinguishedNameIe(buffer, data.pgwLdn); |
| 535 | endIndex = buffer.getCurrentIndex(); |
| 536 | length = endIndex - startIndex; |
| 537 | |
| 538 | // encode the length value now |
| 539 | buffer.goToIndex(startIndex - 3); |
| 540 | buffer.writeUint16(length, false); |
| 541 | buffer.goToIndex(endIndex); |
| 542 | |
| 543 | if (!(rc)) |
| 544 | { |
| 545 | errorStream.add((char *)"Failed to encode IE: pgwLdn\n"); |
| 546 | return false; |
| 547 | } |
| 548 | } |
| 549 | |
| 550 | if (data.pgwBackOffTimeIePresent) |
| 551 | { |
| 552 | |
| 553 | // Encode the Ie Header |
| 554 | header.ieType = EpcTimerIeType; |
| 555 | header.instance = 0; |
| 556 | header.length = 0; // We will encode the IE first and then update the length |
| 557 | GtpV2Ie::encodeGtpV2IeHeader(buffer, header); |
| 558 | startIndex = buffer.getCurrentIndex(); |
| 559 | EpcTimerIe epcTimer= |
| 560 | dynamic_cast< |
| 561 | EpcTimerIe&>(GtpV2IeFactory::getInstance().getIeObject(EpcTimerIeType)); |
| 562 | rc = epcTimer.encodeEpcTimerIe(buffer, data.pgwBackOffTime); |
| 563 | endIndex = buffer.getCurrentIndex(); |
| 564 | length = endIndex - startIndex; |
| 565 | |
| 566 | // encode the length value now |
| 567 | buffer.goToIndex(startIndex - 3); |
| 568 | buffer.writeUint16(length, false); |
| 569 | buffer.goToIndex(endIndex); |
| 570 | |
| 571 | if (!(rc)) |
| 572 | { |
| 573 | errorStream.add((char *)"Failed to encode IE: pgwBackOffTime\n"); |
| 574 | return false; |
| 575 | } |
| 576 | } |
| 577 | |
| 578 | if (data.hNbInformationReportingIePresent) |
| 579 | { |
| 580 | |
| 581 | // Encode the Ie Header |
| 582 | header.ieType = HenbInformationReportingIeType; |
| 583 | header.instance = 0; |
| 584 | header.length = 0; // We will encode the IE first and then update the length |
| 585 | GtpV2Ie::encodeGtpV2IeHeader(buffer, header); |
| 586 | startIndex = buffer.getCurrentIndex(); |
| 587 | HenbInformationReportingIe henbInformationReporting= |
| 588 | dynamic_cast< |
| 589 | HenbInformationReportingIe&>(GtpV2IeFactory::getInstance().getIeObject(HenbInformationReportingIeType)); |
| 590 | rc = henbInformationReporting.encodeHenbInformationReportingIe(buffer, data.hNbInformationReporting); |
| 591 | endIndex = buffer.getCurrentIndex(); |
| 592 | length = endIndex - startIndex; |
| 593 | |
| 594 | // encode the length value now |
| 595 | buffer.goToIndex(startIndex - 3); |
| 596 | buffer.writeUint16(length, false); |
| 597 | buffer.goToIndex(endIndex); |
| 598 | |
| 599 | if (!(rc)) |
| 600 | { |
| 601 | errorStream.add((char *)"Failed to encode IE: hNbInformationReporting\n"); |
| 602 | return false; |
| 603 | } |
| 604 | } |
| 605 | |
| 606 | if (data.pgwS5S8S2bFTeidIePresent) |
| 607 | { |
| 608 | |
| 609 | // Encode the Ie Header |
| 610 | header.ieType = FTeidIeType; |
| 611 | header.instance = 1; |
| 612 | header.length = 0; // We will encode the IE first and then update the length |
| 613 | GtpV2Ie::encodeGtpV2IeHeader(buffer, header); |
| 614 | startIndex = buffer.getCurrentIndex(); |
| 615 | FTeidIe fTeid= |
| 616 | dynamic_cast< |
| 617 | FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType)); |
| 618 | rc = fTeid.encodeFTeidIe(buffer, data.pgwS5S8S2bFTeid); |
| 619 | endIndex = buffer.getCurrentIndex(); |
| 620 | length = endIndex - startIndex; |
| 621 | |
| 622 | // encode the length value now |
| 623 | buffer.goToIndex(startIndex - 3); |
| 624 | buffer.writeUint16(length, false); |
| 625 | buffer.goToIndex(endIndex); |
| 626 | |
| 627 | if (!(rc)) |
| 628 | { |
| 629 | errorStream.add((char *)"Failed to encode IE: pgwS5S8S2bFTeid\n"); |
| 630 | return false; |
| 631 | } |
| 632 | } |
| 633 | |
| 634 | if (data.pdnAddressAllocationIePresent) |
| 635 | { |
| 636 | |
| 637 | // Encode the Ie Header |
| 638 | header.ieType = PaaIeType; |
| 639 | header.instance = 0; |
| 640 | header.length = 0; // We will encode the IE first and then update the length |
| 641 | GtpV2Ie::encodeGtpV2IeHeader(buffer, header); |
| 642 | startIndex = buffer.getCurrentIndex(); |
| 643 | PaaIe paa= |
| 644 | dynamic_cast< |
| 645 | PaaIe&>(GtpV2IeFactory::getInstance().getIeObject(PaaIeType)); |
| 646 | rc = paa.encodePaaIe(buffer, data.pdnAddressAllocation); |
| 647 | endIndex = buffer.getCurrentIndex(); |
| 648 | length = endIndex - startIndex; |
| 649 | |
| 650 | // encode the length value now |
| 651 | buffer.goToIndex(startIndex - 3); |
| 652 | buffer.writeUint16(length, false); |
| 653 | buffer.goToIndex(endIndex); |
| 654 | |
| 655 | if (!(rc)) |
| 656 | { |
| 657 | errorStream.add((char *)"Failed to encode IE: pdnAddressAllocation\n"); |
| 658 | return false; |
| 659 | } |
| 660 | } |
| 661 | |
| 662 | if (data.protocolConfigurationOptionsIePresent) |
| 663 | { |
| 664 | |
| 665 | // Encode the Ie Header |
| 666 | header.ieType = PcoIeType; |
| 667 | header.instance = 0; |
| 668 | header.length = 0; // We will encode the IE first and then update the length |
| 669 | GtpV2Ie::encodeGtpV2IeHeader(buffer, header); |
| 670 | startIndex = buffer.getCurrentIndex(); |
| 671 | PcoIe pco= |
| 672 | dynamic_cast< |
| 673 | PcoIe&>(GtpV2IeFactory::getInstance().getIeObject(PcoIeType)); |
| 674 | rc = pco.encodePcoIe(buffer, data.protocolConfigurationOptions); |
| 675 | endIndex = buffer.getCurrentIndex(); |
| 676 | length = endIndex - startIndex; |
| 677 | |
| 678 | // encode the length value now |
| 679 | buffer.goToIndex(startIndex - 3); |
| 680 | buffer.writeUint16(length, false); |
| 681 | buffer.goToIndex(endIndex); |
| 682 | |
| 683 | if (!(rc)) |
| 684 | { |
| 685 | errorStream.add((char *)"Failed to encode IE: protocolConfigurationOptions\n"); |
| 686 | return false; |
| 687 | } |
| 688 | } |
| 689 | |
| 690 | if (data.additionalProtocolConfigurationOptionsIePresent) |
| 691 | { |
| 692 | |
| 693 | // Encode the Ie Header |
| 694 | header.ieType = AdditionalProtocolConfigurationOptionsIeType; |
| 695 | header.instance = 0; |
| 696 | header.length = 0; // We will encode the IE first and then update the length |
| 697 | GtpV2Ie::encodeGtpV2IeHeader(buffer, header); |
| 698 | startIndex = buffer.getCurrentIndex(); |
| 699 | AdditionalProtocolConfigurationOptionsIe additionalProtocolConfigurationOptions= |
| 700 | dynamic_cast< |
| 701 | AdditionalProtocolConfigurationOptionsIe&>(GtpV2IeFactory::getInstance().getIeObject(AdditionalProtocolConfigurationOptionsIeType)); |
| 702 | rc = additionalProtocolConfigurationOptions.encodeAdditionalProtocolConfigurationOptionsIe(buffer, data.additionalProtocolConfigurationOptions); |
| 703 | endIndex = buffer.getCurrentIndex(); |
| 704 | length = endIndex - startIndex; |
| 705 | |
| 706 | // encode the length value now |
| 707 | buffer.goToIndex(startIndex - 3); |
| 708 | buffer.writeUint16(length, false); |
| 709 | buffer.goToIndex(endIndex); |
| 710 | |
| 711 | if (!(rc)) |
| 712 | { |
| 713 | errorStream.add((char *)"Failed to encode IE: additionalProtocolConfigurationOptions\n"); |
| 714 | return false; |
| 715 | } |
| 716 | } |
| 717 | |
| 718 | if (data.trustedWlanIpv4ParametersIePresent) |
| 719 | { |
| 720 | |
| 721 | // Encode the Ie Header |
| 722 | header.ieType = Ip4cpIeType; |
| 723 | header.instance = 0; |
| 724 | header.length = 0; // We will encode the IE first and then update the length |
| 725 | GtpV2Ie::encodeGtpV2IeHeader(buffer, header); |
| 726 | startIndex = buffer.getCurrentIndex(); |
| 727 | Ip4cpIe ip4cp= |
| 728 | dynamic_cast< |
| 729 | Ip4cpIe&>(GtpV2IeFactory::getInstance().getIeObject(Ip4cpIeType)); |
| 730 | rc = ip4cp.encodeIp4cpIe(buffer, data.trustedWlanIpv4Parameters); |
| 731 | endIndex = buffer.getCurrentIndex(); |
| 732 | length = endIndex - startIndex; |
| 733 | |
| 734 | // encode the length value now |
| 735 | buffer.goToIndex(startIndex - 3); |
| 736 | buffer.writeUint16(length, false); |
| 737 | buffer.goToIndex(endIndex); |
| 738 | |
| 739 | if (!(rc)) |
| 740 | { |
| 741 | errorStream.add((char *)"Failed to encode IE: trustedWlanIpv4Parameters\n"); |
| 742 | return false; |
| 743 | } |
| 744 | } |
| 745 | |
| 746 | if (data.indicationFlagsIePresent) |
| 747 | { |
| 748 | |
| 749 | // Encode the Ie Header |
| 750 | header.ieType = IndicationIeType; |
| 751 | header.instance = 0; |
| 752 | header.length = 0; // We will encode the IE first and then update the length |
| 753 | GtpV2Ie::encodeGtpV2IeHeader(buffer, header); |
| 754 | startIndex = buffer.getCurrentIndex(); |
| 755 | IndicationIe indication= |
| 756 | dynamic_cast< |
| 757 | IndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(IndicationIeType)); |
| 758 | rc = indication.encodeIndicationIe(buffer, data.indicationFlags); |
| 759 | endIndex = buffer.getCurrentIndex(); |
| 760 | length = endIndex - startIndex; |
| 761 | |
| 762 | // encode the length value now |
| 763 | buffer.goToIndex(startIndex - 3); |
| 764 | buffer.writeUint16(length, false); |
| 765 | buffer.goToIndex(endIndex); |
| 766 | |
| 767 | if (!(rc)) |
| 768 | { |
| 769 | errorStream.add((char *)"Failed to encode IE: indicationFlags\n"); |
| 770 | return false; |
| 771 | } |
| 772 | } |
| 773 | |
| 774 | if (data.presenceReportingAreaActionIePresent) |
| 775 | { |
| 776 | |
| 777 | // Encode the Ie Header |
| 778 | header.ieType = PresenceReportingAreaActionIeType; |
| 779 | header.instance = 0; |
| 780 | header.length = 0; // We will encode the IE first and then update the length |
| 781 | GtpV2Ie::encodeGtpV2IeHeader(buffer, header); |
| 782 | startIndex = buffer.getCurrentIndex(); |
| 783 | PresenceReportingAreaActionIe presenceReportingAreaAction= |
| 784 | dynamic_cast< |
| 785 | PresenceReportingAreaActionIe&>(GtpV2IeFactory::getInstance().getIeObject(PresenceReportingAreaActionIeType)); |
| 786 | rc = presenceReportingAreaAction.encodePresenceReportingAreaActionIe(buffer, data.presenceReportingAreaAction); |
| 787 | endIndex = buffer.getCurrentIndex(); |
| 788 | length = endIndex - startIndex; |
| 789 | |
| 790 | // encode the length value now |
| 791 | buffer.goToIndex(startIndex - 3); |
| 792 | buffer.writeUint16(length, false); |
| 793 | buffer.goToIndex(endIndex); |
| 794 | |
| 795 | if (!(rc)) |
| 796 | { |
| 797 | errorStream.add((char *)"Failed to encode IE: presenceReportingAreaAction\n"); |
| 798 | return false; |
| 799 | } |
| 800 | } |
| 801 | |
| 802 | if (data.pgwsNodeLevelLoadControlInformationIePresent) |
| 803 | { |
| 804 | |
| 805 | // Encode the Ie Header |
| 806 | header.ieType = LoadControlInformationIeType; |
| 807 | header.instance = 0; |
| 808 | header.length = 0; // We will encode the IE first and then update the length |
| 809 | GtpV2Ie::encodeGtpV2IeHeader(buffer, header); |
| 810 | startIndex = buffer.getCurrentIndex(); |
| 811 | LoadControlInformationIe loadControlInformation= |
| 812 | dynamic_cast< |
| 813 | LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType)); |
| 814 | PgwsNodeLevelLoadControlInformationInCreateSessionResponse groupedIeInstance = |
| 815 | dynamic_cast< |
| 816 | PgwsNodeLevelLoadControlInformationInCreateSessionResponse&>(loadControlInformation.getGroupedIe(msgType, 0)); |
| 817 | rc = groupedIeInstance.encodePgwsNodeLevelLoadControlInformationInCreateSessionResponse(buffer, data.pgwsNodeLevelLoadControlInformation); |
| 818 | endIndex = buffer.getCurrentIndex(); |
| 819 | length = endIndex - startIndex; |
| 820 | |
| 821 | // encode the length value now |
| 822 | buffer.goToIndex(startIndex - 3); |
| 823 | buffer.writeUint16(length, false); |
| 824 | buffer.goToIndex(endIndex); |
| 825 | |
| 826 | if (!(rc)) |
| 827 | { |
| 828 | errorStream.add((char *)"Failed to encode IE: pgwsNodeLevelLoadControlInformation\n"); |
| 829 | return false; |
| 830 | } |
| 831 | } |
| 832 | |
| 833 | if (data.pgwsApnLevelLoadControlInformationIePresent) |
| 834 | { |
| 835 | |
| 836 | // Encode the Ie Header |
| 837 | header.ieType = LoadControlInformationIeType; |
| 838 | header.instance = 1; |
| 839 | header.length = 0; // We will encode the IE first and then update the length |
| 840 | GtpV2Ie::encodeGtpV2IeHeader(buffer, header); |
| 841 | startIndex = buffer.getCurrentIndex(); |
| 842 | LoadControlInformationIe loadControlInformation= |
| 843 | dynamic_cast< |
| 844 | LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType)); |
| 845 | PgwsApnLevelLoadControlInformationInCreateSessionResponse groupedIeInstance = |
| 846 | dynamic_cast< |
| 847 | PgwsApnLevelLoadControlInformationInCreateSessionResponse&>(loadControlInformation.getGroupedIe(msgType, 1)); |
| 848 | rc = groupedIeInstance.encodePgwsApnLevelLoadControlInformationInCreateSessionResponse(buffer, data.pgwsApnLevelLoadControlInformation); |
| 849 | endIndex = buffer.getCurrentIndex(); |
| 850 | length = endIndex - startIndex; |
| 851 | |
| 852 | // encode the length value now |
| 853 | buffer.goToIndex(startIndex - 3); |
| 854 | buffer.writeUint16(length, false); |
| 855 | buffer.goToIndex(endIndex); |
| 856 | |
| 857 | if (!(rc)) |
| 858 | { |
| 859 | errorStream.add((char *)"Failed to encode IE: pgwsApnLevelLoadControlInformation\n"); |
| 860 | return false; |
| 861 | } |
| 862 | } |
| 863 | |
| 864 | if (data.sgwsNodeLevelLoadControlInformationIePresent) |
| 865 | { |
| 866 | |
| 867 | // Encode the Ie Header |
| 868 | header.ieType = LoadControlInformationIeType; |
| 869 | header.instance = 2; |
| 870 | header.length = 0; // We will encode the IE first and then update the length |
| 871 | GtpV2Ie::encodeGtpV2IeHeader(buffer, header); |
| 872 | startIndex = buffer.getCurrentIndex(); |
| 873 | LoadControlInformationIe loadControlInformation= |
| 874 | dynamic_cast< |
| 875 | LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType)); |
| 876 | SgwsNodeLevelLoadControlInformationInCreateSessionResponse groupedIeInstance = |
| 877 | dynamic_cast< |
| 878 | SgwsNodeLevelLoadControlInformationInCreateSessionResponse&>(loadControlInformation.getGroupedIe(msgType, 2)); |
| 879 | rc = groupedIeInstance.encodeSgwsNodeLevelLoadControlInformationInCreateSessionResponse(buffer, data.sgwsNodeLevelLoadControlInformation); |
| 880 | endIndex = buffer.getCurrentIndex(); |
| 881 | length = endIndex - startIndex; |
| 882 | |
| 883 | // encode the length value now |
| 884 | buffer.goToIndex(startIndex - 3); |
| 885 | buffer.writeUint16(length, false); |
| 886 | buffer.goToIndex(endIndex); |
| 887 | |
| 888 | if (!(rc)) |
| 889 | { |
| 890 | errorStream.add((char *)"Failed to encode IE: sgwsNodeLevelLoadControlInformation\n"); |
| 891 | return false; |
| 892 | } |
| 893 | } |
| 894 | |
| 895 | if (data.pgwsOverloadControlInformationIePresent) |
| 896 | { |
| 897 | |
| 898 | // Encode the Ie Header |
| 899 | header.ieType = OverloadControlInformationIeType; |
| 900 | header.instance = 0; |
| 901 | header.length = 0; // We will encode the IE first and then update the length |
| 902 | GtpV2Ie::encodeGtpV2IeHeader(buffer, header); |
| 903 | startIndex = buffer.getCurrentIndex(); |
| 904 | OverloadControlInformationIe overloadControlInformation= |
| 905 | dynamic_cast< |
| 906 | OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType)); |
| 907 | PgwsOverloadControlInformationInCreateSessionResponse groupedIeInstance = |
| 908 | dynamic_cast< |
| 909 | PgwsOverloadControlInformationInCreateSessionResponse&>(overloadControlInformation.getGroupedIe(msgType, 0)); |
| 910 | rc = groupedIeInstance.encodePgwsOverloadControlInformationInCreateSessionResponse(buffer, data.pgwsOverloadControlInformation); |
| 911 | endIndex = buffer.getCurrentIndex(); |
| 912 | length = endIndex - startIndex; |
| 913 | |
| 914 | // encode the length value now |
| 915 | buffer.goToIndex(startIndex - 3); |
| 916 | buffer.writeUint16(length, false); |
| 917 | buffer.goToIndex(endIndex); |
| 918 | |
| 919 | if (!(rc)) |
| 920 | { |
| 921 | errorStream.add((char *)"Failed to encode IE: pgwsOverloadControlInformation\n"); |
| 922 | return false; |
| 923 | } |
| 924 | } |
| 925 | |
| 926 | if (data.sgwsOverloadControlInformationIePresent) |
| 927 | { |
| 928 | |
| 929 | // Encode the Ie Header |
| 930 | header.ieType = OverloadControlInformationIeType; |
| 931 | header.instance = 1; |
| 932 | header.length = 0; // We will encode the IE first and then update the length |
| 933 | GtpV2Ie::encodeGtpV2IeHeader(buffer, header); |
| 934 | startIndex = buffer.getCurrentIndex(); |
| 935 | OverloadControlInformationIe overloadControlInformation= |
| 936 | dynamic_cast< |
| 937 | OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType)); |
| 938 | SgwsOverloadControlInformationInCreateSessionResponse groupedIeInstance = |
| 939 | dynamic_cast< |
| 940 | SgwsOverloadControlInformationInCreateSessionResponse&>(overloadControlInformation.getGroupedIe(msgType, 1)); |
| 941 | rc = groupedIeInstance.encodeSgwsOverloadControlInformationInCreateSessionResponse(buffer, data.sgwsOverloadControlInformation); |
| 942 | endIndex = buffer.getCurrentIndex(); |
| 943 | length = endIndex - startIndex; |
| 944 | |
| 945 | // encode the length value now |
| 946 | buffer.goToIndex(startIndex - 3); |
| 947 | buffer.writeUint16(length, false); |
| 948 | buffer.goToIndex(endIndex); |
| 949 | |
| 950 | if (!(rc)) |
| 951 | { |
| 952 | errorStream.add((char *)"Failed to encode IE: sgwsOverloadControlInformation\n"); |
| 953 | return false; |
| 954 | } |
| 955 | } |
| 956 | |
| 957 | if (data.nbifomContainerIePresent) |
| 958 | { |
| 959 | |
| 960 | // Encode the Ie Header |
| 961 | header.ieType = FContainerIeType; |
| 962 | header.instance = 0; |
| 963 | header.length = 0; // We will encode the IE first and then update the length |
| 964 | GtpV2Ie::encodeGtpV2IeHeader(buffer, header); |
| 965 | startIndex = buffer.getCurrentIndex(); |
| 966 | FContainerIe fContainer= |
| 967 | dynamic_cast< |
| 968 | FContainerIe&>(GtpV2IeFactory::getInstance().getIeObject(FContainerIeType)); |
| 969 | rc = fContainer.encodeFContainerIe(buffer, data.nbifomContainer); |
| 970 | endIndex = buffer.getCurrentIndex(); |
| 971 | length = endIndex - startIndex; |
| 972 | |
| 973 | // encode the length value now |
| 974 | buffer.goToIndex(startIndex - 3); |
| 975 | buffer.writeUint16(length, false); |
| 976 | buffer.goToIndex(endIndex); |
| 977 | |
| 978 | if (!(rc)) |
| 979 | { |
| 980 | errorStream.add((char *)"Failed to encode IE: nbifomContainer\n"); |
| 981 | return false; |
| 982 | } |
| 983 | } |
| 984 | |
| 985 | if (data.pdnConnectionChargingIdIePresent) |
| 986 | { |
| 987 | |
| 988 | // Encode the Ie Header |
| 989 | header.ieType = ChargingIdIeType; |
| 990 | header.instance = 0; |
| 991 | header.length = 0; // We will encode the IE first and then update the length |
| 992 | GtpV2Ie::encodeGtpV2IeHeader(buffer, header); |
| 993 | startIndex = buffer.getCurrentIndex(); |
| 994 | ChargingIdIe chargingId= |
| 995 | dynamic_cast< |
| 996 | ChargingIdIe&>(GtpV2IeFactory::getInstance().getIeObject(ChargingIdIeType)); |
| 997 | rc = chargingId.encodeChargingIdIe(buffer, data.pdnConnectionChargingId); |
| 998 | endIndex = buffer.getCurrentIndex(); |
| 999 | length = endIndex - startIndex; |
| 1000 | |
| 1001 | // encode the length value now |
| 1002 | buffer.goToIndex(startIndex - 3); |
| 1003 | buffer.writeUint16(length, false); |
| 1004 | buffer.goToIndex(endIndex); |
| 1005 | |
| 1006 | if (!(rc)) |
| 1007 | { |
| 1008 | errorStream.add((char *)"Failed to encode IE: pdnConnectionChargingId\n"); |
| 1009 | return false; |
| 1010 | } |
| 1011 | } |
| 1012 | |
| 1013 | if (data.extendedProtocolConfigurationOptionsIePresent) |
| 1014 | { |
| 1015 | |
| 1016 | // Encode the Ie Header |
| 1017 | header.ieType = EpcoIeType; |
| 1018 | header.instance = 0; |
| 1019 | header.length = 0; // We will encode the IE first and then update the length |
| 1020 | GtpV2Ie::encodeGtpV2IeHeader(buffer, header); |
| 1021 | startIndex = buffer.getCurrentIndex(); |
| 1022 | EpcoIe epco= |
| 1023 | dynamic_cast< |
| 1024 | EpcoIe&>(GtpV2IeFactory::getInstance().getIeObject(EpcoIeType)); |
| 1025 | rc = epco.encodeEpcoIe(buffer, data.extendedProtocolConfigurationOptions); |
| 1026 | endIndex = buffer.getCurrentIndex(); |
| 1027 | length = endIndex - startIndex; |
| 1028 | |
| 1029 | // encode the length value now |
| 1030 | buffer.goToIndex(startIndex - 3); |
| 1031 | buffer.writeUint16(length, false); |
| 1032 | buffer.goToIndex(endIndex); |
| 1033 | |
| 1034 | if (!(rc)) |
| 1035 | { |
| 1036 | errorStream.add((char *)"Failed to encode IE: extendedProtocolConfigurationOptions\n"); |
| 1037 | return false; |
| 1038 | } |
| 1039 | } |
| 1040 | return rc; |
| 1041 | |
| 1042 | } |
| 1043 | |
| 1044 | bool CreateSessionResponseMsg::decodeCreateSessionResponseMsg(MsgBuffer &buffer, |
| 1045 | CreateSessionResponseMsgData |
| 1046 | &data, Uint16 length) |
| 1047 | { |
| 1048 | |
| 1049 | bool rc = false; |
| 1050 | GtpV2IeHeader ieHeader; |
| 1051 | |
| 1052 | set<Uint16> mandatoryIeLocalList = mandatoryIeSet; |
| 1053 | while (buffer.lengthLeft() > IE_HEADER_SIZE) |
| 1054 | { |
| 1055 | GtpV2Ie::decodeGtpV2IeHeader(buffer, ieHeader); |
| 1056 | if (ieHeader.length > buffer.lengthLeft()) |
| 1057 | { |
| 1058 | // We do not have enough bytes left in the message for this IE |
| 1059 | errorStream.add((char *)"IE Length exceeds beyond message boundary\n"); |
| 1060 | errorStream.add((char *)" Offending IE Type: "); |
| 1061 | errorStream.add(ieHeader.ieType); |
| 1062 | errorStream.add((char *)"\n Ie Length in Header: "); |
| 1063 | errorStream.add(ieHeader.length); |
| 1064 | errorStream.add((char *)"\n Bytes left in message: "); |
| 1065 | errorStream.add(buffer.lengthLeft()); |
| 1066 | errorStream.endOfLine(); |
| 1067 | return false; |
| 1068 | } |
| 1069 | |
| 1070 | switch (ieHeader.ieType){ |
| 1071 | |
| 1072 | case CauseIeType: |
| 1073 | { |
| 1074 | CauseIe ieObject = |
| 1075 | dynamic_cast< |
| 1076 | CauseIe&>(GtpV2IeFactory::getInstance().getIeObject(CauseIeType)); |
| 1077 | |
| 1078 | if(ieHeader.instance == 0) |
| 1079 | { |
| 1080 | rc = ieObject.decodeCauseIe(buffer, data.cause, ieHeader.length); |
| 1081 | |
| 1082 | if (!(rc)) |
| 1083 | { |
| 1084 | errorStream.add((char *)"Failed to decode IE: cause\n"); |
| 1085 | return false; |
| 1086 | } |
| 1087 | } |
| 1088 | |
| 1089 | else |
| 1090 | { |
| 1091 | // Unknown IE instance print error |
| 1092 | errorStream.add((char *)"Unknown IE Type: "); |
| 1093 | errorStream.add(ieHeader.ieType); |
| 1094 | errorStream.endOfLine(); |
| 1095 | buffer.skipBytes(ieHeader.length); |
| 1096 | } |
| 1097 | break; |
| 1098 | } |
| 1099 | |
| 1100 | case ChangeReportingActionIeType: |
| 1101 | { |
| 1102 | ChangeReportingActionIe ieObject = |
| 1103 | dynamic_cast< |
| 1104 | ChangeReportingActionIe&>(GtpV2IeFactory::getInstance().getIeObject(ChangeReportingActionIeType)); |
| 1105 | |
| 1106 | if(ieHeader.instance == 0) |
| 1107 | { |
| 1108 | rc = ieObject.decodeChangeReportingActionIe(buffer, data.changeReportingAction, ieHeader.length); |
| 1109 | |
| 1110 | data.changeReportingActionIePresent = true; |
| 1111 | if (!(rc)) |
| 1112 | { |
| 1113 | errorStream.add((char *)"Failed to decode IE: changeReportingAction\n"); |
| 1114 | return false; |
| 1115 | } |
| 1116 | } |
| 1117 | |
| 1118 | else |
| 1119 | { |
| 1120 | // Unknown IE instance print error |
| 1121 | errorStream.add((char *)"Unknown IE Type: "); |
| 1122 | errorStream.add(ieHeader.ieType); |
| 1123 | errorStream.endOfLine(); |
| 1124 | buffer.skipBytes(ieHeader.length); |
| 1125 | } |
| 1126 | break; |
| 1127 | } |
| 1128 | |
| 1129 | case CsgInformationReportingActionIeType: |
| 1130 | { |
| 1131 | CsgInformationReportingActionIe ieObject = |
| 1132 | dynamic_cast< |
| 1133 | CsgInformationReportingActionIe&>(GtpV2IeFactory::getInstance().getIeObject(CsgInformationReportingActionIeType)); |
| 1134 | |
| 1135 | if(ieHeader.instance == 0) |
| 1136 | { |
| 1137 | rc = ieObject.decodeCsgInformationReportingActionIe(buffer, data.csgInformationReportingAction, ieHeader.length); |
| 1138 | |
| 1139 | data.csgInformationReportingActionIePresent = true; |
| 1140 | if (!(rc)) |
| 1141 | { |
| 1142 | errorStream.add((char *)"Failed to decode IE: csgInformationReportingAction\n"); |
| 1143 | return false; |
| 1144 | } |
| 1145 | } |
| 1146 | |
| 1147 | else |
| 1148 | { |
| 1149 | // Unknown IE instance print error |
| 1150 | errorStream.add((char *)"Unknown IE Type: "); |
| 1151 | errorStream.add(ieHeader.ieType); |
| 1152 | errorStream.endOfLine(); |
| 1153 | buffer.skipBytes(ieHeader.length); |
| 1154 | } |
| 1155 | break; |
| 1156 | } |
| 1157 | |
| 1158 | case FTeidIeType: |
| 1159 | { |
| 1160 | FTeidIe ieObject = |
| 1161 | dynamic_cast< |
| 1162 | FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType)); |
| 1163 | |
| 1164 | if(ieHeader.instance == 0) |
| 1165 | { |
| 1166 | rc = ieObject.decodeFTeidIe(buffer, data.senderFTeidForControlPlane, ieHeader.length); |
| 1167 | |
| 1168 | data.senderFTeidForControlPlaneIePresent = true; |
| 1169 | if (!(rc)) |
| 1170 | { |
| 1171 | errorStream.add((char *)"Failed to decode IE: senderFTeidForControlPlane\n"); |
| 1172 | return false; |
| 1173 | } |
| 1174 | } |
| 1175 | else if(ieHeader.instance == 1) |
| 1176 | { |
| 1177 | rc = ieObject.decodeFTeidIe(buffer, data.pgwS5S8S2bFTeid, ieHeader.length); |
| 1178 | |
| 1179 | data.pgwS5S8S2bFTeidIePresent = true; |
| 1180 | if (!(rc)) |
| 1181 | { |
| 1182 | errorStream.add((char *)"Failed to decode IE: pgwS5S8S2bFTeid\n"); |
| 1183 | return false; |
| 1184 | } |
| 1185 | } |
| 1186 | |
| 1187 | else |
| 1188 | { |
| 1189 | // Unknown IE instance print error |
| 1190 | errorStream.add((char *)"Unknown IE Type: "); |
| 1191 | errorStream.add(ieHeader.ieType); |
| 1192 | errorStream.endOfLine(); |
| 1193 | buffer.skipBytes(ieHeader.length); |
| 1194 | } |
| 1195 | break; |
| 1196 | } |
| 1197 | |
| 1198 | case ApnRestrictionIeType: |
| 1199 | { |
| 1200 | ApnRestrictionIe ieObject = |
| 1201 | dynamic_cast< |
| 1202 | ApnRestrictionIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnRestrictionIeType)); |
| 1203 | |
| 1204 | if(ieHeader.instance == 0) |
| 1205 | { |
| 1206 | rc = ieObject.decodeApnRestrictionIe(buffer, data.apnRestriction, ieHeader.length); |
| 1207 | |
| 1208 | data.apnRestrictionIePresent = true; |
| 1209 | if (!(rc)) |
| 1210 | { |
| 1211 | errorStream.add((char *)"Failed to decode IE: apnRestriction\n"); |
| 1212 | return false; |
| 1213 | } |
| 1214 | } |
| 1215 | |
| 1216 | else |
| 1217 | { |
| 1218 | // Unknown IE instance print error |
| 1219 | errorStream.add((char *)"Unknown IE Type: "); |
| 1220 | errorStream.add(ieHeader.ieType); |
| 1221 | errorStream.endOfLine(); |
| 1222 | buffer.skipBytes(ieHeader.length); |
| 1223 | } |
| 1224 | break; |
| 1225 | } |
| 1226 | |
| 1227 | case AmbrIeType: |
| 1228 | { |
| 1229 | AmbrIe ieObject = |
| 1230 | dynamic_cast< |
| 1231 | AmbrIe&>(GtpV2IeFactory::getInstance().getIeObject(AmbrIeType)); |
| 1232 | |
| 1233 | if(ieHeader.instance == 0) |
| 1234 | { |
| 1235 | rc = ieObject.decodeAmbrIe(buffer, data.aggregateMaximumBitRate, ieHeader.length); |
| 1236 | |
| 1237 | data.aggregateMaximumBitRateIePresent = true; |
| 1238 | if (!(rc)) |
| 1239 | { |
| 1240 | errorStream.add((char *)"Failed to decode IE: aggregateMaximumBitRate\n"); |
| 1241 | return false; |
| 1242 | } |
| 1243 | } |
| 1244 | |
| 1245 | else |
| 1246 | { |
| 1247 | // Unknown IE instance print error |
| 1248 | errorStream.add((char *)"Unknown IE Type: "); |
| 1249 | errorStream.add(ieHeader.ieType); |
| 1250 | errorStream.endOfLine(); |
| 1251 | buffer.skipBytes(ieHeader.length); |
| 1252 | } |
| 1253 | break; |
| 1254 | } |
| 1255 | |
| 1256 | case EbiIeType: |
| 1257 | { |
| 1258 | EbiIe ieObject = |
| 1259 | dynamic_cast< |
| 1260 | EbiIe&>(GtpV2IeFactory::getInstance().getIeObject(EbiIeType)); |
| 1261 | |
| 1262 | if(ieHeader.instance == 0) |
| 1263 | { |
| 1264 | rc = ieObject.decodeEbiIe(buffer, data.linkedEpsBearerId, ieHeader.length); |
| 1265 | |
| 1266 | data.linkedEpsBearerIdIePresent = true; |
| 1267 | if (!(rc)) |
| 1268 | { |
| 1269 | errorStream.add((char *)"Failed to decode IE: linkedEpsBearerId\n"); |
| 1270 | return false; |
| 1271 | } |
| 1272 | } |
| 1273 | |
| 1274 | else |
| 1275 | { |
| 1276 | // Unknown IE instance print error |
| 1277 | errorStream.add((char *)"Unknown IE Type: "); |
| 1278 | errorStream.add(ieHeader.ieType); |
| 1279 | errorStream.endOfLine(); |
| 1280 | buffer.skipBytes(ieHeader.length); |
| 1281 | } |
| 1282 | break; |
| 1283 | } |
| 1284 | |
| 1285 | case BearerContextIeType: |
| 1286 | { |
| 1287 | BearerContextIe ieObject = |
| 1288 | dynamic_cast< |
| 1289 | BearerContextIe&>(GtpV2IeFactory::getInstance().getIeObject(BearerContextIeType)); |
| 1290 | |
| 1291 | if(ieHeader.instance == 0) |
| 1292 | { |
| 1293 | // First check if we have enough space left to decode and store this instance |
| 1294 | if (data.bearerContextsCreatedCount == 11) |
| 1295 | { |
| 1296 | errorStream.add((char *)"More than 11 instances of bearerContextsCreated received\n"); |
| 1297 | return false; |
| 1298 | } |
| 1299 | BearerContextsCreatedInCreateSessionResponse groupedIeInstance = |
| 1300 | dynamic_cast< |
| 1301 | BearerContextsCreatedInCreateSessionResponse&>(ieObject.getGroupedIe(msgType, 0)); |
| 1302 | rc = groupedIeInstance.decodeBearerContextsCreatedInCreateSessionResponse(buffer, |
| 1303 | data.bearerContextsCreated[data.bearerContextsCreatedCount], ieHeader.length); |
| 1304 | data.bearerContextsCreatedCount++; // TODO Count validation |
| 1305 | |
| 1306 | if (!(rc)) |
| 1307 | { |
| 1308 | errorStream.add((char *)"Failed to decode IE: bearerContextsCreated\n"); |
| 1309 | return false; |
| 1310 | } |
| 1311 | } |
| 1312 | else if(ieHeader.instance == 1) |
| 1313 | { |
| 1314 | // First check if we have enough space left to decode and store this instance |
| 1315 | if (data.bearerContextsMarkedForRemovalCount == 11) |
| 1316 | { |
| 1317 | errorStream.add((char *)"More than 11 instances of bearerContextsMarkedForRemoval received\n"); |
| 1318 | return false; |
| 1319 | } |
| 1320 | BearerContextsMarkedForRemovalInCreateSessionResponse groupedIeInstance = |
| 1321 | dynamic_cast< |
| 1322 | BearerContextsMarkedForRemovalInCreateSessionResponse&>(ieObject.getGroupedIe(msgType, 1)); |
| 1323 | rc = groupedIeInstance.decodeBearerContextsMarkedForRemovalInCreateSessionResponse(buffer, |
| 1324 | data.bearerContextsMarkedForRemoval[data.bearerContextsMarkedForRemovalCount], ieHeader.length); |
| 1325 | data.bearerContextsMarkedForRemovalCount++; // TODO Count validation |
| 1326 | |
| 1327 | if (!(rc)) |
| 1328 | { |
| 1329 | errorStream.add((char *)"Failed to decode IE: bearerContextsMarkedForRemoval\n"); |
| 1330 | return false; |
| 1331 | } |
| 1332 | } |
| 1333 | |
| 1334 | else |
| 1335 | { |
| 1336 | // Unknown IE instance print error |
| 1337 | errorStream.add((char *)"Unknown IE Type: "); |
| 1338 | errorStream.add(ieHeader.ieType); |
| 1339 | errorStream.endOfLine(); |
| 1340 | buffer.skipBytes(ieHeader.length); |
| 1341 | } |
| 1342 | break; |
| 1343 | } |
| 1344 | |
| 1345 | case RecoveryIeType: |
| 1346 | { |
| 1347 | RecoveryIe ieObject = |
| 1348 | dynamic_cast< |
| 1349 | RecoveryIe&>(GtpV2IeFactory::getInstance().getIeObject(RecoveryIeType)); |
| 1350 | |
| 1351 | if(ieHeader.instance == 0) |
| 1352 | { |
| 1353 | rc = ieObject.decodeRecoveryIe(buffer, data.recovery, ieHeader.length); |
| 1354 | |
| 1355 | data.recoveryIePresent = true; |
| 1356 | if (!(rc)) |
| 1357 | { |
| 1358 | errorStream.add((char *)"Failed to decode IE: recovery\n"); |
| 1359 | return false; |
| 1360 | } |
| 1361 | } |
| 1362 | |
| 1363 | else |
| 1364 | { |
| 1365 | // Unknown IE instance print error |
| 1366 | errorStream.add((char *)"Unknown IE Type: "); |
| 1367 | errorStream.add(ieHeader.ieType); |
| 1368 | errorStream.endOfLine(); |
| 1369 | buffer.skipBytes(ieHeader.length); |
| 1370 | } |
| 1371 | break; |
| 1372 | } |
| 1373 | |
| 1374 | case FqdnIeType: |
| 1375 | { |
| 1376 | FqdnIe ieObject = |
| 1377 | dynamic_cast< |
| 1378 | FqdnIe&>(GtpV2IeFactory::getInstance().getIeObject(FqdnIeType)); |
| 1379 | |
| 1380 | if(ieHeader.instance == 0) |
| 1381 | { |
| 1382 | rc = ieObject.decodeFqdnIe(buffer, data.chargingGatewayName, ieHeader.length); |
| 1383 | |
| 1384 | data.chargingGatewayNameIePresent = true; |
| 1385 | if (!(rc)) |
| 1386 | { |
| 1387 | errorStream.add((char *)"Failed to decode IE: chargingGatewayName\n"); |
| 1388 | return false; |
| 1389 | } |
| 1390 | } |
| 1391 | |
| 1392 | else |
| 1393 | { |
| 1394 | // Unknown IE instance print error |
| 1395 | errorStream.add((char *)"Unknown IE Type: "); |
| 1396 | errorStream.add(ieHeader.ieType); |
| 1397 | errorStream.endOfLine(); |
| 1398 | buffer.skipBytes(ieHeader.length); |
| 1399 | } |
| 1400 | break; |
| 1401 | } |
| 1402 | |
| 1403 | case IpAddressIeType: |
| 1404 | { |
| 1405 | IpAddressIe ieObject = |
| 1406 | dynamic_cast< |
| 1407 | IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType)); |
| 1408 | |
| 1409 | if(ieHeader.instance == 0) |
| 1410 | { |
| 1411 | rc = ieObject.decodeIpAddressIe(buffer, data.chargingGatewayAddress, ieHeader.length); |
| 1412 | |
| 1413 | data.chargingGatewayAddressIePresent = true; |
| 1414 | if (!(rc)) |
| 1415 | { |
| 1416 | errorStream.add((char *)"Failed to decode IE: chargingGatewayAddress\n"); |
| 1417 | return false; |
| 1418 | } |
| 1419 | } |
| 1420 | |
| 1421 | else |
| 1422 | { |
| 1423 | // Unknown IE instance print error |
| 1424 | errorStream.add((char *)"Unknown IE Type: "); |
| 1425 | errorStream.add(ieHeader.ieType); |
| 1426 | errorStream.endOfLine(); |
| 1427 | buffer.skipBytes(ieHeader.length); |
| 1428 | } |
| 1429 | break; |
| 1430 | } |
| 1431 | |
| 1432 | case FqCsidIeType: |
| 1433 | { |
| 1434 | FqCsidIe ieObject = |
| 1435 | dynamic_cast< |
| 1436 | FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType)); |
| 1437 | |
| 1438 | if(ieHeader.instance == 0) |
| 1439 | { |
| 1440 | rc = ieObject.decodeFqCsidIe(buffer, data.pgwFqCsid, ieHeader.length); |
| 1441 | |
| 1442 | data.pgwFqCsidIePresent = true; |
| 1443 | if (!(rc)) |
| 1444 | { |
| 1445 | errorStream.add((char *)"Failed to decode IE: pgwFqCsid\n"); |
| 1446 | return false; |
| 1447 | } |
| 1448 | } |
| 1449 | else if(ieHeader.instance == 1) |
| 1450 | { |
| 1451 | rc = ieObject.decodeFqCsidIe(buffer, data.sgwFqCsid, ieHeader.length); |
| 1452 | |
| 1453 | data.sgwFqCsidIePresent = true; |
| 1454 | if (!(rc)) |
| 1455 | { |
| 1456 | errorStream.add((char *)"Failed to decode IE: sgwFqCsid\n"); |
| 1457 | return false; |
| 1458 | } |
| 1459 | } |
| 1460 | |
| 1461 | else |
| 1462 | { |
| 1463 | // Unknown IE instance print error |
| 1464 | errorStream.add((char *)"Unknown IE Type: "); |
| 1465 | errorStream.add(ieHeader.ieType); |
| 1466 | errorStream.endOfLine(); |
| 1467 | buffer.skipBytes(ieHeader.length); |
| 1468 | } |
| 1469 | break; |
| 1470 | } |
| 1471 | |
| 1472 | case LocalDistinguishedNameIeType: |
| 1473 | { |
| 1474 | LocalDistinguishedNameIe ieObject = |
| 1475 | dynamic_cast< |
| 1476 | LocalDistinguishedNameIe&>(GtpV2IeFactory::getInstance().getIeObject(LocalDistinguishedNameIeType)); |
| 1477 | |
| 1478 | if(ieHeader.instance == 0) |
| 1479 | { |
| 1480 | rc = ieObject.decodeLocalDistinguishedNameIe(buffer, data.sgwLdn, ieHeader.length); |
| 1481 | |
| 1482 | data.sgwLdnIePresent = true; |
| 1483 | if (!(rc)) |
| 1484 | { |
| 1485 | errorStream.add((char *)"Failed to decode IE: sgwLdn\n"); |
| 1486 | return false; |
| 1487 | } |
| 1488 | } |
| 1489 | else if(ieHeader.instance == 1) |
| 1490 | { |
| 1491 | rc = ieObject.decodeLocalDistinguishedNameIe(buffer, data.pgwLdn, ieHeader.length); |
| 1492 | |
| 1493 | data.pgwLdnIePresent = true; |
| 1494 | if (!(rc)) |
| 1495 | { |
| 1496 | errorStream.add((char *)"Failed to decode IE: pgwLdn\n"); |
| 1497 | return false; |
| 1498 | } |
| 1499 | } |
| 1500 | |
| 1501 | else |
| 1502 | { |
| 1503 | // Unknown IE instance print error |
| 1504 | errorStream.add((char *)"Unknown IE Type: "); |
| 1505 | errorStream.add(ieHeader.ieType); |
| 1506 | errorStream.endOfLine(); |
| 1507 | buffer.skipBytes(ieHeader.length); |
| 1508 | } |
| 1509 | break; |
| 1510 | } |
| 1511 | |
| 1512 | case EpcTimerIeType: |
| 1513 | { |
| 1514 | EpcTimerIe ieObject = |
| 1515 | dynamic_cast< |
| 1516 | EpcTimerIe&>(GtpV2IeFactory::getInstance().getIeObject(EpcTimerIeType)); |
| 1517 | |
| 1518 | if(ieHeader.instance == 0) |
| 1519 | { |
| 1520 | rc = ieObject.decodeEpcTimerIe(buffer, data.pgwBackOffTime, ieHeader.length); |
| 1521 | |
| 1522 | data.pgwBackOffTimeIePresent = true; |
| 1523 | if (!(rc)) |
| 1524 | { |
| 1525 | errorStream.add((char *)"Failed to decode IE: pgwBackOffTime\n"); |
| 1526 | return false; |
| 1527 | } |
| 1528 | } |
| 1529 | |
| 1530 | else |
| 1531 | { |
| 1532 | // Unknown IE instance print error |
| 1533 | errorStream.add((char *)"Unknown IE Type: "); |
| 1534 | errorStream.add(ieHeader.ieType); |
| 1535 | errorStream.endOfLine(); |
| 1536 | buffer.skipBytes(ieHeader.length); |
| 1537 | } |
| 1538 | break; |
| 1539 | } |
| 1540 | |
| 1541 | case HenbInformationReportingIeType: |
| 1542 | { |
| 1543 | HenbInformationReportingIe ieObject = |
| 1544 | dynamic_cast< |
| 1545 | HenbInformationReportingIe&>(GtpV2IeFactory::getInstance().getIeObject(HenbInformationReportingIeType)); |
| 1546 | |
| 1547 | if(ieHeader.instance == 0) |
| 1548 | { |
| 1549 | rc = ieObject.decodeHenbInformationReportingIe(buffer, data.hNbInformationReporting, ieHeader.length); |
| 1550 | |
| 1551 | data.hNbInformationReportingIePresent = true; |
| 1552 | if (!(rc)) |
| 1553 | { |
| 1554 | errorStream.add((char *)"Failed to decode IE: hNbInformationReporting\n"); |
| 1555 | return false; |
| 1556 | } |
| 1557 | } |
| 1558 | |
| 1559 | else |
| 1560 | { |
| 1561 | // Unknown IE instance print error |
| 1562 | errorStream.add((char *)"Unknown IE Type: "); |
| 1563 | errorStream.add(ieHeader.ieType); |
| 1564 | errorStream.endOfLine(); |
| 1565 | buffer.skipBytes(ieHeader.length); |
| 1566 | } |
| 1567 | break; |
| 1568 | } |
| 1569 | |
| 1570 | case PaaIeType: |
| 1571 | { |
| 1572 | PaaIe ieObject = |
| 1573 | dynamic_cast< |
| 1574 | PaaIe&>(GtpV2IeFactory::getInstance().getIeObject(PaaIeType)); |
| 1575 | |
| 1576 | if(ieHeader.instance == 0) |
| 1577 | { |
| 1578 | rc = ieObject.decodePaaIe(buffer, data.pdnAddressAllocation, ieHeader.length); |
| 1579 | |
| 1580 | data.pdnAddressAllocationIePresent = true; |
| 1581 | if (!(rc)) |
| 1582 | { |
| 1583 | errorStream.add((char *)"Failed to decode IE: pdnAddressAllocation\n"); |
| 1584 | return false; |
| 1585 | } |
| 1586 | } |
| 1587 | |
| 1588 | else |
| 1589 | { |
| 1590 | // Unknown IE instance print error |
| 1591 | errorStream.add((char *)"Unknown IE Type: "); |
| 1592 | errorStream.add(ieHeader.ieType); |
| 1593 | errorStream.endOfLine(); |
| 1594 | buffer.skipBytes(ieHeader.length); |
| 1595 | } |
| 1596 | break; |
| 1597 | } |
| 1598 | |
| 1599 | case PcoIeType: |
| 1600 | { |
| 1601 | PcoIe ieObject = |
| 1602 | dynamic_cast< |
| 1603 | PcoIe&>(GtpV2IeFactory::getInstance().getIeObject(PcoIeType)); |
| 1604 | |
| 1605 | if(ieHeader.instance == 0) |
| 1606 | { |
| 1607 | rc = ieObject.decodePcoIe(buffer, data.protocolConfigurationOptions, ieHeader.length); |
| 1608 | |
| 1609 | data.protocolConfigurationOptionsIePresent = true; |
| 1610 | if (!(rc)) |
| 1611 | { |
| 1612 | errorStream.add((char *)"Failed to decode IE: protocolConfigurationOptions\n"); |
| 1613 | return false; |
| 1614 | } |
| 1615 | } |
| 1616 | |
| 1617 | else |
| 1618 | { |
| 1619 | // Unknown IE instance print error |
| 1620 | errorStream.add((char *)"Unknown IE Type: "); |
| 1621 | errorStream.add(ieHeader.ieType); |
| 1622 | errorStream.endOfLine(); |
| 1623 | buffer.skipBytes(ieHeader.length); |
| 1624 | } |
| 1625 | break; |
| 1626 | } |
| 1627 | |
| 1628 | case AdditionalProtocolConfigurationOptionsIeType: |
| 1629 | { |
| 1630 | AdditionalProtocolConfigurationOptionsIe ieObject = |
| 1631 | dynamic_cast< |
| 1632 | AdditionalProtocolConfigurationOptionsIe&>(GtpV2IeFactory::getInstance().getIeObject(AdditionalProtocolConfigurationOptionsIeType)); |
| 1633 | |
| 1634 | if(ieHeader.instance == 0) |
| 1635 | { |
| 1636 | rc = ieObject.decodeAdditionalProtocolConfigurationOptionsIe(buffer, data.additionalProtocolConfigurationOptions, ieHeader.length); |
| 1637 | |
| 1638 | data.additionalProtocolConfigurationOptionsIePresent = true; |
| 1639 | if (!(rc)) |
| 1640 | { |
| 1641 | errorStream.add((char *)"Failed to decode IE: additionalProtocolConfigurationOptions\n"); |
| 1642 | return false; |
| 1643 | } |
| 1644 | } |
| 1645 | |
| 1646 | else |
| 1647 | { |
| 1648 | // Unknown IE instance print error |
| 1649 | errorStream.add((char *)"Unknown IE Type: "); |
| 1650 | errorStream.add(ieHeader.ieType); |
| 1651 | errorStream.endOfLine(); |
| 1652 | buffer.skipBytes(ieHeader.length); |
| 1653 | } |
| 1654 | break; |
| 1655 | } |
| 1656 | |
| 1657 | case Ip4cpIeType: |
| 1658 | { |
| 1659 | Ip4cpIe ieObject = |
| 1660 | dynamic_cast< |
| 1661 | Ip4cpIe&>(GtpV2IeFactory::getInstance().getIeObject(Ip4cpIeType)); |
| 1662 | |
| 1663 | if(ieHeader.instance == 0) |
| 1664 | { |
| 1665 | rc = ieObject.decodeIp4cpIe(buffer, data.trustedWlanIpv4Parameters, ieHeader.length); |
| 1666 | |
| 1667 | data.trustedWlanIpv4ParametersIePresent = true; |
| 1668 | if (!(rc)) |
| 1669 | { |
| 1670 | errorStream.add((char *)"Failed to decode IE: trustedWlanIpv4Parameters\n"); |
| 1671 | return false; |
| 1672 | } |
| 1673 | } |
| 1674 | |
| 1675 | else |
| 1676 | { |
| 1677 | // Unknown IE instance print error |
| 1678 | errorStream.add((char *)"Unknown IE Type: "); |
| 1679 | errorStream.add(ieHeader.ieType); |
| 1680 | errorStream.endOfLine(); |
| 1681 | buffer.skipBytes(ieHeader.length); |
| 1682 | } |
| 1683 | break; |
| 1684 | } |
| 1685 | |
| 1686 | case IndicationIeType: |
| 1687 | { |
| 1688 | IndicationIe ieObject = |
| 1689 | dynamic_cast< |
| 1690 | IndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(IndicationIeType)); |
| 1691 | |
| 1692 | if(ieHeader.instance == 0) |
| 1693 | { |
| 1694 | rc = ieObject.decodeIndicationIe(buffer, data.indicationFlags, ieHeader.length); |
| 1695 | |
| 1696 | data.indicationFlagsIePresent = true; |
| 1697 | if (!(rc)) |
| 1698 | { |
| 1699 | errorStream.add((char *)"Failed to decode IE: indicationFlags\n"); |
| 1700 | return false; |
| 1701 | } |
| 1702 | } |
| 1703 | |
| 1704 | else |
| 1705 | { |
| 1706 | // Unknown IE instance print error |
| 1707 | errorStream.add((char *)"Unknown IE Type: "); |
| 1708 | errorStream.add(ieHeader.ieType); |
| 1709 | errorStream.endOfLine(); |
| 1710 | buffer.skipBytes(ieHeader.length); |
| 1711 | } |
| 1712 | break; |
| 1713 | } |
| 1714 | |
| 1715 | case PresenceReportingAreaActionIeType: |
| 1716 | { |
| 1717 | PresenceReportingAreaActionIe ieObject = |
| 1718 | dynamic_cast< |
| 1719 | PresenceReportingAreaActionIe&>(GtpV2IeFactory::getInstance().getIeObject(PresenceReportingAreaActionIeType)); |
| 1720 | |
| 1721 | if(ieHeader.instance == 0) |
| 1722 | { |
| 1723 | rc = ieObject.decodePresenceReportingAreaActionIe(buffer, data.presenceReportingAreaAction, ieHeader.length); |
| 1724 | |
| 1725 | data.presenceReportingAreaActionIePresent = true; |
| 1726 | if (!(rc)) |
| 1727 | { |
| 1728 | errorStream.add((char *)"Failed to decode IE: presenceReportingAreaAction\n"); |
| 1729 | return false; |
| 1730 | } |
| 1731 | } |
| 1732 | |
| 1733 | else |
| 1734 | { |
| 1735 | // Unknown IE instance print error |
| 1736 | errorStream.add((char *)"Unknown IE Type: "); |
| 1737 | errorStream.add(ieHeader.ieType); |
| 1738 | errorStream.endOfLine(); |
| 1739 | buffer.skipBytes(ieHeader.length); |
| 1740 | } |
| 1741 | break; |
| 1742 | } |
| 1743 | |
| 1744 | case LoadControlInformationIeType: |
| 1745 | { |
| 1746 | LoadControlInformationIe ieObject = |
| 1747 | dynamic_cast< |
| 1748 | LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType)); |
| 1749 | |
| 1750 | if(ieHeader.instance == 0) |
| 1751 | { |
| 1752 | PgwsNodeLevelLoadControlInformationInCreateSessionResponse groupedIeInstance = |
| 1753 | dynamic_cast< |
| 1754 | PgwsNodeLevelLoadControlInformationInCreateSessionResponse&>(ieObject.getGroupedIe(msgType, 0)); |
| 1755 | rc = groupedIeInstance.decodePgwsNodeLevelLoadControlInformationInCreateSessionResponse(buffer, data.pgwsNodeLevelLoadControlInformation, ieHeader.length); |
| 1756 | |
| 1757 | data.pgwsNodeLevelLoadControlInformationIePresent = true; |
| 1758 | if (!(rc)) |
| 1759 | { |
| 1760 | errorStream.add((char *)"Failed to decode IE: pgwsNodeLevelLoadControlInformation\n"); |
| 1761 | return false; |
| 1762 | } |
| 1763 | } |
| 1764 | else if(ieHeader.instance == 1) |
| 1765 | { |
| 1766 | PgwsApnLevelLoadControlInformationInCreateSessionResponse groupedIeInstance = |
| 1767 | dynamic_cast< |
| 1768 | PgwsApnLevelLoadControlInformationInCreateSessionResponse&>(ieObject.getGroupedIe(msgType, 1)); |
| 1769 | rc = groupedIeInstance.decodePgwsApnLevelLoadControlInformationInCreateSessionResponse(buffer, data.pgwsApnLevelLoadControlInformation, ieHeader.length); |
| 1770 | |
| 1771 | data.pgwsApnLevelLoadControlInformationIePresent = true; |
| 1772 | if (!(rc)) |
| 1773 | { |
| 1774 | errorStream.add((char *)"Failed to decode IE: pgwsApnLevelLoadControlInformation\n"); |
| 1775 | return false; |
| 1776 | } |
| 1777 | } |
| 1778 | else if(ieHeader.instance == 2) |
| 1779 | { |
| 1780 | SgwsNodeLevelLoadControlInformationInCreateSessionResponse groupedIeInstance = |
| 1781 | dynamic_cast< |
| 1782 | SgwsNodeLevelLoadControlInformationInCreateSessionResponse&>(ieObject.getGroupedIe(msgType, 2)); |
| 1783 | rc = groupedIeInstance.decodeSgwsNodeLevelLoadControlInformationInCreateSessionResponse(buffer, data.sgwsNodeLevelLoadControlInformation, ieHeader.length); |
| 1784 | |
| 1785 | data.sgwsNodeLevelLoadControlInformationIePresent = true; |
| 1786 | if (!(rc)) |
| 1787 | { |
| 1788 | errorStream.add((char *)"Failed to decode IE: sgwsNodeLevelLoadControlInformation\n"); |
| 1789 | return false; |
| 1790 | } |
| 1791 | } |
| 1792 | |
| 1793 | else |
| 1794 | { |
| 1795 | // Unknown IE instance print error |
| 1796 | errorStream.add((char *)"Unknown IE Type: "); |
| 1797 | errorStream.add(ieHeader.ieType); |
| 1798 | errorStream.endOfLine(); |
| 1799 | buffer.skipBytes(ieHeader.length); |
| 1800 | } |
| 1801 | break; |
| 1802 | } |
| 1803 | |
| 1804 | case OverloadControlInformationIeType: |
| 1805 | { |
| 1806 | OverloadControlInformationIe ieObject = |
| 1807 | dynamic_cast< |
| 1808 | OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType)); |
| 1809 | |
| 1810 | if(ieHeader.instance == 0) |
| 1811 | { |
| 1812 | PgwsOverloadControlInformationInCreateSessionResponse groupedIeInstance = |
| 1813 | dynamic_cast< |
| 1814 | PgwsOverloadControlInformationInCreateSessionResponse&>(ieObject.getGroupedIe(msgType, 0)); |
| 1815 | rc = groupedIeInstance.decodePgwsOverloadControlInformationInCreateSessionResponse(buffer, data.pgwsOverloadControlInformation, ieHeader.length); |
| 1816 | |
| 1817 | data.pgwsOverloadControlInformationIePresent = true; |
| 1818 | if (!(rc)) |
| 1819 | { |
| 1820 | errorStream.add((char *)"Failed to decode IE: pgwsOverloadControlInformation\n"); |
| 1821 | return false; |
| 1822 | } |
| 1823 | } |
| 1824 | else if(ieHeader.instance == 1) |
| 1825 | { |
| 1826 | SgwsOverloadControlInformationInCreateSessionResponse groupedIeInstance = |
| 1827 | dynamic_cast< |
| 1828 | SgwsOverloadControlInformationInCreateSessionResponse&>(ieObject.getGroupedIe(msgType, 1)); |
| 1829 | rc = groupedIeInstance.decodeSgwsOverloadControlInformationInCreateSessionResponse(buffer, data.sgwsOverloadControlInformation, ieHeader.length); |
| 1830 | |
| 1831 | data.sgwsOverloadControlInformationIePresent = true; |
| 1832 | if (!(rc)) |
| 1833 | { |
| 1834 | errorStream.add((char *)"Failed to decode IE: sgwsOverloadControlInformation\n"); |
| 1835 | return false; |
| 1836 | } |
| 1837 | } |
| 1838 | |
| 1839 | else |
| 1840 | { |
| 1841 | // Unknown IE instance print error |
| 1842 | errorStream.add((char *)"Unknown IE Type: "); |
| 1843 | errorStream.add(ieHeader.ieType); |
| 1844 | errorStream.endOfLine(); |
| 1845 | buffer.skipBytes(ieHeader.length); |
| 1846 | } |
| 1847 | break; |
| 1848 | } |
| 1849 | |
| 1850 | case FContainerIeType: |
| 1851 | { |
| 1852 | FContainerIe ieObject = |
| 1853 | dynamic_cast< |
| 1854 | FContainerIe&>(GtpV2IeFactory::getInstance().getIeObject(FContainerIeType)); |
| 1855 | |
| 1856 | if(ieHeader.instance == 0) |
| 1857 | { |
| 1858 | rc = ieObject.decodeFContainerIe(buffer, data.nbifomContainer, ieHeader.length); |
| 1859 | |
| 1860 | data.nbifomContainerIePresent = true; |
| 1861 | if (!(rc)) |
| 1862 | { |
| 1863 | errorStream.add((char *)"Failed to decode IE: nbifomContainer\n"); |
| 1864 | return false; |
| 1865 | } |
| 1866 | } |
| 1867 | |
| 1868 | else |
| 1869 | { |
| 1870 | // Unknown IE instance print error |
| 1871 | errorStream.add((char *)"Unknown IE Type: "); |
| 1872 | errorStream.add(ieHeader.ieType); |
| 1873 | errorStream.endOfLine(); |
| 1874 | buffer.skipBytes(ieHeader.length); |
| 1875 | } |
| 1876 | break; |
| 1877 | } |
| 1878 | |
| 1879 | case ChargingIdIeType: |
| 1880 | { |
| 1881 | ChargingIdIe ieObject = |
| 1882 | dynamic_cast< |
| 1883 | ChargingIdIe&>(GtpV2IeFactory::getInstance().getIeObject(ChargingIdIeType)); |
| 1884 | |
| 1885 | if(ieHeader.instance == 0) |
| 1886 | { |
| 1887 | rc = ieObject.decodeChargingIdIe(buffer, data.pdnConnectionChargingId, ieHeader.length); |
| 1888 | |
| 1889 | data.pdnConnectionChargingIdIePresent = true; |
| 1890 | if (!(rc)) |
| 1891 | { |
| 1892 | errorStream.add((char *)"Failed to decode IE: pdnConnectionChargingId\n"); |
| 1893 | return false; |
| 1894 | } |
| 1895 | } |
| 1896 | |
| 1897 | else |
| 1898 | { |
| 1899 | // Unknown IE instance print error |
| 1900 | errorStream.add((char *)"Unknown IE Type: "); |
| 1901 | errorStream.add(ieHeader.ieType); |
| 1902 | errorStream.endOfLine(); |
| 1903 | buffer.skipBytes(ieHeader.length); |
| 1904 | } |
| 1905 | break; |
| 1906 | } |
| 1907 | |
| 1908 | case EpcoIeType: |
| 1909 | { |
| 1910 | EpcoIe ieObject = |
| 1911 | dynamic_cast< |
| 1912 | EpcoIe&>(GtpV2IeFactory::getInstance().getIeObject(EpcoIeType)); |
| 1913 | |
| 1914 | if(ieHeader.instance == 0) |
| 1915 | { |
| 1916 | rc = ieObject.decodeEpcoIe(buffer, data.extendedProtocolConfigurationOptions, ieHeader.length); |
| 1917 | |
| 1918 | data.extendedProtocolConfigurationOptionsIePresent = true; |
| 1919 | if (!(rc)) |
| 1920 | { |
| 1921 | errorStream.add((char *)"Failed to decode IE: extendedProtocolConfigurationOptions\n"); |
| 1922 | return false; |
| 1923 | } |
| 1924 | } |
| 1925 | |
| 1926 | else |
| 1927 | { |
| 1928 | // Unknown IE instance print error |
| 1929 | errorStream.add((char *)"Unknown IE Type: "); |
| 1930 | errorStream.add(ieHeader.ieType); |
| 1931 | errorStream.endOfLine(); |
| 1932 | buffer.skipBytes(ieHeader.length); |
| 1933 | } |
| 1934 | break; |
| 1935 | } |
| 1936 | |
| 1937 | default: |
| 1938 | { |
| 1939 | // Unknown IE print error |
| 1940 | errorStream.add((char *)"Unknown IE Type: "); |
| 1941 | errorStream.add(ieHeader.ieType); |
| 1942 | errorStream.endOfLine(); |
| 1943 | buffer.skipBytes(ieHeader.length); |
| 1944 | } |
| 1945 | } |
| 1946 | } |
| 1947 | return rc; // TODO validations |
| 1948 | } |
| 1949 | |
| 1950 | void CreateSessionResponseMsg:: |
| 1951 | displayCreateSessionResponseMsgData_v(CreateSessionResponseMsgData const &data, Debug &stream) |
| 1952 | { |
| 1953 | stream.incrIndent(); |
| 1954 | stream.add((char *)"CreateSessionResponseMsg:"); |
| 1955 | stream.endOfLine(); |
| 1956 | stream.incrIndent(); |
| 1957 | |
| 1958 | |
| 1959 | stream.add((char *)"IE - cause:"); |
| 1960 | stream.endOfLine(); |
| 1961 | CauseIe cause= |
| 1962 | dynamic_cast< |
| 1963 | CauseIe&>(GtpV2IeFactory::getInstance().getIeObject(CauseIeType)); |
| 1964 | cause.displayCauseIe_v(data.cause, stream); |
| 1965 | |
| 1966 | if (data.changeReportingActionIePresent) |
| 1967 | { |
| 1968 | |
| 1969 | |
| 1970 | stream.add((char *)"IE - changeReportingAction:"); |
| 1971 | stream.endOfLine(); |
| 1972 | ChangeReportingActionIe changeReportingAction= |
| 1973 | dynamic_cast< |
| 1974 | ChangeReportingActionIe&>(GtpV2IeFactory::getInstance().getIeObject(ChangeReportingActionIeType)); |
| 1975 | changeReportingAction.displayChangeReportingActionIe_v(data.changeReportingAction, stream); |
| 1976 | |
| 1977 | } |
| 1978 | if (data.csgInformationReportingActionIePresent) |
| 1979 | { |
| 1980 | |
| 1981 | |
| 1982 | stream.add((char *)"IE - csgInformationReportingAction:"); |
| 1983 | stream.endOfLine(); |
| 1984 | CsgInformationReportingActionIe csgInformationReportingAction= |
| 1985 | dynamic_cast< |
| 1986 | CsgInformationReportingActionIe&>(GtpV2IeFactory::getInstance().getIeObject(CsgInformationReportingActionIeType)); |
| 1987 | csgInformationReportingAction.displayCsgInformationReportingActionIe_v(data.csgInformationReportingAction, stream); |
| 1988 | |
| 1989 | } |
| 1990 | if (data.senderFTeidForControlPlaneIePresent) |
| 1991 | { |
| 1992 | |
| 1993 | |
| 1994 | stream.add((char *)"IE - senderFTeidForControlPlane:"); |
| 1995 | stream.endOfLine(); |
| 1996 | FTeidIe fTeid= |
| 1997 | dynamic_cast< |
| 1998 | FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType)); |
| 1999 | fTeid.displayFTeidIe_v(data.senderFTeidForControlPlane, stream); |
| 2000 | |
| 2001 | } |
| 2002 | if (data.apnRestrictionIePresent) |
| 2003 | { |
| 2004 | |
| 2005 | |
| 2006 | stream.add((char *)"IE - apnRestriction:"); |
| 2007 | stream.endOfLine(); |
| 2008 | ApnRestrictionIe apnRestriction= |
| 2009 | dynamic_cast< |
| 2010 | ApnRestrictionIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnRestrictionIeType)); |
| 2011 | apnRestriction.displayApnRestrictionIe_v(data.apnRestriction, stream); |
| 2012 | |
| 2013 | } |
| 2014 | if (data.aggregateMaximumBitRateIePresent) |
| 2015 | { |
| 2016 | |
| 2017 | |
| 2018 | stream.add((char *)"IE - aggregateMaximumBitRate:"); |
| 2019 | stream.endOfLine(); |
| 2020 | AmbrIe ambr= |
| 2021 | dynamic_cast< |
| 2022 | AmbrIe&>(GtpV2IeFactory::getInstance().getIeObject(AmbrIeType)); |
| 2023 | ambr.displayAmbrIe_v(data.aggregateMaximumBitRate, stream); |
| 2024 | |
| 2025 | } |
| 2026 | if (data.linkedEpsBearerIdIePresent) |
| 2027 | { |
| 2028 | |
| 2029 | |
| 2030 | stream.add((char *)"IE - linkedEpsBearerId:"); |
| 2031 | stream.endOfLine(); |
| 2032 | EbiIe ebi= |
| 2033 | dynamic_cast< |
| 2034 | EbiIe&>(GtpV2IeFactory::getInstance().getIeObject(EbiIeType)); |
| 2035 | ebi.displayEbiIe_v(data.linkedEpsBearerId, stream); |
| 2036 | |
| 2037 | } |
| 2038 | |
| 2039 | Uint8 displayCount; |
| 2040 | |
| 2041 | displayCount = data.bearerContextsCreatedCount; |
| 2042 | if (displayCount > 11) |
| 2043 | { |
| 2044 | stream.add((char *)"Invalid data more than 11 instances"); |
| 2045 | stream.endOfLine(); |
| 2046 | stream.add((char *)"Displaying only 11"); |
| 2047 | stream.endOfLine(); |
| 2048 | displayCount = 11; |
| 2049 | } |
| 2050 | for (Uint8 i = 0; i < displayCount; i++) |
| 2051 | { |
| 2052 | stream.add((char *)"IE - bearerContextsCreated:"); |
| 2053 | stream.endOfLine(); |
| 2054 | BearerContextIe bearerContext= |
| 2055 | dynamic_cast< |
| 2056 | BearerContextIe&>(GtpV2IeFactory::getInstance().getIeObject(BearerContextIeType)); |
| 2057 | BearerContextsCreatedInCreateSessionResponse groupedIeInstance = |
| 2058 | dynamic_cast< |
| 2059 | BearerContextsCreatedInCreateSessionResponse&>(bearerContext.getGroupedIe(msgType, 0)); |
| 2060 | groupedIeInstance.displayBearerContextsCreatedInCreateSessionResponseData_v(data.bearerContextsCreated[i], stream); |
| 2061 | |
| 2062 | } |
| 2063 | displayCount = data.bearerContextsMarkedForRemovalCount; |
| 2064 | if (displayCount > 11) |
| 2065 | { |
| 2066 | stream.add((char *)"Invalid data more than 11 instances"); |
| 2067 | stream.endOfLine(); |
| 2068 | stream.add((char *)"Displaying only 11"); |
| 2069 | stream.endOfLine(); |
| 2070 | displayCount = 11; |
| 2071 | } |
| 2072 | for (Uint8 i = 0; i < displayCount; i++) |
| 2073 | { |
| 2074 | stream.add((char *)"IE - bearerContextsMarkedForRemoval:"); |
| 2075 | stream.endOfLine(); |
| 2076 | BearerContextIe bearerContext= |
| 2077 | dynamic_cast< |
| 2078 | BearerContextIe&>(GtpV2IeFactory::getInstance().getIeObject(BearerContextIeType)); |
| 2079 | BearerContextsMarkedForRemovalInCreateSessionResponse groupedIeInstance = |
| 2080 | dynamic_cast< |
| 2081 | BearerContextsMarkedForRemovalInCreateSessionResponse&>(bearerContext.getGroupedIe(msgType, 1)); |
| 2082 | groupedIeInstance.displayBearerContextsMarkedForRemovalInCreateSessionResponseData_v(data.bearerContextsMarkedForRemoval[i], stream); |
| 2083 | } |
| 2084 | |
| 2085 | |
| 2086 | |
| 2087 | |
| 2088 | if (data.recoveryIePresent) |
| 2089 | { |
| 2090 | |
| 2091 | |
| 2092 | stream.add((char *)"IE - recovery:"); |
| 2093 | stream.endOfLine(); |
| 2094 | RecoveryIe recovery= |
| 2095 | dynamic_cast< |
| 2096 | RecoveryIe&>(GtpV2IeFactory::getInstance().getIeObject(RecoveryIeType)); |
| 2097 | recovery.displayRecoveryIe_v(data.recovery, stream); |
| 2098 | |
| 2099 | } |
| 2100 | if (data.chargingGatewayNameIePresent) |
| 2101 | { |
| 2102 | |
| 2103 | |
| 2104 | stream.add((char *)"IE - chargingGatewayName:"); |
| 2105 | stream.endOfLine(); |
| 2106 | FqdnIe fqdn= |
| 2107 | dynamic_cast< |
| 2108 | FqdnIe&>(GtpV2IeFactory::getInstance().getIeObject(FqdnIeType)); |
| 2109 | fqdn.displayFqdnIe_v(data.chargingGatewayName, stream); |
| 2110 | |
| 2111 | } |
| 2112 | if (data.chargingGatewayAddressIePresent) |
| 2113 | { |
| 2114 | |
| 2115 | |
| 2116 | stream.add((char *)"IE - chargingGatewayAddress:"); |
| 2117 | stream.endOfLine(); |
| 2118 | IpAddressIe ipAddress= |
| 2119 | dynamic_cast< |
| 2120 | IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType)); |
| 2121 | ipAddress.displayIpAddressIe_v(data.chargingGatewayAddress, stream); |
| 2122 | |
| 2123 | } |
| 2124 | if (data.pgwFqCsidIePresent) |
| 2125 | { |
| 2126 | |
| 2127 | |
| 2128 | stream.add((char *)"IE - pgwFqCsid:"); |
| 2129 | stream.endOfLine(); |
| 2130 | FqCsidIe fqCsid= |
| 2131 | dynamic_cast< |
| 2132 | FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType)); |
| 2133 | fqCsid.displayFqCsidIe_v(data.pgwFqCsid, stream); |
| 2134 | |
| 2135 | } |
| 2136 | if (data.sgwFqCsidIePresent) |
| 2137 | { |
| 2138 | |
| 2139 | |
| 2140 | stream.add((char *)"IE - sgwFqCsid:"); |
| 2141 | stream.endOfLine(); |
| 2142 | FqCsidIe fqCsid= |
| 2143 | dynamic_cast< |
| 2144 | FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType)); |
| 2145 | fqCsid.displayFqCsidIe_v(data.sgwFqCsid, stream); |
| 2146 | |
| 2147 | } |
| 2148 | if (data.sgwLdnIePresent) |
| 2149 | { |
| 2150 | |
| 2151 | |
| 2152 | stream.add((char *)"IE - sgwLdn:"); |
| 2153 | stream.endOfLine(); |
| 2154 | LocalDistinguishedNameIe localDistinguishedName= |
| 2155 | dynamic_cast< |
| 2156 | LocalDistinguishedNameIe&>(GtpV2IeFactory::getInstance().getIeObject(LocalDistinguishedNameIeType)); |
| 2157 | localDistinguishedName.displayLocalDistinguishedNameIe_v(data.sgwLdn, stream); |
| 2158 | |
| 2159 | } |
| 2160 | if (data.pgwLdnIePresent) |
| 2161 | { |
| 2162 | |
| 2163 | |
| 2164 | stream.add((char *)"IE - pgwLdn:"); |
| 2165 | stream.endOfLine(); |
| 2166 | LocalDistinguishedNameIe localDistinguishedName= |
| 2167 | dynamic_cast< |
| 2168 | LocalDistinguishedNameIe&>(GtpV2IeFactory::getInstance().getIeObject(LocalDistinguishedNameIeType)); |
| 2169 | localDistinguishedName.displayLocalDistinguishedNameIe_v(data.pgwLdn, stream); |
| 2170 | |
| 2171 | } |
| 2172 | if (data.pgwBackOffTimeIePresent) |
| 2173 | { |
| 2174 | |
| 2175 | |
| 2176 | stream.add((char *)"IE - pgwBackOffTime:"); |
| 2177 | stream.endOfLine(); |
| 2178 | EpcTimerIe epcTimer= |
| 2179 | dynamic_cast< |
| 2180 | EpcTimerIe&>(GtpV2IeFactory::getInstance().getIeObject(EpcTimerIeType)); |
| 2181 | epcTimer.displayEpcTimerIe_v(data.pgwBackOffTime, stream); |
| 2182 | |
| 2183 | } |
| 2184 | if (data.hNbInformationReportingIePresent) |
| 2185 | { |
| 2186 | |
| 2187 | |
| 2188 | stream.add((char *)"IE - hNbInformationReporting:"); |
| 2189 | stream.endOfLine(); |
| 2190 | HenbInformationReportingIe henbInformationReporting= |
| 2191 | dynamic_cast< |
| 2192 | HenbInformationReportingIe&>(GtpV2IeFactory::getInstance().getIeObject(HenbInformationReportingIeType)); |
| 2193 | henbInformationReporting.displayHenbInformationReportingIe_v(data.hNbInformationReporting, stream); |
| 2194 | |
| 2195 | } |
| 2196 | if (data.pgwS5S8S2bFTeidIePresent) |
| 2197 | { |
| 2198 | |
| 2199 | |
| 2200 | stream.add((char *)"IE - pgwS5S8S2bFTeid:"); |
| 2201 | stream.endOfLine(); |
| 2202 | FTeidIe fTeid= |
| 2203 | dynamic_cast< |
| 2204 | FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType)); |
| 2205 | fTeid.displayFTeidIe_v(data.pgwS5S8S2bFTeid, stream); |
| 2206 | |
| 2207 | } |
| 2208 | if (data.pdnAddressAllocationIePresent) |
| 2209 | { |
| 2210 | |
| 2211 | |
| 2212 | stream.add((char *)"IE - pdnAddressAllocation:"); |
| 2213 | stream.endOfLine(); |
| 2214 | PaaIe paa= |
| 2215 | dynamic_cast< |
| 2216 | PaaIe&>(GtpV2IeFactory::getInstance().getIeObject(PaaIeType)); |
| 2217 | paa.displayPaaIe_v(data.pdnAddressAllocation, stream); |
| 2218 | |
| 2219 | } |
| 2220 | if (data.protocolConfigurationOptionsIePresent) |
| 2221 | { |
| 2222 | |
| 2223 | |
| 2224 | stream.add((char *)"IE - protocolConfigurationOptions:"); |
| 2225 | stream.endOfLine(); |
| 2226 | PcoIe pco= |
| 2227 | dynamic_cast< |
| 2228 | PcoIe&>(GtpV2IeFactory::getInstance().getIeObject(PcoIeType)); |
| 2229 | pco.displayPcoIe_v(data.protocolConfigurationOptions, stream); |
| 2230 | |
| 2231 | } |
| 2232 | if (data.additionalProtocolConfigurationOptionsIePresent) |
| 2233 | { |
| 2234 | |
| 2235 | |
| 2236 | stream.add((char *)"IE - additionalProtocolConfigurationOptions:"); |
| 2237 | stream.endOfLine(); |
| 2238 | AdditionalProtocolConfigurationOptionsIe additionalProtocolConfigurationOptions= |
| 2239 | dynamic_cast< |
| 2240 | AdditionalProtocolConfigurationOptionsIe&>(GtpV2IeFactory::getInstance().getIeObject(AdditionalProtocolConfigurationOptionsIeType)); |
| 2241 | additionalProtocolConfigurationOptions.displayAdditionalProtocolConfigurationOptionsIe_v(data.additionalProtocolConfigurationOptions, stream); |
| 2242 | |
| 2243 | } |
| 2244 | if (data.trustedWlanIpv4ParametersIePresent) |
| 2245 | { |
| 2246 | |
| 2247 | |
| 2248 | stream.add((char *)"IE - trustedWlanIpv4Parameters:"); |
| 2249 | stream.endOfLine(); |
| 2250 | Ip4cpIe ip4cp= |
| 2251 | dynamic_cast< |
| 2252 | Ip4cpIe&>(GtpV2IeFactory::getInstance().getIeObject(Ip4cpIeType)); |
| 2253 | ip4cp.displayIp4cpIe_v(data.trustedWlanIpv4Parameters, stream); |
| 2254 | |
| 2255 | } |
| 2256 | if (data.indicationFlagsIePresent) |
| 2257 | { |
| 2258 | |
| 2259 | |
| 2260 | stream.add((char *)"IE - indicationFlags:"); |
| 2261 | stream.endOfLine(); |
| 2262 | IndicationIe indication= |
| 2263 | dynamic_cast< |
| 2264 | IndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(IndicationIeType)); |
| 2265 | indication.displayIndicationIe_v(data.indicationFlags, stream); |
| 2266 | |
| 2267 | } |
| 2268 | if (data.presenceReportingAreaActionIePresent) |
| 2269 | { |
| 2270 | |
| 2271 | |
| 2272 | stream.add((char *)"IE - presenceReportingAreaAction:"); |
| 2273 | stream.endOfLine(); |
| 2274 | PresenceReportingAreaActionIe presenceReportingAreaAction= |
| 2275 | dynamic_cast< |
| 2276 | PresenceReportingAreaActionIe&>(GtpV2IeFactory::getInstance().getIeObject(PresenceReportingAreaActionIeType)); |
| 2277 | presenceReportingAreaAction.displayPresenceReportingAreaActionIe_v(data.presenceReportingAreaAction, stream); |
| 2278 | |
| 2279 | } |
| 2280 | if (data.pgwsNodeLevelLoadControlInformationIePresent) |
| 2281 | { |
| 2282 | |
| 2283 | |
| 2284 | stream.add((char *)"IE - pgwsNodeLevelLoadControlInformation:"); |
| 2285 | stream.endOfLine(); |
| 2286 | LoadControlInformationIe loadControlInformation= |
| 2287 | dynamic_cast< |
| 2288 | LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType)); |
| 2289 | PgwsNodeLevelLoadControlInformationInCreateSessionResponse groupedIeInstance = |
| 2290 | dynamic_cast< |
| 2291 | PgwsNodeLevelLoadControlInformationInCreateSessionResponse&>(loadControlInformation.getGroupedIe(msgType, 0)); |
| 2292 | groupedIeInstance.displayPgwsNodeLevelLoadControlInformationInCreateSessionResponseData_v(data.pgwsNodeLevelLoadControlInformation, stream); |
| 2293 | |
| 2294 | } |
| 2295 | if (data.pgwsApnLevelLoadControlInformationIePresent) |
| 2296 | { |
| 2297 | |
| 2298 | |
| 2299 | stream.add((char *)"IE - pgwsApnLevelLoadControlInformation:"); |
| 2300 | stream.endOfLine(); |
| 2301 | LoadControlInformationIe loadControlInformation= |
| 2302 | dynamic_cast< |
| 2303 | LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType)); |
| 2304 | PgwsApnLevelLoadControlInformationInCreateSessionResponse groupedIeInstance = |
| 2305 | dynamic_cast< |
| 2306 | PgwsApnLevelLoadControlInformationInCreateSessionResponse&>(loadControlInformation.getGroupedIe(msgType, 1)); |
| 2307 | groupedIeInstance.displayPgwsApnLevelLoadControlInformationInCreateSessionResponseData_v(data.pgwsApnLevelLoadControlInformation, stream); |
| 2308 | |
| 2309 | } |
| 2310 | if (data.sgwsNodeLevelLoadControlInformationIePresent) |
| 2311 | { |
| 2312 | |
| 2313 | |
| 2314 | stream.add((char *)"IE - sgwsNodeLevelLoadControlInformation:"); |
| 2315 | stream.endOfLine(); |
| 2316 | LoadControlInformationIe loadControlInformation= |
| 2317 | dynamic_cast< |
| 2318 | LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType)); |
| 2319 | SgwsNodeLevelLoadControlInformationInCreateSessionResponse groupedIeInstance = |
| 2320 | dynamic_cast< |
| 2321 | SgwsNodeLevelLoadControlInformationInCreateSessionResponse&>(loadControlInformation.getGroupedIe(msgType, 2)); |
| 2322 | groupedIeInstance.displaySgwsNodeLevelLoadControlInformationInCreateSessionResponseData_v(data.sgwsNodeLevelLoadControlInformation, stream); |
| 2323 | |
| 2324 | } |
| 2325 | if (data.pgwsOverloadControlInformationIePresent) |
| 2326 | { |
| 2327 | |
| 2328 | |
| 2329 | stream.add((char *)"IE - pgwsOverloadControlInformation:"); |
| 2330 | stream.endOfLine(); |
| 2331 | OverloadControlInformationIe overloadControlInformation= |
| 2332 | dynamic_cast< |
| 2333 | OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType)); |
| 2334 | PgwsOverloadControlInformationInCreateSessionResponse groupedIeInstance = |
| 2335 | dynamic_cast< |
| 2336 | PgwsOverloadControlInformationInCreateSessionResponse&>(overloadControlInformation.getGroupedIe(msgType, 0)); |
| 2337 | groupedIeInstance.displayPgwsOverloadControlInformationInCreateSessionResponseData_v(data.pgwsOverloadControlInformation, stream); |
| 2338 | |
| 2339 | } |
| 2340 | if (data.sgwsOverloadControlInformationIePresent) |
| 2341 | { |
| 2342 | |
| 2343 | |
| 2344 | stream.add((char *)"IE - sgwsOverloadControlInformation:"); |
| 2345 | stream.endOfLine(); |
| 2346 | OverloadControlInformationIe overloadControlInformation= |
| 2347 | dynamic_cast< |
| 2348 | OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType)); |
| 2349 | SgwsOverloadControlInformationInCreateSessionResponse groupedIeInstance = |
| 2350 | dynamic_cast< |
| 2351 | SgwsOverloadControlInformationInCreateSessionResponse&>(overloadControlInformation.getGroupedIe(msgType, 1)); |
| 2352 | groupedIeInstance.displaySgwsOverloadControlInformationInCreateSessionResponseData_v(data.sgwsOverloadControlInformation, stream); |
| 2353 | |
| 2354 | } |
| 2355 | if (data.nbifomContainerIePresent) |
| 2356 | { |
| 2357 | |
| 2358 | |
| 2359 | stream.add((char *)"IE - nbifomContainer:"); |
| 2360 | stream.endOfLine(); |
| 2361 | FContainerIe fContainer= |
| 2362 | dynamic_cast< |
| 2363 | FContainerIe&>(GtpV2IeFactory::getInstance().getIeObject(FContainerIeType)); |
| 2364 | fContainer.displayFContainerIe_v(data.nbifomContainer, stream); |
| 2365 | |
| 2366 | } |
| 2367 | if (data.pdnConnectionChargingIdIePresent) |
| 2368 | { |
| 2369 | |
| 2370 | |
| 2371 | stream.add((char *)"IE - pdnConnectionChargingId:"); |
| 2372 | stream.endOfLine(); |
| 2373 | ChargingIdIe chargingId= |
| 2374 | dynamic_cast< |
| 2375 | ChargingIdIe&>(GtpV2IeFactory::getInstance().getIeObject(ChargingIdIeType)); |
| 2376 | chargingId.displayChargingIdIe_v(data.pdnConnectionChargingId, stream); |
| 2377 | |
| 2378 | } |
| 2379 | if (data.extendedProtocolConfigurationOptionsIePresent) |
| 2380 | { |
| 2381 | |
| 2382 | |
| 2383 | stream.add((char *)"IE - extendedProtocolConfigurationOptions:"); |
| 2384 | stream.endOfLine(); |
| 2385 | EpcoIe epco= |
| 2386 | dynamic_cast< |
| 2387 | EpcoIe&>(GtpV2IeFactory::getInstance().getIeObject(EpcoIeType)); |
| 2388 | epco.displayEpcoIe_v(data.extendedProtocolConfigurationOptions, stream); |
| 2389 | |
| 2390 | } |
| 2391 | |
| 2392 | stream.decrIndent(); |
| 2393 | stream.decrIndent(); |
| 2394 | } |
| 2395 | |
| 2396 | |