blob: 943558abea2599c3e924e99db76e3e4a46585003 [file] [log] [blame]
anjana_sreekumar@infosys.com991c2062020-01-08 11:42:57 +05301/*
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 "createSessionRequestMsg.h"
16#include "../ieClasses/manual/gtpV2Ie.h"
17#include "../ieClasses/gtpV2IeFactory.h"
18#include "../ieClasses/imsiIe.h"
19#include "../ieClasses/msisdnIe.h"
20#include "../ieClasses/meiIe.h"
21#include "../ieClasses/uliIe.h"
22#include "../ieClasses/servingNetworkIe.h"
23#include "../ieClasses/ratTypeIe.h"
24#include "../ieClasses/indicationIe.h"
25#include "../ieClasses/fTeidIe.h"
26#include "../ieClasses/fTeidIe.h"
27#include "../ieClasses/apnIe.h"
28#include "../ieClasses/selectionModeIe.h"
29#include "../ieClasses/pdnTypeIe.h"
30#include "../ieClasses/paaIe.h"
31#include "../ieClasses/apnRestrictionIe.h"
32#include "../ieClasses/ambrIe.h"
33#include "../ieClasses/ebiIe.h"
34#include "../ieClasses/twmiIe.h"
35#include "../ieClasses/pcoIe.h"
36#include "../ieClasses/bearerContextIe.h"
37#include "../ieClasses/bearerContextsToBeCreatedInCreateSessionRequest.h"
38#include "../ieClasses/bearerContextIe.h"
39#include "../ieClasses/bearerContextsToBeRemovedInCreateSessionRequest.h"
40#include "../ieClasses/traceInformationIe.h"
41#include "../ieClasses/recoveryIe.h"
42#include "../ieClasses/fqCsidIe.h"
43#include "../ieClasses/fqCsidIe.h"
44#include "../ieClasses/fqCsidIe.h"
45#include "../ieClasses/fqCsidIe.h"
46#include "../ieClasses/ueTimeZoneIe.h"
47#include "../ieClasses/uciIe.h"
48#include "../ieClasses/chargingCharacteristicsIe.h"
49#include "../ieClasses/localDistinguishedNameIe.h"
50#include "../ieClasses/localDistinguishedNameIe.h"
51#include "../ieClasses/localDistinguishedNameIe.h"
52#include "../ieClasses/localDistinguishedNameIe.h"
53#include "../ieClasses/signallingPriorityIndicationIe.h"
54#include "../ieClasses/ipAddressIe.h"
55#include "../ieClasses/portNumberIe.h"
56#include "../ieClasses/additionalProtocolConfigurationOptionsIe.h"
57#include "../ieClasses/ipAddressIe.h"
58#include "../ieClasses/portNumberIe.h"
59#include "../ieClasses/ipAddressIe.h"
60#include "../ieClasses/twanIdentifierIe.h"
61#include "../ieClasses/ipAddressIe.h"
62#include "../ieClasses/cnOperatorSelectionEntityIe.h"
63#include "../ieClasses/overloadControlInformationIe.h"
64#include "../ieClasses/mmeS4SgsnsOverloadControlInformationInCreateSessionRequest.h"
65#include "../ieClasses/overloadControlInformationIe.h"
66#include "../ieClasses/sgwsOverloadControlInformationInCreateSessionRequest.h"
67#include "../ieClasses/overloadControlInformationIe.h"
68#include "../ieClasses/twanEpdgsOverloadControlInformationInCreateSessionRequest.h"
69#include "../ieClasses/millisecondTimeStampIe.h"
70#include "../ieClasses/integerNumberIe.h"
71#include "../ieClasses/twanIdentifierIe.h"
72#include "../ieClasses/twanIdentifierTimestampIe.h"
73#include "../ieClasses/fContainerIe.h"
74#include "../ieClasses/remoteUeContextIe.h"
75#include "../ieClasses/remoteUeContextConnectedInCreateSessionRequest.h"
76#include "../ieClasses/nodeIdentifierIe.h"
77#include "../ieClasses/epcoIe.h"
78#include "../ieClasses/servingPlmnRateControlIe.h"
79#include "../ieClasses/counterIe.h"
80#include "../ieClasses/portNumberIe.h"
81#include "../ieClasses/mappedUeUsageTypeIe.h"
82#include "../ieClasses/uliIe.h"
83#include "../ieClasses/fqdnIe.h"
84#include "../ieClasses/secondaryRatUsageDataReportIe.h"
85#include "../ieClasses/upFunctionSelectionIndicationFlagsIe.h"
86
87CreateSessionRequestMsg::CreateSessionRequestMsg()
88{
89 msgType = CreateSessionRequestMsgType;
90 Uint16 mandIe;
91 mandIe = RatTypeIeType;
92 mandIe = (mandIe << 8) | 0; // ratType
93 mandatoryIeSet.insert(mandIe); mandIe = FTeidIeType;
94 mandIe = (mandIe << 8) | 0; // senderFTeidForControlPlane
95 mandatoryIeSet.insert(mandIe); mandIe = ApnIeType;
96 mandIe = (mandIe << 8) | 0; // accessPointName
97 mandatoryIeSet.insert(mandIe); mandIe = BearerContextIeType;
98 mandIe = (mandIe << 8) | 0; // bearerContextsToBeCreated
99 mandatoryIeSet.insert(mandIe);
100}
101
102CreateSessionRequestMsg::~CreateSessionRequestMsg()
103{
104
105}
106
107bool CreateSessionRequestMsg::encodeCreateSessionRequestMsg(MsgBuffer &buffer,
108 CreateSessionRequestMsgData
109 const &data)
110{
111 bool rc = false;
112 GtpV2IeHeader header;
113 Uint16 startIndex = 0;
114 Uint16 endIndex = 0;
115 Uint16 length = 0;
116
117 if (data.imsiIePresent)
118 {
119
120 // Encode the Ie Header
121 header.ieType = ImsiIeType;
122 header.instance = 0;
123 header.length = 0; // We will encode the IE first and then update the length
124 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
125 startIndex = buffer.getCurrentIndex();
126 ImsiIe imsi=
127 dynamic_cast<
128 ImsiIe&>(GtpV2IeFactory::getInstance().getIeObject(ImsiIeType));
129 rc = imsi.encodeImsiIe(buffer, data.imsi);
130 endIndex = buffer.getCurrentIndex();
131 length = endIndex - startIndex;
132
133 // encode the length value now
134 buffer.goToIndex(startIndex - 3);
135 buffer.writeUint16(length, false);
136 buffer.goToIndex(endIndex);
137
138 if (!(rc))
139 {
140 errorStream.add((char *)"Failed to encode IE: imsi\n");
141 return false;
142 }
143 }
144
145 if (data.msisdnIePresent)
146 {
147
148 // Encode the Ie Header
149 header.ieType = MsisdnIeType;
150 header.instance = 0;
151 header.length = 0; // We will encode the IE first and then update the length
152 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
153 startIndex = buffer.getCurrentIndex();
154 MsisdnIe msisdn=
155 dynamic_cast<
156 MsisdnIe&>(GtpV2IeFactory::getInstance().getIeObject(MsisdnIeType));
157 rc = msisdn.encodeMsisdnIe(buffer, data.msisdn);
158 endIndex = buffer.getCurrentIndex();
159 length = endIndex - startIndex;
160
161 // encode the length value now
162 buffer.goToIndex(startIndex - 3);
163 buffer.writeUint16(length, false);
164 buffer.goToIndex(endIndex);
165
166 if (!(rc))
167 {
168 errorStream.add((char *)"Failed to encode IE: msisdn\n");
169 return false;
170 }
171 }
172
173 if (data.meIdentityIePresent)
174 {
175
176 // Encode the Ie Header
177 header.ieType = MeiIeType;
178 header.instance = 0;
179 header.length = 0; // We will encode the IE first and then update the length
180 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
181 startIndex = buffer.getCurrentIndex();
182 MeiIe mei=
183 dynamic_cast<
184 MeiIe&>(GtpV2IeFactory::getInstance().getIeObject(MeiIeType));
185 rc = mei.encodeMeiIe(buffer, data.meIdentity);
186 endIndex = buffer.getCurrentIndex();
187 length = endIndex - startIndex;
188
189 // encode the length value now
190 buffer.goToIndex(startIndex - 3);
191 buffer.writeUint16(length, false);
192 buffer.goToIndex(endIndex);
193
194 if (!(rc))
195 {
196 errorStream.add((char *)"Failed to encode IE: meIdentity\n");
197 return false;
198 }
199 }
200
201 if (data.userLocationInformationIePresent)
202 {
203
204 // Encode the Ie Header
205 header.ieType = UliIeType;
206 header.instance = 0;
207 header.length = 0; // We will encode the IE first and then update the length
208 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
209 startIndex = buffer.getCurrentIndex();
210 UliIe uli=
211 dynamic_cast<
212 UliIe&>(GtpV2IeFactory::getInstance().getIeObject(UliIeType));
213 rc = uli.encodeUliIe(buffer, data.userLocationInformation);
214 endIndex = buffer.getCurrentIndex();
215 length = endIndex - startIndex;
216
217 // encode the length value now
218 buffer.goToIndex(startIndex - 3);
219 buffer.writeUint16(length, false);
220 buffer.goToIndex(endIndex);
221
222 if (!(rc))
223 {
224 errorStream.add((char *)"Failed to encode IE: userLocationInformation\n");
225 return false;
226 }
227 }
228
229 if (data.servingNetworkIePresent)
230 {
231
232 // Encode the Ie Header
233 header.ieType = ServingNetworkIeType;
234 header.instance = 0;
235 header.length = 0; // We will encode the IE first and then update the length
236 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
237 startIndex = buffer.getCurrentIndex();
238 ServingNetworkIe servingNetwork=
239 dynamic_cast<
240 ServingNetworkIe&>(GtpV2IeFactory::getInstance().getIeObject(ServingNetworkIeType));
241 rc = servingNetwork.encodeServingNetworkIe(buffer, data.servingNetwork);
242 endIndex = buffer.getCurrentIndex();
243 length = endIndex - startIndex;
244
245 // encode the length value now
246 buffer.goToIndex(startIndex - 3);
247 buffer.writeUint16(length, false);
248 buffer.goToIndex(endIndex);
249
250 if (!(rc))
251 {
252 errorStream.add((char *)"Failed to encode IE: servingNetwork\n");
253 return false;
254 }
255 }
256
257
258 // Encode the Ie Header
259 header.ieType = RatTypeIeType;
260 header.instance = 0;
261 header.length = 0; // We will encode the IE first and then update the length
262 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
263 startIndex = buffer.getCurrentIndex();
264 RatTypeIe ratType=
265 dynamic_cast<
266 RatTypeIe&>(GtpV2IeFactory::getInstance().getIeObject(RatTypeIeType));
267 rc = ratType.encodeRatTypeIe(buffer, data.ratType);
268 endIndex = buffer.getCurrentIndex();
269 length = endIndex - startIndex;
270
271 // encode the length value now
272 buffer.goToIndex(startIndex - 3);
273 buffer.writeUint16(length, false);
274 buffer.goToIndex(endIndex);
275
276 if (!(rc))
277 {
278 errorStream.add((char *)"Failed to encode IE: ratType\n");
279 return false;
280 }
281
282 if (data.indicationFlagsIePresent)
283 {
284
285 // Encode the Ie Header
286 header.ieType = IndicationIeType;
287 header.instance = 0;
288 header.length = 0; // We will encode the IE first and then update the length
289 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
290 startIndex = buffer.getCurrentIndex();
291 IndicationIe indication=
292 dynamic_cast<
293 IndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(IndicationIeType));
294 rc = indication.encodeIndicationIe(buffer, data.indicationFlags);
295 endIndex = buffer.getCurrentIndex();
296 length = endIndex - startIndex;
297
298 // encode the length value now
299 buffer.goToIndex(startIndex - 3);
300 buffer.writeUint16(length, false);
301 buffer.goToIndex(endIndex);
302
303 if (!(rc))
304 {
305 errorStream.add((char *)"Failed to encode IE: indicationFlags\n");
306 return false;
307 }
308 }
309
310
311 // Encode the Ie Header
312 header.ieType = FTeidIeType;
313 header.instance = 0;
314 header.length = 0; // We will encode the IE first and then update the length
315 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
316 startIndex = buffer.getCurrentIndex();
317 FTeidIe fTeid=
318 dynamic_cast<
319 FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
320 rc = fTeid.encodeFTeidIe(buffer, data.senderFTeidForControlPlane);
321 endIndex = buffer.getCurrentIndex();
322 length = endIndex - startIndex;
323
324 // encode the length value now
325 buffer.goToIndex(startIndex - 3);
326 buffer.writeUint16(length, false);
327 buffer.goToIndex(endIndex);
328
329 if (!(rc))
330 {
331 errorStream.add((char *)"Failed to encode IE: senderFTeidForControlPlane\n");
332 return false;
333 }
334
335 if (data.pgwS5S8AddressForControlPlaneOrPmipIePresent)
336 {
337
338 // Encode the Ie Header
339 header.ieType = FTeidIeType;
340 header.instance = 1;
341 header.length = 0; // We will encode the IE first and then update the length
342 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
343 startIndex = buffer.getCurrentIndex();
344 FTeidIe fTeid=
345 dynamic_cast<
346 FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
347 rc = fTeid.encodeFTeidIe(buffer, data.pgwS5S8AddressForControlPlaneOrPmip);
348 endIndex = buffer.getCurrentIndex();
349 length = endIndex - startIndex;
350
351 // encode the length value now
352 buffer.goToIndex(startIndex - 3);
353 buffer.writeUint16(length, false);
354 buffer.goToIndex(endIndex);
355
356 if (!(rc))
357 {
358 errorStream.add((char *)"Failed to encode IE: pgwS5S8AddressForControlPlaneOrPmip\n");
359 return false;
360 }
361 }
362
363
364 // Encode the Ie Header
365 header.ieType = ApnIeType;
366 header.instance = 0;
367 header.length = 0; // We will encode the IE first and then update the length
368 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
369 startIndex = buffer.getCurrentIndex();
370 ApnIe apn=
371 dynamic_cast<
372 ApnIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnIeType));
373 rc = apn.encodeApnIe(buffer, data.accessPointName);
374 endIndex = buffer.getCurrentIndex();
375 length = endIndex - startIndex;
376
377 // encode the length value now
378 buffer.goToIndex(startIndex - 3);
379 buffer.writeUint16(length, false);
380 buffer.goToIndex(endIndex);
381
382 if (!(rc))
383 {
384 errorStream.add((char *)"Failed to encode IE: accessPointName\n");
385 return false;
386 }
387
388 if (data.selectionModeIePresent)
389 {
390
391 // Encode the Ie Header
392 header.ieType = SelectionModeIeType;
393 header.instance = 0;
394 header.length = 0; // We will encode the IE first and then update the length
395 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
396 startIndex = buffer.getCurrentIndex();
397 SelectionModeIe selectionMode=
398 dynamic_cast<
399 SelectionModeIe&>(GtpV2IeFactory::getInstance().getIeObject(SelectionModeIeType));
400 rc = selectionMode.encodeSelectionModeIe(buffer, data.selectionMode);
401 endIndex = buffer.getCurrentIndex();
402 length = endIndex - startIndex;
403
404 // encode the length value now
405 buffer.goToIndex(startIndex - 3);
406 buffer.writeUint16(length, false);
407 buffer.goToIndex(endIndex);
408
409 if (!(rc))
410 {
411 errorStream.add((char *)"Failed to encode IE: selectionMode\n");
412 return false;
413 }
414 }
415
416 if (data.pdnTypeIePresent)
417 {
418
419 // Encode the Ie Header
420 header.ieType = PdnTypeIeType;
421 header.instance = 0;
422 header.length = 0; // We will encode the IE first and then update the length
423 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
424 startIndex = buffer.getCurrentIndex();
425 PdnTypeIe pdnType=
426 dynamic_cast<
427 PdnTypeIe&>(GtpV2IeFactory::getInstance().getIeObject(PdnTypeIeType));
428 rc = pdnType.encodePdnTypeIe(buffer, data.pdnType);
429 endIndex = buffer.getCurrentIndex();
430 length = endIndex - startIndex;
431
432 // encode the length value now
433 buffer.goToIndex(startIndex - 3);
434 buffer.writeUint16(length, false);
435 buffer.goToIndex(endIndex);
436
437 if (!(rc))
438 {
439 errorStream.add((char *)"Failed to encode IE: pdnType\n");
440 return false;
441 }
442 }
443
444 if (data.pdnAddressAllocationIePresent)
445 {
446
447 // Encode the Ie Header
448 header.ieType = PaaIeType;
449 header.instance = 0;
450 header.length = 0; // We will encode the IE first and then update the length
451 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
452 startIndex = buffer.getCurrentIndex();
453 PaaIe paa=
454 dynamic_cast<
455 PaaIe&>(GtpV2IeFactory::getInstance().getIeObject(PaaIeType));
456 rc = paa.encodePaaIe(buffer, data.pdnAddressAllocation);
457 endIndex = buffer.getCurrentIndex();
458 length = endIndex - startIndex;
459
460 // encode the length value now
461 buffer.goToIndex(startIndex - 3);
462 buffer.writeUint16(length, false);
463 buffer.goToIndex(endIndex);
464
465 if (!(rc))
466 {
467 errorStream.add((char *)"Failed to encode IE: pdnAddressAllocation\n");
468 return false;
469 }
470 }
471
472 if (data.maximumApnRestrictionIePresent)
473 {
474
475 // Encode the Ie Header
476 header.ieType = ApnRestrictionIeType;
477 header.instance = 0;
478 header.length = 0; // We will encode the IE first and then update the length
479 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
480 startIndex = buffer.getCurrentIndex();
481 ApnRestrictionIe apnRestriction=
482 dynamic_cast<
483 ApnRestrictionIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnRestrictionIeType));
484 rc = apnRestriction.encodeApnRestrictionIe(buffer, data.maximumApnRestriction);
485 endIndex = buffer.getCurrentIndex();
486 length = endIndex - startIndex;
487
488 // encode the length value now
489 buffer.goToIndex(startIndex - 3);
490 buffer.writeUint16(length, false);
491 buffer.goToIndex(endIndex);
492
493 if (!(rc))
494 {
495 errorStream.add((char *)"Failed to encode IE: maximumApnRestriction\n");
496 return false;
497 }
498 }
499
500 if (data.aggregateMaximumBitRateIePresent)
501 {
502
503 // Encode the Ie Header
504 header.ieType = AmbrIeType;
505 header.instance = 0;
506 header.length = 0; // We will encode the IE first and then update the length
507 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
508 startIndex = buffer.getCurrentIndex();
509 AmbrIe ambr=
510 dynamic_cast<
511 AmbrIe&>(GtpV2IeFactory::getInstance().getIeObject(AmbrIeType));
512 rc = ambr.encodeAmbrIe(buffer, data.aggregateMaximumBitRate);
513 endIndex = buffer.getCurrentIndex();
514 length = endIndex - startIndex;
515
516 // encode the length value now
517 buffer.goToIndex(startIndex - 3);
518 buffer.writeUint16(length, false);
519 buffer.goToIndex(endIndex);
520
521 if (!(rc))
522 {
523 errorStream.add((char *)"Failed to encode IE: aggregateMaximumBitRate\n");
524 return false;
525 }
526 }
527
528 if (data.linkedEpsBearerIdIePresent)
529 {
530
531 // Encode the Ie Header
532 header.ieType = EbiIeType;
533 header.instance = 0;
534 header.length = 0; // We will encode the IE first and then update the length
535 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
536 startIndex = buffer.getCurrentIndex();
537 EbiIe ebi=
538 dynamic_cast<
539 EbiIe&>(GtpV2IeFactory::getInstance().getIeObject(EbiIeType));
540 rc = ebi.encodeEbiIe(buffer, data.linkedEpsBearerId);
541 endIndex = buffer.getCurrentIndex();
542 length = endIndex - startIndex;
543
544 // encode the length value now
545 buffer.goToIndex(startIndex - 3);
546 buffer.writeUint16(length, false);
547 buffer.goToIndex(endIndex);
548
549 if (!(rc))
550 {
551 errorStream.add((char *)"Failed to encode IE: linkedEpsBearerId\n");
552 return false;
553 }
554 }
555
556 if (data.trustedWlanModeIndicationIePresent)
557 {
558
559 // Encode the Ie Header
560 header.ieType = TwmiIeType;
561 header.instance = 0;
562 header.length = 0; // We will encode the IE first and then update the length
563 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
564 startIndex = buffer.getCurrentIndex();
565 TwmiIe twmi=
566 dynamic_cast<
567 TwmiIe&>(GtpV2IeFactory::getInstance().getIeObject(TwmiIeType));
568 rc = twmi.encodeTwmiIe(buffer, data.trustedWlanModeIndication);
569 endIndex = buffer.getCurrentIndex();
570 length = endIndex - startIndex;
571
572 // encode the length value now
573 buffer.goToIndex(startIndex - 3);
574 buffer.writeUint16(length, false);
575 buffer.goToIndex(endIndex);
576
577 if (!(rc))
578 {
579 errorStream.add((char *)"Failed to encode IE: trustedWlanModeIndication\n");
580 return false;
581 }
582 }
583
584 if (data.protocolConfigurationOptionsIePresent)
585 {
586
587 // Encode the Ie Header
588 header.ieType = PcoIeType;
589 header.instance = 0;
590 header.length = 0; // We will encode the IE first and then update the length
591 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
592 startIndex = buffer.getCurrentIndex();
593 PcoIe pco=
594 dynamic_cast<
595 PcoIe&>(GtpV2IeFactory::getInstance().getIeObject(PcoIeType));
596 rc = pco.encodePcoIe(buffer, data.protocolConfigurationOptions);
597 endIndex = buffer.getCurrentIndex();
598 length = endIndex - startIndex;
599
600 // encode the length value now
601 buffer.goToIndex(startIndex - 3);
602 buffer.writeUint16(length, false);
603 buffer.goToIndex(endIndex);
604
605 if (!(rc))
606 {
607 errorStream.add((char *)"Failed to encode IE: protocolConfigurationOptions\n");
608 return false;
609 }
610 }
611
612 // First validate if the applicatoin provided more than the expected cardinality
613 if (data.bearerContextsToBeCreatedCount > 11)
614 {
615 errorStream.add((char *)"Number of entries of bearerContextsToBeCreated exceeded\n");
616 errorStream.add((char *)"Expected count: 11 Received count: ");
617 errorStream.add((char *)"data.bearerContextsToBeCreatedCount");
618 errorStream.endOfLine();
619 return false;
620 }
621 for (Uint8 i = 0; i < data.bearerContextsToBeCreatedCount; i++)
622 {
623 // Encode the Ie Header
624 header.ieType = BearerContextIeType;
625 header.instance = 0;
626 header.length = 0; // We will encode the IE first and then update the length
627 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
628 startIndex = buffer.getCurrentIndex();
629 BearerContextIe bearerContext=
630 dynamic_cast<
631 BearerContextIe&>(GtpV2IeFactory::getInstance().
632 getIeObject(BearerContextIeType));
633 BearerContextsToBeCreatedInCreateSessionRequest groupedIeInstance = dynamic_cast<BearerContextsToBeCreatedInCreateSessionRequest&>(bearerContext.getGroupedIe(msgType, 0));
634 rc = groupedIeInstance.encodeBearerContextsToBeCreatedInCreateSessionRequest(buffer, data.bearerContextsToBeCreated[i]);
635 endIndex = buffer.getCurrentIndex();
636 length = endIndex - startIndex;
637
638 // encode the length value now
639 buffer.goToIndex(startIndex - 3);
640 buffer.writeUint16(length, false);
641 buffer.goToIndex(endIndex);
642 }
643
644 if (!(rc))
645 {
646 errorStream.add((char *)"Failed to encode IE: bearerContextsToBeCreated\n");
647 return false;
648 }
649
650 // First validate if the applicatoin provided more than the expected cardinality
651 if (data.bearerContextsToBeRemovedCount > 11)
652 {
653 errorStream.add((char *)"Number of entries of bearerContextsToBeRemoved exceeded\n");
654 errorStream.add((char *)"Expected count: 11 Received count: ");
655 errorStream.add((char *)"data.bearerContextsToBeRemovedCount");
656 errorStream.endOfLine();
657 return false;
658 }
659 for (Uint8 i = 0; i < data.bearerContextsToBeRemovedCount; i++)
660 {
661 // Encode the Ie Header
662 header.ieType = BearerContextIeType;
663 header.instance = 1;
664 header.length = 0; // We will encode the IE first and then update the length
665 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
666 startIndex = buffer.getCurrentIndex();
667 BearerContextIe bearerContext=
668 dynamic_cast<
669 BearerContextIe&>(GtpV2IeFactory::getInstance().
670 getIeObject(BearerContextIeType));
671 BearerContextsToBeRemovedInCreateSessionRequest groupedIeInstance = dynamic_cast<BearerContextsToBeRemovedInCreateSessionRequest&>(bearerContext.getGroupedIe(msgType, 1));
672 rc = groupedIeInstance.encodeBearerContextsToBeRemovedInCreateSessionRequest(buffer, data.bearerContextsToBeRemoved[i]);
673 endIndex = buffer.getCurrentIndex();
674 length = endIndex - startIndex;
675
676 // encode the length value now
677 buffer.goToIndex(startIndex - 3);
678 buffer.writeUint16(length, false);
679 buffer.goToIndex(endIndex);
680 }
681
682 if (!(rc))
683 {
684 errorStream.add((char *)"Failed to encode IE: bearerContextsToBeRemoved\n");
685 return false;
686 }
687
688 if (data.traceInformationIePresent)
689 {
690
691 // Encode the Ie Header
692 header.ieType = TraceInformationIeType;
693 header.instance = 0;
694 header.length = 0; // We will encode the IE first and then update the length
695 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
696 startIndex = buffer.getCurrentIndex();
697 TraceInformationIe traceInformation=
698 dynamic_cast<
699 TraceInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(TraceInformationIeType));
700 rc = traceInformation.encodeTraceInformationIe(buffer, data.traceInformation);
701 endIndex = buffer.getCurrentIndex();
702 length = endIndex - startIndex;
703
704 // encode the length value now
705 buffer.goToIndex(startIndex - 3);
706 buffer.writeUint16(length, false);
707 buffer.goToIndex(endIndex);
708
709 if (!(rc))
710 {
711 errorStream.add((char *)"Failed to encode IE: traceInformation\n");
712 return false;
713 }
714 }
715
716 if (data.recoveryIePresent)
717 {
718
719 // Encode the Ie Header
720 header.ieType = RecoveryIeType;
721 header.instance = 0;
722 header.length = 0; // We will encode the IE first and then update the length
723 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
724 startIndex = buffer.getCurrentIndex();
725 RecoveryIe recovery=
726 dynamic_cast<
727 RecoveryIe&>(GtpV2IeFactory::getInstance().getIeObject(RecoveryIeType));
728 rc = recovery.encodeRecoveryIe(buffer, data.recovery);
729 endIndex = buffer.getCurrentIndex();
730 length = endIndex - startIndex;
731
732 // encode the length value now
733 buffer.goToIndex(startIndex - 3);
734 buffer.writeUint16(length, false);
735 buffer.goToIndex(endIndex);
736
737 if (!(rc))
738 {
739 errorStream.add((char *)"Failed to encode IE: recovery\n");
740 return false;
741 }
742 }
743
744 if (data.mmeFqCsidIePresent)
745 {
746
747 // Encode the Ie Header
748 header.ieType = FqCsidIeType;
749 header.instance = 0;
750 header.length = 0; // We will encode the IE first and then update the length
751 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
752 startIndex = buffer.getCurrentIndex();
753 FqCsidIe fqCsid=
754 dynamic_cast<
755 FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
756 rc = fqCsid.encodeFqCsidIe(buffer, data.mmeFqCsid);
757 endIndex = buffer.getCurrentIndex();
758 length = endIndex - startIndex;
759
760 // encode the length value now
761 buffer.goToIndex(startIndex - 3);
762 buffer.writeUint16(length, false);
763 buffer.goToIndex(endIndex);
764
765 if (!(rc))
766 {
767 errorStream.add((char *)"Failed to encode IE: mmeFqCsid\n");
768 return false;
769 }
770 }
771
772 if (data.sgwFqCsidIePresent)
773 {
774
775 // Encode the Ie Header
776 header.ieType = FqCsidIeType;
777 header.instance = 1;
778 header.length = 0; // We will encode the IE first and then update the length
779 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
780 startIndex = buffer.getCurrentIndex();
781 FqCsidIe fqCsid=
782 dynamic_cast<
783 FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
784 rc = fqCsid.encodeFqCsidIe(buffer, data.sgwFqCsid);
785 endIndex = buffer.getCurrentIndex();
786 length = endIndex - startIndex;
787
788 // encode the length value now
789 buffer.goToIndex(startIndex - 3);
790 buffer.writeUint16(length, false);
791 buffer.goToIndex(endIndex);
792
793 if (!(rc))
794 {
795 errorStream.add((char *)"Failed to encode IE: sgwFqCsid\n");
796 return false;
797 }
798 }
799
800 if (data.epdgFqCsidIePresent)
801 {
802
803 // Encode the Ie Header
804 header.ieType = FqCsidIeType;
805 header.instance = 2;
806 header.length = 0; // We will encode the IE first and then update the length
807 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
808 startIndex = buffer.getCurrentIndex();
809 FqCsidIe fqCsid=
810 dynamic_cast<
811 FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
812 rc = fqCsid.encodeFqCsidIe(buffer, data.epdgFqCsid);
813 endIndex = buffer.getCurrentIndex();
814 length = endIndex - startIndex;
815
816 // encode the length value now
817 buffer.goToIndex(startIndex - 3);
818 buffer.writeUint16(length, false);
819 buffer.goToIndex(endIndex);
820
821 if (!(rc))
822 {
823 errorStream.add((char *)"Failed to encode IE: epdgFqCsid\n");
824 return false;
825 }
826 }
827
828 if (data.twanFqCsidIePresent)
829 {
830
831 // Encode the Ie Header
832 header.ieType = FqCsidIeType;
833 header.instance = 3;
834 header.length = 0; // We will encode the IE first and then update the length
835 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
836 startIndex = buffer.getCurrentIndex();
837 FqCsidIe fqCsid=
838 dynamic_cast<
839 FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
840 rc = fqCsid.encodeFqCsidIe(buffer, data.twanFqCsid);
841 endIndex = buffer.getCurrentIndex();
842 length = endIndex - startIndex;
843
844 // encode the length value now
845 buffer.goToIndex(startIndex - 3);
846 buffer.writeUint16(length, false);
847 buffer.goToIndex(endIndex);
848
849 if (!(rc))
850 {
851 errorStream.add((char *)"Failed to encode IE: twanFqCsid\n");
852 return false;
853 }
854 }
855
856 if (data.ueTimeZoneIePresent)
857 {
858
859 // Encode the Ie Header
860 header.ieType = UeTimeZoneIeType;
861 header.instance = 0;
862 header.length = 0; // We will encode the IE first and then update the length
863 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
864 startIndex = buffer.getCurrentIndex();
865 UeTimeZoneIe ueTimeZone=
866 dynamic_cast<
867 UeTimeZoneIe&>(GtpV2IeFactory::getInstance().getIeObject(UeTimeZoneIeType));
868 rc = ueTimeZone.encodeUeTimeZoneIe(buffer, data.ueTimeZone);
869 endIndex = buffer.getCurrentIndex();
870 length = endIndex - startIndex;
871
872 // encode the length value now
873 buffer.goToIndex(startIndex - 3);
874 buffer.writeUint16(length, false);
875 buffer.goToIndex(endIndex);
876
877 if (!(rc))
878 {
879 errorStream.add((char *)"Failed to encode IE: ueTimeZone\n");
880 return false;
881 }
882 }
883
884 if (data.userCsgInformationIePresent)
885 {
886
887 // Encode the Ie Header
888 header.ieType = UciIeType;
889 header.instance = 0;
890 header.length = 0; // We will encode the IE first and then update the length
891 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
892 startIndex = buffer.getCurrentIndex();
893 UciIe uci=
894 dynamic_cast<
895 UciIe&>(GtpV2IeFactory::getInstance().getIeObject(UciIeType));
896 rc = uci.encodeUciIe(buffer, data.userCsgInformation);
897 endIndex = buffer.getCurrentIndex();
898 length = endIndex - startIndex;
899
900 // encode the length value now
901 buffer.goToIndex(startIndex - 3);
902 buffer.writeUint16(length, false);
903 buffer.goToIndex(endIndex);
904
905 if (!(rc))
906 {
907 errorStream.add((char *)"Failed to encode IE: userCsgInformation\n");
908 return false;
909 }
910 }
911
912 if (data.chargingCharacteristicsIePresent)
913 {
914
915 // Encode the Ie Header
916 header.ieType = ChargingCharacteristicsIeType;
917 header.instance = 0;
918 header.length = 0; // We will encode the IE first and then update the length
919 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
920 startIndex = buffer.getCurrentIndex();
921 ChargingCharacteristicsIe chargingCharacteristics=
922 dynamic_cast<
923 ChargingCharacteristicsIe&>(GtpV2IeFactory::getInstance().getIeObject(ChargingCharacteristicsIeType));
924 rc = chargingCharacteristics.encodeChargingCharacteristicsIe(buffer, data.chargingCharacteristics);
925 endIndex = buffer.getCurrentIndex();
926 length = endIndex - startIndex;
927
928 // encode the length value now
929 buffer.goToIndex(startIndex - 3);
930 buffer.writeUint16(length, false);
931 buffer.goToIndex(endIndex);
932
933 if (!(rc))
934 {
935 errorStream.add((char *)"Failed to encode IE: chargingCharacteristics\n");
936 return false;
937 }
938 }
939
940 if (data.mmeS4SgsnLdnIePresent)
941 {
942
943 // Encode the Ie Header
944 header.ieType = LocalDistinguishedNameIeType;
945 header.instance = 0;
946 header.length = 0; // We will encode the IE first and then update the length
947 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
948 startIndex = buffer.getCurrentIndex();
949 LocalDistinguishedNameIe localDistinguishedName=
950 dynamic_cast<
951 LocalDistinguishedNameIe&>(GtpV2IeFactory::getInstance().getIeObject(LocalDistinguishedNameIeType));
952 rc = localDistinguishedName.encodeLocalDistinguishedNameIe(buffer, data.mmeS4SgsnLdn);
953 endIndex = buffer.getCurrentIndex();
954 length = endIndex - startIndex;
955
956 // encode the length value now
957 buffer.goToIndex(startIndex - 3);
958 buffer.writeUint16(length, false);
959 buffer.goToIndex(endIndex);
960
961 if (!(rc))
962 {
963 errorStream.add((char *)"Failed to encode IE: mmeS4SgsnLdn\n");
964 return false;
965 }
966 }
967
968 if (data.sgwLdnIePresent)
969 {
970
971 // Encode the Ie Header
972 header.ieType = LocalDistinguishedNameIeType;
973 header.instance = 1;
974 header.length = 0; // We will encode the IE first and then update the length
975 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
976 startIndex = buffer.getCurrentIndex();
977 LocalDistinguishedNameIe localDistinguishedName=
978 dynamic_cast<
979 LocalDistinguishedNameIe&>(GtpV2IeFactory::getInstance().getIeObject(LocalDistinguishedNameIeType));
980 rc = localDistinguishedName.encodeLocalDistinguishedNameIe(buffer, data.sgwLdn);
981 endIndex = buffer.getCurrentIndex();
982 length = endIndex - startIndex;
983
984 // encode the length value now
985 buffer.goToIndex(startIndex - 3);
986 buffer.writeUint16(length, false);
987 buffer.goToIndex(endIndex);
988
989 if (!(rc))
990 {
991 errorStream.add((char *)"Failed to encode IE: sgwLdn\n");
992 return false;
993 }
994 }
995
996 if (data.epdgLdnIePresent)
997 {
998
999 // Encode the Ie Header
1000 header.ieType = LocalDistinguishedNameIeType;
1001 header.instance = 2;
1002 header.length = 0; // We will encode the IE first and then update the length
1003 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
1004 startIndex = buffer.getCurrentIndex();
1005 LocalDistinguishedNameIe localDistinguishedName=
1006 dynamic_cast<
1007 LocalDistinguishedNameIe&>(GtpV2IeFactory::getInstance().getIeObject(LocalDistinguishedNameIeType));
1008 rc = localDistinguishedName.encodeLocalDistinguishedNameIe(buffer, data.epdgLdn);
1009 endIndex = buffer.getCurrentIndex();
1010 length = endIndex - startIndex;
1011
1012 // encode the length value now
1013 buffer.goToIndex(startIndex - 3);
1014 buffer.writeUint16(length, false);
1015 buffer.goToIndex(endIndex);
1016
1017 if (!(rc))
1018 {
1019 errorStream.add((char *)"Failed to encode IE: epdgLdn\n");
1020 return false;
1021 }
1022 }
1023
1024 if (data.twanLdnIePresent)
1025 {
1026
1027 // Encode the Ie Header
1028 header.ieType = LocalDistinguishedNameIeType;
1029 header.instance = 3;
1030 header.length = 0; // We will encode the IE first and then update the length
1031 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
1032 startIndex = buffer.getCurrentIndex();
1033 LocalDistinguishedNameIe localDistinguishedName=
1034 dynamic_cast<
1035 LocalDistinguishedNameIe&>(GtpV2IeFactory::getInstance().getIeObject(LocalDistinguishedNameIeType));
1036 rc = localDistinguishedName.encodeLocalDistinguishedNameIe(buffer, data.twanLdn);
1037 endIndex = buffer.getCurrentIndex();
1038 length = endIndex - startIndex;
1039
1040 // encode the length value now
1041 buffer.goToIndex(startIndex - 3);
1042 buffer.writeUint16(length, false);
1043 buffer.goToIndex(endIndex);
1044
1045 if (!(rc))
1046 {
1047 errorStream.add((char *)"Failed to encode IE: twanLdn\n");
1048 return false;
1049 }
1050 }
1051
1052 if (data.signallingPriorityIndicationIePresent)
1053 {
1054
1055 // Encode the Ie Header
1056 header.ieType = SignallingPriorityIndicationIeType;
1057 header.instance = 0;
1058 header.length = 0; // We will encode the IE first and then update the length
1059 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
1060 startIndex = buffer.getCurrentIndex();
1061 SignallingPriorityIndicationIe signallingPriorityIndication=
1062 dynamic_cast<
1063 SignallingPriorityIndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(SignallingPriorityIndicationIeType));
1064 rc = signallingPriorityIndication.encodeSignallingPriorityIndicationIe(buffer, data.signallingPriorityIndication);
1065 endIndex = buffer.getCurrentIndex();
1066 length = endIndex - startIndex;
1067
1068 // encode the length value now
1069 buffer.goToIndex(startIndex - 3);
1070 buffer.writeUint16(length, false);
1071 buffer.goToIndex(endIndex);
1072
1073 if (!(rc))
1074 {
1075 errorStream.add((char *)"Failed to encode IE: signallingPriorityIndication\n");
1076 return false;
1077 }
1078 }
1079
1080 if (data.ueLocalIpAddressIePresent)
1081 {
1082
1083 // Encode the Ie Header
1084 header.ieType = IpAddressIeType;
1085 header.instance = 0;
1086 header.length = 0; // We will encode the IE first and then update the length
1087 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
1088 startIndex = buffer.getCurrentIndex();
1089 IpAddressIe ipAddress=
1090 dynamic_cast<
1091 IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
1092 rc = ipAddress.encodeIpAddressIe(buffer, data.ueLocalIpAddress);
1093 endIndex = buffer.getCurrentIndex();
1094 length = endIndex - startIndex;
1095
1096 // encode the length value now
1097 buffer.goToIndex(startIndex - 3);
1098 buffer.writeUint16(length, false);
1099 buffer.goToIndex(endIndex);
1100
1101 if (!(rc))
1102 {
1103 errorStream.add((char *)"Failed to encode IE: ueLocalIpAddress\n");
1104 return false;
1105 }
1106 }
1107
1108 if (data.ueUdpPortIePresent)
1109 {
1110
1111 // Encode the Ie Header
1112 header.ieType = PortNumberIeType;
1113 header.instance = 0;
1114 header.length = 0; // We will encode the IE first and then update the length
1115 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
1116 startIndex = buffer.getCurrentIndex();
1117 PortNumberIe portNumber=
1118 dynamic_cast<
1119 PortNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(PortNumberIeType));
1120 rc = portNumber.encodePortNumberIe(buffer, data.ueUdpPort);
1121 endIndex = buffer.getCurrentIndex();
1122 length = endIndex - startIndex;
1123
1124 // encode the length value now
1125 buffer.goToIndex(startIndex - 3);
1126 buffer.writeUint16(length, false);
1127 buffer.goToIndex(endIndex);
1128
1129 if (!(rc))
1130 {
1131 errorStream.add((char *)"Failed to encode IE: ueUdpPort\n");
1132 return false;
1133 }
1134 }
1135
1136 if (data.additionalProtocolConfigurationOptionsIePresent)
1137 {
1138
1139 // Encode the Ie Header
1140 header.ieType = AdditionalProtocolConfigurationOptionsIeType;
1141 header.instance = 0;
1142 header.length = 0; // We will encode the IE first and then update the length
1143 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
1144 startIndex = buffer.getCurrentIndex();
1145 AdditionalProtocolConfigurationOptionsIe additionalProtocolConfigurationOptions=
1146 dynamic_cast<
1147 AdditionalProtocolConfigurationOptionsIe&>(GtpV2IeFactory::getInstance().getIeObject(AdditionalProtocolConfigurationOptionsIeType));
1148 rc = additionalProtocolConfigurationOptions.encodeAdditionalProtocolConfigurationOptionsIe(buffer, data.additionalProtocolConfigurationOptions);
1149 endIndex = buffer.getCurrentIndex();
1150 length = endIndex - startIndex;
1151
1152 // encode the length value now
1153 buffer.goToIndex(startIndex - 3);
1154 buffer.writeUint16(length, false);
1155 buffer.goToIndex(endIndex);
1156
1157 if (!(rc))
1158 {
1159 errorStream.add((char *)"Failed to encode IE: additionalProtocolConfigurationOptions\n");
1160 return false;
1161 }
1162 }
1163
1164 if (data.hNbLocalIpAddressIePresent)
1165 {
1166
1167 // Encode the Ie Header
1168 header.ieType = IpAddressIeType;
1169 header.instance = 1;
1170 header.length = 0; // We will encode the IE first and then update the length
1171 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
1172 startIndex = buffer.getCurrentIndex();
1173 IpAddressIe ipAddress=
1174 dynamic_cast<
1175 IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
1176 rc = ipAddress.encodeIpAddressIe(buffer, data.hNbLocalIpAddress);
1177 endIndex = buffer.getCurrentIndex();
1178 length = endIndex - startIndex;
1179
1180 // encode the length value now
1181 buffer.goToIndex(startIndex - 3);
1182 buffer.writeUint16(length, false);
1183 buffer.goToIndex(endIndex);
1184
1185 if (!(rc))
1186 {
1187 errorStream.add((char *)"Failed to encode IE: hNbLocalIpAddress\n");
1188 return false;
1189 }
1190 }
1191
1192 if (data.hNbUdpPortIePresent)
1193 {
1194
1195 // Encode the Ie Header
1196 header.ieType = PortNumberIeType;
1197 header.instance = 1;
1198 header.length = 0; // We will encode the IE first and then update the length
1199 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
1200 startIndex = buffer.getCurrentIndex();
1201 PortNumberIe portNumber=
1202 dynamic_cast<
1203 PortNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(PortNumberIeType));
1204 rc = portNumber.encodePortNumberIe(buffer, data.hNbUdpPort);
1205 endIndex = buffer.getCurrentIndex();
1206 length = endIndex - startIndex;
1207
1208 // encode the length value now
1209 buffer.goToIndex(startIndex - 3);
1210 buffer.writeUint16(length, false);
1211 buffer.goToIndex(endIndex);
1212
1213 if (!(rc))
1214 {
1215 errorStream.add((char *)"Failed to encode IE: hNbUdpPort\n");
1216 return false;
1217 }
1218 }
1219
1220 if (data.mmeS4SgsnIdentifierIePresent)
1221 {
1222
1223 // Encode the Ie Header
1224 header.ieType = IpAddressIeType;
1225 header.instance = 2;
1226 header.length = 0; // We will encode the IE first and then update the length
1227 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
1228 startIndex = buffer.getCurrentIndex();
1229 IpAddressIe ipAddress=
1230 dynamic_cast<
1231 IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
1232 rc = ipAddress.encodeIpAddressIe(buffer, data.mmeS4SgsnIdentifier);
1233 endIndex = buffer.getCurrentIndex();
1234 length = endIndex - startIndex;
1235
1236 // encode the length value now
1237 buffer.goToIndex(startIndex - 3);
1238 buffer.writeUint16(length, false);
1239 buffer.goToIndex(endIndex);
1240
1241 if (!(rc))
1242 {
1243 errorStream.add((char *)"Failed to encode IE: mmeS4SgsnIdentifier\n");
1244 return false;
1245 }
1246 }
1247
1248 if (data.twanIdentifierIePresent)
1249 {
1250
1251 // Encode the Ie Header
1252 header.ieType = TwanIdentifierIeType;
1253 header.instance = 0;
1254 header.length = 0; // We will encode the IE first and then update the length
1255 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
1256 startIndex = buffer.getCurrentIndex();
1257 TwanIdentifierIe twanIdentifier=
1258 dynamic_cast<
1259 TwanIdentifierIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierIeType));
1260 rc = twanIdentifier.encodeTwanIdentifierIe(buffer, data.twanIdentifier);
1261 endIndex = buffer.getCurrentIndex();
1262 length = endIndex - startIndex;
1263
1264 // encode the length value now
1265 buffer.goToIndex(startIndex - 3);
1266 buffer.writeUint16(length, false);
1267 buffer.goToIndex(endIndex);
1268
1269 if (!(rc))
1270 {
1271 errorStream.add((char *)"Failed to encode IE: twanIdentifier\n");
1272 return false;
1273 }
1274 }
1275
1276 if (data.epdgIpAddressIePresent)
1277 {
1278
1279 // Encode the Ie Header
1280 header.ieType = IpAddressIeType;
1281 header.instance = 3;
1282 header.length = 0; // We will encode the IE first and then update the length
1283 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
1284 startIndex = buffer.getCurrentIndex();
1285 IpAddressIe ipAddress=
1286 dynamic_cast<
1287 IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
1288 rc = ipAddress.encodeIpAddressIe(buffer, data.epdgIpAddress);
1289 endIndex = buffer.getCurrentIndex();
1290 length = endIndex - startIndex;
1291
1292 // encode the length value now
1293 buffer.goToIndex(startIndex - 3);
1294 buffer.writeUint16(length, false);
1295 buffer.goToIndex(endIndex);
1296
1297 if (!(rc))
1298 {
1299 errorStream.add((char *)"Failed to encode IE: epdgIpAddress\n");
1300 return false;
1301 }
1302 }
1303
1304 if (data.cnOperatorSelectionEntityIePresent)
1305 {
1306
1307 // Encode the Ie Header
1308 header.ieType = CnOperatorSelectionEntityIeType;
1309 header.instance = 0;
1310 header.length = 0; // We will encode the IE first and then update the length
1311 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
1312 startIndex = buffer.getCurrentIndex();
1313 CnOperatorSelectionEntityIe cnOperatorSelectionEntity=
1314 dynamic_cast<
1315 CnOperatorSelectionEntityIe&>(GtpV2IeFactory::getInstance().getIeObject(CnOperatorSelectionEntityIeType));
1316 rc = cnOperatorSelectionEntity.encodeCnOperatorSelectionEntityIe(buffer, data.cnOperatorSelectionEntity);
1317 endIndex = buffer.getCurrentIndex();
1318 length = endIndex - startIndex;
1319
1320 // encode the length value now
1321 buffer.goToIndex(startIndex - 3);
1322 buffer.writeUint16(length, false);
1323 buffer.goToIndex(endIndex);
1324
1325 if (!(rc))
1326 {
1327 errorStream.add((char *)"Failed to encode IE: cnOperatorSelectionEntity\n");
1328 return false;
1329 }
1330 }
1331
1332 if (data.mmeS4SgsnsOverloadControlInformationIePresent)
1333 {
1334
1335 // Encode the Ie Header
1336 header.ieType = OverloadControlInformationIeType;
1337 header.instance = 0;
1338 header.length = 0; // We will encode the IE first and then update the length
1339 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
1340 startIndex = buffer.getCurrentIndex();
1341 OverloadControlInformationIe overloadControlInformation=
1342 dynamic_cast<
1343 OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
1344 MmeS4SgsnsOverloadControlInformationInCreateSessionRequest groupedIeInstance =
1345 dynamic_cast<
1346 MmeS4SgsnsOverloadControlInformationInCreateSessionRequest&>(overloadControlInformation.getGroupedIe(msgType, 0));
1347 rc = groupedIeInstance.encodeMmeS4SgsnsOverloadControlInformationInCreateSessionRequest(buffer, data.mmeS4SgsnsOverloadControlInformation);
1348 endIndex = buffer.getCurrentIndex();
1349 length = endIndex - startIndex;
1350
1351 // encode the length value now
1352 buffer.goToIndex(startIndex - 3);
1353 buffer.writeUint16(length, false);
1354 buffer.goToIndex(endIndex);
1355
1356 if (!(rc))
1357 {
1358 errorStream.add((char *)"Failed to encode IE: mmeS4SgsnsOverloadControlInformation\n");
1359 return false;
1360 }
1361 }
1362
1363 if (data.sgwsOverloadControlInformationIePresent)
1364 {
1365
1366 // Encode the Ie Header
1367 header.ieType = OverloadControlInformationIeType;
1368 header.instance = 1;
1369 header.length = 0; // We will encode the IE first and then update the length
1370 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
1371 startIndex = buffer.getCurrentIndex();
1372 OverloadControlInformationIe overloadControlInformation=
1373 dynamic_cast<
1374 OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
1375 SgwsOverloadControlInformationInCreateSessionRequest groupedIeInstance =
1376 dynamic_cast<
1377 SgwsOverloadControlInformationInCreateSessionRequest&>(overloadControlInformation.getGroupedIe(msgType, 1));
1378 rc = groupedIeInstance.encodeSgwsOverloadControlInformationInCreateSessionRequest(buffer, data.sgwsOverloadControlInformation);
1379 endIndex = buffer.getCurrentIndex();
1380 length = endIndex - startIndex;
1381
1382 // encode the length value now
1383 buffer.goToIndex(startIndex - 3);
1384 buffer.writeUint16(length, false);
1385 buffer.goToIndex(endIndex);
1386
1387 if (!(rc))
1388 {
1389 errorStream.add((char *)"Failed to encode IE: sgwsOverloadControlInformation\n");
1390 return false;
1391 }
1392 }
1393
1394 if (data.twanEpdgsOverloadControlInformationIePresent)
1395 {
1396
1397 // Encode the Ie Header
1398 header.ieType = OverloadControlInformationIeType;
1399 header.instance = 2;
1400 header.length = 0; // We will encode the IE first and then update the length
1401 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
1402 startIndex = buffer.getCurrentIndex();
1403 OverloadControlInformationIe overloadControlInformation=
1404 dynamic_cast<
1405 OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
1406 TwanEpdgsOverloadControlInformationInCreateSessionRequest groupedIeInstance =
1407 dynamic_cast<
1408 TwanEpdgsOverloadControlInformationInCreateSessionRequest&>(overloadControlInformation.getGroupedIe(msgType, 2));
1409 rc = groupedIeInstance.encodeTwanEpdgsOverloadControlInformationInCreateSessionRequest(buffer, data.twanEpdgsOverloadControlInformation);
1410 endIndex = buffer.getCurrentIndex();
1411 length = endIndex - startIndex;
1412
1413 // encode the length value now
1414 buffer.goToIndex(startIndex - 3);
1415 buffer.writeUint16(length, false);
1416 buffer.goToIndex(endIndex);
1417
1418 if (!(rc))
1419 {
1420 errorStream.add((char *)"Failed to encode IE: twanEpdgsOverloadControlInformation\n");
1421 return false;
1422 }
1423 }
1424
1425 if (data.originationTimeStampIePresent)
1426 {
1427
1428 // Encode the Ie Header
1429 header.ieType = MillisecondTimeStampIeType;
1430 header.instance = 0;
1431 header.length = 0; // We will encode the IE first and then update the length
1432 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
1433 startIndex = buffer.getCurrentIndex();
1434 MillisecondTimeStampIe millisecondTimeStamp=
1435 dynamic_cast<
1436 MillisecondTimeStampIe&>(GtpV2IeFactory::getInstance().getIeObject(MillisecondTimeStampIeType));
1437 rc = millisecondTimeStamp.encodeMillisecondTimeStampIe(buffer, data.originationTimeStamp);
1438 endIndex = buffer.getCurrentIndex();
1439 length = endIndex - startIndex;
1440
1441 // encode the length value now
1442 buffer.goToIndex(startIndex - 3);
1443 buffer.writeUint16(length, false);
1444 buffer.goToIndex(endIndex);
1445
1446 if (!(rc))
1447 {
1448 errorStream.add((char *)"Failed to encode IE: originationTimeStamp\n");
1449 return false;
1450 }
1451 }
1452
1453 if (data.maximumWaitTimeIePresent)
1454 {
1455
1456 // Encode the Ie Header
1457 header.ieType = IntegerNumberIeType;
1458 header.instance = 0;
1459 header.length = 0; // We will encode the IE first and then update the length
1460 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
1461 startIndex = buffer.getCurrentIndex();
1462 IntegerNumberIe integerNumber=
1463 dynamic_cast<
1464 IntegerNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(IntegerNumberIeType));
1465 rc = integerNumber.encodeIntegerNumberIe(buffer, data.maximumWaitTime);
1466 endIndex = buffer.getCurrentIndex();
1467 length = endIndex - startIndex;
1468
1469 // encode the length value now
1470 buffer.goToIndex(startIndex - 3);
1471 buffer.writeUint16(length, false);
1472 buffer.goToIndex(endIndex);
1473
1474 if (!(rc))
1475 {
1476 errorStream.add((char *)"Failed to encode IE: maximumWaitTime\n");
1477 return false;
1478 }
1479 }
1480
1481 if (data.wlanLocationInformationIePresent)
1482 {
1483
1484 // Encode the Ie Header
1485 header.ieType = TwanIdentifierIeType;
1486 header.instance = 1;
1487 header.length = 0; // We will encode the IE first and then update the length
1488 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
1489 startIndex = buffer.getCurrentIndex();
1490 TwanIdentifierIe twanIdentifier=
1491 dynamic_cast<
1492 TwanIdentifierIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierIeType));
1493 rc = twanIdentifier.encodeTwanIdentifierIe(buffer, data.wlanLocationInformation);
1494 endIndex = buffer.getCurrentIndex();
1495 length = endIndex - startIndex;
1496
1497 // encode the length value now
1498 buffer.goToIndex(startIndex - 3);
1499 buffer.writeUint16(length, false);
1500 buffer.goToIndex(endIndex);
1501
1502 if (!(rc))
1503 {
1504 errorStream.add((char *)"Failed to encode IE: wlanLocationInformation\n");
1505 return false;
1506 }
1507 }
1508
1509 if (data.wlanLocationTimestampIePresent)
1510 {
1511
1512 // Encode the Ie Header
1513 header.ieType = TwanIdentifierTimestampIeType;
1514 header.instance = 0;
1515 header.length = 0; // We will encode the IE first and then update the length
1516 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
1517 startIndex = buffer.getCurrentIndex();
1518 TwanIdentifierTimestampIe twanIdentifierTimestamp=
1519 dynamic_cast<
1520 TwanIdentifierTimestampIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierTimestampIeType));
1521 rc = twanIdentifierTimestamp.encodeTwanIdentifierTimestampIe(buffer, data.wlanLocationTimestamp);
1522 endIndex = buffer.getCurrentIndex();
1523 length = endIndex - startIndex;
1524
1525 // encode the length value now
1526 buffer.goToIndex(startIndex - 3);
1527 buffer.writeUint16(length, false);
1528 buffer.goToIndex(endIndex);
1529
1530 if (!(rc))
1531 {
1532 errorStream.add((char *)"Failed to encode IE: wlanLocationTimestamp\n");
1533 return false;
1534 }
1535 }
1536
1537 if (data.nbifomContainerIePresent)
1538 {
1539
1540 // Encode the Ie Header
1541 header.ieType = FContainerIeType;
1542 header.instance = 0;
1543 header.length = 0; // We will encode the IE first and then update the length
1544 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
1545 startIndex = buffer.getCurrentIndex();
1546 FContainerIe fContainer=
1547 dynamic_cast<
1548 FContainerIe&>(GtpV2IeFactory::getInstance().getIeObject(FContainerIeType));
1549 rc = fContainer.encodeFContainerIe(buffer, data.nbifomContainer);
1550 endIndex = buffer.getCurrentIndex();
1551 length = endIndex - startIndex;
1552
1553 // encode the length value now
1554 buffer.goToIndex(startIndex - 3);
1555 buffer.writeUint16(length, false);
1556 buffer.goToIndex(endIndex);
1557
1558 if (!(rc))
1559 {
1560 errorStream.add((char *)"Failed to encode IE: nbifomContainer\n");
1561 return false;
1562 }
1563 }
1564
1565 if (data.remoteUeContextConnectedIePresent)
1566 {
1567
1568 // Encode the Ie Header
1569 header.ieType = RemoteUeContextIeType;
1570 header.instance = 0;
1571 header.length = 0; // We will encode the IE first and then update the length
1572 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
1573 startIndex = buffer.getCurrentIndex();
1574 RemoteUeContextIe remoteUeContext=
1575 dynamic_cast<
1576 RemoteUeContextIe&>(GtpV2IeFactory::getInstance().getIeObject(RemoteUeContextIeType));
1577 RemoteUeContextConnectedInCreateSessionRequest groupedIeInstance =
1578 dynamic_cast<
1579 RemoteUeContextConnectedInCreateSessionRequest&>(remoteUeContext.getGroupedIe(msgType, 0));
1580 rc = groupedIeInstance.encodeRemoteUeContextConnectedInCreateSessionRequest(buffer, data.remoteUeContextConnected);
1581 endIndex = buffer.getCurrentIndex();
1582 length = endIndex - startIndex;
1583
1584 // encode the length value now
1585 buffer.goToIndex(startIndex - 3);
1586 buffer.writeUint16(length, false);
1587 buffer.goToIndex(endIndex);
1588
1589 if (!(rc))
1590 {
1591 errorStream.add((char *)"Failed to encode IE: remoteUeContextConnected\n");
1592 return false;
1593 }
1594 }
1595
1596 if (data.a3gppAaaServerIdentifierIePresent)
1597 {
1598
1599 // Encode the Ie Header
1600 header.ieType = NodeIdentifierIeType;
1601 header.instance = 0;
1602 header.length = 0; // We will encode the IE first and then update the length
1603 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
1604 startIndex = buffer.getCurrentIndex();
1605 NodeIdentifierIe nodeIdentifier=
1606 dynamic_cast<
1607 NodeIdentifierIe&>(GtpV2IeFactory::getInstance().getIeObject(NodeIdentifierIeType));
1608 rc = nodeIdentifier.encodeNodeIdentifierIe(buffer, data.a3gppAaaServerIdentifier);
1609 endIndex = buffer.getCurrentIndex();
1610 length = endIndex - startIndex;
1611
1612 // encode the length value now
1613 buffer.goToIndex(startIndex - 3);
1614 buffer.writeUint16(length, false);
1615 buffer.goToIndex(endIndex);
1616
1617 if (!(rc))
1618 {
1619 errorStream.add((char *)"Failed to encode IE: a3gppAaaServerIdentifier\n");
1620 return false;
1621 }
1622 }
1623
1624 if (data.extendedProtocolConfigurationOptionsIePresent)
1625 {
1626
1627 // Encode the Ie Header
1628 header.ieType = EpcoIeType;
1629 header.instance = 0;
1630 header.length = 0; // We will encode the IE first and then update the length
1631 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
1632 startIndex = buffer.getCurrentIndex();
1633 EpcoIe epco=
1634 dynamic_cast<
1635 EpcoIe&>(GtpV2IeFactory::getInstance().getIeObject(EpcoIeType));
1636 rc = epco.encodeEpcoIe(buffer, data.extendedProtocolConfigurationOptions);
1637 endIndex = buffer.getCurrentIndex();
1638 length = endIndex - startIndex;
1639
1640 // encode the length value now
1641 buffer.goToIndex(startIndex - 3);
1642 buffer.writeUint16(length, false);
1643 buffer.goToIndex(endIndex);
1644
1645 if (!(rc))
1646 {
1647 errorStream.add((char *)"Failed to encode IE: extendedProtocolConfigurationOptions\n");
1648 return false;
1649 }
1650 }
1651
1652 if (data.servingPlmnRateControlIePresent)
1653 {
1654
1655 // Encode the Ie Header
1656 header.ieType = ServingPlmnRateControlIeType;
1657 header.instance = 0;
1658 header.length = 0; // We will encode the IE first and then update the length
1659 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
1660 startIndex = buffer.getCurrentIndex();
1661 ServingPlmnRateControlIe servingPlmnRateControl=
1662 dynamic_cast<
1663 ServingPlmnRateControlIe&>(GtpV2IeFactory::getInstance().getIeObject(ServingPlmnRateControlIeType));
1664 rc = servingPlmnRateControl.encodeServingPlmnRateControlIe(buffer, data.servingPlmnRateControl);
1665 endIndex = buffer.getCurrentIndex();
1666 length = endIndex - startIndex;
1667
1668 // encode the length value now
1669 buffer.goToIndex(startIndex - 3);
1670 buffer.writeUint16(length, false);
1671 buffer.goToIndex(endIndex);
1672
1673 if (!(rc))
1674 {
1675 errorStream.add((char *)"Failed to encode IE: servingPlmnRateControl\n");
1676 return false;
1677 }
1678 }
1679
1680 if (data.moExceptionDataCounterIePresent)
1681 {
1682
1683 // Encode the Ie Header
1684 header.ieType = CounterIeType;
1685 header.instance = 0;
1686 header.length = 0; // We will encode the IE first and then update the length
1687 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
1688 startIndex = buffer.getCurrentIndex();
1689 CounterIe counter=
1690 dynamic_cast<
1691 CounterIe&>(GtpV2IeFactory::getInstance().getIeObject(CounterIeType));
1692 rc = counter.encodeCounterIe(buffer, data.moExceptionDataCounter);
1693 endIndex = buffer.getCurrentIndex();
1694 length = endIndex - startIndex;
1695
1696 // encode the length value now
1697 buffer.goToIndex(startIndex - 3);
1698 buffer.writeUint16(length, false);
1699 buffer.goToIndex(endIndex);
1700
1701 if (!(rc))
1702 {
1703 errorStream.add((char *)"Failed to encode IE: moExceptionDataCounter\n");
1704 return false;
1705 }
1706 }
1707
1708 if (data.ueTcpPortIePresent)
1709 {
1710
1711 // Encode the Ie Header
1712 header.ieType = PortNumberIeType;
1713 header.instance = 2;
1714 header.length = 0; // We will encode the IE first and then update the length
1715 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
1716 startIndex = buffer.getCurrentIndex();
1717 PortNumberIe portNumber=
1718 dynamic_cast<
1719 PortNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(PortNumberIeType));
1720 rc = portNumber.encodePortNumberIe(buffer, data.ueTcpPort);
1721 endIndex = buffer.getCurrentIndex();
1722 length = endIndex - startIndex;
1723
1724 // encode the length value now
1725 buffer.goToIndex(startIndex - 3);
1726 buffer.writeUint16(length, false);
1727 buffer.goToIndex(endIndex);
1728
1729 if (!(rc))
1730 {
1731 errorStream.add((char *)"Failed to encode IE: ueTcpPort\n");
1732 return false;
1733 }
1734 }
1735
1736 if (data.mappedUeUsageTypeIePresent)
1737 {
1738
1739 // Encode the Ie Header
1740 header.ieType = MappedUeUsageTypeIeType;
1741 header.instance = 0;
1742 header.length = 0; // We will encode the IE first and then update the length
1743 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
1744 startIndex = buffer.getCurrentIndex();
1745 MappedUeUsageTypeIe mappedUeUsageType=
1746 dynamic_cast<
1747 MappedUeUsageTypeIe&>(GtpV2IeFactory::getInstance().getIeObject(MappedUeUsageTypeIeType));
1748 rc = mappedUeUsageType.encodeMappedUeUsageTypeIe(buffer, data.mappedUeUsageType);
1749 endIndex = buffer.getCurrentIndex();
1750 length = endIndex - startIndex;
1751
1752 // encode the length value now
1753 buffer.goToIndex(startIndex - 3);
1754 buffer.writeUint16(length, false);
1755 buffer.goToIndex(endIndex);
1756
1757 if (!(rc))
1758 {
1759 errorStream.add((char *)"Failed to encode IE: mappedUeUsageType\n");
1760 return false;
1761 }
1762 }
1763
1764 if (data.userLocationInformationForSgwIePresent)
1765 {
1766
1767 // Encode the Ie Header
1768 header.ieType = UliIeType;
1769 header.instance = 1;
1770 header.length = 0; // We will encode the IE first and then update the length
1771 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
1772 startIndex = buffer.getCurrentIndex();
1773 UliIe uli=
1774 dynamic_cast<
1775 UliIe&>(GtpV2IeFactory::getInstance().getIeObject(UliIeType));
1776 rc = uli.encodeUliIe(buffer, data.userLocationInformationForSgw);
1777 endIndex = buffer.getCurrentIndex();
1778 length = endIndex - startIndex;
1779
1780 // encode the length value now
1781 buffer.goToIndex(startIndex - 3);
1782 buffer.writeUint16(length, false);
1783 buffer.goToIndex(endIndex);
1784
1785 if (!(rc))
1786 {
1787 errorStream.add((char *)"Failed to encode IE: userLocationInformationForSgw\n");
1788 return false;
1789 }
1790 }
1791
1792 if (data.sgwUNodeNameIePresent)
1793 {
1794
1795 // Encode the Ie Header
1796 header.ieType = FqdnIeType;
1797 header.instance = 0;
1798 header.length = 0; // We will encode the IE first and then update the length
1799 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
1800 startIndex = buffer.getCurrentIndex();
1801 FqdnIe fqdn=
1802 dynamic_cast<
1803 FqdnIe&>(GtpV2IeFactory::getInstance().getIeObject(FqdnIeType));
1804 rc = fqdn.encodeFqdnIe(buffer, data.sgwUNodeName);
1805 endIndex = buffer.getCurrentIndex();
1806 length = endIndex - startIndex;
1807
1808 // encode the length value now
1809 buffer.goToIndex(startIndex - 3);
1810 buffer.writeUint16(length, false);
1811 buffer.goToIndex(endIndex);
1812
1813 if (!(rc))
1814 {
1815 errorStream.add((char *)"Failed to encode IE: sgwUNodeName\n");
1816 return false;
1817 }
1818 }
1819
1820 if (data.secondaryRatUsageDataReportIePresent)
1821 {
1822
1823 // Encode the Ie Header
1824 header.ieType = SecondaryRatUsageDataReportIeType;
1825 header.instance = 0;
1826 header.length = 0; // We will encode the IE first and then update the length
1827 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
1828 startIndex = buffer.getCurrentIndex();
1829 SecondaryRatUsageDataReportIe secondaryRatUsageDataReport=
1830 dynamic_cast<
1831 SecondaryRatUsageDataReportIe&>(GtpV2IeFactory::getInstance().getIeObject(SecondaryRatUsageDataReportIeType));
1832 rc = secondaryRatUsageDataReport.encodeSecondaryRatUsageDataReportIe(buffer, data.secondaryRatUsageDataReport);
1833 endIndex = buffer.getCurrentIndex();
1834 length = endIndex - startIndex;
1835
1836 // encode the length value now
1837 buffer.goToIndex(startIndex - 3);
1838 buffer.writeUint16(length, false);
1839 buffer.goToIndex(endIndex);
1840
1841 if (!(rc))
1842 {
1843 errorStream.add((char *)"Failed to encode IE: secondaryRatUsageDataReport\n");
1844 return false;
1845 }
1846 }
1847
1848 if (data.upFunctionSelectionIndicationFlagsIePresent)
1849 {
1850
1851 // Encode the Ie Header
1852 header.ieType = UpFunctionSelectionIndicationFlagsIeType;
1853 header.instance = 0;
1854 header.length = 0; // We will encode the IE first and then update the length
1855 GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
1856 startIndex = buffer.getCurrentIndex();
1857 UpFunctionSelectionIndicationFlagsIe upFunctionSelectionIndicationFlags=
1858 dynamic_cast<
1859 UpFunctionSelectionIndicationFlagsIe&>(GtpV2IeFactory::getInstance().getIeObject(UpFunctionSelectionIndicationFlagsIeType));
1860 rc = upFunctionSelectionIndicationFlags.encodeUpFunctionSelectionIndicationFlagsIe(buffer, data.upFunctionSelectionIndicationFlags);
1861 endIndex = buffer.getCurrentIndex();
1862 length = endIndex - startIndex;
1863
1864 // encode the length value now
1865 buffer.goToIndex(startIndex - 3);
1866 buffer.writeUint16(length, false);
1867 buffer.goToIndex(endIndex);
1868
1869 if (!(rc))
1870 {
1871 errorStream.add((char *)"Failed to encode IE: upFunctionSelectionIndicationFlags\n");
1872 return false;
1873 }
1874 }
1875 return rc;
1876
1877}
1878
1879bool CreateSessionRequestMsg::decodeCreateSessionRequestMsg(MsgBuffer &buffer,
1880 CreateSessionRequestMsgData
1881 &data, Uint16 length)
1882{
1883
1884 bool rc = false;
1885 GtpV2IeHeader ieHeader;
1886
1887 set<Uint16> mandatoryIeLocalList = mandatoryIeSet;
1888 while (buffer.lengthLeft() > IE_HEADER_SIZE)
1889 {
1890 GtpV2Ie::decodeGtpV2IeHeader(buffer, ieHeader);
1891 if (ieHeader.length > buffer.lengthLeft())
1892 {
1893 // We do not have enough bytes left in the message for this IE
1894 errorStream.add((char *)"IE Length exceeds beyond message boundary\n");
1895 errorStream.add((char *)" Offending IE Type: ");
1896 errorStream.add(ieHeader.ieType);
1897 errorStream.add((char *)"\n Ie Length in Header: ");
1898 errorStream.add(ieHeader.length);
1899 errorStream.add((char *)"\n Bytes left in message: ");
1900 errorStream.add(buffer.lengthLeft());
1901 errorStream.endOfLine();
1902 return false;
1903 }
1904
1905 switch (ieHeader.ieType){
1906
1907 case ImsiIeType:
1908 {
1909 ImsiIe ieObject =
1910 dynamic_cast<
1911 ImsiIe&>(GtpV2IeFactory::getInstance().getIeObject(ImsiIeType));
1912
1913 if(ieHeader.instance == 0)
1914 {
1915 rc = ieObject.decodeImsiIe(buffer, data.imsi, ieHeader.length);
1916
1917 data.imsiIePresent = true;
1918 if (!(rc))
1919 {
1920 errorStream.add((char *)"Failed to decode IE: imsi\n");
1921 return false;
1922 }
1923 }
1924
1925 else
1926 {
1927 // Unknown IE instance print error
1928 errorStream.add((char *)"Unknown IE Type: ");
1929 errorStream.add(ieHeader.ieType);
1930 errorStream.endOfLine();
1931 buffer.skipBytes(ieHeader.length);
1932 }
1933 break;
1934 }
1935
1936 case MsisdnIeType:
1937 {
1938 MsisdnIe ieObject =
1939 dynamic_cast<
1940 MsisdnIe&>(GtpV2IeFactory::getInstance().getIeObject(MsisdnIeType));
1941
1942 if(ieHeader.instance == 0)
1943 {
1944 rc = ieObject.decodeMsisdnIe(buffer, data.msisdn, ieHeader.length);
1945
1946 data.msisdnIePresent = true;
1947 if (!(rc))
1948 {
1949 errorStream.add((char *)"Failed to decode IE: msisdn\n");
1950 return false;
1951 }
1952 }
1953
1954 else
1955 {
1956 // Unknown IE instance print error
1957 errorStream.add((char *)"Unknown IE Type: ");
1958 errorStream.add(ieHeader.ieType);
1959 errorStream.endOfLine();
1960 buffer.skipBytes(ieHeader.length);
1961 }
1962 break;
1963 }
1964
1965 case MeiIeType:
1966 {
1967 MeiIe ieObject =
1968 dynamic_cast<
1969 MeiIe&>(GtpV2IeFactory::getInstance().getIeObject(MeiIeType));
1970
1971 if(ieHeader.instance == 0)
1972 {
1973 rc = ieObject.decodeMeiIe(buffer, data.meIdentity, ieHeader.length);
1974
1975 data.meIdentityIePresent = true;
1976 if (!(rc))
1977 {
1978 errorStream.add((char *)"Failed to decode IE: meIdentity\n");
1979 return false;
1980 }
1981 }
1982
1983 else
1984 {
1985 // Unknown IE instance print error
1986 errorStream.add((char *)"Unknown IE Type: ");
1987 errorStream.add(ieHeader.ieType);
1988 errorStream.endOfLine();
1989 buffer.skipBytes(ieHeader.length);
1990 }
1991 break;
1992 }
1993
1994 case UliIeType:
1995 {
1996 UliIe ieObject =
1997 dynamic_cast<
1998 UliIe&>(GtpV2IeFactory::getInstance().getIeObject(UliIeType));
1999
2000 if(ieHeader.instance == 0)
2001 {
2002 rc = ieObject.decodeUliIe(buffer, data.userLocationInformation, ieHeader.length);
2003
2004 data.userLocationInformationIePresent = true;
2005 if (!(rc))
2006 {
2007 errorStream.add((char *)"Failed to decode IE: userLocationInformation\n");
2008 return false;
2009 }
2010 }
2011 else if(ieHeader.instance == 1)
2012 {
2013 rc = ieObject.decodeUliIe(buffer, data.userLocationInformationForSgw, ieHeader.length);
2014
2015 data.userLocationInformationForSgwIePresent = true;
2016 if (!(rc))
2017 {
2018 errorStream.add((char *)"Failed to decode IE: userLocationInformationForSgw\n");
2019 return false;
2020 }
2021 }
2022
2023 else
2024 {
2025 // Unknown IE instance print error
2026 errorStream.add((char *)"Unknown IE Type: ");
2027 errorStream.add(ieHeader.ieType);
2028 errorStream.endOfLine();
2029 buffer.skipBytes(ieHeader.length);
2030 }
2031 break;
2032 }
2033
2034 case ServingNetworkIeType:
2035 {
2036 ServingNetworkIe ieObject =
2037 dynamic_cast<
2038 ServingNetworkIe&>(GtpV2IeFactory::getInstance().getIeObject(ServingNetworkIeType));
2039
2040 if(ieHeader.instance == 0)
2041 {
2042 rc = ieObject.decodeServingNetworkIe(buffer, data.servingNetwork, ieHeader.length);
2043
2044 data.servingNetworkIePresent = true;
2045 if (!(rc))
2046 {
2047 errorStream.add((char *)"Failed to decode IE: servingNetwork\n");
2048 return false;
2049 }
2050 }
2051
2052 else
2053 {
2054 // Unknown IE instance print error
2055 errorStream.add((char *)"Unknown IE Type: ");
2056 errorStream.add(ieHeader.ieType);
2057 errorStream.endOfLine();
2058 buffer.skipBytes(ieHeader.length);
2059 }
2060 break;
2061 }
2062
2063 case RatTypeIeType:
2064 {
2065 RatTypeIe ieObject =
2066 dynamic_cast<
2067 RatTypeIe&>(GtpV2IeFactory::getInstance().getIeObject(RatTypeIeType));
2068
2069 if(ieHeader.instance == 0)
2070 {
2071 rc = ieObject.decodeRatTypeIe(buffer, data.ratType, ieHeader.length);
2072
2073 if (!(rc))
2074 {
2075 errorStream.add((char *)"Failed to decode IE: ratType\n");
2076 return false;
2077 }
2078 }
2079
2080 else
2081 {
2082 // Unknown IE instance print error
2083 errorStream.add((char *)"Unknown IE Type: ");
2084 errorStream.add(ieHeader.ieType);
2085 errorStream.endOfLine();
2086 buffer.skipBytes(ieHeader.length);
2087 }
2088 break;
2089 }
2090
2091 case IndicationIeType:
2092 {
2093 IndicationIe ieObject =
2094 dynamic_cast<
2095 IndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(IndicationIeType));
2096
2097 if(ieHeader.instance == 0)
2098 {
2099 rc = ieObject.decodeIndicationIe(buffer, data.indicationFlags, ieHeader.length);
2100
2101 data.indicationFlagsIePresent = true;
2102 if (!(rc))
2103 {
2104 errorStream.add((char *)"Failed to decode IE: indicationFlags\n");
2105 return false;
2106 }
2107 }
2108
2109 else
2110 {
2111 // Unknown IE instance print error
2112 errorStream.add((char *)"Unknown IE Type: ");
2113 errorStream.add(ieHeader.ieType);
2114 errorStream.endOfLine();
2115 buffer.skipBytes(ieHeader.length);
2116 }
2117 break;
2118 }
2119
2120 case FTeidIeType:
2121 {
2122 FTeidIe ieObject =
2123 dynamic_cast<
2124 FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
2125
2126 if(ieHeader.instance == 0)
2127 {
2128 rc = ieObject.decodeFTeidIe(buffer, data.senderFTeidForControlPlane, ieHeader.length);
2129
2130 if (!(rc))
2131 {
2132 errorStream.add((char *)"Failed to decode IE: senderFTeidForControlPlane\n");
2133 return false;
2134 }
2135 }
2136 else if(ieHeader.instance == 1)
2137 {
2138 rc = ieObject.decodeFTeidIe(buffer, data.pgwS5S8AddressForControlPlaneOrPmip, ieHeader.length);
2139
2140 data.pgwS5S8AddressForControlPlaneOrPmipIePresent = true;
2141 if (!(rc))
2142 {
2143 errorStream.add((char *)"Failed to decode IE: pgwS5S8AddressForControlPlaneOrPmip\n");
2144 return false;
2145 }
2146 }
2147
2148 else
2149 {
2150 // Unknown IE instance print error
2151 errorStream.add((char *)"Unknown IE Type: ");
2152 errorStream.add(ieHeader.ieType);
2153 errorStream.endOfLine();
2154 buffer.skipBytes(ieHeader.length);
2155 }
2156 break;
2157 }
2158
2159 case ApnIeType:
2160 {
2161 ApnIe ieObject =
2162 dynamic_cast<
2163 ApnIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnIeType));
2164
2165 if(ieHeader.instance == 0)
2166 {
2167 rc = ieObject.decodeApnIe(buffer, data.accessPointName, ieHeader.length);
2168
2169 if (!(rc))
2170 {
2171 errorStream.add((char *)"Failed to decode IE: accessPointName\n");
2172 return false;
2173 }
2174 }
2175
2176 else
2177 {
2178 // Unknown IE instance print error
2179 errorStream.add((char *)"Unknown IE Type: ");
2180 errorStream.add(ieHeader.ieType);
2181 errorStream.endOfLine();
2182 buffer.skipBytes(ieHeader.length);
2183 }
2184 break;
2185 }
2186
2187 case SelectionModeIeType:
2188 {
2189 SelectionModeIe ieObject =
2190 dynamic_cast<
2191 SelectionModeIe&>(GtpV2IeFactory::getInstance().getIeObject(SelectionModeIeType));
2192
2193 if(ieHeader.instance == 0)
2194 {
2195 rc = ieObject.decodeSelectionModeIe(buffer, data.selectionMode, ieHeader.length);
2196
2197 data.selectionModeIePresent = true;
2198 if (!(rc))
2199 {
2200 errorStream.add((char *)"Failed to decode IE: selectionMode\n");
2201 return false;
2202 }
2203 }
2204
2205 else
2206 {
2207 // Unknown IE instance print error
2208 errorStream.add((char *)"Unknown IE Type: ");
2209 errorStream.add(ieHeader.ieType);
2210 errorStream.endOfLine();
2211 buffer.skipBytes(ieHeader.length);
2212 }
2213 break;
2214 }
2215
2216 case PdnTypeIeType:
2217 {
2218 PdnTypeIe ieObject =
2219 dynamic_cast<
2220 PdnTypeIe&>(GtpV2IeFactory::getInstance().getIeObject(PdnTypeIeType));
2221
2222 if(ieHeader.instance == 0)
2223 {
2224 rc = ieObject.decodePdnTypeIe(buffer, data.pdnType, ieHeader.length);
2225
2226 data.pdnTypeIePresent = true;
2227 if (!(rc))
2228 {
2229 errorStream.add((char *)"Failed to decode IE: pdnType\n");
2230 return false;
2231 }
2232 }
2233
2234 else
2235 {
2236 // Unknown IE instance print error
2237 errorStream.add((char *)"Unknown IE Type: ");
2238 errorStream.add(ieHeader.ieType);
2239 errorStream.endOfLine();
2240 buffer.skipBytes(ieHeader.length);
2241 }
2242 break;
2243 }
2244
2245 case PaaIeType:
2246 {
2247 PaaIe ieObject =
2248 dynamic_cast<
2249 PaaIe&>(GtpV2IeFactory::getInstance().getIeObject(PaaIeType));
2250
2251 if(ieHeader.instance == 0)
2252 {
2253 rc = ieObject.decodePaaIe(buffer, data.pdnAddressAllocation, ieHeader.length);
2254
2255 data.pdnAddressAllocationIePresent = true;
2256 if (!(rc))
2257 {
2258 errorStream.add((char *)"Failed to decode IE: pdnAddressAllocation\n");
2259 return false;
2260 }
2261 }
2262
2263 else
2264 {
2265 // Unknown IE instance print error
2266 errorStream.add((char *)"Unknown IE Type: ");
2267 errorStream.add(ieHeader.ieType);
2268 errorStream.endOfLine();
2269 buffer.skipBytes(ieHeader.length);
2270 }
2271 break;
2272 }
2273
2274 case ApnRestrictionIeType:
2275 {
2276 ApnRestrictionIe ieObject =
2277 dynamic_cast<
2278 ApnRestrictionIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnRestrictionIeType));
2279
2280 if(ieHeader.instance == 0)
2281 {
2282 rc = ieObject.decodeApnRestrictionIe(buffer, data.maximumApnRestriction, ieHeader.length);
2283
2284 data.maximumApnRestrictionIePresent = true;
2285 if (!(rc))
2286 {
2287 errorStream.add((char *)"Failed to decode IE: maximumApnRestriction\n");
2288 return false;
2289 }
2290 }
2291
2292 else
2293 {
2294 // Unknown IE instance print error
2295 errorStream.add((char *)"Unknown IE Type: ");
2296 errorStream.add(ieHeader.ieType);
2297 errorStream.endOfLine();
2298 buffer.skipBytes(ieHeader.length);
2299 }
2300 break;
2301 }
2302
2303 case AmbrIeType:
2304 {
2305 AmbrIe ieObject =
2306 dynamic_cast<
2307 AmbrIe&>(GtpV2IeFactory::getInstance().getIeObject(AmbrIeType));
2308
2309 if(ieHeader.instance == 0)
2310 {
2311 rc = ieObject.decodeAmbrIe(buffer, data.aggregateMaximumBitRate, ieHeader.length);
2312
2313 data.aggregateMaximumBitRateIePresent = true;
2314 if (!(rc))
2315 {
2316 errorStream.add((char *)"Failed to decode IE: aggregateMaximumBitRate\n");
2317 return false;
2318 }
2319 }
2320
2321 else
2322 {
2323 // Unknown IE instance print error
2324 errorStream.add((char *)"Unknown IE Type: ");
2325 errorStream.add(ieHeader.ieType);
2326 errorStream.endOfLine();
2327 buffer.skipBytes(ieHeader.length);
2328 }
2329 break;
2330 }
2331
2332 case EbiIeType:
2333 {
2334 EbiIe ieObject =
2335 dynamic_cast<
2336 EbiIe&>(GtpV2IeFactory::getInstance().getIeObject(EbiIeType));
2337
2338 if(ieHeader.instance == 0)
2339 {
2340 rc = ieObject.decodeEbiIe(buffer, data.linkedEpsBearerId, ieHeader.length);
2341
2342 data.linkedEpsBearerIdIePresent = true;
2343 if (!(rc))
2344 {
2345 errorStream.add((char *)"Failed to decode IE: linkedEpsBearerId\n");
2346 return false;
2347 }
2348 }
2349
2350 else
2351 {
2352 // Unknown IE instance print error
2353 errorStream.add((char *)"Unknown IE Type: ");
2354 errorStream.add(ieHeader.ieType);
2355 errorStream.endOfLine();
2356 buffer.skipBytes(ieHeader.length);
2357 }
2358 break;
2359 }
2360
2361 case TwmiIeType:
2362 {
2363 TwmiIe ieObject =
2364 dynamic_cast<
2365 TwmiIe&>(GtpV2IeFactory::getInstance().getIeObject(TwmiIeType));
2366
2367 if(ieHeader.instance == 0)
2368 {
2369 rc = ieObject.decodeTwmiIe(buffer, data.trustedWlanModeIndication, ieHeader.length);
2370
2371 data.trustedWlanModeIndicationIePresent = true;
2372 if (!(rc))
2373 {
2374 errorStream.add((char *)"Failed to decode IE: trustedWlanModeIndication\n");
2375 return false;
2376 }
2377 }
2378
2379 else
2380 {
2381 // Unknown IE instance print error
2382 errorStream.add((char *)"Unknown IE Type: ");
2383 errorStream.add(ieHeader.ieType);
2384 errorStream.endOfLine();
2385 buffer.skipBytes(ieHeader.length);
2386 }
2387 break;
2388 }
2389
2390 case PcoIeType:
2391 {
2392 PcoIe ieObject =
2393 dynamic_cast<
2394 PcoIe&>(GtpV2IeFactory::getInstance().getIeObject(PcoIeType));
2395
2396 if(ieHeader.instance == 0)
2397 {
2398 rc = ieObject.decodePcoIe(buffer, data.protocolConfigurationOptions, ieHeader.length);
2399
2400 data.protocolConfigurationOptionsIePresent = true;
2401 if (!(rc))
2402 {
2403 errorStream.add((char *)"Failed to decode IE: protocolConfigurationOptions\n");
2404 return false;
2405 }
2406 }
2407
2408 else
2409 {
2410 // Unknown IE instance print error
2411 errorStream.add((char *)"Unknown IE Type: ");
2412 errorStream.add(ieHeader.ieType);
2413 errorStream.endOfLine();
2414 buffer.skipBytes(ieHeader.length);
2415 }
2416 break;
2417 }
2418
2419 case BearerContextIeType:
2420 {
2421 BearerContextIe ieObject =
2422 dynamic_cast<
2423 BearerContextIe&>(GtpV2IeFactory::getInstance().getIeObject(BearerContextIeType));
2424
2425 if(ieHeader.instance == 0)
2426 {
2427 // First check if we have enough space left to decode and store this instance
2428 if (data.bearerContextsToBeCreatedCount == 11)
2429 {
2430 errorStream.add((char *)"More than 11 instances of bearerContextsToBeCreated received\n");
2431 return false;
2432 }
2433 BearerContextsToBeCreatedInCreateSessionRequest groupedIeInstance =
2434 dynamic_cast<
2435 BearerContextsToBeCreatedInCreateSessionRequest&>(ieObject.getGroupedIe(msgType, 0));
2436 rc = groupedIeInstance.decodeBearerContextsToBeCreatedInCreateSessionRequest(buffer,
2437 data.bearerContextsToBeCreated[data.bearerContextsToBeCreatedCount], ieHeader.length);
2438 data.bearerContextsToBeCreatedCount++; // TODO Count validation
2439
2440 if (!(rc))
2441 {
2442 errorStream.add((char *)"Failed to decode IE: bearerContextsToBeCreated\n");
2443 return false;
2444 }
2445 }
2446 else if(ieHeader.instance == 1)
2447 {
2448 // First check if we have enough space left to decode and store this instance
2449 if (data.bearerContextsToBeRemovedCount == 11)
2450 {
2451 errorStream.add((char *)"More than 11 instances of bearerContextsToBeRemoved received\n");
2452 return false;
2453 }
2454 BearerContextsToBeRemovedInCreateSessionRequest groupedIeInstance =
2455 dynamic_cast<
2456 BearerContextsToBeRemovedInCreateSessionRequest&>(ieObject.getGroupedIe(msgType, 1));
2457 rc = groupedIeInstance.decodeBearerContextsToBeRemovedInCreateSessionRequest(buffer,
2458 data.bearerContextsToBeRemoved[data.bearerContextsToBeRemovedCount], ieHeader.length);
2459 data.bearerContextsToBeRemovedCount++; // TODO Count validation
2460
2461 if (!(rc))
2462 {
2463 errorStream.add((char *)"Failed to decode IE: bearerContextsToBeRemoved\n");
2464 return false;
2465 }
2466 }
2467
2468 else
2469 {
2470 // Unknown IE instance print error
2471 errorStream.add((char *)"Unknown IE Type: ");
2472 errorStream.add(ieHeader.ieType);
2473 errorStream.endOfLine();
2474 buffer.skipBytes(ieHeader.length);
2475 }
2476 break;
2477 }
2478
2479 case TraceInformationIeType:
2480 {
2481 TraceInformationIe ieObject =
2482 dynamic_cast<
2483 TraceInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(TraceInformationIeType));
2484
2485 if(ieHeader.instance == 0)
2486 {
2487 rc = ieObject.decodeTraceInformationIe(buffer, data.traceInformation, ieHeader.length);
2488
2489 data.traceInformationIePresent = true;
2490 if (!(rc))
2491 {
2492 errorStream.add((char *)"Failed to decode IE: traceInformation\n");
2493 return false;
2494 }
2495 }
2496
2497 else
2498 {
2499 // Unknown IE instance print error
2500 errorStream.add((char *)"Unknown IE Type: ");
2501 errorStream.add(ieHeader.ieType);
2502 errorStream.endOfLine();
2503 buffer.skipBytes(ieHeader.length);
2504 }
2505 break;
2506 }
2507
2508 case RecoveryIeType:
2509 {
2510 RecoveryIe ieObject =
2511 dynamic_cast<
2512 RecoveryIe&>(GtpV2IeFactory::getInstance().getIeObject(RecoveryIeType));
2513
2514 if(ieHeader.instance == 0)
2515 {
2516 rc = ieObject.decodeRecoveryIe(buffer, data.recovery, ieHeader.length);
2517
2518 data.recoveryIePresent = true;
2519 if (!(rc))
2520 {
2521 errorStream.add((char *)"Failed to decode IE: recovery\n");
2522 return false;
2523 }
2524 }
2525
2526 else
2527 {
2528 // Unknown IE instance print error
2529 errorStream.add((char *)"Unknown IE Type: ");
2530 errorStream.add(ieHeader.ieType);
2531 errorStream.endOfLine();
2532 buffer.skipBytes(ieHeader.length);
2533 }
2534 break;
2535 }
2536
2537 case FqCsidIeType:
2538 {
2539 FqCsidIe ieObject =
2540 dynamic_cast<
2541 FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
2542
2543 if(ieHeader.instance == 0)
2544 {
2545 rc = ieObject.decodeFqCsidIe(buffer, data.mmeFqCsid, ieHeader.length);
2546
2547 data.mmeFqCsidIePresent = true;
2548 if (!(rc))
2549 {
2550 errorStream.add((char *)"Failed to decode IE: mmeFqCsid\n");
2551 return false;
2552 }
2553 }
2554 else if(ieHeader.instance == 1)
2555 {
2556 rc = ieObject.decodeFqCsidIe(buffer, data.sgwFqCsid, ieHeader.length);
2557
2558 data.sgwFqCsidIePresent = true;
2559 if (!(rc))
2560 {
2561 errorStream.add((char *)"Failed to decode IE: sgwFqCsid\n");
2562 return false;
2563 }
2564 }
2565 else if(ieHeader.instance == 2)
2566 {
2567 rc = ieObject.decodeFqCsidIe(buffer, data.epdgFqCsid, ieHeader.length);
2568
2569 data.epdgFqCsidIePresent = true;
2570 if (!(rc))
2571 {
2572 errorStream.add((char *)"Failed to decode IE: epdgFqCsid\n");
2573 return false;
2574 }
2575 }
2576 else if(ieHeader.instance == 3)
2577 {
2578 rc = ieObject.decodeFqCsidIe(buffer, data.twanFqCsid, ieHeader.length);
2579
2580 data.twanFqCsidIePresent = true;
2581 if (!(rc))
2582 {
2583 errorStream.add((char *)"Failed to decode IE: twanFqCsid\n");
2584 return false;
2585 }
2586 }
2587
2588 else
2589 {
2590 // Unknown IE instance print error
2591 errorStream.add((char *)"Unknown IE Type: ");
2592 errorStream.add(ieHeader.ieType);
2593 errorStream.endOfLine();
2594 buffer.skipBytes(ieHeader.length);
2595 }
2596 break;
2597 }
2598
2599 case UeTimeZoneIeType:
2600 {
2601 UeTimeZoneIe ieObject =
2602 dynamic_cast<
2603 UeTimeZoneIe&>(GtpV2IeFactory::getInstance().getIeObject(UeTimeZoneIeType));
2604
2605 if(ieHeader.instance == 0)
2606 {
2607 rc = ieObject.decodeUeTimeZoneIe(buffer, data.ueTimeZone, ieHeader.length);
2608
2609 data.ueTimeZoneIePresent = true;
2610 if (!(rc))
2611 {
2612 errorStream.add((char *)"Failed to decode IE: ueTimeZone\n");
2613 return false;
2614 }
2615 }
2616
2617 else
2618 {
2619 // Unknown IE instance print error
2620 errorStream.add((char *)"Unknown IE Type: ");
2621 errorStream.add(ieHeader.ieType);
2622 errorStream.endOfLine();
2623 buffer.skipBytes(ieHeader.length);
2624 }
2625 break;
2626 }
2627
2628 case UciIeType:
2629 {
2630 UciIe ieObject =
2631 dynamic_cast<
2632 UciIe&>(GtpV2IeFactory::getInstance().getIeObject(UciIeType));
2633
2634 if(ieHeader.instance == 0)
2635 {
2636 rc = ieObject.decodeUciIe(buffer, data.userCsgInformation, ieHeader.length);
2637
2638 data.userCsgInformationIePresent = true;
2639 if (!(rc))
2640 {
2641 errorStream.add((char *)"Failed to decode IE: userCsgInformation\n");
2642 return false;
2643 }
2644 }
2645
2646 else
2647 {
2648 // Unknown IE instance print error
2649 errorStream.add((char *)"Unknown IE Type: ");
2650 errorStream.add(ieHeader.ieType);
2651 errorStream.endOfLine();
2652 buffer.skipBytes(ieHeader.length);
2653 }
2654 break;
2655 }
2656
2657 case ChargingCharacteristicsIeType:
2658 {
2659 ChargingCharacteristicsIe ieObject =
2660 dynamic_cast<
2661 ChargingCharacteristicsIe&>(GtpV2IeFactory::getInstance().getIeObject(ChargingCharacteristicsIeType));
2662
2663 if(ieHeader.instance == 0)
2664 {
2665 rc = ieObject.decodeChargingCharacteristicsIe(buffer, data.chargingCharacteristics, ieHeader.length);
2666
2667 data.chargingCharacteristicsIePresent = true;
2668 if (!(rc))
2669 {
2670 errorStream.add((char *)"Failed to decode IE: chargingCharacteristics\n");
2671 return false;
2672 }
2673 }
2674
2675 else
2676 {
2677 // Unknown IE instance print error
2678 errorStream.add((char *)"Unknown IE Type: ");
2679 errorStream.add(ieHeader.ieType);
2680 errorStream.endOfLine();
2681 buffer.skipBytes(ieHeader.length);
2682 }
2683 break;
2684 }
2685
2686 case LocalDistinguishedNameIeType:
2687 {
2688 LocalDistinguishedNameIe ieObject =
2689 dynamic_cast<
2690 LocalDistinguishedNameIe&>(GtpV2IeFactory::getInstance().getIeObject(LocalDistinguishedNameIeType));
2691
2692 if(ieHeader.instance == 0)
2693 {
2694 rc = ieObject.decodeLocalDistinguishedNameIe(buffer, data.mmeS4SgsnLdn, ieHeader.length);
2695
2696 data.mmeS4SgsnLdnIePresent = true;
2697 if (!(rc))
2698 {
2699 errorStream.add((char *)"Failed to decode IE: mmeS4SgsnLdn\n");
2700 return false;
2701 }
2702 }
2703 else if(ieHeader.instance == 1)
2704 {
2705 rc = ieObject.decodeLocalDistinguishedNameIe(buffer, data.sgwLdn, ieHeader.length);
2706
2707 data.sgwLdnIePresent = true;
2708 if (!(rc))
2709 {
2710 errorStream.add((char *)"Failed to decode IE: sgwLdn\n");
2711 return false;
2712 }
2713 }
2714 else if(ieHeader.instance == 2)
2715 {
2716 rc = ieObject.decodeLocalDistinguishedNameIe(buffer, data.epdgLdn, ieHeader.length);
2717
2718 data.epdgLdnIePresent = true;
2719 if (!(rc))
2720 {
2721 errorStream.add((char *)"Failed to decode IE: epdgLdn\n");
2722 return false;
2723 }
2724 }
2725 else if(ieHeader.instance == 3)
2726 {
2727 rc = ieObject.decodeLocalDistinguishedNameIe(buffer, data.twanLdn, ieHeader.length);
2728
2729 data.twanLdnIePresent = true;
2730 if (!(rc))
2731 {
2732 errorStream.add((char *)"Failed to decode IE: twanLdn\n");
2733 return false;
2734 }
2735 }
2736
2737 else
2738 {
2739 // Unknown IE instance print error
2740 errorStream.add((char *)"Unknown IE Type: ");
2741 errorStream.add(ieHeader.ieType);
2742 errorStream.endOfLine();
2743 buffer.skipBytes(ieHeader.length);
2744 }
2745 break;
2746 }
2747
2748 case SignallingPriorityIndicationIeType:
2749 {
2750 SignallingPriorityIndicationIe ieObject =
2751 dynamic_cast<
2752 SignallingPriorityIndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(SignallingPriorityIndicationIeType));
2753
2754 if(ieHeader.instance == 0)
2755 {
2756 rc = ieObject.decodeSignallingPriorityIndicationIe(buffer, data.signallingPriorityIndication, ieHeader.length);
2757
2758 data.signallingPriorityIndicationIePresent = true;
2759 if (!(rc))
2760 {
2761 errorStream.add((char *)"Failed to decode IE: signallingPriorityIndication\n");
2762 return false;
2763 }
2764 }
2765
2766 else
2767 {
2768 // Unknown IE instance print error
2769 errorStream.add((char *)"Unknown IE Type: ");
2770 errorStream.add(ieHeader.ieType);
2771 errorStream.endOfLine();
2772 buffer.skipBytes(ieHeader.length);
2773 }
2774 break;
2775 }
2776
2777 case IpAddressIeType:
2778 {
2779 IpAddressIe ieObject =
2780 dynamic_cast<
2781 IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
2782
2783 if(ieHeader.instance == 0)
2784 {
2785 rc = ieObject.decodeIpAddressIe(buffer, data.ueLocalIpAddress, ieHeader.length);
2786
2787 data.ueLocalIpAddressIePresent = true;
2788 if (!(rc))
2789 {
2790 errorStream.add((char *)"Failed to decode IE: ueLocalIpAddress\n");
2791 return false;
2792 }
2793 }
2794 else if(ieHeader.instance == 1)
2795 {
2796 rc = ieObject.decodeIpAddressIe(buffer, data.hNbLocalIpAddress, ieHeader.length);
2797
2798 data.hNbLocalIpAddressIePresent = true;
2799 if (!(rc))
2800 {
2801 errorStream.add((char *)"Failed to decode IE: hNbLocalIpAddress\n");
2802 return false;
2803 }
2804 }
2805 else if(ieHeader.instance == 2)
2806 {
2807 rc = ieObject.decodeIpAddressIe(buffer, data.mmeS4SgsnIdentifier, ieHeader.length);
2808
2809 data.mmeS4SgsnIdentifierIePresent = true;
2810 if (!(rc))
2811 {
2812 errorStream.add((char *)"Failed to decode IE: mmeS4SgsnIdentifier\n");
2813 return false;
2814 }
2815 }
2816 else if(ieHeader.instance == 3)
2817 {
2818 rc = ieObject.decodeIpAddressIe(buffer, data.epdgIpAddress, ieHeader.length);
2819
2820 data.epdgIpAddressIePresent = true;
2821 if (!(rc))
2822 {
2823 errorStream.add((char *)"Failed to decode IE: epdgIpAddress\n");
2824 return false;
2825 }
2826 }
2827
2828 else
2829 {
2830 // Unknown IE instance print error
2831 errorStream.add((char *)"Unknown IE Type: ");
2832 errorStream.add(ieHeader.ieType);
2833 errorStream.endOfLine();
2834 buffer.skipBytes(ieHeader.length);
2835 }
2836 break;
2837 }
2838
2839 case PortNumberIeType:
2840 {
2841 PortNumberIe ieObject =
2842 dynamic_cast<
2843 PortNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(PortNumberIeType));
2844
2845 if(ieHeader.instance == 0)
2846 {
2847 rc = ieObject.decodePortNumberIe(buffer, data.ueUdpPort, ieHeader.length);
2848
2849 data.ueUdpPortIePresent = true;
2850 if (!(rc))
2851 {
2852 errorStream.add((char *)"Failed to decode IE: ueUdpPort\n");
2853 return false;
2854 }
2855 }
2856 else if(ieHeader.instance == 1)
2857 {
2858 rc = ieObject.decodePortNumberIe(buffer, data.hNbUdpPort, ieHeader.length);
2859
2860 data.hNbUdpPortIePresent = true;
2861 if (!(rc))
2862 {
2863 errorStream.add((char *)"Failed to decode IE: hNbUdpPort\n");
2864 return false;
2865 }
2866 }
2867 else if(ieHeader.instance == 2)
2868 {
2869 rc = ieObject.decodePortNumberIe(buffer, data.ueTcpPort, ieHeader.length);
2870
2871 data.ueTcpPortIePresent = true;
2872 if (!(rc))
2873 {
2874 errorStream.add((char *)"Failed to decode IE: ueTcpPort\n");
2875 return false;
2876 }
2877 }
2878
2879 else
2880 {
2881 // Unknown IE instance print error
2882 errorStream.add((char *)"Unknown IE Type: ");
2883 errorStream.add(ieHeader.ieType);
2884 errorStream.endOfLine();
2885 buffer.skipBytes(ieHeader.length);
2886 }
2887 break;
2888 }
2889
2890 case AdditionalProtocolConfigurationOptionsIeType:
2891 {
2892 AdditionalProtocolConfigurationOptionsIe ieObject =
2893 dynamic_cast<
2894 AdditionalProtocolConfigurationOptionsIe&>(GtpV2IeFactory::getInstance().getIeObject(AdditionalProtocolConfigurationOptionsIeType));
2895
2896 if(ieHeader.instance == 0)
2897 {
2898 rc = ieObject.decodeAdditionalProtocolConfigurationOptionsIe(buffer, data.additionalProtocolConfigurationOptions, ieHeader.length);
2899
2900 data.additionalProtocolConfigurationOptionsIePresent = true;
2901 if (!(rc))
2902 {
2903 errorStream.add((char *)"Failed to decode IE: additionalProtocolConfigurationOptions\n");
2904 return false;
2905 }
2906 }
2907
2908 else
2909 {
2910 // Unknown IE instance print error
2911 errorStream.add((char *)"Unknown IE Type: ");
2912 errorStream.add(ieHeader.ieType);
2913 errorStream.endOfLine();
2914 buffer.skipBytes(ieHeader.length);
2915 }
2916 break;
2917 }
2918
2919 case TwanIdentifierIeType:
2920 {
2921 TwanIdentifierIe ieObject =
2922 dynamic_cast<
2923 TwanIdentifierIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierIeType));
2924
2925 if(ieHeader.instance == 0)
2926 {
2927 rc = ieObject.decodeTwanIdentifierIe(buffer, data.twanIdentifier, ieHeader.length);
2928
2929 data.twanIdentifierIePresent = true;
2930 if (!(rc))
2931 {
2932 errorStream.add((char *)"Failed to decode IE: twanIdentifier\n");
2933 return false;
2934 }
2935 }
2936 else if(ieHeader.instance == 1)
2937 {
2938 rc = ieObject.decodeTwanIdentifierIe(buffer, data.wlanLocationInformation, ieHeader.length);
2939
2940 data.wlanLocationInformationIePresent = true;
2941 if (!(rc))
2942 {
2943 errorStream.add((char *)"Failed to decode IE: wlanLocationInformation\n");
2944 return false;
2945 }
2946 }
2947
2948 else
2949 {
2950 // Unknown IE instance print error
2951 errorStream.add((char *)"Unknown IE Type: ");
2952 errorStream.add(ieHeader.ieType);
2953 errorStream.endOfLine();
2954 buffer.skipBytes(ieHeader.length);
2955 }
2956 break;
2957 }
2958
2959 case CnOperatorSelectionEntityIeType:
2960 {
2961 CnOperatorSelectionEntityIe ieObject =
2962 dynamic_cast<
2963 CnOperatorSelectionEntityIe&>(GtpV2IeFactory::getInstance().getIeObject(CnOperatorSelectionEntityIeType));
2964
2965 if(ieHeader.instance == 0)
2966 {
2967 rc = ieObject.decodeCnOperatorSelectionEntityIe(buffer, data.cnOperatorSelectionEntity, ieHeader.length);
2968
2969 data.cnOperatorSelectionEntityIePresent = true;
2970 if (!(rc))
2971 {
2972 errorStream.add((char *)"Failed to decode IE: cnOperatorSelectionEntity\n");
2973 return false;
2974 }
2975 }
2976
2977 else
2978 {
2979 // Unknown IE instance print error
2980 errorStream.add((char *)"Unknown IE Type: ");
2981 errorStream.add(ieHeader.ieType);
2982 errorStream.endOfLine();
2983 buffer.skipBytes(ieHeader.length);
2984 }
2985 break;
2986 }
2987
2988 case OverloadControlInformationIeType:
2989 {
2990 OverloadControlInformationIe ieObject =
2991 dynamic_cast<
2992 OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
2993
2994 if(ieHeader.instance == 0)
2995 {
2996 MmeS4SgsnsOverloadControlInformationInCreateSessionRequest groupedIeInstance =
2997 dynamic_cast<
2998 MmeS4SgsnsOverloadControlInformationInCreateSessionRequest&>(ieObject.getGroupedIe(msgType, 0));
2999 rc = groupedIeInstance.decodeMmeS4SgsnsOverloadControlInformationInCreateSessionRequest(buffer, data.mmeS4SgsnsOverloadControlInformation, ieHeader.length);
3000
3001 data.mmeS4SgsnsOverloadControlInformationIePresent = true;
3002 if (!(rc))
3003 {
3004 errorStream.add((char *)"Failed to decode IE: mmeS4SgsnsOverloadControlInformation\n");
3005 return false;
3006 }
3007 }
3008 else if(ieHeader.instance == 1)
3009 {
3010 SgwsOverloadControlInformationInCreateSessionRequest groupedIeInstance =
3011 dynamic_cast<
3012 SgwsOverloadControlInformationInCreateSessionRequest&>(ieObject.getGroupedIe(msgType, 1));
3013 rc = groupedIeInstance.decodeSgwsOverloadControlInformationInCreateSessionRequest(buffer, data.sgwsOverloadControlInformation, ieHeader.length);
3014
3015 data.sgwsOverloadControlInformationIePresent = true;
3016 if (!(rc))
3017 {
3018 errorStream.add((char *)"Failed to decode IE: sgwsOverloadControlInformation\n");
3019 return false;
3020 }
3021 }
3022 else if(ieHeader.instance == 2)
3023 {
3024 TwanEpdgsOverloadControlInformationInCreateSessionRequest groupedIeInstance =
3025 dynamic_cast<
3026 TwanEpdgsOverloadControlInformationInCreateSessionRequest&>(ieObject.getGroupedIe(msgType, 2));
3027 rc = groupedIeInstance.decodeTwanEpdgsOverloadControlInformationInCreateSessionRequest(buffer, data.twanEpdgsOverloadControlInformation, ieHeader.length);
3028
3029 data.twanEpdgsOverloadControlInformationIePresent = true;
3030 if (!(rc))
3031 {
3032 errorStream.add((char *)"Failed to decode IE: twanEpdgsOverloadControlInformation\n");
3033 return false;
3034 }
3035 }
3036
3037 else
3038 {
3039 // Unknown IE instance print error
3040 errorStream.add((char *)"Unknown IE Type: ");
3041 errorStream.add(ieHeader.ieType);
3042 errorStream.endOfLine();
3043 buffer.skipBytes(ieHeader.length);
3044 }
3045 break;
3046 }
3047
3048 case MillisecondTimeStampIeType:
3049 {
3050 MillisecondTimeStampIe ieObject =
3051 dynamic_cast<
3052 MillisecondTimeStampIe&>(GtpV2IeFactory::getInstance().getIeObject(MillisecondTimeStampIeType));
3053
3054 if(ieHeader.instance == 0)
3055 {
3056 rc = ieObject.decodeMillisecondTimeStampIe(buffer, data.originationTimeStamp, ieHeader.length);
3057
3058 data.originationTimeStampIePresent = true;
3059 if (!(rc))
3060 {
3061 errorStream.add((char *)"Failed to decode IE: originationTimeStamp\n");
3062 return false;
3063 }
3064 }
3065
3066 else
3067 {
3068 // Unknown IE instance print error
3069 errorStream.add((char *)"Unknown IE Type: ");
3070 errorStream.add(ieHeader.ieType);
3071 errorStream.endOfLine();
3072 buffer.skipBytes(ieHeader.length);
3073 }
3074 break;
3075 }
3076
3077 case IntegerNumberIeType:
3078 {
3079 IntegerNumberIe ieObject =
3080 dynamic_cast<
3081 IntegerNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(IntegerNumberIeType));
3082
3083 if(ieHeader.instance == 0)
3084 {
3085 rc = ieObject.decodeIntegerNumberIe(buffer, data.maximumWaitTime, ieHeader.length);
3086
3087 data.maximumWaitTimeIePresent = true;
3088 if (!(rc))
3089 {
3090 errorStream.add((char *)"Failed to decode IE: maximumWaitTime\n");
3091 return false;
3092 }
3093 }
3094
3095 else
3096 {
3097 // Unknown IE instance print error
3098 errorStream.add((char *)"Unknown IE Type: ");
3099 errorStream.add(ieHeader.ieType);
3100 errorStream.endOfLine();
3101 buffer.skipBytes(ieHeader.length);
3102 }
3103 break;
3104 }
3105
3106 case TwanIdentifierTimestampIeType:
3107 {
3108 TwanIdentifierTimestampIe ieObject =
3109 dynamic_cast<
3110 TwanIdentifierTimestampIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierTimestampIeType));
3111
3112 if(ieHeader.instance == 0)
3113 {
3114 rc = ieObject.decodeTwanIdentifierTimestampIe(buffer, data.wlanLocationTimestamp, ieHeader.length);
3115
3116 data.wlanLocationTimestampIePresent = true;
3117 if (!(rc))
3118 {
3119 errorStream.add((char *)"Failed to decode IE: wlanLocationTimestamp\n");
3120 return false;
3121 }
3122 }
3123
3124 else
3125 {
3126 // Unknown IE instance print error
3127 errorStream.add((char *)"Unknown IE Type: ");
3128 errorStream.add(ieHeader.ieType);
3129 errorStream.endOfLine();
3130 buffer.skipBytes(ieHeader.length);
3131 }
3132 break;
3133 }
3134
3135 case FContainerIeType:
3136 {
3137 FContainerIe ieObject =
3138 dynamic_cast<
3139 FContainerIe&>(GtpV2IeFactory::getInstance().getIeObject(FContainerIeType));
3140
3141 if(ieHeader.instance == 0)
3142 {
3143 rc = ieObject.decodeFContainerIe(buffer, data.nbifomContainer, ieHeader.length);
3144
3145 data.nbifomContainerIePresent = true;
3146 if (!(rc))
3147 {
3148 errorStream.add((char *)"Failed to decode IE: nbifomContainer\n");
3149 return false;
3150 }
3151 }
3152
3153 else
3154 {
3155 // Unknown IE instance print error
3156 errorStream.add((char *)"Unknown IE Type: ");
3157 errorStream.add(ieHeader.ieType);
3158 errorStream.endOfLine();
3159 buffer.skipBytes(ieHeader.length);
3160 }
3161 break;
3162 }
3163
3164 case RemoteUeContextIeType:
3165 {
3166 RemoteUeContextIe ieObject =
3167 dynamic_cast<
3168 RemoteUeContextIe&>(GtpV2IeFactory::getInstance().getIeObject(RemoteUeContextIeType));
3169
3170 if(ieHeader.instance == 0)
3171 {
3172 RemoteUeContextConnectedInCreateSessionRequest groupedIeInstance =
3173 dynamic_cast<
3174 RemoteUeContextConnectedInCreateSessionRequest&>(ieObject.getGroupedIe(msgType, 0));
3175 rc = groupedIeInstance.decodeRemoteUeContextConnectedInCreateSessionRequest(buffer, data.remoteUeContextConnected, ieHeader.length);
3176
3177 data.remoteUeContextConnectedIePresent = true;
3178 if (!(rc))
3179 {
3180 errorStream.add((char *)"Failed to decode IE: remoteUeContextConnected\n");
3181 return false;
3182 }
3183 }
3184
3185 else
3186 {
3187 // Unknown IE instance print error
3188 errorStream.add((char *)"Unknown IE Type: ");
3189 errorStream.add(ieHeader.ieType);
3190 errorStream.endOfLine();
3191 buffer.skipBytes(ieHeader.length);
3192 }
3193 break;
3194 }
3195
3196 case NodeIdentifierIeType:
3197 {
3198 NodeIdentifierIe ieObject =
3199 dynamic_cast<
3200 NodeIdentifierIe&>(GtpV2IeFactory::getInstance().getIeObject(NodeIdentifierIeType));
3201
3202 if(ieHeader.instance == 0)
3203 {
3204 rc = ieObject.decodeNodeIdentifierIe(buffer, data.a3gppAaaServerIdentifier, ieHeader.length);
3205
3206 data.a3gppAaaServerIdentifierIePresent = true;
3207 if (!(rc))
3208 {
3209 errorStream.add((char *)"Failed to decode IE: a3gppAaaServerIdentifier\n");
3210 return false;
3211 }
3212 }
3213
3214 else
3215 {
3216 // Unknown IE instance print error
3217 errorStream.add((char *)"Unknown IE Type: ");
3218 errorStream.add(ieHeader.ieType);
3219 errorStream.endOfLine();
3220 buffer.skipBytes(ieHeader.length);
3221 }
3222 break;
3223 }
3224
3225 case EpcoIeType:
3226 {
3227 EpcoIe ieObject =
3228 dynamic_cast<
3229 EpcoIe&>(GtpV2IeFactory::getInstance().getIeObject(EpcoIeType));
3230
3231 if(ieHeader.instance == 0)
3232 {
3233 rc = ieObject.decodeEpcoIe(buffer, data.extendedProtocolConfigurationOptions, ieHeader.length);
3234
3235 data.extendedProtocolConfigurationOptionsIePresent = true;
3236 if (!(rc))
3237 {
3238 errorStream.add((char *)"Failed to decode IE: extendedProtocolConfigurationOptions\n");
3239 return false;
3240 }
3241 }
3242
3243 else
3244 {
3245 // Unknown IE instance print error
3246 errorStream.add((char *)"Unknown IE Type: ");
3247 errorStream.add(ieHeader.ieType);
3248 errorStream.endOfLine();
3249 buffer.skipBytes(ieHeader.length);
3250 }
3251 break;
3252 }
3253
3254 case ServingPlmnRateControlIeType:
3255 {
3256 ServingPlmnRateControlIe ieObject =
3257 dynamic_cast<
3258 ServingPlmnRateControlIe&>(GtpV2IeFactory::getInstance().getIeObject(ServingPlmnRateControlIeType));
3259
3260 if(ieHeader.instance == 0)
3261 {
3262 rc = ieObject.decodeServingPlmnRateControlIe(buffer, data.servingPlmnRateControl, ieHeader.length);
3263
3264 data.servingPlmnRateControlIePresent = true;
3265 if (!(rc))
3266 {
3267 errorStream.add((char *)"Failed to decode IE: servingPlmnRateControl\n");
3268 return false;
3269 }
3270 }
3271
3272 else
3273 {
3274 // Unknown IE instance print error
3275 errorStream.add((char *)"Unknown IE Type: ");
3276 errorStream.add(ieHeader.ieType);
3277 errorStream.endOfLine();
3278 buffer.skipBytes(ieHeader.length);
3279 }
3280 break;
3281 }
3282
3283 case CounterIeType:
3284 {
3285 CounterIe ieObject =
3286 dynamic_cast<
3287 CounterIe&>(GtpV2IeFactory::getInstance().getIeObject(CounterIeType));
3288
3289 if(ieHeader.instance == 0)
3290 {
3291 rc = ieObject.decodeCounterIe(buffer, data.moExceptionDataCounter, ieHeader.length);
3292
3293 data.moExceptionDataCounterIePresent = true;
3294 if (!(rc))
3295 {
3296 errorStream.add((char *)"Failed to decode IE: moExceptionDataCounter\n");
3297 return false;
3298 }
3299 }
3300
3301 else
3302 {
3303 // Unknown IE instance print error
3304 errorStream.add((char *)"Unknown IE Type: ");
3305 errorStream.add(ieHeader.ieType);
3306 errorStream.endOfLine();
3307 buffer.skipBytes(ieHeader.length);
3308 }
3309 break;
3310 }
3311
3312 case MappedUeUsageTypeIeType:
3313 {
3314 MappedUeUsageTypeIe ieObject =
3315 dynamic_cast<
3316 MappedUeUsageTypeIe&>(GtpV2IeFactory::getInstance().getIeObject(MappedUeUsageTypeIeType));
3317
3318 if(ieHeader.instance == 0)
3319 {
3320 rc = ieObject.decodeMappedUeUsageTypeIe(buffer, data.mappedUeUsageType, ieHeader.length);
3321
3322 data.mappedUeUsageTypeIePresent = true;
3323 if (!(rc))
3324 {
3325 errorStream.add((char *)"Failed to decode IE: mappedUeUsageType\n");
3326 return false;
3327 }
3328 }
3329
3330 else
3331 {
3332 // Unknown IE instance print error
3333 errorStream.add((char *)"Unknown IE Type: ");
3334 errorStream.add(ieHeader.ieType);
3335 errorStream.endOfLine();
3336 buffer.skipBytes(ieHeader.length);
3337 }
3338 break;
3339 }
3340
3341 case FqdnIeType:
3342 {
3343 FqdnIe ieObject =
3344 dynamic_cast<
3345 FqdnIe&>(GtpV2IeFactory::getInstance().getIeObject(FqdnIeType));
3346
3347 if(ieHeader.instance == 0)
3348 {
3349 rc = ieObject.decodeFqdnIe(buffer, data.sgwUNodeName, ieHeader.length);
3350
3351 data.sgwUNodeNameIePresent = true;
3352 if (!(rc))
3353 {
3354 errorStream.add((char *)"Failed to decode IE: sgwUNodeName\n");
3355 return false;
3356 }
3357 }
3358
3359 else
3360 {
3361 // Unknown IE instance print error
3362 errorStream.add((char *)"Unknown IE Type: ");
3363 errorStream.add(ieHeader.ieType);
3364 errorStream.endOfLine();
3365 buffer.skipBytes(ieHeader.length);
3366 }
3367 break;
3368 }
3369
3370 case SecondaryRatUsageDataReportIeType:
3371 {
3372 SecondaryRatUsageDataReportIe ieObject =
3373 dynamic_cast<
3374 SecondaryRatUsageDataReportIe&>(GtpV2IeFactory::getInstance().getIeObject(SecondaryRatUsageDataReportIeType));
3375
3376 if(ieHeader.instance == 0)
3377 {
3378 rc = ieObject.decodeSecondaryRatUsageDataReportIe(buffer, data.secondaryRatUsageDataReport, ieHeader.length);
3379
3380 data.secondaryRatUsageDataReportIePresent = true;
3381 if (!(rc))
3382 {
3383 errorStream.add((char *)"Failed to decode IE: secondaryRatUsageDataReport\n");
3384 return false;
3385 }
3386 }
3387
3388 else
3389 {
3390 // Unknown IE instance print error
3391 errorStream.add((char *)"Unknown IE Type: ");
3392 errorStream.add(ieHeader.ieType);
3393 errorStream.endOfLine();
3394 buffer.skipBytes(ieHeader.length);
3395 }
3396 break;
3397 }
3398
3399 case UpFunctionSelectionIndicationFlagsIeType:
3400 {
3401 UpFunctionSelectionIndicationFlagsIe ieObject =
3402 dynamic_cast<
3403 UpFunctionSelectionIndicationFlagsIe&>(GtpV2IeFactory::getInstance().getIeObject(UpFunctionSelectionIndicationFlagsIeType));
3404
3405 if(ieHeader.instance == 0)
3406 {
3407 rc = ieObject.decodeUpFunctionSelectionIndicationFlagsIe(buffer, data.upFunctionSelectionIndicationFlags, ieHeader.length);
3408
3409 data.upFunctionSelectionIndicationFlagsIePresent = true;
3410 if (!(rc))
3411 {
3412 errorStream.add((char *)"Failed to decode IE: upFunctionSelectionIndicationFlags\n");
3413 return false;
3414 }
3415 }
3416
3417 else
3418 {
3419 // Unknown IE instance print error
3420 errorStream.add((char *)"Unknown IE Type: ");
3421 errorStream.add(ieHeader.ieType);
3422 errorStream.endOfLine();
3423 buffer.skipBytes(ieHeader.length);
3424 }
3425 break;
3426 }
3427
3428 default:
3429 {
3430 // Unknown IE print error
3431 errorStream.add((char *)"Unknown IE Type: ");
3432 errorStream.add(ieHeader.ieType);
3433 errorStream.endOfLine();
3434 buffer.skipBytes(ieHeader.length);
3435 }
3436 }
3437 }
3438 return rc; // TODO validations
3439}
3440
3441void CreateSessionRequestMsg::
3442displayCreateSessionRequestMsgData_v(CreateSessionRequestMsgData const &data, Debug &stream)
3443{
3444 stream.incrIndent();
3445 stream.add((char *)"CreateSessionRequestMsg:");
3446 stream.endOfLine();
3447 stream.incrIndent();
3448
3449
3450 if (data.imsiIePresent)
3451 {
3452
3453
3454 stream.add((char *)"IE - imsi:");
3455 stream.endOfLine();
3456 ImsiIe imsi=
3457 dynamic_cast<
3458 ImsiIe&>(GtpV2IeFactory::getInstance().getIeObject(ImsiIeType));
3459 imsi.displayImsiIe_v(data.imsi, stream);
3460
3461 }
3462 if (data.msisdnIePresent)
3463 {
3464
3465
3466 stream.add((char *)"IE - msisdn:");
3467 stream.endOfLine();
3468 MsisdnIe msisdn=
3469 dynamic_cast<
3470 MsisdnIe&>(GtpV2IeFactory::getInstance().getIeObject(MsisdnIeType));
3471 msisdn.displayMsisdnIe_v(data.msisdn, stream);
3472
3473 }
3474 if (data.meIdentityIePresent)
3475 {
3476
3477
3478 stream.add((char *)"IE - meIdentity:");
3479 stream.endOfLine();
3480 MeiIe mei=
3481 dynamic_cast<
3482 MeiIe&>(GtpV2IeFactory::getInstance().getIeObject(MeiIeType));
3483 mei.displayMeiIe_v(data.meIdentity, stream);
3484
3485 }
3486 if (data.userLocationInformationIePresent)
3487 {
3488
3489
3490 stream.add((char *)"IE - userLocationInformation:");
3491 stream.endOfLine();
3492 UliIe uli=
3493 dynamic_cast<
3494 UliIe&>(GtpV2IeFactory::getInstance().getIeObject(UliIeType));
3495 uli.displayUliIe_v(data.userLocationInformation, stream);
3496
3497 }
3498 if (data.servingNetworkIePresent)
3499 {
3500
3501
3502 stream.add((char *)"IE - servingNetwork:");
3503 stream.endOfLine();
3504 ServingNetworkIe servingNetwork=
3505 dynamic_cast<
3506 ServingNetworkIe&>(GtpV2IeFactory::getInstance().getIeObject(ServingNetworkIeType));
3507 servingNetwork.displayServingNetworkIe_v(data.servingNetwork, stream);
3508
3509 }
3510 stream.add((char *)"IE - ratType:");
3511 stream.endOfLine();
3512 RatTypeIe ratType=
3513 dynamic_cast<
3514 RatTypeIe&>(GtpV2IeFactory::getInstance().getIeObject(RatTypeIeType));
3515 ratType.displayRatTypeIe_v(data.ratType, stream);
3516
3517 if (data.indicationFlagsIePresent)
3518 {
3519
3520
3521 stream.add((char *)"IE - indicationFlags:");
3522 stream.endOfLine();
3523 IndicationIe indication=
3524 dynamic_cast<
3525 IndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(IndicationIeType));
3526 indication.displayIndicationIe_v(data.indicationFlags, stream);
3527
3528 }
3529 stream.add((char *)"IE - senderFTeidForControlPlane:");
3530 stream.endOfLine();
3531 FTeidIe fTeid=
3532 dynamic_cast<
3533 FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
3534 fTeid.displayFTeidIe_v(data.senderFTeidForControlPlane, stream);
3535
3536 if (data.pgwS5S8AddressForControlPlaneOrPmipIePresent)
3537 {
3538
3539
3540 stream.add((char *)"IE - pgwS5S8AddressForControlPlaneOrPmip:");
3541 stream.endOfLine();
3542 FTeidIe fTeid=
3543 dynamic_cast<
3544 FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
3545 fTeid.displayFTeidIe_v(data.pgwS5S8AddressForControlPlaneOrPmip, stream);
3546
3547 }
3548 stream.add((char *)"IE - accessPointName:");
3549 stream.endOfLine();
3550 ApnIe apn=
3551 dynamic_cast<
3552 ApnIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnIeType));
3553 apn.displayApnIe_v(data.accessPointName, stream);
3554
3555 if (data.selectionModeIePresent)
3556 {
3557
3558
3559 stream.add((char *)"IE - selectionMode:");
3560 stream.endOfLine();
3561 SelectionModeIe selectionMode=
3562 dynamic_cast<
3563 SelectionModeIe&>(GtpV2IeFactory::getInstance().getIeObject(SelectionModeIeType));
3564 selectionMode.displaySelectionModeIe_v(data.selectionMode, stream);
3565
3566 }
3567 if (data.pdnTypeIePresent)
3568 {
3569
3570
3571 stream.add((char *)"IE - pdnType:");
3572 stream.endOfLine();
3573 PdnTypeIe pdnType=
3574 dynamic_cast<
3575 PdnTypeIe&>(GtpV2IeFactory::getInstance().getIeObject(PdnTypeIeType));
3576 pdnType.displayPdnTypeIe_v(data.pdnType, stream);
3577
3578 }
3579 if (data.pdnAddressAllocationIePresent)
3580 {
3581
3582
3583 stream.add((char *)"IE - pdnAddressAllocation:");
3584 stream.endOfLine();
3585 PaaIe paa=
3586 dynamic_cast<
3587 PaaIe&>(GtpV2IeFactory::getInstance().getIeObject(PaaIeType));
3588 paa.displayPaaIe_v(data.pdnAddressAllocation, stream);
3589
3590 }
3591 if (data.maximumApnRestrictionIePresent)
3592 {
3593
3594
3595 stream.add((char *)"IE - maximumApnRestriction:");
3596 stream.endOfLine();
3597 ApnRestrictionIe apnRestriction=
3598 dynamic_cast<
3599 ApnRestrictionIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnRestrictionIeType));
3600 apnRestriction.displayApnRestrictionIe_v(data.maximumApnRestriction, stream);
3601
3602 }
3603 if (data.aggregateMaximumBitRateIePresent)
3604 {
3605
3606
3607 stream.add((char *)"IE - aggregateMaximumBitRate:");
3608 stream.endOfLine();
3609 AmbrIe ambr=
3610 dynamic_cast<
3611 AmbrIe&>(GtpV2IeFactory::getInstance().getIeObject(AmbrIeType));
3612 ambr.displayAmbrIe_v(data.aggregateMaximumBitRate, stream);
3613
3614 }
3615 if (data.linkedEpsBearerIdIePresent)
3616 {
3617
3618
3619 stream.add((char *)"IE - linkedEpsBearerId:");
3620 stream.endOfLine();
3621 EbiIe ebi=
3622 dynamic_cast<
3623 EbiIe&>(GtpV2IeFactory::getInstance().getIeObject(EbiIeType));
3624 ebi.displayEbiIe_v(data.linkedEpsBearerId, stream);
3625
3626 }
3627 if (data.trustedWlanModeIndicationIePresent)
3628 {
3629
3630
3631 stream.add((char *)"IE - trustedWlanModeIndication:");
3632 stream.endOfLine();
3633 TwmiIe twmi=
3634 dynamic_cast<
3635 TwmiIe&>(GtpV2IeFactory::getInstance().getIeObject(TwmiIeType));
3636 twmi.displayTwmiIe_v(data.trustedWlanModeIndication, stream);
3637
3638 }
3639 if (data.protocolConfigurationOptionsIePresent)
3640 {
3641
3642
3643 stream.add((char *)"IE - protocolConfigurationOptions:");
3644 stream.endOfLine();
3645 PcoIe pco=
3646 dynamic_cast<
3647 PcoIe&>(GtpV2IeFactory::getInstance().getIeObject(PcoIeType));
3648 pco.displayPcoIe_v(data.protocolConfigurationOptions, stream);
3649
3650 }
3651
3652 Uint8 displayCount;
3653
3654 displayCount = data.bearerContextsToBeCreatedCount;
3655 if (displayCount > 11)
3656 {
3657 stream.add((char *)"Invalid data more than 11 instances");
3658 stream.endOfLine();
3659 stream.add((char *)"Displaying only 11");
3660 stream.endOfLine();
3661 displayCount = 11;
3662 }
3663 for (Uint8 i = 0; i < displayCount; i++)
3664 {
3665 stream.add((char *)"IE - bearerContextsToBeCreated:");
3666 stream.endOfLine();
3667 BearerContextIe bearerContext=
3668 dynamic_cast<
3669 BearerContextIe&>(GtpV2IeFactory::getInstance().getIeObject(BearerContextIeType));
3670 BearerContextsToBeCreatedInCreateSessionRequest groupedIeInstance =
3671 dynamic_cast<
3672 BearerContextsToBeCreatedInCreateSessionRequest&>(bearerContext.getGroupedIe(msgType, 0));
3673 groupedIeInstance.displayBearerContextsToBeCreatedInCreateSessionRequestData_v(data.bearerContextsToBeCreated[i], stream);
3674
3675 }
3676 displayCount = data.bearerContextsToBeRemovedCount;
3677 if (displayCount > 11)
3678 {
3679 stream.add((char *)"Invalid data more than 11 instances");
3680 stream.endOfLine();
3681 stream.add((char *)"Displaying only 11");
3682 stream.endOfLine();
3683 displayCount = 11;
3684 }
3685 for (Uint8 i = 0; i < displayCount; i++)
3686 {
3687 stream.add((char *)"IE - bearerContextsToBeRemoved:");
3688 stream.endOfLine();
3689 BearerContextIe bearerContext=
3690 dynamic_cast<
3691 BearerContextIe&>(GtpV2IeFactory::getInstance().getIeObject(BearerContextIeType));
3692 BearerContextsToBeRemovedInCreateSessionRequest groupedIeInstance =
3693 dynamic_cast<
3694 BearerContextsToBeRemovedInCreateSessionRequest&>(bearerContext.getGroupedIe(msgType, 1));
3695 groupedIeInstance.displayBearerContextsToBeRemovedInCreateSessionRequestData_v(data.bearerContextsToBeRemoved[i], stream);
3696 }
3697
3698
3699
3700
3701 if (data.traceInformationIePresent)
3702 {
3703
3704
3705 stream.add((char *)"IE - traceInformation:");
3706 stream.endOfLine();
3707 TraceInformationIe traceInformation=
3708 dynamic_cast<
3709 TraceInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(TraceInformationIeType));
3710 traceInformation.displayTraceInformationIe_v(data.traceInformation, stream);
3711
3712 }
3713 if (data.recoveryIePresent)
3714 {
3715
3716
3717 stream.add((char *)"IE - recovery:");
3718 stream.endOfLine();
3719 RecoveryIe recovery=
3720 dynamic_cast<
3721 RecoveryIe&>(GtpV2IeFactory::getInstance().getIeObject(RecoveryIeType));
3722 recovery.displayRecoveryIe_v(data.recovery, stream);
3723
3724 }
3725 if (data.mmeFqCsidIePresent)
3726 {
3727
3728
3729 stream.add((char *)"IE - mmeFqCsid:");
3730 stream.endOfLine();
3731 FqCsidIe fqCsid=
3732 dynamic_cast<
3733 FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
3734 fqCsid.displayFqCsidIe_v(data.mmeFqCsid, stream);
3735
3736 }
3737 if (data.sgwFqCsidIePresent)
3738 {
3739
3740
3741 stream.add((char *)"IE - sgwFqCsid:");
3742 stream.endOfLine();
3743 FqCsidIe fqCsid=
3744 dynamic_cast<
3745 FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
3746 fqCsid.displayFqCsidIe_v(data.sgwFqCsid, stream);
3747
3748 }
3749 if (data.epdgFqCsidIePresent)
3750 {
3751
3752
3753 stream.add((char *)"IE - epdgFqCsid:");
3754 stream.endOfLine();
3755 FqCsidIe fqCsid=
3756 dynamic_cast<
3757 FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
3758 fqCsid.displayFqCsidIe_v(data.epdgFqCsid, stream);
3759
3760 }
3761 if (data.twanFqCsidIePresent)
3762 {
3763
3764
3765 stream.add((char *)"IE - twanFqCsid:");
3766 stream.endOfLine();
3767 FqCsidIe fqCsid=
3768 dynamic_cast<
3769 FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
3770 fqCsid.displayFqCsidIe_v(data.twanFqCsid, stream);
3771
3772 }
3773 if (data.ueTimeZoneIePresent)
3774 {
3775
3776
3777 stream.add((char *)"IE - ueTimeZone:");
3778 stream.endOfLine();
3779 UeTimeZoneIe ueTimeZone=
3780 dynamic_cast<
3781 UeTimeZoneIe&>(GtpV2IeFactory::getInstance().getIeObject(UeTimeZoneIeType));
3782 ueTimeZone.displayUeTimeZoneIe_v(data.ueTimeZone, stream);
3783
3784 }
3785 if (data.userCsgInformationIePresent)
3786 {
3787
3788
3789 stream.add((char *)"IE - userCsgInformation:");
3790 stream.endOfLine();
3791 UciIe uci=
3792 dynamic_cast<
3793 UciIe&>(GtpV2IeFactory::getInstance().getIeObject(UciIeType));
3794 uci.displayUciIe_v(data.userCsgInformation, stream);
3795
3796 }
3797 if (data.chargingCharacteristicsIePresent)
3798 {
3799
3800
3801 stream.add((char *)"IE - chargingCharacteristics:");
3802 stream.endOfLine();
3803 ChargingCharacteristicsIe chargingCharacteristics=
3804 dynamic_cast<
3805 ChargingCharacteristicsIe&>(GtpV2IeFactory::getInstance().getIeObject(ChargingCharacteristicsIeType));
3806 chargingCharacteristics.displayChargingCharacteristicsIe_v(data.chargingCharacteristics, stream);
3807
3808 }
3809 if (data.mmeS4SgsnLdnIePresent)
3810 {
3811
3812
3813 stream.add((char *)"IE - mmeS4SgsnLdn:");
3814 stream.endOfLine();
3815 LocalDistinguishedNameIe localDistinguishedName=
3816 dynamic_cast<
3817 LocalDistinguishedNameIe&>(GtpV2IeFactory::getInstance().getIeObject(LocalDistinguishedNameIeType));
3818 localDistinguishedName.displayLocalDistinguishedNameIe_v(data.mmeS4SgsnLdn, stream);
3819
3820 }
3821 if (data.sgwLdnIePresent)
3822 {
3823
3824
3825 stream.add((char *)"IE - sgwLdn:");
3826 stream.endOfLine();
3827 LocalDistinguishedNameIe localDistinguishedName=
3828 dynamic_cast<
3829 LocalDistinguishedNameIe&>(GtpV2IeFactory::getInstance().getIeObject(LocalDistinguishedNameIeType));
3830 localDistinguishedName.displayLocalDistinguishedNameIe_v(data.sgwLdn, stream);
3831
3832 }
3833 if (data.epdgLdnIePresent)
3834 {
3835
3836
3837 stream.add((char *)"IE - epdgLdn:");
3838 stream.endOfLine();
3839 LocalDistinguishedNameIe localDistinguishedName=
3840 dynamic_cast<
3841 LocalDistinguishedNameIe&>(GtpV2IeFactory::getInstance().getIeObject(LocalDistinguishedNameIeType));
3842 localDistinguishedName.displayLocalDistinguishedNameIe_v(data.epdgLdn, stream);
3843
3844 }
3845 if (data.twanLdnIePresent)
3846 {
3847
3848
3849 stream.add((char *)"IE - twanLdn:");
3850 stream.endOfLine();
3851 LocalDistinguishedNameIe localDistinguishedName=
3852 dynamic_cast<
3853 LocalDistinguishedNameIe&>(GtpV2IeFactory::getInstance().getIeObject(LocalDistinguishedNameIeType));
3854 localDistinguishedName.displayLocalDistinguishedNameIe_v(data.twanLdn, stream);
3855
3856 }
3857 if (data.signallingPriorityIndicationIePresent)
3858 {
3859
3860
3861 stream.add((char *)"IE - signallingPriorityIndication:");
3862 stream.endOfLine();
3863 SignallingPriorityIndicationIe signallingPriorityIndication=
3864 dynamic_cast<
3865 SignallingPriorityIndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(SignallingPriorityIndicationIeType));
3866 signallingPriorityIndication.displaySignallingPriorityIndicationIe_v(data.signallingPriorityIndication, stream);
3867
3868 }
3869 if (data.ueLocalIpAddressIePresent)
3870 {
3871
3872
3873 stream.add((char *)"IE - ueLocalIpAddress:");
3874 stream.endOfLine();
3875 IpAddressIe ipAddress=
3876 dynamic_cast<
3877 IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
3878 ipAddress.displayIpAddressIe_v(data.ueLocalIpAddress, stream);
3879
3880 }
3881 if (data.ueUdpPortIePresent)
3882 {
3883
3884
3885 stream.add((char *)"IE - ueUdpPort:");
3886 stream.endOfLine();
3887 PortNumberIe portNumber=
3888 dynamic_cast<
3889 PortNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(PortNumberIeType));
3890 portNumber.displayPortNumberIe_v(data.ueUdpPort, stream);
3891
3892 }
3893 if (data.additionalProtocolConfigurationOptionsIePresent)
3894 {
3895
3896
3897 stream.add((char *)"IE - additionalProtocolConfigurationOptions:");
3898 stream.endOfLine();
3899 AdditionalProtocolConfigurationOptionsIe additionalProtocolConfigurationOptions=
3900 dynamic_cast<
3901 AdditionalProtocolConfigurationOptionsIe&>(GtpV2IeFactory::getInstance().getIeObject(AdditionalProtocolConfigurationOptionsIeType));
3902 additionalProtocolConfigurationOptions.displayAdditionalProtocolConfigurationOptionsIe_v(data.additionalProtocolConfigurationOptions, stream);
3903
3904 }
3905 if (data.hNbLocalIpAddressIePresent)
3906 {
3907
3908
3909 stream.add((char *)"IE - hNbLocalIpAddress:");
3910 stream.endOfLine();
3911 IpAddressIe ipAddress=
3912 dynamic_cast<
3913 IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
3914 ipAddress.displayIpAddressIe_v(data.hNbLocalIpAddress, stream);
3915
3916 }
3917 if (data.hNbUdpPortIePresent)
3918 {
3919
3920
3921 stream.add((char *)"IE - hNbUdpPort:");
3922 stream.endOfLine();
3923 PortNumberIe portNumber=
3924 dynamic_cast<
3925 PortNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(PortNumberIeType));
3926 portNumber.displayPortNumberIe_v(data.hNbUdpPort, stream);
3927
3928 }
3929 if (data.mmeS4SgsnIdentifierIePresent)
3930 {
3931
3932
3933 stream.add((char *)"IE - mmeS4SgsnIdentifier:");
3934 stream.endOfLine();
3935 IpAddressIe ipAddress=
3936 dynamic_cast<
3937 IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
3938 ipAddress.displayIpAddressIe_v(data.mmeS4SgsnIdentifier, stream);
3939
3940 }
3941 if (data.twanIdentifierIePresent)
3942 {
3943
3944
3945 stream.add((char *)"IE - twanIdentifier:");
3946 stream.endOfLine();
3947 TwanIdentifierIe twanIdentifier=
3948 dynamic_cast<
3949 TwanIdentifierIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierIeType));
3950 twanIdentifier.displayTwanIdentifierIe_v(data.twanIdentifier, stream);
3951
3952 }
3953 if (data.epdgIpAddressIePresent)
3954 {
3955
3956
3957 stream.add((char *)"IE - epdgIpAddress:");
3958 stream.endOfLine();
3959 IpAddressIe ipAddress=
3960 dynamic_cast<
3961 IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
3962 ipAddress.displayIpAddressIe_v(data.epdgIpAddress, stream);
3963
3964 }
3965 if (data.cnOperatorSelectionEntityIePresent)
3966 {
3967
3968
3969 stream.add((char *)"IE - cnOperatorSelectionEntity:");
3970 stream.endOfLine();
3971 CnOperatorSelectionEntityIe cnOperatorSelectionEntity=
3972 dynamic_cast<
3973 CnOperatorSelectionEntityIe&>(GtpV2IeFactory::getInstance().getIeObject(CnOperatorSelectionEntityIeType));
3974 cnOperatorSelectionEntity.displayCnOperatorSelectionEntityIe_v(data.cnOperatorSelectionEntity, stream);
3975
3976 }
3977 if (data.mmeS4SgsnsOverloadControlInformationIePresent)
3978 {
3979
3980
3981 stream.add((char *)"IE - mmeS4SgsnsOverloadControlInformation:");
3982 stream.endOfLine();
3983 OverloadControlInformationIe overloadControlInformation=
3984 dynamic_cast<
3985 OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
3986 MmeS4SgsnsOverloadControlInformationInCreateSessionRequest groupedIeInstance =
3987 dynamic_cast<
3988 MmeS4SgsnsOverloadControlInformationInCreateSessionRequest&>(overloadControlInformation.getGroupedIe(msgType, 0));
3989 groupedIeInstance.displayMmeS4SgsnsOverloadControlInformationInCreateSessionRequestData_v(data.mmeS4SgsnsOverloadControlInformation, stream);
3990
3991 }
3992 if (data.sgwsOverloadControlInformationIePresent)
3993 {
3994
3995
3996 stream.add((char *)"IE - sgwsOverloadControlInformation:");
3997 stream.endOfLine();
3998 OverloadControlInformationIe overloadControlInformation=
3999 dynamic_cast<
4000 OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
4001 SgwsOverloadControlInformationInCreateSessionRequest groupedIeInstance =
4002 dynamic_cast<
4003 SgwsOverloadControlInformationInCreateSessionRequest&>(overloadControlInformation.getGroupedIe(msgType, 1));
4004 groupedIeInstance.displaySgwsOverloadControlInformationInCreateSessionRequestData_v(data.sgwsOverloadControlInformation, stream);
4005
4006 }
4007 if (data.twanEpdgsOverloadControlInformationIePresent)
4008 {
4009
4010
4011 stream.add((char *)"IE - twanEpdgsOverloadControlInformation:");
4012 stream.endOfLine();
4013 OverloadControlInformationIe overloadControlInformation=
4014 dynamic_cast<
4015 OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
4016 TwanEpdgsOverloadControlInformationInCreateSessionRequest groupedIeInstance =
4017 dynamic_cast<
4018 TwanEpdgsOverloadControlInformationInCreateSessionRequest&>(overloadControlInformation.getGroupedIe(msgType, 2));
4019 groupedIeInstance.displayTwanEpdgsOverloadControlInformationInCreateSessionRequestData_v(data.twanEpdgsOverloadControlInformation, stream);
4020
4021 }
4022 if (data.originationTimeStampIePresent)
4023 {
4024
4025
4026 stream.add((char *)"IE - originationTimeStamp:");
4027 stream.endOfLine();
4028 MillisecondTimeStampIe millisecondTimeStamp=
4029 dynamic_cast<
4030 MillisecondTimeStampIe&>(GtpV2IeFactory::getInstance().getIeObject(MillisecondTimeStampIeType));
4031 millisecondTimeStamp.displayMillisecondTimeStampIe_v(data.originationTimeStamp, stream);
4032
4033 }
4034 if (data.maximumWaitTimeIePresent)
4035 {
4036
4037
4038 stream.add((char *)"IE - maximumWaitTime:");
4039 stream.endOfLine();
4040 IntegerNumberIe integerNumber=
4041 dynamic_cast<
4042 IntegerNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(IntegerNumberIeType));
4043 integerNumber.displayIntegerNumberIe_v(data.maximumWaitTime, stream);
4044
4045 }
4046 if (data.wlanLocationInformationIePresent)
4047 {
4048
4049
4050 stream.add((char *)"IE - wlanLocationInformation:");
4051 stream.endOfLine();
4052 TwanIdentifierIe twanIdentifier=
4053 dynamic_cast<
4054 TwanIdentifierIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierIeType));
4055 twanIdentifier.displayTwanIdentifierIe_v(data.wlanLocationInformation, stream);
4056
4057 }
4058 if (data.wlanLocationTimestampIePresent)
4059 {
4060
4061
4062 stream.add((char *)"IE - wlanLocationTimestamp:");
4063 stream.endOfLine();
4064 TwanIdentifierTimestampIe twanIdentifierTimestamp=
4065 dynamic_cast<
4066 TwanIdentifierTimestampIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierTimestampIeType));
4067 twanIdentifierTimestamp.displayTwanIdentifierTimestampIe_v(data.wlanLocationTimestamp, stream);
4068
4069 }
4070 if (data.nbifomContainerIePresent)
4071 {
4072
4073
4074 stream.add((char *)"IE - nbifomContainer:");
4075 stream.endOfLine();
4076 FContainerIe fContainer=
4077 dynamic_cast<
4078 FContainerIe&>(GtpV2IeFactory::getInstance().getIeObject(FContainerIeType));
4079 fContainer.displayFContainerIe_v(data.nbifomContainer, stream);
4080
4081 }
4082 if (data.remoteUeContextConnectedIePresent)
4083 {
4084
4085
4086 stream.add((char *)"IE - remoteUeContextConnected:");
4087 stream.endOfLine();
4088 RemoteUeContextIe remoteUeContext=
4089 dynamic_cast<
4090 RemoteUeContextIe&>(GtpV2IeFactory::getInstance().getIeObject(RemoteUeContextIeType));
4091 RemoteUeContextConnectedInCreateSessionRequest groupedIeInstance =
4092 dynamic_cast<
4093 RemoteUeContextConnectedInCreateSessionRequest&>(remoteUeContext.getGroupedIe(msgType, 0));
4094 groupedIeInstance.displayRemoteUeContextConnectedInCreateSessionRequestData_v(data.remoteUeContextConnected, stream);
4095
4096 }
4097 if (data.a3gppAaaServerIdentifierIePresent)
4098 {
4099
4100
4101 stream.add((char *)"IE - a3gppAaaServerIdentifier:");
4102 stream.endOfLine();
4103 NodeIdentifierIe nodeIdentifier=
4104 dynamic_cast<
4105 NodeIdentifierIe&>(GtpV2IeFactory::getInstance().getIeObject(NodeIdentifierIeType));
4106 nodeIdentifier.displayNodeIdentifierIe_v(data.a3gppAaaServerIdentifier, stream);
4107
4108 }
4109 if (data.extendedProtocolConfigurationOptionsIePresent)
4110 {
4111
4112
4113 stream.add((char *)"IE - extendedProtocolConfigurationOptions:");
4114 stream.endOfLine();
4115 EpcoIe epco=
4116 dynamic_cast<
4117 EpcoIe&>(GtpV2IeFactory::getInstance().getIeObject(EpcoIeType));
4118 epco.displayEpcoIe_v(data.extendedProtocolConfigurationOptions, stream);
4119
4120 }
4121 if (data.servingPlmnRateControlIePresent)
4122 {
4123
4124
4125 stream.add((char *)"IE - servingPlmnRateControl:");
4126 stream.endOfLine();
4127 ServingPlmnRateControlIe servingPlmnRateControl=
4128 dynamic_cast<
4129 ServingPlmnRateControlIe&>(GtpV2IeFactory::getInstance().getIeObject(ServingPlmnRateControlIeType));
4130 servingPlmnRateControl.displayServingPlmnRateControlIe_v(data.servingPlmnRateControl, stream);
4131
4132 }
4133 if (data.moExceptionDataCounterIePresent)
4134 {
4135
4136
4137 stream.add((char *)"IE - moExceptionDataCounter:");
4138 stream.endOfLine();
4139 CounterIe counter=
4140 dynamic_cast<
4141 CounterIe&>(GtpV2IeFactory::getInstance().getIeObject(CounterIeType));
4142 counter.displayCounterIe_v(data.moExceptionDataCounter, stream);
4143
4144 }
4145 if (data.ueTcpPortIePresent)
4146 {
4147
4148
4149 stream.add((char *)"IE - ueTcpPort:");
4150 stream.endOfLine();
4151 PortNumberIe portNumber=
4152 dynamic_cast<
4153 PortNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(PortNumberIeType));
4154 portNumber.displayPortNumberIe_v(data.ueTcpPort, stream);
4155
4156 }
4157 if (data.mappedUeUsageTypeIePresent)
4158 {
4159
4160
4161 stream.add((char *)"IE - mappedUeUsageType:");
4162 stream.endOfLine();
4163 MappedUeUsageTypeIe mappedUeUsageType=
4164 dynamic_cast<
4165 MappedUeUsageTypeIe&>(GtpV2IeFactory::getInstance().getIeObject(MappedUeUsageTypeIeType));
4166 mappedUeUsageType.displayMappedUeUsageTypeIe_v(data.mappedUeUsageType, stream);
4167
4168 }
4169 if (data.userLocationInformationForSgwIePresent)
4170 {
4171
4172
4173 stream.add((char *)"IE - userLocationInformationForSgw:");
4174 stream.endOfLine();
4175 UliIe uli=
4176 dynamic_cast<
4177 UliIe&>(GtpV2IeFactory::getInstance().getIeObject(UliIeType));
4178 uli.displayUliIe_v(data.userLocationInformationForSgw, stream);
4179
4180 }
4181 if (data.sgwUNodeNameIePresent)
4182 {
4183
4184
4185 stream.add((char *)"IE - sgwUNodeName:");
4186 stream.endOfLine();
4187 FqdnIe fqdn=
4188 dynamic_cast<
4189 FqdnIe&>(GtpV2IeFactory::getInstance().getIeObject(FqdnIeType));
4190 fqdn.displayFqdnIe_v(data.sgwUNodeName, stream);
4191
4192 }
4193 if (data.secondaryRatUsageDataReportIePresent)
4194 {
4195
4196
4197 stream.add((char *)"IE - secondaryRatUsageDataReport:");
4198 stream.endOfLine();
4199 SecondaryRatUsageDataReportIe secondaryRatUsageDataReport=
4200 dynamic_cast<
4201 SecondaryRatUsageDataReportIe&>(GtpV2IeFactory::getInstance().getIeObject(SecondaryRatUsageDataReportIeType));
4202 secondaryRatUsageDataReport.displaySecondaryRatUsageDataReportIe_v(data.secondaryRatUsageDataReport, stream);
4203
4204 }
4205 if (data.upFunctionSelectionIndicationFlagsIePresent)
4206 {
4207
4208
4209 stream.add((char *)"IE - upFunctionSelectionIndicationFlags:");
4210 stream.endOfLine();
4211 UpFunctionSelectionIndicationFlagsIe upFunctionSelectionIndicationFlags=
4212 dynamic_cast<
4213 UpFunctionSelectionIndicationFlagsIe&>(GtpV2IeFactory::getInstance().getIeObject(UpFunctionSelectionIndicationFlagsIeType));
4214 upFunctionSelectionIndicationFlags.displayUpFunctionSelectionIndicationFlagsIe_v(data.upFunctionSelectionIndicationFlags, stream);
4215
4216 }
4217
4218 stream.decrIndent();
4219 stream.decrIndent();
4220}
4221
4222