MME2 changes - Propped commits from openmme/paging branch. Added scripts
for code gen
Change-Id: Ie55032217232214ac8544ca76ea34335205329e4
diff --git a/src/gtpV2Codec/msgClasses/createBearerRequestMsg.cpp b/src/gtpV2Codec/msgClasses/createBearerRequestMsg.cpp
new file mode 100644
index 0000000..3a849db
--- /dev/null
+++ b/src/gtpV2Codec/msgClasses/createBearerRequestMsg.cpp
@@ -0,0 +1,1296 @@
+/*
+ * Copyright 2019-present Infosys Limited
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+/******************************************************************************
+ *
+ * This is an auto generated file.
+ * Please do not edit this file.
+ * All edits to be made through template source file
+ * <TOP-DIR/scripts/GtpV2StackCodeGen/tts/msgtemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "createBearerRequestMsg.h"
+#include "../ieClasses/manual/gtpV2Ie.h"
+#include "../ieClasses/gtpV2IeFactory.h"
+#include "../ieClasses/ptiIe.h"
+#include "../ieClasses/ebiIe.h"
+#include "../ieClasses/pcoIe.h"
+#include "../ieClasses/bearerContextIe.h"
+#include "../ieClasses/bearerContextsInCreateBearerRequest.h"
+#include "../ieClasses/fqCsidIe.h"
+#include "../ieClasses/fqCsidIe.h"
+#include "../ieClasses/changeReportingActionIe.h"
+#include "../ieClasses/csgInformationReportingActionIe.h"
+#include "../ieClasses/henbInformationReportingIe.h"
+#include "../ieClasses/presenceReportingAreaActionIe.h"
+#include "../ieClasses/indicationIe.h"
+#include "../ieClasses/loadControlInformationIe.h"
+#include "../ieClasses/pgwsNodeLevelLoadControlInformationInCreateBearerRequest.h"
+#include "../ieClasses/loadControlInformationIe.h"
+#include "../ieClasses/pgwsApnLevelLoadControlInformationInCreateBearerRequest.h"
+#include "../ieClasses/loadControlInformationIe.h"
+#include "../ieClasses/sgwsNodeLevelLoadControlInformationInCreateBearerRequest.h"
+#include "../ieClasses/overloadControlInformationIe.h"
+#include "../ieClasses/pgwsOverloadControlInformationInCreateBearerRequest.h"
+#include "../ieClasses/overloadControlInformationIe.h"
+#include "../ieClasses/sgwsOverloadControlInformationInCreateBearerRequest.h"
+#include "../ieClasses/fContainerIe.h"
+
+CreateBearerRequestMsg::CreateBearerRequestMsg()
+{
+ msgType = CreateBearerRequestMsgType;
+ Uint16 mandIe;
+ mandIe = EbiIeType;
+ mandIe = (mandIe << 8) | 0; // linkedEpsBearerId
+ mandatoryIeSet.insert(mandIe); mandIe = BearerContextIeType;
+ mandIe = (mandIe << 8) | 0; // bearerContexts
+ mandatoryIeSet.insert(mandIe);
+}
+
+CreateBearerRequestMsg::~CreateBearerRequestMsg()
+{
+
+}
+
+bool CreateBearerRequestMsg::encodeCreateBearerRequestMsg(MsgBuffer &buffer,
+ CreateBearerRequestMsgData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+ if (data.procedureTransactionIdIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = PtiIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ PtiIe pti=
+ dynamic_cast<
+ PtiIe&>(GtpV2IeFactory::getInstance().getIeObject(PtiIeType));
+ rc = pti.encodePtiIe(buffer, data.procedureTransactionId);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: procedureTransactionId\n");
+ return false;
+ }
+ }
+
+
+ // Encode the Ie Header
+ header.ieType = EbiIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ EbiIe ebi=
+ dynamic_cast<
+ EbiIe&>(GtpV2IeFactory::getInstance().getIeObject(EbiIeType));
+ rc = ebi.encodeEbiIe(buffer, data.linkedEpsBearerId);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: linkedEpsBearerId\n");
+ return false;
+ }
+
+ if (data.protocolConfigurationOptionsIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = PcoIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ PcoIe pco=
+ dynamic_cast<
+ PcoIe&>(GtpV2IeFactory::getInstance().getIeObject(PcoIeType));
+ rc = pco.encodePcoIe(buffer, data.protocolConfigurationOptions);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: protocolConfigurationOptions\n");
+ return false;
+ }
+ }
+
+ // First validate if the applicatoin provided more than the expected cardinality
+ if (data.bearerContextsCount > 11)
+ {
+ errorStream.add((char *)"Number of entries of bearerContexts exceeded\n");
+ errorStream.add((char *)"Expected count: 11 Received count: ");
+ errorStream.add((char *)"data.bearerContextsCount");
+ errorStream.endOfLine();
+ return false;
+ }
+ for (Uint8 i = 0; i < data.bearerContextsCount; i++)
+ {
+ // Encode the Ie Header
+ header.ieType = BearerContextIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ BearerContextIe bearerContext=
+ dynamic_cast<
+ BearerContextIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(BearerContextIeType));
+ BearerContextsInCreateBearerRequest groupedIeInstance = dynamic_cast<BearerContextsInCreateBearerRequest&>(bearerContext.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.encodeBearerContextsInCreateBearerRequest(buffer, data.bearerContexts[i]);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ }
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: bearerContexts\n");
+ return false;
+ }
+
+ if (data.pgwFqCsidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FqCsidIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ rc = fqCsid.encodeFqCsidIe(buffer, data.pgwFqCsid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: pgwFqCsid\n");
+ return false;
+ }
+ }
+
+ if (data.sgwFqCsidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FqCsidIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ rc = fqCsid.encodeFqCsidIe(buffer, data.sgwFqCsid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: sgwFqCsid\n");
+ return false;
+ }
+ }
+
+ if (data.changeReportingActionIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = ChangeReportingActionIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ ChangeReportingActionIe changeReportingAction=
+ dynamic_cast<
+ ChangeReportingActionIe&>(GtpV2IeFactory::getInstance().getIeObject(ChangeReportingActionIeType));
+ rc = changeReportingAction.encodeChangeReportingActionIe(buffer, data.changeReportingAction);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: changeReportingAction\n");
+ return false;
+ }
+ }
+
+ if (data.csgInformationReportingActionIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = CsgInformationReportingActionIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ CsgInformationReportingActionIe csgInformationReportingAction=
+ dynamic_cast<
+ CsgInformationReportingActionIe&>(GtpV2IeFactory::getInstance().getIeObject(CsgInformationReportingActionIeType));
+ rc = csgInformationReportingAction.encodeCsgInformationReportingActionIe(buffer, data.csgInformationReportingAction);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: csgInformationReportingAction\n");
+ return false;
+ }
+ }
+
+ if (data.hNbInformationReportingIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = HenbInformationReportingIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ HenbInformationReportingIe henbInformationReporting=
+ dynamic_cast<
+ HenbInformationReportingIe&>(GtpV2IeFactory::getInstance().getIeObject(HenbInformationReportingIeType));
+ rc = henbInformationReporting.encodeHenbInformationReportingIe(buffer, data.hNbInformationReporting);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: hNbInformationReporting\n");
+ return false;
+ }
+ }
+
+ if (data.presenceReportingAreaActionIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = PresenceReportingAreaActionIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ PresenceReportingAreaActionIe presenceReportingAreaAction=
+ dynamic_cast<
+ PresenceReportingAreaActionIe&>(GtpV2IeFactory::getInstance().getIeObject(PresenceReportingAreaActionIeType));
+ rc = presenceReportingAreaAction.encodePresenceReportingAreaActionIe(buffer, data.presenceReportingAreaAction);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: presenceReportingAreaAction\n");
+ return false;
+ }
+ }
+
+ if (data.indicationFlagsIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = IndicationIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ IndicationIe indication=
+ dynamic_cast<
+ IndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(IndicationIeType));
+ rc = indication.encodeIndicationIe(buffer, data.indicationFlags);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: indicationFlags\n");
+ return false;
+ }
+ }
+
+ if (data.pgwsNodeLevelLoadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = LoadControlInformationIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ LoadControlInformationIe loadControlInformation=
+ dynamic_cast<
+ LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType));
+ PgwsNodeLevelLoadControlInformationInCreateBearerRequest groupedIeInstance =
+ dynamic_cast<
+ PgwsNodeLevelLoadControlInformationInCreateBearerRequest&>(loadControlInformation.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.encodePgwsNodeLevelLoadControlInformationInCreateBearerRequest(buffer, data.pgwsNodeLevelLoadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: pgwsNodeLevelLoadControlInformation\n");
+ return false;
+ }
+ }
+
+ if (data.pgwsApnLevelLoadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = LoadControlInformationIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ LoadControlInformationIe loadControlInformation=
+ dynamic_cast<
+ LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType));
+ PgwsApnLevelLoadControlInformationInCreateBearerRequest groupedIeInstance =
+ dynamic_cast<
+ PgwsApnLevelLoadControlInformationInCreateBearerRequest&>(loadControlInformation.getGroupedIe(msgType, 1));
+ rc = groupedIeInstance.encodePgwsApnLevelLoadControlInformationInCreateBearerRequest(buffer, data.pgwsApnLevelLoadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: pgwsApnLevelLoadControlInformation\n");
+ return false;
+ }
+ }
+
+ if (data.sgwsNodeLevelLoadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = LoadControlInformationIeType;
+ header.instance = 2;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ LoadControlInformationIe loadControlInformation=
+ dynamic_cast<
+ LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType));
+ SgwsNodeLevelLoadControlInformationInCreateBearerRequest groupedIeInstance =
+ dynamic_cast<
+ SgwsNodeLevelLoadControlInformationInCreateBearerRequest&>(loadControlInformation.getGroupedIe(msgType, 2));
+ rc = groupedIeInstance.encodeSgwsNodeLevelLoadControlInformationInCreateBearerRequest(buffer, data.sgwsNodeLevelLoadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: sgwsNodeLevelLoadControlInformation\n");
+ return false;
+ }
+ }
+
+ if (data.pgwsOverloadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = OverloadControlInformationIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ PgwsOverloadControlInformationInCreateBearerRequest groupedIeInstance =
+ dynamic_cast<
+ PgwsOverloadControlInformationInCreateBearerRequest&>(overloadControlInformation.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.encodePgwsOverloadControlInformationInCreateBearerRequest(buffer, data.pgwsOverloadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: pgwsOverloadControlInformation\n");
+ return false;
+ }
+ }
+
+ if (data.sgwsOverloadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = OverloadControlInformationIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ SgwsOverloadControlInformationInCreateBearerRequest groupedIeInstance =
+ dynamic_cast<
+ SgwsOverloadControlInformationInCreateBearerRequest&>(overloadControlInformation.getGroupedIe(msgType, 1));
+ rc = groupedIeInstance.encodeSgwsOverloadControlInformationInCreateBearerRequest(buffer, data.sgwsOverloadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: sgwsOverloadControlInformation\n");
+ return false;
+ }
+ }
+
+ if (data.nbifomContainerIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FContainerIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ FContainerIe fContainer=
+ dynamic_cast<
+ FContainerIe&>(GtpV2IeFactory::getInstance().getIeObject(FContainerIeType));
+ rc = fContainer.encodeFContainerIe(buffer, data.nbifomContainer);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: nbifomContainer\n");
+ return false;
+ }
+ }
+ return rc;
+
+}
+
+bool CreateBearerRequestMsg::decodeCreateBearerRequestMsg(MsgBuffer &buffer,
+ CreateBearerRequestMsgData
+ &data, Uint16 length)
+{
+
+ bool rc = false;
+ GtpV2IeHeader ieHeader;
+
+ set<Uint16> mandatoryIeLocalList = mandatoryIeSet;
+ while (buffer.lengthLeft() > IE_HEADER_SIZE)
+ {
+ GtpV2Ie::decodeGtpV2IeHeader(buffer, ieHeader);
+ if (ieHeader.length > buffer.lengthLeft())
+ {
+ // We do not have enough bytes left in the message for this IE
+ errorStream.add((char *)"IE Length exceeds beyond message boundary\n");
+ errorStream.add((char *)" Offending IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.add((char *)"\n Ie Length in Header: ");
+ errorStream.add(ieHeader.length);
+ errorStream.add((char *)"\n Bytes left in message: ");
+ errorStream.add(buffer.lengthLeft());
+ errorStream.endOfLine();
+ return false;
+ }
+
+ switch (ieHeader.ieType){
+
+ case PtiIeType:
+ {
+ PtiIe ieObject =
+ dynamic_cast<
+ PtiIe&>(GtpV2IeFactory::getInstance().getIeObject(PtiIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodePtiIe(buffer, data.procedureTransactionId, ieHeader.length);
+
+ data.procedureTransactionIdIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: procedureTransactionId\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case EbiIeType:
+ {
+ EbiIe ieObject =
+ dynamic_cast<
+ EbiIe&>(GtpV2IeFactory::getInstance().getIeObject(EbiIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeEbiIe(buffer, data.linkedEpsBearerId, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: linkedEpsBearerId\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case PcoIeType:
+ {
+ PcoIe ieObject =
+ dynamic_cast<
+ PcoIe&>(GtpV2IeFactory::getInstance().getIeObject(PcoIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodePcoIe(buffer, data.protocolConfigurationOptions, ieHeader.length);
+
+ data.protocolConfigurationOptionsIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: protocolConfigurationOptions\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case BearerContextIeType:
+ {
+ BearerContextIe ieObject =
+ dynamic_cast<
+ BearerContextIe&>(GtpV2IeFactory::getInstance().getIeObject(BearerContextIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ // First check if we have enough space left to decode and store this instance
+ if (data.bearerContextsCount == 11)
+ {
+ errorStream.add((char *)"More than 11 instances of bearerContexts received\n");
+ return false;
+ }
+ BearerContextsInCreateBearerRequest groupedIeInstance =
+ dynamic_cast<
+ BearerContextsInCreateBearerRequest&>(ieObject.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.decodeBearerContextsInCreateBearerRequest(buffer,
+ data.bearerContexts[data.bearerContextsCount], ieHeader.length);
+ data.bearerContextsCount++; // TODO Count validation
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: bearerContexts\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case FqCsidIeType:
+ {
+ FqCsidIe ieObject =
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeFqCsidIe(buffer, data.pgwFqCsid, ieHeader.length);
+
+ data.pgwFqCsidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: pgwFqCsid\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ rc = ieObject.decodeFqCsidIe(buffer, data.sgwFqCsid, ieHeader.length);
+
+ data.sgwFqCsidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: sgwFqCsid\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case ChangeReportingActionIeType:
+ {
+ ChangeReportingActionIe ieObject =
+ dynamic_cast<
+ ChangeReportingActionIe&>(GtpV2IeFactory::getInstance().getIeObject(ChangeReportingActionIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeChangeReportingActionIe(buffer, data.changeReportingAction, ieHeader.length);
+
+ data.changeReportingActionIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: changeReportingAction\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case CsgInformationReportingActionIeType:
+ {
+ CsgInformationReportingActionIe ieObject =
+ dynamic_cast<
+ CsgInformationReportingActionIe&>(GtpV2IeFactory::getInstance().getIeObject(CsgInformationReportingActionIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeCsgInformationReportingActionIe(buffer, data.csgInformationReportingAction, ieHeader.length);
+
+ data.csgInformationReportingActionIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: csgInformationReportingAction\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case HenbInformationReportingIeType:
+ {
+ HenbInformationReportingIe ieObject =
+ dynamic_cast<
+ HenbInformationReportingIe&>(GtpV2IeFactory::getInstance().getIeObject(HenbInformationReportingIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeHenbInformationReportingIe(buffer, data.hNbInformationReporting, ieHeader.length);
+
+ data.hNbInformationReportingIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: hNbInformationReporting\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case PresenceReportingAreaActionIeType:
+ {
+ PresenceReportingAreaActionIe ieObject =
+ dynamic_cast<
+ PresenceReportingAreaActionIe&>(GtpV2IeFactory::getInstance().getIeObject(PresenceReportingAreaActionIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodePresenceReportingAreaActionIe(buffer, data.presenceReportingAreaAction, ieHeader.length);
+
+ data.presenceReportingAreaActionIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: presenceReportingAreaAction\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case IndicationIeType:
+ {
+ IndicationIe ieObject =
+ dynamic_cast<
+ IndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(IndicationIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeIndicationIe(buffer, data.indicationFlags, ieHeader.length);
+
+ data.indicationFlagsIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: indicationFlags\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case LoadControlInformationIeType:
+ {
+ LoadControlInformationIe ieObject =
+ dynamic_cast<
+ LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ PgwsNodeLevelLoadControlInformationInCreateBearerRequest groupedIeInstance =
+ dynamic_cast<
+ PgwsNodeLevelLoadControlInformationInCreateBearerRequest&>(ieObject.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.decodePgwsNodeLevelLoadControlInformationInCreateBearerRequest(buffer, data.pgwsNodeLevelLoadControlInformation, ieHeader.length);
+
+ data.pgwsNodeLevelLoadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: pgwsNodeLevelLoadControlInformation\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ PgwsApnLevelLoadControlInformationInCreateBearerRequest groupedIeInstance =
+ dynamic_cast<
+ PgwsApnLevelLoadControlInformationInCreateBearerRequest&>(ieObject.getGroupedIe(msgType, 1));
+ rc = groupedIeInstance.decodePgwsApnLevelLoadControlInformationInCreateBearerRequest(buffer, data.pgwsApnLevelLoadControlInformation, ieHeader.length);
+
+ data.pgwsApnLevelLoadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: pgwsApnLevelLoadControlInformation\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 2)
+ {
+ SgwsNodeLevelLoadControlInformationInCreateBearerRequest groupedIeInstance =
+ dynamic_cast<
+ SgwsNodeLevelLoadControlInformationInCreateBearerRequest&>(ieObject.getGroupedIe(msgType, 2));
+ rc = groupedIeInstance.decodeSgwsNodeLevelLoadControlInformationInCreateBearerRequest(buffer, data.sgwsNodeLevelLoadControlInformation, ieHeader.length);
+
+ data.sgwsNodeLevelLoadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: sgwsNodeLevelLoadControlInformation\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case OverloadControlInformationIeType:
+ {
+ OverloadControlInformationIe ieObject =
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ PgwsOverloadControlInformationInCreateBearerRequest groupedIeInstance =
+ dynamic_cast<
+ PgwsOverloadControlInformationInCreateBearerRequest&>(ieObject.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.decodePgwsOverloadControlInformationInCreateBearerRequest(buffer, data.pgwsOverloadControlInformation, ieHeader.length);
+
+ data.pgwsOverloadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: pgwsOverloadControlInformation\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ SgwsOverloadControlInformationInCreateBearerRequest groupedIeInstance =
+ dynamic_cast<
+ SgwsOverloadControlInformationInCreateBearerRequest&>(ieObject.getGroupedIe(msgType, 1));
+ rc = groupedIeInstance.decodeSgwsOverloadControlInformationInCreateBearerRequest(buffer, data.sgwsOverloadControlInformation, ieHeader.length);
+
+ data.sgwsOverloadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: sgwsOverloadControlInformation\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case FContainerIeType:
+ {
+ FContainerIe ieObject =
+ dynamic_cast<
+ FContainerIe&>(GtpV2IeFactory::getInstance().getIeObject(FContainerIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeFContainerIe(buffer, data.nbifomContainer, ieHeader.length);
+
+ data.nbifomContainerIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: nbifomContainer\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ default:
+ {
+ // Unknown IE print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ }
+ }
+ return rc; // TODO validations
+}
+
+void CreateBearerRequestMsg::
+displayCreateBearerRequestMsgData_v(CreateBearerRequestMsgData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"CreateBearerRequestMsg:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+ if (data.procedureTransactionIdIePresent)
+ {
+
+
+ stream.add((char *)"IE - procedureTransactionId:");
+ stream.endOfLine();
+ PtiIe pti=
+ dynamic_cast<
+ PtiIe&>(GtpV2IeFactory::getInstance().getIeObject(PtiIeType));
+ pti.displayPtiIe_v(data.procedureTransactionId, stream);
+
+ }
+ stream.add((char *)"IE - linkedEpsBearerId:");
+ stream.endOfLine();
+ EbiIe ebi=
+ dynamic_cast<
+ EbiIe&>(GtpV2IeFactory::getInstance().getIeObject(EbiIeType));
+ ebi.displayEbiIe_v(data.linkedEpsBearerId, stream);
+
+ if (data.protocolConfigurationOptionsIePresent)
+ {
+
+
+ stream.add((char *)"IE - protocolConfigurationOptions:");
+ stream.endOfLine();
+ PcoIe pco=
+ dynamic_cast<
+ PcoIe&>(GtpV2IeFactory::getInstance().getIeObject(PcoIeType));
+ pco.displayPcoIe_v(data.protocolConfigurationOptions, stream);
+
+ }
+
+ Uint8 displayCount;
+
+ displayCount = data.bearerContextsCount;
+ if (displayCount > 11)
+ {
+ stream.add((char *)"Invalid data more than 11 instances");
+ stream.endOfLine();
+ stream.add((char *)"Displaying only 11");
+ stream.endOfLine();
+ displayCount = 11;
+ }
+ for (Uint8 i = 0; i < displayCount; i++)
+ {
+ stream.add((char *)"IE - bearerContexts:");
+ stream.endOfLine();
+ BearerContextIe bearerContext=
+ dynamic_cast<
+ BearerContextIe&>(GtpV2IeFactory::getInstance().getIeObject(BearerContextIeType));
+ BearerContextsInCreateBearerRequest groupedIeInstance =
+ dynamic_cast<
+ BearerContextsInCreateBearerRequest&>(bearerContext.getGroupedIe(msgType, 0));
+ groupedIeInstance.displayBearerContextsInCreateBearerRequestData_v(data.bearerContexts[i], stream);
+
+ }
+ if (data.pgwFqCsidIePresent)
+ {
+
+
+ stream.add((char *)"IE - pgwFqCsid:");
+ stream.endOfLine();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ fqCsid.displayFqCsidIe_v(data.pgwFqCsid, stream);
+
+ }
+ if (data.sgwFqCsidIePresent)
+ {
+
+
+ stream.add((char *)"IE - sgwFqCsid:");
+ stream.endOfLine();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ fqCsid.displayFqCsidIe_v(data.sgwFqCsid, stream);
+
+ }
+ if (data.changeReportingActionIePresent)
+ {
+
+
+ stream.add((char *)"IE - changeReportingAction:");
+ stream.endOfLine();
+ ChangeReportingActionIe changeReportingAction=
+ dynamic_cast<
+ ChangeReportingActionIe&>(GtpV2IeFactory::getInstance().getIeObject(ChangeReportingActionIeType));
+ changeReportingAction.displayChangeReportingActionIe_v(data.changeReportingAction, stream);
+
+ }
+ if (data.csgInformationReportingActionIePresent)
+ {
+
+
+ stream.add((char *)"IE - csgInformationReportingAction:");
+ stream.endOfLine();
+ CsgInformationReportingActionIe csgInformationReportingAction=
+ dynamic_cast<
+ CsgInformationReportingActionIe&>(GtpV2IeFactory::getInstance().getIeObject(CsgInformationReportingActionIeType));
+ csgInformationReportingAction.displayCsgInformationReportingActionIe_v(data.csgInformationReportingAction, stream);
+
+ }
+ if (data.hNbInformationReportingIePresent)
+ {
+
+
+ stream.add((char *)"IE - hNbInformationReporting:");
+ stream.endOfLine();
+ HenbInformationReportingIe henbInformationReporting=
+ dynamic_cast<
+ HenbInformationReportingIe&>(GtpV2IeFactory::getInstance().getIeObject(HenbInformationReportingIeType));
+ henbInformationReporting.displayHenbInformationReportingIe_v(data.hNbInformationReporting, stream);
+
+ }
+ if (data.presenceReportingAreaActionIePresent)
+ {
+
+
+ stream.add((char *)"IE - presenceReportingAreaAction:");
+ stream.endOfLine();
+ PresenceReportingAreaActionIe presenceReportingAreaAction=
+ dynamic_cast<
+ PresenceReportingAreaActionIe&>(GtpV2IeFactory::getInstance().getIeObject(PresenceReportingAreaActionIeType));
+ presenceReportingAreaAction.displayPresenceReportingAreaActionIe_v(data.presenceReportingAreaAction, stream);
+
+ }
+ if (data.indicationFlagsIePresent)
+ {
+
+
+ stream.add((char *)"IE - indicationFlags:");
+ stream.endOfLine();
+ IndicationIe indication=
+ dynamic_cast<
+ IndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(IndicationIeType));
+ indication.displayIndicationIe_v(data.indicationFlags, stream);
+
+ }
+ if (data.pgwsNodeLevelLoadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - pgwsNodeLevelLoadControlInformation:");
+ stream.endOfLine();
+ LoadControlInformationIe loadControlInformation=
+ dynamic_cast<
+ LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType));
+ PgwsNodeLevelLoadControlInformationInCreateBearerRequest groupedIeInstance =
+ dynamic_cast<
+ PgwsNodeLevelLoadControlInformationInCreateBearerRequest&>(loadControlInformation.getGroupedIe(msgType, 0));
+ groupedIeInstance.displayPgwsNodeLevelLoadControlInformationInCreateBearerRequestData_v(data.pgwsNodeLevelLoadControlInformation, stream);
+
+ }
+ if (data.pgwsApnLevelLoadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - pgwsApnLevelLoadControlInformation:");
+ stream.endOfLine();
+ LoadControlInformationIe loadControlInformation=
+ dynamic_cast<
+ LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType));
+ PgwsApnLevelLoadControlInformationInCreateBearerRequest groupedIeInstance =
+ dynamic_cast<
+ PgwsApnLevelLoadControlInformationInCreateBearerRequest&>(loadControlInformation.getGroupedIe(msgType, 1));
+ groupedIeInstance.displayPgwsApnLevelLoadControlInformationInCreateBearerRequestData_v(data.pgwsApnLevelLoadControlInformation, stream);
+
+ }
+ if (data.sgwsNodeLevelLoadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - sgwsNodeLevelLoadControlInformation:");
+ stream.endOfLine();
+ LoadControlInformationIe loadControlInformation=
+ dynamic_cast<
+ LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType));
+ SgwsNodeLevelLoadControlInformationInCreateBearerRequest groupedIeInstance =
+ dynamic_cast<
+ SgwsNodeLevelLoadControlInformationInCreateBearerRequest&>(loadControlInformation.getGroupedIe(msgType, 2));
+ groupedIeInstance.displaySgwsNodeLevelLoadControlInformationInCreateBearerRequestData_v(data.sgwsNodeLevelLoadControlInformation, stream);
+
+ }
+ if (data.pgwsOverloadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - pgwsOverloadControlInformation:");
+ stream.endOfLine();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ PgwsOverloadControlInformationInCreateBearerRequest groupedIeInstance =
+ dynamic_cast<
+ PgwsOverloadControlInformationInCreateBearerRequest&>(overloadControlInformation.getGroupedIe(msgType, 0));
+ groupedIeInstance.displayPgwsOverloadControlInformationInCreateBearerRequestData_v(data.pgwsOverloadControlInformation, stream);
+
+ }
+ if (data.sgwsOverloadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - sgwsOverloadControlInformation:");
+ stream.endOfLine();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ SgwsOverloadControlInformationInCreateBearerRequest groupedIeInstance =
+ dynamic_cast<
+ SgwsOverloadControlInformationInCreateBearerRequest&>(overloadControlInformation.getGroupedIe(msgType, 1));
+ groupedIeInstance.displaySgwsOverloadControlInformationInCreateBearerRequestData_v(data.sgwsOverloadControlInformation, stream);
+
+ }
+ if (data.nbifomContainerIePresent)
+ {
+
+
+ stream.add((char *)"IE - nbifomContainer:");
+ stream.endOfLine();
+ FContainerIe fContainer=
+ dynamic_cast<
+ FContainerIe&>(GtpV2IeFactory::getInstance().getIeObject(FContainerIeType));
+ fContainer.displayFContainerIe_v(data.nbifomContainer, stream);
+
+ }
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
diff --git a/src/gtpV2Codec/msgClasses/createBearerRequestMsg.h b/src/gtpV2Codec/msgClasses/createBearerRequestMsg.h
new file mode 100644
index 0000000..96e6ede
--- /dev/null
+++ b/src/gtpV2Codec/msgClasses/createBearerRequestMsg.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2019-present, Infosys Limited.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ /******************************************************************************
+ *
+ * This is an auto generated file.
+ * Please do not edit this file.
+ * All edits to be made through template source file
+ * <TOP-DIR/scripts/GtpV2StackCodeGen/tts/msgtemplate.h.tt>
+ ******************************************************************************/
+#ifndef CREATEBEARERREQUESTMSG_H_
+#define CREATEBEARERREQUESTMSG_H_
+
+#include <set>
+#include "manual/gtpV2Message.h"
+#include <msgBuffer.h>
+#include <debug.h>
+#include "gtpV2MsgDataTypes.h"
+
+
+class CreateBearerRequestMsg:public GtpV2Message
+{
+public:
+ CreateBearerRequestMsg();
+ virtual ~CreateBearerRequestMsg();
+ bool encodeCreateBearerRequestMsg(MsgBuffer &buffer, CreateBearerRequestMsgData const &data);
+
+ bool decodeCreateBearerRequestMsg (MsgBuffer &buffer, CreateBearerRequestMsgData& data, Uint16 length);
+
+ void displayCreateBearerRequestMsgData_v(CreateBearerRequestMsgData const &data, Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/msgClasses/createBearerResponseMsg.cpp b/src/gtpV2Codec/msgClasses/createBearerResponseMsg.cpp
new file mode 100644
index 0000000..1d7dc6f
--- /dev/null
+++ b/src/gtpV2Codec/msgClasses/createBearerResponseMsg.cpp
@@ -0,0 +1,1484 @@
+/*
+ * Copyright 2019-present Infosys Limited
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+/******************************************************************************
+ *
+ * This is an auto generated file.
+ * Please do not edit this file.
+ * All edits to be made through template source file
+ * <TOP-DIR/scripts/GtpV2StackCodeGen/tts/msgtemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "createBearerResponseMsg.h"
+#include "../ieClasses/manual/gtpV2Ie.h"
+#include "../ieClasses/gtpV2IeFactory.h"
+#include "../ieClasses/causeIe.h"
+#include "../ieClasses/bearerContextIe.h"
+#include "../ieClasses/bearerContextsInCreateBearerResponse.h"
+#include "../ieClasses/recoveryIe.h"
+#include "../ieClasses/fqCsidIe.h"
+#include "../ieClasses/fqCsidIe.h"
+#include "../ieClasses/fqCsidIe.h"
+#include "../ieClasses/fqCsidIe.h"
+#include "../ieClasses/pcoIe.h"
+#include "../ieClasses/ueTimeZoneIe.h"
+#include "../ieClasses/uliIe.h"
+#include "../ieClasses/twanIdentifierIe.h"
+#include "../ieClasses/overloadControlInformationIe.h"
+#include "../ieClasses/mmeS4SgsnsOverloadControlInformationInCreateBearerResponse.h"
+#include "../ieClasses/overloadControlInformationIe.h"
+#include "../ieClasses/sgwsOverloadControlInformationInCreateBearerResponse.h"
+#include "../ieClasses/ipAddressIe.h"
+#include "../ieClasses/overloadControlInformationIe.h"
+#include "../ieClasses/twanEpdgsOverloadControlInformationInCreateBearerResponse.h"
+#include "../ieClasses/twanIdentifierIe.h"
+#include "../ieClasses/twanIdentifierTimestampIe.h"
+#include "../ieClasses/ipAddressIe.h"
+#include "../ieClasses/portNumberIe.h"
+#include "../ieClasses/fContainerIe.h"
+#include "../ieClasses/portNumberIe.h"
+
+CreateBearerResponseMsg::CreateBearerResponseMsg()
+{
+ msgType = CreateBearerResponseMsgType;
+ Uint16 mandIe;
+ mandIe = CauseIeType;
+ mandIe = (mandIe << 8) | 0; // cause
+ mandatoryIeSet.insert(mandIe); mandIe = BearerContextIeType;
+ mandIe = (mandIe << 8) | 0; // bearerContexts
+ mandatoryIeSet.insert(mandIe);
+}
+
+CreateBearerResponseMsg::~CreateBearerResponseMsg()
+{
+
+}
+
+bool CreateBearerResponseMsg::encodeCreateBearerResponseMsg(MsgBuffer &buffer,
+ CreateBearerResponseMsgData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+ // Encode the Ie Header
+ header.ieType = CauseIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ CauseIe cause=
+ dynamic_cast<
+ CauseIe&>(GtpV2IeFactory::getInstance().getIeObject(CauseIeType));
+ rc = cause.encodeCauseIe(buffer, data.cause);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: cause\n");
+ return false;
+ }
+
+ // First validate if the applicatoin provided more than the expected cardinality
+ if (data.bearerContextsCount > 11)
+ {
+ errorStream.add((char *)"Number of entries of bearerContexts exceeded\n");
+ errorStream.add((char *)"Expected count: 11 Received count: ");
+ errorStream.add((char *)"data.bearerContextsCount");
+ errorStream.endOfLine();
+ return false;
+ }
+ for (Uint8 i = 0; i < data.bearerContextsCount; i++)
+ {
+ // Encode the Ie Header
+ header.ieType = BearerContextIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ BearerContextIe bearerContext=
+ dynamic_cast<
+ BearerContextIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(BearerContextIeType));
+ BearerContextsInCreateBearerResponse groupedIeInstance = dynamic_cast<BearerContextsInCreateBearerResponse&>(bearerContext.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.encodeBearerContextsInCreateBearerResponse(buffer, data.bearerContexts[i]);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ }
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: bearerContexts\n");
+ return false;
+ }
+
+ if (data.recoveryIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = RecoveryIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ RecoveryIe recovery=
+ dynamic_cast<
+ RecoveryIe&>(GtpV2IeFactory::getInstance().getIeObject(RecoveryIeType));
+ rc = recovery.encodeRecoveryIe(buffer, data.recovery);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: recovery\n");
+ return false;
+ }
+ }
+
+ if (data.mmeFqCsidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FqCsidIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ rc = fqCsid.encodeFqCsidIe(buffer, data.mmeFqCsid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: mmeFqCsid\n");
+ return false;
+ }
+ }
+
+ if (data.sgwFqCsidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FqCsidIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ rc = fqCsid.encodeFqCsidIe(buffer, data.sgwFqCsid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: sgwFqCsid\n");
+ return false;
+ }
+ }
+
+ if (data.epdgFqCsidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FqCsidIeType;
+ header.instance = 2;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ rc = fqCsid.encodeFqCsidIe(buffer, data.epdgFqCsid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: epdgFqCsid\n");
+ return false;
+ }
+ }
+
+ if (data.twanFqCsidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FqCsidIeType;
+ header.instance = 3;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ rc = fqCsid.encodeFqCsidIe(buffer, data.twanFqCsid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: twanFqCsid\n");
+ return false;
+ }
+ }
+
+ if (data.protocolConfigurationOptionsIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = PcoIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ PcoIe pco=
+ dynamic_cast<
+ PcoIe&>(GtpV2IeFactory::getInstance().getIeObject(PcoIeType));
+ rc = pco.encodePcoIe(buffer, data.protocolConfigurationOptions);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: protocolConfigurationOptions\n");
+ return false;
+ }
+ }
+
+ if (data.ueTimeZoneIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = UeTimeZoneIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ UeTimeZoneIe ueTimeZone=
+ dynamic_cast<
+ UeTimeZoneIe&>(GtpV2IeFactory::getInstance().getIeObject(UeTimeZoneIeType));
+ rc = ueTimeZone.encodeUeTimeZoneIe(buffer, data.ueTimeZone);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: ueTimeZone\n");
+ return false;
+ }
+ }
+
+ if (data.userLocationInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = UliIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ UliIe uli=
+ dynamic_cast<
+ UliIe&>(GtpV2IeFactory::getInstance().getIeObject(UliIeType));
+ rc = uli.encodeUliIe(buffer, data.userLocationInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: userLocationInformation\n");
+ return false;
+ }
+ }
+
+ if (data.twanIdentifierIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = TwanIdentifierIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ TwanIdentifierIe twanIdentifier=
+ dynamic_cast<
+ TwanIdentifierIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierIeType));
+ rc = twanIdentifier.encodeTwanIdentifierIe(buffer, data.twanIdentifier);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: twanIdentifier\n");
+ return false;
+ }
+ }
+
+ if (data.mmeS4SgsnsOverloadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = OverloadControlInformationIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ MmeS4SgsnsOverloadControlInformationInCreateBearerResponse groupedIeInstance =
+ dynamic_cast<
+ MmeS4SgsnsOverloadControlInformationInCreateBearerResponse&>(overloadControlInformation.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.encodeMmeS4SgsnsOverloadControlInformationInCreateBearerResponse(buffer, data.mmeS4SgsnsOverloadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: mmeS4SgsnsOverloadControlInformation\n");
+ return false;
+ }
+ }
+
+ if (data.sgwsOverloadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = OverloadControlInformationIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ SgwsOverloadControlInformationInCreateBearerResponse groupedIeInstance =
+ dynamic_cast<
+ SgwsOverloadControlInformationInCreateBearerResponse&>(overloadControlInformation.getGroupedIe(msgType, 1));
+ rc = groupedIeInstance.encodeSgwsOverloadControlInformationInCreateBearerResponse(buffer, data.sgwsOverloadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: sgwsOverloadControlInformation\n");
+ return false;
+ }
+ }
+
+ if (data.mmeS4SgsnIdentifierIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = IpAddressIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ IpAddressIe ipAddress=
+ dynamic_cast<
+ IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
+ rc = ipAddress.encodeIpAddressIe(buffer, data.mmeS4SgsnIdentifier);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: mmeS4SgsnIdentifier\n");
+ return false;
+ }
+ }
+
+ if (data.twanEpdgsOverloadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = OverloadControlInformationIeType;
+ header.instance = 2;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ TwanEpdgsOverloadControlInformationInCreateBearerResponse groupedIeInstance =
+ dynamic_cast<
+ TwanEpdgsOverloadControlInformationInCreateBearerResponse&>(overloadControlInformation.getGroupedIe(msgType, 2));
+ rc = groupedIeInstance.encodeTwanEpdgsOverloadControlInformationInCreateBearerResponse(buffer, data.twanEpdgsOverloadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: twanEpdgsOverloadControlInformation\n");
+ return false;
+ }
+ }
+
+ if (data.wlanLocationInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = TwanIdentifierIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ TwanIdentifierIe twanIdentifier=
+ dynamic_cast<
+ TwanIdentifierIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierIeType));
+ rc = twanIdentifier.encodeTwanIdentifierIe(buffer, data.wlanLocationInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: wlanLocationInformation\n");
+ return false;
+ }
+ }
+
+ if (data.wlanLocationTimestampIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = TwanIdentifierTimestampIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ TwanIdentifierTimestampIe twanIdentifierTimestamp=
+ dynamic_cast<
+ TwanIdentifierTimestampIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierTimestampIeType));
+ rc = twanIdentifierTimestamp.encodeTwanIdentifierTimestampIe(buffer, data.wlanLocationTimestamp);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: wlanLocationTimestamp\n");
+ return false;
+ }
+ }
+
+ if (data.ueLocalIpAddressIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = IpAddressIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ IpAddressIe ipAddress=
+ dynamic_cast<
+ IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
+ rc = ipAddress.encodeIpAddressIe(buffer, data.ueLocalIpAddress);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: ueLocalIpAddress\n");
+ return false;
+ }
+ }
+
+ if (data.ueUdpPortIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = PortNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ PortNumberIe portNumber=
+ dynamic_cast<
+ PortNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(PortNumberIeType));
+ rc = portNumber.encodePortNumberIe(buffer, data.ueUdpPort);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: ueUdpPort\n");
+ return false;
+ }
+ }
+
+ if (data.nbifomContainerIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FContainerIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ FContainerIe fContainer=
+ dynamic_cast<
+ FContainerIe&>(GtpV2IeFactory::getInstance().getIeObject(FContainerIeType));
+ rc = fContainer.encodeFContainerIe(buffer, data.nbifomContainer);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: nbifomContainer\n");
+ return false;
+ }
+ }
+
+ if (data.ueTcpPortIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = PortNumberIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ PortNumberIe portNumber=
+ dynamic_cast<
+ PortNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(PortNumberIeType));
+ rc = portNumber.encodePortNumberIe(buffer, data.ueTcpPort);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: ueTcpPort\n");
+ return false;
+ }
+ }
+ return rc;
+
+}
+
+bool CreateBearerResponseMsg::decodeCreateBearerResponseMsg(MsgBuffer &buffer,
+ CreateBearerResponseMsgData
+ &data, Uint16 length)
+{
+
+ bool rc = false;
+ GtpV2IeHeader ieHeader;
+
+ set<Uint16> mandatoryIeLocalList = mandatoryIeSet;
+ while (buffer.lengthLeft() > IE_HEADER_SIZE)
+ {
+ GtpV2Ie::decodeGtpV2IeHeader(buffer, ieHeader);
+ if (ieHeader.length > buffer.lengthLeft())
+ {
+ // We do not have enough bytes left in the message for this IE
+ errorStream.add((char *)"IE Length exceeds beyond message boundary\n");
+ errorStream.add((char *)" Offending IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.add((char *)"\n Ie Length in Header: ");
+ errorStream.add(ieHeader.length);
+ errorStream.add((char *)"\n Bytes left in message: ");
+ errorStream.add(buffer.lengthLeft());
+ errorStream.endOfLine();
+ return false;
+ }
+
+ switch (ieHeader.ieType){
+
+ case CauseIeType:
+ {
+ CauseIe ieObject =
+ dynamic_cast<
+ CauseIe&>(GtpV2IeFactory::getInstance().getIeObject(CauseIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeCauseIe(buffer, data.cause, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: cause\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case BearerContextIeType:
+ {
+ BearerContextIe ieObject =
+ dynamic_cast<
+ BearerContextIe&>(GtpV2IeFactory::getInstance().getIeObject(BearerContextIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ // First check if we have enough space left to decode and store this instance
+ if (data.bearerContextsCount == 11)
+ {
+ errorStream.add((char *)"More than 11 instances of bearerContexts received\n");
+ return false;
+ }
+ BearerContextsInCreateBearerResponse groupedIeInstance =
+ dynamic_cast<
+ BearerContextsInCreateBearerResponse&>(ieObject.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.decodeBearerContextsInCreateBearerResponse(buffer,
+ data.bearerContexts[data.bearerContextsCount], ieHeader.length);
+ data.bearerContextsCount++; // TODO Count validation
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: bearerContexts\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case RecoveryIeType:
+ {
+ RecoveryIe ieObject =
+ dynamic_cast<
+ RecoveryIe&>(GtpV2IeFactory::getInstance().getIeObject(RecoveryIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeRecoveryIe(buffer, data.recovery, ieHeader.length);
+
+ data.recoveryIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: recovery\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case FqCsidIeType:
+ {
+ FqCsidIe ieObject =
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeFqCsidIe(buffer, data.mmeFqCsid, ieHeader.length);
+
+ data.mmeFqCsidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: mmeFqCsid\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ rc = ieObject.decodeFqCsidIe(buffer, data.sgwFqCsid, ieHeader.length);
+
+ data.sgwFqCsidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: sgwFqCsid\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 2)
+ {
+ rc = ieObject.decodeFqCsidIe(buffer, data.epdgFqCsid, ieHeader.length);
+
+ data.epdgFqCsidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: epdgFqCsid\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 3)
+ {
+ rc = ieObject.decodeFqCsidIe(buffer, data.twanFqCsid, ieHeader.length);
+
+ data.twanFqCsidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: twanFqCsid\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case PcoIeType:
+ {
+ PcoIe ieObject =
+ dynamic_cast<
+ PcoIe&>(GtpV2IeFactory::getInstance().getIeObject(PcoIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodePcoIe(buffer, data.protocolConfigurationOptions, ieHeader.length);
+
+ data.protocolConfigurationOptionsIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: protocolConfigurationOptions\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case UeTimeZoneIeType:
+ {
+ UeTimeZoneIe ieObject =
+ dynamic_cast<
+ UeTimeZoneIe&>(GtpV2IeFactory::getInstance().getIeObject(UeTimeZoneIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeUeTimeZoneIe(buffer, data.ueTimeZone, ieHeader.length);
+
+ data.ueTimeZoneIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: ueTimeZone\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case UliIeType:
+ {
+ UliIe ieObject =
+ dynamic_cast<
+ UliIe&>(GtpV2IeFactory::getInstance().getIeObject(UliIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeUliIe(buffer, data.userLocationInformation, ieHeader.length);
+
+ data.userLocationInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: userLocationInformation\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case TwanIdentifierIeType:
+ {
+ TwanIdentifierIe ieObject =
+ dynamic_cast<
+ TwanIdentifierIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeTwanIdentifierIe(buffer, data.twanIdentifier, ieHeader.length);
+
+ data.twanIdentifierIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: twanIdentifier\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ rc = ieObject.decodeTwanIdentifierIe(buffer, data.wlanLocationInformation, ieHeader.length);
+
+ data.wlanLocationInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: wlanLocationInformation\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case OverloadControlInformationIeType:
+ {
+ OverloadControlInformationIe ieObject =
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ MmeS4SgsnsOverloadControlInformationInCreateBearerResponse groupedIeInstance =
+ dynamic_cast<
+ MmeS4SgsnsOverloadControlInformationInCreateBearerResponse&>(ieObject.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.decodeMmeS4SgsnsOverloadControlInformationInCreateBearerResponse(buffer, data.mmeS4SgsnsOverloadControlInformation, ieHeader.length);
+
+ data.mmeS4SgsnsOverloadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: mmeS4SgsnsOverloadControlInformation\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ SgwsOverloadControlInformationInCreateBearerResponse groupedIeInstance =
+ dynamic_cast<
+ SgwsOverloadControlInformationInCreateBearerResponse&>(ieObject.getGroupedIe(msgType, 1));
+ rc = groupedIeInstance.decodeSgwsOverloadControlInformationInCreateBearerResponse(buffer, data.sgwsOverloadControlInformation, ieHeader.length);
+
+ data.sgwsOverloadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: sgwsOverloadControlInformation\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 2)
+ {
+ TwanEpdgsOverloadControlInformationInCreateBearerResponse groupedIeInstance =
+ dynamic_cast<
+ TwanEpdgsOverloadControlInformationInCreateBearerResponse&>(ieObject.getGroupedIe(msgType, 2));
+ rc = groupedIeInstance.decodeTwanEpdgsOverloadControlInformationInCreateBearerResponse(buffer, data.twanEpdgsOverloadControlInformation, ieHeader.length);
+
+ data.twanEpdgsOverloadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: twanEpdgsOverloadControlInformation\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case IpAddressIeType:
+ {
+ IpAddressIe ieObject =
+ dynamic_cast<
+ IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeIpAddressIe(buffer, data.mmeS4SgsnIdentifier, ieHeader.length);
+
+ data.mmeS4SgsnIdentifierIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: mmeS4SgsnIdentifier\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeIpAddressIe(buffer, data.ueLocalIpAddress, ieHeader.length);
+
+ data.ueLocalIpAddressIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: ueLocalIpAddress\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case TwanIdentifierTimestampIeType:
+ {
+ TwanIdentifierTimestampIe ieObject =
+ dynamic_cast<
+ TwanIdentifierTimestampIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierTimestampIeType));
+
+ if(ieHeader.instance == 1)
+ {
+ rc = ieObject.decodeTwanIdentifierTimestampIe(buffer, data.wlanLocationTimestamp, ieHeader.length);
+
+ data.wlanLocationTimestampIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: wlanLocationTimestamp\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case PortNumberIeType:
+ {
+ PortNumberIe ieObject =
+ dynamic_cast<
+ PortNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(PortNumberIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodePortNumberIe(buffer, data.ueUdpPort, ieHeader.length);
+
+ data.ueUdpPortIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: ueUdpPort\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ rc = ieObject.decodePortNumberIe(buffer, data.ueTcpPort, ieHeader.length);
+
+ data.ueTcpPortIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: ueTcpPort\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case FContainerIeType:
+ {
+ FContainerIe ieObject =
+ dynamic_cast<
+ FContainerIe&>(GtpV2IeFactory::getInstance().getIeObject(FContainerIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeFContainerIe(buffer, data.nbifomContainer, ieHeader.length);
+
+ data.nbifomContainerIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: nbifomContainer\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ default:
+ {
+ // Unknown IE print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ }
+ }
+ return rc; // TODO validations
+}
+
+void CreateBearerResponseMsg::
+displayCreateBearerResponseMsgData_v(CreateBearerResponseMsgData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"CreateBearerResponseMsg:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+ stream.add((char *)"IE - cause:");
+ stream.endOfLine();
+ CauseIe cause=
+ dynamic_cast<
+ CauseIe&>(GtpV2IeFactory::getInstance().getIeObject(CauseIeType));
+ cause.displayCauseIe_v(data.cause, stream);
+
+
+ Uint8 displayCount;
+
+ displayCount = data.bearerContextsCount;
+ if (displayCount > 11)
+ {
+ stream.add((char *)"Invalid data more than 11 instances");
+ stream.endOfLine();
+ stream.add((char *)"Displaying only 11");
+ stream.endOfLine();
+ displayCount = 11;
+ }
+ for (Uint8 i = 0; i < displayCount; i++)
+ {
+ stream.add((char *)"IE - bearerContexts:");
+ stream.endOfLine();
+ BearerContextIe bearerContext=
+ dynamic_cast<
+ BearerContextIe&>(GtpV2IeFactory::getInstance().getIeObject(BearerContextIeType));
+ BearerContextsInCreateBearerResponse groupedIeInstance =
+ dynamic_cast<
+ BearerContextsInCreateBearerResponse&>(bearerContext.getGroupedIe(msgType, 0));
+ groupedIeInstance.displayBearerContextsInCreateBearerResponseData_v(data.bearerContexts[i], stream);
+
+ }
+ if (data.recoveryIePresent)
+ {
+
+
+ stream.add((char *)"IE - recovery:");
+ stream.endOfLine();
+ RecoveryIe recovery=
+ dynamic_cast<
+ RecoveryIe&>(GtpV2IeFactory::getInstance().getIeObject(RecoveryIeType));
+ recovery.displayRecoveryIe_v(data.recovery, stream);
+
+ }
+ if (data.mmeFqCsidIePresent)
+ {
+
+
+ stream.add((char *)"IE - mmeFqCsid:");
+ stream.endOfLine();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ fqCsid.displayFqCsidIe_v(data.mmeFqCsid, stream);
+
+ }
+ if (data.sgwFqCsidIePresent)
+ {
+
+
+ stream.add((char *)"IE - sgwFqCsid:");
+ stream.endOfLine();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ fqCsid.displayFqCsidIe_v(data.sgwFqCsid, stream);
+
+ }
+ if (data.epdgFqCsidIePresent)
+ {
+
+
+ stream.add((char *)"IE - epdgFqCsid:");
+ stream.endOfLine();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ fqCsid.displayFqCsidIe_v(data.epdgFqCsid, stream);
+
+ }
+ if (data.twanFqCsidIePresent)
+ {
+
+
+ stream.add((char *)"IE - twanFqCsid:");
+ stream.endOfLine();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ fqCsid.displayFqCsidIe_v(data.twanFqCsid, stream);
+
+ }
+ if (data.protocolConfigurationOptionsIePresent)
+ {
+
+
+ stream.add((char *)"IE - protocolConfigurationOptions:");
+ stream.endOfLine();
+ PcoIe pco=
+ dynamic_cast<
+ PcoIe&>(GtpV2IeFactory::getInstance().getIeObject(PcoIeType));
+ pco.displayPcoIe_v(data.protocolConfigurationOptions, stream);
+
+ }
+ if (data.ueTimeZoneIePresent)
+ {
+
+
+ stream.add((char *)"IE - ueTimeZone:");
+ stream.endOfLine();
+ UeTimeZoneIe ueTimeZone=
+ dynamic_cast<
+ UeTimeZoneIe&>(GtpV2IeFactory::getInstance().getIeObject(UeTimeZoneIeType));
+ ueTimeZone.displayUeTimeZoneIe_v(data.ueTimeZone, stream);
+
+ }
+ if (data.userLocationInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - userLocationInformation:");
+ stream.endOfLine();
+ UliIe uli=
+ dynamic_cast<
+ UliIe&>(GtpV2IeFactory::getInstance().getIeObject(UliIeType));
+ uli.displayUliIe_v(data.userLocationInformation, stream);
+
+ }
+ if (data.twanIdentifierIePresent)
+ {
+
+
+ stream.add((char *)"IE - twanIdentifier:");
+ stream.endOfLine();
+ TwanIdentifierIe twanIdentifier=
+ dynamic_cast<
+ TwanIdentifierIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierIeType));
+ twanIdentifier.displayTwanIdentifierIe_v(data.twanIdentifier, stream);
+
+ }
+ if (data.mmeS4SgsnsOverloadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - mmeS4SgsnsOverloadControlInformation:");
+ stream.endOfLine();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ MmeS4SgsnsOverloadControlInformationInCreateBearerResponse groupedIeInstance =
+ dynamic_cast<
+ MmeS4SgsnsOverloadControlInformationInCreateBearerResponse&>(overloadControlInformation.getGroupedIe(msgType, 0));
+ groupedIeInstance.displayMmeS4SgsnsOverloadControlInformationInCreateBearerResponseData_v(data.mmeS4SgsnsOverloadControlInformation, stream);
+
+ }
+ if (data.sgwsOverloadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - sgwsOverloadControlInformation:");
+ stream.endOfLine();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ SgwsOverloadControlInformationInCreateBearerResponse groupedIeInstance =
+ dynamic_cast<
+ SgwsOverloadControlInformationInCreateBearerResponse&>(overloadControlInformation.getGroupedIe(msgType, 1));
+ groupedIeInstance.displaySgwsOverloadControlInformationInCreateBearerResponseData_v(data.sgwsOverloadControlInformation, stream);
+
+ }
+ if (data.mmeS4SgsnIdentifierIePresent)
+ {
+
+
+ stream.add((char *)"IE - mmeS4SgsnIdentifier:");
+ stream.endOfLine();
+ IpAddressIe ipAddress=
+ dynamic_cast<
+ IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
+ ipAddress.displayIpAddressIe_v(data.mmeS4SgsnIdentifier, stream);
+
+ }
+ if (data.twanEpdgsOverloadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - twanEpdgsOverloadControlInformation:");
+ stream.endOfLine();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ TwanEpdgsOverloadControlInformationInCreateBearerResponse groupedIeInstance =
+ dynamic_cast<
+ TwanEpdgsOverloadControlInformationInCreateBearerResponse&>(overloadControlInformation.getGroupedIe(msgType, 2));
+ groupedIeInstance.displayTwanEpdgsOverloadControlInformationInCreateBearerResponseData_v(data.twanEpdgsOverloadControlInformation, stream);
+
+ }
+ if (data.wlanLocationInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - wlanLocationInformation:");
+ stream.endOfLine();
+ TwanIdentifierIe twanIdentifier=
+ dynamic_cast<
+ TwanIdentifierIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierIeType));
+ twanIdentifier.displayTwanIdentifierIe_v(data.wlanLocationInformation, stream);
+
+ }
+ if (data.wlanLocationTimestampIePresent)
+ {
+
+
+ stream.add((char *)"IE - wlanLocationTimestamp:");
+ stream.endOfLine();
+ TwanIdentifierTimestampIe twanIdentifierTimestamp=
+ dynamic_cast<
+ TwanIdentifierTimestampIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierTimestampIeType));
+ twanIdentifierTimestamp.displayTwanIdentifierTimestampIe_v(data.wlanLocationTimestamp, stream);
+
+ }
+ if (data.ueLocalIpAddressIePresent)
+ {
+
+
+ stream.add((char *)"IE - ueLocalIpAddress:");
+ stream.endOfLine();
+ IpAddressIe ipAddress=
+ dynamic_cast<
+ IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
+ ipAddress.displayIpAddressIe_v(data.ueLocalIpAddress, stream);
+
+ }
+ if (data.ueUdpPortIePresent)
+ {
+
+
+ stream.add((char *)"IE - ueUdpPort:");
+ stream.endOfLine();
+ PortNumberIe portNumber=
+ dynamic_cast<
+ PortNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(PortNumberIeType));
+ portNumber.displayPortNumberIe_v(data.ueUdpPort, stream);
+
+ }
+ if (data.nbifomContainerIePresent)
+ {
+
+
+ stream.add((char *)"IE - nbifomContainer:");
+ stream.endOfLine();
+ FContainerIe fContainer=
+ dynamic_cast<
+ FContainerIe&>(GtpV2IeFactory::getInstance().getIeObject(FContainerIeType));
+ fContainer.displayFContainerIe_v(data.nbifomContainer, stream);
+
+ }
+ if (data.ueTcpPortIePresent)
+ {
+
+
+ stream.add((char *)"IE - ueTcpPort:");
+ stream.endOfLine();
+ PortNumberIe portNumber=
+ dynamic_cast<
+ PortNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(PortNumberIeType));
+ portNumber.displayPortNumberIe_v(data.ueTcpPort, stream);
+
+ }
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
diff --git a/src/gtpV2Codec/msgClasses/createBearerResponseMsg.h b/src/gtpV2Codec/msgClasses/createBearerResponseMsg.h
new file mode 100644
index 0000000..8e25965
--- /dev/null
+++ b/src/gtpV2Codec/msgClasses/createBearerResponseMsg.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2019-present, Infosys Limited.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ /******************************************************************************
+ *
+ * This is an auto generated file.
+ * Please do not edit this file.
+ * All edits to be made through template source file
+ * <TOP-DIR/scripts/GtpV2StackCodeGen/tts/msgtemplate.h.tt>
+ ******************************************************************************/
+#ifndef CREATEBEARERRESPONSEMSG_H_
+#define CREATEBEARERRESPONSEMSG_H_
+
+#include <set>
+#include "manual/gtpV2Message.h"
+#include <msgBuffer.h>
+#include <debug.h>
+#include "gtpV2MsgDataTypes.h"
+
+
+class CreateBearerResponseMsg:public GtpV2Message
+{
+public:
+ CreateBearerResponseMsg();
+ virtual ~CreateBearerResponseMsg();
+ bool encodeCreateBearerResponseMsg(MsgBuffer &buffer, CreateBearerResponseMsgData const &data);
+
+ bool decodeCreateBearerResponseMsg (MsgBuffer &buffer, CreateBearerResponseMsgData& data, Uint16 length);
+
+ void displayCreateBearerResponseMsgData_v(CreateBearerResponseMsgData const &data, Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/msgClasses/createSessionRequestMsg.cpp b/src/gtpV2Codec/msgClasses/createSessionRequestMsg.cpp
new file mode 100644
index 0000000..943558a
--- /dev/null
+++ b/src/gtpV2Codec/msgClasses/createSessionRequestMsg.cpp
@@ -0,0 +1,4222 @@
+/*
+ * Copyright 2019-present Infosys Limited
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+/******************************************************************************
+ *
+ * This is an auto generated file.
+ * Please do not edit this file.
+ * All edits to be made through template source file
+ * <TOP-DIR/scripts/GtpV2StackCodeGen/tts/msgtemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "createSessionRequestMsg.h"
+#include "../ieClasses/manual/gtpV2Ie.h"
+#include "../ieClasses/gtpV2IeFactory.h"
+#include "../ieClasses/imsiIe.h"
+#include "../ieClasses/msisdnIe.h"
+#include "../ieClasses/meiIe.h"
+#include "../ieClasses/uliIe.h"
+#include "../ieClasses/servingNetworkIe.h"
+#include "../ieClasses/ratTypeIe.h"
+#include "../ieClasses/indicationIe.h"
+#include "../ieClasses/fTeidIe.h"
+#include "../ieClasses/fTeidIe.h"
+#include "../ieClasses/apnIe.h"
+#include "../ieClasses/selectionModeIe.h"
+#include "../ieClasses/pdnTypeIe.h"
+#include "../ieClasses/paaIe.h"
+#include "../ieClasses/apnRestrictionIe.h"
+#include "../ieClasses/ambrIe.h"
+#include "../ieClasses/ebiIe.h"
+#include "../ieClasses/twmiIe.h"
+#include "../ieClasses/pcoIe.h"
+#include "../ieClasses/bearerContextIe.h"
+#include "../ieClasses/bearerContextsToBeCreatedInCreateSessionRequest.h"
+#include "../ieClasses/bearerContextIe.h"
+#include "../ieClasses/bearerContextsToBeRemovedInCreateSessionRequest.h"
+#include "../ieClasses/traceInformationIe.h"
+#include "../ieClasses/recoveryIe.h"
+#include "../ieClasses/fqCsidIe.h"
+#include "../ieClasses/fqCsidIe.h"
+#include "../ieClasses/fqCsidIe.h"
+#include "../ieClasses/fqCsidIe.h"
+#include "../ieClasses/ueTimeZoneIe.h"
+#include "../ieClasses/uciIe.h"
+#include "../ieClasses/chargingCharacteristicsIe.h"
+#include "../ieClasses/localDistinguishedNameIe.h"
+#include "../ieClasses/localDistinguishedNameIe.h"
+#include "../ieClasses/localDistinguishedNameIe.h"
+#include "../ieClasses/localDistinguishedNameIe.h"
+#include "../ieClasses/signallingPriorityIndicationIe.h"
+#include "../ieClasses/ipAddressIe.h"
+#include "../ieClasses/portNumberIe.h"
+#include "../ieClasses/additionalProtocolConfigurationOptionsIe.h"
+#include "../ieClasses/ipAddressIe.h"
+#include "../ieClasses/portNumberIe.h"
+#include "../ieClasses/ipAddressIe.h"
+#include "../ieClasses/twanIdentifierIe.h"
+#include "../ieClasses/ipAddressIe.h"
+#include "../ieClasses/cnOperatorSelectionEntityIe.h"
+#include "../ieClasses/overloadControlInformationIe.h"
+#include "../ieClasses/mmeS4SgsnsOverloadControlInformationInCreateSessionRequest.h"
+#include "../ieClasses/overloadControlInformationIe.h"
+#include "../ieClasses/sgwsOverloadControlInformationInCreateSessionRequest.h"
+#include "../ieClasses/overloadControlInformationIe.h"
+#include "../ieClasses/twanEpdgsOverloadControlInformationInCreateSessionRequest.h"
+#include "../ieClasses/millisecondTimeStampIe.h"
+#include "../ieClasses/integerNumberIe.h"
+#include "../ieClasses/twanIdentifierIe.h"
+#include "../ieClasses/twanIdentifierTimestampIe.h"
+#include "../ieClasses/fContainerIe.h"
+#include "../ieClasses/remoteUeContextIe.h"
+#include "../ieClasses/remoteUeContextConnectedInCreateSessionRequest.h"
+#include "../ieClasses/nodeIdentifierIe.h"
+#include "../ieClasses/epcoIe.h"
+#include "../ieClasses/servingPlmnRateControlIe.h"
+#include "../ieClasses/counterIe.h"
+#include "../ieClasses/portNumberIe.h"
+#include "../ieClasses/mappedUeUsageTypeIe.h"
+#include "../ieClasses/uliIe.h"
+#include "../ieClasses/fqdnIe.h"
+#include "../ieClasses/secondaryRatUsageDataReportIe.h"
+#include "../ieClasses/upFunctionSelectionIndicationFlagsIe.h"
+
+CreateSessionRequestMsg::CreateSessionRequestMsg()
+{
+ msgType = CreateSessionRequestMsgType;
+ Uint16 mandIe;
+ mandIe = RatTypeIeType;
+ mandIe = (mandIe << 8) | 0; // ratType
+ mandatoryIeSet.insert(mandIe); mandIe = FTeidIeType;
+ mandIe = (mandIe << 8) | 0; // senderFTeidForControlPlane
+ mandatoryIeSet.insert(mandIe); mandIe = ApnIeType;
+ mandIe = (mandIe << 8) | 0; // accessPointName
+ mandatoryIeSet.insert(mandIe); mandIe = BearerContextIeType;
+ mandIe = (mandIe << 8) | 0; // bearerContextsToBeCreated
+ mandatoryIeSet.insert(mandIe);
+}
+
+CreateSessionRequestMsg::~CreateSessionRequestMsg()
+{
+
+}
+
+bool CreateSessionRequestMsg::encodeCreateSessionRequestMsg(MsgBuffer &buffer,
+ CreateSessionRequestMsgData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+ if (data.imsiIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = ImsiIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ ImsiIe imsi=
+ dynamic_cast<
+ ImsiIe&>(GtpV2IeFactory::getInstance().getIeObject(ImsiIeType));
+ rc = imsi.encodeImsiIe(buffer, data.imsi);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: imsi\n");
+ return false;
+ }
+ }
+
+ if (data.msisdnIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = MsisdnIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MsisdnIe msisdn=
+ dynamic_cast<
+ MsisdnIe&>(GtpV2IeFactory::getInstance().getIeObject(MsisdnIeType));
+ rc = msisdn.encodeMsisdnIe(buffer, data.msisdn);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: msisdn\n");
+ return false;
+ }
+ }
+
+ if (data.meIdentityIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = MeiIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MeiIe mei=
+ dynamic_cast<
+ MeiIe&>(GtpV2IeFactory::getInstance().getIeObject(MeiIeType));
+ rc = mei.encodeMeiIe(buffer, data.meIdentity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: meIdentity\n");
+ return false;
+ }
+ }
+
+ if (data.userLocationInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = UliIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ UliIe uli=
+ dynamic_cast<
+ UliIe&>(GtpV2IeFactory::getInstance().getIeObject(UliIeType));
+ rc = uli.encodeUliIe(buffer, data.userLocationInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: userLocationInformation\n");
+ return false;
+ }
+ }
+
+ if (data.servingNetworkIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = ServingNetworkIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ ServingNetworkIe servingNetwork=
+ dynamic_cast<
+ ServingNetworkIe&>(GtpV2IeFactory::getInstance().getIeObject(ServingNetworkIeType));
+ rc = servingNetwork.encodeServingNetworkIe(buffer, data.servingNetwork);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: servingNetwork\n");
+ return false;
+ }
+ }
+
+
+ // Encode the Ie Header
+ header.ieType = RatTypeIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ RatTypeIe ratType=
+ dynamic_cast<
+ RatTypeIe&>(GtpV2IeFactory::getInstance().getIeObject(RatTypeIeType));
+ rc = ratType.encodeRatTypeIe(buffer, data.ratType);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: ratType\n");
+ return false;
+ }
+
+ if (data.indicationFlagsIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = IndicationIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ IndicationIe indication=
+ dynamic_cast<
+ IndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(IndicationIeType));
+ rc = indication.encodeIndicationIe(buffer, data.indicationFlags);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: indicationFlags\n");
+ return false;
+ }
+ }
+
+
+ // Encode the Ie Header
+ header.ieType = FTeidIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ rc = fTeid.encodeFTeidIe(buffer, data.senderFTeidForControlPlane);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: senderFTeidForControlPlane\n");
+ return false;
+ }
+
+ if (data.pgwS5S8AddressForControlPlaneOrPmipIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FTeidIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ rc = fTeid.encodeFTeidIe(buffer, data.pgwS5S8AddressForControlPlaneOrPmip);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: pgwS5S8AddressForControlPlaneOrPmip\n");
+ return false;
+ }
+ }
+
+
+ // Encode the Ie Header
+ header.ieType = ApnIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ ApnIe apn=
+ dynamic_cast<
+ ApnIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnIeType));
+ rc = apn.encodeApnIe(buffer, data.accessPointName);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: accessPointName\n");
+ return false;
+ }
+
+ if (data.selectionModeIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = SelectionModeIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SelectionModeIe selectionMode=
+ dynamic_cast<
+ SelectionModeIe&>(GtpV2IeFactory::getInstance().getIeObject(SelectionModeIeType));
+ rc = selectionMode.encodeSelectionModeIe(buffer, data.selectionMode);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: selectionMode\n");
+ return false;
+ }
+ }
+
+ if (data.pdnTypeIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = PdnTypeIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ PdnTypeIe pdnType=
+ dynamic_cast<
+ PdnTypeIe&>(GtpV2IeFactory::getInstance().getIeObject(PdnTypeIeType));
+ rc = pdnType.encodePdnTypeIe(buffer, data.pdnType);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: pdnType\n");
+ return false;
+ }
+ }
+
+ if (data.pdnAddressAllocationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = PaaIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ PaaIe paa=
+ dynamic_cast<
+ PaaIe&>(GtpV2IeFactory::getInstance().getIeObject(PaaIeType));
+ rc = paa.encodePaaIe(buffer, data.pdnAddressAllocation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: pdnAddressAllocation\n");
+ return false;
+ }
+ }
+
+ if (data.maximumApnRestrictionIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = ApnRestrictionIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ ApnRestrictionIe apnRestriction=
+ dynamic_cast<
+ ApnRestrictionIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnRestrictionIeType));
+ rc = apnRestriction.encodeApnRestrictionIe(buffer, data.maximumApnRestriction);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: maximumApnRestriction\n");
+ return false;
+ }
+ }
+
+ if (data.aggregateMaximumBitRateIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = AmbrIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ AmbrIe ambr=
+ dynamic_cast<
+ AmbrIe&>(GtpV2IeFactory::getInstance().getIeObject(AmbrIeType));
+ rc = ambr.encodeAmbrIe(buffer, data.aggregateMaximumBitRate);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: aggregateMaximumBitRate\n");
+ return false;
+ }
+ }
+
+ if (data.linkedEpsBearerIdIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = EbiIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ EbiIe ebi=
+ dynamic_cast<
+ EbiIe&>(GtpV2IeFactory::getInstance().getIeObject(EbiIeType));
+ rc = ebi.encodeEbiIe(buffer, data.linkedEpsBearerId);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: linkedEpsBearerId\n");
+ return false;
+ }
+ }
+
+ if (data.trustedWlanModeIndicationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = TwmiIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ TwmiIe twmi=
+ dynamic_cast<
+ TwmiIe&>(GtpV2IeFactory::getInstance().getIeObject(TwmiIeType));
+ rc = twmi.encodeTwmiIe(buffer, data.trustedWlanModeIndication);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: trustedWlanModeIndication\n");
+ return false;
+ }
+ }
+
+ if (data.protocolConfigurationOptionsIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = PcoIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ PcoIe pco=
+ dynamic_cast<
+ PcoIe&>(GtpV2IeFactory::getInstance().getIeObject(PcoIeType));
+ rc = pco.encodePcoIe(buffer, data.protocolConfigurationOptions);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: protocolConfigurationOptions\n");
+ return false;
+ }
+ }
+
+ // First validate if the applicatoin provided more than the expected cardinality
+ if (data.bearerContextsToBeCreatedCount > 11)
+ {
+ errorStream.add((char *)"Number of entries of bearerContextsToBeCreated exceeded\n");
+ errorStream.add((char *)"Expected count: 11 Received count: ");
+ errorStream.add((char *)"data.bearerContextsToBeCreatedCount");
+ errorStream.endOfLine();
+ return false;
+ }
+ for (Uint8 i = 0; i < data.bearerContextsToBeCreatedCount; i++)
+ {
+ // Encode the Ie Header
+ header.ieType = BearerContextIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ BearerContextIe bearerContext=
+ dynamic_cast<
+ BearerContextIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(BearerContextIeType));
+ BearerContextsToBeCreatedInCreateSessionRequest groupedIeInstance = dynamic_cast<BearerContextsToBeCreatedInCreateSessionRequest&>(bearerContext.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.encodeBearerContextsToBeCreatedInCreateSessionRequest(buffer, data.bearerContextsToBeCreated[i]);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ }
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: bearerContextsToBeCreated\n");
+ return false;
+ }
+
+ // First validate if the applicatoin provided more than the expected cardinality
+ if (data.bearerContextsToBeRemovedCount > 11)
+ {
+ errorStream.add((char *)"Number of entries of bearerContextsToBeRemoved exceeded\n");
+ errorStream.add((char *)"Expected count: 11 Received count: ");
+ errorStream.add((char *)"data.bearerContextsToBeRemovedCount");
+ errorStream.endOfLine();
+ return false;
+ }
+ for (Uint8 i = 0; i < data.bearerContextsToBeRemovedCount; i++)
+ {
+ // Encode the Ie Header
+ header.ieType = BearerContextIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ BearerContextIe bearerContext=
+ dynamic_cast<
+ BearerContextIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(BearerContextIeType));
+ BearerContextsToBeRemovedInCreateSessionRequest groupedIeInstance = dynamic_cast<BearerContextsToBeRemovedInCreateSessionRequest&>(bearerContext.getGroupedIe(msgType, 1));
+ rc = groupedIeInstance.encodeBearerContextsToBeRemovedInCreateSessionRequest(buffer, data.bearerContextsToBeRemoved[i]);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ }
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: bearerContextsToBeRemoved\n");
+ return false;
+ }
+
+ if (data.traceInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = TraceInformationIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ TraceInformationIe traceInformation=
+ dynamic_cast<
+ TraceInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(TraceInformationIeType));
+ rc = traceInformation.encodeTraceInformationIe(buffer, data.traceInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: traceInformation\n");
+ return false;
+ }
+ }
+
+ if (data.recoveryIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = RecoveryIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ RecoveryIe recovery=
+ dynamic_cast<
+ RecoveryIe&>(GtpV2IeFactory::getInstance().getIeObject(RecoveryIeType));
+ rc = recovery.encodeRecoveryIe(buffer, data.recovery);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: recovery\n");
+ return false;
+ }
+ }
+
+ if (data.mmeFqCsidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FqCsidIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ rc = fqCsid.encodeFqCsidIe(buffer, data.mmeFqCsid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: mmeFqCsid\n");
+ return false;
+ }
+ }
+
+ if (data.sgwFqCsidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FqCsidIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ rc = fqCsid.encodeFqCsidIe(buffer, data.sgwFqCsid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: sgwFqCsid\n");
+ return false;
+ }
+ }
+
+ if (data.epdgFqCsidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FqCsidIeType;
+ header.instance = 2;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ rc = fqCsid.encodeFqCsidIe(buffer, data.epdgFqCsid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: epdgFqCsid\n");
+ return false;
+ }
+ }
+
+ if (data.twanFqCsidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FqCsidIeType;
+ header.instance = 3;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ rc = fqCsid.encodeFqCsidIe(buffer, data.twanFqCsid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: twanFqCsid\n");
+ return false;
+ }
+ }
+
+ if (data.ueTimeZoneIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = UeTimeZoneIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ UeTimeZoneIe ueTimeZone=
+ dynamic_cast<
+ UeTimeZoneIe&>(GtpV2IeFactory::getInstance().getIeObject(UeTimeZoneIeType));
+ rc = ueTimeZone.encodeUeTimeZoneIe(buffer, data.ueTimeZone);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: ueTimeZone\n");
+ return false;
+ }
+ }
+
+ if (data.userCsgInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = UciIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ UciIe uci=
+ dynamic_cast<
+ UciIe&>(GtpV2IeFactory::getInstance().getIeObject(UciIeType));
+ rc = uci.encodeUciIe(buffer, data.userCsgInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: userCsgInformation\n");
+ return false;
+ }
+ }
+
+ if (data.chargingCharacteristicsIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = ChargingCharacteristicsIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ ChargingCharacteristicsIe chargingCharacteristics=
+ dynamic_cast<
+ ChargingCharacteristicsIe&>(GtpV2IeFactory::getInstance().getIeObject(ChargingCharacteristicsIeType));
+ rc = chargingCharacteristics.encodeChargingCharacteristicsIe(buffer, data.chargingCharacteristics);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: chargingCharacteristics\n");
+ return false;
+ }
+ }
+
+ if (data.mmeS4SgsnLdnIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = LocalDistinguishedNameIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ LocalDistinguishedNameIe localDistinguishedName=
+ dynamic_cast<
+ LocalDistinguishedNameIe&>(GtpV2IeFactory::getInstance().getIeObject(LocalDistinguishedNameIeType));
+ rc = localDistinguishedName.encodeLocalDistinguishedNameIe(buffer, data.mmeS4SgsnLdn);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: mmeS4SgsnLdn\n");
+ return false;
+ }
+ }
+
+ if (data.sgwLdnIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = LocalDistinguishedNameIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ LocalDistinguishedNameIe localDistinguishedName=
+ dynamic_cast<
+ LocalDistinguishedNameIe&>(GtpV2IeFactory::getInstance().getIeObject(LocalDistinguishedNameIeType));
+ rc = localDistinguishedName.encodeLocalDistinguishedNameIe(buffer, data.sgwLdn);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: sgwLdn\n");
+ return false;
+ }
+ }
+
+ if (data.epdgLdnIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = LocalDistinguishedNameIeType;
+ header.instance = 2;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ LocalDistinguishedNameIe localDistinguishedName=
+ dynamic_cast<
+ LocalDistinguishedNameIe&>(GtpV2IeFactory::getInstance().getIeObject(LocalDistinguishedNameIeType));
+ rc = localDistinguishedName.encodeLocalDistinguishedNameIe(buffer, data.epdgLdn);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: epdgLdn\n");
+ return false;
+ }
+ }
+
+ if (data.twanLdnIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = LocalDistinguishedNameIeType;
+ header.instance = 3;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ LocalDistinguishedNameIe localDistinguishedName=
+ dynamic_cast<
+ LocalDistinguishedNameIe&>(GtpV2IeFactory::getInstance().getIeObject(LocalDistinguishedNameIeType));
+ rc = localDistinguishedName.encodeLocalDistinguishedNameIe(buffer, data.twanLdn);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: twanLdn\n");
+ return false;
+ }
+ }
+
+ if (data.signallingPriorityIndicationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = SignallingPriorityIndicationIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SignallingPriorityIndicationIe signallingPriorityIndication=
+ dynamic_cast<
+ SignallingPriorityIndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(SignallingPriorityIndicationIeType));
+ rc = signallingPriorityIndication.encodeSignallingPriorityIndicationIe(buffer, data.signallingPriorityIndication);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: signallingPriorityIndication\n");
+ return false;
+ }
+ }
+
+ if (data.ueLocalIpAddressIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = IpAddressIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ IpAddressIe ipAddress=
+ dynamic_cast<
+ IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
+ rc = ipAddress.encodeIpAddressIe(buffer, data.ueLocalIpAddress);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: ueLocalIpAddress\n");
+ return false;
+ }
+ }
+
+ if (data.ueUdpPortIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = PortNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ PortNumberIe portNumber=
+ dynamic_cast<
+ PortNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(PortNumberIeType));
+ rc = portNumber.encodePortNumberIe(buffer, data.ueUdpPort);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: ueUdpPort\n");
+ return false;
+ }
+ }
+
+ if (data.additionalProtocolConfigurationOptionsIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = AdditionalProtocolConfigurationOptionsIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ AdditionalProtocolConfigurationOptionsIe additionalProtocolConfigurationOptions=
+ dynamic_cast<
+ AdditionalProtocolConfigurationOptionsIe&>(GtpV2IeFactory::getInstance().getIeObject(AdditionalProtocolConfigurationOptionsIeType));
+ rc = additionalProtocolConfigurationOptions.encodeAdditionalProtocolConfigurationOptionsIe(buffer, data.additionalProtocolConfigurationOptions);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: additionalProtocolConfigurationOptions\n");
+ return false;
+ }
+ }
+
+ if (data.hNbLocalIpAddressIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = IpAddressIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ IpAddressIe ipAddress=
+ dynamic_cast<
+ IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
+ rc = ipAddress.encodeIpAddressIe(buffer, data.hNbLocalIpAddress);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: hNbLocalIpAddress\n");
+ return false;
+ }
+ }
+
+ if (data.hNbUdpPortIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = PortNumberIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ PortNumberIe portNumber=
+ dynamic_cast<
+ PortNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(PortNumberIeType));
+ rc = portNumber.encodePortNumberIe(buffer, data.hNbUdpPort);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: hNbUdpPort\n");
+ return false;
+ }
+ }
+
+ if (data.mmeS4SgsnIdentifierIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = IpAddressIeType;
+ header.instance = 2;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ IpAddressIe ipAddress=
+ dynamic_cast<
+ IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
+ rc = ipAddress.encodeIpAddressIe(buffer, data.mmeS4SgsnIdentifier);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: mmeS4SgsnIdentifier\n");
+ return false;
+ }
+ }
+
+ if (data.twanIdentifierIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = TwanIdentifierIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ TwanIdentifierIe twanIdentifier=
+ dynamic_cast<
+ TwanIdentifierIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierIeType));
+ rc = twanIdentifier.encodeTwanIdentifierIe(buffer, data.twanIdentifier);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: twanIdentifier\n");
+ return false;
+ }
+ }
+
+ if (data.epdgIpAddressIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = IpAddressIeType;
+ header.instance = 3;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ IpAddressIe ipAddress=
+ dynamic_cast<
+ IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
+ rc = ipAddress.encodeIpAddressIe(buffer, data.epdgIpAddress);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: epdgIpAddress\n");
+ return false;
+ }
+ }
+
+ if (data.cnOperatorSelectionEntityIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = CnOperatorSelectionEntityIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ CnOperatorSelectionEntityIe cnOperatorSelectionEntity=
+ dynamic_cast<
+ CnOperatorSelectionEntityIe&>(GtpV2IeFactory::getInstance().getIeObject(CnOperatorSelectionEntityIeType));
+ rc = cnOperatorSelectionEntity.encodeCnOperatorSelectionEntityIe(buffer, data.cnOperatorSelectionEntity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: cnOperatorSelectionEntity\n");
+ return false;
+ }
+ }
+
+ if (data.mmeS4SgsnsOverloadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = OverloadControlInformationIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ MmeS4SgsnsOverloadControlInformationInCreateSessionRequest groupedIeInstance =
+ dynamic_cast<
+ MmeS4SgsnsOverloadControlInformationInCreateSessionRequest&>(overloadControlInformation.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.encodeMmeS4SgsnsOverloadControlInformationInCreateSessionRequest(buffer, data.mmeS4SgsnsOverloadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: mmeS4SgsnsOverloadControlInformation\n");
+ return false;
+ }
+ }
+
+ if (data.sgwsOverloadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = OverloadControlInformationIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ SgwsOverloadControlInformationInCreateSessionRequest groupedIeInstance =
+ dynamic_cast<
+ SgwsOverloadControlInformationInCreateSessionRequest&>(overloadControlInformation.getGroupedIe(msgType, 1));
+ rc = groupedIeInstance.encodeSgwsOverloadControlInformationInCreateSessionRequest(buffer, data.sgwsOverloadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: sgwsOverloadControlInformation\n");
+ return false;
+ }
+ }
+
+ if (data.twanEpdgsOverloadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = OverloadControlInformationIeType;
+ header.instance = 2;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ TwanEpdgsOverloadControlInformationInCreateSessionRequest groupedIeInstance =
+ dynamic_cast<
+ TwanEpdgsOverloadControlInformationInCreateSessionRequest&>(overloadControlInformation.getGroupedIe(msgType, 2));
+ rc = groupedIeInstance.encodeTwanEpdgsOverloadControlInformationInCreateSessionRequest(buffer, data.twanEpdgsOverloadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: twanEpdgsOverloadControlInformation\n");
+ return false;
+ }
+ }
+
+ if (data.originationTimeStampIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = MillisecondTimeStampIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MillisecondTimeStampIe millisecondTimeStamp=
+ dynamic_cast<
+ MillisecondTimeStampIe&>(GtpV2IeFactory::getInstance().getIeObject(MillisecondTimeStampIeType));
+ rc = millisecondTimeStamp.encodeMillisecondTimeStampIe(buffer, data.originationTimeStamp);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: originationTimeStamp\n");
+ return false;
+ }
+ }
+
+ if (data.maximumWaitTimeIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = IntegerNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ IntegerNumberIe integerNumber=
+ dynamic_cast<
+ IntegerNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(IntegerNumberIeType));
+ rc = integerNumber.encodeIntegerNumberIe(buffer, data.maximumWaitTime);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: maximumWaitTime\n");
+ return false;
+ }
+ }
+
+ if (data.wlanLocationInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = TwanIdentifierIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ TwanIdentifierIe twanIdentifier=
+ dynamic_cast<
+ TwanIdentifierIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierIeType));
+ rc = twanIdentifier.encodeTwanIdentifierIe(buffer, data.wlanLocationInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: wlanLocationInformation\n");
+ return false;
+ }
+ }
+
+ if (data.wlanLocationTimestampIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = TwanIdentifierTimestampIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ TwanIdentifierTimestampIe twanIdentifierTimestamp=
+ dynamic_cast<
+ TwanIdentifierTimestampIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierTimestampIeType));
+ rc = twanIdentifierTimestamp.encodeTwanIdentifierTimestampIe(buffer, data.wlanLocationTimestamp);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: wlanLocationTimestamp\n");
+ return false;
+ }
+ }
+
+ if (data.nbifomContainerIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FContainerIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ FContainerIe fContainer=
+ dynamic_cast<
+ FContainerIe&>(GtpV2IeFactory::getInstance().getIeObject(FContainerIeType));
+ rc = fContainer.encodeFContainerIe(buffer, data.nbifomContainer);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: nbifomContainer\n");
+ return false;
+ }
+ }
+
+ if (data.remoteUeContextConnectedIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = RemoteUeContextIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ RemoteUeContextIe remoteUeContext=
+ dynamic_cast<
+ RemoteUeContextIe&>(GtpV2IeFactory::getInstance().getIeObject(RemoteUeContextIeType));
+ RemoteUeContextConnectedInCreateSessionRequest groupedIeInstance =
+ dynamic_cast<
+ RemoteUeContextConnectedInCreateSessionRequest&>(remoteUeContext.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.encodeRemoteUeContextConnectedInCreateSessionRequest(buffer, data.remoteUeContextConnected);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: remoteUeContextConnected\n");
+ return false;
+ }
+ }
+
+ if (data.a3gppAaaServerIdentifierIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = NodeIdentifierIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ NodeIdentifierIe nodeIdentifier=
+ dynamic_cast<
+ NodeIdentifierIe&>(GtpV2IeFactory::getInstance().getIeObject(NodeIdentifierIeType));
+ rc = nodeIdentifier.encodeNodeIdentifierIe(buffer, data.a3gppAaaServerIdentifier);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: a3gppAaaServerIdentifier\n");
+ return false;
+ }
+ }
+
+ if (data.extendedProtocolConfigurationOptionsIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = EpcoIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ EpcoIe epco=
+ dynamic_cast<
+ EpcoIe&>(GtpV2IeFactory::getInstance().getIeObject(EpcoIeType));
+ rc = epco.encodeEpcoIe(buffer, data.extendedProtocolConfigurationOptions);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: extendedProtocolConfigurationOptions\n");
+ return false;
+ }
+ }
+
+ if (data.servingPlmnRateControlIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = ServingPlmnRateControlIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ ServingPlmnRateControlIe servingPlmnRateControl=
+ dynamic_cast<
+ ServingPlmnRateControlIe&>(GtpV2IeFactory::getInstance().getIeObject(ServingPlmnRateControlIeType));
+ rc = servingPlmnRateControl.encodeServingPlmnRateControlIe(buffer, data.servingPlmnRateControl);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: servingPlmnRateControl\n");
+ return false;
+ }
+ }
+
+ if (data.moExceptionDataCounterIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = CounterIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ CounterIe counter=
+ dynamic_cast<
+ CounterIe&>(GtpV2IeFactory::getInstance().getIeObject(CounterIeType));
+ rc = counter.encodeCounterIe(buffer, data.moExceptionDataCounter);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: moExceptionDataCounter\n");
+ return false;
+ }
+ }
+
+ if (data.ueTcpPortIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = PortNumberIeType;
+ header.instance = 2;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ PortNumberIe portNumber=
+ dynamic_cast<
+ PortNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(PortNumberIeType));
+ rc = portNumber.encodePortNumberIe(buffer, data.ueTcpPort);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: ueTcpPort\n");
+ return false;
+ }
+ }
+
+ if (data.mappedUeUsageTypeIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = MappedUeUsageTypeIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MappedUeUsageTypeIe mappedUeUsageType=
+ dynamic_cast<
+ MappedUeUsageTypeIe&>(GtpV2IeFactory::getInstance().getIeObject(MappedUeUsageTypeIeType));
+ rc = mappedUeUsageType.encodeMappedUeUsageTypeIe(buffer, data.mappedUeUsageType);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: mappedUeUsageType\n");
+ return false;
+ }
+ }
+
+ if (data.userLocationInformationForSgwIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = UliIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ UliIe uli=
+ dynamic_cast<
+ UliIe&>(GtpV2IeFactory::getInstance().getIeObject(UliIeType));
+ rc = uli.encodeUliIe(buffer, data.userLocationInformationForSgw);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: userLocationInformationForSgw\n");
+ return false;
+ }
+ }
+
+ if (data.sgwUNodeNameIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FqdnIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ FqdnIe fqdn=
+ dynamic_cast<
+ FqdnIe&>(GtpV2IeFactory::getInstance().getIeObject(FqdnIeType));
+ rc = fqdn.encodeFqdnIe(buffer, data.sgwUNodeName);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: sgwUNodeName\n");
+ return false;
+ }
+ }
+
+ if (data.secondaryRatUsageDataReportIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = SecondaryRatUsageDataReportIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SecondaryRatUsageDataReportIe secondaryRatUsageDataReport=
+ dynamic_cast<
+ SecondaryRatUsageDataReportIe&>(GtpV2IeFactory::getInstance().getIeObject(SecondaryRatUsageDataReportIeType));
+ rc = secondaryRatUsageDataReport.encodeSecondaryRatUsageDataReportIe(buffer, data.secondaryRatUsageDataReport);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: secondaryRatUsageDataReport\n");
+ return false;
+ }
+ }
+
+ if (data.upFunctionSelectionIndicationFlagsIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = UpFunctionSelectionIndicationFlagsIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ UpFunctionSelectionIndicationFlagsIe upFunctionSelectionIndicationFlags=
+ dynamic_cast<
+ UpFunctionSelectionIndicationFlagsIe&>(GtpV2IeFactory::getInstance().getIeObject(UpFunctionSelectionIndicationFlagsIeType));
+ rc = upFunctionSelectionIndicationFlags.encodeUpFunctionSelectionIndicationFlagsIe(buffer, data.upFunctionSelectionIndicationFlags);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: upFunctionSelectionIndicationFlags\n");
+ return false;
+ }
+ }
+ return rc;
+
+}
+
+bool CreateSessionRequestMsg::decodeCreateSessionRequestMsg(MsgBuffer &buffer,
+ CreateSessionRequestMsgData
+ &data, Uint16 length)
+{
+
+ bool rc = false;
+ GtpV2IeHeader ieHeader;
+
+ set<Uint16> mandatoryIeLocalList = mandatoryIeSet;
+ while (buffer.lengthLeft() > IE_HEADER_SIZE)
+ {
+ GtpV2Ie::decodeGtpV2IeHeader(buffer, ieHeader);
+ if (ieHeader.length > buffer.lengthLeft())
+ {
+ // We do not have enough bytes left in the message for this IE
+ errorStream.add((char *)"IE Length exceeds beyond message boundary\n");
+ errorStream.add((char *)" Offending IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.add((char *)"\n Ie Length in Header: ");
+ errorStream.add(ieHeader.length);
+ errorStream.add((char *)"\n Bytes left in message: ");
+ errorStream.add(buffer.lengthLeft());
+ errorStream.endOfLine();
+ return false;
+ }
+
+ switch (ieHeader.ieType){
+
+ case ImsiIeType:
+ {
+ ImsiIe ieObject =
+ dynamic_cast<
+ ImsiIe&>(GtpV2IeFactory::getInstance().getIeObject(ImsiIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeImsiIe(buffer, data.imsi, ieHeader.length);
+
+ data.imsiIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: imsi\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case MsisdnIeType:
+ {
+ MsisdnIe ieObject =
+ dynamic_cast<
+ MsisdnIe&>(GtpV2IeFactory::getInstance().getIeObject(MsisdnIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeMsisdnIe(buffer, data.msisdn, ieHeader.length);
+
+ data.msisdnIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: msisdn\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case MeiIeType:
+ {
+ MeiIe ieObject =
+ dynamic_cast<
+ MeiIe&>(GtpV2IeFactory::getInstance().getIeObject(MeiIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeMeiIe(buffer, data.meIdentity, ieHeader.length);
+
+ data.meIdentityIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: meIdentity\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case UliIeType:
+ {
+ UliIe ieObject =
+ dynamic_cast<
+ UliIe&>(GtpV2IeFactory::getInstance().getIeObject(UliIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeUliIe(buffer, data.userLocationInformation, ieHeader.length);
+
+ data.userLocationInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: userLocationInformation\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ rc = ieObject.decodeUliIe(buffer, data.userLocationInformationForSgw, ieHeader.length);
+
+ data.userLocationInformationForSgwIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: userLocationInformationForSgw\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case ServingNetworkIeType:
+ {
+ ServingNetworkIe ieObject =
+ dynamic_cast<
+ ServingNetworkIe&>(GtpV2IeFactory::getInstance().getIeObject(ServingNetworkIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeServingNetworkIe(buffer, data.servingNetwork, ieHeader.length);
+
+ data.servingNetworkIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: servingNetwork\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case RatTypeIeType:
+ {
+ RatTypeIe ieObject =
+ dynamic_cast<
+ RatTypeIe&>(GtpV2IeFactory::getInstance().getIeObject(RatTypeIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeRatTypeIe(buffer, data.ratType, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: ratType\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case IndicationIeType:
+ {
+ IndicationIe ieObject =
+ dynamic_cast<
+ IndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(IndicationIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeIndicationIe(buffer, data.indicationFlags, ieHeader.length);
+
+ data.indicationFlagsIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: indicationFlags\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case FTeidIeType:
+ {
+ FTeidIe ieObject =
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeFTeidIe(buffer, data.senderFTeidForControlPlane, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: senderFTeidForControlPlane\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ rc = ieObject.decodeFTeidIe(buffer, data.pgwS5S8AddressForControlPlaneOrPmip, ieHeader.length);
+
+ data.pgwS5S8AddressForControlPlaneOrPmipIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: pgwS5S8AddressForControlPlaneOrPmip\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case ApnIeType:
+ {
+ ApnIe ieObject =
+ dynamic_cast<
+ ApnIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeApnIe(buffer, data.accessPointName, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: accessPointName\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case SelectionModeIeType:
+ {
+ SelectionModeIe ieObject =
+ dynamic_cast<
+ SelectionModeIe&>(GtpV2IeFactory::getInstance().getIeObject(SelectionModeIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeSelectionModeIe(buffer, data.selectionMode, ieHeader.length);
+
+ data.selectionModeIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: selectionMode\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case PdnTypeIeType:
+ {
+ PdnTypeIe ieObject =
+ dynamic_cast<
+ PdnTypeIe&>(GtpV2IeFactory::getInstance().getIeObject(PdnTypeIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodePdnTypeIe(buffer, data.pdnType, ieHeader.length);
+
+ data.pdnTypeIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: pdnType\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case PaaIeType:
+ {
+ PaaIe ieObject =
+ dynamic_cast<
+ PaaIe&>(GtpV2IeFactory::getInstance().getIeObject(PaaIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodePaaIe(buffer, data.pdnAddressAllocation, ieHeader.length);
+
+ data.pdnAddressAllocationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: pdnAddressAllocation\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case ApnRestrictionIeType:
+ {
+ ApnRestrictionIe ieObject =
+ dynamic_cast<
+ ApnRestrictionIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnRestrictionIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeApnRestrictionIe(buffer, data.maximumApnRestriction, ieHeader.length);
+
+ data.maximumApnRestrictionIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: maximumApnRestriction\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case AmbrIeType:
+ {
+ AmbrIe ieObject =
+ dynamic_cast<
+ AmbrIe&>(GtpV2IeFactory::getInstance().getIeObject(AmbrIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeAmbrIe(buffer, data.aggregateMaximumBitRate, ieHeader.length);
+
+ data.aggregateMaximumBitRateIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: aggregateMaximumBitRate\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case EbiIeType:
+ {
+ EbiIe ieObject =
+ dynamic_cast<
+ EbiIe&>(GtpV2IeFactory::getInstance().getIeObject(EbiIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeEbiIe(buffer, data.linkedEpsBearerId, ieHeader.length);
+
+ data.linkedEpsBearerIdIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: linkedEpsBearerId\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case TwmiIeType:
+ {
+ TwmiIe ieObject =
+ dynamic_cast<
+ TwmiIe&>(GtpV2IeFactory::getInstance().getIeObject(TwmiIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeTwmiIe(buffer, data.trustedWlanModeIndication, ieHeader.length);
+
+ data.trustedWlanModeIndicationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: trustedWlanModeIndication\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case PcoIeType:
+ {
+ PcoIe ieObject =
+ dynamic_cast<
+ PcoIe&>(GtpV2IeFactory::getInstance().getIeObject(PcoIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodePcoIe(buffer, data.protocolConfigurationOptions, ieHeader.length);
+
+ data.protocolConfigurationOptionsIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: protocolConfigurationOptions\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case BearerContextIeType:
+ {
+ BearerContextIe ieObject =
+ dynamic_cast<
+ BearerContextIe&>(GtpV2IeFactory::getInstance().getIeObject(BearerContextIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ // First check if we have enough space left to decode and store this instance
+ if (data.bearerContextsToBeCreatedCount == 11)
+ {
+ errorStream.add((char *)"More than 11 instances of bearerContextsToBeCreated received\n");
+ return false;
+ }
+ BearerContextsToBeCreatedInCreateSessionRequest groupedIeInstance =
+ dynamic_cast<
+ BearerContextsToBeCreatedInCreateSessionRequest&>(ieObject.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.decodeBearerContextsToBeCreatedInCreateSessionRequest(buffer,
+ data.bearerContextsToBeCreated[data.bearerContextsToBeCreatedCount], ieHeader.length);
+ data.bearerContextsToBeCreatedCount++; // TODO Count validation
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: bearerContextsToBeCreated\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ // First check if we have enough space left to decode and store this instance
+ if (data.bearerContextsToBeRemovedCount == 11)
+ {
+ errorStream.add((char *)"More than 11 instances of bearerContextsToBeRemoved received\n");
+ return false;
+ }
+ BearerContextsToBeRemovedInCreateSessionRequest groupedIeInstance =
+ dynamic_cast<
+ BearerContextsToBeRemovedInCreateSessionRequest&>(ieObject.getGroupedIe(msgType, 1));
+ rc = groupedIeInstance.decodeBearerContextsToBeRemovedInCreateSessionRequest(buffer,
+ data.bearerContextsToBeRemoved[data.bearerContextsToBeRemovedCount], ieHeader.length);
+ data.bearerContextsToBeRemovedCount++; // TODO Count validation
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: bearerContextsToBeRemoved\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case TraceInformationIeType:
+ {
+ TraceInformationIe ieObject =
+ dynamic_cast<
+ TraceInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(TraceInformationIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeTraceInformationIe(buffer, data.traceInformation, ieHeader.length);
+
+ data.traceInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: traceInformation\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case RecoveryIeType:
+ {
+ RecoveryIe ieObject =
+ dynamic_cast<
+ RecoveryIe&>(GtpV2IeFactory::getInstance().getIeObject(RecoveryIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeRecoveryIe(buffer, data.recovery, ieHeader.length);
+
+ data.recoveryIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: recovery\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case FqCsidIeType:
+ {
+ FqCsidIe ieObject =
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeFqCsidIe(buffer, data.mmeFqCsid, ieHeader.length);
+
+ data.mmeFqCsidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: mmeFqCsid\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ rc = ieObject.decodeFqCsidIe(buffer, data.sgwFqCsid, ieHeader.length);
+
+ data.sgwFqCsidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: sgwFqCsid\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 2)
+ {
+ rc = ieObject.decodeFqCsidIe(buffer, data.epdgFqCsid, ieHeader.length);
+
+ data.epdgFqCsidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: epdgFqCsid\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 3)
+ {
+ rc = ieObject.decodeFqCsidIe(buffer, data.twanFqCsid, ieHeader.length);
+
+ data.twanFqCsidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: twanFqCsid\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case UeTimeZoneIeType:
+ {
+ UeTimeZoneIe ieObject =
+ dynamic_cast<
+ UeTimeZoneIe&>(GtpV2IeFactory::getInstance().getIeObject(UeTimeZoneIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeUeTimeZoneIe(buffer, data.ueTimeZone, ieHeader.length);
+
+ data.ueTimeZoneIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: ueTimeZone\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case UciIeType:
+ {
+ UciIe ieObject =
+ dynamic_cast<
+ UciIe&>(GtpV2IeFactory::getInstance().getIeObject(UciIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeUciIe(buffer, data.userCsgInformation, ieHeader.length);
+
+ data.userCsgInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: userCsgInformation\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case ChargingCharacteristicsIeType:
+ {
+ ChargingCharacteristicsIe ieObject =
+ dynamic_cast<
+ ChargingCharacteristicsIe&>(GtpV2IeFactory::getInstance().getIeObject(ChargingCharacteristicsIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeChargingCharacteristicsIe(buffer, data.chargingCharacteristics, ieHeader.length);
+
+ data.chargingCharacteristicsIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: chargingCharacteristics\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case LocalDistinguishedNameIeType:
+ {
+ LocalDistinguishedNameIe ieObject =
+ dynamic_cast<
+ LocalDistinguishedNameIe&>(GtpV2IeFactory::getInstance().getIeObject(LocalDistinguishedNameIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeLocalDistinguishedNameIe(buffer, data.mmeS4SgsnLdn, ieHeader.length);
+
+ data.mmeS4SgsnLdnIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: mmeS4SgsnLdn\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ rc = ieObject.decodeLocalDistinguishedNameIe(buffer, data.sgwLdn, ieHeader.length);
+
+ data.sgwLdnIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: sgwLdn\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 2)
+ {
+ rc = ieObject.decodeLocalDistinguishedNameIe(buffer, data.epdgLdn, ieHeader.length);
+
+ data.epdgLdnIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: epdgLdn\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 3)
+ {
+ rc = ieObject.decodeLocalDistinguishedNameIe(buffer, data.twanLdn, ieHeader.length);
+
+ data.twanLdnIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: twanLdn\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case SignallingPriorityIndicationIeType:
+ {
+ SignallingPriorityIndicationIe ieObject =
+ dynamic_cast<
+ SignallingPriorityIndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(SignallingPriorityIndicationIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeSignallingPriorityIndicationIe(buffer, data.signallingPriorityIndication, ieHeader.length);
+
+ data.signallingPriorityIndicationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: signallingPriorityIndication\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case IpAddressIeType:
+ {
+ IpAddressIe ieObject =
+ dynamic_cast<
+ IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeIpAddressIe(buffer, data.ueLocalIpAddress, ieHeader.length);
+
+ data.ueLocalIpAddressIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: ueLocalIpAddress\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ rc = ieObject.decodeIpAddressIe(buffer, data.hNbLocalIpAddress, ieHeader.length);
+
+ data.hNbLocalIpAddressIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: hNbLocalIpAddress\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 2)
+ {
+ rc = ieObject.decodeIpAddressIe(buffer, data.mmeS4SgsnIdentifier, ieHeader.length);
+
+ data.mmeS4SgsnIdentifierIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: mmeS4SgsnIdentifier\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 3)
+ {
+ rc = ieObject.decodeIpAddressIe(buffer, data.epdgIpAddress, ieHeader.length);
+
+ data.epdgIpAddressIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: epdgIpAddress\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case PortNumberIeType:
+ {
+ PortNumberIe ieObject =
+ dynamic_cast<
+ PortNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(PortNumberIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodePortNumberIe(buffer, data.ueUdpPort, ieHeader.length);
+
+ data.ueUdpPortIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: ueUdpPort\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ rc = ieObject.decodePortNumberIe(buffer, data.hNbUdpPort, ieHeader.length);
+
+ data.hNbUdpPortIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: hNbUdpPort\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 2)
+ {
+ rc = ieObject.decodePortNumberIe(buffer, data.ueTcpPort, ieHeader.length);
+
+ data.ueTcpPortIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: ueTcpPort\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case AdditionalProtocolConfigurationOptionsIeType:
+ {
+ AdditionalProtocolConfigurationOptionsIe ieObject =
+ dynamic_cast<
+ AdditionalProtocolConfigurationOptionsIe&>(GtpV2IeFactory::getInstance().getIeObject(AdditionalProtocolConfigurationOptionsIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeAdditionalProtocolConfigurationOptionsIe(buffer, data.additionalProtocolConfigurationOptions, ieHeader.length);
+
+ data.additionalProtocolConfigurationOptionsIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: additionalProtocolConfigurationOptions\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case TwanIdentifierIeType:
+ {
+ TwanIdentifierIe ieObject =
+ dynamic_cast<
+ TwanIdentifierIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeTwanIdentifierIe(buffer, data.twanIdentifier, ieHeader.length);
+
+ data.twanIdentifierIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: twanIdentifier\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ rc = ieObject.decodeTwanIdentifierIe(buffer, data.wlanLocationInformation, ieHeader.length);
+
+ data.wlanLocationInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: wlanLocationInformation\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case CnOperatorSelectionEntityIeType:
+ {
+ CnOperatorSelectionEntityIe ieObject =
+ dynamic_cast<
+ CnOperatorSelectionEntityIe&>(GtpV2IeFactory::getInstance().getIeObject(CnOperatorSelectionEntityIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeCnOperatorSelectionEntityIe(buffer, data.cnOperatorSelectionEntity, ieHeader.length);
+
+ data.cnOperatorSelectionEntityIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: cnOperatorSelectionEntity\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case OverloadControlInformationIeType:
+ {
+ OverloadControlInformationIe ieObject =
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ MmeS4SgsnsOverloadControlInformationInCreateSessionRequest groupedIeInstance =
+ dynamic_cast<
+ MmeS4SgsnsOverloadControlInformationInCreateSessionRequest&>(ieObject.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.decodeMmeS4SgsnsOverloadControlInformationInCreateSessionRequest(buffer, data.mmeS4SgsnsOverloadControlInformation, ieHeader.length);
+
+ data.mmeS4SgsnsOverloadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: mmeS4SgsnsOverloadControlInformation\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ SgwsOverloadControlInformationInCreateSessionRequest groupedIeInstance =
+ dynamic_cast<
+ SgwsOverloadControlInformationInCreateSessionRequest&>(ieObject.getGroupedIe(msgType, 1));
+ rc = groupedIeInstance.decodeSgwsOverloadControlInformationInCreateSessionRequest(buffer, data.sgwsOverloadControlInformation, ieHeader.length);
+
+ data.sgwsOverloadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: sgwsOverloadControlInformation\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 2)
+ {
+ TwanEpdgsOverloadControlInformationInCreateSessionRequest groupedIeInstance =
+ dynamic_cast<
+ TwanEpdgsOverloadControlInformationInCreateSessionRequest&>(ieObject.getGroupedIe(msgType, 2));
+ rc = groupedIeInstance.decodeTwanEpdgsOverloadControlInformationInCreateSessionRequest(buffer, data.twanEpdgsOverloadControlInformation, ieHeader.length);
+
+ data.twanEpdgsOverloadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: twanEpdgsOverloadControlInformation\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case MillisecondTimeStampIeType:
+ {
+ MillisecondTimeStampIe ieObject =
+ dynamic_cast<
+ MillisecondTimeStampIe&>(GtpV2IeFactory::getInstance().getIeObject(MillisecondTimeStampIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeMillisecondTimeStampIe(buffer, data.originationTimeStamp, ieHeader.length);
+
+ data.originationTimeStampIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: originationTimeStamp\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case IntegerNumberIeType:
+ {
+ IntegerNumberIe ieObject =
+ dynamic_cast<
+ IntegerNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(IntegerNumberIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeIntegerNumberIe(buffer, data.maximumWaitTime, ieHeader.length);
+
+ data.maximumWaitTimeIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: maximumWaitTime\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case TwanIdentifierTimestampIeType:
+ {
+ TwanIdentifierTimestampIe ieObject =
+ dynamic_cast<
+ TwanIdentifierTimestampIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierTimestampIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeTwanIdentifierTimestampIe(buffer, data.wlanLocationTimestamp, ieHeader.length);
+
+ data.wlanLocationTimestampIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: wlanLocationTimestamp\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case FContainerIeType:
+ {
+ FContainerIe ieObject =
+ dynamic_cast<
+ FContainerIe&>(GtpV2IeFactory::getInstance().getIeObject(FContainerIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeFContainerIe(buffer, data.nbifomContainer, ieHeader.length);
+
+ data.nbifomContainerIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: nbifomContainer\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case RemoteUeContextIeType:
+ {
+ RemoteUeContextIe ieObject =
+ dynamic_cast<
+ RemoteUeContextIe&>(GtpV2IeFactory::getInstance().getIeObject(RemoteUeContextIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ RemoteUeContextConnectedInCreateSessionRequest groupedIeInstance =
+ dynamic_cast<
+ RemoteUeContextConnectedInCreateSessionRequest&>(ieObject.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.decodeRemoteUeContextConnectedInCreateSessionRequest(buffer, data.remoteUeContextConnected, ieHeader.length);
+
+ data.remoteUeContextConnectedIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: remoteUeContextConnected\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case NodeIdentifierIeType:
+ {
+ NodeIdentifierIe ieObject =
+ dynamic_cast<
+ NodeIdentifierIe&>(GtpV2IeFactory::getInstance().getIeObject(NodeIdentifierIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeNodeIdentifierIe(buffer, data.a3gppAaaServerIdentifier, ieHeader.length);
+
+ data.a3gppAaaServerIdentifierIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: a3gppAaaServerIdentifier\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case EpcoIeType:
+ {
+ EpcoIe ieObject =
+ dynamic_cast<
+ EpcoIe&>(GtpV2IeFactory::getInstance().getIeObject(EpcoIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeEpcoIe(buffer, data.extendedProtocolConfigurationOptions, ieHeader.length);
+
+ data.extendedProtocolConfigurationOptionsIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: extendedProtocolConfigurationOptions\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case ServingPlmnRateControlIeType:
+ {
+ ServingPlmnRateControlIe ieObject =
+ dynamic_cast<
+ ServingPlmnRateControlIe&>(GtpV2IeFactory::getInstance().getIeObject(ServingPlmnRateControlIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeServingPlmnRateControlIe(buffer, data.servingPlmnRateControl, ieHeader.length);
+
+ data.servingPlmnRateControlIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: servingPlmnRateControl\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case CounterIeType:
+ {
+ CounterIe ieObject =
+ dynamic_cast<
+ CounterIe&>(GtpV2IeFactory::getInstance().getIeObject(CounterIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeCounterIe(buffer, data.moExceptionDataCounter, ieHeader.length);
+
+ data.moExceptionDataCounterIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: moExceptionDataCounter\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case MappedUeUsageTypeIeType:
+ {
+ MappedUeUsageTypeIe ieObject =
+ dynamic_cast<
+ MappedUeUsageTypeIe&>(GtpV2IeFactory::getInstance().getIeObject(MappedUeUsageTypeIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeMappedUeUsageTypeIe(buffer, data.mappedUeUsageType, ieHeader.length);
+
+ data.mappedUeUsageTypeIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: mappedUeUsageType\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case FqdnIeType:
+ {
+ FqdnIe ieObject =
+ dynamic_cast<
+ FqdnIe&>(GtpV2IeFactory::getInstance().getIeObject(FqdnIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeFqdnIe(buffer, data.sgwUNodeName, ieHeader.length);
+
+ data.sgwUNodeNameIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: sgwUNodeName\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case SecondaryRatUsageDataReportIeType:
+ {
+ SecondaryRatUsageDataReportIe ieObject =
+ dynamic_cast<
+ SecondaryRatUsageDataReportIe&>(GtpV2IeFactory::getInstance().getIeObject(SecondaryRatUsageDataReportIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeSecondaryRatUsageDataReportIe(buffer, data.secondaryRatUsageDataReport, ieHeader.length);
+
+ data.secondaryRatUsageDataReportIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: secondaryRatUsageDataReport\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case UpFunctionSelectionIndicationFlagsIeType:
+ {
+ UpFunctionSelectionIndicationFlagsIe ieObject =
+ dynamic_cast<
+ UpFunctionSelectionIndicationFlagsIe&>(GtpV2IeFactory::getInstance().getIeObject(UpFunctionSelectionIndicationFlagsIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeUpFunctionSelectionIndicationFlagsIe(buffer, data.upFunctionSelectionIndicationFlags, ieHeader.length);
+
+ data.upFunctionSelectionIndicationFlagsIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: upFunctionSelectionIndicationFlags\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ default:
+ {
+ // Unknown IE print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ }
+ }
+ return rc; // TODO validations
+}
+
+void CreateSessionRequestMsg::
+displayCreateSessionRequestMsgData_v(CreateSessionRequestMsgData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"CreateSessionRequestMsg:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+ if (data.imsiIePresent)
+ {
+
+
+ stream.add((char *)"IE - imsi:");
+ stream.endOfLine();
+ ImsiIe imsi=
+ dynamic_cast<
+ ImsiIe&>(GtpV2IeFactory::getInstance().getIeObject(ImsiIeType));
+ imsi.displayImsiIe_v(data.imsi, stream);
+
+ }
+ if (data.msisdnIePresent)
+ {
+
+
+ stream.add((char *)"IE - msisdn:");
+ stream.endOfLine();
+ MsisdnIe msisdn=
+ dynamic_cast<
+ MsisdnIe&>(GtpV2IeFactory::getInstance().getIeObject(MsisdnIeType));
+ msisdn.displayMsisdnIe_v(data.msisdn, stream);
+
+ }
+ if (data.meIdentityIePresent)
+ {
+
+
+ stream.add((char *)"IE - meIdentity:");
+ stream.endOfLine();
+ MeiIe mei=
+ dynamic_cast<
+ MeiIe&>(GtpV2IeFactory::getInstance().getIeObject(MeiIeType));
+ mei.displayMeiIe_v(data.meIdentity, stream);
+
+ }
+ if (data.userLocationInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - userLocationInformation:");
+ stream.endOfLine();
+ UliIe uli=
+ dynamic_cast<
+ UliIe&>(GtpV2IeFactory::getInstance().getIeObject(UliIeType));
+ uli.displayUliIe_v(data.userLocationInformation, stream);
+
+ }
+ if (data.servingNetworkIePresent)
+ {
+
+
+ stream.add((char *)"IE - servingNetwork:");
+ stream.endOfLine();
+ ServingNetworkIe servingNetwork=
+ dynamic_cast<
+ ServingNetworkIe&>(GtpV2IeFactory::getInstance().getIeObject(ServingNetworkIeType));
+ servingNetwork.displayServingNetworkIe_v(data.servingNetwork, stream);
+
+ }
+ stream.add((char *)"IE - ratType:");
+ stream.endOfLine();
+ RatTypeIe ratType=
+ dynamic_cast<
+ RatTypeIe&>(GtpV2IeFactory::getInstance().getIeObject(RatTypeIeType));
+ ratType.displayRatTypeIe_v(data.ratType, stream);
+
+ if (data.indicationFlagsIePresent)
+ {
+
+
+ stream.add((char *)"IE - indicationFlags:");
+ stream.endOfLine();
+ IndicationIe indication=
+ dynamic_cast<
+ IndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(IndicationIeType));
+ indication.displayIndicationIe_v(data.indicationFlags, stream);
+
+ }
+ stream.add((char *)"IE - senderFTeidForControlPlane:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.senderFTeidForControlPlane, stream);
+
+ if (data.pgwS5S8AddressForControlPlaneOrPmipIePresent)
+ {
+
+
+ stream.add((char *)"IE - pgwS5S8AddressForControlPlaneOrPmip:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.pgwS5S8AddressForControlPlaneOrPmip, stream);
+
+ }
+ stream.add((char *)"IE - accessPointName:");
+ stream.endOfLine();
+ ApnIe apn=
+ dynamic_cast<
+ ApnIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnIeType));
+ apn.displayApnIe_v(data.accessPointName, stream);
+
+ if (data.selectionModeIePresent)
+ {
+
+
+ stream.add((char *)"IE - selectionMode:");
+ stream.endOfLine();
+ SelectionModeIe selectionMode=
+ dynamic_cast<
+ SelectionModeIe&>(GtpV2IeFactory::getInstance().getIeObject(SelectionModeIeType));
+ selectionMode.displaySelectionModeIe_v(data.selectionMode, stream);
+
+ }
+ if (data.pdnTypeIePresent)
+ {
+
+
+ stream.add((char *)"IE - pdnType:");
+ stream.endOfLine();
+ PdnTypeIe pdnType=
+ dynamic_cast<
+ PdnTypeIe&>(GtpV2IeFactory::getInstance().getIeObject(PdnTypeIeType));
+ pdnType.displayPdnTypeIe_v(data.pdnType, stream);
+
+ }
+ if (data.pdnAddressAllocationIePresent)
+ {
+
+
+ stream.add((char *)"IE - pdnAddressAllocation:");
+ stream.endOfLine();
+ PaaIe paa=
+ dynamic_cast<
+ PaaIe&>(GtpV2IeFactory::getInstance().getIeObject(PaaIeType));
+ paa.displayPaaIe_v(data.pdnAddressAllocation, stream);
+
+ }
+ if (data.maximumApnRestrictionIePresent)
+ {
+
+
+ stream.add((char *)"IE - maximumApnRestriction:");
+ stream.endOfLine();
+ ApnRestrictionIe apnRestriction=
+ dynamic_cast<
+ ApnRestrictionIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnRestrictionIeType));
+ apnRestriction.displayApnRestrictionIe_v(data.maximumApnRestriction, stream);
+
+ }
+ if (data.aggregateMaximumBitRateIePresent)
+ {
+
+
+ stream.add((char *)"IE - aggregateMaximumBitRate:");
+ stream.endOfLine();
+ AmbrIe ambr=
+ dynamic_cast<
+ AmbrIe&>(GtpV2IeFactory::getInstance().getIeObject(AmbrIeType));
+ ambr.displayAmbrIe_v(data.aggregateMaximumBitRate, stream);
+
+ }
+ if (data.linkedEpsBearerIdIePresent)
+ {
+
+
+ stream.add((char *)"IE - linkedEpsBearerId:");
+ stream.endOfLine();
+ EbiIe ebi=
+ dynamic_cast<
+ EbiIe&>(GtpV2IeFactory::getInstance().getIeObject(EbiIeType));
+ ebi.displayEbiIe_v(data.linkedEpsBearerId, stream);
+
+ }
+ if (data.trustedWlanModeIndicationIePresent)
+ {
+
+
+ stream.add((char *)"IE - trustedWlanModeIndication:");
+ stream.endOfLine();
+ TwmiIe twmi=
+ dynamic_cast<
+ TwmiIe&>(GtpV2IeFactory::getInstance().getIeObject(TwmiIeType));
+ twmi.displayTwmiIe_v(data.trustedWlanModeIndication, stream);
+
+ }
+ if (data.protocolConfigurationOptionsIePresent)
+ {
+
+
+ stream.add((char *)"IE - protocolConfigurationOptions:");
+ stream.endOfLine();
+ PcoIe pco=
+ dynamic_cast<
+ PcoIe&>(GtpV2IeFactory::getInstance().getIeObject(PcoIeType));
+ pco.displayPcoIe_v(data.protocolConfigurationOptions, stream);
+
+ }
+
+ Uint8 displayCount;
+
+ displayCount = data.bearerContextsToBeCreatedCount;
+ if (displayCount > 11)
+ {
+ stream.add((char *)"Invalid data more than 11 instances");
+ stream.endOfLine();
+ stream.add((char *)"Displaying only 11");
+ stream.endOfLine();
+ displayCount = 11;
+ }
+ for (Uint8 i = 0; i < displayCount; i++)
+ {
+ stream.add((char *)"IE - bearerContextsToBeCreated:");
+ stream.endOfLine();
+ BearerContextIe bearerContext=
+ dynamic_cast<
+ BearerContextIe&>(GtpV2IeFactory::getInstance().getIeObject(BearerContextIeType));
+ BearerContextsToBeCreatedInCreateSessionRequest groupedIeInstance =
+ dynamic_cast<
+ BearerContextsToBeCreatedInCreateSessionRequest&>(bearerContext.getGroupedIe(msgType, 0));
+ groupedIeInstance.displayBearerContextsToBeCreatedInCreateSessionRequestData_v(data.bearerContextsToBeCreated[i], stream);
+
+ }
+ displayCount = data.bearerContextsToBeRemovedCount;
+ if (displayCount > 11)
+ {
+ stream.add((char *)"Invalid data more than 11 instances");
+ stream.endOfLine();
+ stream.add((char *)"Displaying only 11");
+ stream.endOfLine();
+ displayCount = 11;
+ }
+ for (Uint8 i = 0; i < displayCount; i++)
+ {
+ stream.add((char *)"IE - bearerContextsToBeRemoved:");
+ stream.endOfLine();
+ BearerContextIe bearerContext=
+ dynamic_cast<
+ BearerContextIe&>(GtpV2IeFactory::getInstance().getIeObject(BearerContextIeType));
+ BearerContextsToBeRemovedInCreateSessionRequest groupedIeInstance =
+ dynamic_cast<
+ BearerContextsToBeRemovedInCreateSessionRequest&>(bearerContext.getGroupedIe(msgType, 1));
+ groupedIeInstance.displayBearerContextsToBeRemovedInCreateSessionRequestData_v(data.bearerContextsToBeRemoved[i], stream);
+ }
+
+
+
+
+ if (data.traceInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - traceInformation:");
+ stream.endOfLine();
+ TraceInformationIe traceInformation=
+ dynamic_cast<
+ TraceInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(TraceInformationIeType));
+ traceInformation.displayTraceInformationIe_v(data.traceInformation, stream);
+
+ }
+ if (data.recoveryIePresent)
+ {
+
+
+ stream.add((char *)"IE - recovery:");
+ stream.endOfLine();
+ RecoveryIe recovery=
+ dynamic_cast<
+ RecoveryIe&>(GtpV2IeFactory::getInstance().getIeObject(RecoveryIeType));
+ recovery.displayRecoveryIe_v(data.recovery, stream);
+
+ }
+ if (data.mmeFqCsidIePresent)
+ {
+
+
+ stream.add((char *)"IE - mmeFqCsid:");
+ stream.endOfLine();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ fqCsid.displayFqCsidIe_v(data.mmeFqCsid, stream);
+
+ }
+ if (data.sgwFqCsidIePresent)
+ {
+
+
+ stream.add((char *)"IE - sgwFqCsid:");
+ stream.endOfLine();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ fqCsid.displayFqCsidIe_v(data.sgwFqCsid, stream);
+
+ }
+ if (data.epdgFqCsidIePresent)
+ {
+
+
+ stream.add((char *)"IE - epdgFqCsid:");
+ stream.endOfLine();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ fqCsid.displayFqCsidIe_v(data.epdgFqCsid, stream);
+
+ }
+ if (data.twanFqCsidIePresent)
+ {
+
+
+ stream.add((char *)"IE - twanFqCsid:");
+ stream.endOfLine();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ fqCsid.displayFqCsidIe_v(data.twanFqCsid, stream);
+
+ }
+ if (data.ueTimeZoneIePresent)
+ {
+
+
+ stream.add((char *)"IE - ueTimeZone:");
+ stream.endOfLine();
+ UeTimeZoneIe ueTimeZone=
+ dynamic_cast<
+ UeTimeZoneIe&>(GtpV2IeFactory::getInstance().getIeObject(UeTimeZoneIeType));
+ ueTimeZone.displayUeTimeZoneIe_v(data.ueTimeZone, stream);
+
+ }
+ if (data.userCsgInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - userCsgInformation:");
+ stream.endOfLine();
+ UciIe uci=
+ dynamic_cast<
+ UciIe&>(GtpV2IeFactory::getInstance().getIeObject(UciIeType));
+ uci.displayUciIe_v(data.userCsgInformation, stream);
+
+ }
+ if (data.chargingCharacteristicsIePresent)
+ {
+
+
+ stream.add((char *)"IE - chargingCharacteristics:");
+ stream.endOfLine();
+ ChargingCharacteristicsIe chargingCharacteristics=
+ dynamic_cast<
+ ChargingCharacteristicsIe&>(GtpV2IeFactory::getInstance().getIeObject(ChargingCharacteristicsIeType));
+ chargingCharacteristics.displayChargingCharacteristicsIe_v(data.chargingCharacteristics, stream);
+
+ }
+ if (data.mmeS4SgsnLdnIePresent)
+ {
+
+
+ stream.add((char *)"IE - mmeS4SgsnLdn:");
+ stream.endOfLine();
+ LocalDistinguishedNameIe localDistinguishedName=
+ dynamic_cast<
+ LocalDistinguishedNameIe&>(GtpV2IeFactory::getInstance().getIeObject(LocalDistinguishedNameIeType));
+ localDistinguishedName.displayLocalDistinguishedNameIe_v(data.mmeS4SgsnLdn, stream);
+
+ }
+ if (data.sgwLdnIePresent)
+ {
+
+
+ stream.add((char *)"IE - sgwLdn:");
+ stream.endOfLine();
+ LocalDistinguishedNameIe localDistinguishedName=
+ dynamic_cast<
+ LocalDistinguishedNameIe&>(GtpV2IeFactory::getInstance().getIeObject(LocalDistinguishedNameIeType));
+ localDistinguishedName.displayLocalDistinguishedNameIe_v(data.sgwLdn, stream);
+
+ }
+ if (data.epdgLdnIePresent)
+ {
+
+
+ stream.add((char *)"IE - epdgLdn:");
+ stream.endOfLine();
+ LocalDistinguishedNameIe localDistinguishedName=
+ dynamic_cast<
+ LocalDistinguishedNameIe&>(GtpV2IeFactory::getInstance().getIeObject(LocalDistinguishedNameIeType));
+ localDistinguishedName.displayLocalDistinguishedNameIe_v(data.epdgLdn, stream);
+
+ }
+ if (data.twanLdnIePresent)
+ {
+
+
+ stream.add((char *)"IE - twanLdn:");
+ stream.endOfLine();
+ LocalDistinguishedNameIe localDistinguishedName=
+ dynamic_cast<
+ LocalDistinguishedNameIe&>(GtpV2IeFactory::getInstance().getIeObject(LocalDistinguishedNameIeType));
+ localDistinguishedName.displayLocalDistinguishedNameIe_v(data.twanLdn, stream);
+
+ }
+ if (data.signallingPriorityIndicationIePresent)
+ {
+
+
+ stream.add((char *)"IE - signallingPriorityIndication:");
+ stream.endOfLine();
+ SignallingPriorityIndicationIe signallingPriorityIndication=
+ dynamic_cast<
+ SignallingPriorityIndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(SignallingPriorityIndicationIeType));
+ signallingPriorityIndication.displaySignallingPriorityIndicationIe_v(data.signallingPriorityIndication, stream);
+
+ }
+ if (data.ueLocalIpAddressIePresent)
+ {
+
+
+ stream.add((char *)"IE - ueLocalIpAddress:");
+ stream.endOfLine();
+ IpAddressIe ipAddress=
+ dynamic_cast<
+ IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
+ ipAddress.displayIpAddressIe_v(data.ueLocalIpAddress, stream);
+
+ }
+ if (data.ueUdpPortIePresent)
+ {
+
+
+ stream.add((char *)"IE - ueUdpPort:");
+ stream.endOfLine();
+ PortNumberIe portNumber=
+ dynamic_cast<
+ PortNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(PortNumberIeType));
+ portNumber.displayPortNumberIe_v(data.ueUdpPort, stream);
+
+ }
+ if (data.additionalProtocolConfigurationOptionsIePresent)
+ {
+
+
+ stream.add((char *)"IE - additionalProtocolConfigurationOptions:");
+ stream.endOfLine();
+ AdditionalProtocolConfigurationOptionsIe additionalProtocolConfigurationOptions=
+ dynamic_cast<
+ AdditionalProtocolConfigurationOptionsIe&>(GtpV2IeFactory::getInstance().getIeObject(AdditionalProtocolConfigurationOptionsIeType));
+ additionalProtocolConfigurationOptions.displayAdditionalProtocolConfigurationOptionsIe_v(data.additionalProtocolConfigurationOptions, stream);
+
+ }
+ if (data.hNbLocalIpAddressIePresent)
+ {
+
+
+ stream.add((char *)"IE - hNbLocalIpAddress:");
+ stream.endOfLine();
+ IpAddressIe ipAddress=
+ dynamic_cast<
+ IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
+ ipAddress.displayIpAddressIe_v(data.hNbLocalIpAddress, stream);
+
+ }
+ if (data.hNbUdpPortIePresent)
+ {
+
+
+ stream.add((char *)"IE - hNbUdpPort:");
+ stream.endOfLine();
+ PortNumberIe portNumber=
+ dynamic_cast<
+ PortNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(PortNumberIeType));
+ portNumber.displayPortNumberIe_v(data.hNbUdpPort, stream);
+
+ }
+ if (data.mmeS4SgsnIdentifierIePresent)
+ {
+
+
+ stream.add((char *)"IE - mmeS4SgsnIdentifier:");
+ stream.endOfLine();
+ IpAddressIe ipAddress=
+ dynamic_cast<
+ IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
+ ipAddress.displayIpAddressIe_v(data.mmeS4SgsnIdentifier, stream);
+
+ }
+ if (data.twanIdentifierIePresent)
+ {
+
+
+ stream.add((char *)"IE - twanIdentifier:");
+ stream.endOfLine();
+ TwanIdentifierIe twanIdentifier=
+ dynamic_cast<
+ TwanIdentifierIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierIeType));
+ twanIdentifier.displayTwanIdentifierIe_v(data.twanIdentifier, stream);
+
+ }
+ if (data.epdgIpAddressIePresent)
+ {
+
+
+ stream.add((char *)"IE - epdgIpAddress:");
+ stream.endOfLine();
+ IpAddressIe ipAddress=
+ dynamic_cast<
+ IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
+ ipAddress.displayIpAddressIe_v(data.epdgIpAddress, stream);
+
+ }
+ if (data.cnOperatorSelectionEntityIePresent)
+ {
+
+
+ stream.add((char *)"IE - cnOperatorSelectionEntity:");
+ stream.endOfLine();
+ CnOperatorSelectionEntityIe cnOperatorSelectionEntity=
+ dynamic_cast<
+ CnOperatorSelectionEntityIe&>(GtpV2IeFactory::getInstance().getIeObject(CnOperatorSelectionEntityIeType));
+ cnOperatorSelectionEntity.displayCnOperatorSelectionEntityIe_v(data.cnOperatorSelectionEntity, stream);
+
+ }
+ if (data.mmeS4SgsnsOverloadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - mmeS4SgsnsOverloadControlInformation:");
+ stream.endOfLine();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ MmeS4SgsnsOverloadControlInformationInCreateSessionRequest groupedIeInstance =
+ dynamic_cast<
+ MmeS4SgsnsOverloadControlInformationInCreateSessionRequest&>(overloadControlInformation.getGroupedIe(msgType, 0));
+ groupedIeInstance.displayMmeS4SgsnsOverloadControlInformationInCreateSessionRequestData_v(data.mmeS4SgsnsOverloadControlInformation, stream);
+
+ }
+ if (data.sgwsOverloadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - sgwsOverloadControlInformation:");
+ stream.endOfLine();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ SgwsOverloadControlInformationInCreateSessionRequest groupedIeInstance =
+ dynamic_cast<
+ SgwsOverloadControlInformationInCreateSessionRequest&>(overloadControlInformation.getGroupedIe(msgType, 1));
+ groupedIeInstance.displaySgwsOverloadControlInformationInCreateSessionRequestData_v(data.sgwsOverloadControlInformation, stream);
+
+ }
+ if (data.twanEpdgsOverloadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - twanEpdgsOverloadControlInformation:");
+ stream.endOfLine();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ TwanEpdgsOverloadControlInformationInCreateSessionRequest groupedIeInstance =
+ dynamic_cast<
+ TwanEpdgsOverloadControlInformationInCreateSessionRequest&>(overloadControlInformation.getGroupedIe(msgType, 2));
+ groupedIeInstance.displayTwanEpdgsOverloadControlInformationInCreateSessionRequestData_v(data.twanEpdgsOverloadControlInformation, stream);
+
+ }
+ if (data.originationTimeStampIePresent)
+ {
+
+
+ stream.add((char *)"IE - originationTimeStamp:");
+ stream.endOfLine();
+ MillisecondTimeStampIe millisecondTimeStamp=
+ dynamic_cast<
+ MillisecondTimeStampIe&>(GtpV2IeFactory::getInstance().getIeObject(MillisecondTimeStampIeType));
+ millisecondTimeStamp.displayMillisecondTimeStampIe_v(data.originationTimeStamp, stream);
+
+ }
+ if (data.maximumWaitTimeIePresent)
+ {
+
+
+ stream.add((char *)"IE - maximumWaitTime:");
+ stream.endOfLine();
+ IntegerNumberIe integerNumber=
+ dynamic_cast<
+ IntegerNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(IntegerNumberIeType));
+ integerNumber.displayIntegerNumberIe_v(data.maximumWaitTime, stream);
+
+ }
+ if (data.wlanLocationInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - wlanLocationInformation:");
+ stream.endOfLine();
+ TwanIdentifierIe twanIdentifier=
+ dynamic_cast<
+ TwanIdentifierIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierIeType));
+ twanIdentifier.displayTwanIdentifierIe_v(data.wlanLocationInformation, stream);
+
+ }
+ if (data.wlanLocationTimestampIePresent)
+ {
+
+
+ stream.add((char *)"IE - wlanLocationTimestamp:");
+ stream.endOfLine();
+ TwanIdentifierTimestampIe twanIdentifierTimestamp=
+ dynamic_cast<
+ TwanIdentifierTimestampIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierTimestampIeType));
+ twanIdentifierTimestamp.displayTwanIdentifierTimestampIe_v(data.wlanLocationTimestamp, stream);
+
+ }
+ if (data.nbifomContainerIePresent)
+ {
+
+
+ stream.add((char *)"IE - nbifomContainer:");
+ stream.endOfLine();
+ FContainerIe fContainer=
+ dynamic_cast<
+ FContainerIe&>(GtpV2IeFactory::getInstance().getIeObject(FContainerIeType));
+ fContainer.displayFContainerIe_v(data.nbifomContainer, stream);
+
+ }
+ if (data.remoteUeContextConnectedIePresent)
+ {
+
+
+ stream.add((char *)"IE - remoteUeContextConnected:");
+ stream.endOfLine();
+ RemoteUeContextIe remoteUeContext=
+ dynamic_cast<
+ RemoteUeContextIe&>(GtpV2IeFactory::getInstance().getIeObject(RemoteUeContextIeType));
+ RemoteUeContextConnectedInCreateSessionRequest groupedIeInstance =
+ dynamic_cast<
+ RemoteUeContextConnectedInCreateSessionRequest&>(remoteUeContext.getGroupedIe(msgType, 0));
+ groupedIeInstance.displayRemoteUeContextConnectedInCreateSessionRequestData_v(data.remoteUeContextConnected, stream);
+
+ }
+ if (data.a3gppAaaServerIdentifierIePresent)
+ {
+
+
+ stream.add((char *)"IE - a3gppAaaServerIdentifier:");
+ stream.endOfLine();
+ NodeIdentifierIe nodeIdentifier=
+ dynamic_cast<
+ NodeIdentifierIe&>(GtpV2IeFactory::getInstance().getIeObject(NodeIdentifierIeType));
+ nodeIdentifier.displayNodeIdentifierIe_v(data.a3gppAaaServerIdentifier, stream);
+
+ }
+ if (data.extendedProtocolConfigurationOptionsIePresent)
+ {
+
+
+ stream.add((char *)"IE - extendedProtocolConfigurationOptions:");
+ stream.endOfLine();
+ EpcoIe epco=
+ dynamic_cast<
+ EpcoIe&>(GtpV2IeFactory::getInstance().getIeObject(EpcoIeType));
+ epco.displayEpcoIe_v(data.extendedProtocolConfigurationOptions, stream);
+
+ }
+ if (data.servingPlmnRateControlIePresent)
+ {
+
+
+ stream.add((char *)"IE - servingPlmnRateControl:");
+ stream.endOfLine();
+ ServingPlmnRateControlIe servingPlmnRateControl=
+ dynamic_cast<
+ ServingPlmnRateControlIe&>(GtpV2IeFactory::getInstance().getIeObject(ServingPlmnRateControlIeType));
+ servingPlmnRateControl.displayServingPlmnRateControlIe_v(data.servingPlmnRateControl, stream);
+
+ }
+ if (data.moExceptionDataCounterIePresent)
+ {
+
+
+ stream.add((char *)"IE - moExceptionDataCounter:");
+ stream.endOfLine();
+ CounterIe counter=
+ dynamic_cast<
+ CounterIe&>(GtpV2IeFactory::getInstance().getIeObject(CounterIeType));
+ counter.displayCounterIe_v(data.moExceptionDataCounter, stream);
+
+ }
+ if (data.ueTcpPortIePresent)
+ {
+
+
+ stream.add((char *)"IE - ueTcpPort:");
+ stream.endOfLine();
+ PortNumberIe portNumber=
+ dynamic_cast<
+ PortNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(PortNumberIeType));
+ portNumber.displayPortNumberIe_v(data.ueTcpPort, stream);
+
+ }
+ if (data.mappedUeUsageTypeIePresent)
+ {
+
+
+ stream.add((char *)"IE - mappedUeUsageType:");
+ stream.endOfLine();
+ MappedUeUsageTypeIe mappedUeUsageType=
+ dynamic_cast<
+ MappedUeUsageTypeIe&>(GtpV2IeFactory::getInstance().getIeObject(MappedUeUsageTypeIeType));
+ mappedUeUsageType.displayMappedUeUsageTypeIe_v(data.mappedUeUsageType, stream);
+
+ }
+ if (data.userLocationInformationForSgwIePresent)
+ {
+
+
+ stream.add((char *)"IE - userLocationInformationForSgw:");
+ stream.endOfLine();
+ UliIe uli=
+ dynamic_cast<
+ UliIe&>(GtpV2IeFactory::getInstance().getIeObject(UliIeType));
+ uli.displayUliIe_v(data.userLocationInformationForSgw, stream);
+
+ }
+ if (data.sgwUNodeNameIePresent)
+ {
+
+
+ stream.add((char *)"IE - sgwUNodeName:");
+ stream.endOfLine();
+ FqdnIe fqdn=
+ dynamic_cast<
+ FqdnIe&>(GtpV2IeFactory::getInstance().getIeObject(FqdnIeType));
+ fqdn.displayFqdnIe_v(data.sgwUNodeName, stream);
+
+ }
+ if (data.secondaryRatUsageDataReportIePresent)
+ {
+
+
+ stream.add((char *)"IE - secondaryRatUsageDataReport:");
+ stream.endOfLine();
+ SecondaryRatUsageDataReportIe secondaryRatUsageDataReport=
+ dynamic_cast<
+ SecondaryRatUsageDataReportIe&>(GtpV2IeFactory::getInstance().getIeObject(SecondaryRatUsageDataReportIeType));
+ secondaryRatUsageDataReport.displaySecondaryRatUsageDataReportIe_v(data.secondaryRatUsageDataReport, stream);
+
+ }
+ if (data.upFunctionSelectionIndicationFlagsIePresent)
+ {
+
+
+ stream.add((char *)"IE - upFunctionSelectionIndicationFlags:");
+ stream.endOfLine();
+ UpFunctionSelectionIndicationFlagsIe upFunctionSelectionIndicationFlags=
+ dynamic_cast<
+ UpFunctionSelectionIndicationFlagsIe&>(GtpV2IeFactory::getInstance().getIeObject(UpFunctionSelectionIndicationFlagsIeType));
+ upFunctionSelectionIndicationFlags.displayUpFunctionSelectionIndicationFlagsIe_v(data.upFunctionSelectionIndicationFlags, stream);
+
+ }
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
diff --git a/src/gtpV2Codec/msgClasses/createSessionRequestMsg.h b/src/gtpV2Codec/msgClasses/createSessionRequestMsg.h
new file mode 100644
index 0000000..fb10a66
--- /dev/null
+++ b/src/gtpV2Codec/msgClasses/createSessionRequestMsg.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2019-present, Infosys Limited.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ /******************************************************************************
+ *
+ * This is an auto generated file.
+ * Please do not edit this file.
+ * All edits to be made through template source file
+ * <TOP-DIR/scripts/GtpV2StackCodeGen/tts/msgtemplate.h.tt>
+ ******************************************************************************/
+#ifndef CREATESESSIONREQUESTMSG_H_
+#define CREATESESSIONREQUESTMSG_H_
+
+#include <set>
+#include "manual/gtpV2Message.h"
+#include <msgBuffer.h>
+#include <debug.h>
+#include "gtpV2MsgDataTypes.h"
+
+
+class CreateSessionRequestMsg:public GtpV2Message
+{
+public:
+ CreateSessionRequestMsg();
+ virtual ~CreateSessionRequestMsg();
+ bool encodeCreateSessionRequestMsg(MsgBuffer &buffer, CreateSessionRequestMsgData const &data);
+
+ bool decodeCreateSessionRequestMsg (MsgBuffer &buffer, CreateSessionRequestMsgData& data, Uint16 length);
+
+ void displayCreateSessionRequestMsgData_v(CreateSessionRequestMsgData const &data, Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/msgClasses/createSessionResponseMsg.cpp b/src/gtpV2Codec/msgClasses/createSessionResponseMsg.cpp
new file mode 100644
index 0000000..4823825
--- /dev/null
+++ b/src/gtpV2Codec/msgClasses/createSessionResponseMsg.cpp
@@ -0,0 +1,2396 @@
+/*
+ * Copyright 2019-present Infosys Limited
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+/******************************************************************************
+ *
+ * This is an auto generated file.
+ * Please do not edit this file.
+ * All edits to be made through template source file
+ * <TOP-DIR/scripts/GtpV2StackCodeGen/tts/msgtemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "createSessionResponseMsg.h"
+#include "../ieClasses/manual/gtpV2Ie.h"
+#include "../ieClasses/gtpV2IeFactory.h"
+#include "../ieClasses/causeIe.h"
+#include "../ieClasses/changeReportingActionIe.h"
+#include "../ieClasses/csgInformationReportingActionIe.h"
+#include "../ieClasses/fTeidIe.h"
+#include "../ieClasses/apnRestrictionIe.h"
+#include "../ieClasses/ambrIe.h"
+#include "../ieClasses/ebiIe.h"
+#include "../ieClasses/bearerContextIe.h"
+#include "../ieClasses/bearerContextsCreatedInCreateSessionResponse.h"
+#include "../ieClasses/bearerContextIe.h"
+#include "../ieClasses/bearerContextsMarkedForRemovalInCreateSessionResponse.h"
+#include "../ieClasses/recoveryIe.h"
+#include "../ieClasses/fqdnIe.h"
+#include "../ieClasses/ipAddressIe.h"
+#include "../ieClasses/fqCsidIe.h"
+#include "../ieClasses/fqCsidIe.h"
+#include "../ieClasses/localDistinguishedNameIe.h"
+#include "../ieClasses/localDistinguishedNameIe.h"
+#include "../ieClasses/epcTimerIe.h"
+#include "../ieClasses/henbInformationReportingIe.h"
+#include "../ieClasses/fTeidIe.h"
+#include "../ieClasses/paaIe.h"
+#include "../ieClasses/pcoIe.h"
+#include "../ieClasses/additionalProtocolConfigurationOptionsIe.h"
+#include "../ieClasses/ip4cpIe.h"
+#include "../ieClasses/indicationIe.h"
+#include "../ieClasses/presenceReportingAreaActionIe.h"
+#include "../ieClasses/loadControlInformationIe.h"
+#include "../ieClasses/pgwsNodeLevelLoadControlInformationInCreateSessionResponse.h"
+#include "../ieClasses/loadControlInformationIe.h"
+#include "../ieClasses/pgwsApnLevelLoadControlInformationInCreateSessionResponse.h"
+#include "../ieClasses/loadControlInformationIe.h"
+#include "../ieClasses/sgwsNodeLevelLoadControlInformationInCreateSessionResponse.h"
+#include "../ieClasses/overloadControlInformationIe.h"
+#include "../ieClasses/pgwsOverloadControlInformationInCreateSessionResponse.h"
+#include "../ieClasses/overloadControlInformationIe.h"
+#include "../ieClasses/sgwsOverloadControlInformationInCreateSessionResponse.h"
+#include "../ieClasses/fContainerIe.h"
+#include "../ieClasses/chargingIdIe.h"
+#include "../ieClasses/epcoIe.h"
+
+CreateSessionResponseMsg::CreateSessionResponseMsg()
+{
+ msgType = CreateSessionResponseMsgType;
+ Uint16 mandIe;
+ mandIe = CauseIeType;
+ mandIe = (mandIe << 8) | 0; // cause
+ mandatoryIeSet.insert(mandIe); mandIe = BearerContextIeType;
+ mandIe = (mandIe << 8) | 0; // bearerContextsCreated
+ mandatoryIeSet.insert(mandIe);
+}
+
+CreateSessionResponseMsg::~CreateSessionResponseMsg()
+{
+
+}
+
+bool CreateSessionResponseMsg::encodeCreateSessionResponseMsg(MsgBuffer &buffer,
+ CreateSessionResponseMsgData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+ // Encode the Ie Header
+ header.ieType = CauseIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ CauseIe cause=
+ dynamic_cast<
+ CauseIe&>(GtpV2IeFactory::getInstance().getIeObject(CauseIeType));
+ rc = cause.encodeCauseIe(buffer, data.cause);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: cause\n");
+ return false;
+ }
+
+ if (data.changeReportingActionIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = ChangeReportingActionIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ ChangeReportingActionIe changeReportingAction=
+ dynamic_cast<
+ ChangeReportingActionIe&>(GtpV2IeFactory::getInstance().getIeObject(ChangeReportingActionIeType));
+ rc = changeReportingAction.encodeChangeReportingActionIe(buffer, data.changeReportingAction);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: changeReportingAction\n");
+ return false;
+ }
+ }
+
+ if (data.csgInformationReportingActionIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = CsgInformationReportingActionIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ CsgInformationReportingActionIe csgInformationReportingAction=
+ dynamic_cast<
+ CsgInformationReportingActionIe&>(GtpV2IeFactory::getInstance().getIeObject(CsgInformationReportingActionIeType));
+ rc = csgInformationReportingAction.encodeCsgInformationReportingActionIe(buffer, data.csgInformationReportingAction);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: csgInformationReportingAction\n");
+ return false;
+ }
+ }
+
+ if (data.senderFTeidForControlPlaneIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FTeidIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ rc = fTeid.encodeFTeidIe(buffer, data.senderFTeidForControlPlane);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: senderFTeidForControlPlane\n");
+ return false;
+ }
+ }
+
+ if (data.apnRestrictionIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = ApnRestrictionIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ ApnRestrictionIe apnRestriction=
+ dynamic_cast<
+ ApnRestrictionIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnRestrictionIeType));
+ rc = apnRestriction.encodeApnRestrictionIe(buffer, data.apnRestriction);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: apnRestriction\n");
+ return false;
+ }
+ }
+
+ if (data.aggregateMaximumBitRateIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = AmbrIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ AmbrIe ambr=
+ dynamic_cast<
+ AmbrIe&>(GtpV2IeFactory::getInstance().getIeObject(AmbrIeType));
+ rc = ambr.encodeAmbrIe(buffer, data.aggregateMaximumBitRate);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: aggregateMaximumBitRate\n");
+ return false;
+ }
+ }
+
+ if (data.linkedEpsBearerIdIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = EbiIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ EbiIe ebi=
+ dynamic_cast<
+ EbiIe&>(GtpV2IeFactory::getInstance().getIeObject(EbiIeType));
+ rc = ebi.encodeEbiIe(buffer, data.linkedEpsBearerId);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: linkedEpsBearerId\n");
+ return false;
+ }
+ }
+
+ // First validate if the applicatoin provided more than the expected cardinality
+ if (data.bearerContextsCreatedCount > 11)
+ {
+ errorStream.add((char *)"Number of entries of bearerContextsCreated exceeded\n");
+ errorStream.add((char *)"Expected count: 11 Received count: ");
+ errorStream.add((char *)"data.bearerContextsCreatedCount");
+ errorStream.endOfLine();
+ return false;
+ }
+ for (Uint8 i = 0; i < data.bearerContextsCreatedCount; i++)
+ {
+ // Encode the Ie Header
+ header.ieType = BearerContextIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ BearerContextIe bearerContext=
+ dynamic_cast<
+ BearerContextIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(BearerContextIeType));
+ BearerContextsCreatedInCreateSessionResponse groupedIeInstance = dynamic_cast<BearerContextsCreatedInCreateSessionResponse&>(bearerContext.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.encodeBearerContextsCreatedInCreateSessionResponse(buffer, data.bearerContextsCreated[i]);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ }
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: bearerContextsCreated\n");
+ return false;
+ }
+
+ // First validate if the applicatoin provided more than the expected cardinality
+ if (data.bearerContextsMarkedForRemovalCount > 11)
+ {
+ errorStream.add((char *)"Number of entries of bearerContextsMarkedForRemoval exceeded\n");
+ errorStream.add((char *)"Expected count: 11 Received count: ");
+ errorStream.add((char *)"data.bearerContextsMarkedForRemovalCount");
+ errorStream.endOfLine();
+ return false;
+ }
+ for (Uint8 i = 0; i < data.bearerContextsMarkedForRemovalCount; i++)
+ {
+ // Encode the Ie Header
+ header.ieType = BearerContextIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ BearerContextIe bearerContext=
+ dynamic_cast<
+ BearerContextIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(BearerContextIeType));
+ BearerContextsMarkedForRemovalInCreateSessionResponse groupedIeInstance = dynamic_cast<BearerContextsMarkedForRemovalInCreateSessionResponse&>(bearerContext.getGroupedIe(msgType, 1));
+ rc = groupedIeInstance.encodeBearerContextsMarkedForRemovalInCreateSessionResponse(buffer, data.bearerContextsMarkedForRemoval[i]);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ }
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: bearerContextsMarkedForRemoval\n");
+ return false;
+ }
+
+ if (data.recoveryIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = RecoveryIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ RecoveryIe recovery=
+ dynamic_cast<
+ RecoveryIe&>(GtpV2IeFactory::getInstance().getIeObject(RecoveryIeType));
+ rc = recovery.encodeRecoveryIe(buffer, data.recovery);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: recovery\n");
+ return false;
+ }
+ }
+
+ if (data.chargingGatewayNameIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FqdnIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ FqdnIe fqdn=
+ dynamic_cast<
+ FqdnIe&>(GtpV2IeFactory::getInstance().getIeObject(FqdnIeType));
+ rc = fqdn.encodeFqdnIe(buffer, data.chargingGatewayName);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: chargingGatewayName\n");
+ return false;
+ }
+ }
+
+ if (data.chargingGatewayAddressIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = IpAddressIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ IpAddressIe ipAddress=
+ dynamic_cast<
+ IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
+ rc = ipAddress.encodeIpAddressIe(buffer, data.chargingGatewayAddress);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: chargingGatewayAddress\n");
+ return false;
+ }
+ }
+
+ if (data.pgwFqCsidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FqCsidIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ rc = fqCsid.encodeFqCsidIe(buffer, data.pgwFqCsid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: pgwFqCsid\n");
+ return false;
+ }
+ }
+
+ if (data.sgwFqCsidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FqCsidIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ rc = fqCsid.encodeFqCsidIe(buffer, data.sgwFqCsid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: sgwFqCsid\n");
+ return false;
+ }
+ }
+
+ if (data.sgwLdnIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = LocalDistinguishedNameIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ LocalDistinguishedNameIe localDistinguishedName=
+ dynamic_cast<
+ LocalDistinguishedNameIe&>(GtpV2IeFactory::getInstance().getIeObject(LocalDistinguishedNameIeType));
+ rc = localDistinguishedName.encodeLocalDistinguishedNameIe(buffer, data.sgwLdn);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: sgwLdn\n");
+ return false;
+ }
+ }
+
+ if (data.pgwLdnIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = LocalDistinguishedNameIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ LocalDistinguishedNameIe localDistinguishedName=
+ dynamic_cast<
+ LocalDistinguishedNameIe&>(GtpV2IeFactory::getInstance().getIeObject(LocalDistinguishedNameIeType));
+ rc = localDistinguishedName.encodeLocalDistinguishedNameIe(buffer, data.pgwLdn);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: pgwLdn\n");
+ return false;
+ }
+ }
+
+ if (data.pgwBackOffTimeIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = EpcTimerIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ EpcTimerIe epcTimer=
+ dynamic_cast<
+ EpcTimerIe&>(GtpV2IeFactory::getInstance().getIeObject(EpcTimerIeType));
+ rc = epcTimer.encodeEpcTimerIe(buffer, data.pgwBackOffTime);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: pgwBackOffTime\n");
+ return false;
+ }
+ }
+
+ if (data.hNbInformationReportingIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = HenbInformationReportingIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ HenbInformationReportingIe henbInformationReporting=
+ dynamic_cast<
+ HenbInformationReportingIe&>(GtpV2IeFactory::getInstance().getIeObject(HenbInformationReportingIeType));
+ rc = henbInformationReporting.encodeHenbInformationReportingIe(buffer, data.hNbInformationReporting);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: hNbInformationReporting\n");
+ return false;
+ }
+ }
+
+ if (data.pgwS5S8S2bFTeidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FTeidIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ rc = fTeid.encodeFTeidIe(buffer, data.pgwS5S8S2bFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: pgwS5S8S2bFTeid\n");
+ return false;
+ }
+ }
+
+ if (data.pdnAddressAllocationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = PaaIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ PaaIe paa=
+ dynamic_cast<
+ PaaIe&>(GtpV2IeFactory::getInstance().getIeObject(PaaIeType));
+ rc = paa.encodePaaIe(buffer, data.pdnAddressAllocation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: pdnAddressAllocation\n");
+ return false;
+ }
+ }
+
+ if (data.protocolConfigurationOptionsIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = PcoIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ PcoIe pco=
+ dynamic_cast<
+ PcoIe&>(GtpV2IeFactory::getInstance().getIeObject(PcoIeType));
+ rc = pco.encodePcoIe(buffer, data.protocolConfigurationOptions);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: protocolConfigurationOptions\n");
+ return false;
+ }
+ }
+
+ if (data.additionalProtocolConfigurationOptionsIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = AdditionalProtocolConfigurationOptionsIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ AdditionalProtocolConfigurationOptionsIe additionalProtocolConfigurationOptions=
+ dynamic_cast<
+ AdditionalProtocolConfigurationOptionsIe&>(GtpV2IeFactory::getInstance().getIeObject(AdditionalProtocolConfigurationOptionsIeType));
+ rc = additionalProtocolConfigurationOptions.encodeAdditionalProtocolConfigurationOptionsIe(buffer, data.additionalProtocolConfigurationOptions);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: additionalProtocolConfigurationOptions\n");
+ return false;
+ }
+ }
+
+ if (data.trustedWlanIpv4ParametersIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = Ip4cpIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ Ip4cpIe ip4cp=
+ dynamic_cast<
+ Ip4cpIe&>(GtpV2IeFactory::getInstance().getIeObject(Ip4cpIeType));
+ rc = ip4cp.encodeIp4cpIe(buffer, data.trustedWlanIpv4Parameters);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: trustedWlanIpv4Parameters\n");
+ return false;
+ }
+ }
+
+ if (data.indicationFlagsIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = IndicationIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ IndicationIe indication=
+ dynamic_cast<
+ IndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(IndicationIeType));
+ rc = indication.encodeIndicationIe(buffer, data.indicationFlags);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: indicationFlags\n");
+ return false;
+ }
+ }
+
+ if (data.presenceReportingAreaActionIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = PresenceReportingAreaActionIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ PresenceReportingAreaActionIe presenceReportingAreaAction=
+ dynamic_cast<
+ PresenceReportingAreaActionIe&>(GtpV2IeFactory::getInstance().getIeObject(PresenceReportingAreaActionIeType));
+ rc = presenceReportingAreaAction.encodePresenceReportingAreaActionIe(buffer, data.presenceReportingAreaAction);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: presenceReportingAreaAction\n");
+ return false;
+ }
+ }
+
+ if (data.pgwsNodeLevelLoadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = LoadControlInformationIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ LoadControlInformationIe loadControlInformation=
+ dynamic_cast<
+ LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType));
+ PgwsNodeLevelLoadControlInformationInCreateSessionResponse groupedIeInstance =
+ dynamic_cast<
+ PgwsNodeLevelLoadControlInformationInCreateSessionResponse&>(loadControlInformation.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.encodePgwsNodeLevelLoadControlInformationInCreateSessionResponse(buffer, data.pgwsNodeLevelLoadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: pgwsNodeLevelLoadControlInformation\n");
+ return false;
+ }
+ }
+
+ if (data.pgwsApnLevelLoadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = LoadControlInformationIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ LoadControlInformationIe loadControlInformation=
+ dynamic_cast<
+ LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType));
+ PgwsApnLevelLoadControlInformationInCreateSessionResponse groupedIeInstance =
+ dynamic_cast<
+ PgwsApnLevelLoadControlInformationInCreateSessionResponse&>(loadControlInformation.getGroupedIe(msgType, 1));
+ rc = groupedIeInstance.encodePgwsApnLevelLoadControlInformationInCreateSessionResponse(buffer, data.pgwsApnLevelLoadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: pgwsApnLevelLoadControlInformation\n");
+ return false;
+ }
+ }
+
+ if (data.sgwsNodeLevelLoadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = LoadControlInformationIeType;
+ header.instance = 2;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ LoadControlInformationIe loadControlInformation=
+ dynamic_cast<
+ LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType));
+ SgwsNodeLevelLoadControlInformationInCreateSessionResponse groupedIeInstance =
+ dynamic_cast<
+ SgwsNodeLevelLoadControlInformationInCreateSessionResponse&>(loadControlInformation.getGroupedIe(msgType, 2));
+ rc = groupedIeInstance.encodeSgwsNodeLevelLoadControlInformationInCreateSessionResponse(buffer, data.sgwsNodeLevelLoadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: sgwsNodeLevelLoadControlInformation\n");
+ return false;
+ }
+ }
+
+ if (data.pgwsOverloadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = OverloadControlInformationIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ PgwsOverloadControlInformationInCreateSessionResponse groupedIeInstance =
+ dynamic_cast<
+ PgwsOverloadControlInformationInCreateSessionResponse&>(overloadControlInformation.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.encodePgwsOverloadControlInformationInCreateSessionResponse(buffer, data.pgwsOverloadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: pgwsOverloadControlInformation\n");
+ return false;
+ }
+ }
+
+ if (data.sgwsOverloadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = OverloadControlInformationIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ SgwsOverloadControlInformationInCreateSessionResponse groupedIeInstance =
+ dynamic_cast<
+ SgwsOverloadControlInformationInCreateSessionResponse&>(overloadControlInformation.getGroupedIe(msgType, 1));
+ rc = groupedIeInstance.encodeSgwsOverloadControlInformationInCreateSessionResponse(buffer, data.sgwsOverloadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: sgwsOverloadControlInformation\n");
+ return false;
+ }
+ }
+
+ if (data.nbifomContainerIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FContainerIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ FContainerIe fContainer=
+ dynamic_cast<
+ FContainerIe&>(GtpV2IeFactory::getInstance().getIeObject(FContainerIeType));
+ rc = fContainer.encodeFContainerIe(buffer, data.nbifomContainer);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: nbifomContainer\n");
+ return false;
+ }
+ }
+
+ if (data.pdnConnectionChargingIdIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = ChargingIdIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ ChargingIdIe chargingId=
+ dynamic_cast<
+ ChargingIdIe&>(GtpV2IeFactory::getInstance().getIeObject(ChargingIdIeType));
+ rc = chargingId.encodeChargingIdIe(buffer, data.pdnConnectionChargingId);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: pdnConnectionChargingId\n");
+ return false;
+ }
+ }
+
+ if (data.extendedProtocolConfigurationOptionsIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = EpcoIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ EpcoIe epco=
+ dynamic_cast<
+ EpcoIe&>(GtpV2IeFactory::getInstance().getIeObject(EpcoIeType));
+ rc = epco.encodeEpcoIe(buffer, data.extendedProtocolConfigurationOptions);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: extendedProtocolConfigurationOptions\n");
+ return false;
+ }
+ }
+ return rc;
+
+}
+
+bool CreateSessionResponseMsg::decodeCreateSessionResponseMsg(MsgBuffer &buffer,
+ CreateSessionResponseMsgData
+ &data, Uint16 length)
+{
+
+ bool rc = false;
+ GtpV2IeHeader ieHeader;
+
+ set<Uint16> mandatoryIeLocalList = mandatoryIeSet;
+ while (buffer.lengthLeft() > IE_HEADER_SIZE)
+ {
+ GtpV2Ie::decodeGtpV2IeHeader(buffer, ieHeader);
+ if (ieHeader.length > buffer.lengthLeft())
+ {
+ // We do not have enough bytes left in the message for this IE
+ errorStream.add((char *)"IE Length exceeds beyond message boundary\n");
+ errorStream.add((char *)" Offending IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.add((char *)"\n Ie Length in Header: ");
+ errorStream.add(ieHeader.length);
+ errorStream.add((char *)"\n Bytes left in message: ");
+ errorStream.add(buffer.lengthLeft());
+ errorStream.endOfLine();
+ return false;
+ }
+
+ switch (ieHeader.ieType){
+
+ case CauseIeType:
+ {
+ CauseIe ieObject =
+ dynamic_cast<
+ CauseIe&>(GtpV2IeFactory::getInstance().getIeObject(CauseIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeCauseIe(buffer, data.cause, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: cause\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case ChangeReportingActionIeType:
+ {
+ ChangeReportingActionIe ieObject =
+ dynamic_cast<
+ ChangeReportingActionIe&>(GtpV2IeFactory::getInstance().getIeObject(ChangeReportingActionIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeChangeReportingActionIe(buffer, data.changeReportingAction, ieHeader.length);
+
+ data.changeReportingActionIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: changeReportingAction\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case CsgInformationReportingActionIeType:
+ {
+ CsgInformationReportingActionIe ieObject =
+ dynamic_cast<
+ CsgInformationReportingActionIe&>(GtpV2IeFactory::getInstance().getIeObject(CsgInformationReportingActionIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeCsgInformationReportingActionIe(buffer, data.csgInformationReportingAction, ieHeader.length);
+
+ data.csgInformationReportingActionIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: csgInformationReportingAction\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case FTeidIeType:
+ {
+ FTeidIe ieObject =
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeFTeidIe(buffer, data.senderFTeidForControlPlane, ieHeader.length);
+
+ data.senderFTeidForControlPlaneIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: senderFTeidForControlPlane\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ rc = ieObject.decodeFTeidIe(buffer, data.pgwS5S8S2bFTeid, ieHeader.length);
+
+ data.pgwS5S8S2bFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: pgwS5S8S2bFTeid\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case ApnRestrictionIeType:
+ {
+ ApnRestrictionIe ieObject =
+ dynamic_cast<
+ ApnRestrictionIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnRestrictionIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeApnRestrictionIe(buffer, data.apnRestriction, ieHeader.length);
+
+ data.apnRestrictionIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: apnRestriction\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case AmbrIeType:
+ {
+ AmbrIe ieObject =
+ dynamic_cast<
+ AmbrIe&>(GtpV2IeFactory::getInstance().getIeObject(AmbrIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeAmbrIe(buffer, data.aggregateMaximumBitRate, ieHeader.length);
+
+ data.aggregateMaximumBitRateIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: aggregateMaximumBitRate\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case EbiIeType:
+ {
+ EbiIe ieObject =
+ dynamic_cast<
+ EbiIe&>(GtpV2IeFactory::getInstance().getIeObject(EbiIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeEbiIe(buffer, data.linkedEpsBearerId, ieHeader.length);
+
+ data.linkedEpsBearerIdIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: linkedEpsBearerId\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case BearerContextIeType:
+ {
+ BearerContextIe ieObject =
+ dynamic_cast<
+ BearerContextIe&>(GtpV2IeFactory::getInstance().getIeObject(BearerContextIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ // First check if we have enough space left to decode and store this instance
+ if (data.bearerContextsCreatedCount == 11)
+ {
+ errorStream.add((char *)"More than 11 instances of bearerContextsCreated received\n");
+ return false;
+ }
+ BearerContextsCreatedInCreateSessionResponse groupedIeInstance =
+ dynamic_cast<
+ BearerContextsCreatedInCreateSessionResponse&>(ieObject.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.decodeBearerContextsCreatedInCreateSessionResponse(buffer,
+ data.bearerContextsCreated[data.bearerContextsCreatedCount], ieHeader.length);
+ data.bearerContextsCreatedCount++; // TODO Count validation
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: bearerContextsCreated\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ // First check if we have enough space left to decode and store this instance
+ if (data.bearerContextsMarkedForRemovalCount == 11)
+ {
+ errorStream.add((char *)"More than 11 instances of bearerContextsMarkedForRemoval received\n");
+ return false;
+ }
+ BearerContextsMarkedForRemovalInCreateSessionResponse groupedIeInstance =
+ dynamic_cast<
+ BearerContextsMarkedForRemovalInCreateSessionResponse&>(ieObject.getGroupedIe(msgType, 1));
+ rc = groupedIeInstance.decodeBearerContextsMarkedForRemovalInCreateSessionResponse(buffer,
+ data.bearerContextsMarkedForRemoval[data.bearerContextsMarkedForRemovalCount], ieHeader.length);
+ data.bearerContextsMarkedForRemovalCount++; // TODO Count validation
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: bearerContextsMarkedForRemoval\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case RecoveryIeType:
+ {
+ RecoveryIe ieObject =
+ dynamic_cast<
+ RecoveryIe&>(GtpV2IeFactory::getInstance().getIeObject(RecoveryIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeRecoveryIe(buffer, data.recovery, ieHeader.length);
+
+ data.recoveryIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: recovery\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case FqdnIeType:
+ {
+ FqdnIe ieObject =
+ dynamic_cast<
+ FqdnIe&>(GtpV2IeFactory::getInstance().getIeObject(FqdnIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeFqdnIe(buffer, data.chargingGatewayName, ieHeader.length);
+
+ data.chargingGatewayNameIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: chargingGatewayName\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case IpAddressIeType:
+ {
+ IpAddressIe ieObject =
+ dynamic_cast<
+ IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeIpAddressIe(buffer, data.chargingGatewayAddress, ieHeader.length);
+
+ data.chargingGatewayAddressIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: chargingGatewayAddress\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case FqCsidIeType:
+ {
+ FqCsidIe ieObject =
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeFqCsidIe(buffer, data.pgwFqCsid, ieHeader.length);
+
+ data.pgwFqCsidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: pgwFqCsid\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ rc = ieObject.decodeFqCsidIe(buffer, data.sgwFqCsid, ieHeader.length);
+
+ data.sgwFqCsidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: sgwFqCsid\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case LocalDistinguishedNameIeType:
+ {
+ LocalDistinguishedNameIe ieObject =
+ dynamic_cast<
+ LocalDistinguishedNameIe&>(GtpV2IeFactory::getInstance().getIeObject(LocalDistinguishedNameIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeLocalDistinguishedNameIe(buffer, data.sgwLdn, ieHeader.length);
+
+ data.sgwLdnIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: sgwLdn\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ rc = ieObject.decodeLocalDistinguishedNameIe(buffer, data.pgwLdn, ieHeader.length);
+
+ data.pgwLdnIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: pgwLdn\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case EpcTimerIeType:
+ {
+ EpcTimerIe ieObject =
+ dynamic_cast<
+ EpcTimerIe&>(GtpV2IeFactory::getInstance().getIeObject(EpcTimerIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeEpcTimerIe(buffer, data.pgwBackOffTime, ieHeader.length);
+
+ data.pgwBackOffTimeIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: pgwBackOffTime\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case HenbInformationReportingIeType:
+ {
+ HenbInformationReportingIe ieObject =
+ dynamic_cast<
+ HenbInformationReportingIe&>(GtpV2IeFactory::getInstance().getIeObject(HenbInformationReportingIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeHenbInformationReportingIe(buffer, data.hNbInformationReporting, ieHeader.length);
+
+ data.hNbInformationReportingIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: hNbInformationReporting\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case PaaIeType:
+ {
+ PaaIe ieObject =
+ dynamic_cast<
+ PaaIe&>(GtpV2IeFactory::getInstance().getIeObject(PaaIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodePaaIe(buffer, data.pdnAddressAllocation, ieHeader.length);
+
+ data.pdnAddressAllocationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: pdnAddressAllocation\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case PcoIeType:
+ {
+ PcoIe ieObject =
+ dynamic_cast<
+ PcoIe&>(GtpV2IeFactory::getInstance().getIeObject(PcoIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodePcoIe(buffer, data.protocolConfigurationOptions, ieHeader.length);
+
+ data.protocolConfigurationOptionsIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: protocolConfigurationOptions\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case AdditionalProtocolConfigurationOptionsIeType:
+ {
+ AdditionalProtocolConfigurationOptionsIe ieObject =
+ dynamic_cast<
+ AdditionalProtocolConfigurationOptionsIe&>(GtpV2IeFactory::getInstance().getIeObject(AdditionalProtocolConfigurationOptionsIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeAdditionalProtocolConfigurationOptionsIe(buffer, data.additionalProtocolConfigurationOptions, ieHeader.length);
+
+ data.additionalProtocolConfigurationOptionsIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: additionalProtocolConfigurationOptions\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case Ip4cpIeType:
+ {
+ Ip4cpIe ieObject =
+ dynamic_cast<
+ Ip4cpIe&>(GtpV2IeFactory::getInstance().getIeObject(Ip4cpIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeIp4cpIe(buffer, data.trustedWlanIpv4Parameters, ieHeader.length);
+
+ data.trustedWlanIpv4ParametersIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: trustedWlanIpv4Parameters\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case IndicationIeType:
+ {
+ IndicationIe ieObject =
+ dynamic_cast<
+ IndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(IndicationIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeIndicationIe(buffer, data.indicationFlags, ieHeader.length);
+
+ data.indicationFlagsIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: indicationFlags\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case PresenceReportingAreaActionIeType:
+ {
+ PresenceReportingAreaActionIe ieObject =
+ dynamic_cast<
+ PresenceReportingAreaActionIe&>(GtpV2IeFactory::getInstance().getIeObject(PresenceReportingAreaActionIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodePresenceReportingAreaActionIe(buffer, data.presenceReportingAreaAction, ieHeader.length);
+
+ data.presenceReportingAreaActionIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: presenceReportingAreaAction\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case LoadControlInformationIeType:
+ {
+ LoadControlInformationIe ieObject =
+ dynamic_cast<
+ LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ PgwsNodeLevelLoadControlInformationInCreateSessionResponse groupedIeInstance =
+ dynamic_cast<
+ PgwsNodeLevelLoadControlInformationInCreateSessionResponse&>(ieObject.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.decodePgwsNodeLevelLoadControlInformationInCreateSessionResponse(buffer, data.pgwsNodeLevelLoadControlInformation, ieHeader.length);
+
+ data.pgwsNodeLevelLoadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: pgwsNodeLevelLoadControlInformation\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ PgwsApnLevelLoadControlInformationInCreateSessionResponse groupedIeInstance =
+ dynamic_cast<
+ PgwsApnLevelLoadControlInformationInCreateSessionResponse&>(ieObject.getGroupedIe(msgType, 1));
+ rc = groupedIeInstance.decodePgwsApnLevelLoadControlInformationInCreateSessionResponse(buffer, data.pgwsApnLevelLoadControlInformation, ieHeader.length);
+
+ data.pgwsApnLevelLoadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: pgwsApnLevelLoadControlInformation\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 2)
+ {
+ SgwsNodeLevelLoadControlInformationInCreateSessionResponse groupedIeInstance =
+ dynamic_cast<
+ SgwsNodeLevelLoadControlInformationInCreateSessionResponse&>(ieObject.getGroupedIe(msgType, 2));
+ rc = groupedIeInstance.decodeSgwsNodeLevelLoadControlInformationInCreateSessionResponse(buffer, data.sgwsNodeLevelLoadControlInformation, ieHeader.length);
+
+ data.sgwsNodeLevelLoadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: sgwsNodeLevelLoadControlInformation\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case OverloadControlInformationIeType:
+ {
+ OverloadControlInformationIe ieObject =
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ PgwsOverloadControlInformationInCreateSessionResponse groupedIeInstance =
+ dynamic_cast<
+ PgwsOverloadControlInformationInCreateSessionResponse&>(ieObject.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.decodePgwsOverloadControlInformationInCreateSessionResponse(buffer, data.pgwsOverloadControlInformation, ieHeader.length);
+
+ data.pgwsOverloadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: pgwsOverloadControlInformation\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ SgwsOverloadControlInformationInCreateSessionResponse groupedIeInstance =
+ dynamic_cast<
+ SgwsOverloadControlInformationInCreateSessionResponse&>(ieObject.getGroupedIe(msgType, 1));
+ rc = groupedIeInstance.decodeSgwsOverloadControlInformationInCreateSessionResponse(buffer, data.sgwsOverloadControlInformation, ieHeader.length);
+
+ data.sgwsOverloadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: sgwsOverloadControlInformation\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case FContainerIeType:
+ {
+ FContainerIe ieObject =
+ dynamic_cast<
+ FContainerIe&>(GtpV2IeFactory::getInstance().getIeObject(FContainerIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeFContainerIe(buffer, data.nbifomContainer, ieHeader.length);
+
+ data.nbifomContainerIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: nbifomContainer\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case ChargingIdIeType:
+ {
+ ChargingIdIe ieObject =
+ dynamic_cast<
+ ChargingIdIe&>(GtpV2IeFactory::getInstance().getIeObject(ChargingIdIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeChargingIdIe(buffer, data.pdnConnectionChargingId, ieHeader.length);
+
+ data.pdnConnectionChargingIdIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: pdnConnectionChargingId\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case EpcoIeType:
+ {
+ EpcoIe ieObject =
+ dynamic_cast<
+ EpcoIe&>(GtpV2IeFactory::getInstance().getIeObject(EpcoIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeEpcoIe(buffer, data.extendedProtocolConfigurationOptions, ieHeader.length);
+
+ data.extendedProtocolConfigurationOptionsIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: extendedProtocolConfigurationOptions\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ default:
+ {
+ // Unknown IE print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ }
+ }
+ return rc; // TODO validations
+}
+
+void CreateSessionResponseMsg::
+displayCreateSessionResponseMsgData_v(CreateSessionResponseMsgData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"CreateSessionResponseMsg:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+ stream.add((char *)"IE - cause:");
+ stream.endOfLine();
+ CauseIe cause=
+ dynamic_cast<
+ CauseIe&>(GtpV2IeFactory::getInstance().getIeObject(CauseIeType));
+ cause.displayCauseIe_v(data.cause, stream);
+
+ if (data.changeReportingActionIePresent)
+ {
+
+
+ stream.add((char *)"IE - changeReportingAction:");
+ stream.endOfLine();
+ ChangeReportingActionIe changeReportingAction=
+ dynamic_cast<
+ ChangeReportingActionIe&>(GtpV2IeFactory::getInstance().getIeObject(ChangeReportingActionIeType));
+ changeReportingAction.displayChangeReportingActionIe_v(data.changeReportingAction, stream);
+
+ }
+ if (data.csgInformationReportingActionIePresent)
+ {
+
+
+ stream.add((char *)"IE - csgInformationReportingAction:");
+ stream.endOfLine();
+ CsgInformationReportingActionIe csgInformationReportingAction=
+ dynamic_cast<
+ CsgInformationReportingActionIe&>(GtpV2IeFactory::getInstance().getIeObject(CsgInformationReportingActionIeType));
+ csgInformationReportingAction.displayCsgInformationReportingActionIe_v(data.csgInformationReportingAction, stream);
+
+ }
+ if (data.senderFTeidForControlPlaneIePresent)
+ {
+
+
+ stream.add((char *)"IE - senderFTeidForControlPlane:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.senderFTeidForControlPlane, stream);
+
+ }
+ if (data.apnRestrictionIePresent)
+ {
+
+
+ stream.add((char *)"IE - apnRestriction:");
+ stream.endOfLine();
+ ApnRestrictionIe apnRestriction=
+ dynamic_cast<
+ ApnRestrictionIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnRestrictionIeType));
+ apnRestriction.displayApnRestrictionIe_v(data.apnRestriction, stream);
+
+ }
+ if (data.aggregateMaximumBitRateIePresent)
+ {
+
+
+ stream.add((char *)"IE - aggregateMaximumBitRate:");
+ stream.endOfLine();
+ AmbrIe ambr=
+ dynamic_cast<
+ AmbrIe&>(GtpV2IeFactory::getInstance().getIeObject(AmbrIeType));
+ ambr.displayAmbrIe_v(data.aggregateMaximumBitRate, stream);
+
+ }
+ if (data.linkedEpsBearerIdIePresent)
+ {
+
+
+ stream.add((char *)"IE - linkedEpsBearerId:");
+ stream.endOfLine();
+ EbiIe ebi=
+ dynamic_cast<
+ EbiIe&>(GtpV2IeFactory::getInstance().getIeObject(EbiIeType));
+ ebi.displayEbiIe_v(data.linkedEpsBearerId, stream);
+
+ }
+
+ Uint8 displayCount;
+
+ displayCount = data.bearerContextsCreatedCount;
+ if (displayCount > 11)
+ {
+ stream.add((char *)"Invalid data more than 11 instances");
+ stream.endOfLine();
+ stream.add((char *)"Displaying only 11");
+ stream.endOfLine();
+ displayCount = 11;
+ }
+ for (Uint8 i = 0; i < displayCount; i++)
+ {
+ stream.add((char *)"IE - bearerContextsCreated:");
+ stream.endOfLine();
+ BearerContextIe bearerContext=
+ dynamic_cast<
+ BearerContextIe&>(GtpV2IeFactory::getInstance().getIeObject(BearerContextIeType));
+ BearerContextsCreatedInCreateSessionResponse groupedIeInstance =
+ dynamic_cast<
+ BearerContextsCreatedInCreateSessionResponse&>(bearerContext.getGroupedIe(msgType, 0));
+ groupedIeInstance.displayBearerContextsCreatedInCreateSessionResponseData_v(data.bearerContextsCreated[i], stream);
+
+ }
+ displayCount = data.bearerContextsMarkedForRemovalCount;
+ if (displayCount > 11)
+ {
+ stream.add((char *)"Invalid data more than 11 instances");
+ stream.endOfLine();
+ stream.add((char *)"Displaying only 11");
+ stream.endOfLine();
+ displayCount = 11;
+ }
+ for (Uint8 i = 0; i < displayCount; i++)
+ {
+ stream.add((char *)"IE - bearerContextsMarkedForRemoval:");
+ stream.endOfLine();
+ BearerContextIe bearerContext=
+ dynamic_cast<
+ BearerContextIe&>(GtpV2IeFactory::getInstance().getIeObject(BearerContextIeType));
+ BearerContextsMarkedForRemovalInCreateSessionResponse groupedIeInstance =
+ dynamic_cast<
+ BearerContextsMarkedForRemovalInCreateSessionResponse&>(bearerContext.getGroupedIe(msgType, 1));
+ groupedIeInstance.displayBearerContextsMarkedForRemovalInCreateSessionResponseData_v(data.bearerContextsMarkedForRemoval[i], stream);
+ }
+
+
+
+
+ if (data.recoveryIePresent)
+ {
+
+
+ stream.add((char *)"IE - recovery:");
+ stream.endOfLine();
+ RecoveryIe recovery=
+ dynamic_cast<
+ RecoveryIe&>(GtpV2IeFactory::getInstance().getIeObject(RecoveryIeType));
+ recovery.displayRecoveryIe_v(data.recovery, stream);
+
+ }
+ if (data.chargingGatewayNameIePresent)
+ {
+
+
+ stream.add((char *)"IE - chargingGatewayName:");
+ stream.endOfLine();
+ FqdnIe fqdn=
+ dynamic_cast<
+ FqdnIe&>(GtpV2IeFactory::getInstance().getIeObject(FqdnIeType));
+ fqdn.displayFqdnIe_v(data.chargingGatewayName, stream);
+
+ }
+ if (data.chargingGatewayAddressIePresent)
+ {
+
+
+ stream.add((char *)"IE - chargingGatewayAddress:");
+ stream.endOfLine();
+ IpAddressIe ipAddress=
+ dynamic_cast<
+ IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
+ ipAddress.displayIpAddressIe_v(data.chargingGatewayAddress, stream);
+
+ }
+ if (data.pgwFqCsidIePresent)
+ {
+
+
+ stream.add((char *)"IE - pgwFqCsid:");
+ stream.endOfLine();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ fqCsid.displayFqCsidIe_v(data.pgwFqCsid, stream);
+
+ }
+ if (data.sgwFqCsidIePresent)
+ {
+
+
+ stream.add((char *)"IE - sgwFqCsid:");
+ stream.endOfLine();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ fqCsid.displayFqCsidIe_v(data.sgwFqCsid, stream);
+
+ }
+ if (data.sgwLdnIePresent)
+ {
+
+
+ stream.add((char *)"IE - sgwLdn:");
+ stream.endOfLine();
+ LocalDistinguishedNameIe localDistinguishedName=
+ dynamic_cast<
+ LocalDistinguishedNameIe&>(GtpV2IeFactory::getInstance().getIeObject(LocalDistinguishedNameIeType));
+ localDistinguishedName.displayLocalDistinguishedNameIe_v(data.sgwLdn, stream);
+
+ }
+ if (data.pgwLdnIePresent)
+ {
+
+
+ stream.add((char *)"IE - pgwLdn:");
+ stream.endOfLine();
+ LocalDistinguishedNameIe localDistinguishedName=
+ dynamic_cast<
+ LocalDistinguishedNameIe&>(GtpV2IeFactory::getInstance().getIeObject(LocalDistinguishedNameIeType));
+ localDistinguishedName.displayLocalDistinguishedNameIe_v(data.pgwLdn, stream);
+
+ }
+ if (data.pgwBackOffTimeIePresent)
+ {
+
+
+ stream.add((char *)"IE - pgwBackOffTime:");
+ stream.endOfLine();
+ EpcTimerIe epcTimer=
+ dynamic_cast<
+ EpcTimerIe&>(GtpV2IeFactory::getInstance().getIeObject(EpcTimerIeType));
+ epcTimer.displayEpcTimerIe_v(data.pgwBackOffTime, stream);
+
+ }
+ if (data.hNbInformationReportingIePresent)
+ {
+
+
+ stream.add((char *)"IE - hNbInformationReporting:");
+ stream.endOfLine();
+ HenbInformationReportingIe henbInformationReporting=
+ dynamic_cast<
+ HenbInformationReportingIe&>(GtpV2IeFactory::getInstance().getIeObject(HenbInformationReportingIeType));
+ henbInformationReporting.displayHenbInformationReportingIe_v(data.hNbInformationReporting, stream);
+
+ }
+ if (data.pgwS5S8S2bFTeidIePresent)
+ {
+
+
+ stream.add((char *)"IE - pgwS5S8S2bFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.pgwS5S8S2bFTeid, stream);
+
+ }
+ if (data.pdnAddressAllocationIePresent)
+ {
+
+
+ stream.add((char *)"IE - pdnAddressAllocation:");
+ stream.endOfLine();
+ PaaIe paa=
+ dynamic_cast<
+ PaaIe&>(GtpV2IeFactory::getInstance().getIeObject(PaaIeType));
+ paa.displayPaaIe_v(data.pdnAddressAllocation, stream);
+
+ }
+ if (data.protocolConfigurationOptionsIePresent)
+ {
+
+
+ stream.add((char *)"IE - protocolConfigurationOptions:");
+ stream.endOfLine();
+ PcoIe pco=
+ dynamic_cast<
+ PcoIe&>(GtpV2IeFactory::getInstance().getIeObject(PcoIeType));
+ pco.displayPcoIe_v(data.protocolConfigurationOptions, stream);
+
+ }
+ if (data.additionalProtocolConfigurationOptionsIePresent)
+ {
+
+
+ stream.add((char *)"IE - additionalProtocolConfigurationOptions:");
+ stream.endOfLine();
+ AdditionalProtocolConfigurationOptionsIe additionalProtocolConfigurationOptions=
+ dynamic_cast<
+ AdditionalProtocolConfigurationOptionsIe&>(GtpV2IeFactory::getInstance().getIeObject(AdditionalProtocolConfigurationOptionsIeType));
+ additionalProtocolConfigurationOptions.displayAdditionalProtocolConfigurationOptionsIe_v(data.additionalProtocolConfigurationOptions, stream);
+
+ }
+ if (data.trustedWlanIpv4ParametersIePresent)
+ {
+
+
+ stream.add((char *)"IE - trustedWlanIpv4Parameters:");
+ stream.endOfLine();
+ Ip4cpIe ip4cp=
+ dynamic_cast<
+ Ip4cpIe&>(GtpV2IeFactory::getInstance().getIeObject(Ip4cpIeType));
+ ip4cp.displayIp4cpIe_v(data.trustedWlanIpv4Parameters, stream);
+
+ }
+ if (data.indicationFlagsIePresent)
+ {
+
+
+ stream.add((char *)"IE - indicationFlags:");
+ stream.endOfLine();
+ IndicationIe indication=
+ dynamic_cast<
+ IndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(IndicationIeType));
+ indication.displayIndicationIe_v(data.indicationFlags, stream);
+
+ }
+ if (data.presenceReportingAreaActionIePresent)
+ {
+
+
+ stream.add((char *)"IE - presenceReportingAreaAction:");
+ stream.endOfLine();
+ PresenceReportingAreaActionIe presenceReportingAreaAction=
+ dynamic_cast<
+ PresenceReportingAreaActionIe&>(GtpV2IeFactory::getInstance().getIeObject(PresenceReportingAreaActionIeType));
+ presenceReportingAreaAction.displayPresenceReportingAreaActionIe_v(data.presenceReportingAreaAction, stream);
+
+ }
+ if (data.pgwsNodeLevelLoadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - pgwsNodeLevelLoadControlInformation:");
+ stream.endOfLine();
+ LoadControlInformationIe loadControlInformation=
+ dynamic_cast<
+ LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType));
+ PgwsNodeLevelLoadControlInformationInCreateSessionResponse groupedIeInstance =
+ dynamic_cast<
+ PgwsNodeLevelLoadControlInformationInCreateSessionResponse&>(loadControlInformation.getGroupedIe(msgType, 0));
+ groupedIeInstance.displayPgwsNodeLevelLoadControlInformationInCreateSessionResponseData_v(data.pgwsNodeLevelLoadControlInformation, stream);
+
+ }
+ if (data.pgwsApnLevelLoadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - pgwsApnLevelLoadControlInformation:");
+ stream.endOfLine();
+ LoadControlInformationIe loadControlInformation=
+ dynamic_cast<
+ LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType));
+ PgwsApnLevelLoadControlInformationInCreateSessionResponse groupedIeInstance =
+ dynamic_cast<
+ PgwsApnLevelLoadControlInformationInCreateSessionResponse&>(loadControlInformation.getGroupedIe(msgType, 1));
+ groupedIeInstance.displayPgwsApnLevelLoadControlInformationInCreateSessionResponseData_v(data.pgwsApnLevelLoadControlInformation, stream);
+
+ }
+ if (data.sgwsNodeLevelLoadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - sgwsNodeLevelLoadControlInformation:");
+ stream.endOfLine();
+ LoadControlInformationIe loadControlInformation=
+ dynamic_cast<
+ LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType));
+ SgwsNodeLevelLoadControlInformationInCreateSessionResponse groupedIeInstance =
+ dynamic_cast<
+ SgwsNodeLevelLoadControlInformationInCreateSessionResponse&>(loadControlInformation.getGroupedIe(msgType, 2));
+ groupedIeInstance.displaySgwsNodeLevelLoadControlInformationInCreateSessionResponseData_v(data.sgwsNodeLevelLoadControlInformation, stream);
+
+ }
+ if (data.pgwsOverloadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - pgwsOverloadControlInformation:");
+ stream.endOfLine();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ PgwsOverloadControlInformationInCreateSessionResponse groupedIeInstance =
+ dynamic_cast<
+ PgwsOverloadControlInformationInCreateSessionResponse&>(overloadControlInformation.getGroupedIe(msgType, 0));
+ groupedIeInstance.displayPgwsOverloadControlInformationInCreateSessionResponseData_v(data.pgwsOverloadControlInformation, stream);
+
+ }
+ if (data.sgwsOverloadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - sgwsOverloadControlInformation:");
+ stream.endOfLine();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ SgwsOverloadControlInformationInCreateSessionResponse groupedIeInstance =
+ dynamic_cast<
+ SgwsOverloadControlInformationInCreateSessionResponse&>(overloadControlInformation.getGroupedIe(msgType, 1));
+ groupedIeInstance.displaySgwsOverloadControlInformationInCreateSessionResponseData_v(data.sgwsOverloadControlInformation, stream);
+
+ }
+ if (data.nbifomContainerIePresent)
+ {
+
+
+ stream.add((char *)"IE - nbifomContainer:");
+ stream.endOfLine();
+ FContainerIe fContainer=
+ dynamic_cast<
+ FContainerIe&>(GtpV2IeFactory::getInstance().getIeObject(FContainerIeType));
+ fContainer.displayFContainerIe_v(data.nbifomContainer, stream);
+
+ }
+ if (data.pdnConnectionChargingIdIePresent)
+ {
+
+
+ stream.add((char *)"IE - pdnConnectionChargingId:");
+ stream.endOfLine();
+ ChargingIdIe chargingId=
+ dynamic_cast<
+ ChargingIdIe&>(GtpV2IeFactory::getInstance().getIeObject(ChargingIdIeType));
+ chargingId.displayChargingIdIe_v(data.pdnConnectionChargingId, stream);
+
+ }
+ if (data.extendedProtocolConfigurationOptionsIePresent)
+ {
+
+
+ stream.add((char *)"IE - extendedProtocolConfigurationOptions:");
+ stream.endOfLine();
+ EpcoIe epco=
+ dynamic_cast<
+ EpcoIe&>(GtpV2IeFactory::getInstance().getIeObject(EpcoIeType));
+ epco.displayEpcoIe_v(data.extendedProtocolConfigurationOptions, stream);
+
+ }
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
diff --git a/src/gtpV2Codec/msgClasses/createSessionResponseMsg.h b/src/gtpV2Codec/msgClasses/createSessionResponseMsg.h
new file mode 100644
index 0000000..e394232
--- /dev/null
+++ b/src/gtpV2Codec/msgClasses/createSessionResponseMsg.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2019-present, Infosys Limited.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ /******************************************************************************
+ *
+ * This is an auto generated file.
+ * Please do not edit this file.
+ * All edits to be made through template source file
+ * <TOP-DIR/scripts/GtpV2StackCodeGen/tts/msgtemplate.h.tt>
+ ******************************************************************************/
+#ifndef CREATESESSIONRESPONSEMSG_H_
+#define CREATESESSIONRESPONSEMSG_H_
+
+#include <set>
+#include "manual/gtpV2Message.h"
+#include <msgBuffer.h>
+#include <debug.h>
+#include "gtpV2MsgDataTypes.h"
+
+
+class CreateSessionResponseMsg:public GtpV2Message
+{
+public:
+ CreateSessionResponseMsg();
+ virtual ~CreateSessionResponseMsg();
+ bool encodeCreateSessionResponseMsg(MsgBuffer &buffer, CreateSessionResponseMsgData const &data);
+
+ bool decodeCreateSessionResponseMsg (MsgBuffer &buffer, CreateSessionResponseMsgData& data, Uint16 length);
+
+ void displayCreateSessionResponseMsgData_v(CreateSessionResponseMsgData const &data, Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/msgClasses/deleteBearerRequestMsg.cpp b/src/gtpV2Codec/msgClasses/deleteBearerRequestMsg.cpp
new file mode 100644
index 0000000..3c8f0be
--- /dev/null
+++ b/src/gtpV2Codec/msgClasses/deleteBearerRequestMsg.cpp
@@ -0,0 +1,1215 @@
+/*
+ * Copyright 2019-present Infosys Limited
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+/******************************************************************************
+ *
+ * This is an auto generated file.
+ * Please do not edit this file.
+ * All edits to be made through template source file
+ * <TOP-DIR/scripts/GtpV2StackCodeGen/tts/msgtemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "deleteBearerRequestMsg.h"
+#include "../ieClasses/manual/gtpV2Ie.h"
+#include "../ieClasses/gtpV2IeFactory.h"
+#include "../ieClasses/ebiIe.h"
+#include "../ieClasses/ebiIe.h"
+#include "../ieClasses/bearerContextIe.h"
+#include "../ieClasses/failedBearerContextsInDeleteBearerRequest.h"
+#include "../ieClasses/ptiIe.h"
+#include "../ieClasses/pcoIe.h"
+#include "../ieClasses/fqCsidIe.h"
+#include "../ieClasses/fqCsidIe.h"
+#include "../ieClasses/causeIe.h"
+#include "../ieClasses/indicationIe.h"
+#include "../ieClasses/loadControlInformationIe.h"
+#include "../ieClasses/pgwsNodeLevelLoadControlInformationInDeleteBearerRequest.h"
+#include "../ieClasses/loadControlInformationIe.h"
+#include "../ieClasses/pgwsApnLevelLoadControlInformationInDeleteBearerRequest.h"
+#include "../ieClasses/loadControlInformationIe.h"
+#include "../ieClasses/sgwsNodeLevelLoadControlInformationInDeleteBearerRequest.h"
+#include "../ieClasses/overloadControlInformationIe.h"
+#include "../ieClasses/pgwsOverloadControlInformationInDeleteBearerRequest.h"
+#include "../ieClasses/overloadControlInformationIe.h"
+#include "../ieClasses/sgwsOverloadControlInformationInDeleteBearerRequest.h"
+#include "../ieClasses/fContainerIe.h"
+#include "../ieClasses/epcoIe.h"
+
+DeleteBearerRequestMsg::DeleteBearerRequestMsg()
+{
+ msgType = DeleteBearerRequestMsgType;
+
+}
+
+DeleteBearerRequestMsg::~DeleteBearerRequestMsg()
+{
+
+}
+
+bool DeleteBearerRequestMsg::encodeDeleteBearerRequestMsg(MsgBuffer &buffer,
+ DeleteBearerRequestMsgData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+ if (data.linkedEpsBearerIdIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = EbiIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ EbiIe ebi=
+ dynamic_cast<
+ EbiIe&>(GtpV2IeFactory::getInstance().getIeObject(EbiIeType));
+ rc = ebi.encodeEbiIe(buffer, data.linkedEpsBearerId);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: linkedEpsBearerId\n");
+ return false;
+ }
+ }
+
+ if (data.epsBearerIdsIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = EbiIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ EbiIe ebi=
+ dynamic_cast<
+ EbiIe&>(GtpV2IeFactory::getInstance().getIeObject(EbiIeType));
+ rc = ebi.encodeEbiIe(buffer, data.epsBearerIds);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: epsBearerIds\n");
+ return false;
+ }
+ }
+
+ // First validate if the applicatoin provided more than the expected cardinality
+ if (data.failedBearerContextsCount > 11)
+ {
+ errorStream.add((char *)"Number of entries of failedBearerContexts exceeded\n");
+ errorStream.add((char *)"Expected count: 11 Received count: ");
+ errorStream.add((char *)"data.failedBearerContextsCount");
+ errorStream.endOfLine();
+ return false;
+ }
+ for (Uint8 i = 0; i < data.failedBearerContextsCount; i++)
+ {
+ // Encode the Ie Header
+ header.ieType = BearerContextIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ BearerContextIe bearerContext=
+ dynamic_cast<
+ BearerContextIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(BearerContextIeType));
+ FailedBearerContextsInDeleteBearerRequest groupedIeInstance = dynamic_cast<FailedBearerContextsInDeleteBearerRequest&>(bearerContext.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.encodeFailedBearerContextsInDeleteBearerRequest(buffer, data.failedBearerContexts[i]);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ }
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: failedBearerContexts\n");
+ return false;
+ }
+
+ if (data.procedureTransactionIdIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = PtiIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ PtiIe pti=
+ dynamic_cast<
+ PtiIe&>(GtpV2IeFactory::getInstance().getIeObject(PtiIeType));
+ rc = pti.encodePtiIe(buffer, data.procedureTransactionId);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: procedureTransactionId\n");
+ return false;
+ }
+ }
+
+ if (data.protocolConfigurationOptionsIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = PcoIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ PcoIe pco=
+ dynamic_cast<
+ PcoIe&>(GtpV2IeFactory::getInstance().getIeObject(PcoIeType));
+ rc = pco.encodePcoIe(buffer, data.protocolConfigurationOptions);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: protocolConfigurationOptions\n");
+ return false;
+ }
+ }
+
+ if (data.pgwFqCsidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FqCsidIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ rc = fqCsid.encodeFqCsidIe(buffer, data.pgwFqCsid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: pgwFqCsid\n");
+ return false;
+ }
+ }
+
+ if (data.sgwFqCsidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FqCsidIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ rc = fqCsid.encodeFqCsidIe(buffer, data.sgwFqCsid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: sgwFqCsid\n");
+ return false;
+ }
+ }
+
+ if (data.causeIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = CauseIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ CauseIe cause=
+ dynamic_cast<
+ CauseIe&>(GtpV2IeFactory::getInstance().getIeObject(CauseIeType));
+ rc = cause.encodeCauseIe(buffer, data.cause);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: cause\n");
+ return false;
+ }
+ }
+
+ if (data.indicationFlagsIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = IndicationIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ IndicationIe indication=
+ dynamic_cast<
+ IndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(IndicationIeType));
+ rc = indication.encodeIndicationIe(buffer, data.indicationFlags);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: indicationFlags\n");
+ return false;
+ }
+ }
+
+ if (data.pgwsNodeLevelLoadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = LoadControlInformationIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ LoadControlInformationIe loadControlInformation=
+ dynamic_cast<
+ LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType));
+ PgwsNodeLevelLoadControlInformationInDeleteBearerRequest groupedIeInstance =
+ dynamic_cast<
+ PgwsNodeLevelLoadControlInformationInDeleteBearerRequest&>(loadControlInformation.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.encodePgwsNodeLevelLoadControlInformationInDeleteBearerRequest(buffer, data.pgwsNodeLevelLoadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: pgwsNodeLevelLoadControlInformation\n");
+ return false;
+ }
+ }
+
+ if (data.pgwsApnLevelLoadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = LoadControlInformationIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ LoadControlInformationIe loadControlInformation=
+ dynamic_cast<
+ LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType));
+ PgwsApnLevelLoadControlInformationInDeleteBearerRequest groupedIeInstance =
+ dynamic_cast<
+ PgwsApnLevelLoadControlInformationInDeleteBearerRequest&>(loadControlInformation.getGroupedIe(msgType, 1));
+ rc = groupedIeInstance.encodePgwsApnLevelLoadControlInformationInDeleteBearerRequest(buffer, data.pgwsApnLevelLoadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: pgwsApnLevelLoadControlInformation\n");
+ return false;
+ }
+ }
+
+ if (data.sgwsNodeLevelLoadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = LoadControlInformationIeType;
+ header.instance = 2;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ LoadControlInformationIe loadControlInformation=
+ dynamic_cast<
+ LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType));
+ SgwsNodeLevelLoadControlInformationInDeleteBearerRequest groupedIeInstance =
+ dynamic_cast<
+ SgwsNodeLevelLoadControlInformationInDeleteBearerRequest&>(loadControlInformation.getGroupedIe(msgType, 2));
+ rc = groupedIeInstance.encodeSgwsNodeLevelLoadControlInformationInDeleteBearerRequest(buffer, data.sgwsNodeLevelLoadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: sgwsNodeLevelLoadControlInformation\n");
+ return false;
+ }
+ }
+
+ if (data.pgwsOverloadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = OverloadControlInformationIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ PgwsOverloadControlInformationInDeleteBearerRequest groupedIeInstance =
+ dynamic_cast<
+ PgwsOverloadControlInformationInDeleteBearerRequest&>(overloadControlInformation.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.encodePgwsOverloadControlInformationInDeleteBearerRequest(buffer, data.pgwsOverloadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: pgwsOverloadControlInformation\n");
+ return false;
+ }
+ }
+
+ if (data.sgwsOverloadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = OverloadControlInformationIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ SgwsOverloadControlInformationInDeleteBearerRequest groupedIeInstance =
+ dynamic_cast<
+ SgwsOverloadControlInformationInDeleteBearerRequest&>(overloadControlInformation.getGroupedIe(msgType, 1));
+ rc = groupedIeInstance.encodeSgwsOverloadControlInformationInDeleteBearerRequest(buffer, data.sgwsOverloadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: sgwsOverloadControlInformation\n");
+ return false;
+ }
+ }
+
+ if (data.nbifomContainerIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FContainerIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ FContainerIe fContainer=
+ dynamic_cast<
+ FContainerIe&>(GtpV2IeFactory::getInstance().getIeObject(FContainerIeType));
+ rc = fContainer.encodeFContainerIe(buffer, data.nbifomContainer);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: nbifomContainer\n");
+ return false;
+ }
+ }
+
+ if (data.extendedProtocolConfigurationOptionsIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = EpcoIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ EpcoIe epco=
+ dynamic_cast<
+ EpcoIe&>(GtpV2IeFactory::getInstance().getIeObject(EpcoIeType));
+ rc = epco.encodeEpcoIe(buffer, data.extendedProtocolConfigurationOptions);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: extendedProtocolConfigurationOptions\n");
+ return false;
+ }
+ }
+ return rc;
+
+}
+
+bool DeleteBearerRequestMsg::decodeDeleteBearerRequestMsg(MsgBuffer &buffer,
+ DeleteBearerRequestMsgData
+ &data, Uint16 length)
+{
+
+ bool rc = false;
+ GtpV2IeHeader ieHeader;
+
+ set<Uint16> mandatoryIeLocalList = mandatoryIeSet;
+ while (buffer.lengthLeft() > IE_HEADER_SIZE)
+ {
+ GtpV2Ie::decodeGtpV2IeHeader(buffer, ieHeader);
+ if (ieHeader.length > buffer.lengthLeft())
+ {
+ // We do not have enough bytes left in the message for this IE
+ errorStream.add((char *)"IE Length exceeds beyond message boundary\n");
+ errorStream.add((char *)" Offending IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.add((char *)"\n Ie Length in Header: ");
+ errorStream.add(ieHeader.length);
+ errorStream.add((char *)"\n Bytes left in message: ");
+ errorStream.add(buffer.lengthLeft());
+ errorStream.endOfLine();
+ return false;
+ }
+
+ switch (ieHeader.ieType){
+
+ case EbiIeType:
+ {
+ EbiIe ieObject =
+ dynamic_cast<
+ EbiIe&>(GtpV2IeFactory::getInstance().getIeObject(EbiIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeEbiIe(buffer, data.linkedEpsBearerId, ieHeader.length);
+
+ data.linkedEpsBearerIdIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: linkedEpsBearerId\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ rc = ieObject.decodeEbiIe(buffer, data.epsBearerIds, ieHeader.length);
+
+ data.epsBearerIdsIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: epsBearerIds\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case BearerContextIeType:
+ {
+ BearerContextIe ieObject =
+ dynamic_cast<
+ BearerContextIe&>(GtpV2IeFactory::getInstance().getIeObject(BearerContextIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ // First check if we have enough space left to decode and store this instance
+ if (data.failedBearerContextsCount == 11)
+ {
+ errorStream.add((char *)"More than 11 instances of failedBearerContexts received\n");
+ return false;
+ }
+ FailedBearerContextsInDeleteBearerRequest groupedIeInstance =
+ dynamic_cast<
+ FailedBearerContextsInDeleteBearerRequest&>(ieObject.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.decodeFailedBearerContextsInDeleteBearerRequest(buffer,
+ data.failedBearerContexts[data.failedBearerContextsCount], ieHeader.length);
+ data.failedBearerContextsCount++; // TODO Count validation
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: failedBearerContexts\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case PtiIeType:
+ {
+ PtiIe ieObject =
+ dynamic_cast<
+ PtiIe&>(GtpV2IeFactory::getInstance().getIeObject(PtiIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodePtiIe(buffer, data.procedureTransactionId, ieHeader.length);
+
+ data.procedureTransactionIdIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: procedureTransactionId\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case PcoIeType:
+ {
+ PcoIe ieObject =
+ dynamic_cast<
+ PcoIe&>(GtpV2IeFactory::getInstance().getIeObject(PcoIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodePcoIe(buffer, data.protocolConfigurationOptions, ieHeader.length);
+
+ data.protocolConfigurationOptionsIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: protocolConfigurationOptions\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case FqCsidIeType:
+ {
+ FqCsidIe ieObject =
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeFqCsidIe(buffer, data.pgwFqCsid, ieHeader.length);
+
+ data.pgwFqCsidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: pgwFqCsid\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ rc = ieObject.decodeFqCsidIe(buffer, data.sgwFqCsid, ieHeader.length);
+
+ data.sgwFqCsidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: sgwFqCsid\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case CauseIeType:
+ {
+ CauseIe ieObject =
+ dynamic_cast<
+ CauseIe&>(GtpV2IeFactory::getInstance().getIeObject(CauseIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeCauseIe(buffer, data.cause, ieHeader.length);
+
+ data.causeIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: cause\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case IndicationIeType:
+ {
+ IndicationIe ieObject =
+ dynamic_cast<
+ IndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(IndicationIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeIndicationIe(buffer, data.indicationFlags, ieHeader.length);
+
+ data.indicationFlagsIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: indicationFlags\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case LoadControlInformationIeType:
+ {
+ LoadControlInformationIe ieObject =
+ dynamic_cast<
+ LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ PgwsNodeLevelLoadControlInformationInDeleteBearerRequest groupedIeInstance =
+ dynamic_cast<
+ PgwsNodeLevelLoadControlInformationInDeleteBearerRequest&>(ieObject.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.decodePgwsNodeLevelLoadControlInformationInDeleteBearerRequest(buffer, data.pgwsNodeLevelLoadControlInformation, ieHeader.length);
+
+ data.pgwsNodeLevelLoadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: pgwsNodeLevelLoadControlInformation\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ PgwsApnLevelLoadControlInformationInDeleteBearerRequest groupedIeInstance =
+ dynamic_cast<
+ PgwsApnLevelLoadControlInformationInDeleteBearerRequest&>(ieObject.getGroupedIe(msgType, 1));
+ rc = groupedIeInstance.decodePgwsApnLevelLoadControlInformationInDeleteBearerRequest(buffer, data.pgwsApnLevelLoadControlInformation, ieHeader.length);
+
+ data.pgwsApnLevelLoadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: pgwsApnLevelLoadControlInformation\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 2)
+ {
+ SgwsNodeLevelLoadControlInformationInDeleteBearerRequest groupedIeInstance =
+ dynamic_cast<
+ SgwsNodeLevelLoadControlInformationInDeleteBearerRequest&>(ieObject.getGroupedIe(msgType, 2));
+ rc = groupedIeInstance.decodeSgwsNodeLevelLoadControlInformationInDeleteBearerRequest(buffer, data.sgwsNodeLevelLoadControlInformation, ieHeader.length);
+
+ data.sgwsNodeLevelLoadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: sgwsNodeLevelLoadControlInformation\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case OverloadControlInformationIeType:
+ {
+ OverloadControlInformationIe ieObject =
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ PgwsOverloadControlInformationInDeleteBearerRequest groupedIeInstance =
+ dynamic_cast<
+ PgwsOverloadControlInformationInDeleteBearerRequest&>(ieObject.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.decodePgwsOverloadControlInformationInDeleteBearerRequest(buffer, data.pgwsOverloadControlInformation, ieHeader.length);
+
+ data.pgwsOverloadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: pgwsOverloadControlInformation\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ SgwsOverloadControlInformationInDeleteBearerRequest groupedIeInstance =
+ dynamic_cast<
+ SgwsOverloadControlInformationInDeleteBearerRequest&>(ieObject.getGroupedIe(msgType, 1));
+ rc = groupedIeInstance.decodeSgwsOverloadControlInformationInDeleteBearerRequest(buffer, data.sgwsOverloadControlInformation, ieHeader.length);
+
+ data.sgwsOverloadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: sgwsOverloadControlInformation\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case FContainerIeType:
+ {
+ FContainerIe ieObject =
+ dynamic_cast<
+ FContainerIe&>(GtpV2IeFactory::getInstance().getIeObject(FContainerIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeFContainerIe(buffer, data.nbifomContainer, ieHeader.length);
+
+ data.nbifomContainerIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: nbifomContainer\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case EpcoIeType:
+ {
+ EpcoIe ieObject =
+ dynamic_cast<
+ EpcoIe&>(GtpV2IeFactory::getInstance().getIeObject(EpcoIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeEpcoIe(buffer, data.extendedProtocolConfigurationOptions, ieHeader.length);
+
+ data.extendedProtocolConfigurationOptionsIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: extendedProtocolConfigurationOptions\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ default:
+ {
+ // Unknown IE print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ }
+ }
+ return rc; // TODO validations
+}
+
+void DeleteBearerRequestMsg::
+displayDeleteBearerRequestMsgData_v(DeleteBearerRequestMsgData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"DeleteBearerRequestMsg:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+ if (data.linkedEpsBearerIdIePresent)
+ {
+
+
+ stream.add((char *)"IE - linkedEpsBearerId:");
+ stream.endOfLine();
+ EbiIe ebi=
+ dynamic_cast<
+ EbiIe&>(GtpV2IeFactory::getInstance().getIeObject(EbiIeType));
+ ebi.displayEbiIe_v(data.linkedEpsBearerId, stream);
+
+ }
+ if (data.epsBearerIdsIePresent)
+ {
+
+
+ stream.add((char *)"IE - epsBearerIds:");
+ stream.endOfLine();
+ EbiIe ebi=
+ dynamic_cast<
+ EbiIe&>(GtpV2IeFactory::getInstance().getIeObject(EbiIeType));
+ ebi.displayEbiIe_v(data.epsBearerIds, stream);
+
+ }
+
+ Uint8 displayCount;
+
+ displayCount = data.failedBearerContextsCount;
+ if (displayCount > 11)
+ {
+ stream.add((char *)"Invalid data more than 11 instances");
+ stream.endOfLine();
+ stream.add((char *)"Displaying only 11");
+ stream.endOfLine();
+ displayCount = 11;
+ }
+ for (Uint8 i = 0; i < displayCount; i++)
+ {
+ stream.add((char *)"IE - failedBearerContexts:");
+ stream.endOfLine();
+ BearerContextIe bearerContext=
+ dynamic_cast<
+ BearerContextIe&>(GtpV2IeFactory::getInstance().getIeObject(BearerContextIeType));
+ FailedBearerContextsInDeleteBearerRequest groupedIeInstance =
+ dynamic_cast<
+ FailedBearerContextsInDeleteBearerRequest&>(bearerContext.getGroupedIe(msgType, 0));
+ groupedIeInstance.displayFailedBearerContextsInDeleteBearerRequestData_v(data.failedBearerContexts[i], stream);
+ }
+
+
+
+
+ if (data.procedureTransactionIdIePresent)
+ {
+
+
+ stream.add((char *)"IE - procedureTransactionId:");
+ stream.endOfLine();
+ PtiIe pti=
+ dynamic_cast<
+ PtiIe&>(GtpV2IeFactory::getInstance().getIeObject(PtiIeType));
+ pti.displayPtiIe_v(data.procedureTransactionId, stream);
+
+ }
+ if (data.protocolConfigurationOptionsIePresent)
+ {
+
+
+ stream.add((char *)"IE - protocolConfigurationOptions:");
+ stream.endOfLine();
+ PcoIe pco=
+ dynamic_cast<
+ PcoIe&>(GtpV2IeFactory::getInstance().getIeObject(PcoIeType));
+ pco.displayPcoIe_v(data.protocolConfigurationOptions, stream);
+
+ }
+ if (data.pgwFqCsidIePresent)
+ {
+
+
+ stream.add((char *)"IE - pgwFqCsid:");
+ stream.endOfLine();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ fqCsid.displayFqCsidIe_v(data.pgwFqCsid, stream);
+
+ }
+ if (data.sgwFqCsidIePresent)
+ {
+
+
+ stream.add((char *)"IE - sgwFqCsid:");
+ stream.endOfLine();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ fqCsid.displayFqCsidIe_v(data.sgwFqCsid, stream);
+
+ }
+ if (data.causeIePresent)
+ {
+
+
+ stream.add((char *)"IE - cause:");
+ stream.endOfLine();
+ CauseIe cause=
+ dynamic_cast<
+ CauseIe&>(GtpV2IeFactory::getInstance().getIeObject(CauseIeType));
+ cause.displayCauseIe_v(data.cause, stream);
+
+ }
+ if (data.indicationFlagsIePresent)
+ {
+
+
+ stream.add((char *)"IE - indicationFlags:");
+ stream.endOfLine();
+ IndicationIe indication=
+ dynamic_cast<
+ IndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(IndicationIeType));
+ indication.displayIndicationIe_v(data.indicationFlags, stream);
+
+ }
+ if (data.pgwsNodeLevelLoadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - pgwsNodeLevelLoadControlInformation:");
+ stream.endOfLine();
+ LoadControlInformationIe loadControlInformation=
+ dynamic_cast<
+ LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType));
+ PgwsNodeLevelLoadControlInformationInDeleteBearerRequest groupedIeInstance =
+ dynamic_cast<
+ PgwsNodeLevelLoadControlInformationInDeleteBearerRequest&>(loadControlInformation.getGroupedIe(msgType, 0));
+ groupedIeInstance.displayPgwsNodeLevelLoadControlInformationInDeleteBearerRequestData_v(data.pgwsNodeLevelLoadControlInformation, stream);
+
+ }
+ if (data.pgwsApnLevelLoadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - pgwsApnLevelLoadControlInformation:");
+ stream.endOfLine();
+ LoadControlInformationIe loadControlInformation=
+ dynamic_cast<
+ LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType));
+ PgwsApnLevelLoadControlInformationInDeleteBearerRequest groupedIeInstance =
+ dynamic_cast<
+ PgwsApnLevelLoadControlInformationInDeleteBearerRequest&>(loadControlInformation.getGroupedIe(msgType, 1));
+ groupedIeInstance.displayPgwsApnLevelLoadControlInformationInDeleteBearerRequestData_v(data.pgwsApnLevelLoadControlInformation, stream);
+
+ }
+ if (data.sgwsNodeLevelLoadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - sgwsNodeLevelLoadControlInformation:");
+ stream.endOfLine();
+ LoadControlInformationIe loadControlInformation=
+ dynamic_cast<
+ LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType));
+ SgwsNodeLevelLoadControlInformationInDeleteBearerRequest groupedIeInstance =
+ dynamic_cast<
+ SgwsNodeLevelLoadControlInformationInDeleteBearerRequest&>(loadControlInformation.getGroupedIe(msgType, 2));
+ groupedIeInstance.displaySgwsNodeLevelLoadControlInformationInDeleteBearerRequestData_v(data.sgwsNodeLevelLoadControlInformation, stream);
+
+ }
+ if (data.pgwsOverloadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - pgwsOverloadControlInformation:");
+ stream.endOfLine();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ PgwsOverloadControlInformationInDeleteBearerRequest groupedIeInstance =
+ dynamic_cast<
+ PgwsOverloadControlInformationInDeleteBearerRequest&>(overloadControlInformation.getGroupedIe(msgType, 0));
+ groupedIeInstance.displayPgwsOverloadControlInformationInDeleteBearerRequestData_v(data.pgwsOverloadControlInformation, stream);
+
+ }
+ if (data.sgwsOverloadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - sgwsOverloadControlInformation:");
+ stream.endOfLine();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ SgwsOverloadControlInformationInDeleteBearerRequest groupedIeInstance =
+ dynamic_cast<
+ SgwsOverloadControlInformationInDeleteBearerRequest&>(overloadControlInformation.getGroupedIe(msgType, 1));
+ groupedIeInstance.displaySgwsOverloadControlInformationInDeleteBearerRequestData_v(data.sgwsOverloadControlInformation, stream);
+
+ }
+ if (data.nbifomContainerIePresent)
+ {
+
+
+ stream.add((char *)"IE - nbifomContainer:");
+ stream.endOfLine();
+ FContainerIe fContainer=
+ dynamic_cast<
+ FContainerIe&>(GtpV2IeFactory::getInstance().getIeObject(FContainerIeType));
+ fContainer.displayFContainerIe_v(data.nbifomContainer, stream);
+
+ }
+ if (data.extendedProtocolConfigurationOptionsIePresent)
+ {
+
+
+ stream.add((char *)"IE - extendedProtocolConfigurationOptions:");
+ stream.endOfLine();
+ EpcoIe epco=
+ dynamic_cast<
+ EpcoIe&>(GtpV2IeFactory::getInstance().getIeObject(EpcoIeType));
+ epco.displayEpcoIe_v(data.extendedProtocolConfigurationOptions, stream);
+
+ }
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
diff --git a/src/gtpV2Codec/msgClasses/deleteBearerRequestMsg.h b/src/gtpV2Codec/msgClasses/deleteBearerRequestMsg.h
new file mode 100644
index 0000000..799255d
--- /dev/null
+++ b/src/gtpV2Codec/msgClasses/deleteBearerRequestMsg.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2019-present, Infosys Limited.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ /******************************************************************************
+ *
+ * This is an auto generated file.
+ * Please do not edit this file.
+ * All edits to be made through template source file
+ * <TOP-DIR/scripts/GtpV2StackCodeGen/tts/msgtemplate.h.tt>
+ ******************************************************************************/
+#ifndef DELETEBEARERREQUESTMSG_H_
+#define DELETEBEARERREQUESTMSG_H_
+
+#include <set>
+#include "manual/gtpV2Message.h"
+#include <msgBuffer.h>
+#include <debug.h>
+#include "gtpV2MsgDataTypes.h"
+
+
+class DeleteBearerRequestMsg:public GtpV2Message
+{
+public:
+ DeleteBearerRequestMsg();
+ virtual ~DeleteBearerRequestMsg();
+ bool encodeDeleteBearerRequestMsg(MsgBuffer &buffer, DeleteBearerRequestMsgData const &data);
+
+ bool decodeDeleteBearerRequestMsg (MsgBuffer &buffer, DeleteBearerRequestMsgData& data, Uint16 length);
+
+ void displayDeleteBearerRequestMsgData_v(DeleteBearerRequestMsgData const &data, Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/msgClasses/deleteBearerResponseMsg.cpp b/src/gtpV2Codec/msgClasses/deleteBearerResponseMsg.cpp
new file mode 100644
index 0000000..873b4a2
--- /dev/null
+++ b/src/gtpV2Codec/msgClasses/deleteBearerResponseMsg.cpp
@@ -0,0 +1,1747 @@
+/*
+ * Copyright 2019-present Infosys Limited
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+/******************************************************************************
+ *
+ * This is an auto generated file.
+ * Please do not edit this file.
+ * All edits to be made through template source file
+ * <TOP-DIR/scripts/GtpV2StackCodeGen/tts/msgtemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "deleteBearerResponseMsg.h"
+#include "../ieClasses/manual/gtpV2Ie.h"
+#include "../ieClasses/gtpV2IeFactory.h"
+#include "../ieClasses/causeIe.h"
+#include "../ieClasses/ebiIe.h"
+#include "../ieClasses/bearerContextIe.h"
+#include "../ieClasses/bearerContextsInDeleteBearerResponse.h"
+#include "../ieClasses/recoveryIe.h"
+#include "../ieClasses/fqCsidIe.h"
+#include "../ieClasses/fqCsidIe.h"
+#include "../ieClasses/fqCsidIe.h"
+#include "../ieClasses/fqCsidIe.h"
+#include "../ieClasses/pcoIe.h"
+#include "../ieClasses/ueTimeZoneIe.h"
+#include "../ieClasses/uliIe.h"
+#include "../ieClasses/uliTimestampIe.h"
+#include "../ieClasses/twanIdentifierIe.h"
+#include "../ieClasses/twanIdentifierTimestampIe.h"
+#include "../ieClasses/overloadControlInformationIe.h"
+#include "../ieClasses/mmeS4SgsnsOverloadControlInformationInDeleteBearerResponse.h"
+#include "../ieClasses/overloadControlInformationIe.h"
+#include "../ieClasses/sgwsOverloadControlInformationInDeleteBearerResponse.h"
+#include "../ieClasses/ipAddressIe.h"
+#include "../ieClasses/overloadControlInformationIe.h"
+#include "../ieClasses/twanEpdgsOverloadControlInformationInDeleteBearerResponse.h"
+#include "../ieClasses/twanIdentifierIe.h"
+#include "../ieClasses/twanIdentifierTimestampIe.h"
+#include "../ieClasses/ipAddressIe.h"
+#include "../ieClasses/portNumberIe.h"
+#include "../ieClasses/fContainerIe.h"
+#include "../ieClasses/portNumberIe.h"
+#include "../ieClasses/secondaryRatUsageDataReportIe.h"
+
+DeleteBearerResponseMsg::DeleteBearerResponseMsg()
+{
+ msgType = DeleteBearerResponseMsgType;
+ Uint16 mandIe;
+ mandIe = CauseIeType;
+ mandIe = (mandIe << 8) | 0; // cause
+ mandatoryIeSet.insert(mandIe);
+}
+
+DeleteBearerResponseMsg::~DeleteBearerResponseMsg()
+{
+
+}
+
+bool DeleteBearerResponseMsg::encodeDeleteBearerResponseMsg(MsgBuffer &buffer,
+ DeleteBearerResponseMsgData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+ // Encode the Ie Header
+ header.ieType = CauseIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ CauseIe cause=
+ dynamic_cast<
+ CauseIe&>(GtpV2IeFactory::getInstance().getIeObject(CauseIeType));
+ rc = cause.encodeCauseIe(buffer, data.cause);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: cause\n");
+ return false;
+ }
+
+ if (data.linkedEpsBearerIdIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = EbiIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ EbiIe ebi=
+ dynamic_cast<
+ EbiIe&>(GtpV2IeFactory::getInstance().getIeObject(EbiIeType));
+ rc = ebi.encodeEbiIe(buffer, data.linkedEpsBearerId);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: linkedEpsBearerId\n");
+ return false;
+ }
+ }
+
+ // First validate if the applicatoin provided more than the expected cardinality
+ if (data.bearerContextsCount > 11)
+ {
+ errorStream.add((char *)"Number of entries of bearerContexts exceeded\n");
+ errorStream.add((char *)"Expected count: 11 Received count: ");
+ errorStream.add((char *)"data.bearerContextsCount");
+ errorStream.endOfLine();
+ return false;
+ }
+ for (Uint8 i = 0; i < data.bearerContextsCount; i++)
+ {
+ // Encode the Ie Header
+ header.ieType = BearerContextIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ BearerContextIe bearerContext=
+ dynamic_cast<
+ BearerContextIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(BearerContextIeType));
+ BearerContextsInDeleteBearerResponse groupedIeInstance = dynamic_cast<BearerContextsInDeleteBearerResponse&>(bearerContext.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.encodeBearerContextsInDeleteBearerResponse(buffer, data.bearerContexts[i]);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ }
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: bearerContexts\n");
+ return false;
+ }
+
+ if (data.recoveryIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = RecoveryIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ RecoveryIe recovery=
+ dynamic_cast<
+ RecoveryIe&>(GtpV2IeFactory::getInstance().getIeObject(RecoveryIeType));
+ rc = recovery.encodeRecoveryIe(buffer, data.recovery);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: recovery\n");
+ return false;
+ }
+ }
+
+ if (data.mmeFqCsidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FqCsidIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ rc = fqCsid.encodeFqCsidIe(buffer, data.mmeFqCsid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: mmeFqCsid\n");
+ return false;
+ }
+ }
+
+ if (data.sgwFqCsidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FqCsidIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ rc = fqCsid.encodeFqCsidIe(buffer, data.sgwFqCsid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: sgwFqCsid\n");
+ return false;
+ }
+ }
+
+ if (data.epdgFqCsidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FqCsidIeType;
+ header.instance = 2;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ rc = fqCsid.encodeFqCsidIe(buffer, data.epdgFqCsid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: epdgFqCsid\n");
+ return false;
+ }
+ }
+
+ if (data.twanFqCsidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FqCsidIeType;
+ header.instance = 3;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ rc = fqCsid.encodeFqCsidIe(buffer, data.twanFqCsid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: twanFqCsid\n");
+ return false;
+ }
+ }
+
+ if (data.protocolConfigurationOptionsIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = PcoIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ PcoIe pco=
+ dynamic_cast<
+ PcoIe&>(GtpV2IeFactory::getInstance().getIeObject(PcoIeType));
+ rc = pco.encodePcoIe(buffer, data.protocolConfigurationOptions);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: protocolConfigurationOptions\n");
+ return false;
+ }
+ }
+
+ if (data.ueTimeZoneIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = UeTimeZoneIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ UeTimeZoneIe ueTimeZone=
+ dynamic_cast<
+ UeTimeZoneIe&>(GtpV2IeFactory::getInstance().getIeObject(UeTimeZoneIeType));
+ rc = ueTimeZone.encodeUeTimeZoneIe(buffer, data.ueTimeZone);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: ueTimeZone\n");
+ return false;
+ }
+ }
+
+ if (data.userLocationInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = UliIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ UliIe uli=
+ dynamic_cast<
+ UliIe&>(GtpV2IeFactory::getInstance().getIeObject(UliIeType));
+ rc = uli.encodeUliIe(buffer, data.userLocationInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: userLocationInformation\n");
+ return false;
+ }
+ }
+
+ if (data.uliTimestampIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = UliTimestampIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ UliTimestampIe uliTimestamp=
+ dynamic_cast<
+ UliTimestampIe&>(GtpV2IeFactory::getInstance().getIeObject(UliTimestampIeType));
+ rc = uliTimestamp.encodeUliTimestampIe(buffer, data.uliTimestamp);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: uliTimestamp\n");
+ return false;
+ }
+ }
+
+ if (data.twanIdentifierIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = TwanIdentifierIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ TwanIdentifierIe twanIdentifier=
+ dynamic_cast<
+ TwanIdentifierIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierIeType));
+ rc = twanIdentifier.encodeTwanIdentifierIe(buffer, data.twanIdentifier);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: twanIdentifier\n");
+ return false;
+ }
+ }
+
+ if (data.twanIdentifierTimestampIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = TwanIdentifierTimestampIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ TwanIdentifierTimestampIe twanIdentifierTimestamp=
+ dynamic_cast<
+ TwanIdentifierTimestampIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierTimestampIeType));
+ rc = twanIdentifierTimestamp.encodeTwanIdentifierTimestampIe(buffer, data.twanIdentifierTimestamp);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: twanIdentifierTimestamp\n");
+ return false;
+ }
+ }
+
+ if (data.mmeS4SgsnsOverloadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = OverloadControlInformationIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ MmeS4SgsnsOverloadControlInformationInDeleteBearerResponse groupedIeInstance =
+ dynamic_cast<
+ MmeS4SgsnsOverloadControlInformationInDeleteBearerResponse&>(overloadControlInformation.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.encodeMmeS4SgsnsOverloadControlInformationInDeleteBearerResponse(buffer, data.mmeS4SgsnsOverloadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: mmeS4SgsnsOverloadControlInformation\n");
+ return false;
+ }
+ }
+
+ if (data.sgwsOverloadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = OverloadControlInformationIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ SgwsOverloadControlInformationInDeleteBearerResponse groupedIeInstance =
+ dynamic_cast<
+ SgwsOverloadControlInformationInDeleteBearerResponse&>(overloadControlInformation.getGroupedIe(msgType, 1));
+ rc = groupedIeInstance.encodeSgwsOverloadControlInformationInDeleteBearerResponse(buffer, data.sgwsOverloadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: sgwsOverloadControlInformation\n");
+ return false;
+ }
+ }
+
+ if (data.mmeS4SgsnIdentifierIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = IpAddressIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ IpAddressIe ipAddress=
+ dynamic_cast<
+ IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
+ rc = ipAddress.encodeIpAddressIe(buffer, data.mmeS4SgsnIdentifier);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: mmeS4SgsnIdentifier\n");
+ return false;
+ }
+ }
+
+ if (data.twanEpdgsOverloadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = OverloadControlInformationIeType;
+ header.instance = 2;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ TwanEpdgsOverloadControlInformationInDeleteBearerResponse groupedIeInstance =
+ dynamic_cast<
+ TwanEpdgsOverloadControlInformationInDeleteBearerResponse&>(overloadControlInformation.getGroupedIe(msgType, 2));
+ rc = groupedIeInstance.encodeTwanEpdgsOverloadControlInformationInDeleteBearerResponse(buffer, data.twanEpdgsOverloadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: twanEpdgsOverloadControlInformation\n");
+ return false;
+ }
+ }
+
+ if (data.wlanLocationInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = TwanIdentifierIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ TwanIdentifierIe twanIdentifier=
+ dynamic_cast<
+ TwanIdentifierIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierIeType));
+ rc = twanIdentifier.encodeTwanIdentifierIe(buffer, data.wlanLocationInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: wlanLocationInformation\n");
+ return false;
+ }
+ }
+
+ if (data.wlanLocationTimestampIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = TwanIdentifierTimestampIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ TwanIdentifierTimestampIe twanIdentifierTimestamp=
+ dynamic_cast<
+ TwanIdentifierTimestampIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierTimestampIeType));
+ rc = twanIdentifierTimestamp.encodeTwanIdentifierTimestampIe(buffer, data.wlanLocationTimestamp);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: wlanLocationTimestamp\n");
+ return false;
+ }
+ }
+
+ if (data.ueLocalIpAddressIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = IpAddressIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ IpAddressIe ipAddress=
+ dynamic_cast<
+ IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
+ rc = ipAddress.encodeIpAddressIe(buffer, data.ueLocalIpAddress);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: ueLocalIpAddress\n");
+ return false;
+ }
+ }
+
+ if (data.ueUdpPortIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = PortNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ PortNumberIe portNumber=
+ dynamic_cast<
+ PortNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(PortNumberIeType));
+ rc = portNumber.encodePortNumberIe(buffer, data.ueUdpPort);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: ueUdpPort\n");
+ return false;
+ }
+ }
+
+ if (data.nbifomContainerIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FContainerIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ FContainerIe fContainer=
+ dynamic_cast<
+ FContainerIe&>(GtpV2IeFactory::getInstance().getIeObject(FContainerIeType));
+ rc = fContainer.encodeFContainerIe(buffer, data.nbifomContainer);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: nbifomContainer\n");
+ return false;
+ }
+ }
+
+ if (data.ueTcpPortIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = PortNumberIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ PortNumberIe portNumber=
+ dynamic_cast<
+ PortNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(PortNumberIeType));
+ rc = portNumber.encodePortNumberIe(buffer, data.ueTcpPort);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: ueTcpPort\n");
+ return false;
+ }
+ }
+
+ if (data.secondaryRatUsageDataReportIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = SecondaryRatUsageDataReportIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SecondaryRatUsageDataReportIe secondaryRatUsageDataReport=
+ dynamic_cast<
+ SecondaryRatUsageDataReportIe&>(GtpV2IeFactory::getInstance().getIeObject(SecondaryRatUsageDataReportIeType));
+ rc = secondaryRatUsageDataReport.encodeSecondaryRatUsageDataReportIe(buffer, data.secondaryRatUsageDataReport);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: secondaryRatUsageDataReport\n");
+ return false;
+ }
+ }
+ return rc;
+
+}
+
+bool DeleteBearerResponseMsg::decodeDeleteBearerResponseMsg(MsgBuffer &buffer,
+ DeleteBearerResponseMsgData
+ &data, Uint16 length)
+{
+
+ bool rc = false;
+ GtpV2IeHeader ieHeader;
+
+ set<Uint16> mandatoryIeLocalList = mandatoryIeSet;
+ while (buffer.lengthLeft() > IE_HEADER_SIZE)
+ {
+ GtpV2Ie::decodeGtpV2IeHeader(buffer, ieHeader);
+ if (ieHeader.length > buffer.lengthLeft())
+ {
+ // We do not have enough bytes left in the message for this IE
+ errorStream.add((char *)"IE Length exceeds beyond message boundary\n");
+ errorStream.add((char *)" Offending IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.add((char *)"\n Ie Length in Header: ");
+ errorStream.add(ieHeader.length);
+ errorStream.add((char *)"\n Bytes left in message: ");
+ errorStream.add(buffer.lengthLeft());
+ errorStream.endOfLine();
+ return false;
+ }
+
+ switch (ieHeader.ieType){
+
+ case CauseIeType:
+ {
+ CauseIe ieObject =
+ dynamic_cast<
+ CauseIe&>(GtpV2IeFactory::getInstance().getIeObject(CauseIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeCauseIe(buffer, data.cause, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: cause\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case EbiIeType:
+ {
+ EbiIe ieObject =
+ dynamic_cast<
+ EbiIe&>(GtpV2IeFactory::getInstance().getIeObject(EbiIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeEbiIe(buffer, data.linkedEpsBearerId, ieHeader.length);
+
+ data.linkedEpsBearerIdIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: linkedEpsBearerId\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case BearerContextIeType:
+ {
+ BearerContextIe ieObject =
+ dynamic_cast<
+ BearerContextIe&>(GtpV2IeFactory::getInstance().getIeObject(BearerContextIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ // First check if we have enough space left to decode and store this instance
+ if (data.bearerContextsCount == 11)
+ {
+ errorStream.add((char *)"More than 11 instances of bearerContexts received\n");
+ return false;
+ }
+ BearerContextsInDeleteBearerResponse groupedIeInstance =
+ dynamic_cast<
+ BearerContextsInDeleteBearerResponse&>(ieObject.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.decodeBearerContextsInDeleteBearerResponse(buffer,
+ data.bearerContexts[data.bearerContextsCount], ieHeader.length);
+ data.bearerContextsCount++; // TODO Count validation
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: bearerContexts\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case RecoveryIeType:
+ {
+ RecoveryIe ieObject =
+ dynamic_cast<
+ RecoveryIe&>(GtpV2IeFactory::getInstance().getIeObject(RecoveryIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeRecoveryIe(buffer, data.recovery, ieHeader.length);
+
+ data.recoveryIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: recovery\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case FqCsidIeType:
+ {
+ FqCsidIe ieObject =
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeFqCsidIe(buffer, data.mmeFqCsid, ieHeader.length);
+
+ data.mmeFqCsidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: mmeFqCsid\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ rc = ieObject.decodeFqCsidIe(buffer, data.sgwFqCsid, ieHeader.length);
+
+ data.sgwFqCsidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: sgwFqCsid\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 2)
+ {
+ rc = ieObject.decodeFqCsidIe(buffer, data.epdgFqCsid, ieHeader.length);
+
+ data.epdgFqCsidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: epdgFqCsid\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 3)
+ {
+ rc = ieObject.decodeFqCsidIe(buffer, data.twanFqCsid, ieHeader.length);
+
+ data.twanFqCsidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: twanFqCsid\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case PcoIeType:
+ {
+ PcoIe ieObject =
+ dynamic_cast<
+ PcoIe&>(GtpV2IeFactory::getInstance().getIeObject(PcoIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodePcoIe(buffer, data.protocolConfigurationOptions, ieHeader.length);
+
+ data.protocolConfigurationOptionsIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: protocolConfigurationOptions\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case UeTimeZoneIeType:
+ {
+ UeTimeZoneIe ieObject =
+ dynamic_cast<
+ UeTimeZoneIe&>(GtpV2IeFactory::getInstance().getIeObject(UeTimeZoneIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeUeTimeZoneIe(buffer, data.ueTimeZone, ieHeader.length);
+
+ data.ueTimeZoneIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: ueTimeZone\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case UliIeType:
+ {
+ UliIe ieObject =
+ dynamic_cast<
+ UliIe&>(GtpV2IeFactory::getInstance().getIeObject(UliIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeUliIe(buffer, data.userLocationInformation, ieHeader.length);
+
+ data.userLocationInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: userLocationInformation\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case UliTimestampIeType:
+ {
+ UliTimestampIe ieObject =
+ dynamic_cast<
+ UliTimestampIe&>(GtpV2IeFactory::getInstance().getIeObject(UliTimestampIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeUliTimestampIe(buffer, data.uliTimestamp, ieHeader.length);
+
+ data.uliTimestampIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: uliTimestamp\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case TwanIdentifierIeType:
+ {
+ TwanIdentifierIe ieObject =
+ dynamic_cast<
+ TwanIdentifierIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeTwanIdentifierIe(buffer, data.twanIdentifier, ieHeader.length);
+
+ data.twanIdentifierIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: twanIdentifier\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ rc = ieObject.decodeTwanIdentifierIe(buffer, data.wlanLocationInformation, ieHeader.length);
+
+ data.wlanLocationInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: wlanLocationInformation\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case TwanIdentifierTimestampIeType:
+ {
+ TwanIdentifierTimestampIe ieObject =
+ dynamic_cast<
+ TwanIdentifierTimestampIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierTimestampIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeTwanIdentifierTimestampIe(buffer, data.twanIdentifierTimestamp, ieHeader.length);
+
+ data.twanIdentifierTimestampIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: twanIdentifierTimestamp\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ rc = ieObject.decodeTwanIdentifierTimestampIe(buffer, data.wlanLocationTimestamp, ieHeader.length);
+
+ data.wlanLocationTimestampIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: wlanLocationTimestamp\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case OverloadControlInformationIeType:
+ {
+ OverloadControlInformationIe ieObject =
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ MmeS4SgsnsOverloadControlInformationInDeleteBearerResponse groupedIeInstance =
+ dynamic_cast<
+ MmeS4SgsnsOverloadControlInformationInDeleteBearerResponse&>(ieObject.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.decodeMmeS4SgsnsOverloadControlInformationInDeleteBearerResponse(buffer, data.mmeS4SgsnsOverloadControlInformation, ieHeader.length);
+
+ data.mmeS4SgsnsOverloadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: mmeS4SgsnsOverloadControlInformation\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ SgwsOverloadControlInformationInDeleteBearerResponse groupedIeInstance =
+ dynamic_cast<
+ SgwsOverloadControlInformationInDeleteBearerResponse&>(ieObject.getGroupedIe(msgType, 1));
+ rc = groupedIeInstance.decodeSgwsOverloadControlInformationInDeleteBearerResponse(buffer, data.sgwsOverloadControlInformation, ieHeader.length);
+
+ data.sgwsOverloadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: sgwsOverloadControlInformation\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 2)
+ {
+ TwanEpdgsOverloadControlInformationInDeleteBearerResponse groupedIeInstance =
+ dynamic_cast<
+ TwanEpdgsOverloadControlInformationInDeleteBearerResponse&>(ieObject.getGroupedIe(msgType, 2));
+ rc = groupedIeInstance.decodeTwanEpdgsOverloadControlInformationInDeleteBearerResponse(buffer, data.twanEpdgsOverloadControlInformation, ieHeader.length);
+
+ data.twanEpdgsOverloadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: twanEpdgsOverloadControlInformation\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case IpAddressIeType:
+ {
+ IpAddressIe ieObject =
+ dynamic_cast<
+ IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeIpAddressIe(buffer, data.mmeS4SgsnIdentifier, ieHeader.length);
+
+ data.mmeS4SgsnIdentifierIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: mmeS4SgsnIdentifier\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeIpAddressIe(buffer, data.ueLocalIpAddress, ieHeader.length);
+
+ data.ueLocalIpAddressIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: ueLocalIpAddress\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case PortNumberIeType:
+ {
+ PortNumberIe ieObject =
+ dynamic_cast<
+ PortNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(PortNumberIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodePortNumberIe(buffer, data.ueUdpPort, ieHeader.length);
+
+ data.ueUdpPortIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: ueUdpPort\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ rc = ieObject.decodePortNumberIe(buffer, data.ueTcpPort, ieHeader.length);
+
+ data.ueTcpPortIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: ueTcpPort\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case FContainerIeType:
+ {
+ FContainerIe ieObject =
+ dynamic_cast<
+ FContainerIe&>(GtpV2IeFactory::getInstance().getIeObject(FContainerIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeFContainerIe(buffer, data.nbifomContainer, ieHeader.length);
+
+ data.nbifomContainerIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: nbifomContainer\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case SecondaryRatUsageDataReportIeType:
+ {
+ SecondaryRatUsageDataReportIe ieObject =
+ dynamic_cast<
+ SecondaryRatUsageDataReportIe&>(GtpV2IeFactory::getInstance().getIeObject(SecondaryRatUsageDataReportIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeSecondaryRatUsageDataReportIe(buffer, data.secondaryRatUsageDataReport, ieHeader.length);
+
+ data.secondaryRatUsageDataReportIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: secondaryRatUsageDataReport\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ default:
+ {
+ // Unknown IE print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ }
+ }
+ return rc; // TODO validations
+}
+
+void DeleteBearerResponseMsg::
+displayDeleteBearerResponseMsgData_v(DeleteBearerResponseMsgData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"DeleteBearerResponseMsg:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+ stream.add((char *)"IE - cause:");
+ stream.endOfLine();
+ CauseIe cause=
+ dynamic_cast<
+ CauseIe&>(GtpV2IeFactory::getInstance().getIeObject(CauseIeType));
+ cause.displayCauseIe_v(data.cause, stream);
+
+ if (data.linkedEpsBearerIdIePresent)
+ {
+
+
+ stream.add((char *)"IE - linkedEpsBearerId:");
+ stream.endOfLine();
+ EbiIe ebi=
+ dynamic_cast<
+ EbiIe&>(GtpV2IeFactory::getInstance().getIeObject(EbiIeType));
+ ebi.displayEbiIe_v(data.linkedEpsBearerId, stream);
+
+ }
+
+ Uint8 displayCount;
+
+ displayCount = data.bearerContextsCount;
+ if (displayCount > 11)
+ {
+ stream.add((char *)"Invalid data more than 11 instances");
+ stream.endOfLine();
+ stream.add((char *)"Displaying only 11");
+ stream.endOfLine();
+ displayCount = 11;
+ }
+ for (Uint8 i = 0; i < displayCount; i++)
+ {
+ stream.add((char *)"IE - bearerContexts:");
+ stream.endOfLine();
+ BearerContextIe bearerContext=
+ dynamic_cast<
+ BearerContextIe&>(GtpV2IeFactory::getInstance().getIeObject(BearerContextIeType));
+ BearerContextsInDeleteBearerResponse groupedIeInstance =
+ dynamic_cast<
+ BearerContextsInDeleteBearerResponse&>(bearerContext.getGroupedIe(msgType, 0));
+ groupedIeInstance.displayBearerContextsInDeleteBearerResponseData_v(data.bearerContexts[i], stream);
+ }
+
+
+
+
+ if (data.recoveryIePresent)
+ {
+
+
+ stream.add((char *)"IE - recovery:");
+ stream.endOfLine();
+ RecoveryIe recovery=
+ dynamic_cast<
+ RecoveryIe&>(GtpV2IeFactory::getInstance().getIeObject(RecoveryIeType));
+ recovery.displayRecoveryIe_v(data.recovery, stream);
+
+ }
+ if (data.mmeFqCsidIePresent)
+ {
+
+
+ stream.add((char *)"IE - mmeFqCsid:");
+ stream.endOfLine();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ fqCsid.displayFqCsidIe_v(data.mmeFqCsid, stream);
+
+ }
+ if (data.sgwFqCsidIePresent)
+ {
+
+
+ stream.add((char *)"IE - sgwFqCsid:");
+ stream.endOfLine();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ fqCsid.displayFqCsidIe_v(data.sgwFqCsid, stream);
+
+ }
+ if (data.epdgFqCsidIePresent)
+ {
+
+
+ stream.add((char *)"IE - epdgFqCsid:");
+ stream.endOfLine();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ fqCsid.displayFqCsidIe_v(data.epdgFqCsid, stream);
+
+ }
+ if (data.twanFqCsidIePresent)
+ {
+
+
+ stream.add((char *)"IE - twanFqCsid:");
+ stream.endOfLine();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ fqCsid.displayFqCsidIe_v(data.twanFqCsid, stream);
+
+ }
+ if (data.protocolConfigurationOptionsIePresent)
+ {
+
+
+ stream.add((char *)"IE - protocolConfigurationOptions:");
+ stream.endOfLine();
+ PcoIe pco=
+ dynamic_cast<
+ PcoIe&>(GtpV2IeFactory::getInstance().getIeObject(PcoIeType));
+ pco.displayPcoIe_v(data.protocolConfigurationOptions, stream);
+
+ }
+ if (data.ueTimeZoneIePresent)
+ {
+
+
+ stream.add((char *)"IE - ueTimeZone:");
+ stream.endOfLine();
+ UeTimeZoneIe ueTimeZone=
+ dynamic_cast<
+ UeTimeZoneIe&>(GtpV2IeFactory::getInstance().getIeObject(UeTimeZoneIeType));
+ ueTimeZone.displayUeTimeZoneIe_v(data.ueTimeZone, stream);
+
+ }
+ if (data.userLocationInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - userLocationInformation:");
+ stream.endOfLine();
+ UliIe uli=
+ dynamic_cast<
+ UliIe&>(GtpV2IeFactory::getInstance().getIeObject(UliIeType));
+ uli.displayUliIe_v(data.userLocationInformation, stream);
+
+ }
+ if (data.uliTimestampIePresent)
+ {
+
+
+ stream.add((char *)"IE - uliTimestamp:");
+ stream.endOfLine();
+ UliTimestampIe uliTimestamp=
+ dynamic_cast<
+ UliTimestampIe&>(GtpV2IeFactory::getInstance().getIeObject(UliTimestampIeType));
+ uliTimestamp.displayUliTimestampIe_v(data.uliTimestamp, stream);
+
+ }
+ if (data.twanIdentifierIePresent)
+ {
+
+
+ stream.add((char *)"IE - twanIdentifier:");
+ stream.endOfLine();
+ TwanIdentifierIe twanIdentifier=
+ dynamic_cast<
+ TwanIdentifierIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierIeType));
+ twanIdentifier.displayTwanIdentifierIe_v(data.twanIdentifier, stream);
+
+ }
+ if (data.twanIdentifierTimestampIePresent)
+ {
+
+
+ stream.add((char *)"IE - twanIdentifierTimestamp:");
+ stream.endOfLine();
+ TwanIdentifierTimestampIe twanIdentifierTimestamp=
+ dynamic_cast<
+ TwanIdentifierTimestampIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierTimestampIeType));
+ twanIdentifierTimestamp.displayTwanIdentifierTimestampIe_v(data.twanIdentifierTimestamp, stream);
+
+ }
+ if (data.mmeS4SgsnsOverloadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - mmeS4SgsnsOverloadControlInformation:");
+ stream.endOfLine();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ MmeS4SgsnsOverloadControlInformationInDeleteBearerResponse groupedIeInstance =
+ dynamic_cast<
+ MmeS4SgsnsOverloadControlInformationInDeleteBearerResponse&>(overloadControlInformation.getGroupedIe(msgType, 0));
+ groupedIeInstance.displayMmeS4SgsnsOverloadControlInformationInDeleteBearerResponseData_v(data.mmeS4SgsnsOverloadControlInformation, stream);
+
+ }
+ if (data.sgwsOverloadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - sgwsOverloadControlInformation:");
+ stream.endOfLine();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ SgwsOverloadControlInformationInDeleteBearerResponse groupedIeInstance =
+ dynamic_cast<
+ SgwsOverloadControlInformationInDeleteBearerResponse&>(overloadControlInformation.getGroupedIe(msgType, 1));
+ groupedIeInstance.displaySgwsOverloadControlInformationInDeleteBearerResponseData_v(data.sgwsOverloadControlInformation, stream);
+
+ }
+ if (data.mmeS4SgsnIdentifierIePresent)
+ {
+
+
+ stream.add((char *)"IE - mmeS4SgsnIdentifier:");
+ stream.endOfLine();
+ IpAddressIe ipAddress=
+ dynamic_cast<
+ IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
+ ipAddress.displayIpAddressIe_v(data.mmeS4SgsnIdentifier, stream);
+
+ }
+ if (data.twanEpdgsOverloadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - twanEpdgsOverloadControlInformation:");
+ stream.endOfLine();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ TwanEpdgsOverloadControlInformationInDeleteBearerResponse groupedIeInstance =
+ dynamic_cast<
+ TwanEpdgsOverloadControlInformationInDeleteBearerResponse&>(overloadControlInformation.getGroupedIe(msgType, 2));
+ groupedIeInstance.displayTwanEpdgsOverloadControlInformationInDeleteBearerResponseData_v(data.twanEpdgsOverloadControlInformation, stream);
+
+ }
+ if (data.wlanLocationInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - wlanLocationInformation:");
+ stream.endOfLine();
+ TwanIdentifierIe twanIdentifier=
+ dynamic_cast<
+ TwanIdentifierIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierIeType));
+ twanIdentifier.displayTwanIdentifierIe_v(data.wlanLocationInformation, stream);
+
+ }
+ if (data.wlanLocationTimestampIePresent)
+ {
+
+
+ stream.add((char *)"IE - wlanLocationTimestamp:");
+ stream.endOfLine();
+ TwanIdentifierTimestampIe twanIdentifierTimestamp=
+ dynamic_cast<
+ TwanIdentifierTimestampIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierTimestampIeType));
+ twanIdentifierTimestamp.displayTwanIdentifierTimestampIe_v(data.wlanLocationTimestamp, stream);
+
+ }
+ if (data.ueLocalIpAddressIePresent)
+ {
+
+
+ stream.add((char *)"IE - ueLocalIpAddress:");
+ stream.endOfLine();
+ IpAddressIe ipAddress=
+ dynamic_cast<
+ IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
+ ipAddress.displayIpAddressIe_v(data.ueLocalIpAddress, stream);
+
+ }
+ if (data.ueUdpPortIePresent)
+ {
+
+
+ stream.add((char *)"IE - ueUdpPort:");
+ stream.endOfLine();
+ PortNumberIe portNumber=
+ dynamic_cast<
+ PortNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(PortNumberIeType));
+ portNumber.displayPortNumberIe_v(data.ueUdpPort, stream);
+
+ }
+ if (data.nbifomContainerIePresent)
+ {
+
+
+ stream.add((char *)"IE - nbifomContainer:");
+ stream.endOfLine();
+ FContainerIe fContainer=
+ dynamic_cast<
+ FContainerIe&>(GtpV2IeFactory::getInstance().getIeObject(FContainerIeType));
+ fContainer.displayFContainerIe_v(data.nbifomContainer, stream);
+
+ }
+ if (data.ueTcpPortIePresent)
+ {
+
+
+ stream.add((char *)"IE - ueTcpPort:");
+ stream.endOfLine();
+ PortNumberIe portNumber=
+ dynamic_cast<
+ PortNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(PortNumberIeType));
+ portNumber.displayPortNumberIe_v(data.ueTcpPort, stream);
+
+ }
+ if (data.secondaryRatUsageDataReportIePresent)
+ {
+
+
+ stream.add((char *)"IE - secondaryRatUsageDataReport:");
+ stream.endOfLine();
+ SecondaryRatUsageDataReportIe secondaryRatUsageDataReport=
+ dynamic_cast<
+ SecondaryRatUsageDataReportIe&>(GtpV2IeFactory::getInstance().getIeObject(SecondaryRatUsageDataReportIeType));
+ secondaryRatUsageDataReport.displaySecondaryRatUsageDataReportIe_v(data.secondaryRatUsageDataReport, stream);
+
+ }
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
diff --git a/src/gtpV2Codec/msgClasses/deleteBearerResponseMsg.h b/src/gtpV2Codec/msgClasses/deleteBearerResponseMsg.h
new file mode 100644
index 0000000..cc932d1
--- /dev/null
+++ b/src/gtpV2Codec/msgClasses/deleteBearerResponseMsg.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2019-present, Infosys Limited.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ /******************************************************************************
+ *
+ * This is an auto generated file.
+ * Please do not edit this file.
+ * All edits to be made through template source file
+ * <TOP-DIR/scripts/GtpV2StackCodeGen/tts/msgtemplate.h.tt>
+ ******************************************************************************/
+#ifndef DELETEBEARERRESPONSEMSG_H_
+#define DELETEBEARERRESPONSEMSG_H_
+
+#include <set>
+#include "manual/gtpV2Message.h"
+#include <msgBuffer.h>
+#include <debug.h>
+#include "gtpV2MsgDataTypes.h"
+
+
+class DeleteBearerResponseMsg:public GtpV2Message
+{
+public:
+ DeleteBearerResponseMsg();
+ virtual ~DeleteBearerResponseMsg();
+ bool encodeDeleteBearerResponseMsg(MsgBuffer &buffer, DeleteBearerResponseMsgData const &data);
+
+ bool decodeDeleteBearerResponseMsg (MsgBuffer &buffer, DeleteBearerResponseMsgData& data, Uint16 length);
+
+ void displayDeleteBearerResponseMsgData_v(DeleteBearerResponseMsgData const &data, Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/msgClasses/deleteSessionRequestMsg.cpp b/src/gtpV2Codec/msgClasses/deleteSessionRequestMsg.cpp
new file mode 100644
index 0000000..d8482f2
--- /dev/null
+++ b/src/gtpV2Codec/msgClasses/deleteSessionRequestMsg.cpp
@@ -0,0 +1,1578 @@
+/*
+ * Copyright 2019-present Infosys Limited
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+/******************************************************************************
+ *
+ * This is an auto generated file.
+ * Please do not edit this file.
+ * All edits to be made through template source file
+ * <TOP-DIR/scripts/GtpV2StackCodeGen/tts/msgtemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "deleteSessionRequestMsg.h"
+#include "../ieClasses/manual/gtpV2Ie.h"
+#include "../ieClasses/gtpV2IeFactory.h"
+#include "../ieClasses/ebiIe.h"
+#include "../ieClasses/indicationIe.h"
+#include "../ieClasses/causeIe.h"
+#include "../ieClasses/fTeidIe.h"
+#include "../ieClasses/uliIe.h"
+#include "../ieClasses/pcoIe.h"
+#include "../ieClasses/nodeTypeIe.h"
+#include "../ieClasses/ueTimeZoneIe.h"
+#include "../ieClasses/uliTimestampIe.h"
+#include "../ieClasses/ranNasCauseIe.h"
+#include "../ieClasses/twanIdentifierIe.h"
+#include "../ieClasses/twanIdentifierTimestampIe.h"
+#include "../ieClasses/overloadControlInformationIe.h"
+#include "../ieClasses/mmeS4SgsnsOverloadControlInformationInDeleteSessionRequest.h"
+#include "../ieClasses/overloadControlInformationIe.h"
+#include "../ieClasses/sgwsOverloadControlInformationInDeleteSessionRequest.h"
+#include "../ieClasses/overloadControlInformationIe.h"
+#include "../ieClasses/twanEpdgsOverloadControlInformationInDeleteSessionRequest.h"
+#include "../ieClasses/twanIdentifierIe.h"
+#include "../ieClasses/twanIdentifierTimestampIe.h"
+#include "../ieClasses/ipAddressIe.h"
+#include "../ieClasses/portNumberIe.h"
+#include "../ieClasses/epcoIe.h"
+#include "../ieClasses/portNumberIe.h"
+#include "../ieClasses/secondaryRatUsageDataReportIe.h"
+
+DeleteSessionRequestMsg::DeleteSessionRequestMsg()
+{
+ msgType = DeleteSessionRequestMsgType;
+
+}
+
+DeleteSessionRequestMsg::~DeleteSessionRequestMsg()
+{
+
+}
+
+bool DeleteSessionRequestMsg::encodeDeleteSessionRequestMsg(MsgBuffer &buffer,
+ DeleteSessionRequestMsgData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+ if (data.linkedEpsBearerIdIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = EbiIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ EbiIe ebi=
+ dynamic_cast<
+ EbiIe&>(GtpV2IeFactory::getInstance().getIeObject(EbiIeType));
+ rc = ebi.encodeEbiIe(buffer, data.linkedEpsBearerId);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: linkedEpsBearerId\n");
+ return false;
+ }
+ }
+
+ if (data.indicationFlagsIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = IndicationIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ IndicationIe indication=
+ dynamic_cast<
+ IndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(IndicationIeType));
+ rc = indication.encodeIndicationIe(buffer, data.indicationFlags);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: indicationFlags\n");
+ return false;
+ }
+ }
+
+ if (data.causeIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = CauseIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ CauseIe cause=
+ dynamic_cast<
+ CauseIe&>(GtpV2IeFactory::getInstance().getIeObject(CauseIeType));
+ rc = cause.encodeCauseIe(buffer, data.cause);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: cause\n");
+ return false;
+ }
+ }
+
+ if (data.senderFTeidForControlPlaneIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FTeidIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ rc = fTeid.encodeFTeidIe(buffer, data.senderFTeidForControlPlane);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: senderFTeidForControlPlane\n");
+ return false;
+ }
+ }
+
+ if (data.userLocationInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = UliIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ UliIe uli=
+ dynamic_cast<
+ UliIe&>(GtpV2IeFactory::getInstance().getIeObject(UliIeType));
+ rc = uli.encodeUliIe(buffer, data.userLocationInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: userLocationInformation\n");
+ return false;
+ }
+ }
+
+ if (data.protocolConfigurationOptionsIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = PcoIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ PcoIe pco=
+ dynamic_cast<
+ PcoIe&>(GtpV2IeFactory::getInstance().getIeObject(PcoIeType));
+ rc = pco.encodePcoIe(buffer, data.protocolConfigurationOptions);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: protocolConfigurationOptions\n");
+ return false;
+ }
+ }
+
+ if (data.originatingNodeIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = NodeTypeIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ NodeTypeIe nodeType=
+ dynamic_cast<
+ NodeTypeIe&>(GtpV2IeFactory::getInstance().getIeObject(NodeTypeIeType));
+ rc = nodeType.encodeNodeTypeIe(buffer, data.originatingNode);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: originatingNode\n");
+ return false;
+ }
+ }
+
+ if (data.ueTimeZoneIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = UeTimeZoneIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ UeTimeZoneIe ueTimeZone=
+ dynamic_cast<
+ UeTimeZoneIe&>(GtpV2IeFactory::getInstance().getIeObject(UeTimeZoneIeType));
+ rc = ueTimeZone.encodeUeTimeZoneIe(buffer, data.ueTimeZone);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: ueTimeZone\n");
+ return false;
+ }
+ }
+
+ if (data.uliTimestampIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = UliTimestampIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ UliTimestampIe uliTimestamp=
+ dynamic_cast<
+ UliTimestampIe&>(GtpV2IeFactory::getInstance().getIeObject(UliTimestampIeType));
+ rc = uliTimestamp.encodeUliTimestampIe(buffer, data.uliTimestamp);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: uliTimestamp\n");
+ return false;
+ }
+ }
+
+ if (data.ranNasReleaseCauseIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = RanNasCauseIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ RanNasCauseIe ranNasCause=
+ dynamic_cast<
+ RanNasCauseIe&>(GtpV2IeFactory::getInstance().getIeObject(RanNasCauseIeType));
+ rc = ranNasCause.encodeRanNasCauseIe(buffer, data.ranNasReleaseCause);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: ranNasReleaseCause\n");
+ return false;
+ }
+ }
+
+ if (data.twanIdentifierIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = TwanIdentifierIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ TwanIdentifierIe twanIdentifier=
+ dynamic_cast<
+ TwanIdentifierIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierIeType));
+ rc = twanIdentifier.encodeTwanIdentifierIe(buffer, data.twanIdentifier);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: twanIdentifier\n");
+ return false;
+ }
+ }
+
+ if (data.twanIdentifierTimestampIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = TwanIdentifierTimestampIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ TwanIdentifierTimestampIe twanIdentifierTimestamp=
+ dynamic_cast<
+ TwanIdentifierTimestampIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierTimestampIeType));
+ rc = twanIdentifierTimestamp.encodeTwanIdentifierTimestampIe(buffer, data.twanIdentifierTimestamp);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: twanIdentifierTimestamp\n");
+ return false;
+ }
+ }
+
+ if (data.mmeS4SgsnsOverloadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = OverloadControlInformationIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ MmeS4SgsnsOverloadControlInformationInDeleteSessionRequest groupedIeInstance =
+ dynamic_cast<
+ MmeS4SgsnsOverloadControlInformationInDeleteSessionRequest&>(overloadControlInformation.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.encodeMmeS4SgsnsOverloadControlInformationInDeleteSessionRequest(buffer, data.mmeS4SgsnsOverloadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: mmeS4SgsnsOverloadControlInformation\n");
+ return false;
+ }
+ }
+
+ if (data.sgwsOverloadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = OverloadControlInformationIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ SgwsOverloadControlInformationInDeleteSessionRequest groupedIeInstance =
+ dynamic_cast<
+ SgwsOverloadControlInformationInDeleteSessionRequest&>(overloadControlInformation.getGroupedIe(msgType, 1));
+ rc = groupedIeInstance.encodeSgwsOverloadControlInformationInDeleteSessionRequest(buffer, data.sgwsOverloadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: sgwsOverloadControlInformation\n");
+ return false;
+ }
+ }
+
+ if (data.twanEpdgsOverloadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = OverloadControlInformationIeType;
+ header.instance = 2;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ TwanEpdgsOverloadControlInformationInDeleteSessionRequest groupedIeInstance =
+ dynamic_cast<
+ TwanEpdgsOverloadControlInformationInDeleteSessionRequest&>(overloadControlInformation.getGroupedIe(msgType, 2));
+ rc = groupedIeInstance.encodeTwanEpdgsOverloadControlInformationInDeleteSessionRequest(buffer, data.twanEpdgsOverloadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: twanEpdgsOverloadControlInformation\n");
+ return false;
+ }
+ }
+
+ if (data.wlanLocationInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = TwanIdentifierIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ TwanIdentifierIe twanIdentifier=
+ dynamic_cast<
+ TwanIdentifierIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierIeType));
+ rc = twanIdentifier.encodeTwanIdentifierIe(buffer, data.wlanLocationInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: wlanLocationInformation\n");
+ return false;
+ }
+ }
+
+ if (data.wlanLocationTimestampIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = TwanIdentifierTimestampIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ TwanIdentifierTimestampIe twanIdentifierTimestamp=
+ dynamic_cast<
+ TwanIdentifierTimestampIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierTimestampIeType));
+ rc = twanIdentifierTimestamp.encodeTwanIdentifierTimestampIe(buffer, data.wlanLocationTimestamp);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: wlanLocationTimestamp\n");
+ return false;
+ }
+ }
+
+ if (data.ueLocalIpAddressIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = IpAddressIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ IpAddressIe ipAddress=
+ dynamic_cast<
+ IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
+ rc = ipAddress.encodeIpAddressIe(buffer, data.ueLocalIpAddress);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: ueLocalIpAddress\n");
+ return false;
+ }
+ }
+
+ if (data.ueUdpPortIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = PortNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ PortNumberIe portNumber=
+ dynamic_cast<
+ PortNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(PortNumberIeType));
+ rc = portNumber.encodePortNumberIe(buffer, data.ueUdpPort);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: ueUdpPort\n");
+ return false;
+ }
+ }
+
+ if (data.extendedProtocolConfigurationOptionsIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = EpcoIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ EpcoIe epco=
+ dynamic_cast<
+ EpcoIe&>(GtpV2IeFactory::getInstance().getIeObject(EpcoIeType));
+ rc = epco.encodeEpcoIe(buffer, data.extendedProtocolConfigurationOptions);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: extendedProtocolConfigurationOptions\n");
+ return false;
+ }
+ }
+
+ if (data.ueTcpPortIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = PortNumberIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ PortNumberIe portNumber=
+ dynamic_cast<
+ PortNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(PortNumberIeType));
+ rc = portNumber.encodePortNumberIe(buffer, data.ueTcpPort);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: ueTcpPort\n");
+ return false;
+ }
+ }
+
+ if (data.secondaryRatUsageDataReportIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = SecondaryRatUsageDataReportIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SecondaryRatUsageDataReportIe secondaryRatUsageDataReport=
+ dynamic_cast<
+ SecondaryRatUsageDataReportIe&>(GtpV2IeFactory::getInstance().getIeObject(SecondaryRatUsageDataReportIeType));
+ rc = secondaryRatUsageDataReport.encodeSecondaryRatUsageDataReportIe(buffer, data.secondaryRatUsageDataReport);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: secondaryRatUsageDataReport\n");
+ return false;
+ }
+ }
+ return rc;
+
+}
+
+bool DeleteSessionRequestMsg::decodeDeleteSessionRequestMsg(MsgBuffer &buffer,
+ DeleteSessionRequestMsgData
+ &data, Uint16 length)
+{
+
+ bool rc = false;
+ GtpV2IeHeader ieHeader;
+
+ set<Uint16> mandatoryIeLocalList = mandatoryIeSet;
+ while (buffer.lengthLeft() > IE_HEADER_SIZE)
+ {
+ GtpV2Ie::decodeGtpV2IeHeader(buffer, ieHeader);
+ if (ieHeader.length > buffer.lengthLeft())
+ {
+ // We do not have enough bytes left in the message for this IE
+ errorStream.add((char *)"IE Length exceeds beyond message boundary\n");
+ errorStream.add((char *)" Offending IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.add((char *)"\n Ie Length in Header: ");
+ errorStream.add(ieHeader.length);
+ errorStream.add((char *)"\n Bytes left in message: ");
+ errorStream.add(buffer.lengthLeft());
+ errorStream.endOfLine();
+ return false;
+ }
+
+ switch (ieHeader.ieType){
+
+ case EbiIeType:
+ {
+ EbiIe ieObject =
+ dynamic_cast<
+ EbiIe&>(GtpV2IeFactory::getInstance().getIeObject(EbiIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeEbiIe(buffer, data.linkedEpsBearerId, ieHeader.length);
+
+ data.linkedEpsBearerIdIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: linkedEpsBearerId\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case IndicationIeType:
+ {
+ IndicationIe ieObject =
+ dynamic_cast<
+ IndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(IndicationIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeIndicationIe(buffer, data.indicationFlags, ieHeader.length);
+
+ data.indicationFlagsIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: indicationFlags\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case CauseIeType:
+ {
+ CauseIe ieObject =
+ dynamic_cast<
+ CauseIe&>(GtpV2IeFactory::getInstance().getIeObject(CauseIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeCauseIe(buffer, data.cause, ieHeader.length);
+
+ data.causeIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: cause\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case FTeidIeType:
+ {
+ FTeidIe ieObject =
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeFTeidIe(buffer, data.senderFTeidForControlPlane, ieHeader.length);
+
+ data.senderFTeidForControlPlaneIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: senderFTeidForControlPlane\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case UliIeType:
+ {
+ UliIe ieObject =
+ dynamic_cast<
+ UliIe&>(GtpV2IeFactory::getInstance().getIeObject(UliIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeUliIe(buffer, data.userLocationInformation, ieHeader.length);
+
+ data.userLocationInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: userLocationInformation\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case PcoIeType:
+ {
+ PcoIe ieObject =
+ dynamic_cast<
+ PcoIe&>(GtpV2IeFactory::getInstance().getIeObject(PcoIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodePcoIe(buffer, data.protocolConfigurationOptions, ieHeader.length);
+
+ data.protocolConfigurationOptionsIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: protocolConfigurationOptions\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case NodeTypeIeType:
+ {
+ NodeTypeIe ieObject =
+ dynamic_cast<
+ NodeTypeIe&>(GtpV2IeFactory::getInstance().getIeObject(NodeTypeIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeNodeTypeIe(buffer, data.originatingNode, ieHeader.length);
+
+ data.originatingNodeIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: originatingNode\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case UeTimeZoneIeType:
+ {
+ UeTimeZoneIe ieObject =
+ dynamic_cast<
+ UeTimeZoneIe&>(GtpV2IeFactory::getInstance().getIeObject(UeTimeZoneIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeUeTimeZoneIe(buffer, data.ueTimeZone, ieHeader.length);
+
+ data.ueTimeZoneIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: ueTimeZone\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case UliTimestampIeType:
+ {
+ UliTimestampIe ieObject =
+ dynamic_cast<
+ UliTimestampIe&>(GtpV2IeFactory::getInstance().getIeObject(UliTimestampIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeUliTimestampIe(buffer, data.uliTimestamp, ieHeader.length);
+
+ data.uliTimestampIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: uliTimestamp\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case RanNasCauseIeType:
+ {
+ RanNasCauseIe ieObject =
+ dynamic_cast<
+ RanNasCauseIe&>(GtpV2IeFactory::getInstance().getIeObject(RanNasCauseIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeRanNasCauseIe(buffer, data.ranNasReleaseCause, ieHeader.length);
+
+ data.ranNasReleaseCauseIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: ranNasReleaseCause\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case TwanIdentifierIeType:
+ {
+ TwanIdentifierIe ieObject =
+ dynamic_cast<
+ TwanIdentifierIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeTwanIdentifierIe(buffer, data.twanIdentifier, ieHeader.length);
+
+ data.twanIdentifierIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: twanIdentifier\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ rc = ieObject.decodeTwanIdentifierIe(buffer, data.wlanLocationInformation, ieHeader.length);
+
+ data.wlanLocationInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: wlanLocationInformation\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case TwanIdentifierTimestampIeType:
+ {
+ TwanIdentifierTimestampIe ieObject =
+ dynamic_cast<
+ TwanIdentifierTimestampIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierTimestampIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeTwanIdentifierTimestampIe(buffer, data.twanIdentifierTimestamp, ieHeader.length);
+
+ data.twanIdentifierTimestampIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: twanIdentifierTimestamp\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ rc = ieObject.decodeTwanIdentifierTimestampIe(buffer, data.wlanLocationTimestamp, ieHeader.length);
+
+ data.wlanLocationTimestampIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: wlanLocationTimestamp\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case OverloadControlInformationIeType:
+ {
+ OverloadControlInformationIe ieObject =
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ MmeS4SgsnsOverloadControlInformationInDeleteSessionRequest groupedIeInstance =
+ dynamic_cast<
+ MmeS4SgsnsOverloadControlInformationInDeleteSessionRequest&>(ieObject.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.decodeMmeS4SgsnsOverloadControlInformationInDeleteSessionRequest(buffer, data.mmeS4SgsnsOverloadControlInformation, ieHeader.length);
+
+ data.mmeS4SgsnsOverloadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: mmeS4SgsnsOverloadControlInformation\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ SgwsOverloadControlInformationInDeleteSessionRequest groupedIeInstance =
+ dynamic_cast<
+ SgwsOverloadControlInformationInDeleteSessionRequest&>(ieObject.getGroupedIe(msgType, 1));
+ rc = groupedIeInstance.decodeSgwsOverloadControlInformationInDeleteSessionRequest(buffer, data.sgwsOverloadControlInformation, ieHeader.length);
+
+ data.sgwsOverloadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: sgwsOverloadControlInformation\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 2)
+ {
+ TwanEpdgsOverloadControlInformationInDeleteSessionRequest groupedIeInstance =
+ dynamic_cast<
+ TwanEpdgsOverloadControlInformationInDeleteSessionRequest&>(ieObject.getGroupedIe(msgType, 2));
+ rc = groupedIeInstance.decodeTwanEpdgsOverloadControlInformationInDeleteSessionRequest(buffer, data.twanEpdgsOverloadControlInformation, ieHeader.length);
+
+ data.twanEpdgsOverloadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: twanEpdgsOverloadControlInformation\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case IpAddressIeType:
+ {
+ IpAddressIe ieObject =
+ dynamic_cast<
+ IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeIpAddressIe(buffer, data.ueLocalIpAddress, ieHeader.length);
+
+ data.ueLocalIpAddressIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: ueLocalIpAddress\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case PortNumberIeType:
+ {
+ PortNumberIe ieObject =
+ dynamic_cast<
+ PortNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(PortNumberIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodePortNumberIe(buffer, data.ueUdpPort, ieHeader.length);
+
+ data.ueUdpPortIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: ueUdpPort\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ rc = ieObject.decodePortNumberIe(buffer, data.ueTcpPort, ieHeader.length);
+
+ data.ueTcpPortIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: ueTcpPort\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case EpcoIeType:
+ {
+ EpcoIe ieObject =
+ dynamic_cast<
+ EpcoIe&>(GtpV2IeFactory::getInstance().getIeObject(EpcoIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeEpcoIe(buffer, data.extendedProtocolConfigurationOptions, ieHeader.length);
+
+ data.extendedProtocolConfigurationOptionsIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: extendedProtocolConfigurationOptions\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case SecondaryRatUsageDataReportIeType:
+ {
+ SecondaryRatUsageDataReportIe ieObject =
+ dynamic_cast<
+ SecondaryRatUsageDataReportIe&>(GtpV2IeFactory::getInstance().getIeObject(SecondaryRatUsageDataReportIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeSecondaryRatUsageDataReportIe(buffer, data.secondaryRatUsageDataReport, ieHeader.length);
+
+ data.secondaryRatUsageDataReportIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: secondaryRatUsageDataReport\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ default:
+ {
+ // Unknown IE print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ }
+ }
+ return rc; // TODO validations
+}
+
+void DeleteSessionRequestMsg::
+displayDeleteSessionRequestMsgData_v(DeleteSessionRequestMsgData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"DeleteSessionRequestMsg:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+ if (data.linkedEpsBearerIdIePresent)
+ {
+
+
+ stream.add((char *)"IE - linkedEpsBearerId:");
+ stream.endOfLine();
+ EbiIe ebi=
+ dynamic_cast<
+ EbiIe&>(GtpV2IeFactory::getInstance().getIeObject(EbiIeType));
+ ebi.displayEbiIe_v(data.linkedEpsBearerId, stream);
+
+ }
+ if (data.indicationFlagsIePresent)
+ {
+
+
+ stream.add((char *)"IE - indicationFlags:");
+ stream.endOfLine();
+ IndicationIe indication=
+ dynamic_cast<
+ IndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(IndicationIeType));
+ indication.displayIndicationIe_v(data.indicationFlags, stream);
+
+ }
+ if (data.causeIePresent)
+ {
+
+
+ stream.add((char *)"IE - cause:");
+ stream.endOfLine();
+ CauseIe cause=
+ dynamic_cast<
+ CauseIe&>(GtpV2IeFactory::getInstance().getIeObject(CauseIeType));
+ cause.displayCauseIe_v(data.cause, stream);
+
+ }
+ if (data.senderFTeidForControlPlaneIePresent)
+ {
+
+
+ stream.add((char *)"IE - senderFTeidForControlPlane:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.senderFTeidForControlPlane, stream);
+
+ }
+ if (data.userLocationInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - userLocationInformation:");
+ stream.endOfLine();
+ UliIe uli=
+ dynamic_cast<
+ UliIe&>(GtpV2IeFactory::getInstance().getIeObject(UliIeType));
+ uli.displayUliIe_v(data.userLocationInformation, stream);
+
+ }
+ if (data.protocolConfigurationOptionsIePresent)
+ {
+
+
+ stream.add((char *)"IE - protocolConfigurationOptions:");
+ stream.endOfLine();
+ PcoIe pco=
+ dynamic_cast<
+ PcoIe&>(GtpV2IeFactory::getInstance().getIeObject(PcoIeType));
+ pco.displayPcoIe_v(data.protocolConfigurationOptions, stream);
+
+ }
+ if (data.originatingNodeIePresent)
+ {
+
+
+ stream.add((char *)"IE - originatingNode:");
+ stream.endOfLine();
+ NodeTypeIe nodeType=
+ dynamic_cast<
+ NodeTypeIe&>(GtpV2IeFactory::getInstance().getIeObject(NodeTypeIeType));
+ nodeType.displayNodeTypeIe_v(data.originatingNode, stream);
+
+ }
+ if (data.ueTimeZoneIePresent)
+ {
+
+
+ stream.add((char *)"IE - ueTimeZone:");
+ stream.endOfLine();
+ UeTimeZoneIe ueTimeZone=
+ dynamic_cast<
+ UeTimeZoneIe&>(GtpV2IeFactory::getInstance().getIeObject(UeTimeZoneIeType));
+ ueTimeZone.displayUeTimeZoneIe_v(data.ueTimeZone, stream);
+
+ }
+ if (data.uliTimestampIePresent)
+ {
+
+
+ stream.add((char *)"IE - uliTimestamp:");
+ stream.endOfLine();
+ UliTimestampIe uliTimestamp=
+ dynamic_cast<
+ UliTimestampIe&>(GtpV2IeFactory::getInstance().getIeObject(UliTimestampIeType));
+ uliTimestamp.displayUliTimestampIe_v(data.uliTimestamp, stream);
+
+ }
+ if (data.ranNasReleaseCauseIePresent)
+ {
+
+
+ stream.add((char *)"IE - ranNasReleaseCause:");
+ stream.endOfLine();
+ RanNasCauseIe ranNasCause=
+ dynamic_cast<
+ RanNasCauseIe&>(GtpV2IeFactory::getInstance().getIeObject(RanNasCauseIeType));
+ ranNasCause.displayRanNasCauseIe_v(data.ranNasReleaseCause, stream);
+
+ }
+ if (data.twanIdentifierIePresent)
+ {
+
+
+ stream.add((char *)"IE - twanIdentifier:");
+ stream.endOfLine();
+ TwanIdentifierIe twanIdentifier=
+ dynamic_cast<
+ TwanIdentifierIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierIeType));
+ twanIdentifier.displayTwanIdentifierIe_v(data.twanIdentifier, stream);
+
+ }
+ if (data.twanIdentifierTimestampIePresent)
+ {
+
+
+ stream.add((char *)"IE - twanIdentifierTimestamp:");
+ stream.endOfLine();
+ TwanIdentifierTimestampIe twanIdentifierTimestamp=
+ dynamic_cast<
+ TwanIdentifierTimestampIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierTimestampIeType));
+ twanIdentifierTimestamp.displayTwanIdentifierTimestampIe_v(data.twanIdentifierTimestamp, stream);
+
+ }
+ if (data.mmeS4SgsnsOverloadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - mmeS4SgsnsOverloadControlInformation:");
+ stream.endOfLine();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ MmeS4SgsnsOverloadControlInformationInDeleteSessionRequest groupedIeInstance =
+ dynamic_cast<
+ MmeS4SgsnsOverloadControlInformationInDeleteSessionRequest&>(overloadControlInformation.getGroupedIe(msgType, 0));
+ groupedIeInstance.displayMmeS4SgsnsOverloadControlInformationInDeleteSessionRequestData_v(data.mmeS4SgsnsOverloadControlInformation, stream);
+
+ }
+ if (data.sgwsOverloadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - sgwsOverloadControlInformation:");
+ stream.endOfLine();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ SgwsOverloadControlInformationInDeleteSessionRequest groupedIeInstance =
+ dynamic_cast<
+ SgwsOverloadControlInformationInDeleteSessionRequest&>(overloadControlInformation.getGroupedIe(msgType, 1));
+ groupedIeInstance.displaySgwsOverloadControlInformationInDeleteSessionRequestData_v(data.sgwsOverloadControlInformation, stream);
+
+ }
+ if (data.twanEpdgsOverloadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - twanEpdgsOverloadControlInformation:");
+ stream.endOfLine();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ TwanEpdgsOverloadControlInformationInDeleteSessionRequest groupedIeInstance =
+ dynamic_cast<
+ TwanEpdgsOverloadControlInformationInDeleteSessionRequest&>(overloadControlInformation.getGroupedIe(msgType, 2));
+ groupedIeInstance.displayTwanEpdgsOverloadControlInformationInDeleteSessionRequestData_v(data.twanEpdgsOverloadControlInformation, stream);
+
+ }
+ if (data.wlanLocationInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - wlanLocationInformation:");
+ stream.endOfLine();
+ TwanIdentifierIe twanIdentifier=
+ dynamic_cast<
+ TwanIdentifierIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierIeType));
+ twanIdentifier.displayTwanIdentifierIe_v(data.wlanLocationInformation, stream);
+
+ }
+ if (data.wlanLocationTimestampIePresent)
+ {
+
+
+ stream.add((char *)"IE - wlanLocationTimestamp:");
+ stream.endOfLine();
+ TwanIdentifierTimestampIe twanIdentifierTimestamp=
+ dynamic_cast<
+ TwanIdentifierTimestampIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierTimestampIeType));
+ twanIdentifierTimestamp.displayTwanIdentifierTimestampIe_v(data.wlanLocationTimestamp, stream);
+
+ }
+ if (data.ueLocalIpAddressIePresent)
+ {
+
+
+ stream.add((char *)"IE - ueLocalIpAddress:");
+ stream.endOfLine();
+ IpAddressIe ipAddress=
+ dynamic_cast<
+ IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
+ ipAddress.displayIpAddressIe_v(data.ueLocalIpAddress, stream);
+
+ }
+ if (data.ueUdpPortIePresent)
+ {
+
+
+ stream.add((char *)"IE - ueUdpPort:");
+ stream.endOfLine();
+ PortNumberIe portNumber=
+ dynamic_cast<
+ PortNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(PortNumberIeType));
+ portNumber.displayPortNumberIe_v(data.ueUdpPort, stream);
+
+ }
+ if (data.extendedProtocolConfigurationOptionsIePresent)
+ {
+
+
+ stream.add((char *)"IE - extendedProtocolConfigurationOptions:");
+ stream.endOfLine();
+ EpcoIe epco=
+ dynamic_cast<
+ EpcoIe&>(GtpV2IeFactory::getInstance().getIeObject(EpcoIeType));
+ epco.displayEpcoIe_v(data.extendedProtocolConfigurationOptions, stream);
+
+ }
+ if (data.ueTcpPortIePresent)
+ {
+
+
+ stream.add((char *)"IE - ueTcpPort:");
+ stream.endOfLine();
+ PortNumberIe portNumber=
+ dynamic_cast<
+ PortNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(PortNumberIeType));
+ portNumber.displayPortNumberIe_v(data.ueTcpPort, stream);
+
+ }
+ if (data.secondaryRatUsageDataReportIePresent)
+ {
+
+
+ stream.add((char *)"IE - secondaryRatUsageDataReport:");
+ stream.endOfLine();
+ SecondaryRatUsageDataReportIe secondaryRatUsageDataReport=
+ dynamic_cast<
+ SecondaryRatUsageDataReportIe&>(GtpV2IeFactory::getInstance().getIeObject(SecondaryRatUsageDataReportIeType));
+ secondaryRatUsageDataReport.displaySecondaryRatUsageDataReportIe_v(data.secondaryRatUsageDataReport, stream);
+
+ }
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
diff --git a/src/gtpV2Codec/msgClasses/deleteSessionRequestMsg.h b/src/gtpV2Codec/msgClasses/deleteSessionRequestMsg.h
new file mode 100644
index 0000000..c453015
--- /dev/null
+++ b/src/gtpV2Codec/msgClasses/deleteSessionRequestMsg.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2019-present, Infosys Limited.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ /******************************************************************************
+ *
+ * This is an auto generated file.
+ * Please do not edit this file.
+ * All edits to be made through template source file
+ * <TOP-DIR/scripts/GtpV2StackCodeGen/tts/msgtemplate.h.tt>
+ ******************************************************************************/
+#ifndef DELETESESSIONREQUESTMSG_H_
+#define DELETESESSIONREQUESTMSG_H_
+
+#include <set>
+#include "manual/gtpV2Message.h"
+#include <msgBuffer.h>
+#include <debug.h>
+#include "gtpV2MsgDataTypes.h"
+
+
+class DeleteSessionRequestMsg:public GtpV2Message
+{
+public:
+ DeleteSessionRequestMsg();
+ virtual ~DeleteSessionRequestMsg();
+ bool encodeDeleteSessionRequestMsg(MsgBuffer &buffer, DeleteSessionRequestMsgData const &data);
+
+ bool decodeDeleteSessionRequestMsg (MsgBuffer &buffer, DeleteSessionRequestMsgData& data, Uint16 length);
+
+ void displayDeleteSessionRequestMsgData_v(DeleteSessionRequestMsgData const &data, Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/msgClasses/deleteSessionResponseMsg.cpp b/src/gtpV2Codec/msgClasses/deleteSessionResponseMsg.cpp
new file mode 100644
index 0000000..292fe40
--- /dev/null
+++ b/src/gtpV2Codec/msgClasses/deleteSessionResponseMsg.cpp
@@ -0,0 +1,788 @@
+/*
+ * Copyright 2019-present Infosys Limited
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+/******************************************************************************
+ *
+ * This is an auto generated file.
+ * Please do not edit this file.
+ * All edits to be made through template source file
+ * <TOP-DIR/scripts/GtpV2StackCodeGen/tts/msgtemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "deleteSessionResponseMsg.h"
+#include "../ieClasses/manual/gtpV2Ie.h"
+#include "../ieClasses/gtpV2IeFactory.h"
+#include "../ieClasses/causeIe.h"
+#include "../ieClasses/recoveryIe.h"
+#include "../ieClasses/pcoIe.h"
+#include "../ieClasses/indicationIe.h"
+#include "../ieClasses/loadControlInformationIe.h"
+#include "../ieClasses/pgwsNodeLevelLoadControlInformationInDeleteSessionResponse.h"
+#include "../ieClasses/loadControlInformationIe.h"
+#include "../ieClasses/pgwsApnLevelLoadControlInformationInDeleteSessionResponse.h"
+#include "../ieClasses/loadControlInformationIe.h"
+#include "../ieClasses/sgwsNodeLevelLoadControlInformationInDeleteSessionResponse.h"
+#include "../ieClasses/overloadControlInformationIe.h"
+#include "../ieClasses/pgwsOverloadControlInformationInDeleteSessionResponse.h"
+#include "../ieClasses/overloadControlInformationIe.h"
+#include "../ieClasses/sgwsOverloadControlInformationInDeleteSessionResponse.h"
+#include "../ieClasses/epcoIe.h"
+
+DeleteSessionResponseMsg::DeleteSessionResponseMsg()
+{
+ msgType = DeleteSessionResponseMsgType;
+ Uint16 mandIe;
+ mandIe = CauseIeType;
+ mandIe = (mandIe << 8) | 0; // cause
+ mandatoryIeSet.insert(mandIe);
+}
+
+DeleteSessionResponseMsg::~DeleteSessionResponseMsg()
+{
+
+}
+
+bool DeleteSessionResponseMsg::encodeDeleteSessionResponseMsg(MsgBuffer &buffer,
+ DeleteSessionResponseMsgData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+ // Encode the Ie Header
+ header.ieType = CauseIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ CauseIe cause=
+ dynamic_cast<
+ CauseIe&>(GtpV2IeFactory::getInstance().getIeObject(CauseIeType));
+ rc = cause.encodeCauseIe(buffer, data.cause);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: cause\n");
+ return false;
+ }
+
+ if (data.recoveryIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = RecoveryIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ RecoveryIe recovery=
+ dynamic_cast<
+ RecoveryIe&>(GtpV2IeFactory::getInstance().getIeObject(RecoveryIeType));
+ rc = recovery.encodeRecoveryIe(buffer, data.recovery);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: recovery\n");
+ return false;
+ }
+ }
+
+ if (data.protocolConfigurationOptionsIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = PcoIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ PcoIe pco=
+ dynamic_cast<
+ PcoIe&>(GtpV2IeFactory::getInstance().getIeObject(PcoIeType));
+ rc = pco.encodePcoIe(buffer, data.protocolConfigurationOptions);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: protocolConfigurationOptions\n");
+ return false;
+ }
+ }
+
+ if (data.indicationFlagsIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = IndicationIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ IndicationIe indication=
+ dynamic_cast<
+ IndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(IndicationIeType));
+ rc = indication.encodeIndicationIe(buffer, data.indicationFlags);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: indicationFlags\n");
+ return false;
+ }
+ }
+
+ if (data.pgwsNodeLevelLoadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = LoadControlInformationIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ LoadControlInformationIe loadControlInformation=
+ dynamic_cast<
+ LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType));
+ PgwsNodeLevelLoadControlInformationInDeleteSessionResponse groupedIeInstance =
+ dynamic_cast<
+ PgwsNodeLevelLoadControlInformationInDeleteSessionResponse&>(loadControlInformation.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.encodePgwsNodeLevelLoadControlInformationInDeleteSessionResponse(buffer, data.pgwsNodeLevelLoadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: pgwsNodeLevelLoadControlInformation\n");
+ return false;
+ }
+ }
+
+ if (data.pgwsApnLevelLoadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = LoadControlInformationIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ LoadControlInformationIe loadControlInformation=
+ dynamic_cast<
+ LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType));
+ PgwsApnLevelLoadControlInformationInDeleteSessionResponse groupedIeInstance =
+ dynamic_cast<
+ PgwsApnLevelLoadControlInformationInDeleteSessionResponse&>(loadControlInformation.getGroupedIe(msgType, 1));
+ rc = groupedIeInstance.encodePgwsApnLevelLoadControlInformationInDeleteSessionResponse(buffer, data.pgwsApnLevelLoadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: pgwsApnLevelLoadControlInformation\n");
+ return false;
+ }
+ }
+
+ if (data.sgwsNodeLevelLoadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = LoadControlInformationIeType;
+ header.instance = 2;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ LoadControlInformationIe loadControlInformation=
+ dynamic_cast<
+ LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType));
+ SgwsNodeLevelLoadControlInformationInDeleteSessionResponse groupedIeInstance =
+ dynamic_cast<
+ SgwsNodeLevelLoadControlInformationInDeleteSessionResponse&>(loadControlInformation.getGroupedIe(msgType, 2));
+ rc = groupedIeInstance.encodeSgwsNodeLevelLoadControlInformationInDeleteSessionResponse(buffer, data.sgwsNodeLevelLoadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: sgwsNodeLevelLoadControlInformation\n");
+ return false;
+ }
+ }
+
+ if (data.pgwsOverloadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = OverloadControlInformationIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ PgwsOverloadControlInformationInDeleteSessionResponse groupedIeInstance =
+ dynamic_cast<
+ PgwsOverloadControlInformationInDeleteSessionResponse&>(overloadControlInformation.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.encodePgwsOverloadControlInformationInDeleteSessionResponse(buffer, data.pgwsOverloadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: pgwsOverloadControlInformation\n");
+ return false;
+ }
+ }
+
+ if (data.sgwsOverloadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = OverloadControlInformationIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ SgwsOverloadControlInformationInDeleteSessionResponse groupedIeInstance =
+ dynamic_cast<
+ SgwsOverloadControlInformationInDeleteSessionResponse&>(overloadControlInformation.getGroupedIe(msgType, 1));
+ rc = groupedIeInstance.encodeSgwsOverloadControlInformationInDeleteSessionResponse(buffer, data.sgwsOverloadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: sgwsOverloadControlInformation\n");
+ return false;
+ }
+ }
+
+ if (data.extendedProtocolConfigurationOptionsIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = EpcoIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ EpcoIe epco=
+ dynamic_cast<
+ EpcoIe&>(GtpV2IeFactory::getInstance().getIeObject(EpcoIeType));
+ rc = epco.encodeEpcoIe(buffer, data.extendedProtocolConfigurationOptions);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: extendedProtocolConfigurationOptions\n");
+ return false;
+ }
+ }
+ return rc;
+
+}
+
+bool DeleteSessionResponseMsg::decodeDeleteSessionResponseMsg(MsgBuffer &buffer,
+ DeleteSessionResponseMsgData
+ &data, Uint16 length)
+{
+
+ bool rc = false;
+ GtpV2IeHeader ieHeader;
+
+ set<Uint16> mandatoryIeLocalList = mandatoryIeSet;
+ while (buffer.lengthLeft() > IE_HEADER_SIZE)
+ {
+ GtpV2Ie::decodeGtpV2IeHeader(buffer, ieHeader);
+ if (ieHeader.length > buffer.lengthLeft())
+ {
+ // We do not have enough bytes left in the message for this IE
+ errorStream.add((char *)"IE Length exceeds beyond message boundary\n");
+ errorStream.add((char *)" Offending IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.add((char *)"\n Ie Length in Header: ");
+ errorStream.add(ieHeader.length);
+ errorStream.add((char *)"\n Bytes left in message: ");
+ errorStream.add(buffer.lengthLeft());
+ errorStream.endOfLine();
+ return false;
+ }
+
+ switch (ieHeader.ieType){
+
+ case CauseIeType:
+ {
+ CauseIe ieObject =
+ dynamic_cast<
+ CauseIe&>(GtpV2IeFactory::getInstance().getIeObject(CauseIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeCauseIe(buffer, data.cause, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: cause\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case RecoveryIeType:
+ {
+ RecoveryIe ieObject =
+ dynamic_cast<
+ RecoveryIe&>(GtpV2IeFactory::getInstance().getIeObject(RecoveryIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeRecoveryIe(buffer, data.recovery, ieHeader.length);
+
+ data.recoveryIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: recovery\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case PcoIeType:
+ {
+ PcoIe ieObject =
+ dynamic_cast<
+ PcoIe&>(GtpV2IeFactory::getInstance().getIeObject(PcoIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodePcoIe(buffer, data.protocolConfigurationOptions, ieHeader.length);
+
+ data.protocolConfigurationOptionsIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: protocolConfigurationOptions\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case IndicationIeType:
+ {
+ IndicationIe ieObject =
+ dynamic_cast<
+ IndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(IndicationIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeIndicationIe(buffer, data.indicationFlags, ieHeader.length);
+
+ data.indicationFlagsIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: indicationFlags\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case LoadControlInformationIeType:
+ {
+ LoadControlInformationIe ieObject =
+ dynamic_cast<
+ LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ PgwsNodeLevelLoadControlInformationInDeleteSessionResponse groupedIeInstance =
+ dynamic_cast<
+ PgwsNodeLevelLoadControlInformationInDeleteSessionResponse&>(ieObject.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.decodePgwsNodeLevelLoadControlInformationInDeleteSessionResponse(buffer, data.pgwsNodeLevelLoadControlInformation, ieHeader.length);
+
+ data.pgwsNodeLevelLoadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: pgwsNodeLevelLoadControlInformation\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ PgwsApnLevelLoadControlInformationInDeleteSessionResponse groupedIeInstance =
+ dynamic_cast<
+ PgwsApnLevelLoadControlInformationInDeleteSessionResponse&>(ieObject.getGroupedIe(msgType, 1));
+ rc = groupedIeInstance.decodePgwsApnLevelLoadControlInformationInDeleteSessionResponse(buffer, data.pgwsApnLevelLoadControlInformation, ieHeader.length);
+
+ data.pgwsApnLevelLoadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: pgwsApnLevelLoadControlInformation\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 2)
+ {
+ SgwsNodeLevelLoadControlInformationInDeleteSessionResponse groupedIeInstance =
+ dynamic_cast<
+ SgwsNodeLevelLoadControlInformationInDeleteSessionResponse&>(ieObject.getGroupedIe(msgType, 2));
+ rc = groupedIeInstance.decodeSgwsNodeLevelLoadControlInformationInDeleteSessionResponse(buffer, data.sgwsNodeLevelLoadControlInformation, ieHeader.length);
+
+ data.sgwsNodeLevelLoadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: sgwsNodeLevelLoadControlInformation\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case OverloadControlInformationIeType:
+ {
+ OverloadControlInformationIe ieObject =
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ PgwsOverloadControlInformationInDeleteSessionResponse groupedIeInstance =
+ dynamic_cast<
+ PgwsOverloadControlInformationInDeleteSessionResponse&>(ieObject.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.decodePgwsOverloadControlInformationInDeleteSessionResponse(buffer, data.pgwsOverloadControlInformation, ieHeader.length);
+
+ data.pgwsOverloadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: pgwsOverloadControlInformation\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ SgwsOverloadControlInformationInDeleteSessionResponse groupedIeInstance =
+ dynamic_cast<
+ SgwsOverloadControlInformationInDeleteSessionResponse&>(ieObject.getGroupedIe(msgType, 1));
+ rc = groupedIeInstance.decodeSgwsOverloadControlInformationInDeleteSessionResponse(buffer, data.sgwsOverloadControlInformation, ieHeader.length);
+
+ data.sgwsOverloadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: sgwsOverloadControlInformation\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case EpcoIeType:
+ {
+ EpcoIe ieObject =
+ dynamic_cast<
+ EpcoIe&>(GtpV2IeFactory::getInstance().getIeObject(EpcoIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeEpcoIe(buffer, data.extendedProtocolConfigurationOptions, ieHeader.length);
+
+ data.extendedProtocolConfigurationOptionsIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: extendedProtocolConfigurationOptions\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ default:
+ {
+ // Unknown IE print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ }
+ }
+ return rc; // TODO validations
+}
+
+void DeleteSessionResponseMsg::
+displayDeleteSessionResponseMsgData_v(DeleteSessionResponseMsgData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"DeleteSessionResponseMsg:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+ stream.add((char *)"IE - cause:");
+ stream.endOfLine();
+ CauseIe cause=
+ dynamic_cast<
+ CauseIe&>(GtpV2IeFactory::getInstance().getIeObject(CauseIeType));
+ cause.displayCauseIe_v(data.cause, stream);
+
+ if (data.recoveryIePresent)
+ {
+
+
+ stream.add((char *)"IE - recovery:");
+ stream.endOfLine();
+ RecoveryIe recovery=
+ dynamic_cast<
+ RecoveryIe&>(GtpV2IeFactory::getInstance().getIeObject(RecoveryIeType));
+ recovery.displayRecoveryIe_v(data.recovery, stream);
+
+ }
+ if (data.protocolConfigurationOptionsIePresent)
+ {
+
+
+ stream.add((char *)"IE - protocolConfigurationOptions:");
+ stream.endOfLine();
+ PcoIe pco=
+ dynamic_cast<
+ PcoIe&>(GtpV2IeFactory::getInstance().getIeObject(PcoIeType));
+ pco.displayPcoIe_v(data.protocolConfigurationOptions, stream);
+
+ }
+ if (data.indicationFlagsIePresent)
+ {
+
+
+ stream.add((char *)"IE - indicationFlags:");
+ stream.endOfLine();
+ IndicationIe indication=
+ dynamic_cast<
+ IndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(IndicationIeType));
+ indication.displayIndicationIe_v(data.indicationFlags, stream);
+
+ }
+ if (data.pgwsNodeLevelLoadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - pgwsNodeLevelLoadControlInformation:");
+ stream.endOfLine();
+ LoadControlInformationIe loadControlInformation=
+ dynamic_cast<
+ LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType));
+ PgwsNodeLevelLoadControlInformationInDeleteSessionResponse groupedIeInstance =
+ dynamic_cast<
+ PgwsNodeLevelLoadControlInformationInDeleteSessionResponse&>(loadControlInformation.getGroupedIe(msgType, 0));
+ groupedIeInstance.displayPgwsNodeLevelLoadControlInformationInDeleteSessionResponseData_v(data.pgwsNodeLevelLoadControlInformation, stream);
+
+ }
+ if (data.pgwsApnLevelLoadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - pgwsApnLevelLoadControlInformation:");
+ stream.endOfLine();
+ LoadControlInformationIe loadControlInformation=
+ dynamic_cast<
+ LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType));
+ PgwsApnLevelLoadControlInformationInDeleteSessionResponse groupedIeInstance =
+ dynamic_cast<
+ PgwsApnLevelLoadControlInformationInDeleteSessionResponse&>(loadControlInformation.getGroupedIe(msgType, 1));
+ groupedIeInstance.displayPgwsApnLevelLoadControlInformationInDeleteSessionResponseData_v(data.pgwsApnLevelLoadControlInformation, stream);
+
+ }
+ if (data.sgwsNodeLevelLoadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - sgwsNodeLevelLoadControlInformation:");
+ stream.endOfLine();
+ LoadControlInformationIe loadControlInformation=
+ dynamic_cast<
+ LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType));
+ SgwsNodeLevelLoadControlInformationInDeleteSessionResponse groupedIeInstance =
+ dynamic_cast<
+ SgwsNodeLevelLoadControlInformationInDeleteSessionResponse&>(loadControlInformation.getGroupedIe(msgType, 2));
+ groupedIeInstance.displaySgwsNodeLevelLoadControlInformationInDeleteSessionResponseData_v(data.sgwsNodeLevelLoadControlInformation, stream);
+
+ }
+ if (data.pgwsOverloadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - pgwsOverloadControlInformation:");
+ stream.endOfLine();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ PgwsOverloadControlInformationInDeleteSessionResponse groupedIeInstance =
+ dynamic_cast<
+ PgwsOverloadControlInformationInDeleteSessionResponse&>(overloadControlInformation.getGroupedIe(msgType, 0));
+ groupedIeInstance.displayPgwsOverloadControlInformationInDeleteSessionResponseData_v(data.pgwsOverloadControlInformation, stream);
+
+ }
+ if (data.sgwsOverloadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - sgwsOverloadControlInformation:");
+ stream.endOfLine();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ SgwsOverloadControlInformationInDeleteSessionResponse groupedIeInstance =
+ dynamic_cast<
+ SgwsOverloadControlInformationInDeleteSessionResponse&>(overloadControlInformation.getGroupedIe(msgType, 1));
+ groupedIeInstance.displaySgwsOverloadControlInformationInDeleteSessionResponseData_v(data.sgwsOverloadControlInformation, stream);
+
+ }
+ if (data.extendedProtocolConfigurationOptionsIePresent)
+ {
+
+
+ stream.add((char *)"IE - extendedProtocolConfigurationOptions:");
+ stream.endOfLine();
+ EpcoIe epco=
+ dynamic_cast<
+ EpcoIe&>(GtpV2IeFactory::getInstance().getIeObject(EpcoIeType));
+ epco.displayEpcoIe_v(data.extendedProtocolConfigurationOptions, stream);
+
+ }
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
diff --git a/src/gtpV2Codec/msgClasses/deleteSessionResponseMsg.h b/src/gtpV2Codec/msgClasses/deleteSessionResponseMsg.h
new file mode 100644
index 0000000..294a670
--- /dev/null
+++ b/src/gtpV2Codec/msgClasses/deleteSessionResponseMsg.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2019-present, Infosys Limited.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ /******************************************************************************
+ *
+ * This is an auto generated file.
+ * Please do not edit this file.
+ * All edits to be made through template source file
+ * <TOP-DIR/scripts/GtpV2StackCodeGen/tts/msgtemplate.h.tt>
+ ******************************************************************************/
+#ifndef DELETESESSIONRESPONSEMSG_H_
+#define DELETESESSIONRESPONSEMSG_H_
+
+#include <set>
+#include "manual/gtpV2Message.h"
+#include <msgBuffer.h>
+#include <debug.h>
+#include "gtpV2MsgDataTypes.h"
+
+
+class DeleteSessionResponseMsg:public GtpV2Message
+{
+public:
+ DeleteSessionResponseMsg();
+ virtual ~DeleteSessionResponseMsg();
+ bool encodeDeleteSessionResponseMsg(MsgBuffer &buffer, DeleteSessionResponseMsgData const &data);
+
+ bool decodeDeleteSessionResponseMsg (MsgBuffer &buffer, DeleteSessionResponseMsgData& data, Uint16 length);
+
+ void displayDeleteSessionResponseMsgData_v(DeleteSessionResponseMsgData const &data, Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/msgClasses/downlinkDataNotificationAcknowledgeMsg.cpp b/src/gtpV2Codec/msgClasses/downlinkDataNotificationAcknowledgeMsg.cpp
new file mode 100644
index 0000000..1500662
--- /dev/null
+++ b/src/gtpV2Codec/msgClasses/downlinkDataNotificationAcknowledgeMsg.cpp
@@ -0,0 +1,582 @@
+/*
+ * Copyright 2019-present Infosys Limited
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+/******************************************************************************
+ *
+ * This is an auto generated file.
+ * Please do not edit this file.
+ * All edits to be made through template source file
+ * <TOP-DIR/scripts/GtpV2StackCodeGen/tts/msgtemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "downlinkDataNotificationAcknowledgeMsg.h"
+#include "../ieClasses/manual/gtpV2Ie.h"
+#include "../ieClasses/gtpV2IeFactory.h"
+#include "../ieClasses/causeIe.h"
+#include "../ieClasses/delayValueIe.h"
+#include "../ieClasses/recoveryIe.h"
+#include "../ieClasses/throttlingIe.h"
+#include "../ieClasses/imsiIe.h"
+#include "../ieClasses/epcTimerIe.h"
+#include "../ieClasses/integerNumberIe.h"
+
+DownlinkDataNotificationAcknowledgeMsg::DownlinkDataNotificationAcknowledgeMsg()
+{
+ msgType = DownlinkDataNotificationAcknowledgeMsgType;
+ Uint16 mandIe;
+ mandIe = CauseIeType;
+ mandIe = (mandIe << 8) | 0; // cause
+ mandatoryIeSet.insert(mandIe);
+}
+
+DownlinkDataNotificationAcknowledgeMsg::~DownlinkDataNotificationAcknowledgeMsg()
+{
+
+}
+
+bool DownlinkDataNotificationAcknowledgeMsg::encodeDownlinkDataNotificationAcknowledgeMsg(MsgBuffer &buffer,
+ DownlinkDataNotificationAcknowledgeMsgData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+ // Encode the Ie Header
+ header.ieType = CauseIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ CauseIe cause=
+ dynamic_cast<
+ CauseIe&>(GtpV2IeFactory::getInstance().getIeObject(CauseIeType));
+ rc = cause.encodeCauseIe(buffer, data.cause);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: cause\n");
+ return false;
+ }
+
+ if (data.dataNotificationDelayIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = DelayValueIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ DelayValueIe delayValue=
+ dynamic_cast<
+ DelayValueIe&>(GtpV2IeFactory::getInstance().getIeObject(DelayValueIeType));
+ rc = delayValue.encodeDelayValueIe(buffer, data.dataNotificationDelay);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: dataNotificationDelay\n");
+ return false;
+ }
+ }
+
+ if (data.recoveryIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = RecoveryIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ RecoveryIe recovery=
+ dynamic_cast<
+ RecoveryIe&>(GtpV2IeFactory::getInstance().getIeObject(RecoveryIeType));
+ rc = recovery.encodeRecoveryIe(buffer, data.recovery);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: recovery\n");
+ return false;
+ }
+ }
+
+ if (data.dlLowPriorityTrafficThrottlingIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = ThrottlingIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ ThrottlingIe throttling=
+ dynamic_cast<
+ ThrottlingIe&>(GtpV2IeFactory::getInstance().getIeObject(ThrottlingIeType));
+ rc = throttling.encodeThrottlingIe(buffer, data.dlLowPriorityTrafficThrottling);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: dlLowPriorityTrafficThrottling\n");
+ return false;
+ }
+ }
+
+ if (data.imsiIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = ImsiIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ ImsiIe imsi=
+ dynamic_cast<
+ ImsiIe&>(GtpV2IeFactory::getInstance().getIeObject(ImsiIeType));
+ rc = imsi.encodeImsiIe(buffer, data.imsi);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: imsi\n");
+ return false;
+ }
+ }
+
+ if (data.dlBufferingDurationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = EpcTimerIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ EpcTimerIe epcTimer=
+ dynamic_cast<
+ EpcTimerIe&>(GtpV2IeFactory::getInstance().getIeObject(EpcTimerIeType));
+ rc = epcTimer.encodeEpcTimerIe(buffer, data.dlBufferingDuration);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: dlBufferingDuration\n");
+ return false;
+ }
+ }
+
+ if (data.dlBufferingSuggestedPacketCountIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = IntegerNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ IntegerNumberIe integerNumber=
+ dynamic_cast<
+ IntegerNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(IntegerNumberIeType));
+ rc = integerNumber.encodeIntegerNumberIe(buffer, data.dlBufferingSuggestedPacketCount);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: dlBufferingSuggestedPacketCount\n");
+ return false;
+ }
+ }
+ return rc;
+
+}
+
+bool DownlinkDataNotificationAcknowledgeMsg::decodeDownlinkDataNotificationAcknowledgeMsg(MsgBuffer &buffer,
+ DownlinkDataNotificationAcknowledgeMsgData
+ &data, Uint16 length)
+{
+
+ bool rc = false;
+ GtpV2IeHeader ieHeader;
+
+ set<Uint16> mandatoryIeLocalList = mandatoryIeSet;
+ while (buffer.lengthLeft() > IE_HEADER_SIZE)
+ {
+ GtpV2Ie::decodeGtpV2IeHeader(buffer, ieHeader);
+ if (ieHeader.length > buffer.lengthLeft())
+ {
+ // We do not have enough bytes left in the message for this IE
+ errorStream.add((char *)"IE Length exceeds beyond message boundary\n");
+ errorStream.add((char *)" Offending IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.add((char *)"\n Ie Length in Header: ");
+ errorStream.add(ieHeader.length);
+ errorStream.add((char *)"\n Bytes left in message: ");
+ errorStream.add(buffer.lengthLeft());
+ errorStream.endOfLine();
+ return false;
+ }
+
+ switch (ieHeader.ieType){
+
+ case CauseIeType:
+ {
+ CauseIe ieObject =
+ dynamic_cast<
+ CauseIe&>(GtpV2IeFactory::getInstance().getIeObject(CauseIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeCauseIe(buffer, data.cause, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: cause\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case DelayValueIeType:
+ {
+ DelayValueIe ieObject =
+ dynamic_cast<
+ DelayValueIe&>(GtpV2IeFactory::getInstance().getIeObject(DelayValueIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeDelayValueIe(buffer, data.dataNotificationDelay, ieHeader.length);
+
+ data.dataNotificationDelayIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: dataNotificationDelay\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case RecoveryIeType:
+ {
+ RecoveryIe ieObject =
+ dynamic_cast<
+ RecoveryIe&>(GtpV2IeFactory::getInstance().getIeObject(RecoveryIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeRecoveryIe(buffer, data.recovery, ieHeader.length);
+
+ data.recoveryIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: recovery\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case ThrottlingIeType:
+ {
+ ThrottlingIe ieObject =
+ dynamic_cast<
+ ThrottlingIe&>(GtpV2IeFactory::getInstance().getIeObject(ThrottlingIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeThrottlingIe(buffer, data.dlLowPriorityTrafficThrottling, ieHeader.length);
+
+ data.dlLowPriorityTrafficThrottlingIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: dlLowPriorityTrafficThrottling\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case ImsiIeType:
+ {
+ ImsiIe ieObject =
+ dynamic_cast<
+ ImsiIe&>(GtpV2IeFactory::getInstance().getIeObject(ImsiIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeImsiIe(buffer, data.imsi, ieHeader.length);
+
+ data.imsiIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: imsi\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case EpcTimerIeType:
+ {
+ EpcTimerIe ieObject =
+ dynamic_cast<
+ EpcTimerIe&>(GtpV2IeFactory::getInstance().getIeObject(EpcTimerIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeEpcTimerIe(buffer, data.dlBufferingDuration, ieHeader.length);
+
+ data.dlBufferingDurationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: dlBufferingDuration\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case IntegerNumberIeType:
+ {
+ IntegerNumberIe ieObject =
+ dynamic_cast<
+ IntegerNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(IntegerNumberIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeIntegerNumberIe(buffer, data.dlBufferingSuggestedPacketCount, ieHeader.length);
+
+ data.dlBufferingSuggestedPacketCountIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: dlBufferingSuggestedPacketCount\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ default:
+ {
+ // Unknown IE print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ }
+ }
+ return rc; // TODO validations
+}
+
+void DownlinkDataNotificationAcknowledgeMsg::
+displayDownlinkDataNotificationAcknowledgeMsgData_v(DownlinkDataNotificationAcknowledgeMsgData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"DownlinkDataNotificationAcknowledgeMsg:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+ stream.add((char *)"IE - cause:");
+ stream.endOfLine();
+ CauseIe cause=
+ dynamic_cast<
+ CauseIe&>(GtpV2IeFactory::getInstance().getIeObject(CauseIeType));
+ cause.displayCauseIe_v(data.cause, stream);
+
+ if (data.dataNotificationDelayIePresent)
+ {
+
+
+ stream.add((char *)"IE - dataNotificationDelay:");
+ stream.endOfLine();
+ DelayValueIe delayValue=
+ dynamic_cast<
+ DelayValueIe&>(GtpV2IeFactory::getInstance().getIeObject(DelayValueIeType));
+ delayValue.displayDelayValueIe_v(data.dataNotificationDelay, stream);
+
+ }
+ if (data.recoveryIePresent)
+ {
+
+
+ stream.add((char *)"IE - recovery:");
+ stream.endOfLine();
+ RecoveryIe recovery=
+ dynamic_cast<
+ RecoveryIe&>(GtpV2IeFactory::getInstance().getIeObject(RecoveryIeType));
+ recovery.displayRecoveryIe_v(data.recovery, stream);
+
+ }
+ if (data.dlLowPriorityTrafficThrottlingIePresent)
+ {
+
+
+ stream.add((char *)"IE - dlLowPriorityTrafficThrottling:");
+ stream.endOfLine();
+ ThrottlingIe throttling=
+ dynamic_cast<
+ ThrottlingIe&>(GtpV2IeFactory::getInstance().getIeObject(ThrottlingIeType));
+ throttling.displayThrottlingIe_v(data.dlLowPriorityTrafficThrottling, stream);
+
+ }
+ if (data.imsiIePresent)
+ {
+
+
+ stream.add((char *)"IE - imsi:");
+ stream.endOfLine();
+ ImsiIe imsi=
+ dynamic_cast<
+ ImsiIe&>(GtpV2IeFactory::getInstance().getIeObject(ImsiIeType));
+ imsi.displayImsiIe_v(data.imsi, stream);
+
+ }
+ if (data.dlBufferingDurationIePresent)
+ {
+
+
+ stream.add((char *)"IE - dlBufferingDuration:");
+ stream.endOfLine();
+ EpcTimerIe epcTimer=
+ dynamic_cast<
+ EpcTimerIe&>(GtpV2IeFactory::getInstance().getIeObject(EpcTimerIeType));
+ epcTimer.displayEpcTimerIe_v(data.dlBufferingDuration, stream);
+
+ }
+ if (data.dlBufferingSuggestedPacketCountIePresent)
+ {
+
+
+ stream.add((char *)"IE - dlBufferingSuggestedPacketCount:");
+ stream.endOfLine();
+ IntegerNumberIe integerNumber=
+ dynamic_cast<
+ IntegerNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(IntegerNumberIeType));
+ integerNumber.displayIntegerNumberIe_v(data.dlBufferingSuggestedPacketCount, stream);
+
+ }
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
diff --git a/src/gtpV2Codec/msgClasses/downlinkDataNotificationAcknowledgeMsg.h b/src/gtpV2Codec/msgClasses/downlinkDataNotificationAcknowledgeMsg.h
new file mode 100644
index 0000000..7557d27
--- /dev/null
+++ b/src/gtpV2Codec/msgClasses/downlinkDataNotificationAcknowledgeMsg.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2019-present, Infosys Limited.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ /******************************************************************************
+ *
+ * This is an auto generated file.
+ * Please do not edit this file.
+ * All edits to be made through template source file
+ * <TOP-DIR/scripts/GtpV2StackCodeGen/tts/msgtemplate.h.tt>
+ ******************************************************************************/
+#ifndef DOWNLINKDATANOTIFICATIONACKNOWLEDGEMSG_H_
+#define DOWNLINKDATANOTIFICATIONACKNOWLEDGEMSG_H_
+
+#include <set>
+#include "manual/gtpV2Message.h"
+#include <msgBuffer.h>
+#include <debug.h>
+#include "gtpV2MsgDataTypes.h"
+
+
+class DownlinkDataNotificationAcknowledgeMsg:public GtpV2Message
+{
+public:
+ DownlinkDataNotificationAcknowledgeMsg();
+ virtual ~DownlinkDataNotificationAcknowledgeMsg();
+ bool encodeDownlinkDataNotificationAcknowledgeMsg(MsgBuffer &buffer, DownlinkDataNotificationAcknowledgeMsgData const &data);
+
+ bool decodeDownlinkDataNotificationAcknowledgeMsg (MsgBuffer &buffer, DownlinkDataNotificationAcknowledgeMsgData& data, Uint16 length);
+
+ void displayDownlinkDataNotificationAcknowledgeMsgData_v(DownlinkDataNotificationAcknowledgeMsgData const &data, Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/msgClasses/downlinkDataNotificationFailureIndicationMsg.cpp b/src/gtpV2Codec/msgClasses/downlinkDataNotificationFailureIndicationMsg.cpp
new file mode 100644
index 0000000..538220d
--- /dev/null
+++ b/src/gtpV2Codec/msgClasses/downlinkDataNotificationFailureIndicationMsg.cpp
@@ -0,0 +1,302 @@
+/*
+ * Copyright 2019-present Infosys Limited
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+/******************************************************************************
+ *
+ * This is an auto generated file.
+ * Please do not edit this file.
+ * All edits to be made through template source file
+ * <TOP-DIR/scripts/GtpV2StackCodeGen/tts/msgtemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "downlinkDataNotificationFailureIndicationMsg.h"
+#include "../ieClasses/manual/gtpV2Ie.h"
+#include "../ieClasses/gtpV2IeFactory.h"
+#include "../ieClasses/causeIe.h"
+#include "../ieClasses/nodeTypeIe.h"
+#include "../ieClasses/imsiIe.h"
+
+DownlinkDataNotificationFailureIndicationMsg::DownlinkDataNotificationFailureIndicationMsg()
+{
+ msgType = DownlinkDataNotificationFailureIndicationMsgType;
+ Uint16 mandIe;
+ mandIe = CauseIeType;
+ mandIe = (mandIe << 8) | 0; // cause
+ mandatoryIeSet.insert(mandIe);
+}
+
+DownlinkDataNotificationFailureIndicationMsg::~DownlinkDataNotificationFailureIndicationMsg()
+{
+
+}
+
+bool DownlinkDataNotificationFailureIndicationMsg::encodeDownlinkDataNotificationFailureIndicationMsg(MsgBuffer &buffer,
+ DownlinkDataNotificationFailureIndicationMsgData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+ // Encode the Ie Header
+ header.ieType = CauseIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ CauseIe cause=
+ dynamic_cast<
+ CauseIe&>(GtpV2IeFactory::getInstance().getIeObject(CauseIeType));
+ rc = cause.encodeCauseIe(buffer, data.cause);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: cause\n");
+ return false;
+ }
+
+ if (data.originatingNodeIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = NodeTypeIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ NodeTypeIe nodeType=
+ dynamic_cast<
+ NodeTypeIe&>(GtpV2IeFactory::getInstance().getIeObject(NodeTypeIeType));
+ rc = nodeType.encodeNodeTypeIe(buffer, data.originatingNode);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: originatingNode\n");
+ return false;
+ }
+ }
+
+ if (data.imsiIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = ImsiIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ ImsiIe imsi=
+ dynamic_cast<
+ ImsiIe&>(GtpV2IeFactory::getInstance().getIeObject(ImsiIeType));
+ rc = imsi.encodeImsiIe(buffer, data.imsi);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: imsi\n");
+ return false;
+ }
+ }
+ return rc;
+
+}
+
+bool DownlinkDataNotificationFailureIndicationMsg::decodeDownlinkDataNotificationFailureIndicationMsg(MsgBuffer &buffer,
+ DownlinkDataNotificationFailureIndicationMsgData
+ &data, Uint16 length)
+{
+
+ bool rc = false;
+ GtpV2IeHeader ieHeader;
+
+ set<Uint16> mandatoryIeLocalList = mandatoryIeSet;
+ while (buffer.lengthLeft() > IE_HEADER_SIZE)
+ {
+ GtpV2Ie::decodeGtpV2IeHeader(buffer, ieHeader);
+ if (ieHeader.length > buffer.lengthLeft())
+ {
+ // We do not have enough bytes left in the message for this IE
+ errorStream.add((char *)"IE Length exceeds beyond message boundary\n");
+ errorStream.add((char *)" Offending IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.add((char *)"\n Ie Length in Header: ");
+ errorStream.add(ieHeader.length);
+ errorStream.add((char *)"\n Bytes left in message: ");
+ errorStream.add(buffer.lengthLeft());
+ errorStream.endOfLine();
+ return false;
+ }
+
+ switch (ieHeader.ieType){
+
+ case CauseIeType:
+ {
+ CauseIe ieObject =
+ dynamic_cast<
+ CauseIe&>(GtpV2IeFactory::getInstance().getIeObject(CauseIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeCauseIe(buffer, data.cause, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: cause\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case NodeTypeIeType:
+ {
+ NodeTypeIe ieObject =
+ dynamic_cast<
+ NodeTypeIe&>(GtpV2IeFactory::getInstance().getIeObject(NodeTypeIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeNodeTypeIe(buffer, data.originatingNode, ieHeader.length);
+
+ data.originatingNodeIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: originatingNode\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case ImsiIeType:
+ {
+ ImsiIe ieObject =
+ dynamic_cast<
+ ImsiIe&>(GtpV2IeFactory::getInstance().getIeObject(ImsiIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeImsiIe(buffer, data.imsi, ieHeader.length);
+
+ data.imsiIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: imsi\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ default:
+ {
+ // Unknown IE print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ }
+ }
+ return rc; // TODO validations
+}
+
+void DownlinkDataNotificationFailureIndicationMsg::
+displayDownlinkDataNotificationFailureIndicationMsgData_v(DownlinkDataNotificationFailureIndicationMsgData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"DownlinkDataNotificationFailureIndicationMsg:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+ stream.add((char *)"IE - cause:");
+ stream.endOfLine();
+ CauseIe cause=
+ dynamic_cast<
+ CauseIe&>(GtpV2IeFactory::getInstance().getIeObject(CauseIeType));
+ cause.displayCauseIe_v(data.cause, stream);
+
+ if (data.originatingNodeIePresent)
+ {
+
+
+ stream.add((char *)"IE - originatingNode:");
+ stream.endOfLine();
+ NodeTypeIe nodeType=
+ dynamic_cast<
+ NodeTypeIe&>(GtpV2IeFactory::getInstance().getIeObject(NodeTypeIeType));
+ nodeType.displayNodeTypeIe_v(data.originatingNode, stream);
+
+ }
+ if (data.imsiIePresent)
+ {
+
+
+ stream.add((char *)"IE - imsi:");
+ stream.endOfLine();
+ ImsiIe imsi=
+ dynamic_cast<
+ ImsiIe&>(GtpV2IeFactory::getInstance().getIeObject(ImsiIeType));
+ imsi.displayImsiIe_v(data.imsi, stream);
+
+ }
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
diff --git a/src/gtpV2Codec/msgClasses/downlinkDataNotificationFailureIndicationMsg.h b/src/gtpV2Codec/msgClasses/downlinkDataNotificationFailureIndicationMsg.h
new file mode 100644
index 0000000..205ce64
--- /dev/null
+++ b/src/gtpV2Codec/msgClasses/downlinkDataNotificationFailureIndicationMsg.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2019-present, Infosys Limited.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ /******************************************************************************
+ *
+ * This is an auto generated file.
+ * Please do not edit this file.
+ * All edits to be made through template source file
+ * <TOP-DIR/scripts/GtpV2StackCodeGen/tts/msgtemplate.h.tt>
+ ******************************************************************************/
+#ifndef DOWNLINKDATANOTIFICATIONFAILUREINDICATIONMSG_H_
+#define DOWNLINKDATANOTIFICATIONFAILUREINDICATIONMSG_H_
+
+#include <set>
+#include "manual/gtpV2Message.h"
+#include <msgBuffer.h>
+#include <debug.h>
+#include "gtpV2MsgDataTypes.h"
+
+
+class DownlinkDataNotificationFailureIndicationMsg:public GtpV2Message
+{
+public:
+ DownlinkDataNotificationFailureIndicationMsg();
+ virtual ~DownlinkDataNotificationFailureIndicationMsg();
+ bool encodeDownlinkDataNotificationFailureIndicationMsg(MsgBuffer &buffer, DownlinkDataNotificationFailureIndicationMsgData const &data);
+
+ bool decodeDownlinkDataNotificationFailureIndicationMsg (MsgBuffer &buffer, DownlinkDataNotificationFailureIndicationMsgData& data, Uint16 length);
+
+ void displayDownlinkDataNotificationFailureIndicationMsgData_v(DownlinkDataNotificationFailureIndicationMsgData const &data, Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/msgClasses/downlinkDataNotificationMsg.cpp b/src/gtpV2Codec/msgClasses/downlinkDataNotificationMsg.cpp
new file mode 100644
index 0000000..3c5c0e5
--- /dev/null
+++ b/src/gtpV2Codec/msgClasses/downlinkDataNotificationMsg.cpp
@@ -0,0 +1,748 @@
+/*
+ * Copyright 2019-present Infosys Limited
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+/******************************************************************************
+ *
+ * This is an auto generated file.
+ * Please do not edit this file.
+ * All edits to be made through template source file
+ * <TOP-DIR/scripts/GtpV2StackCodeGen/tts/msgtemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "downlinkDataNotificationMsg.h"
+#include "../ieClasses/manual/gtpV2Ie.h"
+#include "../ieClasses/gtpV2IeFactory.h"
+#include "../ieClasses/causeIe.h"
+#include "../ieClasses/ebiIe.h"
+#include "../ieClasses/arpIe.h"
+#include "../ieClasses/imsiIe.h"
+#include "../ieClasses/fTeidIe.h"
+#include "../ieClasses/indicationIe.h"
+#include "../ieClasses/loadControlInformationIe.h"
+#include "../ieClasses/sgwsNodeLevelLoadControlInformationInDownlinkDataNotification.h"
+#include "../ieClasses/overloadControlInformationIe.h"
+#include "../ieClasses/sgwsOverloadControlInformationInDownlinkDataNotification.h"
+#include "../ieClasses/pagingAndServiceInformationIe.h"
+
+DownlinkDataNotificationMsg::DownlinkDataNotificationMsg()
+{
+ msgType = DownlinkDataNotificationMsgType;
+
+}
+
+DownlinkDataNotificationMsg::~DownlinkDataNotificationMsg()
+{
+
+}
+
+bool DownlinkDataNotificationMsg::encodeDownlinkDataNotificationMsg(MsgBuffer &buffer,
+ DownlinkDataNotificationMsgData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+ if (data.causeIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = CauseIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ CauseIe cause=
+ dynamic_cast<
+ CauseIe&>(GtpV2IeFactory::getInstance().getIeObject(CauseIeType));
+ rc = cause.encodeCauseIe(buffer, data.cause);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: cause\n");
+ return false;
+ }
+ }
+
+ if (data.epsBearerIdIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = EbiIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ EbiIe ebi=
+ dynamic_cast<
+ EbiIe&>(GtpV2IeFactory::getInstance().getIeObject(EbiIeType));
+ rc = ebi.encodeEbiIe(buffer, data.epsBearerId);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: epsBearerId\n");
+ return false;
+ }
+ }
+
+ if (data.allocationRetentionPriorityIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = ArpIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ ArpIe arp=
+ dynamic_cast<
+ ArpIe&>(GtpV2IeFactory::getInstance().getIeObject(ArpIeType));
+ rc = arp.encodeArpIe(buffer, data.allocationRetentionPriority);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: allocationRetentionPriority\n");
+ return false;
+ }
+ }
+
+ if (data.imsiIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = ImsiIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ ImsiIe imsi=
+ dynamic_cast<
+ ImsiIe&>(GtpV2IeFactory::getInstance().getIeObject(ImsiIeType));
+ rc = imsi.encodeImsiIe(buffer, data.imsi);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: imsi\n");
+ return false;
+ }
+ }
+
+ if (data.senderFTeidForControlPlaneIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FTeidIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ rc = fTeid.encodeFTeidIe(buffer, data.senderFTeidForControlPlane);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: senderFTeidForControlPlane\n");
+ return false;
+ }
+ }
+
+ if (data.indicationFlagsIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = IndicationIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ IndicationIe indication=
+ dynamic_cast<
+ IndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(IndicationIeType));
+ rc = indication.encodeIndicationIe(buffer, data.indicationFlags);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: indicationFlags\n");
+ return false;
+ }
+ }
+
+ if (data.sgwsNodeLevelLoadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = LoadControlInformationIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ LoadControlInformationIe loadControlInformation=
+ dynamic_cast<
+ LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType));
+ SgwsNodeLevelLoadControlInformationInDownlinkDataNotification groupedIeInstance =
+ dynamic_cast<
+ SgwsNodeLevelLoadControlInformationInDownlinkDataNotification&>(loadControlInformation.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.encodeSgwsNodeLevelLoadControlInformationInDownlinkDataNotification(buffer, data.sgwsNodeLevelLoadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: sgwsNodeLevelLoadControlInformation\n");
+ return false;
+ }
+ }
+
+ if (data.sgwsOverloadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = OverloadControlInformationIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ SgwsOverloadControlInformationInDownlinkDataNotification groupedIeInstance =
+ dynamic_cast<
+ SgwsOverloadControlInformationInDownlinkDataNotification&>(overloadControlInformation.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.encodeSgwsOverloadControlInformationInDownlinkDataNotification(buffer, data.sgwsOverloadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: sgwsOverloadControlInformation\n");
+ return false;
+ }
+ }
+
+ if (data.pagingAndServiceInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = PagingAndServiceInformationIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ PagingAndServiceInformationIe pagingAndServiceInformation=
+ dynamic_cast<
+ PagingAndServiceInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(PagingAndServiceInformationIeType));
+ rc = pagingAndServiceInformation.encodePagingAndServiceInformationIe(buffer, data.pagingAndServiceInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: pagingAndServiceInformation\n");
+ return false;
+ }
+ }
+ return rc;
+
+}
+
+bool DownlinkDataNotificationMsg::decodeDownlinkDataNotificationMsg(MsgBuffer &buffer,
+ DownlinkDataNotificationMsgData
+ &data, Uint16 length)
+{
+
+ bool rc = false;
+ GtpV2IeHeader ieHeader;
+
+ set<Uint16> mandatoryIeLocalList = mandatoryIeSet;
+ while (buffer.lengthLeft() > IE_HEADER_SIZE)
+ {
+ GtpV2Ie::decodeGtpV2IeHeader(buffer, ieHeader);
+ if (ieHeader.length > buffer.lengthLeft())
+ {
+ // We do not have enough bytes left in the message for this IE
+ errorStream.add((char *)"IE Length exceeds beyond message boundary\n");
+ errorStream.add((char *)" Offending IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.add((char *)"\n Ie Length in Header: ");
+ errorStream.add(ieHeader.length);
+ errorStream.add((char *)"\n Bytes left in message: ");
+ errorStream.add(buffer.lengthLeft());
+ errorStream.endOfLine();
+ return false;
+ }
+
+ switch (ieHeader.ieType){
+
+ case CauseIeType:
+ {
+ CauseIe ieObject =
+ dynamic_cast<
+ CauseIe&>(GtpV2IeFactory::getInstance().getIeObject(CauseIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeCauseIe(buffer, data.cause, ieHeader.length);
+
+ data.causeIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: cause\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case EbiIeType:
+ {
+ EbiIe ieObject =
+ dynamic_cast<
+ EbiIe&>(GtpV2IeFactory::getInstance().getIeObject(EbiIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeEbiIe(buffer, data.epsBearerId, ieHeader.length);
+
+ data.epsBearerIdIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: epsBearerId\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case ArpIeType:
+ {
+ ArpIe ieObject =
+ dynamic_cast<
+ ArpIe&>(GtpV2IeFactory::getInstance().getIeObject(ArpIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeArpIe(buffer, data.allocationRetentionPriority, ieHeader.length);
+
+ data.allocationRetentionPriorityIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: allocationRetentionPriority\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case ImsiIeType:
+ {
+ ImsiIe ieObject =
+ dynamic_cast<
+ ImsiIe&>(GtpV2IeFactory::getInstance().getIeObject(ImsiIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeImsiIe(buffer, data.imsi, ieHeader.length);
+
+ data.imsiIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: imsi\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case FTeidIeType:
+ {
+ FTeidIe ieObject =
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeFTeidIe(buffer, data.senderFTeidForControlPlane, ieHeader.length);
+
+ data.senderFTeidForControlPlaneIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: senderFTeidForControlPlane\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case IndicationIeType:
+ {
+ IndicationIe ieObject =
+ dynamic_cast<
+ IndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(IndicationIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeIndicationIe(buffer, data.indicationFlags, ieHeader.length);
+
+ data.indicationFlagsIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: indicationFlags\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case LoadControlInformationIeType:
+ {
+ LoadControlInformationIe ieObject =
+ dynamic_cast<
+ LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ SgwsNodeLevelLoadControlInformationInDownlinkDataNotification groupedIeInstance =
+ dynamic_cast<
+ SgwsNodeLevelLoadControlInformationInDownlinkDataNotification&>(ieObject.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.decodeSgwsNodeLevelLoadControlInformationInDownlinkDataNotification(buffer, data.sgwsNodeLevelLoadControlInformation, ieHeader.length);
+
+ data.sgwsNodeLevelLoadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: sgwsNodeLevelLoadControlInformation\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case OverloadControlInformationIeType:
+ {
+ OverloadControlInformationIe ieObject =
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ SgwsOverloadControlInformationInDownlinkDataNotification groupedIeInstance =
+ dynamic_cast<
+ SgwsOverloadControlInformationInDownlinkDataNotification&>(ieObject.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.decodeSgwsOverloadControlInformationInDownlinkDataNotification(buffer, data.sgwsOverloadControlInformation, ieHeader.length);
+
+ data.sgwsOverloadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: sgwsOverloadControlInformation\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case PagingAndServiceInformationIeType:
+ {
+ PagingAndServiceInformationIe ieObject =
+ dynamic_cast<
+ PagingAndServiceInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(PagingAndServiceInformationIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodePagingAndServiceInformationIe(buffer, data.pagingAndServiceInformation, ieHeader.length);
+
+ data.pagingAndServiceInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: pagingAndServiceInformation\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ default:
+ {
+ // Unknown IE print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ }
+ }
+ return rc; // TODO validations
+}
+
+void DownlinkDataNotificationMsg::
+displayDownlinkDataNotificationMsgData_v(DownlinkDataNotificationMsgData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"DownlinkDataNotificationMsg:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+ if (data.causeIePresent)
+ {
+
+
+ stream.add((char *)"IE - cause:");
+ stream.endOfLine();
+ CauseIe cause=
+ dynamic_cast<
+ CauseIe&>(GtpV2IeFactory::getInstance().getIeObject(CauseIeType));
+ cause.displayCauseIe_v(data.cause, stream);
+
+ }
+ if (data.epsBearerIdIePresent)
+ {
+
+
+ stream.add((char *)"IE - epsBearerId:");
+ stream.endOfLine();
+ EbiIe ebi=
+ dynamic_cast<
+ EbiIe&>(GtpV2IeFactory::getInstance().getIeObject(EbiIeType));
+ ebi.displayEbiIe_v(data.epsBearerId, stream);
+
+ }
+ if (data.allocationRetentionPriorityIePresent)
+ {
+
+
+ stream.add((char *)"IE - allocationRetentionPriority:");
+ stream.endOfLine();
+ ArpIe arp=
+ dynamic_cast<
+ ArpIe&>(GtpV2IeFactory::getInstance().getIeObject(ArpIeType));
+ arp.displayArpIe_v(data.allocationRetentionPriority, stream);
+
+ }
+ if (data.imsiIePresent)
+ {
+
+
+ stream.add((char *)"IE - imsi:");
+ stream.endOfLine();
+ ImsiIe imsi=
+ dynamic_cast<
+ ImsiIe&>(GtpV2IeFactory::getInstance().getIeObject(ImsiIeType));
+ imsi.displayImsiIe_v(data.imsi, stream);
+
+ }
+ if (data.senderFTeidForControlPlaneIePresent)
+ {
+
+
+ stream.add((char *)"IE - senderFTeidForControlPlane:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.senderFTeidForControlPlane, stream);
+
+ }
+ if (data.indicationFlagsIePresent)
+ {
+
+
+ stream.add((char *)"IE - indicationFlags:");
+ stream.endOfLine();
+ IndicationIe indication=
+ dynamic_cast<
+ IndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(IndicationIeType));
+ indication.displayIndicationIe_v(data.indicationFlags, stream);
+
+ }
+ if (data.sgwsNodeLevelLoadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - sgwsNodeLevelLoadControlInformation:");
+ stream.endOfLine();
+ LoadControlInformationIe loadControlInformation=
+ dynamic_cast<
+ LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType));
+ SgwsNodeLevelLoadControlInformationInDownlinkDataNotification groupedIeInstance =
+ dynamic_cast<
+ SgwsNodeLevelLoadControlInformationInDownlinkDataNotification&>(loadControlInformation.getGroupedIe(msgType, 0));
+ groupedIeInstance.displaySgwsNodeLevelLoadControlInformationInDownlinkDataNotificationData_v(data.sgwsNodeLevelLoadControlInformation, stream);
+
+ }
+ if (data.sgwsOverloadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - sgwsOverloadControlInformation:");
+ stream.endOfLine();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ SgwsOverloadControlInformationInDownlinkDataNotification groupedIeInstance =
+ dynamic_cast<
+ SgwsOverloadControlInformationInDownlinkDataNotification&>(overloadControlInformation.getGroupedIe(msgType, 0));
+ groupedIeInstance.displaySgwsOverloadControlInformationInDownlinkDataNotificationData_v(data.sgwsOverloadControlInformation, stream);
+
+ }
+ if (data.pagingAndServiceInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - pagingAndServiceInformation:");
+ stream.endOfLine();
+ PagingAndServiceInformationIe pagingAndServiceInformation=
+ dynamic_cast<
+ PagingAndServiceInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(PagingAndServiceInformationIeType));
+ pagingAndServiceInformation.displayPagingAndServiceInformationIe_v(data.pagingAndServiceInformation, stream);
+
+ }
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
diff --git a/src/gtpV2Codec/msgClasses/downlinkDataNotificationMsg.h b/src/gtpV2Codec/msgClasses/downlinkDataNotificationMsg.h
new file mode 100644
index 0000000..d49f58e
--- /dev/null
+++ b/src/gtpV2Codec/msgClasses/downlinkDataNotificationMsg.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2019-present, Infosys Limited.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ /******************************************************************************
+ *
+ * This is an auto generated file.
+ * Please do not edit this file.
+ * All edits to be made through template source file
+ * <TOP-DIR/scripts/GtpV2StackCodeGen/tts/msgtemplate.h.tt>
+ ******************************************************************************/
+#ifndef DOWNLINKDATANOTIFICATIONMSG_H_
+#define DOWNLINKDATANOTIFICATIONMSG_H_
+
+#include <set>
+#include "manual/gtpV2Message.h"
+#include <msgBuffer.h>
+#include <debug.h>
+#include "gtpV2MsgDataTypes.h"
+
+
+class DownlinkDataNotificationMsg:public GtpV2Message
+{
+public:
+ DownlinkDataNotificationMsg();
+ virtual ~DownlinkDataNotificationMsg();
+ bool encodeDownlinkDataNotificationMsg(MsgBuffer &buffer, DownlinkDataNotificationMsgData const &data);
+
+ bool decodeDownlinkDataNotificationMsg (MsgBuffer &buffer, DownlinkDataNotificationMsgData& data, Uint16 length);
+
+ void displayDownlinkDataNotificationMsgData_v(DownlinkDataNotificationMsgData const &data, Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/msgClasses/gtpV2MsgDataTypes.h b/src/gtpV2Codec/msgClasses/gtpV2MsgDataTypes.h
new file mode 100644
index 0000000..b54d19a
--- /dev/null
+++ b/src/gtpV2Codec/msgClasses/gtpV2MsgDataTypes.h
@@ -0,0 +1,730 @@
+/*
+ * Copyright 2019-present, Infosys Limited.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ /******************************************************************************
+ *
+ * This is an auto generated file.
+ * Please do not edit this file.
+ * All edits to be made through template source file
+ * <TOP-DIR/scripts/GtpV2StackCodeGen/tts/msgDataTypetemplate.h.tt>
+ ******************************************************************************/
+#ifndef GTPV2MSGDATATYPES_H_
+#define GTPV2MSGDATATYPES_H_
+
+#include "../../gtpV2Codec/ieClasses/gtpV2GrpIeDataTypes.h"
+#include "../../gtpV2Codec/ieClasses/gtpV2IeDataTypes.h"
+
+typedef struct
+{
+ Uint8 msgType;
+ Uint16 msgLength;
+ bool teidPresent;
+ Uint32 teid;
+ Uint32 sequenceNumber;
+}GtpV2MessageHeader;
+
+typedef struct
+{
+ bool imsiIePresent;
+ bool msisdnIePresent;
+ bool meIdentityIePresent;
+ bool userLocationInformationIePresent;
+ bool servingNetworkIePresent;
+ bool indicationFlagsIePresent;
+ bool pgwS5S8AddressForControlPlaneOrPmipIePresent;
+ bool selectionModeIePresent;
+ bool pdnTypeIePresent;
+ bool pdnAddressAllocationIePresent;
+ bool maximumApnRestrictionIePresent;
+ bool aggregateMaximumBitRateIePresent;
+ bool linkedEpsBearerIdIePresent;
+ bool trustedWlanModeIndicationIePresent;
+ bool protocolConfigurationOptionsIePresent;
+ bool traceInformationIePresent;
+ bool recoveryIePresent;
+ bool mmeFqCsidIePresent;
+ bool sgwFqCsidIePresent;
+ bool epdgFqCsidIePresent;
+ bool twanFqCsidIePresent;
+ bool ueTimeZoneIePresent;
+ bool userCsgInformationIePresent;
+ bool chargingCharacteristicsIePresent;
+ bool mmeS4SgsnLdnIePresent;
+ bool sgwLdnIePresent;
+ bool epdgLdnIePresent;
+ bool twanLdnIePresent;
+ bool signallingPriorityIndicationIePresent;
+ bool ueLocalIpAddressIePresent;
+ bool ueUdpPortIePresent;
+ bool additionalProtocolConfigurationOptionsIePresent;
+ bool hNbLocalIpAddressIePresent;
+ bool hNbUdpPortIePresent;
+ bool mmeS4SgsnIdentifierIePresent;
+ bool twanIdentifierIePresent;
+ bool epdgIpAddressIePresent;
+ bool cnOperatorSelectionEntityIePresent;
+ bool mmeS4SgsnsOverloadControlInformationIePresent;
+ bool sgwsOverloadControlInformationIePresent;
+ bool twanEpdgsOverloadControlInformationIePresent;
+ bool originationTimeStampIePresent;
+ bool maximumWaitTimeIePresent;
+ bool wlanLocationInformationIePresent;
+ bool wlanLocationTimestampIePresent;
+ bool nbifomContainerIePresent;
+ bool remoteUeContextConnectedIePresent;
+ bool a3gppAaaServerIdentifierIePresent;
+ bool extendedProtocolConfigurationOptionsIePresent;
+ bool servingPlmnRateControlIePresent;
+ bool moExceptionDataCounterIePresent;
+ bool ueTcpPortIePresent;
+ bool mappedUeUsageTypeIePresent;
+ bool userLocationInformationForSgwIePresent;
+ bool sgwUNodeNameIePresent;
+ bool secondaryRatUsageDataReportIePresent;
+ bool upFunctionSelectionIndicationFlagsIePresent;
+
+
+ ImsiIeData imsi;
+ MsisdnIeData msisdn;
+ MeiIeData meIdentity;
+ UliIeData userLocationInformation;
+ ServingNetworkIeData servingNetwork;
+ RatTypeIeData ratType;
+ IndicationIeData indicationFlags;
+ FTeidIeData senderFTeidForControlPlane;
+ FTeidIeData pgwS5S8AddressForControlPlaneOrPmip;
+ ApnIeData accessPointName;
+ SelectionModeIeData selectionMode;
+ PdnTypeIeData pdnType;
+ PaaIeData pdnAddressAllocation;
+ ApnRestrictionIeData maximumApnRestriction;
+ AmbrIeData aggregateMaximumBitRate;
+ EbiIeData linkedEpsBearerId;
+ TwmiIeData trustedWlanModeIndication;
+ PcoIeData protocolConfigurationOptions;
+
+ Uint16 bearerContextsToBeCreatedCount;
+ BearerContextsToBeCreatedInCreateSessionRequestData bearerContextsToBeCreated[11];
+
+ Uint16 bearerContextsToBeRemovedCount;
+ BearerContextsToBeRemovedInCreateSessionRequestData bearerContextsToBeRemoved[11];
+ TraceInformationIeData traceInformation;
+ RecoveryIeData recovery;
+ FqCsidIeData mmeFqCsid;
+ FqCsidIeData sgwFqCsid;
+ FqCsidIeData epdgFqCsid;
+ FqCsidIeData twanFqCsid;
+ UeTimeZoneIeData ueTimeZone;
+ UciIeData userCsgInformation;
+ ChargingCharacteristicsIeData chargingCharacteristics;
+ LocalDistinguishedNameIeData mmeS4SgsnLdn;
+ LocalDistinguishedNameIeData sgwLdn;
+ LocalDistinguishedNameIeData epdgLdn;
+ LocalDistinguishedNameIeData twanLdn;
+ SignallingPriorityIndicationIeData signallingPriorityIndication;
+ IpAddressIeData ueLocalIpAddress;
+ PortNumberIeData ueUdpPort;
+ AdditionalProtocolConfigurationOptionsIeData additionalProtocolConfigurationOptions;
+ IpAddressIeData hNbLocalIpAddress;
+ PortNumberIeData hNbUdpPort;
+ IpAddressIeData mmeS4SgsnIdentifier;
+ TwanIdentifierIeData twanIdentifier;
+ IpAddressIeData epdgIpAddress;
+ CnOperatorSelectionEntityIeData cnOperatorSelectionEntity;
+ MmeS4SgsnsOverloadControlInformationInCreateSessionRequestData mmeS4SgsnsOverloadControlInformation;
+ SgwsOverloadControlInformationInCreateSessionRequestData sgwsOverloadControlInformation;
+ TwanEpdgsOverloadControlInformationInCreateSessionRequestData twanEpdgsOverloadControlInformation;
+ MillisecondTimeStampIeData originationTimeStamp;
+ IntegerNumberIeData maximumWaitTime;
+ TwanIdentifierIeData wlanLocationInformation;
+ TwanIdentifierTimestampIeData wlanLocationTimestamp;
+ FContainerIeData nbifomContainer;
+ RemoteUeContextConnectedInCreateSessionRequestData remoteUeContextConnected;
+ NodeIdentifierIeData a3gppAaaServerIdentifier;
+ EpcoIeData extendedProtocolConfigurationOptions;
+ ServingPlmnRateControlIeData servingPlmnRateControl;
+ CounterIeData moExceptionDataCounter;
+ PortNumberIeData ueTcpPort;
+ MappedUeUsageTypeIeData mappedUeUsageType;
+ UliIeData userLocationInformationForSgw;
+ FqdnIeData sgwUNodeName;
+ SecondaryRatUsageDataReportIeData secondaryRatUsageDataReport;
+ UpFunctionSelectionIndicationFlagsIeData upFunctionSelectionIndicationFlags;
+}CreateSessionRequestMsgData;
+
+typedef struct
+{
+ bool changeReportingActionIePresent;
+ bool csgInformationReportingActionIePresent;
+ bool senderFTeidForControlPlaneIePresent;
+ bool apnRestrictionIePresent;
+ bool aggregateMaximumBitRateIePresent;
+ bool linkedEpsBearerIdIePresent;
+ bool recoveryIePresent;
+ bool chargingGatewayNameIePresent;
+ bool chargingGatewayAddressIePresent;
+ bool pgwFqCsidIePresent;
+ bool sgwFqCsidIePresent;
+ bool sgwLdnIePresent;
+ bool pgwLdnIePresent;
+ bool pgwBackOffTimeIePresent;
+ bool hNbInformationReportingIePresent;
+ bool pgwS5S8S2bFTeidIePresent;
+ bool pdnAddressAllocationIePresent;
+ bool protocolConfigurationOptionsIePresent;
+ bool additionalProtocolConfigurationOptionsIePresent;
+ bool trustedWlanIpv4ParametersIePresent;
+ bool indicationFlagsIePresent;
+ bool presenceReportingAreaActionIePresent;
+ bool pgwsNodeLevelLoadControlInformationIePresent;
+ bool pgwsApnLevelLoadControlInformationIePresent;
+ bool sgwsNodeLevelLoadControlInformationIePresent;
+ bool pgwsOverloadControlInformationIePresent;
+ bool sgwsOverloadControlInformationIePresent;
+ bool nbifomContainerIePresent;
+ bool pdnConnectionChargingIdIePresent;
+ bool extendedProtocolConfigurationOptionsIePresent;
+
+
+ CauseIeData cause;
+ ChangeReportingActionIeData changeReportingAction;
+ CsgInformationReportingActionIeData csgInformationReportingAction;
+ FTeidIeData senderFTeidForControlPlane;
+ ApnRestrictionIeData apnRestriction;
+ AmbrIeData aggregateMaximumBitRate;
+ EbiIeData linkedEpsBearerId;
+
+ Uint16 bearerContextsCreatedCount;
+ BearerContextsCreatedInCreateSessionResponseData bearerContextsCreated[11];
+
+ Uint16 bearerContextsMarkedForRemovalCount;
+ BearerContextsMarkedForRemovalInCreateSessionResponseData bearerContextsMarkedForRemoval[11];
+ RecoveryIeData recovery;
+ FqdnIeData chargingGatewayName;
+ IpAddressIeData chargingGatewayAddress;
+ FqCsidIeData pgwFqCsid;
+ FqCsidIeData sgwFqCsid;
+ LocalDistinguishedNameIeData sgwLdn;
+ LocalDistinguishedNameIeData pgwLdn;
+ EpcTimerIeData pgwBackOffTime;
+ HenbInformationReportingIeData hNbInformationReporting;
+ FTeidIeData pgwS5S8S2bFTeid;
+ PaaIeData pdnAddressAllocation;
+ PcoIeData protocolConfigurationOptions;
+ AdditionalProtocolConfigurationOptionsIeData additionalProtocolConfigurationOptions;
+ Ip4cpIeData trustedWlanIpv4Parameters;
+ IndicationIeData indicationFlags;
+ PresenceReportingAreaActionIeData presenceReportingAreaAction;
+ PgwsNodeLevelLoadControlInformationInCreateSessionResponseData pgwsNodeLevelLoadControlInformation;
+ PgwsApnLevelLoadControlInformationInCreateSessionResponseData pgwsApnLevelLoadControlInformation;
+ SgwsNodeLevelLoadControlInformationInCreateSessionResponseData sgwsNodeLevelLoadControlInformation;
+ PgwsOverloadControlInformationInCreateSessionResponseData pgwsOverloadControlInformation;
+ SgwsOverloadControlInformationInCreateSessionResponseData sgwsOverloadControlInformation;
+ FContainerIeData nbifomContainer;
+ ChargingIdIeData pdnConnectionChargingId;
+ EpcoIeData extendedProtocolConfigurationOptions;
+}CreateSessionResponseMsgData;
+
+typedef struct
+{
+ bool meIdentityIePresent;
+ bool userLocationInformationIePresent;
+ bool servingNetworkIePresent;
+ bool ratTypeIePresent;
+ bool indicationFlagsIePresent;
+ bool senderFTeidForControlPlaneIePresent;
+ bool aggregateMaximumBitRateIePresent;
+ bool delayDownlinkPacketNotificationRequestIePresent;
+ bool recoveryIePresent;
+ bool ueTimeZoneIePresent;
+ bool mmeFqCsidIePresent;
+ bool sgwFqCsidIePresent;
+ bool userCsgInformationIePresent;
+ bool ueLocalIpAddressIePresent;
+ bool ueUdpPortIePresent;
+ bool mmeS4SgsnLdnIePresent;
+ bool sgwLdnIePresent;
+ bool hNbLocalIpAddressIePresent;
+ bool hNbUdpPortIePresent;
+ bool mmeS4SgsnIdentifierIePresent;
+ bool cnOperatorSelectionEntityIePresent;
+ bool mmeS4SgsnsOverloadControlInformationIePresent;
+ bool sgwsOverloadControlInformationIePresent;
+ bool epdgsOverloadControlInformationIePresent;
+ bool servingPlmnRateControlIePresent;
+ bool moExceptionDataCounterIePresent;
+ bool imsiIePresent;
+ bool userLocationInformationForSgwIePresent;
+ bool wlanLocationInformationIePresent;
+ bool wlanLocationTimestampIePresent;
+ bool secondaryRatUsageDataReportIePresent;
+
+
+ MeiIeData meIdentity;
+ UliIeData userLocationInformation;
+ ServingNetworkIeData servingNetwork;
+ RatTypeIeData ratType;
+ IndicationIeData indicationFlags;
+ FTeidIeData senderFTeidForControlPlane;
+ AmbrIeData aggregateMaximumBitRate;
+ DelayValueIeData delayDownlinkPacketNotificationRequest;
+
+ Uint16 bearerContextsToBeModifiedCount;
+ BearerContextsToBeModifiedInModifyBearerRequestData bearerContextsToBeModified[11];
+
+ Uint16 bearerContextsToBeRemovedCount;
+ BearerContextsToBeRemovedInModifyBearerRequestData bearerContextsToBeRemoved[11];
+ RecoveryIeData recovery;
+ UeTimeZoneIeData ueTimeZone;
+ FqCsidIeData mmeFqCsid;
+ FqCsidIeData sgwFqCsid;
+ UciIeData userCsgInformation;
+ IpAddressIeData ueLocalIpAddress;
+ PortNumberIeData ueUdpPort;
+ LocalDistinguishedNameIeData mmeS4SgsnLdn;
+ LocalDistinguishedNameIeData sgwLdn;
+ IpAddressIeData hNbLocalIpAddress;
+ PortNumberIeData hNbUdpPort;
+ IpAddressIeData mmeS4SgsnIdentifier;
+ CnOperatorSelectionEntityIeData cnOperatorSelectionEntity;
+ MmeS4SgsnsOverloadControlInformationInModifyBearerRequestData mmeS4SgsnsOverloadControlInformation;
+ SgwsOverloadControlInformationInModifyBearerRequestData sgwsOverloadControlInformation;
+ EpdgsOverloadControlInformationInModifyBearerRequestData epdgsOverloadControlInformation;
+ ServingPlmnRateControlIeData servingPlmnRateControl;
+ CounterIeData moExceptionDataCounter;
+ ImsiIeData imsi;
+ UliIeData userLocationInformationForSgw;
+ TwanIdentifierIeData wlanLocationInformation;
+ TwanIdentifierTimestampIeData wlanLocationTimestamp;
+ SecondaryRatUsageDataReportIeData secondaryRatUsageDataReport;
+}ModifyBearerRequestMsgData;
+
+typedef struct
+{
+ bool linkedEpsBearerIdIePresent;
+ bool indicationFlagsIePresent;
+ bool apnRestrictionIePresent;
+ bool protocolConfigurationOptionsIePresent;
+ bool changeReportingActionIePresent;
+ bool csgInformationReportingActionIePresent;
+ bool hNbInformationReportingIePresent;
+ bool chargingGatewayNameIePresent;
+ bool chargingGatewayAddressIePresent;
+ bool pgwFqCsidIePresent;
+ bool sgwFqCsidIePresent;
+ bool recoveryIePresent;
+ bool sgwLdnIePresent;
+ bool pgwLdnIePresent;
+ bool presenceReportingAreaActionIePresent;
+ bool pgwsNodeLevelLoadControlInformationIePresent;
+ bool pgwsApnLevelLoadControlInformationIePresent;
+ bool sgwsNodeLevelLoadControlInformationIePresent;
+ bool pgwsOverloadControlInformationIePresent;
+ bool sgwsOverloadControlInformationIePresent;
+ bool pdnConnectionChargingIdIePresent;
+ bool msisdnIePresent;
+
+
+ EbiIeData linkedEpsBearerId;
+
+ Uint16 bearerContextsModifiedCount;
+ BearerContextsModifiedInModifyBearerResponseData bearerContextsModified[11];
+
+ Uint16 bearerContextsMarkedForRemovalCount;
+ BearerContextsMarkedForRemovalInModifyBearerResponseData bearerContextsMarkedForRemoval[11];
+ IndicationIeData indicationFlags;
+ CauseIeData cause;
+ ApnRestrictionIeData apnRestriction;
+ PcoIeData protocolConfigurationOptions;
+ ChangeReportingActionIeData changeReportingAction;
+ CsgInformationReportingActionIeData csgInformationReportingAction;
+ HenbInformationReportingIeData hNbInformationReporting;
+ FqdnIeData chargingGatewayName;
+ IpAddressIeData chargingGatewayAddress;
+ FqCsidIeData pgwFqCsid;
+ FqCsidIeData sgwFqCsid;
+ RecoveryIeData recovery;
+ LocalDistinguishedNameIeData sgwLdn;
+ LocalDistinguishedNameIeData pgwLdn;
+ PresenceReportingAreaActionIeData presenceReportingAreaAction;
+ PgwsNodeLevelLoadControlInformationInModifyBearerResponseData pgwsNodeLevelLoadControlInformation;
+ PgwsApnLevelLoadControlInformationInModifyBearerResponseData pgwsApnLevelLoadControlInformation;
+ SgwsNodeLevelLoadControlInformationInModifyBearerResponseData sgwsNodeLevelLoadControlInformation;
+ PgwsOverloadControlInformationInModifyBearerResponseData pgwsOverloadControlInformation;
+ SgwsOverloadControlInformationInModifyBearerResponseData sgwsOverloadControlInformation;
+ ChargingIdIeData pdnConnectionChargingId;
+ MsisdnIeData msisdn;
+}ModifyBearerResponseMsgData;
+
+typedef struct
+{
+ bool linkedEpsBearerIdIePresent;
+ bool indicationFlagsIePresent;
+ bool causeIePresent;
+ bool senderFTeidForControlPlaneIePresent;
+ bool userLocationInformationIePresent;
+ bool protocolConfigurationOptionsIePresent;
+ bool originatingNodeIePresent;
+ bool ueTimeZoneIePresent;
+ bool uliTimestampIePresent;
+ bool ranNasReleaseCauseIePresent;
+ bool twanIdentifierIePresent;
+ bool twanIdentifierTimestampIePresent;
+ bool mmeS4SgsnsOverloadControlInformationIePresent;
+ bool sgwsOverloadControlInformationIePresent;
+ bool twanEpdgsOverloadControlInformationIePresent;
+ bool wlanLocationInformationIePresent;
+ bool wlanLocationTimestampIePresent;
+ bool ueLocalIpAddressIePresent;
+ bool ueUdpPortIePresent;
+ bool extendedProtocolConfigurationOptionsIePresent;
+ bool ueTcpPortIePresent;
+ bool secondaryRatUsageDataReportIePresent;
+
+
+ EbiIeData linkedEpsBearerId;
+ IndicationIeData indicationFlags;
+ CauseIeData cause;
+ FTeidIeData senderFTeidForControlPlane;
+ UliIeData userLocationInformation;
+ PcoIeData protocolConfigurationOptions;
+ NodeTypeIeData originatingNode;
+ UeTimeZoneIeData ueTimeZone;
+ UliTimestampIeData uliTimestamp;
+ RanNasCauseIeData ranNasReleaseCause;
+ TwanIdentifierIeData twanIdentifier;
+ TwanIdentifierTimestampIeData twanIdentifierTimestamp;
+ MmeS4SgsnsOverloadControlInformationInDeleteSessionRequestData mmeS4SgsnsOverloadControlInformation;
+ SgwsOverloadControlInformationInDeleteSessionRequestData sgwsOverloadControlInformation;
+ TwanEpdgsOverloadControlInformationInDeleteSessionRequestData twanEpdgsOverloadControlInformation;
+ TwanIdentifierIeData wlanLocationInformation;
+ TwanIdentifierTimestampIeData wlanLocationTimestamp;
+ IpAddressIeData ueLocalIpAddress;
+ PortNumberIeData ueUdpPort;
+ EpcoIeData extendedProtocolConfigurationOptions;
+ PortNumberIeData ueTcpPort;
+ SecondaryRatUsageDataReportIeData secondaryRatUsageDataReport;
+}DeleteSessionRequestMsgData;
+
+typedef struct
+{
+ bool recoveryIePresent;
+ bool protocolConfigurationOptionsIePresent;
+ bool indicationFlagsIePresent;
+ bool pgwsNodeLevelLoadControlInformationIePresent;
+ bool pgwsApnLevelLoadControlInformationIePresent;
+ bool sgwsNodeLevelLoadControlInformationIePresent;
+ bool pgwsOverloadControlInformationIePresent;
+ bool sgwsOverloadControlInformationIePresent;
+ bool extendedProtocolConfigurationOptionsIePresent;
+
+
+ CauseIeData cause;
+ RecoveryIeData recovery;
+ PcoIeData protocolConfigurationOptions;
+ IndicationIeData indicationFlags;
+ PgwsNodeLevelLoadControlInformationInDeleteSessionResponseData pgwsNodeLevelLoadControlInformation;
+ PgwsApnLevelLoadControlInformationInDeleteSessionResponseData pgwsApnLevelLoadControlInformation;
+ SgwsNodeLevelLoadControlInformationInDeleteSessionResponseData sgwsNodeLevelLoadControlInformation;
+ PgwsOverloadControlInformationInDeleteSessionResponseData pgwsOverloadControlInformation;
+ SgwsOverloadControlInformationInDeleteSessionResponseData sgwsOverloadControlInformation;
+ EpcoIeData extendedProtocolConfigurationOptions;
+}DeleteSessionResponseMsgData;
+
+typedef struct
+{
+ bool listOfRabsIePresent;
+ bool originatingNodeIePresent;
+ bool indicationFlagsIePresent;
+ bool secondaryRatUsageDataReportIePresent;
+
+
+ EbiIeData listOfRabs;
+ NodeTypeIeData originatingNode;
+ IndicationIeData indicationFlags;
+ SecondaryRatUsageDataReportIeData secondaryRatUsageDataReport;
+}ReleaseAccessBearersRequestMsgData;
+
+typedef struct
+{
+ bool recoveryIePresent;
+ bool indicationFlagsIePresent;
+ bool sgwsNodeLevelLoadControlInformationIePresent;
+ bool sgwsOverloadControlInformationIePresent;
+
+
+ CauseIeData cause;
+ RecoveryIeData recovery;
+ IndicationIeData indicationFlags;
+ SgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponseData sgwsNodeLevelLoadControlInformation;
+ SgwsOverloadControlInformationInReleaseAccessBearersResponseData sgwsOverloadControlInformation;
+}ReleaseAccessBearersResponseMsgData;
+
+typedef struct
+{
+ bool procedureTransactionIdIePresent;
+ bool protocolConfigurationOptionsIePresent;
+ bool pgwFqCsidIePresent;
+ bool sgwFqCsidIePresent;
+ bool changeReportingActionIePresent;
+ bool csgInformationReportingActionIePresent;
+ bool hNbInformationReportingIePresent;
+ bool presenceReportingAreaActionIePresent;
+ bool indicationFlagsIePresent;
+ bool pgwsNodeLevelLoadControlInformationIePresent;
+ bool pgwsApnLevelLoadControlInformationIePresent;
+ bool sgwsNodeLevelLoadControlInformationIePresent;
+ bool pgwsOverloadControlInformationIePresent;
+ bool sgwsOverloadControlInformationIePresent;
+ bool nbifomContainerIePresent;
+
+
+ PtiIeData procedureTransactionId;
+ EbiIeData linkedEpsBearerId;
+ PcoIeData protocolConfigurationOptions;
+
+ Uint16 bearerContextsCount;
+ BearerContextsInCreateBearerRequestData bearerContexts[11];
+ FqCsidIeData pgwFqCsid;
+ FqCsidIeData sgwFqCsid;
+ ChangeReportingActionIeData changeReportingAction;
+ CsgInformationReportingActionIeData csgInformationReportingAction;
+ HenbInformationReportingIeData hNbInformationReporting;
+ PresenceReportingAreaActionIeData presenceReportingAreaAction;
+ IndicationIeData indicationFlags;
+ PgwsNodeLevelLoadControlInformationInCreateBearerRequestData pgwsNodeLevelLoadControlInformation;
+ PgwsApnLevelLoadControlInformationInCreateBearerRequestData pgwsApnLevelLoadControlInformation;
+ SgwsNodeLevelLoadControlInformationInCreateBearerRequestData sgwsNodeLevelLoadControlInformation;
+ PgwsOverloadControlInformationInCreateBearerRequestData pgwsOverloadControlInformation;
+ SgwsOverloadControlInformationInCreateBearerRequestData sgwsOverloadControlInformation;
+ FContainerIeData nbifomContainer;
+}CreateBearerRequestMsgData;
+
+typedef struct
+{
+ bool recoveryIePresent;
+ bool mmeFqCsidIePresent;
+ bool sgwFqCsidIePresent;
+ bool epdgFqCsidIePresent;
+ bool twanFqCsidIePresent;
+ bool protocolConfigurationOptionsIePresent;
+ bool ueTimeZoneIePresent;
+ bool userLocationInformationIePresent;
+ bool twanIdentifierIePresent;
+ bool mmeS4SgsnsOverloadControlInformationIePresent;
+ bool sgwsOverloadControlInformationIePresent;
+ bool mmeS4SgsnIdentifierIePresent;
+ bool twanEpdgsOverloadControlInformationIePresent;
+ bool wlanLocationInformationIePresent;
+ bool wlanLocationTimestampIePresent;
+ bool ueLocalIpAddressIePresent;
+ bool ueUdpPortIePresent;
+ bool nbifomContainerIePresent;
+ bool ueTcpPortIePresent;
+
+
+ CauseIeData cause;
+
+ Uint16 bearerContextsCount;
+ BearerContextsInCreateBearerResponseData bearerContexts[11];
+ RecoveryIeData recovery;
+ FqCsidIeData mmeFqCsid;
+ FqCsidIeData sgwFqCsid;
+ FqCsidIeData epdgFqCsid;
+ FqCsidIeData twanFqCsid;
+ PcoIeData protocolConfigurationOptions;
+ UeTimeZoneIeData ueTimeZone;
+ UliIeData userLocationInformation;
+ TwanIdentifierIeData twanIdentifier;
+ MmeS4SgsnsOverloadControlInformationInCreateBearerResponseData mmeS4SgsnsOverloadControlInformation;
+ SgwsOverloadControlInformationInCreateBearerResponseData sgwsOverloadControlInformation;
+ IpAddressIeData mmeS4SgsnIdentifier;
+ TwanEpdgsOverloadControlInformationInCreateBearerResponseData twanEpdgsOverloadControlInformation;
+ TwanIdentifierIeData wlanLocationInformation;
+ TwanIdentifierTimestampIeData wlanLocationTimestamp;
+ IpAddressIeData ueLocalIpAddress;
+ PortNumberIeData ueUdpPort;
+ FContainerIeData nbifomContainer;
+ PortNumberIeData ueTcpPort;
+}CreateBearerResponseMsgData;
+
+typedef struct
+{
+ bool linkedEpsBearerIdIePresent;
+ bool epsBearerIdsIePresent;
+ bool procedureTransactionIdIePresent;
+ bool protocolConfigurationOptionsIePresent;
+ bool pgwFqCsidIePresent;
+ bool sgwFqCsidIePresent;
+ bool causeIePresent;
+ bool indicationFlagsIePresent;
+ bool pgwsNodeLevelLoadControlInformationIePresent;
+ bool pgwsApnLevelLoadControlInformationIePresent;
+ bool sgwsNodeLevelLoadControlInformationIePresent;
+ bool pgwsOverloadControlInformationIePresent;
+ bool sgwsOverloadControlInformationIePresent;
+ bool nbifomContainerIePresent;
+ bool extendedProtocolConfigurationOptionsIePresent;
+
+
+ EbiIeData linkedEpsBearerId;
+ EbiIeData epsBearerIds;
+
+ Uint16 failedBearerContextsCount;
+ FailedBearerContextsInDeleteBearerRequestData failedBearerContexts[11];
+ PtiIeData procedureTransactionId;
+ PcoIeData protocolConfigurationOptions;
+ FqCsidIeData pgwFqCsid;
+ FqCsidIeData sgwFqCsid;
+ CauseIeData cause;
+ IndicationIeData indicationFlags;
+ PgwsNodeLevelLoadControlInformationInDeleteBearerRequestData pgwsNodeLevelLoadControlInformation;
+ PgwsApnLevelLoadControlInformationInDeleteBearerRequestData pgwsApnLevelLoadControlInformation;
+ SgwsNodeLevelLoadControlInformationInDeleteBearerRequestData sgwsNodeLevelLoadControlInformation;
+ PgwsOverloadControlInformationInDeleteBearerRequestData pgwsOverloadControlInformation;
+ SgwsOverloadControlInformationInDeleteBearerRequestData sgwsOverloadControlInformation;
+ FContainerIeData nbifomContainer;
+ EpcoIeData extendedProtocolConfigurationOptions;
+}DeleteBearerRequestMsgData;
+
+typedef struct
+{
+ bool linkedEpsBearerIdIePresent;
+ bool recoveryIePresent;
+ bool mmeFqCsidIePresent;
+ bool sgwFqCsidIePresent;
+ bool epdgFqCsidIePresent;
+ bool twanFqCsidIePresent;
+ bool protocolConfigurationOptionsIePresent;
+ bool ueTimeZoneIePresent;
+ bool userLocationInformationIePresent;
+ bool uliTimestampIePresent;
+ bool twanIdentifierIePresent;
+ bool twanIdentifierTimestampIePresent;
+ bool mmeS4SgsnsOverloadControlInformationIePresent;
+ bool sgwsOverloadControlInformationIePresent;
+ bool mmeS4SgsnIdentifierIePresent;
+ bool twanEpdgsOverloadControlInformationIePresent;
+ bool wlanLocationInformationIePresent;
+ bool wlanLocationTimestampIePresent;
+ bool ueLocalIpAddressIePresent;
+ bool ueUdpPortIePresent;
+ bool nbifomContainerIePresent;
+ bool ueTcpPortIePresent;
+ bool secondaryRatUsageDataReportIePresent;
+
+
+ CauseIeData cause;
+ EbiIeData linkedEpsBearerId;
+
+ Uint16 bearerContextsCount;
+ BearerContextsInDeleteBearerResponseData bearerContexts[11];
+ RecoveryIeData recovery;
+ FqCsidIeData mmeFqCsid;
+ FqCsidIeData sgwFqCsid;
+ FqCsidIeData epdgFqCsid;
+ FqCsidIeData twanFqCsid;
+ PcoIeData protocolConfigurationOptions;
+ UeTimeZoneIeData ueTimeZone;
+ UliIeData userLocationInformation;
+ UliTimestampIeData uliTimestamp;
+ TwanIdentifierIeData twanIdentifier;
+ TwanIdentifierTimestampIeData twanIdentifierTimestamp;
+ MmeS4SgsnsOverloadControlInformationInDeleteBearerResponseData mmeS4SgsnsOverloadControlInformation;
+ SgwsOverloadControlInformationInDeleteBearerResponseData sgwsOverloadControlInformation;
+ IpAddressIeData mmeS4SgsnIdentifier;
+ TwanEpdgsOverloadControlInformationInDeleteBearerResponseData twanEpdgsOverloadControlInformation;
+ TwanIdentifierIeData wlanLocationInformation;
+ TwanIdentifierTimestampIeData wlanLocationTimestamp;
+ IpAddressIeData ueLocalIpAddress;
+ PortNumberIeData ueUdpPort;
+ FContainerIeData nbifomContainer;
+ PortNumberIeData ueTcpPort;
+ SecondaryRatUsageDataReportIeData secondaryRatUsageDataReport;
+}DeleteBearerResponseMsgData;
+
+typedef struct
+{
+ bool causeIePresent;
+ bool epsBearerIdIePresent;
+ bool allocationRetentionPriorityIePresent;
+ bool imsiIePresent;
+ bool senderFTeidForControlPlaneIePresent;
+ bool indicationFlagsIePresent;
+ bool sgwsNodeLevelLoadControlInformationIePresent;
+ bool sgwsOverloadControlInformationIePresent;
+ bool pagingAndServiceInformationIePresent;
+
+
+ CauseIeData cause;
+ EbiIeData epsBearerId;
+ ArpIeData allocationRetentionPriority;
+ ImsiIeData imsi;
+ FTeidIeData senderFTeidForControlPlane;
+ IndicationIeData indicationFlags;
+ SgwsNodeLevelLoadControlInformationInDownlinkDataNotificationData sgwsNodeLevelLoadControlInformation;
+ SgwsOverloadControlInformationInDownlinkDataNotificationData sgwsOverloadControlInformation;
+ PagingAndServiceInformationIeData pagingAndServiceInformation;
+}DownlinkDataNotificationMsgData;
+
+typedef struct
+{
+ bool dataNotificationDelayIePresent;
+ bool recoveryIePresent;
+ bool dlLowPriorityTrafficThrottlingIePresent;
+ bool imsiIePresent;
+ bool dlBufferingDurationIePresent;
+ bool dlBufferingSuggestedPacketCountIePresent;
+
+
+ CauseIeData cause;
+ DelayValueIeData dataNotificationDelay;
+ RecoveryIeData recovery;
+ ThrottlingIeData dlLowPriorityTrafficThrottling;
+ ImsiIeData imsi;
+ EpcTimerIeData dlBufferingDuration;
+ IntegerNumberIeData dlBufferingSuggestedPacketCount;
+}DownlinkDataNotificationAcknowledgeMsgData;
+
+typedef struct
+{
+ bool originatingNodeIePresent;
+ bool imsiIePresent;
+
+
+ CauseIeData cause;
+ NodeTypeIeData originatingNode;
+ ImsiIeData imsi;
+}DownlinkDataNotificationFailureIndicationMsgData;
+
+
+//Ie Type Constants
+static const Uint8 CreateSessionRequestMsgType = 32;
+static const Uint8 CreateSessionResponseMsgType = 33;
+static const Uint8 ModifyBearerRequestMsgType = 34;
+static const Uint8 ModifyBearerResponseMsgType = 35;
+static const Uint8 DeleteSessionRequestMsgType = 36;
+static const Uint8 DeleteSessionResponseMsgType = 37;
+static const Uint8 ReleaseAccessBearersRequestMsgType = 170;
+static const Uint8 ReleaseAccessBearersResponseMsgType = 171;
+static const Uint8 CreateBearerRequestMsgType = 95;
+static const Uint8 CreateBearerResponseMsgType = 96;
+static const Uint8 DeleteBearerRequestMsgType = 99;
+static const Uint8 DeleteBearerResponseMsgType = 100;
+static const Uint8 DownlinkDataNotificationMsgType = 176;
+static const Uint8 DownlinkDataNotificationAcknowledgeMsgType = 177;
+static const Uint8 DownlinkDataNotificationFailureIndicationMsgType = 70;
+
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/msgClasses/gtpV2MsgFactory.cpp b/src/gtpV2Codec/msgClasses/gtpV2MsgFactory.cpp
new file mode 100644
index 0000000..3751ca6
--- /dev/null
+++ b/src/gtpV2Codec/msgClasses/gtpV2MsgFactory.cpp
@@ -0,0 +1,101 @@
+/*
+ * Copyright 2019-present Infosys Limited
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+/******************************************************************************
+ *
+ * This is an auto generated file.
+ * Please do not edit this file.
+ * All edits to be made through template source file
+ * <TOP-DIR/scripts/GtpV2StackCodeGen/tts/msgfactorytemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "gtpV2MsgFactory.h"
+#include "createSessionRequestMsg.h"
+#include "createSessionResponseMsg.h"
+#include "modifyBearerRequestMsg.h"
+#include "modifyBearerResponseMsg.h"
+#include "deleteSessionRequestMsg.h"
+#include "deleteSessionResponseMsg.h"
+#include "releaseAccessBearersRequestMsg.h"
+#include "releaseAccessBearersResponseMsg.h"
+#include "createBearerRequestMsg.h"
+#include "createBearerResponseMsg.h"
+#include "deleteBearerRequestMsg.h"
+#include "deleteBearerResponseMsg.h"
+#include "downlinkDataNotificationMsg.h"
+#include "downlinkDataNotificationAcknowledgeMsg.h"
+#include "downlinkDataNotificationFailureIndicationMsg.h"
+
+static GtpV2MsgFactory gtpV2MsgFactory;
+
+GtpV2MsgFactory::GtpV2MsgFactory()
+{
+ //Create Message Objects
+
+ CreateSessionRequestMsg* createSessionRequestMsg_p = new (CreateSessionRequestMsg);
+ msgObjectContainer.insert(std::pair<Uint8, GtpV2Message*>(CreateSessionRequestMsgType, createSessionRequestMsg_p));
+
+ CreateSessionResponseMsg* createSessionResponseMsg_p = new (CreateSessionResponseMsg);
+ msgObjectContainer.insert(std::pair<Uint8, GtpV2Message*>(CreateSessionResponseMsgType, createSessionResponseMsg_p));
+
+ ModifyBearerRequestMsg* modifyBearerRequestMsg_p = new (ModifyBearerRequestMsg);
+ msgObjectContainer.insert(std::pair<Uint8, GtpV2Message*>(ModifyBearerRequestMsgType, modifyBearerRequestMsg_p));
+
+ ModifyBearerResponseMsg* modifyBearerResponseMsg_p = new (ModifyBearerResponseMsg);
+ msgObjectContainer.insert(std::pair<Uint8, GtpV2Message*>(ModifyBearerResponseMsgType, modifyBearerResponseMsg_p));
+
+ DeleteSessionRequestMsg* deleteSessionRequestMsg_p = new (DeleteSessionRequestMsg);
+ msgObjectContainer.insert(std::pair<Uint8, GtpV2Message*>(DeleteSessionRequestMsgType, deleteSessionRequestMsg_p));
+
+ DeleteSessionResponseMsg* deleteSessionResponseMsg_p = new (DeleteSessionResponseMsg);
+ msgObjectContainer.insert(std::pair<Uint8, GtpV2Message*>(DeleteSessionResponseMsgType, deleteSessionResponseMsg_p));
+
+ ReleaseAccessBearersRequestMsg* releaseAccessBearersRequestMsg_p = new (ReleaseAccessBearersRequestMsg);
+ msgObjectContainer.insert(std::pair<Uint8, GtpV2Message*>(ReleaseAccessBearersRequestMsgType, releaseAccessBearersRequestMsg_p));
+
+ ReleaseAccessBearersResponseMsg* releaseAccessBearersResponseMsg_p = new (ReleaseAccessBearersResponseMsg);
+ msgObjectContainer.insert(std::pair<Uint8, GtpV2Message*>(ReleaseAccessBearersResponseMsgType, releaseAccessBearersResponseMsg_p));
+
+ CreateBearerRequestMsg* createBearerRequestMsg_p = new (CreateBearerRequestMsg);
+ msgObjectContainer.insert(std::pair<Uint8, GtpV2Message*>(CreateBearerRequestMsgType, createBearerRequestMsg_p));
+
+ CreateBearerResponseMsg* createBearerResponseMsg_p = new (CreateBearerResponseMsg);
+ msgObjectContainer.insert(std::pair<Uint8, GtpV2Message*>(CreateBearerResponseMsgType, createBearerResponseMsg_p));
+
+ DeleteBearerRequestMsg* deleteBearerRequestMsg_p = new (DeleteBearerRequestMsg);
+ msgObjectContainer.insert(std::pair<Uint8, GtpV2Message*>(DeleteBearerRequestMsgType, deleteBearerRequestMsg_p));
+
+ DeleteBearerResponseMsg* deleteBearerResponseMsg_p = new (DeleteBearerResponseMsg);
+ msgObjectContainer.insert(std::pair<Uint8, GtpV2Message*>(DeleteBearerResponseMsgType, deleteBearerResponseMsg_p));
+
+ DownlinkDataNotificationMsg* downlinkDataNotificationMsg_p = new (DownlinkDataNotificationMsg);
+ msgObjectContainer.insert(std::pair<Uint8, GtpV2Message*>(DownlinkDataNotificationMsgType, downlinkDataNotificationMsg_p));
+
+ DownlinkDataNotificationAcknowledgeMsg* downlinkDataNotificationAcknowledgeMsg_p = new (DownlinkDataNotificationAcknowledgeMsg);
+ msgObjectContainer.insert(std::pair<Uint8, GtpV2Message*>(DownlinkDataNotificationAcknowledgeMsgType, downlinkDataNotificationAcknowledgeMsg_p));
+
+ DownlinkDataNotificationFailureIndicationMsg* downlinkDataNotificationFailureIndicationMsg_p = new (DownlinkDataNotificationFailureIndicationMsg);
+ msgObjectContainer.insert(std::pair<Uint8, GtpV2Message*>(DownlinkDataNotificationFailureIndicationMsgType, downlinkDataNotificationFailureIndicationMsg_p));
+
+
+}
+
+GtpV2MsgFactory::~GtpV2MsgFactory() {
+ // TODO clean up the allocated memory for message objects
+}
+
+GtpV2MsgFactory& GtpV2MsgFactory::getInstance()
+{
+ static GtpV2MsgFactory gtpV2MsgFactory;
+ return gtpV2MsgFactory;
+}
+
+GtpV2Message& GtpV2MsgFactory::getMsgObject(Uint8 msgType)
+{
+ std::map<Uint8, GtpV2Message*>::iterator it;
+ it = msgObjectContainer.find(msgType);
+ return *(it->second);
+}
diff --git a/src/gtpV2Codec/msgClasses/gtpV2MsgFactory.h b/src/gtpV2Codec/msgClasses/gtpV2MsgFactory.h
new file mode 100644
index 0000000..e2546b2
--- /dev/null
+++ b/src/gtpV2Codec/msgClasses/gtpV2MsgFactory.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2019-present, Infosys Limited.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/******************************************************************************
+ *
+ * This is an auto generated file.
+ * Please do not edit this file.
+ * All edits to be made through template source file
+ * <TOP-DIR/scripts/GtpV2StackCodeGen/tts/msgfactorytemplate.h.tt>
+ ******************************************************************************/
+#ifndef GTPV2MSGFACTORY_H_
+#define GTPV2MSGFACTORY_H_
+
+#include <map>
+#include "manual/gtpV2Message.h"
+
+class GtpV2MsgFactory {
+public:
+ GtpV2MsgFactory();
+ virtual ~GtpV2MsgFactory();
+
+ static GtpV2MsgFactory& getInstance();
+ GtpV2Message& getMsgObject(Uint8 msgType);
+
+private:
+
+ map<Uint8, GtpV2Message*> msgObjectContainer;
+
+};
+
+
+#endif /* GTPV2MSGFACTORY_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/msgClasses/manual/gtpV2Message.cpp b/src/gtpV2Codec/msgClasses/manual/gtpV2Message.cpp
new file mode 100644
index 0000000..8fc7c73
--- /dev/null
+++ b/src/gtpV2Codec/msgClasses/manual/gtpV2Message.cpp
@@ -0,0 +1,63 @@
+ /*
+Copyright 2019-present Infosys Limited
+
+SPDX-License-Identifier: Apache-2.0
+
+*/
+
+
+
+#include "gtpV2Message.h"
+
+GtpV2Message::GtpV2Message() {
+ // TODO Auto-generated constructor stub
+
+}
+
+GtpV2Message::~GtpV2Message() {
+ // TODO Auto-generated destructor stub
+}
+
+void GtpV2Message::encodeHeader(MsgBuffer& buffer, GtpV2MessageHeader& msgHeader)
+{
+ buffer.writeBits(2, 3); // Gtpversion 2
+ buffer.writeBits(0, 1); //Pigiback - TODO later
+ buffer.writeBits(msgHeader.teidPresent, 1);
+ buffer.skipBits(3);
+
+ buffer.writeUint8(msgHeader.msgType);
+ buffer.writeUint16(msgHeader.msgLength);
+
+ if (msgHeader.teidPresent)
+ {
+ buffer.writeUint32(msgHeader.teid);
+ }
+
+ Uint32 seqNumber = msgHeader.sequenceNumber << 8;
+ std::cout << "current seq num indx is " << buffer.getCurrentIndex() << std::endl;
+ buffer.writeUint32(seqNumber);
+
+}
+
+bool GtpV2Message::decodeHeader(MsgBuffer& buffer, GtpV2MessageHeader& msgHeader)
+{
+ buffer.skipBits(4);
+ msgHeader.teidPresent = buffer.readBit();
+ buffer.skipBits(3);
+
+ buffer.readUint8(msgHeader.msgType);
+ buffer.readUint16(msgHeader.msgLength);
+
+ if (msgHeader.teidPresent)
+ {
+ buffer.readUint32(msgHeader.teid);
+ }
+ Uint32 seqNumber;
+
+ buffer.readUint32(seqNumber);
+ msgHeader.sequenceNumber = (seqNumber >> 8);
+
+ return true; //TODO
+
+}
+
diff --git a/src/gtpV2Codec/msgClasses/manual/gtpV2Message.h b/src/gtpV2Codec/msgClasses/manual/gtpV2Message.h
new file mode 100644
index 0000000..4ef856b
--- /dev/null
+++ b/src/gtpV2Codec/msgClasses/manual/gtpV2Message.h
@@ -0,0 +1,29 @@
+ /*
+Copyright 2019-present Infosys Limited
+
+SPDX-License-Identifier: Apache-2.0
+
+*/
+
+
+
+#ifndef GTPV2MESSAGE_H_
+#define GTPV2MESSAGE_H_
+
+#include "basicTypes.h"
+#include "msgBuffer.h"
+#include "../../../gtpV2Codec/msgClasses/gtpV2MsgDataTypes.h"
+
+class GtpV2Message {
+public:
+ GtpV2Message();
+ virtual ~GtpV2Message();
+ static void encodeHeader(MsgBuffer& buffer, GtpV2MessageHeader& msgHeader);
+ static bool decodeHeader(MsgBuffer& buffer, GtpV2MessageHeader& msgHeader);
+
+protected:
+ Uint8 msgType;
+};
+
+#endif /* GTPV2MESSAGE_H_ */
+
diff --git a/src/gtpV2Codec/msgClasses/modifyBearerRequestMsg.cpp b/src/gtpV2Codec/msgClasses/modifyBearerRequestMsg.cpp
new file mode 100644
index 0000000..4bbd715
--- /dev/null
+++ b/src/gtpV2Codec/msgClasses/modifyBearerRequestMsg.cpp
@@ -0,0 +1,2347 @@
+/*
+ * Copyright 2019-present Infosys Limited
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+/******************************************************************************
+ *
+ * This is an auto generated file.
+ * Please do not edit this file.
+ * All edits to be made through template source file
+ * <TOP-DIR/scripts/GtpV2StackCodeGen/tts/msgtemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "modifyBearerRequestMsg.h"
+#include "../ieClasses/manual/gtpV2Ie.h"
+#include "../ieClasses/gtpV2IeFactory.h"
+#include "../ieClasses/meiIe.h"
+#include "../ieClasses/uliIe.h"
+#include "../ieClasses/servingNetworkIe.h"
+#include "../ieClasses/ratTypeIe.h"
+#include "../ieClasses/indicationIe.h"
+#include "../ieClasses/fTeidIe.h"
+#include "../ieClasses/ambrIe.h"
+#include "../ieClasses/delayValueIe.h"
+#include "../ieClasses/bearerContextIe.h"
+#include "../ieClasses/bearerContextsToBeModifiedInModifyBearerRequest.h"
+#include "../ieClasses/bearerContextIe.h"
+#include "../ieClasses/bearerContextsToBeRemovedInModifyBearerRequest.h"
+#include "../ieClasses/recoveryIe.h"
+#include "../ieClasses/ueTimeZoneIe.h"
+#include "../ieClasses/fqCsidIe.h"
+#include "../ieClasses/fqCsidIe.h"
+#include "../ieClasses/uciIe.h"
+#include "../ieClasses/ipAddressIe.h"
+#include "../ieClasses/portNumberIe.h"
+#include "../ieClasses/localDistinguishedNameIe.h"
+#include "../ieClasses/localDistinguishedNameIe.h"
+#include "../ieClasses/ipAddressIe.h"
+#include "../ieClasses/portNumberIe.h"
+#include "../ieClasses/ipAddressIe.h"
+#include "../ieClasses/cnOperatorSelectionEntityIe.h"
+#include "../ieClasses/overloadControlInformationIe.h"
+#include "../ieClasses/mmeS4SgsnsOverloadControlInformationInModifyBearerRequest.h"
+#include "../ieClasses/overloadControlInformationIe.h"
+#include "../ieClasses/sgwsOverloadControlInformationInModifyBearerRequest.h"
+#include "../ieClasses/overloadControlInformationIe.h"
+#include "../ieClasses/epdgsOverloadControlInformationInModifyBearerRequest.h"
+#include "../ieClasses/servingPlmnRateControlIe.h"
+#include "../ieClasses/counterIe.h"
+#include "../ieClasses/imsiIe.h"
+#include "../ieClasses/uliIe.h"
+#include "../ieClasses/twanIdentifierIe.h"
+#include "../ieClasses/twanIdentifierTimestampIe.h"
+#include "../ieClasses/secondaryRatUsageDataReportIe.h"
+
+ModifyBearerRequestMsg::ModifyBearerRequestMsg()
+{
+ msgType = ModifyBearerRequestMsgType;
+
+}
+
+ModifyBearerRequestMsg::~ModifyBearerRequestMsg()
+{
+
+}
+
+bool ModifyBearerRequestMsg::encodeModifyBearerRequestMsg(MsgBuffer &buffer,
+ ModifyBearerRequestMsgData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+ if (data.meIdentityIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = MeiIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MeiIe mei=
+ dynamic_cast<
+ MeiIe&>(GtpV2IeFactory::getInstance().getIeObject(MeiIeType));
+ rc = mei.encodeMeiIe(buffer, data.meIdentity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: meIdentity\n");
+ return false;
+ }
+ }
+
+ if (data.userLocationInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = UliIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ UliIe uli=
+ dynamic_cast<
+ UliIe&>(GtpV2IeFactory::getInstance().getIeObject(UliIeType));
+ rc = uli.encodeUliIe(buffer, data.userLocationInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: userLocationInformation\n");
+ return false;
+ }
+ }
+
+ if (data.servingNetworkIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = ServingNetworkIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ ServingNetworkIe servingNetwork=
+ dynamic_cast<
+ ServingNetworkIe&>(GtpV2IeFactory::getInstance().getIeObject(ServingNetworkIeType));
+ rc = servingNetwork.encodeServingNetworkIe(buffer, data.servingNetwork);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: servingNetwork\n");
+ return false;
+ }
+ }
+
+ if (data.ratTypeIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = RatTypeIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ RatTypeIe ratType=
+ dynamic_cast<
+ RatTypeIe&>(GtpV2IeFactory::getInstance().getIeObject(RatTypeIeType));
+ rc = ratType.encodeRatTypeIe(buffer, data.ratType);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: ratType\n");
+ return false;
+ }
+ }
+
+ if (data.indicationFlagsIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = IndicationIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ IndicationIe indication=
+ dynamic_cast<
+ IndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(IndicationIeType));
+ rc = indication.encodeIndicationIe(buffer, data.indicationFlags);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: indicationFlags\n");
+ return false;
+ }
+ }
+
+ if (data.senderFTeidForControlPlaneIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FTeidIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ rc = fTeid.encodeFTeidIe(buffer, data.senderFTeidForControlPlane);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: senderFTeidForControlPlane\n");
+ return false;
+ }
+ }
+
+ if (data.aggregateMaximumBitRateIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = AmbrIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ AmbrIe ambr=
+ dynamic_cast<
+ AmbrIe&>(GtpV2IeFactory::getInstance().getIeObject(AmbrIeType));
+ rc = ambr.encodeAmbrIe(buffer, data.aggregateMaximumBitRate);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: aggregateMaximumBitRate\n");
+ return false;
+ }
+ }
+
+ if (data.delayDownlinkPacketNotificationRequestIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = DelayValueIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ DelayValueIe delayValue=
+ dynamic_cast<
+ DelayValueIe&>(GtpV2IeFactory::getInstance().getIeObject(DelayValueIeType));
+ rc = delayValue.encodeDelayValueIe(buffer, data.delayDownlinkPacketNotificationRequest);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: delayDownlinkPacketNotificationRequest\n");
+ return false;
+ }
+ }
+
+ // First validate if the applicatoin provided more than the expected cardinality
+ if (data.bearerContextsToBeModifiedCount > 11)
+ {
+ errorStream.add((char *)"Number of entries of bearerContextsToBeModified exceeded\n");
+ errorStream.add((char *)"Expected count: 11 Received count: ");
+ errorStream.add((char *)"data.bearerContextsToBeModifiedCount");
+ errorStream.endOfLine();
+ return false;
+ }
+ for (Uint8 i = 0; i < data.bearerContextsToBeModifiedCount; i++)
+ {
+ // Encode the Ie Header
+ header.ieType = BearerContextIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ BearerContextIe bearerContext=
+ dynamic_cast<
+ BearerContextIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(BearerContextIeType));
+ BearerContextsToBeModifiedInModifyBearerRequest groupedIeInstance = dynamic_cast<BearerContextsToBeModifiedInModifyBearerRequest&>(bearerContext.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.encodeBearerContextsToBeModifiedInModifyBearerRequest(buffer, data.bearerContextsToBeModified[i]);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ }
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: bearerContextsToBeModified\n");
+ return false;
+ }
+
+ // First validate if the applicatoin provided more than the expected cardinality
+ if (data.bearerContextsToBeRemovedCount > 11)
+ {
+ errorStream.add((char *)"Number of entries of bearerContextsToBeRemoved exceeded\n");
+ errorStream.add((char *)"Expected count: 11 Received count: ");
+ errorStream.add((char *)"data.bearerContextsToBeRemovedCount");
+ errorStream.endOfLine();
+ return false;
+ }
+ for (Uint8 i = 0; i < data.bearerContextsToBeRemovedCount; i++)
+ {
+ // Encode the Ie Header
+ header.ieType = BearerContextIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ BearerContextIe bearerContext=
+ dynamic_cast<
+ BearerContextIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(BearerContextIeType));
+ BearerContextsToBeRemovedInModifyBearerRequest groupedIeInstance = dynamic_cast<BearerContextsToBeRemovedInModifyBearerRequest&>(bearerContext.getGroupedIe(msgType, 1));
+ rc = groupedIeInstance.encodeBearerContextsToBeRemovedInModifyBearerRequest(buffer, data.bearerContextsToBeRemoved[i]);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ }
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: bearerContextsToBeRemoved\n");
+ return false;
+ }
+
+ if (data.recoveryIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = RecoveryIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ RecoveryIe recovery=
+ dynamic_cast<
+ RecoveryIe&>(GtpV2IeFactory::getInstance().getIeObject(RecoveryIeType));
+ rc = recovery.encodeRecoveryIe(buffer, data.recovery);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: recovery\n");
+ return false;
+ }
+ }
+
+ if (data.ueTimeZoneIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = UeTimeZoneIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ UeTimeZoneIe ueTimeZone=
+ dynamic_cast<
+ UeTimeZoneIe&>(GtpV2IeFactory::getInstance().getIeObject(UeTimeZoneIeType));
+ rc = ueTimeZone.encodeUeTimeZoneIe(buffer, data.ueTimeZone);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: ueTimeZone\n");
+ return false;
+ }
+ }
+
+ if (data.mmeFqCsidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FqCsidIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ rc = fqCsid.encodeFqCsidIe(buffer, data.mmeFqCsid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: mmeFqCsid\n");
+ return false;
+ }
+ }
+
+ if (data.sgwFqCsidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FqCsidIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ rc = fqCsid.encodeFqCsidIe(buffer, data.sgwFqCsid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: sgwFqCsid\n");
+ return false;
+ }
+ }
+
+ if (data.userCsgInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = UciIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ UciIe uci=
+ dynamic_cast<
+ UciIe&>(GtpV2IeFactory::getInstance().getIeObject(UciIeType));
+ rc = uci.encodeUciIe(buffer, data.userCsgInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: userCsgInformation\n");
+ return false;
+ }
+ }
+
+ if (data.ueLocalIpAddressIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = IpAddressIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ IpAddressIe ipAddress=
+ dynamic_cast<
+ IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
+ rc = ipAddress.encodeIpAddressIe(buffer, data.ueLocalIpAddress);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: ueLocalIpAddress\n");
+ return false;
+ }
+ }
+
+ if (data.ueUdpPortIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = PortNumberIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ PortNumberIe portNumber=
+ dynamic_cast<
+ PortNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(PortNumberIeType));
+ rc = portNumber.encodePortNumberIe(buffer, data.ueUdpPort);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: ueUdpPort\n");
+ return false;
+ }
+ }
+
+ if (data.mmeS4SgsnLdnIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = LocalDistinguishedNameIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ LocalDistinguishedNameIe localDistinguishedName=
+ dynamic_cast<
+ LocalDistinguishedNameIe&>(GtpV2IeFactory::getInstance().getIeObject(LocalDistinguishedNameIeType));
+ rc = localDistinguishedName.encodeLocalDistinguishedNameIe(buffer, data.mmeS4SgsnLdn);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: mmeS4SgsnLdn\n");
+ return false;
+ }
+ }
+
+ if (data.sgwLdnIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = LocalDistinguishedNameIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ LocalDistinguishedNameIe localDistinguishedName=
+ dynamic_cast<
+ LocalDistinguishedNameIe&>(GtpV2IeFactory::getInstance().getIeObject(LocalDistinguishedNameIeType));
+ rc = localDistinguishedName.encodeLocalDistinguishedNameIe(buffer, data.sgwLdn);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: sgwLdn\n");
+ return false;
+ }
+ }
+
+ if (data.hNbLocalIpAddressIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = IpAddressIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ IpAddressIe ipAddress=
+ dynamic_cast<
+ IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
+ rc = ipAddress.encodeIpAddressIe(buffer, data.hNbLocalIpAddress);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: hNbLocalIpAddress\n");
+ return false;
+ }
+ }
+
+ if (data.hNbUdpPortIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = PortNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ PortNumberIe portNumber=
+ dynamic_cast<
+ PortNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(PortNumberIeType));
+ rc = portNumber.encodePortNumberIe(buffer, data.hNbUdpPort);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: hNbUdpPort\n");
+ return false;
+ }
+ }
+
+ if (data.mmeS4SgsnIdentifierIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = IpAddressIeType;
+ header.instance = 2;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ IpAddressIe ipAddress=
+ dynamic_cast<
+ IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
+ rc = ipAddress.encodeIpAddressIe(buffer, data.mmeS4SgsnIdentifier);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: mmeS4SgsnIdentifier\n");
+ return false;
+ }
+ }
+
+ if (data.cnOperatorSelectionEntityIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = CnOperatorSelectionEntityIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ CnOperatorSelectionEntityIe cnOperatorSelectionEntity=
+ dynamic_cast<
+ CnOperatorSelectionEntityIe&>(GtpV2IeFactory::getInstance().getIeObject(CnOperatorSelectionEntityIeType));
+ rc = cnOperatorSelectionEntity.encodeCnOperatorSelectionEntityIe(buffer, data.cnOperatorSelectionEntity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: cnOperatorSelectionEntity\n");
+ return false;
+ }
+ }
+
+ if (data.mmeS4SgsnsOverloadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = OverloadControlInformationIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ MmeS4SgsnsOverloadControlInformationInModifyBearerRequest groupedIeInstance =
+ dynamic_cast<
+ MmeS4SgsnsOverloadControlInformationInModifyBearerRequest&>(overloadControlInformation.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.encodeMmeS4SgsnsOverloadControlInformationInModifyBearerRequest(buffer, data.mmeS4SgsnsOverloadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: mmeS4SgsnsOverloadControlInformation\n");
+ return false;
+ }
+ }
+
+ if (data.sgwsOverloadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = OverloadControlInformationIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ SgwsOverloadControlInformationInModifyBearerRequest groupedIeInstance =
+ dynamic_cast<
+ SgwsOverloadControlInformationInModifyBearerRequest&>(overloadControlInformation.getGroupedIe(msgType, 1));
+ rc = groupedIeInstance.encodeSgwsOverloadControlInformationInModifyBearerRequest(buffer, data.sgwsOverloadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: sgwsOverloadControlInformation\n");
+ return false;
+ }
+ }
+
+ if (data.epdgsOverloadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = OverloadControlInformationIeType;
+ header.instance = 2;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ EpdgsOverloadControlInformationInModifyBearerRequest groupedIeInstance =
+ dynamic_cast<
+ EpdgsOverloadControlInformationInModifyBearerRequest&>(overloadControlInformation.getGroupedIe(msgType, 2));
+ rc = groupedIeInstance.encodeEpdgsOverloadControlInformationInModifyBearerRequest(buffer, data.epdgsOverloadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: epdgsOverloadControlInformation\n");
+ return false;
+ }
+ }
+
+ if (data.servingPlmnRateControlIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = ServingPlmnRateControlIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ ServingPlmnRateControlIe servingPlmnRateControl=
+ dynamic_cast<
+ ServingPlmnRateControlIe&>(GtpV2IeFactory::getInstance().getIeObject(ServingPlmnRateControlIeType));
+ rc = servingPlmnRateControl.encodeServingPlmnRateControlIe(buffer, data.servingPlmnRateControl);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: servingPlmnRateControl\n");
+ return false;
+ }
+ }
+
+ if (data.moExceptionDataCounterIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = CounterIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ CounterIe counter=
+ dynamic_cast<
+ CounterIe&>(GtpV2IeFactory::getInstance().getIeObject(CounterIeType));
+ rc = counter.encodeCounterIe(buffer, data.moExceptionDataCounter);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: moExceptionDataCounter\n");
+ return false;
+ }
+ }
+
+ if (data.imsiIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = ImsiIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ ImsiIe imsi=
+ dynamic_cast<
+ ImsiIe&>(GtpV2IeFactory::getInstance().getIeObject(ImsiIeType));
+ rc = imsi.encodeImsiIe(buffer, data.imsi);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: imsi\n");
+ return false;
+ }
+ }
+
+ if (data.userLocationInformationForSgwIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = UliIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ UliIe uli=
+ dynamic_cast<
+ UliIe&>(GtpV2IeFactory::getInstance().getIeObject(UliIeType));
+ rc = uli.encodeUliIe(buffer, data.userLocationInformationForSgw);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: userLocationInformationForSgw\n");
+ return false;
+ }
+ }
+
+ if (data.wlanLocationInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = TwanIdentifierIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ TwanIdentifierIe twanIdentifier=
+ dynamic_cast<
+ TwanIdentifierIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierIeType));
+ rc = twanIdentifier.encodeTwanIdentifierIe(buffer, data.wlanLocationInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: wlanLocationInformation\n");
+ return false;
+ }
+ }
+
+ if (data.wlanLocationTimestampIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = TwanIdentifierTimestampIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ TwanIdentifierTimestampIe twanIdentifierTimestamp=
+ dynamic_cast<
+ TwanIdentifierTimestampIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierTimestampIeType));
+ rc = twanIdentifierTimestamp.encodeTwanIdentifierTimestampIe(buffer, data.wlanLocationTimestamp);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: wlanLocationTimestamp\n");
+ return false;
+ }
+ }
+
+ if (data.secondaryRatUsageDataReportIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = SecondaryRatUsageDataReportIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SecondaryRatUsageDataReportIe secondaryRatUsageDataReport=
+ dynamic_cast<
+ SecondaryRatUsageDataReportIe&>(GtpV2IeFactory::getInstance().getIeObject(SecondaryRatUsageDataReportIeType));
+ rc = secondaryRatUsageDataReport.encodeSecondaryRatUsageDataReportIe(buffer, data.secondaryRatUsageDataReport);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: secondaryRatUsageDataReport\n");
+ return false;
+ }
+ }
+ return rc;
+
+}
+
+bool ModifyBearerRequestMsg::decodeModifyBearerRequestMsg(MsgBuffer &buffer,
+ ModifyBearerRequestMsgData
+ &data, Uint16 length)
+{
+
+ bool rc = false;
+ GtpV2IeHeader ieHeader;
+
+ set<Uint16> mandatoryIeLocalList = mandatoryIeSet;
+ while (buffer.lengthLeft() > IE_HEADER_SIZE)
+ {
+ GtpV2Ie::decodeGtpV2IeHeader(buffer, ieHeader);
+ if (ieHeader.length > buffer.lengthLeft())
+ {
+ // We do not have enough bytes left in the message for this IE
+ errorStream.add((char *)"IE Length exceeds beyond message boundary\n");
+ errorStream.add((char *)" Offending IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.add((char *)"\n Ie Length in Header: ");
+ errorStream.add(ieHeader.length);
+ errorStream.add((char *)"\n Bytes left in message: ");
+ errorStream.add(buffer.lengthLeft());
+ errorStream.endOfLine();
+ return false;
+ }
+
+ switch (ieHeader.ieType){
+
+ case MeiIeType:
+ {
+ MeiIe ieObject =
+ dynamic_cast<
+ MeiIe&>(GtpV2IeFactory::getInstance().getIeObject(MeiIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeMeiIe(buffer, data.meIdentity, ieHeader.length);
+
+ data.meIdentityIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: meIdentity\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case UliIeType:
+ {
+ UliIe ieObject =
+ dynamic_cast<
+ UliIe&>(GtpV2IeFactory::getInstance().getIeObject(UliIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeUliIe(buffer, data.userLocationInformation, ieHeader.length);
+
+ data.userLocationInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: userLocationInformation\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ rc = ieObject.decodeUliIe(buffer, data.userLocationInformationForSgw, ieHeader.length);
+
+ data.userLocationInformationForSgwIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: userLocationInformationForSgw\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case ServingNetworkIeType:
+ {
+ ServingNetworkIe ieObject =
+ dynamic_cast<
+ ServingNetworkIe&>(GtpV2IeFactory::getInstance().getIeObject(ServingNetworkIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeServingNetworkIe(buffer, data.servingNetwork, ieHeader.length);
+
+ data.servingNetworkIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: servingNetwork\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case RatTypeIeType:
+ {
+ RatTypeIe ieObject =
+ dynamic_cast<
+ RatTypeIe&>(GtpV2IeFactory::getInstance().getIeObject(RatTypeIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeRatTypeIe(buffer, data.ratType, ieHeader.length);
+
+ data.ratTypeIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: ratType\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case IndicationIeType:
+ {
+ IndicationIe ieObject =
+ dynamic_cast<
+ IndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(IndicationIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeIndicationIe(buffer, data.indicationFlags, ieHeader.length);
+
+ data.indicationFlagsIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: indicationFlags\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case FTeidIeType:
+ {
+ FTeidIe ieObject =
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeFTeidIe(buffer, data.senderFTeidForControlPlane, ieHeader.length);
+
+ data.senderFTeidForControlPlaneIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: senderFTeidForControlPlane\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case AmbrIeType:
+ {
+ AmbrIe ieObject =
+ dynamic_cast<
+ AmbrIe&>(GtpV2IeFactory::getInstance().getIeObject(AmbrIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeAmbrIe(buffer, data.aggregateMaximumBitRate, ieHeader.length);
+
+ data.aggregateMaximumBitRateIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: aggregateMaximumBitRate\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case DelayValueIeType:
+ {
+ DelayValueIe ieObject =
+ dynamic_cast<
+ DelayValueIe&>(GtpV2IeFactory::getInstance().getIeObject(DelayValueIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeDelayValueIe(buffer, data.delayDownlinkPacketNotificationRequest, ieHeader.length);
+
+ data.delayDownlinkPacketNotificationRequestIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: delayDownlinkPacketNotificationRequest\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case BearerContextIeType:
+ {
+ BearerContextIe ieObject =
+ dynamic_cast<
+ BearerContextIe&>(GtpV2IeFactory::getInstance().getIeObject(BearerContextIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ // First check if we have enough space left to decode and store this instance
+ if (data.bearerContextsToBeModifiedCount == 11)
+ {
+ errorStream.add((char *)"More than 11 instances of bearerContextsToBeModified received\n");
+ return false;
+ }
+ BearerContextsToBeModifiedInModifyBearerRequest groupedIeInstance =
+ dynamic_cast<
+ BearerContextsToBeModifiedInModifyBearerRequest&>(ieObject.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.decodeBearerContextsToBeModifiedInModifyBearerRequest(buffer,
+ data.bearerContextsToBeModified[data.bearerContextsToBeModifiedCount], ieHeader.length);
+ data.bearerContextsToBeModifiedCount++; // TODO Count validation
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: bearerContextsToBeModified\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ // First check if we have enough space left to decode and store this instance
+ if (data.bearerContextsToBeRemovedCount == 11)
+ {
+ errorStream.add((char *)"More than 11 instances of bearerContextsToBeRemoved received\n");
+ return false;
+ }
+ BearerContextsToBeRemovedInModifyBearerRequest groupedIeInstance =
+ dynamic_cast<
+ BearerContextsToBeRemovedInModifyBearerRequest&>(ieObject.getGroupedIe(msgType, 1));
+ rc = groupedIeInstance.decodeBearerContextsToBeRemovedInModifyBearerRequest(buffer,
+ data.bearerContextsToBeRemoved[data.bearerContextsToBeRemovedCount], ieHeader.length);
+ data.bearerContextsToBeRemovedCount++; // TODO Count validation
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: bearerContextsToBeRemoved\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case RecoveryIeType:
+ {
+ RecoveryIe ieObject =
+ dynamic_cast<
+ RecoveryIe&>(GtpV2IeFactory::getInstance().getIeObject(RecoveryIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeRecoveryIe(buffer, data.recovery, ieHeader.length);
+
+ data.recoveryIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: recovery\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case UeTimeZoneIeType:
+ {
+ UeTimeZoneIe ieObject =
+ dynamic_cast<
+ UeTimeZoneIe&>(GtpV2IeFactory::getInstance().getIeObject(UeTimeZoneIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeUeTimeZoneIe(buffer, data.ueTimeZone, ieHeader.length);
+
+ data.ueTimeZoneIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: ueTimeZone\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case FqCsidIeType:
+ {
+ FqCsidIe ieObject =
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeFqCsidIe(buffer, data.mmeFqCsid, ieHeader.length);
+
+ data.mmeFqCsidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: mmeFqCsid\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ rc = ieObject.decodeFqCsidIe(buffer, data.sgwFqCsid, ieHeader.length);
+
+ data.sgwFqCsidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: sgwFqCsid\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case UciIeType:
+ {
+ UciIe ieObject =
+ dynamic_cast<
+ UciIe&>(GtpV2IeFactory::getInstance().getIeObject(UciIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeUciIe(buffer, data.userCsgInformation, ieHeader.length);
+
+ data.userCsgInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: userCsgInformation\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case IpAddressIeType:
+ {
+ IpAddressIe ieObject =
+ dynamic_cast<
+ IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
+
+ if(ieHeader.instance == 1)
+ {
+ rc = ieObject.decodeIpAddressIe(buffer, data.ueLocalIpAddress, ieHeader.length);
+
+ data.ueLocalIpAddressIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: ueLocalIpAddress\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeIpAddressIe(buffer, data.hNbLocalIpAddress, ieHeader.length);
+
+ data.hNbLocalIpAddressIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: hNbLocalIpAddress\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 2)
+ {
+ rc = ieObject.decodeIpAddressIe(buffer, data.mmeS4SgsnIdentifier, ieHeader.length);
+
+ data.mmeS4SgsnIdentifierIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: mmeS4SgsnIdentifier\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case PortNumberIeType:
+ {
+ PortNumberIe ieObject =
+ dynamic_cast<
+ PortNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(PortNumberIeType));
+
+ if(ieHeader.instance == 1)
+ {
+ rc = ieObject.decodePortNumberIe(buffer, data.ueUdpPort, ieHeader.length);
+
+ data.ueUdpPortIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: ueUdpPort\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodePortNumberIe(buffer, data.hNbUdpPort, ieHeader.length);
+
+ data.hNbUdpPortIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: hNbUdpPort\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case LocalDistinguishedNameIeType:
+ {
+ LocalDistinguishedNameIe ieObject =
+ dynamic_cast<
+ LocalDistinguishedNameIe&>(GtpV2IeFactory::getInstance().getIeObject(LocalDistinguishedNameIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeLocalDistinguishedNameIe(buffer, data.mmeS4SgsnLdn, ieHeader.length);
+
+ data.mmeS4SgsnLdnIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: mmeS4SgsnLdn\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeLocalDistinguishedNameIe(buffer, data.sgwLdn, ieHeader.length);
+
+ data.sgwLdnIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: sgwLdn\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case CnOperatorSelectionEntityIeType:
+ {
+ CnOperatorSelectionEntityIe ieObject =
+ dynamic_cast<
+ CnOperatorSelectionEntityIe&>(GtpV2IeFactory::getInstance().getIeObject(CnOperatorSelectionEntityIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeCnOperatorSelectionEntityIe(buffer, data.cnOperatorSelectionEntity, ieHeader.length);
+
+ data.cnOperatorSelectionEntityIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: cnOperatorSelectionEntity\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case OverloadControlInformationIeType:
+ {
+ OverloadControlInformationIe ieObject =
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ MmeS4SgsnsOverloadControlInformationInModifyBearerRequest groupedIeInstance =
+ dynamic_cast<
+ MmeS4SgsnsOverloadControlInformationInModifyBearerRequest&>(ieObject.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.decodeMmeS4SgsnsOverloadControlInformationInModifyBearerRequest(buffer, data.mmeS4SgsnsOverloadControlInformation, ieHeader.length);
+
+ data.mmeS4SgsnsOverloadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: mmeS4SgsnsOverloadControlInformation\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ SgwsOverloadControlInformationInModifyBearerRequest groupedIeInstance =
+ dynamic_cast<
+ SgwsOverloadControlInformationInModifyBearerRequest&>(ieObject.getGroupedIe(msgType, 1));
+ rc = groupedIeInstance.decodeSgwsOverloadControlInformationInModifyBearerRequest(buffer, data.sgwsOverloadControlInformation, ieHeader.length);
+
+ data.sgwsOverloadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: sgwsOverloadControlInformation\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 2)
+ {
+ EpdgsOverloadControlInformationInModifyBearerRequest groupedIeInstance =
+ dynamic_cast<
+ EpdgsOverloadControlInformationInModifyBearerRequest&>(ieObject.getGroupedIe(msgType, 2));
+ rc = groupedIeInstance.decodeEpdgsOverloadControlInformationInModifyBearerRequest(buffer, data.epdgsOverloadControlInformation, ieHeader.length);
+
+ data.epdgsOverloadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: epdgsOverloadControlInformation\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case ServingPlmnRateControlIeType:
+ {
+ ServingPlmnRateControlIe ieObject =
+ dynamic_cast<
+ ServingPlmnRateControlIe&>(GtpV2IeFactory::getInstance().getIeObject(ServingPlmnRateControlIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeServingPlmnRateControlIe(buffer, data.servingPlmnRateControl, ieHeader.length);
+
+ data.servingPlmnRateControlIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: servingPlmnRateControl\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case CounterIeType:
+ {
+ CounterIe ieObject =
+ dynamic_cast<
+ CounterIe&>(GtpV2IeFactory::getInstance().getIeObject(CounterIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeCounterIe(buffer, data.moExceptionDataCounter, ieHeader.length);
+
+ data.moExceptionDataCounterIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: moExceptionDataCounter\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case ImsiIeType:
+ {
+ ImsiIe ieObject =
+ dynamic_cast<
+ ImsiIe&>(GtpV2IeFactory::getInstance().getIeObject(ImsiIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeImsiIe(buffer, data.imsi, ieHeader.length);
+
+ data.imsiIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: imsi\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case TwanIdentifierIeType:
+ {
+ TwanIdentifierIe ieObject =
+ dynamic_cast<
+ TwanIdentifierIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeTwanIdentifierIe(buffer, data.wlanLocationInformation, ieHeader.length);
+
+ data.wlanLocationInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: wlanLocationInformation\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case TwanIdentifierTimestampIeType:
+ {
+ TwanIdentifierTimestampIe ieObject =
+ dynamic_cast<
+ TwanIdentifierTimestampIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierTimestampIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeTwanIdentifierTimestampIe(buffer, data.wlanLocationTimestamp, ieHeader.length);
+
+ data.wlanLocationTimestampIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: wlanLocationTimestamp\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case SecondaryRatUsageDataReportIeType:
+ {
+ SecondaryRatUsageDataReportIe ieObject =
+ dynamic_cast<
+ SecondaryRatUsageDataReportIe&>(GtpV2IeFactory::getInstance().getIeObject(SecondaryRatUsageDataReportIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeSecondaryRatUsageDataReportIe(buffer, data.secondaryRatUsageDataReport, ieHeader.length);
+
+ data.secondaryRatUsageDataReportIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: secondaryRatUsageDataReport\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ default:
+ {
+ // Unknown IE print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ }
+ }
+ return rc; // TODO validations
+}
+
+void ModifyBearerRequestMsg::
+displayModifyBearerRequestMsgData_v(ModifyBearerRequestMsgData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"ModifyBearerRequestMsg:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+ if (data.meIdentityIePresent)
+ {
+
+
+ stream.add((char *)"IE - meIdentity:");
+ stream.endOfLine();
+ MeiIe mei=
+ dynamic_cast<
+ MeiIe&>(GtpV2IeFactory::getInstance().getIeObject(MeiIeType));
+ mei.displayMeiIe_v(data.meIdentity, stream);
+
+ }
+ if (data.userLocationInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - userLocationInformation:");
+ stream.endOfLine();
+ UliIe uli=
+ dynamic_cast<
+ UliIe&>(GtpV2IeFactory::getInstance().getIeObject(UliIeType));
+ uli.displayUliIe_v(data.userLocationInformation, stream);
+
+ }
+ if (data.servingNetworkIePresent)
+ {
+
+
+ stream.add((char *)"IE - servingNetwork:");
+ stream.endOfLine();
+ ServingNetworkIe servingNetwork=
+ dynamic_cast<
+ ServingNetworkIe&>(GtpV2IeFactory::getInstance().getIeObject(ServingNetworkIeType));
+ servingNetwork.displayServingNetworkIe_v(data.servingNetwork, stream);
+
+ }
+ if (data.ratTypeIePresent)
+ {
+
+
+ stream.add((char *)"IE - ratType:");
+ stream.endOfLine();
+ RatTypeIe ratType=
+ dynamic_cast<
+ RatTypeIe&>(GtpV2IeFactory::getInstance().getIeObject(RatTypeIeType));
+ ratType.displayRatTypeIe_v(data.ratType, stream);
+
+ }
+ if (data.indicationFlagsIePresent)
+ {
+
+
+ stream.add((char *)"IE - indicationFlags:");
+ stream.endOfLine();
+ IndicationIe indication=
+ dynamic_cast<
+ IndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(IndicationIeType));
+ indication.displayIndicationIe_v(data.indicationFlags, stream);
+
+ }
+ if (data.senderFTeidForControlPlaneIePresent)
+ {
+
+
+ stream.add((char *)"IE - senderFTeidForControlPlane:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.senderFTeidForControlPlane, stream);
+
+ }
+ if (data.aggregateMaximumBitRateIePresent)
+ {
+
+
+ stream.add((char *)"IE - aggregateMaximumBitRate:");
+ stream.endOfLine();
+ AmbrIe ambr=
+ dynamic_cast<
+ AmbrIe&>(GtpV2IeFactory::getInstance().getIeObject(AmbrIeType));
+ ambr.displayAmbrIe_v(data.aggregateMaximumBitRate, stream);
+
+ }
+ if (data.delayDownlinkPacketNotificationRequestIePresent)
+ {
+
+
+ stream.add((char *)"IE - delayDownlinkPacketNotificationRequest:");
+ stream.endOfLine();
+ DelayValueIe delayValue=
+ dynamic_cast<
+ DelayValueIe&>(GtpV2IeFactory::getInstance().getIeObject(DelayValueIeType));
+ delayValue.displayDelayValueIe_v(data.delayDownlinkPacketNotificationRequest, stream);
+
+ }
+
+ Uint8 displayCount;
+
+ displayCount = data.bearerContextsToBeModifiedCount;
+ if (displayCount > 11)
+ {
+ stream.add((char *)"Invalid data more than 11 instances");
+ stream.endOfLine();
+ stream.add((char *)"Displaying only 11");
+ stream.endOfLine();
+ displayCount = 11;
+ }
+ for (Uint8 i = 0; i < displayCount; i++)
+ {
+ stream.add((char *)"IE - bearerContextsToBeModified:");
+ stream.endOfLine();
+ BearerContextIe bearerContext=
+ dynamic_cast<
+ BearerContextIe&>(GtpV2IeFactory::getInstance().getIeObject(BearerContextIeType));
+ BearerContextsToBeModifiedInModifyBearerRequest groupedIeInstance =
+ dynamic_cast<
+ BearerContextsToBeModifiedInModifyBearerRequest&>(bearerContext.getGroupedIe(msgType, 0));
+ groupedIeInstance.displayBearerContextsToBeModifiedInModifyBearerRequestData_v(data.bearerContextsToBeModified[i], stream);
+ }
+
+
+
+
+ displayCount = data.bearerContextsToBeRemovedCount;
+ if (displayCount > 11)
+ {
+ stream.add((char *)"Invalid data more than 11 instances");
+ stream.endOfLine();
+ stream.add((char *)"Displaying only 11");
+ stream.endOfLine();
+ displayCount = 11;
+ }
+ for (Uint8 i = 0; i < displayCount; i++)
+ {
+ stream.add((char *)"IE - bearerContextsToBeRemoved:");
+ stream.endOfLine();
+ BearerContextIe bearerContext=
+ dynamic_cast<
+ BearerContextIe&>(GtpV2IeFactory::getInstance().getIeObject(BearerContextIeType));
+ BearerContextsToBeRemovedInModifyBearerRequest groupedIeInstance =
+ dynamic_cast<
+ BearerContextsToBeRemovedInModifyBearerRequest&>(bearerContext.getGroupedIe(msgType, 1));
+ groupedIeInstance.displayBearerContextsToBeRemovedInModifyBearerRequestData_v(data.bearerContextsToBeRemoved[i], stream);
+ }
+
+
+
+
+ if (data.recoveryIePresent)
+ {
+
+
+ stream.add((char *)"IE - recovery:");
+ stream.endOfLine();
+ RecoveryIe recovery=
+ dynamic_cast<
+ RecoveryIe&>(GtpV2IeFactory::getInstance().getIeObject(RecoveryIeType));
+ recovery.displayRecoveryIe_v(data.recovery, stream);
+
+ }
+ if (data.ueTimeZoneIePresent)
+ {
+
+
+ stream.add((char *)"IE - ueTimeZone:");
+ stream.endOfLine();
+ UeTimeZoneIe ueTimeZone=
+ dynamic_cast<
+ UeTimeZoneIe&>(GtpV2IeFactory::getInstance().getIeObject(UeTimeZoneIeType));
+ ueTimeZone.displayUeTimeZoneIe_v(data.ueTimeZone, stream);
+
+ }
+ if (data.mmeFqCsidIePresent)
+ {
+
+
+ stream.add((char *)"IE - mmeFqCsid:");
+ stream.endOfLine();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ fqCsid.displayFqCsidIe_v(data.mmeFqCsid, stream);
+
+ }
+ if (data.sgwFqCsidIePresent)
+ {
+
+
+ stream.add((char *)"IE - sgwFqCsid:");
+ stream.endOfLine();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ fqCsid.displayFqCsidIe_v(data.sgwFqCsid, stream);
+
+ }
+ if (data.userCsgInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - userCsgInformation:");
+ stream.endOfLine();
+ UciIe uci=
+ dynamic_cast<
+ UciIe&>(GtpV2IeFactory::getInstance().getIeObject(UciIeType));
+ uci.displayUciIe_v(data.userCsgInformation, stream);
+
+ }
+ if (data.ueLocalIpAddressIePresent)
+ {
+
+
+ stream.add((char *)"IE - ueLocalIpAddress:");
+ stream.endOfLine();
+ IpAddressIe ipAddress=
+ dynamic_cast<
+ IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
+ ipAddress.displayIpAddressIe_v(data.ueLocalIpAddress, stream);
+
+ }
+ if (data.ueUdpPortIePresent)
+ {
+
+
+ stream.add((char *)"IE - ueUdpPort:");
+ stream.endOfLine();
+ PortNumberIe portNumber=
+ dynamic_cast<
+ PortNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(PortNumberIeType));
+ portNumber.displayPortNumberIe_v(data.ueUdpPort, stream);
+
+ }
+ if (data.mmeS4SgsnLdnIePresent)
+ {
+
+
+ stream.add((char *)"IE - mmeS4SgsnLdn:");
+ stream.endOfLine();
+ LocalDistinguishedNameIe localDistinguishedName=
+ dynamic_cast<
+ LocalDistinguishedNameIe&>(GtpV2IeFactory::getInstance().getIeObject(LocalDistinguishedNameIeType));
+ localDistinguishedName.displayLocalDistinguishedNameIe_v(data.mmeS4SgsnLdn, stream);
+
+ }
+ if (data.sgwLdnIePresent)
+ {
+
+
+ stream.add((char *)"IE - sgwLdn:");
+ stream.endOfLine();
+ LocalDistinguishedNameIe localDistinguishedName=
+ dynamic_cast<
+ LocalDistinguishedNameIe&>(GtpV2IeFactory::getInstance().getIeObject(LocalDistinguishedNameIeType));
+ localDistinguishedName.displayLocalDistinguishedNameIe_v(data.sgwLdn, stream);
+
+ }
+ if (data.hNbLocalIpAddressIePresent)
+ {
+
+
+ stream.add((char *)"IE - hNbLocalIpAddress:");
+ stream.endOfLine();
+ IpAddressIe ipAddress=
+ dynamic_cast<
+ IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
+ ipAddress.displayIpAddressIe_v(data.hNbLocalIpAddress, stream);
+
+ }
+ if (data.hNbUdpPortIePresent)
+ {
+
+
+ stream.add((char *)"IE - hNbUdpPort:");
+ stream.endOfLine();
+ PortNumberIe portNumber=
+ dynamic_cast<
+ PortNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(PortNumberIeType));
+ portNumber.displayPortNumberIe_v(data.hNbUdpPort, stream);
+
+ }
+ if (data.mmeS4SgsnIdentifierIePresent)
+ {
+
+
+ stream.add((char *)"IE - mmeS4SgsnIdentifier:");
+ stream.endOfLine();
+ IpAddressIe ipAddress=
+ dynamic_cast<
+ IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
+ ipAddress.displayIpAddressIe_v(data.mmeS4SgsnIdentifier, stream);
+
+ }
+ if (data.cnOperatorSelectionEntityIePresent)
+ {
+
+
+ stream.add((char *)"IE - cnOperatorSelectionEntity:");
+ stream.endOfLine();
+ CnOperatorSelectionEntityIe cnOperatorSelectionEntity=
+ dynamic_cast<
+ CnOperatorSelectionEntityIe&>(GtpV2IeFactory::getInstance().getIeObject(CnOperatorSelectionEntityIeType));
+ cnOperatorSelectionEntity.displayCnOperatorSelectionEntityIe_v(data.cnOperatorSelectionEntity, stream);
+
+ }
+ if (data.mmeS4SgsnsOverloadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - mmeS4SgsnsOverloadControlInformation:");
+ stream.endOfLine();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ MmeS4SgsnsOverloadControlInformationInModifyBearerRequest groupedIeInstance =
+ dynamic_cast<
+ MmeS4SgsnsOverloadControlInformationInModifyBearerRequest&>(overloadControlInformation.getGroupedIe(msgType, 0));
+ groupedIeInstance.displayMmeS4SgsnsOverloadControlInformationInModifyBearerRequestData_v(data.mmeS4SgsnsOverloadControlInformation, stream);
+
+ }
+ if (data.sgwsOverloadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - sgwsOverloadControlInformation:");
+ stream.endOfLine();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ SgwsOverloadControlInformationInModifyBearerRequest groupedIeInstance =
+ dynamic_cast<
+ SgwsOverloadControlInformationInModifyBearerRequest&>(overloadControlInformation.getGroupedIe(msgType, 1));
+ groupedIeInstance.displaySgwsOverloadControlInformationInModifyBearerRequestData_v(data.sgwsOverloadControlInformation, stream);
+
+ }
+ if (data.epdgsOverloadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - epdgsOverloadControlInformation:");
+ stream.endOfLine();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ EpdgsOverloadControlInformationInModifyBearerRequest groupedIeInstance =
+ dynamic_cast<
+ EpdgsOverloadControlInformationInModifyBearerRequest&>(overloadControlInformation.getGroupedIe(msgType, 2));
+ groupedIeInstance.displayEpdgsOverloadControlInformationInModifyBearerRequestData_v(data.epdgsOverloadControlInformation, stream);
+
+ }
+ if (data.servingPlmnRateControlIePresent)
+ {
+
+
+ stream.add((char *)"IE - servingPlmnRateControl:");
+ stream.endOfLine();
+ ServingPlmnRateControlIe servingPlmnRateControl=
+ dynamic_cast<
+ ServingPlmnRateControlIe&>(GtpV2IeFactory::getInstance().getIeObject(ServingPlmnRateControlIeType));
+ servingPlmnRateControl.displayServingPlmnRateControlIe_v(data.servingPlmnRateControl, stream);
+
+ }
+ if (data.moExceptionDataCounterIePresent)
+ {
+
+
+ stream.add((char *)"IE - moExceptionDataCounter:");
+ stream.endOfLine();
+ CounterIe counter=
+ dynamic_cast<
+ CounterIe&>(GtpV2IeFactory::getInstance().getIeObject(CounterIeType));
+ counter.displayCounterIe_v(data.moExceptionDataCounter, stream);
+
+ }
+ if (data.imsiIePresent)
+ {
+
+
+ stream.add((char *)"IE - imsi:");
+ stream.endOfLine();
+ ImsiIe imsi=
+ dynamic_cast<
+ ImsiIe&>(GtpV2IeFactory::getInstance().getIeObject(ImsiIeType));
+ imsi.displayImsiIe_v(data.imsi, stream);
+
+ }
+ if (data.userLocationInformationForSgwIePresent)
+ {
+
+
+ stream.add((char *)"IE - userLocationInformationForSgw:");
+ stream.endOfLine();
+ UliIe uli=
+ dynamic_cast<
+ UliIe&>(GtpV2IeFactory::getInstance().getIeObject(UliIeType));
+ uli.displayUliIe_v(data.userLocationInformationForSgw, stream);
+
+ }
+ if (data.wlanLocationInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - wlanLocationInformation:");
+ stream.endOfLine();
+ TwanIdentifierIe twanIdentifier=
+ dynamic_cast<
+ TwanIdentifierIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierIeType));
+ twanIdentifier.displayTwanIdentifierIe_v(data.wlanLocationInformation, stream);
+
+ }
+ if (data.wlanLocationTimestampIePresent)
+ {
+
+
+ stream.add((char *)"IE - wlanLocationTimestamp:");
+ stream.endOfLine();
+ TwanIdentifierTimestampIe twanIdentifierTimestamp=
+ dynamic_cast<
+ TwanIdentifierTimestampIe&>(GtpV2IeFactory::getInstance().getIeObject(TwanIdentifierTimestampIeType));
+ twanIdentifierTimestamp.displayTwanIdentifierTimestampIe_v(data.wlanLocationTimestamp, stream);
+
+ }
+ if (data.secondaryRatUsageDataReportIePresent)
+ {
+
+
+ stream.add((char *)"IE - secondaryRatUsageDataReport:");
+ stream.endOfLine();
+ SecondaryRatUsageDataReportIe secondaryRatUsageDataReport=
+ dynamic_cast<
+ SecondaryRatUsageDataReportIe&>(GtpV2IeFactory::getInstance().getIeObject(SecondaryRatUsageDataReportIeType));
+ secondaryRatUsageDataReport.displaySecondaryRatUsageDataReportIe_v(data.secondaryRatUsageDataReport, stream);
+
+ }
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
diff --git a/src/gtpV2Codec/msgClasses/modifyBearerRequestMsg.h b/src/gtpV2Codec/msgClasses/modifyBearerRequestMsg.h
new file mode 100644
index 0000000..2a06175
--- /dev/null
+++ b/src/gtpV2Codec/msgClasses/modifyBearerRequestMsg.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2019-present, Infosys Limited.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ /******************************************************************************
+ *
+ * This is an auto generated file.
+ * Please do not edit this file.
+ * All edits to be made through template source file
+ * <TOP-DIR/scripts/GtpV2StackCodeGen/tts/msgtemplate.h.tt>
+ ******************************************************************************/
+#ifndef MODIFYBEARERREQUESTMSG_H_
+#define MODIFYBEARERREQUESTMSG_H_
+
+#include <set>
+#include "manual/gtpV2Message.h"
+#include <msgBuffer.h>
+#include <debug.h>
+#include "gtpV2MsgDataTypes.h"
+
+
+class ModifyBearerRequestMsg:public GtpV2Message
+{
+public:
+ ModifyBearerRequestMsg();
+ virtual ~ModifyBearerRequestMsg();
+ bool encodeModifyBearerRequestMsg(MsgBuffer &buffer, ModifyBearerRequestMsgData const &data);
+
+ bool decodeModifyBearerRequestMsg (MsgBuffer &buffer, ModifyBearerRequestMsgData& data, Uint16 length);
+
+ void displayModifyBearerRequestMsgData_v(ModifyBearerRequestMsgData const &data, Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/msgClasses/modifyBearerResponseMsg.cpp b/src/gtpV2Codec/msgClasses/modifyBearerResponseMsg.cpp
new file mode 100644
index 0000000..e6303de
--- /dev/null
+++ b/src/gtpV2Codec/msgClasses/modifyBearerResponseMsg.cpp
@@ -0,0 +1,1855 @@
+/*
+ * Copyright 2019-present Infosys Limited
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+/******************************************************************************
+ *
+ * This is an auto generated file.
+ * Please do not edit this file.
+ * All edits to be made through template source file
+ * <TOP-DIR/scripts/GtpV2StackCodeGen/tts/msgtemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "modifyBearerResponseMsg.h"
+#include "../ieClasses/manual/gtpV2Ie.h"
+#include "../ieClasses/gtpV2IeFactory.h"
+#include "../ieClasses/ebiIe.h"
+#include "../ieClasses/bearerContextIe.h"
+#include "../ieClasses/bearerContextsModifiedInModifyBearerResponse.h"
+#include "../ieClasses/bearerContextIe.h"
+#include "../ieClasses/bearerContextsMarkedForRemovalInModifyBearerResponse.h"
+#include "../ieClasses/indicationIe.h"
+#include "../ieClasses/causeIe.h"
+#include "../ieClasses/apnRestrictionIe.h"
+#include "../ieClasses/pcoIe.h"
+#include "../ieClasses/changeReportingActionIe.h"
+#include "../ieClasses/csgInformationReportingActionIe.h"
+#include "../ieClasses/henbInformationReportingIe.h"
+#include "../ieClasses/fqdnIe.h"
+#include "../ieClasses/ipAddressIe.h"
+#include "../ieClasses/fqCsidIe.h"
+#include "../ieClasses/fqCsidIe.h"
+#include "../ieClasses/recoveryIe.h"
+#include "../ieClasses/localDistinguishedNameIe.h"
+#include "../ieClasses/localDistinguishedNameIe.h"
+#include "../ieClasses/presenceReportingAreaActionIe.h"
+#include "../ieClasses/loadControlInformationIe.h"
+#include "../ieClasses/pgwsNodeLevelLoadControlInformationInModifyBearerResponse.h"
+#include "../ieClasses/loadControlInformationIe.h"
+#include "../ieClasses/pgwsApnLevelLoadControlInformationInModifyBearerResponse.h"
+#include "../ieClasses/loadControlInformationIe.h"
+#include "../ieClasses/sgwsNodeLevelLoadControlInformationInModifyBearerResponse.h"
+#include "../ieClasses/overloadControlInformationIe.h"
+#include "../ieClasses/pgwsOverloadControlInformationInModifyBearerResponse.h"
+#include "../ieClasses/overloadControlInformationIe.h"
+#include "../ieClasses/sgwsOverloadControlInformationInModifyBearerResponse.h"
+#include "../ieClasses/chargingIdIe.h"
+#include "../ieClasses/msisdnIe.h"
+
+ModifyBearerResponseMsg::ModifyBearerResponseMsg()
+{
+ msgType = ModifyBearerResponseMsgType;
+ Uint16 mandIe;
+ mandIe = CauseIeType;
+ mandIe = (mandIe << 8) | 0; // cause
+ mandatoryIeSet.insert(mandIe);
+}
+
+ModifyBearerResponseMsg::~ModifyBearerResponseMsg()
+{
+
+}
+
+bool ModifyBearerResponseMsg::encodeModifyBearerResponseMsg(MsgBuffer &buffer,
+ ModifyBearerResponseMsgData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+ if (data.linkedEpsBearerIdIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = EbiIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ EbiIe ebi=
+ dynamic_cast<
+ EbiIe&>(GtpV2IeFactory::getInstance().getIeObject(EbiIeType));
+ rc = ebi.encodeEbiIe(buffer, data.linkedEpsBearerId);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: linkedEpsBearerId\n");
+ return false;
+ }
+ }
+
+ // First validate if the applicatoin provided more than the expected cardinality
+ if (data.bearerContextsModifiedCount > 11)
+ {
+ errorStream.add((char *)"Number of entries of bearerContextsModified exceeded\n");
+ errorStream.add((char *)"Expected count: 11 Received count: ");
+ errorStream.add((char *)"data.bearerContextsModifiedCount");
+ errorStream.endOfLine();
+ return false;
+ }
+ for (Uint8 i = 0; i < data.bearerContextsModifiedCount; i++)
+ {
+ // Encode the Ie Header
+ header.ieType = BearerContextIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ BearerContextIe bearerContext=
+ dynamic_cast<
+ BearerContextIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(BearerContextIeType));
+ BearerContextsModifiedInModifyBearerResponse groupedIeInstance = dynamic_cast<BearerContextsModifiedInModifyBearerResponse&>(bearerContext.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.encodeBearerContextsModifiedInModifyBearerResponse(buffer, data.bearerContextsModified[i]);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ }
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: bearerContextsModified\n");
+ return false;
+ }
+
+ // First validate if the applicatoin provided more than the expected cardinality
+ if (data.bearerContextsMarkedForRemovalCount > 11)
+ {
+ errorStream.add((char *)"Number of entries of bearerContextsMarkedForRemoval exceeded\n");
+ errorStream.add((char *)"Expected count: 11 Received count: ");
+ errorStream.add((char *)"data.bearerContextsMarkedForRemovalCount");
+ errorStream.endOfLine();
+ return false;
+ }
+ for (Uint8 i = 0; i < data.bearerContextsMarkedForRemovalCount; i++)
+ {
+ // Encode the Ie Header
+ header.ieType = BearerContextIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ BearerContextIe bearerContext=
+ dynamic_cast<
+ BearerContextIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(BearerContextIeType));
+ BearerContextsMarkedForRemovalInModifyBearerResponse groupedIeInstance = dynamic_cast<BearerContextsMarkedForRemovalInModifyBearerResponse&>(bearerContext.getGroupedIe(msgType, 1));
+ rc = groupedIeInstance.encodeBearerContextsMarkedForRemovalInModifyBearerResponse(buffer, data.bearerContextsMarkedForRemoval[i]);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ }
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: bearerContextsMarkedForRemoval\n");
+ return false;
+ }
+
+ if (data.indicationFlagsIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = IndicationIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ IndicationIe indication=
+ dynamic_cast<
+ IndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(IndicationIeType));
+ rc = indication.encodeIndicationIe(buffer, data.indicationFlags);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: indicationFlags\n");
+ return false;
+ }
+ }
+
+
+ // Encode the Ie Header
+ header.ieType = CauseIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ CauseIe cause=
+ dynamic_cast<
+ CauseIe&>(GtpV2IeFactory::getInstance().getIeObject(CauseIeType));
+ rc = cause.encodeCauseIe(buffer, data.cause);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: cause\n");
+ return false;
+ }
+
+ if (data.apnRestrictionIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = ApnRestrictionIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ ApnRestrictionIe apnRestriction=
+ dynamic_cast<
+ ApnRestrictionIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnRestrictionIeType));
+ rc = apnRestriction.encodeApnRestrictionIe(buffer, data.apnRestriction);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: apnRestriction\n");
+ return false;
+ }
+ }
+
+ if (data.protocolConfigurationOptionsIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = PcoIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ PcoIe pco=
+ dynamic_cast<
+ PcoIe&>(GtpV2IeFactory::getInstance().getIeObject(PcoIeType));
+ rc = pco.encodePcoIe(buffer, data.protocolConfigurationOptions);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: protocolConfigurationOptions\n");
+ return false;
+ }
+ }
+
+ if (data.changeReportingActionIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = ChangeReportingActionIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ ChangeReportingActionIe changeReportingAction=
+ dynamic_cast<
+ ChangeReportingActionIe&>(GtpV2IeFactory::getInstance().getIeObject(ChangeReportingActionIeType));
+ rc = changeReportingAction.encodeChangeReportingActionIe(buffer, data.changeReportingAction);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: changeReportingAction\n");
+ return false;
+ }
+ }
+
+ if (data.csgInformationReportingActionIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = CsgInformationReportingActionIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ CsgInformationReportingActionIe csgInformationReportingAction=
+ dynamic_cast<
+ CsgInformationReportingActionIe&>(GtpV2IeFactory::getInstance().getIeObject(CsgInformationReportingActionIeType));
+ rc = csgInformationReportingAction.encodeCsgInformationReportingActionIe(buffer, data.csgInformationReportingAction);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: csgInformationReportingAction\n");
+ return false;
+ }
+ }
+
+ if (data.hNbInformationReportingIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = HenbInformationReportingIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ HenbInformationReportingIe henbInformationReporting=
+ dynamic_cast<
+ HenbInformationReportingIe&>(GtpV2IeFactory::getInstance().getIeObject(HenbInformationReportingIeType));
+ rc = henbInformationReporting.encodeHenbInformationReportingIe(buffer, data.hNbInformationReporting);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: hNbInformationReporting\n");
+ return false;
+ }
+ }
+
+ if (data.chargingGatewayNameIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FqdnIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ FqdnIe fqdn=
+ dynamic_cast<
+ FqdnIe&>(GtpV2IeFactory::getInstance().getIeObject(FqdnIeType));
+ rc = fqdn.encodeFqdnIe(buffer, data.chargingGatewayName);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: chargingGatewayName\n");
+ return false;
+ }
+ }
+
+ if (data.chargingGatewayAddressIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = IpAddressIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ IpAddressIe ipAddress=
+ dynamic_cast<
+ IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
+ rc = ipAddress.encodeIpAddressIe(buffer, data.chargingGatewayAddress);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: chargingGatewayAddress\n");
+ return false;
+ }
+ }
+
+ if (data.pgwFqCsidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FqCsidIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ rc = fqCsid.encodeFqCsidIe(buffer, data.pgwFqCsid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: pgwFqCsid\n");
+ return false;
+ }
+ }
+
+ if (data.sgwFqCsidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FqCsidIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ rc = fqCsid.encodeFqCsidIe(buffer, data.sgwFqCsid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: sgwFqCsid\n");
+ return false;
+ }
+ }
+
+ if (data.recoveryIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = RecoveryIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ RecoveryIe recovery=
+ dynamic_cast<
+ RecoveryIe&>(GtpV2IeFactory::getInstance().getIeObject(RecoveryIeType));
+ rc = recovery.encodeRecoveryIe(buffer, data.recovery);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: recovery\n");
+ return false;
+ }
+ }
+
+ if (data.sgwLdnIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = LocalDistinguishedNameIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ LocalDistinguishedNameIe localDistinguishedName=
+ dynamic_cast<
+ LocalDistinguishedNameIe&>(GtpV2IeFactory::getInstance().getIeObject(LocalDistinguishedNameIeType));
+ rc = localDistinguishedName.encodeLocalDistinguishedNameIe(buffer, data.sgwLdn);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: sgwLdn\n");
+ return false;
+ }
+ }
+
+ if (data.pgwLdnIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = LocalDistinguishedNameIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ LocalDistinguishedNameIe localDistinguishedName=
+ dynamic_cast<
+ LocalDistinguishedNameIe&>(GtpV2IeFactory::getInstance().getIeObject(LocalDistinguishedNameIeType));
+ rc = localDistinguishedName.encodeLocalDistinguishedNameIe(buffer, data.pgwLdn);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: pgwLdn\n");
+ return false;
+ }
+ }
+
+ if (data.presenceReportingAreaActionIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = PresenceReportingAreaActionIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ PresenceReportingAreaActionIe presenceReportingAreaAction=
+ dynamic_cast<
+ PresenceReportingAreaActionIe&>(GtpV2IeFactory::getInstance().getIeObject(PresenceReportingAreaActionIeType));
+ rc = presenceReportingAreaAction.encodePresenceReportingAreaActionIe(buffer, data.presenceReportingAreaAction);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: presenceReportingAreaAction\n");
+ return false;
+ }
+ }
+
+ if (data.pgwsNodeLevelLoadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = LoadControlInformationIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ LoadControlInformationIe loadControlInformation=
+ dynamic_cast<
+ LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType));
+ PgwsNodeLevelLoadControlInformationInModifyBearerResponse groupedIeInstance =
+ dynamic_cast<
+ PgwsNodeLevelLoadControlInformationInModifyBearerResponse&>(loadControlInformation.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.encodePgwsNodeLevelLoadControlInformationInModifyBearerResponse(buffer, data.pgwsNodeLevelLoadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: pgwsNodeLevelLoadControlInformation\n");
+ return false;
+ }
+ }
+
+ if (data.pgwsApnLevelLoadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = LoadControlInformationIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ LoadControlInformationIe loadControlInformation=
+ dynamic_cast<
+ LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType));
+ PgwsApnLevelLoadControlInformationInModifyBearerResponse groupedIeInstance =
+ dynamic_cast<
+ PgwsApnLevelLoadControlInformationInModifyBearerResponse&>(loadControlInformation.getGroupedIe(msgType, 1));
+ rc = groupedIeInstance.encodePgwsApnLevelLoadControlInformationInModifyBearerResponse(buffer, data.pgwsApnLevelLoadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: pgwsApnLevelLoadControlInformation\n");
+ return false;
+ }
+ }
+
+ if (data.sgwsNodeLevelLoadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = LoadControlInformationIeType;
+ header.instance = 2;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ LoadControlInformationIe loadControlInformation=
+ dynamic_cast<
+ LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType));
+ SgwsNodeLevelLoadControlInformationInModifyBearerResponse groupedIeInstance =
+ dynamic_cast<
+ SgwsNodeLevelLoadControlInformationInModifyBearerResponse&>(loadControlInformation.getGroupedIe(msgType, 2));
+ rc = groupedIeInstance.encodeSgwsNodeLevelLoadControlInformationInModifyBearerResponse(buffer, data.sgwsNodeLevelLoadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: sgwsNodeLevelLoadControlInformation\n");
+ return false;
+ }
+ }
+
+ if (data.pgwsOverloadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = OverloadControlInformationIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ PgwsOverloadControlInformationInModifyBearerResponse groupedIeInstance =
+ dynamic_cast<
+ PgwsOverloadControlInformationInModifyBearerResponse&>(overloadControlInformation.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.encodePgwsOverloadControlInformationInModifyBearerResponse(buffer, data.pgwsOverloadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: pgwsOverloadControlInformation\n");
+ return false;
+ }
+ }
+
+ if (data.sgwsOverloadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = OverloadControlInformationIeType;
+ header.instance = 1;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ SgwsOverloadControlInformationInModifyBearerResponse groupedIeInstance =
+ dynamic_cast<
+ SgwsOverloadControlInformationInModifyBearerResponse&>(overloadControlInformation.getGroupedIe(msgType, 1));
+ rc = groupedIeInstance.encodeSgwsOverloadControlInformationInModifyBearerResponse(buffer, data.sgwsOverloadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: sgwsOverloadControlInformation\n");
+ return false;
+ }
+ }
+
+ if (data.pdnConnectionChargingIdIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = ChargingIdIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ ChargingIdIe chargingId=
+ dynamic_cast<
+ ChargingIdIe&>(GtpV2IeFactory::getInstance().getIeObject(ChargingIdIeType));
+ rc = chargingId.encodeChargingIdIe(buffer, data.pdnConnectionChargingId);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: pdnConnectionChargingId\n");
+ return false;
+ }
+ }
+
+ if (data.msisdnIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = MsisdnIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MsisdnIe msisdn=
+ dynamic_cast<
+ MsisdnIe&>(GtpV2IeFactory::getInstance().getIeObject(MsisdnIeType));
+ rc = msisdn.encodeMsisdnIe(buffer, data.msisdn);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: msisdn\n");
+ return false;
+ }
+ }
+ return rc;
+
+}
+
+bool ModifyBearerResponseMsg::decodeModifyBearerResponseMsg(MsgBuffer &buffer,
+ ModifyBearerResponseMsgData
+ &data, Uint16 length)
+{
+
+ bool rc = false;
+ GtpV2IeHeader ieHeader;
+
+ set<Uint16> mandatoryIeLocalList = mandatoryIeSet;
+ while (buffer.lengthLeft() > IE_HEADER_SIZE)
+ {
+ GtpV2Ie::decodeGtpV2IeHeader(buffer, ieHeader);
+ if (ieHeader.length > buffer.lengthLeft())
+ {
+ // We do not have enough bytes left in the message for this IE
+ errorStream.add((char *)"IE Length exceeds beyond message boundary\n");
+ errorStream.add((char *)" Offending IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.add((char *)"\n Ie Length in Header: ");
+ errorStream.add(ieHeader.length);
+ errorStream.add((char *)"\n Bytes left in message: ");
+ errorStream.add(buffer.lengthLeft());
+ errorStream.endOfLine();
+ return false;
+ }
+
+ switch (ieHeader.ieType){
+
+ case EbiIeType:
+ {
+ EbiIe ieObject =
+ dynamic_cast<
+ EbiIe&>(GtpV2IeFactory::getInstance().getIeObject(EbiIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeEbiIe(buffer, data.linkedEpsBearerId, ieHeader.length);
+
+ data.linkedEpsBearerIdIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: linkedEpsBearerId\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case BearerContextIeType:
+ {
+ BearerContextIe ieObject =
+ dynamic_cast<
+ BearerContextIe&>(GtpV2IeFactory::getInstance().getIeObject(BearerContextIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ // First check if we have enough space left to decode and store this instance
+ if (data.bearerContextsModifiedCount == 11)
+ {
+ errorStream.add((char *)"More than 11 instances of bearerContextsModified received\n");
+ return false;
+ }
+ BearerContextsModifiedInModifyBearerResponse groupedIeInstance =
+ dynamic_cast<
+ BearerContextsModifiedInModifyBearerResponse&>(ieObject.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.decodeBearerContextsModifiedInModifyBearerResponse(buffer,
+ data.bearerContextsModified[data.bearerContextsModifiedCount], ieHeader.length);
+ data.bearerContextsModifiedCount++; // TODO Count validation
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: bearerContextsModified\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ // First check if we have enough space left to decode and store this instance
+ if (data.bearerContextsMarkedForRemovalCount == 11)
+ {
+ errorStream.add((char *)"More than 11 instances of bearerContextsMarkedForRemoval received\n");
+ return false;
+ }
+ BearerContextsMarkedForRemovalInModifyBearerResponse groupedIeInstance =
+ dynamic_cast<
+ BearerContextsMarkedForRemovalInModifyBearerResponse&>(ieObject.getGroupedIe(msgType, 1));
+ rc = groupedIeInstance.decodeBearerContextsMarkedForRemovalInModifyBearerResponse(buffer,
+ data.bearerContextsMarkedForRemoval[data.bearerContextsMarkedForRemovalCount], ieHeader.length);
+ data.bearerContextsMarkedForRemovalCount++; // TODO Count validation
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: bearerContextsMarkedForRemoval\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case IndicationIeType:
+ {
+ IndicationIe ieObject =
+ dynamic_cast<
+ IndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(IndicationIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeIndicationIe(buffer, data.indicationFlags, ieHeader.length);
+
+ data.indicationFlagsIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: indicationFlags\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case CauseIeType:
+ {
+ CauseIe ieObject =
+ dynamic_cast<
+ CauseIe&>(GtpV2IeFactory::getInstance().getIeObject(CauseIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeCauseIe(buffer, data.cause, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: cause\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case ApnRestrictionIeType:
+ {
+ ApnRestrictionIe ieObject =
+ dynamic_cast<
+ ApnRestrictionIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnRestrictionIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeApnRestrictionIe(buffer, data.apnRestriction, ieHeader.length);
+
+ data.apnRestrictionIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: apnRestriction\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case PcoIeType:
+ {
+ PcoIe ieObject =
+ dynamic_cast<
+ PcoIe&>(GtpV2IeFactory::getInstance().getIeObject(PcoIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodePcoIe(buffer, data.protocolConfigurationOptions, ieHeader.length);
+
+ data.protocolConfigurationOptionsIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: protocolConfigurationOptions\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case ChangeReportingActionIeType:
+ {
+ ChangeReportingActionIe ieObject =
+ dynamic_cast<
+ ChangeReportingActionIe&>(GtpV2IeFactory::getInstance().getIeObject(ChangeReportingActionIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeChangeReportingActionIe(buffer, data.changeReportingAction, ieHeader.length);
+
+ data.changeReportingActionIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: changeReportingAction\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case CsgInformationReportingActionIeType:
+ {
+ CsgInformationReportingActionIe ieObject =
+ dynamic_cast<
+ CsgInformationReportingActionIe&>(GtpV2IeFactory::getInstance().getIeObject(CsgInformationReportingActionIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeCsgInformationReportingActionIe(buffer, data.csgInformationReportingAction, ieHeader.length);
+
+ data.csgInformationReportingActionIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: csgInformationReportingAction\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case HenbInformationReportingIeType:
+ {
+ HenbInformationReportingIe ieObject =
+ dynamic_cast<
+ HenbInformationReportingIe&>(GtpV2IeFactory::getInstance().getIeObject(HenbInformationReportingIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeHenbInformationReportingIe(buffer, data.hNbInformationReporting, ieHeader.length);
+
+ data.hNbInformationReportingIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: hNbInformationReporting\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case FqdnIeType:
+ {
+ FqdnIe ieObject =
+ dynamic_cast<
+ FqdnIe&>(GtpV2IeFactory::getInstance().getIeObject(FqdnIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeFqdnIe(buffer, data.chargingGatewayName, ieHeader.length);
+
+ data.chargingGatewayNameIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: chargingGatewayName\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case IpAddressIeType:
+ {
+ IpAddressIe ieObject =
+ dynamic_cast<
+ IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeIpAddressIe(buffer, data.chargingGatewayAddress, ieHeader.length);
+
+ data.chargingGatewayAddressIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: chargingGatewayAddress\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case FqCsidIeType:
+ {
+ FqCsidIe ieObject =
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeFqCsidIe(buffer, data.pgwFqCsid, ieHeader.length);
+
+ data.pgwFqCsidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: pgwFqCsid\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ rc = ieObject.decodeFqCsidIe(buffer, data.sgwFqCsid, ieHeader.length);
+
+ data.sgwFqCsidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: sgwFqCsid\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case RecoveryIeType:
+ {
+ RecoveryIe ieObject =
+ dynamic_cast<
+ RecoveryIe&>(GtpV2IeFactory::getInstance().getIeObject(RecoveryIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeRecoveryIe(buffer, data.recovery, ieHeader.length);
+
+ data.recoveryIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: recovery\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case LocalDistinguishedNameIeType:
+ {
+ LocalDistinguishedNameIe ieObject =
+ dynamic_cast<
+ LocalDistinguishedNameIe&>(GtpV2IeFactory::getInstance().getIeObject(LocalDistinguishedNameIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeLocalDistinguishedNameIe(buffer, data.sgwLdn, ieHeader.length);
+
+ data.sgwLdnIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: sgwLdn\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ rc = ieObject.decodeLocalDistinguishedNameIe(buffer, data.pgwLdn, ieHeader.length);
+
+ data.pgwLdnIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: pgwLdn\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case PresenceReportingAreaActionIeType:
+ {
+ PresenceReportingAreaActionIe ieObject =
+ dynamic_cast<
+ PresenceReportingAreaActionIe&>(GtpV2IeFactory::getInstance().getIeObject(PresenceReportingAreaActionIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodePresenceReportingAreaActionIe(buffer, data.presenceReportingAreaAction, ieHeader.length);
+
+ data.presenceReportingAreaActionIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: presenceReportingAreaAction\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case LoadControlInformationIeType:
+ {
+ LoadControlInformationIe ieObject =
+ dynamic_cast<
+ LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ PgwsNodeLevelLoadControlInformationInModifyBearerResponse groupedIeInstance =
+ dynamic_cast<
+ PgwsNodeLevelLoadControlInformationInModifyBearerResponse&>(ieObject.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.decodePgwsNodeLevelLoadControlInformationInModifyBearerResponse(buffer, data.pgwsNodeLevelLoadControlInformation, ieHeader.length);
+
+ data.pgwsNodeLevelLoadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: pgwsNodeLevelLoadControlInformation\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ PgwsApnLevelLoadControlInformationInModifyBearerResponse groupedIeInstance =
+ dynamic_cast<
+ PgwsApnLevelLoadControlInformationInModifyBearerResponse&>(ieObject.getGroupedIe(msgType, 1));
+ rc = groupedIeInstance.decodePgwsApnLevelLoadControlInformationInModifyBearerResponse(buffer, data.pgwsApnLevelLoadControlInformation, ieHeader.length);
+
+ data.pgwsApnLevelLoadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: pgwsApnLevelLoadControlInformation\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 2)
+ {
+ SgwsNodeLevelLoadControlInformationInModifyBearerResponse groupedIeInstance =
+ dynamic_cast<
+ SgwsNodeLevelLoadControlInformationInModifyBearerResponse&>(ieObject.getGroupedIe(msgType, 2));
+ rc = groupedIeInstance.decodeSgwsNodeLevelLoadControlInformationInModifyBearerResponse(buffer, data.sgwsNodeLevelLoadControlInformation, ieHeader.length);
+
+ data.sgwsNodeLevelLoadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: sgwsNodeLevelLoadControlInformation\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case OverloadControlInformationIeType:
+ {
+ OverloadControlInformationIe ieObject =
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ PgwsOverloadControlInformationInModifyBearerResponse groupedIeInstance =
+ dynamic_cast<
+ PgwsOverloadControlInformationInModifyBearerResponse&>(ieObject.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.decodePgwsOverloadControlInformationInModifyBearerResponse(buffer, data.pgwsOverloadControlInformation, ieHeader.length);
+
+ data.pgwsOverloadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: pgwsOverloadControlInformation\n");
+ return false;
+ }
+ }
+ else if(ieHeader.instance == 1)
+ {
+ SgwsOverloadControlInformationInModifyBearerResponse groupedIeInstance =
+ dynamic_cast<
+ SgwsOverloadControlInformationInModifyBearerResponse&>(ieObject.getGroupedIe(msgType, 1));
+ rc = groupedIeInstance.decodeSgwsOverloadControlInformationInModifyBearerResponse(buffer, data.sgwsOverloadControlInformation, ieHeader.length);
+
+ data.sgwsOverloadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: sgwsOverloadControlInformation\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case ChargingIdIeType:
+ {
+ ChargingIdIe ieObject =
+ dynamic_cast<
+ ChargingIdIe&>(GtpV2IeFactory::getInstance().getIeObject(ChargingIdIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeChargingIdIe(buffer, data.pdnConnectionChargingId, ieHeader.length);
+
+ data.pdnConnectionChargingIdIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: pdnConnectionChargingId\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case MsisdnIeType:
+ {
+ MsisdnIe ieObject =
+ dynamic_cast<
+ MsisdnIe&>(GtpV2IeFactory::getInstance().getIeObject(MsisdnIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeMsisdnIe(buffer, data.msisdn, ieHeader.length);
+
+ data.msisdnIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: msisdn\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ default:
+ {
+ // Unknown IE print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ }
+ }
+ return rc; // TODO validations
+}
+
+void ModifyBearerResponseMsg::
+displayModifyBearerResponseMsgData_v(ModifyBearerResponseMsgData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"ModifyBearerResponseMsg:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+ if (data.linkedEpsBearerIdIePresent)
+ {
+
+
+ stream.add((char *)"IE - linkedEpsBearerId:");
+ stream.endOfLine();
+ EbiIe ebi=
+ dynamic_cast<
+ EbiIe&>(GtpV2IeFactory::getInstance().getIeObject(EbiIeType));
+ ebi.displayEbiIe_v(data.linkedEpsBearerId, stream);
+
+ }
+
+ Uint8 displayCount;
+
+ displayCount = data.bearerContextsModifiedCount;
+ if (displayCount > 11)
+ {
+ stream.add((char *)"Invalid data more than 11 instances");
+ stream.endOfLine();
+ stream.add((char *)"Displaying only 11");
+ stream.endOfLine();
+ displayCount = 11;
+ }
+ for (Uint8 i = 0; i < displayCount; i++)
+ {
+ stream.add((char *)"IE - bearerContextsModified:");
+ stream.endOfLine();
+ BearerContextIe bearerContext=
+ dynamic_cast<
+ BearerContextIe&>(GtpV2IeFactory::getInstance().getIeObject(BearerContextIeType));
+ BearerContextsModifiedInModifyBearerResponse groupedIeInstance =
+ dynamic_cast<
+ BearerContextsModifiedInModifyBearerResponse&>(bearerContext.getGroupedIe(msgType, 0));
+ groupedIeInstance.displayBearerContextsModifiedInModifyBearerResponseData_v(data.bearerContextsModified[i], stream);
+ }
+
+
+
+
+ displayCount = data.bearerContextsMarkedForRemovalCount;
+ if (displayCount > 11)
+ {
+ stream.add((char *)"Invalid data more than 11 instances");
+ stream.endOfLine();
+ stream.add((char *)"Displaying only 11");
+ stream.endOfLine();
+ displayCount = 11;
+ }
+ for (Uint8 i = 0; i < displayCount; i++)
+ {
+ stream.add((char *)"IE - bearerContextsMarkedForRemoval:");
+ stream.endOfLine();
+ BearerContextIe bearerContext=
+ dynamic_cast<
+ BearerContextIe&>(GtpV2IeFactory::getInstance().getIeObject(BearerContextIeType));
+ BearerContextsMarkedForRemovalInModifyBearerResponse groupedIeInstance =
+ dynamic_cast<
+ BearerContextsMarkedForRemovalInModifyBearerResponse&>(bearerContext.getGroupedIe(msgType, 1));
+ groupedIeInstance.displayBearerContextsMarkedForRemovalInModifyBearerResponseData_v(data.bearerContextsMarkedForRemoval[i], stream);
+ }
+
+
+
+
+ if (data.indicationFlagsIePresent)
+ {
+
+
+ stream.add((char *)"IE - indicationFlags:");
+ stream.endOfLine();
+ IndicationIe indication=
+ dynamic_cast<
+ IndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(IndicationIeType));
+ indication.displayIndicationIe_v(data.indicationFlags, stream);
+
+ }
+ stream.add((char *)"IE - cause:");
+ stream.endOfLine();
+ CauseIe cause=
+ dynamic_cast<
+ CauseIe&>(GtpV2IeFactory::getInstance().getIeObject(CauseIeType));
+ cause.displayCauseIe_v(data.cause, stream);
+
+ if (data.apnRestrictionIePresent)
+ {
+
+
+ stream.add((char *)"IE - apnRestriction:");
+ stream.endOfLine();
+ ApnRestrictionIe apnRestriction=
+ dynamic_cast<
+ ApnRestrictionIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnRestrictionIeType));
+ apnRestriction.displayApnRestrictionIe_v(data.apnRestriction, stream);
+
+ }
+ if (data.protocolConfigurationOptionsIePresent)
+ {
+
+
+ stream.add((char *)"IE - protocolConfigurationOptions:");
+ stream.endOfLine();
+ PcoIe pco=
+ dynamic_cast<
+ PcoIe&>(GtpV2IeFactory::getInstance().getIeObject(PcoIeType));
+ pco.displayPcoIe_v(data.protocolConfigurationOptions, stream);
+
+ }
+ if (data.changeReportingActionIePresent)
+ {
+
+
+ stream.add((char *)"IE - changeReportingAction:");
+ stream.endOfLine();
+ ChangeReportingActionIe changeReportingAction=
+ dynamic_cast<
+ ChangeReportingActionIe&>(GtpV2IeFactory::getInstance().getIeObject(ChangeReportingActionIeType));
+ changeReportingAction.displayChangeReportingActionIe_v(data.changeReportingAction, stream);
+
+ }
+ if (data.csgInformationReportingActionIePresent)
+ {
+
+
+ stream.add((char *)"IE - csgInformationReportingAction:");
+ stream.endOfLine();
+ CsgInformationReportingActionIe csgInformationReportingAction=
+ dynamic_cast<
+ CsgInformationReportingActionIe&>(GtpV2IeFactory::getInstance().getIeObject(CsgInformationReportingActionIeType));
+ csgInformationReportingAction.displayCsgInformationReportingActionIe_v(data.csgInformationReportingAction, stream);
+
+ }
+ if (data.hNbInformationReportingIePresent)
+ {
+
+
+ stream.add((char *)"IE - hNbInformationReporting:");
+ stream.endOfLine();
+ HenbInformationReportingIe henbInformationReporting=
+ dynamic_cast<
+ HenbInformationReportingIe&>(GtpV2IeFactory::getInstance().getIeObject(HenbInformationReportingIeType));
+ henbInformationReporting.displayHenbInformationReportingIe_v(data.hNbInformationReporting, stream);
+
+ }
+ if (data.chargingGatewayNameIePresent)
+ {
+
+
+ stream.add((char *)"IE - chargingGatewayName:");
+ stream.endOfLine();
+ FqdnIe fqdn=
+ dynamic_cast<
+ FqdnIe&>(GtpV2IeFactory::getInstance().getIeObject(FqdnIeType));
+ fqdn.displayFqdnIe_v(data.chargingGatewayName, stream);
+
+ }
+ if (data.chargingGatewayAddressIePresent)
+ {
+
+
+ stream.add((char *)"IE - chargingGatewayAddress:");
+ stream.endOfLine();
+ IpAddressIe ipAddress=
+ dynamic_cast<
+ IpAddressIe&>(GtpV2IeFactory::getInstance().getIeObject(IpAddressIeType));
+ ipAddress.displayIpAddressIe_v(data.chargingGatewayAddress, stream);
+
+ }
+ if (data.pgwFqCsidIePresent)
+ {
+
+
+ stream.add((char *)"IE - pgwFqCsid:");
+ stream.endOfLine();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ fqCsid.displayFqCsidIe_v(data.pgwFqCsid, stream);
+
+ }
+ if (data.sgwFqCsidIePresent)
+ {
+
+
+ stream.add((char *)"IE - sgwFqCsid:");
+ stream.endOfLine();
+ FqCsidIe fqCsid=
+ dynamic_cast<
+ FqCsidIe&>(GtpV2IeFactory::getInstance().getIeObject(FqCsidIeType));
+ fqCsid.displayFqCsidIe_v(data.sgwFqCsid, stream);
+
+ }
+ if (data.recoveryIePresent)
+ {
+
+
+ stream.add((char *)"IE - recovery:");
+ stream.endOfLine();
+ RecoveryIe recovery=
+ dynamic_cast<
+ RecoveryIe&>(GtpV2IeFactory::getInstance().getIeObject(RecoveryIeType));
+ recovery.displayRecoveryIe_v(data.recovery, stream);
+
+ }
+ if (data.sgwLdnIePresent)
+ {
+
+
+ stream.add((char *)"IE - sgwLdn:");
+ stream.endOfLine();
+ LocalDistinguishedNameIe localDistinguishedName=
+ dynamic_cast<
+ LocalDistinguishedNameIe&>(GtpV2IeFactory::getInstance().getIeObject(LocalDistinguishedNameIeType));
+ localDistinguishedName.displayLocalDistinguishedNameIe_v(data.sgwLdn, stream);
+
+ }
+ if (data.pgwLdnIePresent)
+ {
+
+
+ stream.add((char *)"IE - pgwLdn:");
+ stream.endOfLine();
+ LocalDistinguishedNameIe localDistinguishedName=
+ dynamic_cast<
+ LocalDistinguishedNameIe&>(GtpV2IeFactory::getInstance().getIeObject(LocalDistinguishedNameIeType));
+ localDistinguishedName.displayLocalDistinguishedNameIe_v(data.pgwLdn, stream);
+
+ }
+ if (data.presenceReportingAreaActionIePresent)
+ {
+
+
+ stream.add((char *)"IE - presenceReportingAreaAction:");
+ stream.endOfLine();
+ PresenceReportingAreaActionIe presenceReportingAreaAction=
+ dynamic_cast<
+ PresenceReportingAreaActionIe&>(GtpV2IeFactory::getInstance().getIeObject(PresenceReportingAreaActionIeType));
+ presenceReportingAreaAction.displayPresenceReportingAreaActionIe_v(data.presenceReportingAreaAction, stream);
+
+ }
+ if (data.pgwsNodeLevelLoadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - pgwsNodeLevelLoadControlInformation:");
+ stream.endOfLine();
+ LoadControlInformationIe loadControlInformation=
+ dynamic_cast<
+ LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType));
+ PgwsNodeLevelLoadControlInformationInModifyBearerResponse groupedIeInstance =
+ dynamic_cast<
+ PgwsNodeLevelLoadControlInformationInModifyBearerResponse&>(loadControlInformation.getGroupedIe(msgType, 0));
+ groupedIeInstance.displayPgwsNodeLevelLoadControlInformationInModifyBearerResponseData_v(data.pgwsNodeLevelLoadControlInformation, stream);
+
+ }
+ if (data.pgwsApnLevelLoadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - pgwsApnLevelLoadControlInformation:");
+ stream.endOfLine();
+ LoadControlInformationIe loadControlInformation=
+ dynamic_cast<
+ LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType));
+ PgwsApnLevelLoadControlInformationInModifyBearerResponse groupedIeInstance =
+ dynamic_cast<
+ PgwsApnLevelLoadControlInformationInModifyBearerResponse&>(loadControlInformation.getGroupedIe(msgType, 1));
+ groupedIeInstance.displayPgwsApnLevelLoadControlInformationInModifyBearerResponseData_v(data.pgwsApnLevelLoadControlInformation, stream);
+
+ }
+ if (data.sgwsNodeLevelLoadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - sgwsNodeLevelLoadControlInformation:");
+ stream.endOfLine();
+ LoadControlInformationIe loadControlInformation=
+ dynamic_cast<
+ LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType));
+ SgwsNodeLevelLoadControlInformationInModifyBearerResponse groupedIeInstance =
+ dynamic_cast<
+ SgwsNodeLevelLoadControlInformationInModifyBearerResponse&>(loadControlInformation.getGroupedIe(msgType, 2));
+ groupedIeInstance.displaySgwsNodeLevelLoadControlInformationInModifyBearerResponseData_v(data.sgwsNodeLevelLoadControlInformation, stream);
+
+ }
+ if (data.pgwsOverloadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - pgwsOverloadControlInformation:");
+ stream.endOfLine();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ PgwsOverloadControlInformationInModifyBearerResponse groupedIeInstance =
+ dynamic_cast<
+ PgwsOverloadControlInformationInModifyBearerResponse&>(overloadControlInformation.getGroupedIe(msgType, 0));
+ groupedIeInstance.displayPgwsOverloadControlInformationInModifyBearerResponseData_v(data.pgwsOverloadControlInformation, stream);
+
+ }
+ if (data.sgwsOverloadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - sgwsOverloadControlInformation:");
+ stream.endOfLine();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ SgwsOverloadControlInformationInModifyBearerResponse groupedIeInstance =
+ dynamic_cast<
+ SgwsOverloadControlInformationInModifyBearerResponse&>(overloadControlInformation.getGroupedIe(msgType, 1));
+ groupedIeInstance.displaySgwsOverloadControlInformationInModifyBearerResponseData_v(data.sgwsOverloadControlInformation, stream);
+
+ }
+ if (data.pdnConnectionChargingIdIePresent)
+ {
+
+
+ stream.add((char *)"IE - pdnConnectionChargingId:");
+ stream.endOfLine();
+ ChargingIdIe chargingId=
+ dynamic_cast<
+ ChargingIdIe&>(GtpV2IeFactory::getInstance().getIeObject(ChargingIdIeType));
+ chargingId.displayChargingIdIe_v(data.pdnConnectionChargingId, stream);
+
+ }
+ if (data.msisdnIePresent)
+ {
+
+
+ stream.add((char *)"IE - msisdn:");
+ stream.endOfLine();
+ MsisdnIe msisdn=
+ dynamic_cast<
+ MsisdnIe&>(GtpV2IeFactory::getInstance().getIeObject(MsisdnIeType));
+ msisdn.displayMsisdnIe_v(data.msisdn, stream);
+
+ }
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
diff --git a/src/gtpV2Codec/msgClasses/modifyBearerResponseMsg.h b/src/gtpV2Codec/msgClasses/modifyBearerResponseMsg.h
new file mode 100644
index 0000000..2de8376
--- /dev/null
+++ b/src/gtpV2Codec/msgClasses/modifyBearerResponseMsg.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2019-present, Infosys Limited.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ /******************************************************************************
+ *
+ * This is an auto generated file.
+ * Please do not edit this file.
+ * All edits to be made through template source file
+ * <TOP-DIR/scripts/GtpV2StackCodeGen/tts/msgtemplate.h.tt>
+ ******************************************************************************/
+#ifndef MODIFYBEARERRESPONSEMSG_H_
+#define MODIFYBEARERRESPONSEMSG_H_
+
+#include <set>
+#include "manual/gtpV2Message.h"
+#include <msgBuffer.h>
+#include <debug.h>
+#include "gtpV2MsgDataTypes.h"
+
+
+class ModifyBearerResponseMsg:public GtpV2Message
+{
+public:
+ ModifyBearerResponseMsg();
+ virtual ~ModifyBearerResponseMsg();
+ bool encodeModifyBearerResponseMsg(MsgBuffer &buffer, ModifyBearerResponseMsgData const &data);
+
+ bool decodeModifyBearerResponseMsg (MsgBuffer &buffer, ModifyBearerResponseMsgData& data, Uint16 length);
+
+ void displayModifyBearerResponseMsgData_v(ModifyBearerResponseMsgData const &data, Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/msgClasses/releaseAccessBearersRequestMsg.cpp b/src/gtpV2Codec/msgClasses/releaseAccessBearersRequestMsg.cpp
new file mode 100644
index 0000000..9188f75
--- /dev/null
+++ b/src/gtpV2Codec/msgClasses/releaseAccessBearersRequestMsg.cpp
@@ -0,0 +1,378 @@
+/*
+ * Copyright 2019-present Infosys Limited
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+/******************************************************************************
+ *
+ * This is an auto generated file.
+ * Please do not edit this file.
+ * All edits to be made through template source file
+ * <TOP-DIR/scripts/GtpV2StackCodeGen/tts/msgtemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "releaseAccessBearersRequestMsg.h"
+#include "../ieClasses/manual/gtpV2Ie.h"
+#include "../ieClasses/gtpV2IeFactory.h"
+#include "../ieClasses/ebiIe.h"
+#include "../ieClasses/nodeTypeIe.h"
+#include "../ieClasses/indicationIe.h"
+#include "../ieClasses/secondaryRatUsageDataReportIe.h"
+
+ReleaseAccessBearersRequestMsg::ReleaseAccessBearersRequestMsg()
+{
+ msgType = ReleaseAccessBearersRequestMsgType;
+
+}
+
+ReleaseAccessBearersRequestMsg::~ReleaseAccessBearersRequestMsg()
+{
+
+}
+
+bool ReleaseAccessBearersRequestMsg::encodeReleaseAccessBearersRequestMsg(MsgBuffer &buffer,
+ ReleaseAccessBearersRequestMsgData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+ if (data.listOfRabsIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = EbiIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ EbiIe ebi=
+ dynamic_cast<
+ EbiIe&>(GtpV2IeFactory::getInstance().getIeObject(EbiIeType));
+ rc = ebi.encodeEbiIe(buffer, data.listOfRabs);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: listOfRabs\n");
+ return false;
+ }
+ }
+
+ if (data.originatingNodeIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = NodeTypeIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ NodeTypeIe nodeType=
+ dynamic_cast<
+ NodeTypeIe&>(GtpV2IeFactory::getInstance().getIeObject(NodeTypeIeType));
+ rc = nodeType.encodeNodeTypeIe(buffer, data.originatingNode);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: originatingNode\n");
+ return false;
+ }
+ }
+
+ if (data.indicationFlagsIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = IndicationIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ IndicationIe indication=
+ dynamic_cast<
+ IndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(IndicationIeType));
+ rc = indication.encodeIndicationIe(buffer, data.indicationFlags);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: indicationFlags\n");
+ return false;
+ }
+ }
+
+ if (data.secondaryRatUsageDataReportIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = SecondaryRatUsageDataReportIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SecondaryRatUsageDataReportIe secondaryRatUsageDataReport=
+ dynamic_cast<
+ SecondaryRatUsageDataReportIe&>(GtpV2IeFactory::getInstance().getIeObject(SecondaryRatUsageDataReportIeType));
+ rc = secondaryRatUsageDataReport.encodeSecondaryRatUsageDataReportIe(buffer, data.secondaryRatUsageDataReport);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: secondaryRatUsageDataReport\n");
+ return false;
+ }
+ }
+ return rc;
+
+}
+
+bool ReleaseAccessBearersRequestMsg::decodeReleaseAccessBearersRequestMsg(MsgBuffer &buffer,
+ ReleaseAccessBearersRequestMsgData
+ &data, Uint16 length)
+{
+
+ bool rc = false;
+ GtpV2IeHeader ieHeader;
+
+ set<Uint16> mandatoryIeLocalList = mandatoryIeSet;
+ while (buffer.lengthLeft() > IE_HEADER_SIZE)
+ {
+ GtpV2Ie::decodeGtpV2IeHeader(buffer, ieHeader);
+ if (ieHeader.length > buffer.lengthLeft())
+ {
+ // We do not have enough bytes left in the message for this IE
+ errorStream.add((char *)"IE Length exceeds beyond message boundary\n");
+ errorStream.add((char *)" Offending IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.add((char *)"\n Ie Length in Header: ");
+ errorStream.add(ieHeader.length);
+ errorStream.add((char *)"\n Bytes left in message: ");
+ errorStream.add(buffer.lengthLeft());
+ errorStream.endOfLine();
+ return false;
+ }
+
+ switch (ieHeader.ieType){
+
+ case EbiIeType:
+ {
+ EbiIe ieObject =
+ dynamic_cast<
+ EbiIe&>(GtpV2IeFactory::getInstance().getIeObject(EbiIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeEbiIe(buffer, data.listOfRabs, ieHeader.length);
+
+ data.listOfRabsIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: listOfRabs\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case NodeTypeIeType:
+ {
+ NodeTypeIe ieObject =
+ dynamic_cast<
+ NodeTypeIe&>(GtpV2IeFactory::getInstance().getIeObject(NodeTypeIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeNodeTypeIe(buffer, data.originatingNode, ieHeader.length);
+
+ data.originatingNodeIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: originatingNode\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case IndicationIeType:
+ {
+ IndicationIe ieObject =
+ dynamic_cast<
+ IndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(IndicationIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeIndicationIe(buffer, data.indicationFlags, ieHeader.length);
+
+ data.indicationFlagsIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: indicationFlags\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case SecondaryRatUsageDataReportIeType:
+ {
+ SecondaryRatUsageDataReportIe ieObject =
+ dynamic_cast<
+ SecondaryRatUsageDataReportIe&>(GtpV2IeFactory::getInstance().getIeObject(SecondaryRatUsageDataReportIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeSecondaryRatUsageDataReportIe(buffer, data.secondaryRatUsageDataReport, ieHeader.length);
+
+ data.secondaryRatUsageDataReportIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: secondaryRatUsageDataReport\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ default:
+ {
+ // Unknown IE print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ }
+ }
+ return rc; // TODO validations
+}
+
+void ReleaseAccessBearersRequestMsg::
+displayReleaseAccessBearersRequestMsgData_v(ReleaseAccessBearersRequestMsgData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"ReleaseAccessBearersRequestMsg:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+ if (data.listOfRabsIePresent)
+ {
+
+
+ stream.add((char *)"IE - listOfRabs:");
+ stream.endOfLine();
+ EbiIe ebi=
+ dynamic_cast<
+ EbiIe&>(GtpV2IeFactory::getInstance().getIeObject(EbiIeType));
+ ebi.displayEbiIe_v(data.listOfRabs, stream);
+
+ }
+ if (data.originatingNodeIePresent)
+ {
+
+
+ stream.add((char *)"IE - originatingNode:");
+ stream.endOfLine();
+ NodeTypeIe nodeType=
+ dynamic_cast<
+ NodeTypeIe&>(GtpV2IeFactory::getInstance().getIeObject(NodeTypeIeType));
+ nodeType.displayNodeTypeIe_v(data.originatingNode, stream);
+
+ }
+ if (data.indicationFlagsIePresent)
+ {
+
+
+ stream.add((char *)"IE - indicationFlags:");
+ stream.endOfLine();
+ IndicationIe indication=
+ dynamic_cast<
+ IndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(IndicationIeType));
+ indication.displayIndicationIe_v(data.indicationFlags, stream);
+
+ }
+ if (data.secondaryRatUsageDataReportIePresent)
+ {
+
+
+ stream.add((char *)"IE - secondaryRatUsageDataReport:");
+ stream.endOfLine();
+ SecondaryRatUsageDataReportIe secondaryRatUsageDataReport=
+ dynamic_cast<
+ SecondaryRatUsageDataReportIe&>(GtpV2IeFactory::getInstance().getIeObject(SecondaryRatUsageDataReportIeType));
+ secondaryRatUsageDataReport.displaySecondaryRatUsageDataReportIe_v(data.secondaryRatUsageDataReport, stream);
+
+ }
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
diff --git a/src/gtpV2Codec/msgClasses/releaseAccessBearersRequestMsg.h b/src/gtpV2Codec/msgClasses/releaseAccessBearersRequestMsg.h
new file mode 100644
index 0000000..8c58ffa
--- /dev/null
+++ b/src/gtpV2Codec/msgClasses/releaseAccessBearersRequestMsg.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2019-present, Infosys Limited.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ /******************************************************************************
+ *
+ * This is an auto generated file.
+ * Please do not edit this file.
+ * All edits to be made through template source file
+ * <TOP-DIR/scripts/GtpV2StackCodeGen/tts/msgtemplate.h.tt>
+ ******************************************************************************/
+#ifndef RELEASEACCESSBEARERSREQUESTMSG_H_
+#define RELEASEACCESSBEARERSREQUESTMSG_H_
+
+#include <set>
+#include "manual/gtpV2Message.h"
+#include <msgBuffer.h>
+#include <debug.h>
+#include "gtpV2MsgDataTypes.h"
+
+
+class ReleaseAccessBearersRequestMsg:public GtpV2Message
+{
+public:
+ ReleaseAccessBearersRequestMsg();
+ virtual ~ReleaseAccessBearersRequestMsg();
+ bool encodeReleaseAccessBearersRequestMsg(MsgBuffer &buffer, ReleaseAccessBearersRequestMsgData const &data);
+
+ bool decodeReleaseAccessBearersRequestMsg (MsgBuffer &buffer, ReleaseAccessBearersRequestMsgData& data, Uint16 length);
+
+ void displayReleaseAccessBearersRequestMsgData_v(ReleaseAccessBearersRequestMsgData const &data, Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/msgClasses/releaseAccessBearersResponseMsg.cpp b/src/gtpV2Codec/msgClasses/releaseAccessBearersResponseMsg.cpp
new file mode 100644
index 0000000..8b9f4a9
--- /dev/null
+++ b/src/gtpV2Codec/msgClasses/releaseAccessBearersResponseMsg.cpp
@@ -0,0 +1,462 @@
+/*
+ * Copyright 2019-present Infosys Limited
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+/******************************************************************************
+ *
+ * This is an auto generated file.
+ * Please do not edit this file.
+ * All edits to be made through template source file
+ * <TOP-DIR/scripts/GtpV2StackCodeGen/tts/msgtemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "releaseAccessBearersResponseMsg.h"
+#include "../ieClasses/manual/gtpV2Ie.h"
+#include "../ieClasses/gtpV2IeFactory.h"
+#include "../ieClasses/causeIe.h"
+#include "../ieClasses/recoveryIe.h"
+#include "../ieClasses/indicationIe.h"
+#include "../ieClasses/loadControlInformationIe.h"
+#include "../ieClasses/sgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponse.h"
+#include "../ieClasses/overloadControlInformationIe.h"
+#include "../ieClasses/sgwsOverloadControlInformationInReleaseAccessBearersResponse.h"
+
+ReleaseAccessBearersResponseMsg::ReleaseAccessBearersResponseMsg()
+{
+ msgType = ReleaseAccessBearersResponseMsgType;
+ Uint16 mandIe;
+ mandIe = CauseIeType;
+ mandIe = (mandIe << 8) | 0; // cause
+ mandatoryIeSet.insert(mandIe);
+}
+
+ReleaseAccessBearersResponseMsg::~ReleaseAccessBearersResponseMsg()
+{
+
+}
+
+bool ReleaseAccessBearersResponseMsg::encodeReleaseAccessBearersResponseMsg(MsgBuffer &buffer,
+ ReleaseAccessBearersResponseMsgData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+ // Encode the Ie Header
+ header.ieType = CauseIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ CauseIe cause=
+ dynamic_cast<
+ CauseIe&>(GtpV2IeFactory::getInstance().getIeObject(CauseIeType));
+ rc = cause.encodeCauseIe(buffer, data.cause);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: cause\n");
+ return false;
+ }
+
+ if (data.recoveryIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = RecoveryIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ RecoveryIe recovery=
+ dynamic_cast<
+ RecoveryIe&>(GtpV2IeFactory::getInstance().getIeObject(RecoveryIeType));
+ rc = recovery.encodeRecoveryIe(buffer, data.recovery);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: recovery\n");
+ return false;
+ }
+ }
+
+ if (data.indicationFlagsIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = IndicationIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ IndicationIe indication=
+ dynamic_cast<
+ IndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(IndicationIeType));
+ rc = indication.encodeIndicationIe(buffer, data.indicationFlags);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: indicationFlags\n");
+ return false;
+ }
+ }
+
+ if (data.sgwsNodeLevelLoadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = LoadControlInformationIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ LoadControlInformationIe loadControlInformation=
+ dynamic_cast<
+ LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType));
+ SgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponse groupedIeInstance =
+ dynamic_cast<
+ SgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponse&>(loadControlInformation.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.encodeSgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponse(buffer, data.sgwsNodeLevelLoadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: sgwsNodeLevelLoadControlInformation\n");
+ return false;
+ }
+ }
+
+ if (data.sgwsOverloadControlInformationIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = OverloadControlInformationIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ SgwsOverloadControlInformationInReleaseAccessBearersResponse groupedIeInstance =
+ dynamic_cast<
+ SgwsOverloadControlInformationInReleaseAccessBearersResponse&>(overloadControlInformation.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.encodeSgwsOverloadControlInformationInReleaseAccessBearersResponse(buffer, data.sgwsOverloadControlInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: sgwsOverloadControlInformation\n");
+ return false;
+ }
+ }
+ return rc;
+
+}
+
+bool ReleaseAccessBearersResponseMsg::decodeReleaseAccessBearersResponseMsg(MsgBuffer &buffer,
+ ReleaseAccessBearersResponseMsgData
+ &data, Uint16 length)
+{
+
+ bool rc = false;
+ GtpV2IeHeader ieHeader;
+
+ set<Uint16> mandatoryIeLocalList = mandatoryIeSet;
+ while (buffer.lengthLeft() > IE_HEADER_SIZE)
+ {
+ GtpV2Ie::decodeGtpV2IeHeader(buffer, ieHeader);
+ if (ieHeader.length > buffer.lengthLeft())
+ {
+ // We do not have enough bytes left in the message for this IE
+ errorStream.add((char *)"IE Length exceeds beyond message boundary\n");
+ errorStream.add((char *)" Offending IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.add((char *)"\n Ie Length in Header: ");
+ errorStream.add(ieHeader.length);
+ errorStream.add((char *)"\n Bytes left in message: ");
+ errorStream.add(buffer.lengthLeft());
+ errorStream.endOfLine();
+ return false;
+ }
+
+ switch (ieHeader.ieType){
+
+ case CauseIeType:
+ {
+ CauseIe ieObject =
+ dynamic_cast<
+ CauseIe&>(GtpV2IeFactory::getInstance().getIeObject(CauseIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeCauseIe(buffer, data.cause, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: cause\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case RecoveryIeType:
+ {
+ RecoveryIe ieObject =
+ dynamic_cast<
+ RecoveryIe&>(GtpV2IeFactory::getInstance().getIeObject(RecoveryIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeRecoveryIe(buffer, data.recovery, ieHeader.length);
+
+ data.recoveryIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: recovery\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case IndicationIeType:
+ {
+ IndicationIe ieObject =
+ dynamic_cast<
+ IndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(IndicationIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ rc = ieObject.decodeIndicationIe(buffer, data.indicationFlags, ieHeader.length);
+
+ data.indicationFlagsIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: indicationFlags\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case LoadControlInformationIeType:
+ {
+ LoadControlInformationIe ieObject =
+ dynamic_cast<
+ LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ SgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponse groupedIeInstance =
+ dynamic_cast<
+ SgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponse&>(ieObject.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.decodeSgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponse(buffer, data.sgwsNodeLevelLoadControlInformation, ieHeader.length);
+
+ data.sgwsNodeLevelLoadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: sgwsNodeLevelLoadControlInformation\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ case OverloadControlInformationIeType:
+ {
+ OverloadControlInformationIe ieObject =
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+
+ if(ieHeader.instance == 0)
+ {
+ SgwsOverloadControlInformationInReleaseAccessBearersResponse groupedIeInstance =
+ dynamic_cast<
+ SgwsOverloadControlInformationInReleaseAccessBearersResponse&>(ieObject.getGroupedIe(msgType, 0));
+ rc = groupedIeInstance.decodeSgwsOverloadControlInformationInReleaseAccessBearersResponse(buffer, data.sgwsOverloadControlInformation, ieHeader.length);
+
+ data.sgwsOverloadControlInformationIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: sgwsOverloadControlInformation\n");
+ return false;
+ }
+ }
+
+ else
+ {
+ // Unknown IE instance print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+
+ default:
+ {
+ // Unknown IE print error
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ }
+ }
+ return rc; // TODO validations
+}
+
+void ReleaseAccessBearersResponseMsg::
+displayReleaseAccessBearersResponseMsgData_v(ReleaseAccessBearersResponseMsgData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"ReleaseAccessBearersResponseMsg:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+ stream.add((char *)"IE - cause:");
+ stream.endOfLine();
+ CauseIe cause=
+ dynamic_cast<
+ CauseIe&>(GtpV2IeFactory::getInstance().getIeObject(CauseIeType));
+ cause.displayCauseIe_v(data.cause, stream);
+
+ if (data.recoveryIePresent)
+ {
+
+
+ stream.add((char *)"IE - recovery:");
+ stream.endOfLine();
+ RecoveryIe recovery=
+ dynamic_cast<
+ RecoveryIe&>(GtpV2IeFactory::getInstance().getIeObject(RecoveryIeType));
+ recovery.displayRecoveryIe_v(data.recovery, stream);
+
+ }
+ if (data.indicationFlagsIePresent)
+ {
+
+
+ stream.add((char *)"IE - indicationFlags:");
+ stream.endOfLine();
+ IndicationIe indication=
+ dynamic_cast<
+ IndicationIe&>(GtpV2IeFactory::getInstance().getIeObject(IndicationIeType));
+ indication.displayIndicationIe_v(data.indicationFlags, stream);
+
+ }
+ if (data.sgwsNodeLevelLoadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - sgwsNodeLevelLoadControlInformation:");
+ stream.endOfLine();
+ LoadControlInformationIe loadControlInformation=
+ dynamic_cast<
+ LoadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(LoadControlInformationIeType));
+ SgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponse groupedIeInstance =
+ dynamic_cast<
+ SgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponse&>(loadControlInformation.getGroupedIe(msgType, 0));
+ groupedIeInstance.displaySgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponseData_v(data.sgwsNodeLevelLoadControlInformation, stream);
+
+ }
+ if (data.sgwsOverloadControlInformationIePresent)
+ {
+
+
+ stream.add((char *)"IE - sgwsOverloadControlInformation:");
+ stream.endOfLine();
+ OverloadControlInformationIe overloadControlInformation=
+ dynamic_cast<
+ OverloadControlInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(OverloadControlInformationIeType));
+ SgwsOverloadControlInformationInReleaseAccessBearersResponse groupedIeInstance =
+ dynamic_cast<
+ SgwsOverloadControlInformationInReleaseAccessBearersResponse&>(overloadControlInformation.getGroupedIe(msgType, 0));
+ groupedIeInstance.displaySgwsOverloadControlInformationInReleaseAccessBearersResponseData_v(data.sgwsOverloadControlInformation, stream);
+
+ }
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
diff --git a/src/gtpV2Codec/msgClasses/releaseAccessBearersResponseMsg.h b/src/gtpV2Codec/msgClasses/releaseAccessBearersResponseMsg.h
new file mode 100644
index 0000000..13f30b5
--- /dev/null
+++ b/src/gtpV2Codec/msgClasses/releaseAccessBearersResponseMsg.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2019-present, Infosys Limited.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ /******************************************************************************
+ *
+ * This is an auto generated file.
+ * Please do not edit this file.
+ * All edits to be made through template source file
+ * <TOP-DIR/scripts/GtpV2StackCodeGen/tts/msgtemplate.h.tt>
+ ******************************************************************************/
+#ifndef RELEASEACCESSBEARERSRESPONSEMSG_H_
+#define RELEASEACCESSBEARERSRESPONSEMSG_H_
+
+#include <set>
+#include "manual/gtpV2Message.h"
+#include <msgBuffer.h>
+#include <debug.h>
+#include "gtpV2MsgDataTypes.h"
+
+
+class ReleaseAccessBearersResponseMsg:public GtpV2Message
+{
+public:
+ ReleaseAccessBearersResponseMsg();
+ virtual ~ReleaseAccessBearersResponseMsg();
+ bool encodeReleaseAccessBearersResponseMsg(MsgBuffer &buffer, ReleaseAccessBearersResponseMsgData const &data);
+
+ bool decodeReleaseAccessBearersResponseMsg (MsgBuffer &buffer, ReleaseAccessBearersResponseMsgData& data, Uint16 length);
+
+ void displayReleaseAccessBearersResponseMsgData_v(ReleaseAccessBearersResponseMsgData const &data, Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file