MME2 changes - Propped commits from openmme/paging branch. Added scripts
for code gen
Change-Id: Ie55032217232214ac8544ca76ea34335205329e4
diff --git a/src/gtpV2Codec/Makefile b/src/gtpV2Codec/Makefile
new file mode 100644
index 0000000..0247d73
--- /dev/null
+++ b/src/gtpV2Codec/Makefile
@@ -0,0 +1,197 @@
+#
+# 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.
+
+include ../../Makefile.common
+
+gtpV2CodecOBJDIR := $(OBJDIR)/gtpV2Codec/
+
+gtpV2CodecLIB := $(LIBDIR)/libgtpV2Codec.so
+
+gtpV2CodecOBJS := $(addprefix $(gtpV2CodecOBJDIR), \
+ ieClasses/imsiIe.o \
+ ieClasses/gtpV2IeFactory.o \
+ ieClasses/dataTypeCodecUtils.o \
+ ieClasses/manual/gtpV2Ie.o \
+ ieClasses/causeIe.o \
+ ieClasses/msisdnIe.o \
+ ieClasses/meiIe.o \
+ ieClasses/uliIe.o \
+ ieClasses/servingNetworkIe.o \
+ ieClasses/ratTypeIe.o \
+ ieClasses/indicationIe.o \
+ ieClasses/fTeidIe.o \
+ ieClasses/apnIe.o \
+ ieClasses/selectionModeIe.o \
+ ieClasses/pdnTypeIe.o \
+ ieClasses/paaIe.o \
+ ieClasses/apnRestrictionIe.o \
+ ieClasses/ambrMmbrIe.o \
+ ieClasses/ambrIe.o \
+ ieClasses/ebiIe.o \
+ ieClasses/pcoIe.o \
+ ieClasses/traceInformationIe.o \
+ ieClasses/recoveryIe.o \
+ ieClasses/ueTimeZoneIe.o \
+ ieClasses/uciIe.o \
+ ieClasses/chargingCharacteristicsIe.o \
+ ieClasses/localDistinguishedNameIe.o \
+ ieClasses/signallingPriorityIndicationIe.o \
+ ieClasses/additionalProtocolConfigurationOptionsIe.o \
+ ieClasses/fqCsidIe.o \
+ ieClasses/bearerTftIe.o \
+ ieClasses/bearerQosIe.o \
+ ieClasses/changeReportingActionIe.o \
+ ieClasses/csgInformationReportingActionIe.o \
+ ieClasses/fqdnIe.o \
+ ieClasses/epcTimerIe.o \
+ ieClasses/chargingIdIe.o \
+ ieClasses/bearerFlagsIe.o \
+ ieClasses/ipAddressIe.o \
+ ieClasses/delayValueIe.o \
+ ieClasses/portNumberIe.o \
+ ieClasses/cnOperatorSelectionEntityIe.o \
+ ieClasses/servingPlmnRateControlIe.o \
+ ieClasses/counterIe.o \
+ ieClasses/twanIdentifierIe.o \
+ ieClasses/twanIdentifierTimestampIe.o \
+ ieClasses/secondaryRatUsageDataReportIe.o \
+ ieClasses/ranNasCauseIe.o \
+ ieClasses/epcoIe.o \
+ ieClasses/maximumPacketLossRateIe.o \
+ ieClasses/fContainerIe.o \
+ ieClasses/nodeIdentifierIe.o \
+ ieClasses/upFunctionSelectionIndicationFlagsIe.o \
+ ieClasses/henbInformationReportingIe.o \
+ ieClasses/ip4cpIe.o \
+ ieClasses/presenceReportingAreaActionIe.o \
+ ieClasses/nodeTypeIe.o \
+ ieClasses/ptiIe.o \
+ ieClasses/twmiIe.o \
+ ieClasses/millisecondTimeStampIe.o \
+ ieClasses/integerNumberIe.o \
+ ieClasses/mappedUeUsageTypeIe.o \
+ ieClasses/uliTimestampIe.o \
+ ieClasses/metricIe.o \
+ ieClasses/remoteUserIdIe.o \
+ ieClasses/remoteUeIpInformationIe.o \
+ ieClasses/sequenceNumberIe.o \
+ ieClasses/apnAndRelativeCapacityIe.o \
+ ieClasses/arpIe.o \
+ ieClasses/throttlingIe.o \
+ ieClasses/pagingAndServiceInformationIe.o \
+ msgClasses/createSessionRequestMsg.o \
+ msgClasses/gtpV2MsgFactory.o \
+ gtpV2Stack.o \
+ msgClasses/manual/gtpV2Message.o \
+ msgClasses/createSessionResponseMsg.o \
+ msgClasses/modifyBearerRequestMsg.o \
+ msgClasses/modifyBearerResponseMsg.o \
+ msgClasses/deleteSessionRequestMsg.o \
+ msgClasses/deleteSessionResponseMsg.o \
+ msgClasses/releaseAccessBearersRequestMsg.o \
+ msgClasses/releaseAccessBearersResponseMsg.o \
+ msgClasses/createBearerRequestMsg.o \
+ msgClasses/createBearerResponseMsg.o \
+ msgClasses/deleteBearerRequestMsg.o \
+ msgClasses/deleteBearerResponseMsg.o \
+ msgClasses/downlinkDataNotificationMsg.o \
+ msgClasses/downlinkDataNotificationAcknowledgeMsg.o \
+ msgClasses/downlinkDataNotificationFailureIndicationMsg.o \
+ ieClasses/bearerContextsToBeModifiedInModifyBearerRequest.o \
+ ieClasses/bearerContextIe.o \
+ ieClasses/manual/gtpV2GroupedIe.o \
+ ieClasses/bearerContextsToBeRemovedInModifyBearerRequest.o \
+ ieClasses/bearerContextsMarkedForRemovalInModifyBearerResponse.o \
+ ieClasses/bearerContextsModifiedInModifyBearerResponse.o \
+ ieClasses/bearerContextsToBeCreatedInCreateSessionRequest.o \
+ ieClasses/bearerContextsToBeRemovedInCreateSessionRequest.o \
+ ieClasses/bearerContextsCreatedInCreateSessionResponse.o \
+ ieClasses/bearerContextsMarkedForRemovalInCreateSessionResponse.o \
+ ieClasses/sgwsOverloadControlInformationInCreateSessionRequest.o \
+ ieClasses/overloadControlInformationIe.o \
+ ieClasses/twanEpdgsOverloadControlInformationInCreateSessionRequest.o \
+ ieClasses/mmeS4SgsnsOverloadControlInformationInCreateSessionRequest.o \
+ ieClasses/remoteUeContextConnectedInCreateSessionRequest.o \
+ ieClasses/remoteUeContextIe.o \
+ ieClasses/pgwsOverloadControlInformationInCreateSessionResponse.o \
+ ieClasses/sgwsOverloadControlInformationInCreateSessionResponse.o \
+ ieClasses/pgwsNodeLevelLoadControlInformationInCreateSessionResponse.o \
+ ieClasses/loadControlInformationIe.o \
+ ieClasses/pgwsApnLevelLoadControlInformationInCreateSessionResponse.o \
+ ieClasses/sgwsNodeLevelLoadControlInformationInCreateSessionResponse.o \
+ ieClasses/mmeS4SgsnsOverloadControlInformationInModifyBearerRequest.o \
+ ieClasses/sgwsOverloadControlInformationInModifyBearerRequest.o \
+ ieClasses/epdgsOverloadControlInformationInModifyBearerRequest.o \
+ ieClasses/sgwsOverloadControlInformationInModifyBearerResponse.o \
+ ieClasses/pgwsOverloadControlInformationInModifyBearerResponse.o \
+ ieClasses/sgwsNodeLevelLoadControlInformationInModifyBearerResponse.o \
+ ieClasses/pgwsApnLevelLoadControlInformationInModifyBearerResponse.o \
+ ieClasses/pgwsNodeLevelLoadControlInformationInModifyBearerResponse.o \
+ ieClasses/mmeS4SgsnsOverloadControlInformationInDeleteSessionRequest.o \
+ ieClasses/sgwsOverloadControlInformationInDeleteSessionRequest.o \
+ ieClasses/twanEpdgsOverloadControlInformationInDeleteSessionRequest.o \
+ ieClasses/sgwsOverloadControlInformationInDeleteSessionResponse.o \
+ ieClasses/pgwsOverloadControlInformationInDeleteSessionResponse.o \
+ ieClasses/pgwsNodeLevelLoadControlInformationInDeleteSessionResponse.o \
+ ieClasses/pgwsApnLevelLoadControlInformationInDeleteSessionResponse.o \
+ ieClasses/sgwsNodeLevelLoadControlInformationInDeleteSessionResponse.o \
+ ieClasses/sgwsOverloadControlInformationInReleaseAccessBearersResponse.o \
+ ieClasses/sgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponse.o \
+ ieClasses/bearerContextsInCreateBearerRequest.o \
+ ieClasses/pgwsNodeLevelLoadControlInformationInCreateBearerRequest.o \
+ ieClasses/pgwsApnLevelLoadControlInformationInCreateBearerRequest.o \
+ ieClasses/sgwsNodeLevelLoadControlInformationInCreateBearerRequest.o \
+ ieClasses/pgwsOverloadControlInformationInCreateBearerRequest.o \
+ ieClasses/sgwsOverloadControlInformationInCreateBearerRequest.o \
+ ieClasses/bearerContextsInCreateBearerResponse.o \
+ ieClasses/mmeS4SgsnsOverloadControlInformationInCreateBearerResponse.o \
+ ieClasses/sgwsOverloadControlInformationInCreateBearerResponse.o \
+ ieClasses/twanEpdgsOverloadControlInformationInCreateBearerResponse.o \
+ ieClasses/failedBearerContextsInDeleteBearerRequest.o \
+ ieClasses/pgwsNodeLevelLoadControlInformationInDeleteBearerRequest.o \
+ ieClasses/pgwsApnLevelLoadControlInformationInDeleteBearerRequest.o \
+ ieClasses/sgwsNodeLevelLoadControlInformationInDeleteBearerRequest.o \
+ ieClasses/pgwsOverloadControlInformationInDeleteBearerRequest.o \
+ ieClasses/sgwsOverloadControlInformationInDeleteBearerRequest.o \
+ ieClasses/bearerContextsInDeleteBearerResponse.o \
+ ieClasses/mmeS4SgsnsOverloadControlInformationInDeleteBearerResponse.o \
+ ieClasses/sgwsOverloadControlInformationInDeleteBearerResponse.o \
+ ieClasses/twanEpdgsOverloadControlInformationInDeleteBearerResponse.o \
+ ieClasses/sgwsNodeLevelLoadControlInformationInDownlinkDataNotification.o \
+ ieClasses/sgwsOverloadControlInformationInDownlinkDataNotification.o \
+ ieClasses/manual/dataTypeCodecUtils_manual.o \
+ gtpV2StackWrappers.o )
+all : $(gtpV2CodecLIB)
+
+.PHONY : all
+
+$(gtpV2CodecLIB) : $(gtpV2CodecOBJS)
+ mkdir -p $(LIBDIR)
+ $(CC) $(CFLAGS) -shared -o $(gtpV2CodecLIB) $(gtpV2CodecOBJS)
+
+$(gtpV2CodecOBJS) : $(OBJDIR)/gtpV2Codec/%.o : %.cpp
+ echo "$@ from $< "
+ mkdir -p $(gtpV2CodecOBJDIR)/ieClasses/manual
+ mkdir -p $(gtpV2CodecOBJDIR)/msgClasses/manual
+ $(CC) $(CFLAGS) $(INC_DIRS) -fPIC -c $< -o $@
+
+install:
+ mkdir -p $(TOPDIR)/target/lib
+ cp -rf $(gtpV2CodecLIB) $(TOPDIR)/target/lib
+
+clean :
+ rm -rf $(gtpV2CodecLIB)
+ rm -rf $(gtpV2CodecOBJDIR)
+
+.PHONY : clean
\ No newline at end of file
diff --git a/src/gtpV2Codec/gtpV2Stack.cpp b/src/gtpV2Codec/gtpV2Stack.cpp
new file mode 100644
index 0000000..c1f415f
--- /dev/null
+++ b/src/gtpV2Codec/gtpV2Stack.cpp
@@ -0,0 +1,1175 @@
+/*
+ * 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/stacktemplate.cpp.tt>
+ ******************************************************************************/
+#include <cstring>
+#include <stdint.h>
+#include "gtpV2Stack.h"
+#include "msgClasses/gtpV2MsgFactory.h"
+#include "msgClasses/manual/gtpV2Message.h"
+#include "msgClasses/createSessionRequestMsg.h"
+#include "msgClasses/createSessionResponseMsg.h"
+#include "msgClasses/modifyBearerRequestMsg.h"
+#include "msgClasses/modifyBearerResponseMsg.h"
+#include "msgClasses/deleteSessionRequestMsg.h"
+#include "msgClasses/deleteSessionResponseMsg.h"
+#include "msgClasses/releaseAccessBearersRequestMsg.h"
+#include "msgClasses/releaseAccessBearersResponseMsg.h"
+#include "msgClasses/createBearerRequestMsg.h"
+#include "msgClasses/createBearerResponseMsg.h"
+#include "msgClasses/deleteBearerRequestMsg.h"
+#include "msgClasses/deleteBearerResponseMsg.h"
+#include "msgClasses/downlinkDataNotificationMsg.h"
+#include "msgClasses/downlinkDataNotificationAcknowledgeMsg.h"
+#include "msgClasses/downlinkDataNotificationFailureIndicationMsg.h"
+
+cmn::utils::Debug errorStream;
+
+GtpV2Stack::GtpV2Stack ()
+{
+ // TODO Auto-generated constructor stub
+
+}
+
+GtpV2Stack::~GtpV2Stack ()
+{
+ // TODO Auto-generated destructor stub
+}
+
+bool
+GtpV2Stack::encodeMessage (GtpV2MessageHeader & msgHeader,
+ MsgBuffer & buffer, void *data_p)
+{
+
+ //Clear the global errorStream
+ errorStream.clearStream ();
+ bool rc = false;
+ GtpV2Message & msg =
+ GtpV2MsgFactory::getInstance ().getMsgObject (msgHeader.msgType);
+
+ uint16_t gtpHeaderStartIdx = buffer.getCurrentIndex();
+ // Encode the header
+ GtpV2Message::encodeHeader (buffer, msgHeader);
+
+ Uint16 startIndex = buffer.getCurrentIndex();
+
+ switch (msgHeader.msgType)
+ {
+ case CreateSessionRequestMsgType:
+ {
+ if (data_p != NULL)
+ {
+ rc =
+ dynamic_cast<
+ CreateSessionRequestMsg & >(msg).
+ encodeCreateSessionRequestMsg(buffer,
+ *((CreateSessionRequestMsgData *)
+ data_p));
+ }
+ else
+ {
+ // Application has filled the data structure provided by the stack
+ rc =
+ dynamic_cast<
+ CreateSessionRequestMsg & >(msg).
+ encodeCreateSessionRequestMsg (buffer,
+ createSessionRequestStackData);
+ }
+ break;
+ }
+ case CreateSessionResponseMsgType:
+ {
+ if (data_p != NULL)
+ {
+ rc =
+ dynamic_cast<
+ CreateSessionResponseMsg & >(msg).
+ encodeCreateSessionResponseMsg(buffer,
+ *((CreateSessionResponseMsgData *)
+ data_p));
+ }
+ else
+ {
+ // Application has filled the data structure provided by the stack
+ rc =
+ dynamic_cast<
+ CreateSessionResponseMsg & >(msg).
+ encodeCreateSessionResponseMsg (buffer,
+ createSessionResponseStackData);
+ }
+ break;
+ }
+ case ModifyBearerRequestMsgType:
+ {
+ if (data_p != NULL)
+ {
+ rc =
+ dynamic_cast<
+ ModifyBearerRequestMsg & >(msg).
+ encodeModifyBearerRequestMsg(buffer,
+ *((ModifyBearerRequestMsgData *)
+ data_p));
+ }
+ else
+ {
+ // Application has filled the data structure provided by the stack
+ rc =
+ dynamic_cast<
+ ModifyBearerRequestMsg & >(msg).
+ encodeModifyBearerRequestMsg (buffer,
+ modifyBearerRequestStackData);
+ }
+ break;
+ }
+ case ModifyBearerResponseMsgType:
+ {
+ if (data_p != NULL)
+ {
+ rc =
+ dynamic_cast<
+ ModifyBearerResponseMsg & >(msg).
+ encodeModifyBearerResponseMsg(buffer,
+ *((ModifyBearerResponseMsgData *)
+ data_p));
+ }
+ else
+ {
+ // Application has filled the data structure provided by the stack
+ rc =
+ dynamic_cast<
+ ModifyBearerResponseMsg & >(msg).
+ encodeModifyBearerResponseMsg (buffer,
+ modifyBearerResponseStackData);
+ }
+ break;
+ }
+ case DeleteSessionRequestMsgType:
+ {
+ if (data_p != NULL)
+ {
+ rc =
+ dynamic_cast<
+ DeleteSessionRequestMsg & >(msg).
+ encodeDeleteSessionRequestMsg(buffer,
+ *((DeleteSessionRequestMsgData *)
+ data_p));
+ }
+ else
+ {
+ // Application has filled the data structure provided by the stack
+ rc =
+ dynamic_cast<
+ DeleteSessionRequestMsg & >(msg).
+ encodeDeleteSessionRequestMsg (buffer,
+ deleteSessionRequestStackData);
+ }
+ break;
+ }
+ case DeleteSessionResponseMsgType:
+ {
+ if (data_p != NULL)
+ {
+ rc =
+ dynamic_cast<
+ DeleteSessionResponseMsg & >(msg).
+ encodeDeleteSessionResponseMsg(buffer,
+ *((DeleteSessionResponseMsgData *)
+ data_p));
+ }
+ else
+ {
+ // Application has filled the data structure provided by the stack
+ rc =
+ dynamic_cast<
+ DeleteSessionResponseMsg & >(msg).
+ encodeDeleteSessionResponseMsg (buffer,
+ deleteSessionResponseStackData);
+ }
+ break;
+ }
+ case ReleaseAccessBearersRequestMsgType:
+ {
+ if (data_p != NULL)
+ {
+ rc =
+ dynamic_cast<
+ ReleaseAccessBearersRequestMsg & >(msg).
+ encodeReleaseAccessBearersRequestMsg(buffer,
+ *((ReleaseAccessBearersRequestMsgData *)
+ data_p));
+ }
+ else
+ {
+ // Application has filled the data structure provided by the stack
+ rc =
+ dynamic_cast<
+ ReleaseAccessBearersRequestMsg & >(msg).
+ encodeReleaseAccessBearersRequestMsg (buffer,
+ releaseAccessBearersRequestStackData);
+ }
+ break;
+ }
+ case ReleaseAccessBearersResponseMsgType:
+ {
+ if (data_p != NULL)
+ {
+ rc =
+ dynamic_cast<
+ ReleaseAccessBearersResponseMsg & >(msg).
+ encodeReleaseAccessBearersResponseMsg(buffer,
+ *((ReleaseAccessBearersResponseMsgData *)
+ data_p));
+ }
+ else
+ {
+ // Application has filled the data structure provided by the stack
+ rc =
+ dynamic_cast<
+ ReleaseAccessBearersResponseMsg & >(msg).
+ encodeReleaseAccessBearersResponseMsg (buffer,
+ releaseAccessBearersResponseStackData);
+ }
+ break;
+ }
+ case CreateBearerRequestMsgType:
+ {
+ if (data_p != NULL)
+ {
+ rc =
+ dynamic_cast<
+ CreateBearerRequestMsg & >(msg).
+ encodeCreateBearerRequestMsg(buffer,
+ *((CreateBearerRequestMsgData *)
+ data_p));
+ }
+ else
+ {
+ // Application has filled the data structure provided by the stack
+ rc =
+ dynamic_cast<
+ CreateBearerRequestMsg & >(msg).
+ encodeCreateBearerRequestMsg (buffer,
+ createBearerRequestStackData);
+ }
+ break;
+ }
+ case CreateBearerResponseMsgType:
+ {
+ if (data_p != NULL)
+ {
+ rc =
+ dynamic_cast<
+ CreateBearerResponseMsg & >(msg).
+ encodeCreateBearerResponseMsg(buffer,
+ *((CreateBearerResponseMsgData *)
+ data_p));
+ }
+ else
+ {
+ // Application has filled the data structure provided by the stack
+ rc =
+ dynamic_cast<
+ CreateBearerResponseMsg & >(msg).
+ encodeCreateBearerResponseMsg (buffer,
+ createBearerResponseStackData);
+ }
+ break;
+ }
+ case DeleteBearerRequestMsgType:
+ {
+ if (data_p != NULL)
+ {
+ rc =
+ dynamic_cast<
+ DeleteBearerRequestMsg & >(msg).
+ encodeDeleteBearerRequestMsg(buffer,
+ *((DeleteBearerRequestMsgData *)
+ data_p));
+ }
+ else
+ {
+ // Application has filled the data structure provided by the stack
+ rc =
+ dynamic_cast<
+ DeleteBearerRequestMsg & >(msg).
+ encodeDeleteBearerRequestMsg (buffer,
+ deleteBearerRequestStackData);
+ }
+ break;
+ }
+ case DeleteBearerResponseMsgType:
+ {
+ if (data_p != NULL)
+ {
+ rc =
+ dynamic_cast<
+ DeleteBearerResponseMsg & >(msg).
+ encodeDeleteBearerResponseMsg(buffer,
+ *((DeleteBearerResponseMsgData *)
+ data_p));
+ }
+ else
+ {
+ // Application has filled the data structure provided by the stack
+ rc =
+ dynamic_cast<
+ DeleteBearerResponseMsg & >(msg).
+ encodeDeleteBearerResponseMsg (buffer,
+ deleteBearerResponseStackData);
+ }
+ break;
+ }
+ case DownlinkDataNotificationMsgType:
+ {
+ if (data_p != NULL)
+ {
+ rc =
+ dynamic_cast<
+ DownlinkDataNotificationMsg & >(msg).
+ encodeDownlinkDataNotificationMsg(buffer,
+ *((DownlinkDataNotificationMsgData *)
+ data_p));
+ }
+ else
+ {
+ // Application has filled the data structure provided by the stack
+ rc =
+ dynamic_cast<
+ DownlinkDataNotificationMsg & >(msg).
+ encodeDownlinkDataNotificationMsg (buffer,
+ downlinkDataNotificationStackData);
+ }
+ break;
+ }
+ case DownlinkDataNotificationAcknowledgeMsgType:
+ {
+ if (data_p != NULL)
+ {
+ rc =
+ dynamic_cast<
+ DownlinkDataNotificationAcknowledgeMsg & >(msg).
+ encodeDownlinkDataNotificationAcknowledgeMsg(buffer,
+ *((DownlinkDataNotificationAcknowledgeMsgData *)
+ data_p));
+ }
+ else
+ {
+ // Application has filled the data structure provided by the stack
+ rc =
+ dynamic_cast<
+ DownlinkDataNotificationAcknowledgeMsg & >(msg).
+ encodeDownlinkDataNotificationAcknowledgeMsg (buffer,
+ downlinkDataNotificationAcknowledgeStackData);
+ }
+ break;
+ }
+ case DownlinkDataNotificationFailureIndicationMsgType:
+ {
+ if (data_p != NULL)
+ {
+ rc =
+ dynamic_cast<
+ DownlinkDataNotificationFailureIndicationMsg & >(msg).
+ encodeDownlinkDataNotificationFailureIndicationMsg(buffer,
+ *((DownlinkDataNotificationFailureIndicationMsgData *)
+ data_p));
+ }
+ else
+ {
+ // Application has filled the data structure provided by the stack
+ rc =
+ dynamic_cast<
+ DownlinkDataNotificationFailureIndicationMsg & >(msg).
+ encodeDownlinkDataNotificationFailureIndicationMsg (buffer,
+ downlinkDataNotificationFailureIndicationStackData);
+ }
+ break;
+ }
+ }
+
+ Uint16 endIndex = buffer.getCurrentIndex ();
+
+ Uint16 messageLength = (endIndex - startIndex)+8;
+
+ buffer.goToIndex (gtpHeaderStartIdx + 2); // 2 is where length is encoded in a gtp message TODO remove hardcoding
+ buffer.writeUint16 (messageLength, false);
+ buffer.goToIndex (endIndex);
+ return rc;
+}
+
+bool
+GtpV2Stack::decodeGtpMessageHeader(GtpV2MessageHeader& msgHeader, MsgBuffer& buffer)
+{
+ return GtpV2Message::decodeHeader (buffer, msgHeader);
+}
+
+
+bool
+GtpV2Stack::decodeMessage (GtpV2MessageHeader& msgHeader,
+ MsgBuffer& buffer,void* data_p)
+{
+ errorStream.clearStream();
+ // First decode the message header
+ bool rc = false;
+
+
+
+ Uint16 msgDataLength = msgHeader.msgLength;
+
+ if (msgHeader.teidPresent)
+ {
+ msgDataLength = msgDataLength - 8; //teid and sequence number
+ }
+ else
+ {
+ msgDataLength = msgDataLength - 4; //only sequence number
+ }
+
+ // Validate the length before proceeding
+ if (msgDataLength != buffer.lengthLeft() )
+ {
+ // Encoded message length does not match the number of bytes left in the message
+ errorStream.add ((char *)"Message length does not match bytes in buffer\n");
+ errorStream.add ((char *)"Computed Message length: ");
+ errorStream.add (msgDataLength);
+ errorStream.add ((char *)" Bytes Left in buffer: ");
+ errorStream.add (buffer.lengthLeft());
+ errorStream.endOfLine ();
+ return false;
+ }
+
+ GtpV2Message& msg =
+ GtpV2MsgFactory::getInstance ().getMsgObject (msgHeader.msgType);
+
+ switch (msgHeader.msgType){
+ case CreateSessionRequestMsgType:
+ {
+ if (data_p != NULL)
+ {
+ rc =
+ dynamic_cast<
+ CreateSessionRequestMsg & >(msg).
+ decodeCreateSessionRequestMsg(buffer,
+ *(CreateSessionRequestMsgData*)
+ data_p, msgDataLength);
+ }
+ else
+ {
+ // Application wants to use the data structure provided by the stack
+ // let us first clear any data present in the internal data structure
+ memset (&createSessionRequestStackData, 0,
+ sizeof (CreateSessionRequestMsgData));
+ rc =
+ dynamic_cast<
+ CreateSessionRequestMsg & >(msg).
+ decodeCreateSessionRequestMsg(buffer,
+ createSessionRequestStackData,
+ msgDataLength);
+ }
+ break;
+ }
+ case CreateSessionResponseMsgType:
+ {
+ if (data_p != NULL)
+ {
+ rc =
+ dynamic_cast<
+ CreateSessionResponseMsg & >(msg).
+ decodeCreateSessionResponseMsg(buffer,
+ *(CreateSessionResponseMsgData*)
+ data_p, msgDataLength);
+ }
+ else
+ {
+ // Application wants to use the data structure provided by the stack
+ // let us first clear any data present in the internal data structure
+ memset (&createSessionResponseStackData, 0,
+ sizeof (CreateSessionResponseMsgData));
+ rc =
+ dynamic_cast<
+ CreateSessionResponseMsg & >(msg).
+ decodeCreateSessionResponseMsg(buffer,
+ createSessionResponseStackData,
+ msgDataLength);
+ }
+ break;
+ }
+ case ModifyBearerRequestMsgType:
+ {
+ if (data_p != NULL)
+ {
+ rc =
+ dynamic_cast<
+ ModifyBearerRequestMsg & >(msg).
+ decodeModifyBearerRequestMsg(buffer,
+ *(ModifyBearerRequestMsgData*)
+ data_p, msgDataLength);
+ }
+ else
+ {
+ // Application wants to use the data structure provided by the stack
+ // let us first clear any data present in the internal data structure
+ memset (&modifyBearerRequestStackData, 0,
+ sizeof (ModifyBearerRequestMsgData));
+ rc =
+ dynamic_cast<
+ ModifyBearerRequestMsg & >(msg).
+ decodeModifyBearerRequestMsg(buffer,
+ modifyBearerRequestStackData,
+ msgDataLength);
+ }
+ break;
+ }
+ case ModifyBearerResponseMsgType:
+ {
+ if (data_p != NULL)
+ {
+ rc =
+ dynamic_cast<
+ ModifyBearerResponseMsg & >(msg).
+ decodeModifyBearerResponseMsg(buffer,
+ *(ModifyBearerResponseMsgData*)
+ data_p, msgDataLength);
+ }
+ else
+ {
+ // Application wants to use the data structure provided by the stack
+ // let us first clear any data present in the internal data structure
+ memset (&modifyBearerResponseStackData, 0,
+ sizeof (ModifyBearerResponseMsgData));
+ rc =
+ dynamic_cast<
+ ModifyBearerResponseMsg & >(msg).
+ decodeModifyBearerResponseMsg(buffer,
+ modifyBearerResponseStackData,
+ msgDataLength);
+ }
+ break;
+ }
+ case DeleteSessionRequestMsgType:
+ {
+ if (data_p != NULL)
+ {
+ rc =
+ dynamic_cast<
+ DeleteSessionRequestMsg & >(msg).
+ decodeDeleteSessionRequestMsg(buffer,
+ *(DeleteSessionRequestMsgData*)
+ data_p, msgDataLength);
+ }
+ else
+ {
+ // Application wants to use the data structure provided by the stack
+ // let us first clear any data present in the internal data structure
+ memset (&deleteSessionRequestStackData, 0,
+ sizeof (DeleteSessionRequestMsgData));
+ rc =
+ dynamic_cast<
+ DeleteSessionRequestMsg & >(msg).
+ decodeDeleteSessionRequestMsg(buffer,
+ deleteSessionRequestStackData,
+ msgDataLength);
+ }
+ break;
+ }
+ case DeleteSessionResponseMsgType:
+ {
+ if (data_p != NULL)
+ {
+ rc =
+ dynamic_cast<
+ DeleteSessionResponseMsg & >(msg).
+ decodeDeleteSessionResponseMsg(buffer,
+ *(DeleteSessionResponseMsgData*)
+ data_p, msgDataLength);
+ }
+ else
+ {
+ // Application wants to use the data structure provided by the stack
+ // let us first clear any data present in the internal data structure
+ memset (&deleteSessionResponseStackData, 0,
+ sizeof (DeleteSessionResponseMsgData));
+ rc =
+ dynamic_cast<
+ DeleteSessionResponseMsg & >(msg).
+ decodeDeleteSessionResponseMsg(buffer,
+ deleteSessionResponseStackData,
+ msgDataLength);
+ }
+ break;
+ }
+ case ReleaseAccessBearersRequestMsgType:
+ {
+ if (data_p != NULL)
+ {
+ rc =
+ dynamic_cast<
+ ReleaseAccessBearersRequestMsg & >(msg).
+ decodeReleaseAccessBearersRequestMsg(buffer,
+ *(ReleaseAccessBearersRequestMsgData*)
+ data_p, msgDataLength);
+ }
+ else
+ {
+ // Application wants to use the data structure provided by the stack
+ // let us first clear any data present in the internal data structure
+ memset (&releaseAccessBearersRequestStackData, 0,
+ sizeof (ReleaseAccessBearersRequestMsgData));
+ rc =
+ dynamic_cast<
+ ReleaseAccessBearersRequestMsg & >(msg).
+ decodeReleaseAccessBearersRequestMsg(buffer,
+ releaseAccessBearersRequestStackData,
+ msgDataLength);
+ }
+ break;
+ }
+ case ReleaseAccessBearersResponseMsgType:
+ {
+ if (data_p != NULL)
+ {
+ rc =
+ dynamic_cast<
+ ReleaseAccessBearersResponseMsg & >(msg).
+ decodeReleaseAccessBearersResponseMsg(buffer,
+ *(ReleaseAccessBearersResponseMsgData*)
+ data_p, msgDataLength);
+ }
+ else
+ {
+ // Application wants to use the data structure provided by the stack
+ // let us first clear any data present in the internal data structure
+ memset (&releaseAccessBearersResponseStackData, 0,
+ sizeof (ReleaseAccessBearersResponseMsgData));
+ rc =
+ dynamic_cast<
+ ReleaseAccessBearersResponseMsg & >(msg).
+ decodeReleaseAccessBearersResponseMsg(buffer,
+ releaseAccessBearersResponseStackData,
+ msgDataLength);
+ }
+ break;
+ }
+ case CreateBearerRequestMsgType:
+ {
+ if (data_p != NULL)
+ {
+ rc =
+ dynamic_cast<
+ CreateBearerRequestMsg & >(msg).
+ decodeCreateBearerRequestMsg(buffer,
+ *(CreateBearerRequestMsgData*)
+ data_p, msgDataLength);
+ }
+ else
+ {
+ // Application wants to use the data structure provided by the stack
+ // let us first clear any data present in the internal data structure
+ memset (&createBearerRequestStackData, 0,
+ sizeof (CreateBearerRequestMsgData));
+ rc =
+ dynamic_cast<
+ CreateBearerRequestMsg & >(msg).
+ decodeCreateBearerRequestMsg(buffer,
+ createBearerRequestStackData,
+ msgDataLength);
+ }
+ break;
+ }
+ case CreateBearerResponseMsgType:
+ {
+ if (data_p != NULL)
+ {
+ rc =
+ dynamic_cast<
+ CreateBearerResponseMsg & >(msg).
+ decodeCreateBearerResponseMsg(buffer,
+ *(CreateBearerResponseMsgData*)
+ data_p, msgDataLength);
+ }
+ else
+ {
+ // Application wants to use the data structure provided by the stack
+ // let us first clear any data present in the internal data structure
+ memset (&createBearerResponseStackData, 0,
+ sizeof (CreateBearerResponseMsgData));
+ rc =
+ dynamic_cast<
+ CreateBearerResponseMsg & >(msg).
+ decodeCreateBearerResponseMsg(buffer,
+ createBearerResponseStackData,
+ msgDataLength);
+ }
+ break;
+ }
+ case DeleteBearerRequestMsgType:
+ {
+ if (data_p != NULL)
+ {
+ rc =
+ dynamic_cast<
+ DeleteBearerRequestMsg & >(msg).
+ decodeDeleteBearerRequestMsg(buffer,
+ *(DeleteBearerRequestMsgData*)
+ data_p, msgDataLength);
+ }
+ else
+ {
+ // Application wants to use the data structure provided by the stack
+ // let us first clear any data present in the internal data structure
+ memset (&deleteBearerRequestStackData, 0,
+ sizeof (DeleteBearerRequestMsgData));
+ rc =
+ dynamic_cast<
+ DeleteBearerRequestMsg & >(msg).
+ decodeDeleteBearerRequestMsg(buffer,
+ deleteBearerRequestStackData,
+ msgDataLength);
+ }
+ break;
+ }
+ case DeleteBearerResponseMsgType:
+ {
+ if (data_p != NULL)
+ {
+ rc =
+ dynamic_cast<
+ DeleteBearerResponseMsg & >(msg).
+ decodeDeleteBearerResponseMsg(buffer,
+ *(DeleteBearerResponseMsgData*)
+ data_p, msgDataLength);
+ }
+ else
+ {
+ // Application wants to use the data structure provided by the stack
+ // let us first clear any data present in the internal data structure
+ memset (&deleteBearerResponseStackData, 0,
+ sizeof (DeleteBearerResponseMsgData));
+ rc =
+ dynamic_cast<
+ DeleteBearerResponseMsg & >(msg).
+ decodeDeleteBearerResponseMsg(buffer,
+ deleteBearerResponseStackData,
+ msgDataLength);
+ }
+ break;
+ }
+ case DownlinkDataNotificationMsgType:
+ {
+ if (data_p != NULL)
+ {
+ rc =
+ dynamic_cast<
+ DownlinkDataNotificationMsg & >(msg).
+ decodeDownlinkDataNotificationMsg(buffer,
+ *(DownlinkDataNotificationMsgData*)
+ data_p, msgDataLength);
+ }
+ else
+ {
+ // Application wants to use the data structure provided by the stack
+ // let us first clear any data present in the internal data structure
+ memset (&downlinkDataNotificationStackData, 0,
+ sizeof (DownlinkDataNotificationMsgData));
+ rc =
+ dynamic_cast<
+ DownlinkDataNotificationMsg & >(msg).
+ decodeDownlinkDataNotificationMsg(buffer,
+ downlinkDataNotificationStackData,
+ msgDataLength);
+ }
+ break;
+ }
+ case DownlinkDataNotificationAcknowledgeMsgType:
+ {
+ if (data_p != NULL)
+ {
+ rc =
+ dynamic_cast<
+ DownlinkDataNotificationAcknowledgeMsg & >(msg).
+ decodeDownlinkDataNotificationAcknowledgeMsg(buffer,
+ *(DownlinkDataNotificationAcknowledgeMsgData*)
+ data_p, msgDataLength);
+ }
+ else
+ {
+ // Application wants to use the data structure provided by the stack
+ // let us first clear any data present in the internal data structure
+ memset (&downlinkDataNotificationAcknowledgeStackData, 0,
+ sizeof (DownlinkDataNotificationAcknowledgeMsgData));
+ rc =
+ dynamic_cast<
+ DownlinkDataNotificationAcknowledgeMsg & >(msg).
+ decodeDownlinkDataNotificationAcknowledgeMsg(buffer,
+ downlinkDataNotificationAcknowledgeStackData,
+ msgDataLength);
+ }
+ break;
+ }
+ case DownlinkDataNotificationFailureIndicationMsgType:
+ {
+ if (data_p != NULL)
+ {
+ rc =
+ dynamic_cast<
+ DownlinkDataNotificationFailureIndicationMsg & >(msg).
+ decodeDownlinkDataNotificationFailureIndicationMsg(buffer,
+ *(DownlinkDataNotificationFailureIndicationMsgData*)
+ data_p, msgDataLength);
+ }
+ else
+ {
+ // Application wants to use the data structure provided by the stack
+ // let us first clear any data present in the internal data structure
+ memset (&downlinkDataNotificationFailureIndicationStackData, 0,
+ sizeof (DownlinkDataNotificationFailureIndicationMsgData));
+ rc =
+ dynamic_cast<
+ DownlinkDataNotificationFailureIndicationMsg & >(msg).
+ decodeDownlinkDataNotificationFailureIndicationMsg(buffer,
+ downlinkDataNotificationFailureIndicationStackData,
+ msgDataLength);
+ }
+ break;
+ }
+ }
+ return rc;
+}
+
+void
+GtpV2Stack::display_v(Uint8 msgType, Debug& stream, void* data_p)
+{
+ // Display the messageType
+ stream.add ((char *)"MessageType: ");
+ stream.add (msgType);
+ stream.endOfLine ();
+
+ GtpV2Message& msg = GtpV2MsgFactory::getInstance ().getMsgObject (msgType);
+
+ switch (msgType){
+ case CreateSessionRequestMsgType:
+ {
+ stream.add ((char *)"Message: CreateSessionRequestMsg");
+ stream.endOfLine ();
+ if (data_p != NULL)
+ {
+ dynamic_cast<
+ CreateSessionRequestMsg & >(msg).
+ displayCreateSessionRequestMsgData_v (*
+ ((CreateSessionRequestMsgData*) data_p), stream);
+ }
+ else
+ {
+ // Application wants to use the data structure provided by the stack
+ dynamic_cast<
+ CreateSessionRequestMsg & >(msg).
+ displayCreateSessionRequestMsgData_v
+ (createSessionRequestStackData, stream);
+ }
+ break;
+ }
+ case CreateSessionResponseMsgType:
+ {
+ stream.add ((char *)"Message: CreateSessionResponseMsg");
+ stream.endOfLine ();
+ if (data_p != NULL)
+ {
+ dynamic_cast<
+ CreateSessionResponseMsg & >(msg).
+ displayCreateSessionResponseMsgData_v (*
+ ((CreateSessionResponseMsgData*) data_p), stream);
+ }
+ else
+ {
+ // Application wants to use the data structure provided by the stack
+ dynamic_cast<
+ CreateSessionResponseMsg & >(msg).
+ displayCreateSessionResponseMsgData_v
+ (createSessionResponseStackData, stream);
+ }
+ break;
+ }
+ case ModifyBearerRequestMsgType:
+ {
+ stream.add ((char *)"Message: ModifyBearerRequestMsg");
+ stream.endOfLine ();
+ if (data_p != NULL)
+ {
+ dynamic_cast<
+ ModifyBearerRequestMsg & >(msg).
+ displayModifyBearerRequestMsgData_v (*
+ ((ModifyBearerRequestMsgData*) data_p), stream);
+ }
+ else
+ {
+ // Application wants to use the data structure provided by the stack
+ dynamic_cast<
+ ModifyBearerRequestMsg & >(msg).
+ displayModifyBearerRequestMsgData_v
+ (modifyBearerRequestStackData, stream);
+ }
+ break;
+ }
+ case ModifyBearerResponseMsgType:
+ {
+ stream.add ((char *)"Message: ModifyBearerResponseMsg");
+ stream.endOfLine ();
+ if (data_p != NULL)
+ {
+ dynamic_cast<
+ ModifyBearerResponseMsg & >(msg).
+ displayModifyBearerResponseMsgData_v (*
+ ((ModifyBearerResponseMsgData*) data_p), stream);
+ }
+ else
+ {
+ // Application wants to use the data structure provided by the stack
+ dynamic_cast<
+ ModifyBearerResponseMsg & >(msg).
+ displayModifyBearerResponseMsgData_v
+ (modifyBearerResponseStackData, stream);
+ }
+ break;
+ }
+ case DeleteSessionRequestMsgType:
+ {
+ stream.add ((char *)"Message: DeleteSessionRequestMsg");
+ stream.endOfLine ();
+ if (data_p != NULL)
+ {
+ dynamic_cast<
+ DeleteSessionRequestMsg & >(msg).
+ displayDeleteSessionRequestMsgData_v (*
+ ((DeleteSessionRequestMsgData*) data_p), stream);
+ }
+ else
+ {
+ // Application wants to use the data structure provided by the stack
+ dynamic_cast<
+ DeleteSessionRequestMsg & >(msg).
+ displayDeleteSessionRequestMsgData_v
+ (deleteSessionRequestStackData, stream);
+ }
+ break;
+ }
+ case DeleteSessionResponseMsgType:
+ {
+ stream.add ((char *)"Message: DeleteSessionResponseMsg");
+ stream.endOfLine ();
+ if (data_p != NULL)
+ {
+ dynamic_cast<
+ DeleteSessionResponseMsg & >(msg).
+ displayDeleteSessionResponseMsgData_v (*
+ ((DeleteSessionResponseMsgData*) data_p), stream);
+ }
+ else
+ {
+ // Application wants to use the data structure provided by the stack
+ dynamic_cast<
+ DeleteSessionResponseMsg & >(msg).
+ displayDeleteSessionResponseMsgData_v
+ (deleteSessionResponseStackData, stream);
+ }
+ break;
+ }
+ case ReleaseAccessBearersRequestMsgType:
+ {
+ stream.add ((char *)"Message: ReleaseAccessBearersRequestMsg");
+ stream.endOfLine ();
+ if (data_p != NULL)
+ {
+ dynamic_cast<
+ ReleaseAccessBearersRequestMsg & >(msg).
+ displayReleaseAccessBearersRequestMsgData_v (*
+ ((ReleaseAccessBearersRequestMsgData*) data_p), stream);
+ }
+ else
+ {
+ // Application wants to use the data structure provided by the stack
+ dynamic_cast<
+ ReleaseAccessBearersRequestMsg & >(msg).
+ displayReleaseAccessBearersRequestMsgData_v
+ (releaseAccessBearersRequestStackData, stream);
+ }
+ break;
+ }
+ case ReleaseAccessBearersResponseMsgType:
+ {
+ stream.add ((char *)"Message: ReleaseAccessBearersResponseMsg");
+ stream.endOfLine ();
+ if (data_p != NULL)
+ {
+ dynamic_cast<
+ ReleaseAccessBearersResponseMsg & >(msg).
+ displayReleaseAccessBearersResponseMsgData_v (*
+ ((ReleaseAccessBearersResponseMsgData*) data_p), stream);
+ }
+ else
+ {
+ // Application wants to use the data structure provided by the stack
+ dynamic_cast<
+ ReleaseAccessBearersResponseMsg & >(msg).
+ displayReleaseAccessBearersResponseMsgData_v
+ (releaseAccessBearersResponseStackData, stream);
+ }
+ break;
+ }
+ case CreateBearerRequestMsgType:
+ {
+ stream.add ((char *)"Message: CreateBearerRequestMsg");
+ stream.endOfLine ();
+ if (data_p != NULL)
+ {
+ dynamic_cast<
+ CreateBearerRequestMsg & >(msg).
+ displayCreateBearerRequestMsgData_v (*
+ ((CreateBearerRequestMsgData*) data_p), stream);
+ }
+ else
+ {
+ // Application wants to use the data structure provided by the stack
+ dynamic_cast<
+ CreateBearerRequestMsg & >(msg).
+ displayCreateBearerRequestMsgData_v
+ (createBearerRequestStackData, stream);
+ }
+ break;
+ }
+ case CreateBearerResponseMsgType:
+ {
+ stream.add ((char *)"Message: CreateBearerResponseMsg");
+ stream.endOfLine ();
+ if (data_p != NULL)
+ {
+ dynamic_cast<
+ CreateBearerResponseMsg & >(msg).
+ displayCreateBearerResponseMsgData_v (*
+ ((CreateBearerResponseMsgData*) data_p), stream);
+ }
+ else
+ {
+ // Application wants to use the data structure provided by the stack
+ dynamic_cast<
+ CreateBearerResponseMsg & >(msg).
+ displayCreateBearerResponseMsgData_v
+ (createBearerResponseStackData, stream);
+ }
+ break;
+ }
+ case DeleteBearerRequestMsgType:
+ {
+ stream.add ((char *)"Message: DeleteBearerRequestMsg");
+ stream.endOfLine ();
+ if (data_p != NULL)
+ {
+ dynamic_cast<
+ DeleteBearerRequestMsg & >(msg).
+ displayDeleteBearerRequestMsgData_v (*
+ ((DeleteBearerRequestMsgData*) data_p), stream);
+ }
+ else
+ {
+ // Application wants to use the data structure provided by the stack
+ dynamic_cast<
+ DeleteBearerRequestMsg & >(msg).
+ displayDeleteBearerRequestMsgData_v
+ (deleteBearerRequestStackData, stream);
+ }
+ break;
+ }
+ case DeleteBearerResponseMsgType:
+ {
+ stream.add ((char *)"Message: DeleteBearerResponseMsg");
+ stream.endOfLine ();
+ if (data_p != NULL)
+ {
+ dynamic_cast<
+ DeleteBearerResponseMsg & >(msg).
+ displayDeleteBearerResponseMsgData_v (*
+ ((DeleteBearerResponseMsgData*) data_p), stream);
+ }
+ else
+ {
+ // Application wants to use the data structure provided by the stack
+ dynamic_cast<
+ DeleteBearerResponseMsg & >(msg).
+ displayDeleteBearerResponseMsgData_v
+ (deleteBearerResponseStackData, stream);
+ }
+ break;
+ }
+ case DownlinkDataNotificationMsgType:
+ {
+ stream.add ((char *)"Message: DownlinkDataNotificationMsg");
+ stream.endOfLine ();
+ if (data_p != NULL)
+ {
+ dynamic_cast<
+ DownlinkDataNotificationMsg & >(msg).
+ displayDownlinkDataNotificationMsgData_v (*
+ ((DownlinkDataNotificationMsgData*) data_p), stream);
+ }
+ else
+ {
+ // Application wants to use the data structure provided by the stack
+ dynamic_cast<
+ DownlinkDataNotificationMsg & >(msg).
+ displayDownlinkDataNotificationMsgData_v
+ (downlinkDataNotificationStackData, stream);
+ }
+ break;
+ }
+ case DownlinkDataNotificationAcknowledgeMsgType:
+ {
+ stream.add ((char *)"Message: DownlinkDataNotificationAcknowledgeMsg");
+ stream.endOfLine ();
+ if (data_p != NULL)
+ {
+ dynamic_cast<
+ DownlinkDataNotificationAcknowledgeMsg & >(msg).
+ displayDownlinkDataNotificationAcknowledgeMsgData_v (*
+ ((DownlinkDataNotificationAcknowledgeMsgData*) data_p), stream);
+ }
+ else
+ {
+ // Application wants to use the data structure provided by the stack
+ dynamic_cast<
+ DownlinkDataNotificationAcknowledgeMsg & >(msg).
+ displayDownlinkDataNotificationAcknowledgeMsgData_v
+ (downlinkDataNotificationAcknowledgeStackData, stream);
+ }
+ break;
+ }
+ case DownlinkDataNotificationFailureIndicationMsgType:
+ {
+ stream.add ((char *)"Message: DownlinkDataNotificationFailureIndicationMsg");
+ stream.endOfLine ();
+ if (data_p != NULL)
+ {
+ dynamic_cast<
+ DownlinkDataNotificationFailureIndicationMsg & >(msg).
+ displayDownlinkDataNotificationFailureIndicationMsgData_v (*
+ ((DownlinkDataNotificationFailureIndicationMsgData*) data_p), stream);
+ }
+ else
+ {
+ // Application wants to use the data structure provided by the stack
+ dynamic_cast<
+ DownlinkDataNotificationFailureIndicationMsg & >(msg).
+ displayDownlinkDataNotificationFailureIndicationMsgData_v
+ (downlinkDataNotificationFailureIndicationStackData, stream);
+ }
+ break;
+ }
+ }
+}
diff --git a/src/gtpV2Codec/gtpV2Stack.h b/src/gtpV2Codec/gtpV2Stack.h
new file mode 100644
index 0000000..39b1c91
--- /dev/null
+++ b/src/gtpV2Codec/gtpV2Stack.h
@@ -0,0 +1,60 @@
+/*
+ * 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/stacktemplate.h.tt>
+ ******************************************************************************/
+#ifndef GTPV2STACK_H_
+#define GTPV2STACK_H_
+
+#include <sstream>
+#include <basicTypes.h>
+#include <msgBuffer.h>
+#include "msgClasses/gtpV2MsgDataTypes.h"
+
+class GtpV2Stack {
+public:
+ GtpV2Stack();
+ virtual ~GtpV2Stack();
+
+ // Public datastructures that hold decoded data or data to be encoded
+ CreateSessionRequestMsgData createSessionRequestStackData;
+ CreateSessionResponseMsgData createSessionResponseStackData;
+ ModifyBearerRequestMsgData modifyBearerRequestStackData;
+ ModifyBearerResponseMsgData modifyBearerResponseStackData;
+ DeleteSessionRequestMsgData deleteSessionRequestStackData;
+ DeleteSessionResponseMsgData deleteSessionResponseStackData;
+ ReleaseAccessBearersRequestMsgData releaseAccessBearersRequestStackData;
+ ReleaseAccessBearersResponseMsgData releaseAccessBearersResponseStackData;
+ CreateBearerRequestMsgData createBearerRequestStackData;
+ CreateBearerResponseMsgData createBearerResponseStackData;
+ DeleteBearerRequestMsgData deleteBearerRequestStackData;
+ DeleteBearerResponseMsgData deleteBearerResponseStackData;
+ DownlinkDataNotificationMsgData downlinkDataNotificationStackData;
+ DownlinkDataNotificationAcknowledgeMsgData downlinkDataNotificationAcknowledgeStackData;
+ DownlinkDataNotificationFailureIndicationMsgData downlinkDataNotificationFailureIndicationStackData;
+
+ bool encodeMessage(GtpV2MessageHeader& msgHeader, MsgBuffer& buffer,
+ void* data_p = NULL);
+ bool decodeGtpMessageHeader(GtpV2MessageHeader& msgHeader, MsgBuffer& buffer);
+ bool decodeMessage(GtpV2MessageHeader& msgHeader, MsgBuffer& buffer,
+ void* data_p = NULL);
+ void display_v(Uint8 msgType, Debug& stream, void* data_p = NULL);
+};
+
+#endif /* GTPV2STACK_H_ */
diff --git a/src/gtpV2Codec/gtpV2StackWrappers.cpp b/src/gtpV2Codec/gtpV2StackWrappers.cpp
new file mode 100644
index 0000000..c8447fe
--- /dev/null
+++ b/src/gtpV2Codec/gtpV2StackWrappers.cpp
@@ -0,0 +1,85 @@
+#include "gtpV2Stack.h"
+#include "msgBuffer.h"
+#include "gtpV2StackWrappers.h"
+
+extern "C"
+{
+ GtpV2Stack* createGtpV2Stack()
+ {
+ return new GtpV2Stack();
+ }
+
+ MsgBuffer* createMsgBuffer(uint16_t size)
+ {
+ return new MsgBuffer();
+ }
+
+ void MsgBuffer_free(MsgBuffer* buf_p)
+ {
+ delete buf_p;
+ }
+
+ void* MsgBuffer_getDataPointer(MsgBuffer* buf_p)
+ {
+ return buf_p->getDataPointer();
+ }
+
+ uint16_t MsgBuffer_getBufLen(MsgBuffer* buf_p)
+ {
+ return buf_p->getLength();
+ }
+
+ void MsgBuffer_reset(MsgBuffer* buf_p)
+ {
+ return buf_p->reset();
+ }
+
+ bool MsgBuffer_writeBytes(MsgBuffer* msgBuf_p, Uint8* data, Uint16 size, bool append)
+ {
+ return msgBuf_p->writeBytes(data, size, append);
+ }
+
+ void MsgBuffer_rewind(MsgBuffer* msgBuf_p)
+ {
+ return msgBuf_p->rewind();
+ }
+
+ bool GtpV2Stack_buildGtpV2Message(
+ GtpV2Stack* stack_p,
+ MsgBuffer* buf_p,
+ GtpV2MessageHeader* msgHeader_p,
+ void* data_p)
+ {
+ bool rc = stack_p->encodeMessage(*msgHeader_p, *buf_p, data_p);
+ if (rc == false)
+ {
+ errorStream.printDebugStream();
+ } else
+ {
+ cout << "GTP Encode Success" << endl;
+ }
+ return rc;
+ }
+
+ bool GtpV2Stack_decodeMessageHeader(GtpV2Stack* stack_p, GtpV2MessageHeader* hdr_p, MsgBuffer* msgBuf_p)
+ {
+ return stack_p->decodeGtpMessageHeader(*hdr_p, *msgBuf_p);
+ }
+
+ bool GtpV2Stack_decodeMessage(GtpV2Stack* stack_p,
+ GtpV2MessageHeader* msgHeader,
+ MsgBuffer* buffer,
+ void* data_p)
+ {
+ bool rc = stack_p->decodeMessage(*msgHeader, *buffer, data_p);
+ if (rc == false)
+ {
+ errorStream.printDebugStream();
+ } else
+ {
+ cout << "GTP Decode Success" << endl;
+ }
+ return rc;
+ }
+
+}
diff --git a/src/gtpV2Codec/gtpV2StackWrappers.h b/src/gtpV2Codec/gtpV2StackWrappers.h
new file mode 100644
index 0000000..4aa5f72
--- /dev/null
+++ b/src/gtpV2Codec/gtpV2StackWrappers.h
@@ -0,0 +1,45 @@
+#ifndef __GtpStackWrappers_H
+#define __GtpStackWrappers_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <stdint.h>
+#include "msgClasses/gtpV2MsgDataTypes.h"
+
+ typedef struct GtpV2Stack GtpV2Stack;
+ typedef struct MsgBuffer MsgBuffer;
+
+ GtpV2Stack* createGtpV2Stack();
+ MsgBuffer* createMsgBuffer(uint16_t size);
+
+ void* MsgBuffer_getDataPointer(MsgBuffer* buf_p);
+
+ uint16_t MsgBuffer_getBufLen(MsgBuffer* buf_p);
+
+ void MsgBuffer_reset(MsgBuffer* buf_p);
+
+ bool MsgBuffer_writeBytes(MsgBuffer* msgBuf_p, Uint8* data, Uint16 size, bool append);
+
+ void MsgBuffer_rewind(MsgBuffer* msgBuf_p);
+
+ void MsgBuffer_free(MsgBuffer* buf_p);
+
+ bool GtpV2Stack_decodeMessageHeader(GtpV2Stack* stack_p,
+ GtpV2MessageHeader* hdr_p,
+ MsgBuffer* msgBuf_p);
+
+ bool GtpV2Stack_decodeMessage(GtpV2Stack* stack_p,
+ GtpV2MessageHeader* msgHeader_p,
+ MsgBuffer* buffer_p,
+ void* data_p);
+
+ bool GtpV2Stack_buildGtpV2Message(GtpV2Stack* stack_p,
+ MsgBuffer* buf_p,
+ GtpV2MessageHeader* hdr_p,
+ void* data_p);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/src/gtpV2Codec/ieClasses/additionalProtocolConfigurationOptionsIe.cpp b/src/gtpV2Codec/ieClasses/additionalProtocolConfigurationOptionsIe.cpp
new file mode 100644
index 0000000..cd941db
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/additionalProtocolConfigurationOptionsIe.cpp
@@ -0,0 +1,78 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "additionalProtocolConfigurationOptionsIe.h"
+#include "dataTypeCodecUtils.h"
+
+AdditionalProtocolConfigurationOptionsIe::AdditionalProtocolConfigurationOptionsIe()
+{
+ ieType = 163;
+ // TODO
+
+}
+
+AdditionalProtocolConfigurationOptionsIe::~AdditionalProtocolConfigurationOptionsIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool AdditionalProtocolConfigurationOptionsIe::encodeAdditionalProtocolConfigurationOptionsIe(MsgBuffer &buffer, AdditionalProtocolConfigurationOptionsIeData const &data)
+{
+ if (!(DataTypeCodecUtils::encodeUint8Array16(buffer, data.apco)))
+ {
+ errorStream.add((char *)"Encoding of apco failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool AdditionalProtocolConfigurationOptionsIe::decodeAdditionalProtocolConfigurationOptionsIe(MsgBuffer &buffer, AdditionalProtocolConfigurationOptionsIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+
+ Uint16 lengthLeft = length;
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeUint8Array16(buffer, data.apco, lengthLeft, 0)))
+ {
+ errorStream.add((char *)"Failed to decode: apco\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE AdditionalProtocolConfigurationOptionsIe\n");
+ return false;
+ }
+}
+void AdditionalProtocolConfigurationOptionsIe::displayAdditionalProtocolConfigurationOptionsIe_v(AdditionalProtocolConfigurationOptionsIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"AdditionalProtocolConfigurationOptionsIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add((char *)"apco:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displayUint8Array16_v(data.apco, stream);
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/additionalProtocolConfigurationOptionsIe.h b/src/gtpV2Codec/ieClasses/additionalProtocolConfigurationOptionsIe.h
new file mode 100644
index 0000000..43e8ea1
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/additionalProtocolConfigurationOptionsIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef ADDITIONALPROTOCOLCONFIGURATIONOPTIONSIE_H_
+#define ADDITIONALPROTOCOLCONFIGURATIONOPTIONSIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class AdditionalProtocolConfigurationOptionsIe: public GtpV2Ie {
+public:
+ AdditionalProtocolConfigurationOptionsIe();
+ virtual ~AdditionalProtocolConfigurationOptionsIe();
+
+ bool encodeAdditionalProtocolConfigurationOptionsIe(MsgBuffer &buffer,
+ AdditionalProtocolConfigurationOptionsIeData const &data);
+ bool decodeAdditionalProtocolConfigurationOptionsIe(MsgBuffer &buffer,
+ AdditionalProtocolConfigurationOptionsIeData &data, Uint16 length);
+ void displayAdditionalProtocolConfigurationOptionsIe_v(AdditionalProtocolConfigurationOptionsIeData const &data,
+ Debug &stream);
+};
+
+#endif /* ADDITIONALPROTOCOLCONFIGURATIONOPTIONSIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/ambrIe.cpp b/src/gtpV2Codec/ieClasses/ambrIe.cpp
new file mode 100644
index 0000000..3ae5cd1
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/ambrIe.cpp
@@ -0,0 +1,93 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "ambrIe.h"
+#include "dataTypeCodecUtils.h"
+
+AmbrIe::AmbrIe()
+{
+ ieType = 72;
+ // TODO
+
+}
+
+AmbrIe::~AmbrIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool AmbrIe::encodeAmbrIe(MsgBuffer &buffer, AmbrIeData const &data)
+{
+ if (!(buffer.writeUint32(data.maxMbrUplink)))
+ {
+ errorStream.add((char *)"Encoding of maxMbrUplink failed\n");
+ return false;
+ }
+ if (!(buffer.writeUint32(data.maxMbrDownlink)))
+ {
+ errorStream.add((char *)"Encoding of maxMbrDownlink failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool AmbrIe::decodeAmbrIe(MsgBuffer &buffer, AmbrIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+
+ buffer.readUint32(data.maxMbrUplink);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: maxMbrUplink\n");
+ return false;
+ }
+
+ buffer.readUint32(data.maxMbrDownlink);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: maxMbrDownlink\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE AmbrIe\n");
+ return false;
+ }
+}
+void AmbrIe::displayAmbrIe_v(AmbrIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"AmbrIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add((char *)"maxMbrUplink: ");
+ stream.add(data.maxMbrUplink);
+ stream.endOfLine();
+
+ stream.add((char *)"maxMbrDownlink: ");
+ stream.add(data.maxMbrDownlink);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/ambrIe.h b/src/gtpV2Codec/ieClasses/ambrIe.h
new file mode 100644
index 0000000..0cd108b
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/ambrIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef AMBRIE_H_
+#define AMBRIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class AmbrIe: public GtpV2Ie {
+public:
+ AmbrIe();
+ virtual ~AmbrIe();
+
+ bool encodeAmbrIe(MsgBuffer &buffer,
+ AmbrIeData const &data);
+ bool decodeAmbrIe(MsgBuffer &buffer,
+ AmbrIeData &data, Uint16 length);
+ void displayAmbrIe_v(AmbrIeData const &data,
+ Debug &stream);
+};
+
+#endif /* AMBRIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/ambrMmbrIe.cpp b/src/gtpV2Codec/ieClasses/ambrMmbrIe.cpp
new file mode 100644
index 0000000..5deb43e
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/ambrMmbrIe.cpp
@@ -0,0 +1,93 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "ambrMmbrIe.h"
+#include "dataTypeCodecUtils.h"
+
+AmbrMmbrIe::AmbrMmbrIe()
+{
+ ieType = 161;
+ // TODO
+
+}
+
+AmbrMmbrIe::~AmbrMmbrIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool AmbrMmbrIe::encodeAmbrMmbrIe(MsgBuffer &buffer, AmbrMmbrIeData const &data)
+{
+ if (!(buffer.writeUint32(data.maxMbrUplink)))
+ {
+ errorStream.add((char *)"Encoding of maxMbrUplink failed\n");
+ return false;
+ }
+ if (!(buffer.writeUint32(data.maxMbrDownlink)))
+ {
+ errorStream.add((char *)"Encoding of maxMbrDownlink failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool AmbrMmbrIe::decodeAmbrMmbrIe(MsgBuffer &buffer, AmbrMmbrIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+
+ buffer.readUint32(data.maxMbrUplink);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: maxMbrUplink\n");
+ return false;
+ }
+
+ buffer.readUint32(data.maxMbrDownlink);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: maxMbrDownlink\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE AmbrMmbrIe\n");
+ return false;
+ }
+}
+void AmbrMmbrIe::displayAmbrMmbrIe_v(AmbrMmbrIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"AmbrMmbrIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add((char *)"maxMbrUplink: ");
+ stream.add(data.maxMbrUplink);
+ stream.endOfLine();
+
+ stream.add((char *)"maxMbrDownlink: ");
+ stream.add(data.maxMbrDownlink);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/ambrMmbrIe.h b/src/gtpV2Codec/ieClasses/ambrMmbrIe.h
new file mode 100644
index 0000000..41540b4
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/ambrMmbrIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef AMBRMMBRIE_H_
+#define AMBRMMBRIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class AmbrMmbrIe: public GtpV2Ie {
+public:
+ AmbrMmbrIe();
+ virtual ~AmbrMmbrIe();
+
+ bool encodeAmbrMmbrIe(MsgBuffer &buffer,
+ AmbrMmbrIeData const &data);
+ bool decodeAmbrMmbrIe(MsgBuffer &buffer,
+ AmbrMmbrIeData &data, Uint16 length);
+ void displayAmbrMmbrIe_v(AmbrMmbrIeData const &data,
+ Debug &stream);
+};
+
+#endif /* AMBRMMBRIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/apnAndRelativeCapacityIe.cpp b/src/gtpV2Codec/ieClasses/apnAndRelativeCapacityIe.cpp
new file mode 100644
index 0000000..fe6d129
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/apnAndRelativeCapacityIe.cpp
@@ -0,0 +1,120 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "apnAndRelativeCapacityIe.h"
+#include "dataTypeCodecUtils.h"
+
+ApnAndRelativeCapacityIe::ApnAndRelativeCapacityIe()
+{
+ ieType = 184;
+ // TODO
+
+}
+
+ApnAndRelativeCapacityIe::~ApnAndRelativeCapacityIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool ApnAndRelativeCapacityIe::encodeApnAndRelativeCapacityIe(MsgBuffer &buffer, ApnAndRelativeCapacityIeData const &data)
+{
+ if (!(data.relativeCapacity>= 1 && data.relativeCapacity<= 100))
+ {
+ errorStream.add((char *)"Data validation failure: relativeCapacity\n");
+ return false;
+ }
+ if (!(buffer.writeUint8(data.relativeCapacity)))
+ {
+ errorStream.add((char *)"Encoding of relativeCapacity failed\n");
+ return false;
+ }
+ if (!(buffer.writeUint8(data.apnLength)))
+ {
+ errorStream.add((char *)"Encoding of apnLength failed\n");
+ return false;
+ }
+ if (!(DataTypeCodecUtils::encodeUint8Array32(buffer, data.apn)))
+ {
+ errorStream.add((char *)"Encoding of apn failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool ApnAndRelativeCapacityIe::decodeApnAndRelativeCapacityIe(MsgBuffer &buffer, ApnAndRelativeCapacityIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+
+ buffer.readUint8(data.relativeCapacity);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: relativeCapacity\n");
+ return false;
+ }
+ if (!(data.relativeCapacity>= 1 && data.relativeCapacity<= 100))
+ {
+ errorStream.add((char *)"Data validation failure : relativeCapacity\n");
+ return false; //TODO need to add validations
+ }
+
+ buffer.readUint8(data.apnLength);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: apnLength\n");
+ return false;
+ }
+
+ Uint16 lengthLeft = length;
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeUint8Array32(buffer, data.apn, lengthLeft, 0)))
+ {
+ errorStream.add((char *)"Failed to decode: apn\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE ApnAndRelativeCapacityIe\n");
+ return false;
+ }
+}
+void ApnAndRelativeCapacityIe::displayApnAndRelativeCapacityIe_v(ApnAndRelativeCapacityIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"ApnAndRelativeCapacityIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add((char *)"relativeCapacity: ");
+ stream.add(data.relativeCapacity);
+ stream.endOfLine();
+
+ stream.add((char *)"apnLength: ");
+ stream.add(data.apnLength);
+ stream.endOfLine();
+
+ stream.add((char *)"apn:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displayUint8Array32_v(data.apn, stream);
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/apnAndRelativeCapacityIe.h b/src/gtpV2Codec/ieClasses/apnAndRelativeCapacityIe.h
new file mode 100644
index 0000000..5928d19
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/apnAndRelativeCapacityIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef APNANDRELATIVECAPACITYIE_H_
+#define APNANDRELATIVECAPACITYIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class ApnAndRelativeCapacityIe: public GtpV2Ie {
+public:
+ ApnAndRelativeCapacityIe();
+ virtual ~ApnAndRelativeCapacityIe();
+
+ bool encodeApnAndRelativeCapacityIe(MsgBuffer &buffer,
+ ApnAndRelativeCapacityIeData const &data);
+ bool decodeApnAndRelativeCapacityIe(MsgBuffer &buffer,
+ ApnAndRelativeCapacityIeData &data, Uint16 length);
+ void displayApnAndRelativeCapacityIe_v(ApnAndRelativeCapacityIeData const &data,
+ Debug &stream);
+};
+
+#endif /* APNANDRELATIVECAPACITYIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/apnIe.cpp b/src/gtpV2Codec/ieClasses/apnIe.cpp
new file mode 100644
index 0000000..243b9dc
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/apnIe.cpp
@@ -0,0 +1,78 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "apnIe.h"
+#include "dataTypeCodecUtils.h"
+
+ApnIe::ApnIe()
+{
+ ieType = 71;
+ // TODO
+
+}
+
+ApnIe::~ApnIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool ApnIe::encodeApnIe(MsgBuffer &buffer, ApnIeData const &data)
+{
+ if (!(DataTypeCodecUtils::encodeUint8Array32(buffer, data.apnValue)))
+ {
+ errorStream.add((char *)"Encoding of apnValue failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool ApnIe::decodeApnIe(MsgBuffer &buffer, ApnIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+
+ Uint16 lengthLeft = length;
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeUint8Array32(buffer, data.apnValue, lengthLeft, 0)))
+ {
+ errorStream.add((char *)"Failed to decode: apnValue\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE ApnIe\n");
+ return false;
+ }
+}
+void ApnIe::displayApnIe_v(ApnIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"ApnIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add((char *)"apnValue:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displayUint8Array32_v(data.apnValue, stream);
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/apnIe.h b/src/gtpV2Codec/ieClasses/apnIe.h
new file mode 100644
index 0000000..9237e48
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/apnIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef APNIE_H_
+#define APNIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class ApnIe: public GtpV2Ie {
+public:
+ ApnIe();
+ virtual ~ApnIe();
+
+ bool encodeApnIe(MsgBuffer &buffer,
+ ApnIeData const &data);
+ bool decodeApnIe(MsgBuffer &buffer,
+ ApnIeData &data, Uint16 length);
+ void displayApnIe_v(ApnIeData const &data,
+ Debug &stream);
+};
+
+#endif /* APNIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/apnRestrictionIe.cpp b/src/gtpV2Codec/ieClasses/apnRestrictionIe.cpp
new file mode 100644
index 0000000..d4b018c
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/apnRestrictionIe.cpp
@@ -0,0 +1,77 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "apnRestrictionIe.h"
+#include "dataTypeCodecUtils.h"
+
+ApnRestrictionIe::ApnRestrictionIe()
+{
+ ieType = 127;
+ // TODO
+
+}
+
+ApnRestrictionIe::~ApnRestrictionIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool ApnRestrictionIe::encodeApnRestrictionIe(MsgBuffer &buffer, ApnRestrictionIeData const &data)
+{
+ if (!(buffer.writeUint8(data.restrictionValue)))
+ {
+ errorStream.add((char *)"Encoding of restrictionValue failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool ApnRestrictionIe::decodeApnRestrictionIe(MsgBuffer &buffer, ApnRestrictionIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+
+ buffer.readUint8(data.restrictionValue);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: restrictionValue\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE ApnRestrictionIe\n");
+ return false;
+ }
+}
+void ApnRestrictionIe::displayApnRestrictionIe_v(ApnRestrictionIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"ApnRestrictionIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add((char *)"restrictionValue: ");
+ stream.add(data.restrictionValue);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/apnRestrictionIe.h b/src/gtpV2Codec/ieClasses/apnRestrictionIe.h
new file mode 100644
index 0000000..b8ae71b
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/apnRestrictionIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef APNRESTRICTIONIE_H_
+#define APNRESTRICTIONIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class ApnRestrictionIe: public GtpV2Ie {
+public:
+ ApnRestrictionIe();
+ virtual ~ApnRestrictionIe();
+
+ bool encodeApnRestrictionIe(MsgBuffer &buffer,
+ ApnRestrictionIeData const &data);
+ bool decodeApnRestrictionIe(MsgBuffer &buffer,
+ ApnRestrictionIeData &data, Uint16 length);
+ void displayApnRestrictionIe_v(ApnRestrictionIeData const &data,
+ Debug &stream);
+};
+
+#endif /* APNRESTRICTIONIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/arpIe.cpp b/src/gtpV2Codec/ieClasses/arpIe.cpp
new file mode 100644
index 0000000..3d307ef
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/arpIe.cpp
@@ -0,0 +1,127 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "arpIe.h"
+#include "dataTypeCodecUtils.h"
+
+ArpIe::ArpIe()
+{
+ ieType = 155;
+ // TODO
+
+}
+
+ArpIe::~ArpIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool ArpIe::encodeArpIe(MsgBuffer &buffer, ArpIeData const &data)
+{
+ buffer.skipBits(1);
+
+ if(!(buffer.writeBits(data.pci, 1)))
+ {
+ errorStream.add((char *)"Encoding of pci failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.pl, 4)))
+ {
+ errorStream.add((char *)"Encoding of pl failed\n");
+ return false;
+ }
+ buffer.skipBits(1);
+
+ if(!(buffer.writeBits(data.pvi, 1)))
+ {
+ errorStream.add((char *)"Encoding of pvi failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool ArpIe::decodeArpIe(MsgBuffer &buffer, ArpIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+ buffer.skipBits(1);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: \n");
+ return false;
+ }
+
+ data.pci = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: pci\n");
+ return false;
+ }
+ data.pl = buffer.readBits(4);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: pl\n");
+ return false;
+ }
+ buffer.skipBits(1);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: \n");
+ return false;
+ }
+
+ data.pvi = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: pvi\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE ArpIe\n");
+ return false;
+ }
+}
+void ArpIe::displayArpIe_v(ArpIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"ArpIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add( (char *)"pci: ");
+ stream.add((Uint8)data.pci);
+ stream.endOfLine();
+
+ stream.add( (char *)"pl: ");
+ stream.add((Uint8)data.pl);
+ stream.endOfLine();
+
+ stream.add( (char *)"pvi: ");
+ stream.add((Uint8)data.pvi);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/arpIe.h b/src/gtpV2Codec/ieClasses/arpIe.h
new file mode 100644
index 0000000..3cb200f
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/arpIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef ARPIE_H_
+#define ARPIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class ArpIe: public GtpV2Ie {
+public:
+ ArpIe();
+ virtual ~ArpIe();
+
+ bool encodeArpIe(MsgBuffer &buffer,
+ ArpIeData const &data);
+ bool decodeArpIe(MsgBuffer &buffer,
+ ArpIeData &data, Uint16 length);
+ void displayArpIe_v(ArpIeData const &data,
+ Debug &stream);
+};
+
+#endif /* ARPIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/bearerContextIe.cpp b/src/gtpV2Codec/ieClasses/bearerContextIe.cpp
new file mode 100644
index 0000000..8fd846d
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/bearerContextIe.cpp
@@ -0,0 +1,82 @@
+/*
+ * 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/grpietemplate.cpp.tt>
+ ******************************************************************************/
+#include "bearerContextIe.h"
+#include "gtpV2GrpIeDataTypes.h"
+#include "manual/gtpV2GroupedIe.h"
+
+#include "bearerContextsToBeModifiedInModifyBearerRequest.h"
+#include "bearerContextsToBeRemovedInModifyBearerRequest.h"
+#include "bearerContextsMarkedForRemovalInModifyBearerResponse.h"
+#include "bearerContextsModifiedInModifyBearerResponse.h"
+#include "bearerContextsToBeCreatedInCreateSessionRequest.h"
+#include "bearerContextsToBeRemovedInCreateSessionRequest.h"
+#include "bearerContextsCreatedInCreateSessionResponse.h"
+#include "bearerContextsMarkedForRemovalInCreateSessionResponse.h"
+#include "bearerContextsInCreateBearerRequest.h"
+#include "bearerContextsInCreateBearerResponse.h"
+#include "failedBearerContextsInDeleteBearerRequest.h"
+#include "bearerContextsInDeleteBearerResponse.h"
+
+BearerContextIe::BearerContextIe()
+{
+ ieType = BearerContextIeType;
+
+ BearerContextsToBeModifiedInModifyBearerRequest* bearerContextsToBeModifiedInModifyBearerRequest_p = new (BearerContextsToBeModifiedInModifyBearerRequest);
+ insertGroupedIeObject(ModifyBearerRequestMsgType, 0, bearerContextsToBeModifiedInModifyBearerRequest_p);
+ BearerContextsToBeRemovedInModifyBearerRequest* bearerContextsToBeRemovedInModifyBearerRequest_p = new (BearerContextsToBeRemovedInModifyBearerRequest);
+ insertGroupedIeObject(ModifyBearerRequestMsgType, 1, bearerContextsToBeRemovedInModifyBearerRequest_p);
+ BearerContextsMarkedForRemovalInModifyBearerResponse* bearerContextsMarkedForRemovalInModifyBearerResponse_p = new (BearerContextsMarkedForRemovalInModifyBearerResponse);
+ insertGroupedIeObject(ModifyBearerResponseMsgType, 1, bearerContextsMarkedForRemovalInModifyBearerResponse_p);
+ BearerContextsModifiedInModifyBearerResponse* bearerContextsModifiedInModifyBearerResponse_p = new (BearerContextsModifiedInModifyBearerResponse);
+ insertGroupedIeObject(ModifyBearerResponseMsgType, 0, bearerContextsModifiedInModifyBearerResponse_p);
+ BearerContextsToBeCreatedInCreateSessionRequest* bearerContextsToBeCreatedInCreateSessionRequest_p = new (BearerContextsToBeCreatedInCreateSessionRequest);
+ insertGroupedIeObject(CreateSessionRequestMsgType, 0, bearerContextsToBeCreatedInCreateSessionRequest_p);
+ BearerContextsToBeRemovedInCreateSessionRequest* bearerContextsToBeRemovedInCreateSessionRequest_p = new (BearerContextsToBeRemovedInCreateSessionRequest);
+ insertGroupedIeObject(CreateSessionRequestMsgType, 1, bearerContextsToBeRemovedInCreateSessionRequest_p);
+ BearerContextsCreatedInCreateSessionResponse* bearerContextsCreatedInCreateSessionResponse_p = new (BearerContextsCreatedInCreateSessionResponse);
+ insertGroupedIeObject(CreateSessionResponseMsgType, 0, bearerContextsCreatedInCreateSessionResponse_p);
+ BearerContextsMarkedForRemovalInCreateSessionResponse* bearerContextsMarkedForRemovalInCreateSessionResponse_p = new (BearerContextsMarkedForRemovalInCreateSessionResponse);
+ insertGroupedIeObject(CreateSessionResponseMsgType, 1, bearerContextsMarkedForRemovalInCreateSessionResponse_p);
+ BearerContextsInCreateBearerRequest* bearerContextsInCreateBearerRequest_p = new (BearerContextsInCreateBearerRequest);
+ insertGroupedIeObject(CreateBearerRequestMsgType, 0, bearerContextsInCreateBearerRequest_p);
+ BearerContextsInCreateBearerResponse* bearerContextsInCreateBearerResponse_p = new (BearerContextsInCreateBearerResponse);
+ insertGroupedIeObject(CreateBearerResponseMsgType, 0, bearerContextsInCreateBearerResponse_p);
+ FailedBearerContextsInDeleteBearerRequest* failedBearerContextsInDeleteBearerRequest_p = new (FailedBearerContextsInDeleteBearerRequest);
+ insertGroupedIeObject(DeleteBearerRequestMsgType, 0, failedBearerContextsInDeleteBearerRequest_p);
+ BearerContextsInDeleteBearerResponse* bearerContextsInDeleteBearerResponse_p = new (BearerContextsInDeleteBearerResponse);
+ insertGroupedIeObject(DeleteBearerResponseMsgType, 0, bearerContextsInDeleteBearerResponse_p);
+}
+
+BearerContextIe::~BearerContextIe() {
+// TODO Auto-generated destructor stub
+}
+
+GtpV2GroupedIe& BearerContextIe::getGroupedIe(Uint8 msgType, Uint8 instance)
+{
+ std::map<Uint16, GtpV2GroupedIe*>::iterator it;
+ Uint16 key = msgType;
+ key = (key << 8) + instance;
+ it = groupedIeObjectContainer.find(key);
+ return *(it->second);
+}
+
+void BearerContextIe::insertGroupedIeObject(Uint8 msgType, Uint8 instance, GtpV2GroupedIe* grpIe_p)
+{
+
+ Uint16 key = msgType;
+ key = (key << 8) + instance;
+
+ groupedIeObjectContainer.insert(std::pair<Uint16, GtpV2GroupedIe*>(key, grpIe_p));
+
+}
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/bearerContextIe.h b/src/gtpV2Codec/ieClasses/bearerContextIe.h
new file mode 100644
index 0000000..9e1b2b5
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/bearerContextIe.h
@@ -0,0 +1,44 @@
+/*
+ * 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/grpietemplate.h.tt>
+ ******************************************************************************/
+#ifndef BEARERCONTEXTIE_H_
+#define BEARERCONTEXTIE_H_
+
+#include <map>
+#include "manual/gtpV2Ie.h"
+#include "manual/gtpV2GroupedIe.h"
+#include "gtpV2DataTypes.h"
+
+class BearerContextIe:public GtpV2Ie
+{
+public:
+ BearerContextIe ();
+ virtual ~ BearerContextIe ();
+
+ GtpV2GroupedIe & getGroupedIe (Uint8 msgType, Uint8 instance);
+ void insertGroupedIeObject (Uint8 msgType, Uint8 instance,
+ GtpV2GroupedIe * grpIe_p);
+
+private:
+ map < Uint16, GtpV2GroupedIe * >groupedIeObjectContainer; // map[msgType || instance]
+};
+
+#endif
diff --git a/src/gtpV2Codec/ieClasses/bearerContextsCreatedInCreateSessionResponse.cpp b/src/gtpV2Codec/ieClasses/bearerContextsCreatedInCreateSessionResponse.cpp
new file mode 100644
index 0000000..13e056e
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/bearerContextsCreatedInCreateSessionResponse.cpp
@@ -0,0 +1,852 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "bearerContextsCreatedInCreateSessionResponse.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "ebiIe.h"
+#include "causeIe.h"
+#include "fTeidIe.h"
+#include "fTeidIe.h"
+#include "fTeidIe.h"
+#include "fTeidIe.h"
+#include "fTeidIe.h"
+#include "fTeidIe.h"
+#include "bearerQosIe.h"
+#include "chargingIdIe.h"
+#include "bearerFlagsIe.h"
+#include "fTeidIe.h"
+
+BearerContextsCreatedInCreateSessionResponse::
+BearerContextsCreatedInCreateSessionResponse()
+{
+ Uint16 mandIe;
+ mandIe = EbiIeType;
+ mandIe = (mandIe << 8) | 0; // epsBearerId
+ mandatoryIeSet.insert(mandIe);
+ mandIe = CauseIeType;
+ mandIe = (mandIe << 8) | 0; // cause
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+BearerContextsCreatedInCreateSessionResponse::
+~BearerContextsCreatedInCreateSessionResponse()
+{
+
+}
+bool BearerContextsCreatedInCreateSessionResponse::
+encodeBearerContextsCreatedInCreateSessionResponse(MsgBuffer &buffer,
+ BearerContextsCreatedInCreateSessionResponseData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // 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;
+ }
+
+
+
+ // 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.s1USgwFTeidIePresent)
+ {
+
+ // 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.s1USgwFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: s1USgwFTeid\n");
+ return false;
+ }
+ }
+
+ if (data.s4USgwFTeidIePresent)
+ {
+
+ // 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.s4USgwFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: s4USgwFTeid\n");
+ return false;
+ }
+ }
+
+ if (data.s5S8UPgwFTeidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FTeidIeType;
+ header.instance = 2;
+ 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.s5S8UPgwFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: s5S8UPgwFTeid\n");
+ return false;
+ }
+ }
+
+ if (data.s12SgwFTeidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FTeidIeType;
+ header.instance = 3;
+ 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.s12SgwFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: s12SgwFTeid\n");
+ return false;
+ }
+ }
+
+ if (data.s2bUPgwFTeidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FTeidIeType;
+ header.instance = 4;
+ 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.s2bUPgwFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: s2bUPgwFTeid\n");
+ return false;
+ }
+ }
+
+ if (data.s2aUPgwFTeidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FTeidIeType;
+ header.instance = 5;
+ 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.s2aUPgwFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: s2aUPgwFTeid\n");
+ return false;
+ }
+ }
+
+ if (data.bearerLevelQosIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = BearerQosIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ BearerQosIe bearerQos=
+ dynamic_cast<
+ BearerQosIe&>(GtpV2IeFactory::getInstance().getIeObject(BearerQosIeType));
+ rc = bearerQos.encodeBearerQosIe(buffer, data.bearerLevelQos);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: bearerLevelQos\n");
+ return false;
+ }
+ }
+
+ if (data.chargingIdIePresent)
+ {
+
+ // 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.chargingId);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: chargingId\n");
+ return false;
+ }
+ }
+
+ if (data.bearerFlagsIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = BearerFlagsIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ BearerFlagsIe bearerFlags=
+ dynamic_cast<
+ BearerFlagsIe&>(GtpV2IeFactory::getInstance().getIeObject(BearerFlagsIeType));
+ rc = bearerFlags.encodeBearerFlagsIe(buffer, data.bearerFlags);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: bearerFlags\n");
+ return false;
+ }
+ }
+
+ if (data.s11USgwFTeidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FTeidIeType;
+ header.instance = 6;
+ 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.s11USgwFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: s11USgwFTeid\n");
+ return false;
+ }
+ }
+ return rc;
+}
+
+bool BearerContextsCreatedInCreateSessionResponse::
+decodeBearerContextsCreatedInCreateSessionResponse(MsgBuffer &buffer,
+ BearerContextsCreatedInCreateSessionResponseData
+ &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.epsBearerId, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: epsBearerId\n");
+ return false;
+ }
+ Uint16 mandIe = EbiIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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;
+ }
+ Uint16 mandIe = CauseIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.s1USgwFTeid, ieHeader.length);
+
+ data.s1USgwFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: s1USgwFTeid\n");
+ return false;
+ }
+ }
+
+ else if(ieHeader.instance == 1)
+ {
+
+ rc = ieObject.decodeFTeidIe(buffer, data.s4USgwFTeid, ieHeader.length);
+
+ data.s4USgwFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: s4USgwFTeid\n");
+ return false;
+ }
+ }
+
+ else if(ieHeader.instance == 2)
+ {
+
+ rc = ieObject.decodeFTeidIe(buffer, data.s5S8UPgwFTeid, ieHeader.length);
+
+ data.s5S8UPgwFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: s5S8UPgwFTeid\n");
+ return false;
+ }
+ }
+
+ else if(ieHeader.instance == 3)
+ {
+
+ rc = ieObject.decodeFTeidIe(buffer, data.s12SgwFTeid, ieHeader.length);
+
+ data.s12SgwFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: s12SgwFTeid\n");
+ return false;
+ }
+ }
+
+ else if(ieHeader.instance == 4)
+ {
+
+ rc = ieObject.decodeFTeidIe(buffer, data.s2bUPgwFTeid, ieHeader.length);
+
+ data.s2bUPgwFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: s2bUPgwFTeid\n");
+ return false;
+ }
+ }
+
+ else if(ieHeader.instance == 5)
+ {
+
+ rc = ieObject.decodeFTeidIe(buffer, data.s2aUPgwFTeid, ieHeader.length);
+
+ data.s2aUPgwFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: s2aUPgwFTeid\n");
+ return false;
+ }
+ }
+
+ else if(ieHeader.instance == 6)
+ {
+
+ rc = ieObject.decodeFTeidIe(buffer, data.s11USgwFTeid, ieHeader.length);
+
+ data.s11USgwFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: s11USgwFTeid\n");
+ return false;
+ }
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case BearerQosIeType:
+ {
+ BearerQosIe ieObject =
+ dynamic_cast<
+ BearerQosIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(BearerQosIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeBearerQosIe(buffer, data.bearerLevelQos, ieHeader.length);
+
+ data.bearerLevelQosIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: bearerLevelQos\n");
+ return false;
+ }
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.chargingId, ieHeader.length);
+
+ data.chargingIdIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: chargingId\n");
+ return false;
+ }
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case BearerFlagsIeType:
+ {
+ BearerFlagsIe ieObject =
+ dynamic_cast<
+ BearerFlagsIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(BearerFlagsIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeBearerFlagsIe(buffer, data.bearerFlags, ieHeader.length);
+
+ data.bearerFlagsIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: bearerFlags\n");
+ return false;
+ }
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void BearerContextsCreatedInCreateSessionResponse::
+displayBearerContextsCreatedInCreateSessionResponseData_v
+(BearerContextsCreatedInCreateSessionResponseData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"BearerContextsCreatedInCreateSessionResponse:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+ if (data.s1USgwFTeidIePresent)
+ {
+
+ stream.add((char *)"s1USgwFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.s1USgwFTeid, stream);
+
+ }
+
+ if (data.s4USgwFTeidIePresent)
+ {
+
+ stream.add((char *)"s4USgwFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.s4USgwFTeid, stream);
+
+ }
+
+ if (data.s5S8UPgwFTeidIePresent)
+ {
+
+ stream.add((char *)"s5S8UPgwFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.s5S8UPgwFTeid, stream);
+
+ }
+
+ if (data.s12SgwFTeidIePresent)
+ {
+
+ stream.add((char *)"s12SgwFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.s12SgwFTeid, stream);
+
+ }
+
+ if (data.s2bUPgwFTeidIePresent)
+ {
+
+ stream.add((char *)"s2bUPgwFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.s2bUPgwFTeid, stream);
+
+ }
+
+ if (data.s2aUPgwFTeidIePresent)
+ {
+
+ stream.add((char *)"s2aUPgwFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.s2aUPgwFTeid, stream);
+
+ }
+
+ if (data.bearerLevelQosIePresent)
+ {
+
+ stream.add((char *)"bearerLevelQos:");
+ stream.endOfLine();
+ BearerQosIe bearerQos=
+ dynamic_cast<
+ BearerQosIe&>(GtpV2IeFactory::getInstance().getIeObject(BearerQosIeType));
+ bearerQos.displayBearerQosIe_v(data.bearerLevelQos, stream);
+
+ }
+
+ if (data.chargingIdIePresent)
+ {
+
+ stream.add((char *)"chargingId:");
+ stream.endOfLine();
+ ChargingIdIe chargingId=
+ dynamic_cast<
+ ChargingIdIe&>(GtpV2IeFactory::getInstance().getIeObject(ChargingIdIeType));
+ chargingId.displayChargingIdIe_v(data.chargingId, stream);
+
+ }
+
+ if (data.bearerFlagsIePresent)
+ {
+
+ stream.add((char *)"bearerFlags:");
+ stream.endOfLine();
+ BearerFlagsIe bearerFlags=
+ dynamic_cast<
+ BearerFlagsIe&>(GtpV2IeFactory::getInstance().getIeObject(BearerFlagsIeType));
+ bearerFlags.displayBearerFlagsIe_v(data.bearerFlags, stream);
+
+ }
+
+ if (data.s11USgwFTeidIePresent)
+ {
+
+ stream.add((char *)"s11USgwFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.s11USgwFTeid, stream);
+
+ }
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/bearerContextsCreatedInCreateSessionResponse.h b/src/gtpV2Codec/ieClasses/bearerContextsCreatedInCreateSessionResponse.h
new file mode 100644
index 0000000..74c0ab2
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/bearerContextsCreatedInCreateSessionResponse.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef BEARERCONTEXTSCREATEDINCREATESESSIONRESPONSE_H_
+#define BEARERCONTEXTSCREATEDINCREATESESSIONRESPONSE_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class BearerContextsCreatedInCreateSessionResponse:public GtpV2GroupedIe
+{
+public:
+ BearerContextsCreatedInCreateSessionResponse();
+ virtual ~BearerContextsCreatedInCreateSessionResponse();
+ bool encodeBearerContextsCreatedInCreateSessionResponse(MsgBuffer &buffer,
+ BearerContextsCreatedInCreateSessionResponseData
+ const &data);
+
+ bool decodeBearerContextsCreatedInCreateSessionResponse (MsgBuffer &buffer,
+ BearerContextsCreatedInCreateSessionResponseData
+ & data, Uint16 length);
+
+ void displayBearerContextsCreatedInCreateSessionResponseData_v
+ (BearerContextsCreatedInCreateSessionResponseData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/bearerContextsInCreateBearerRequest.cpp b/src/gtpV2Codec/ieClasses/bearerContextsInCreateBearerRequest.cpp
new file mode 100644
index 0000000..c87ec60
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/bearerContextsInCreateBearerRequest.cpp
@@ -0,0 +1,1002 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "bearerContextsInCreateBearerRequest.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "ebiIe.h"
+#include "bearerTftIe.h"
+#include "fTeidIe.h"
+#include "fTeidIe.h"
+#include "fTeidIe.h"
+#include "fTeidIe.h"
+#include "fTeidIe.h"
+#include "fTeidIe.h"
+#include "bearerQosIe.h"
+#include "chargingIdIe.h"
+#include "bearerFlagsIe.h"
+#include "pcoIe.h"
+#include "epcoIe.h"
+#include "maximumPacketLossRateIe.h"
+
+BearerContextsInCreateBearerRequest::
+BearerContextsInCreateBearerRequest()
+{
+ Uint16 mandIe;
+ mandIe = EbiIeType;
+ mandIe = (mandIe << 8) | 0; // epsBearerId
+ mandatoryIeSet.insert(mandIe);
+ mandIe = BearerTftIeType;
+ mandIe = (mandIe << 8) | 0; // tft
+ mandatoryIeSet.insert(mandIe);
+ mandIe = BearerQosIeType;
+ mandIe = (mandIe << 8) | 0; // bearerLevelQos
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+BearerContextsInCreateBearerRequest::
+~BearerContextsInCreateBearerRequest()
+{
+
+}
+bool BearerContextsInCreateBearerRequest::
+encodeBearerContextsInCreateBearerRequest(MsgBuffer &buffer,
+ BearerContextsInCreateBearerRequestData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // 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;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = BearerTftIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ BearerTftIe bearerTft=
+ dynamic_cast<
+ BearerTftIe&>(GtpV2IeFactory::getInstance().getIeObject(BearerTftIeType));
+ rc = bearerTft.encodeBearerTftIe(buffer, data.tft);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: tft\n");
+ return false;
+ }
+
+ if (data.s1USgwFTeidIePresent)
+ {
+
+ // 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.s1USgwFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: s1USgwFTeid\n");
+ return false;
+ }
+ }
+
+ if (data.s58UPgwFTeidIePresent)
+ {
+
+ // 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.s58UPgwFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: s58UPgwFTeid\n");
+ return false;
+ }
+ }
+
+ if (data.s12SgwFTeidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FTeidIeType;
+ header.instance = 2;
+ 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.s12SgwFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: s12SgwFTeid\n");
+ return false;
+ }
+ }
+
+ if (data.s4USgwFTeidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FTeidIeType;
+ header.instance = 3;
+ 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.s4USgwFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: s4USgwFTeid\n");
+ return false;
+ }
+ }
+
+ if (data.s2bUPgwFTeidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FTeidIeType;
+ header.instance = 4;
+ 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.s2bUPgwFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: s2bUPgwFTeid\n");
+ return false;
+ }
+ }
+
+ if (data.s2aUPgwFTeidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FTeidIeType;
+ header.instance = 5;
+ 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.s2aUPgwFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: s2aUPgwFTeid\n");
+ return false;
+ }
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = BearerQosIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ BearerQosIe bearerQos=
+ dynamic_cast<
+ BearerQosIe&>(GtpV2IeFactory::getInstance().getIeObject(BearerQosIeType));
+ rc = bearerQos.encodeBearerQosIe(buffer, data.bearerLevelQos);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: bearerLevelQos\n");
+ return false;
+ }
+
+ if (data.chargingIdIePresent)
+ {
+
+ // 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.chargingId);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: chargingId\n");
+ return false;
+ }
+ }
+
+ if (data.bearerFlagsIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = BearerFlagsIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ BearerFlagsIe bearerFlags=
+ dynamic_cast<
+ BearerFlagsIe&>(GtpV2IeFactory::getInstance().getIeObject(BearerFlagsIeType));
+ rc = bearerFlags.encodeBearerFlagsIe(buffer, data.bearerFlags);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: bearerFlags\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.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.maximumPacketLossRateIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = MaximumPacketLossRateIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MaximumPacketLossRateIe maximumPacketLossRate=
+ dynamic_cast<
+ MaximumPacketLossRateIe&>(GtpV2IeFactory::getInstance().getIeObject(MaximumPacketLossRateIeType));
+ rc = maximumPacketLossRate.encodeMaximumPacketLossRateIe(buffer, data.maximumPacketLossRate);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: maximumPacketLossRate\n");
+ return false;
+ }
+ }
+ return rc;
+}
+
+bool BearerContextsInCreateBearerRequest::
+decodeBearerContextsInCreateBearerRequest(MsgBuffer &buffer,
+ BearerContextsInCreateBearerRequestData
+ &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.epsBearerId, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: epsBearerId\n");
+ return false;
+ }
+ Uint16 mandIe = EbiIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case BearerTftIeType:
+ {
+ BearerTftIe ieObject =
+ dynamic_cast<
+ BearerTftIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(BearerTftIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeBearerTftIe(buffer, data.tft, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: tft\n");
+ return false;
+ }
+ Uint16 mandIe = BearerTftIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.s1USgwFTeid, ieHeader.length);
+
+ data.s1USgwFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: s1USgwFTeid\n");
+ return false;
+ }
+ }
+
+ else if(ieHeader.instance == 1)
+ {
+
+ rc = ieObject.decodeFTeidIe(buffer, data.s58UPgwFTeid, ieHeader.length);
+
+ data.s58UPgwFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: s58UPgwFTeid\n");
+ return false;
+ }
+ }
+
+ else if(ieHeader.instance == 2)
+ {
+
+ rc = ieObject.decodeFTeidIe(buffer, data.s12SgwFTeid, ieHeader.length);
+
+ data.s12SgwFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: s12SgwFTeid\n");
+ return false;
+ }
+ }
+
+ else if(ieHeader.instance == 3)
+ {
+
+ rc = ieObject.decodeFTeidIe(buffer, data.s4USgwFTeid, ieHeader.length);
+
+ data.s4USgwFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: s4USgwFTeid\n");
+ return false;
+ }
+ }
+
+ else if(ieHeader.instance == 4)
+ {
+
+ rc = ieObject.decodeFTeidIe(buffer, data.s2bUPgwFTeid, ieHeader.length);
+
+ data.s2bUPgwFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: s2bUPgwFTeid\n");
+ return false;
+ }
+ }
+
+ else if(ieHeader.instance == 5)
+ {
+
+ rc = ieObject.decodeFTeidIe(buffer, data.s2aUPgwFTeid, ieHeader.length);
+
+ data.s2aUPgwFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: s2aUPgwFTeid\n");
+ return false;
+ }
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case BearerQosIeType:
+ {
+ BearerQosIe ieObject =
+ dynamic_cast<
+ BearerQosIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(BearerQosIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeBearerQosIe(buffer, data.bearerLevelQos, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: bearerLevelQos\n");
+ return false;
+ }
+ Uint16 mandIe = BearerQosIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.chargingId, ieHeader.length);
+
+ data.chargingIdIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: chargingId\n");
+ return false;
+ }
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case BearerFlagsIeType:
+ {
+ BearerFlagsIe ieObject =
+ dynamic_cast<
+ BearerFlagsIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(BearerFlagsIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeBearerFlagsIe(buffer, data.bearerFlags, ieHeader.length);
+
+ data.bearerFlagsIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: bearerFlags\n");
+ return false;
+ }
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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 TODO
+ 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 TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MaximumPacketLossRateIeType:
+ {
+ MaximumPacketLossRateIe ieObject =
+ dynamic_cast<
+ MaximumPacketLossRateIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MaximumPacketLossRateIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMaximumPacketLossRateIe(buffer, data.maximumPacketLossRate, ieHeader.length);
+
+ data.maximumPacketLossRateIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: maximumPacketLossRate\n");
+ return false;
+ }
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void BearerContextsInCreateBearerRequest::
+displayBearerContextsInCreateBearerRequestData_v
+(BearerContextsInCreateBearerRequestData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"BearerContextsInCreateBearerRequest:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+ if (data.s1USgwFTeidIePresent)
+ {
+
+ stream.add((char *)"s1USgwFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.s1USgwFTeid, stream);
+
+ }
+
+ if (data.s58UPgwFTeidIePresent)
+ {
+
+ stream.add((char *)"s58UPgwFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.s58UPgwFTeid, stream);
+
+ }
+
+ if (data.s12SgwFTeidIePresent)
+ {
+
+ stream.add((char *)"s12SgwFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.s12SgwFTeid, stream);
+
+ }
+
+ if (data.s4USgwFTeidIePresent)
+ {
+
+ stream.add((char *)"s4USgwFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.s4USgwFTeid, stream);
+
+ }
+
+ if (data.s2bUPgwFTeidIePresent)
+ {
+
+ stream.add((char *)"s2bUPgwFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.s2bUPgwFTeid, stream);
+
+ }
+
+ if (data.s2aUPgwFTeidIePresent)
+ {
+
+ stream.add((char *)"s2aUPgwFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.s2aUPgwFTeid, stream);
+
+ }
+
+
+ if (data.chargingIdIePresent)
+ {
+
+ stream.add((char *)"chargingId:");
+ stream.endOfLine();
+ ChargingIdIe chargingId=
+ dynamic_cast<
+ ChargingIdIe&>(GtpV2IeFactory::getInstance().getIeObject(ChargingIdIeType));
+ chargingId.displayChargingIdIe_v(data.chargingId, stream);
+
+ }
+
+ if (data.bearerFlagsIePresent)
+ {
+
+ stream.add((char *)"bearerFlags:");
+ stream.endOfLine();
+ BearerFlagsIe bearerFlags=
+ dynamic_cast<
+ BearerFlagsIe&>(GtpV2IeFactory::getInstance().getIeObject(BearerFlagsIeType));
+ bearerFlags.displayBearerFlagsIe_v(data.bearerFlags, stream);
+
+ }
+
+ if (data.protocolConfigurationOptionsIePresent)
+ {
+
+ stream.add((char *)"protocolConfigurationOptions:");
+ stream.endOfLine();
+ PcoIe pco=
+ dynamic_cast<
+ PcoIe&>(GtpV2IeFactory::getInstance().getIeObject(PcoIeType));
+ pco.displayPcoIe_v(data.protocolConfigurationOptions, stream);
+
+ }
+
+ if (data.extendedProtocolConfigurationOptionsIePresent)
+ {
+
+ stream.add((char *)"extendedProtocolConfigurationOptions:");
+ stream.endOfLine();
+ EpcoIe epco=
+ dynamic_cast<
+ EpcoIe&>(GtpV2IeFactory::getInstance().getIeObject(EpcoIeType));
+ epco.displayEpcoIe_v(data.extendedProtocolConfigurationOptions, stream);
+
+ }
+
+ if (data.maximumPacketLossRateIePresent)
+ {
+
+ stream.add((char *)"maximumPacketLossRate:");
+ stream.endOfLine();
+ MaximumPacketLossRateIe maximumPacketLossRate=
+ dynamic_cast<
+ MaximumPacketLossRateIe&>(GtpV2IeFactory::getInstance().getIeObject(MaximumPacketLossRateIeType));
+ maximumPacketLossRate.displayMaximumPacketLossRateIe_v(data.maximumPacketLossRate, stream);
+
+ }
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/bearerContextsInCreateBearerRequest.h b/src/gtpV2Codec/ieClasses/bearerContextsInCreateBearerRequest.h
new file mode 100644
index 0000000..c38ef45
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/bearerContextsInCreateBearerRequest.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef BEARERCONTEXTSINCREATEBEARERREQUEST_H_
+#define BEARERCONTEXTSINCREATEBEARERREQUEST_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class BearerContextsInCreateBearerRequest:public GtpV2GroupedIe
+{
+public:
+ BearerContextsInCreateBearerRequest();
+ virtual ~BearerContextsInCreateBearerRequest();
+ bool encodeBearerContextsInCreateBearerRequest(MsgBuffer &buffer,
+ BearerContextsInCreateBearerRequestData
+ const &data);
+
+ bool decodeBearerContextsInCreateBearerRequest (MsgBuffer &buffer,
+ BearerContextsInCreateBearerRequestData
+ & data, Uint16 length);
+
+ void displayBearerContextsInCreateBearerRequestData_v
+ (BearerContextsInCreateBearerRequestData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/bearerContextsInCreateBearerResponse.cpp b/src/gtpV2Codec/ieClasses/bearerContextsInCreateBearerResponse.cpp
new file mode 100644
index 0000000..0c897e9
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/bearerContextsInCreateBearerResponse.cpp
@@ -0,0 +1,1122 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "bearerContextsInCreateBearerResponse.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "ebiIe.h"
+#include "causeIe.h"
+#include "fTeidIe.h"
+#include "fTeidIe.h"
+#include "fTeidIe.h"
+#include "fTeidIe.h"
+#include "fTeidIe.h"
+#include "fTeidIe.h"
+#include "fTeidIe.h"
+#include "fTeidIe.h"
+#include "fTeidIe.h"
+#include "fTeidIe.h"
+#include "fTeidIe.h"
+#include "fTeidIe.h"
+#include "pcoIe.h"
+#include "ranNasCauseIe.h"
+#include "epcoIe.h"
+
+BearerContextsInCreateBearerResponse::
+BearerContextsInCreateBearerResponse()
+{
+ Uint16 mandIe;
+ mandIe = EbiIeType;
+ mandIe = (mandIe << 8) | 0; // epsBearerId
+ mandatoryIeSet.insert(mandIe);
+ mandIe = CauseIeType;
+ mandIe = (mandIe << 8) | 0; // cause
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+BearerContextsInCreateBearerResponse::
+~BearerContextsInCreateBearerResponse()
+{
+
+}
+bool BearerContextsInCreateBearerResponse::
+encodeBearerContextsInCreateBearerResponse(MsgBuffer &buffer,
+ BearerContextsInCreateBearerResponseData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // 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;
+ }
+
+
+
+ // 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.s1UEnodebFTeidIePresent)
+ {
+
+ // 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.s1UEnodebFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: s1UEnodebFTeid\n");
+ return false;
+ }
+ }
+
+ if (data.s1USgwFTeidIePresent)
+ {
+
+ // 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.s1USgwFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: s1USgwFTeid\n");
+ return false;
+ }
+ }
+
+ if (data.s58USgwFTeidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FTeidIeType;
+ header.instance = 2;
+ 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.s58USgwFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: s58USgwFTeid\n");
+ return false;
+ }
+ }
+
+ if (data.s58UPgwFTeidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FTeidIeType;
+ header.instance = 3;
+ 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.s58UPgwFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: s58UPgwFTeid\n");
+ return false;
+ }
+ }
+
+ if (data.s12RncFTeidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FTeidIeType;
+ header.instance = 4;
+ 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.s12RncFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: s12RncFTeid\n");
+ return false;
+ }
+ }
+
+ if (data.s12SgwFTeidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FTeidIeType;
+ header.instance = 5;
+ 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.s12SgwFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: s12SgwFTeid\n");
+ return false;
+ }
+ }
+
+ if (data.s4USgsnFTeidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FTeidIeType;
+ header.instance = 6;
+ 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.s4USgsnFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: s4USgsnFTeid\n");
+ return false;
+ }
+ }
+
+ if (data.s4USgwFTeidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FTeidIeType;
+ header.instance = 7;
+ 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.s4USgwFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: s4USgwFTeid\n");
+ return false;
+ }
+ }
+
+ if (data.s2bUEpdgFTeidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FTeidIeType;
+ header.instance = 8;
+ 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.s2bUEpdgFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: s2bUEpdgFTeid\n");
+ return false;
+ }
+ }
+
+ if (data.s2bUPgwFTeidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FTeidIeType;
+ header.instance = 9;
+ 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.s2bUPgwFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: s2bUPgwFTeid\n");
+ return false;
+ }
+ }
+
+ if (data.s2aUTwanFTeidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FTeidIeType;
+ header.instance = 10;
+ 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.s2aUTwanFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: s2aUTwanFTeid\n");
+ return false;
+ }
+ }
+
+ if (data.s2aUPgwFTeidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FTeidIeType;
+ header.instance = 11;
+ 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.s2aUPgwFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: s2aUPgwFTeid\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.ranNasCauseIePresent)
+ {
+
+ // 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.ranNasCause);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: ranNasCause\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 BearerContextsInCreateBearerResponse::
+decodeBearerContextsInCreateBearerResponse(MsgBuffer &buffer,
+ BearerContextsInCreateBearerResponseData
+ &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.epsBearerId, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: epsBearerId\n");
+ return false;
+ }
+ Uint16 mandIe = EbiIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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;
+ }
+ Uint16 mandIe = CauseIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.s1UEnodebFTeid, ieHeader.length);
+
+ data.s1UEnodebFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: s1UEnodebFTeid\n");
+ return false;
+ }
+ }
+
+ else if(ieHeader.instance == 1)
+ {
+
+ rc = ieObject.decodeFTeidIe(buffer, data.s1USgwFTeid, ieHeader.length);
+
+ data.s1USgwFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: s1USgwFTeid\n");
+ return false;
+ }
+ }
+
+ else if(ieHeader.instance == 2)
+ {
+
+ rc = ieObject.decodeFTeidIe(buffer, data.s58USgwFTeid, ieHeader.length);
+
+ data.s58USgwFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: s58USgwFTeid\n");
+ return false;
+ }
+ }
+
+ else if(ieHeader.instance == 3)
+ {
+
+ rc = ieObject.decodeFTeidIe(buffer, data.s58UPgwFTeid, ieHeader.length);
+
+ data.s58UPgwFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: s58UPgwFTeid\n");
+ return false;
+ }
+ }
+
+ else if(ieHeader.instance == 4)
+ {
+
+ rc = ieObject.decodeFTeidIe(buffer, data.s12RncFTeid, ieHeader.length);
+
+ data.s12RncFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: s12RncFTeid\n");
+ return false;
+ }
+ }
+
+ else if(ieHeader.instance == 5)
+ {
+
+ rc = ieObject.decodeFTeidIe(buffer, data.s12SgwFTeid, ieHeader.length);
+
+ data.s12SgwFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: s12SgwFTeid\n");
+ return false;
+ }
+ }
+
+ else if(ieHeader.instance == 6)
+ {
+
+ rc = ieObject.decodeFTeidIe(buffer, data.s4USgsnFTeid, ieHeader.length);
+
+ data.s4USgsnFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: s4USgsnFTeid\n");
+ return false;
+ }
+ }
+
+ else if(ieHeader.instance == 7)
+ {
+
+ rc = ieObject.decodeFTeidIe(buffer, data.s4USgwFTeid, ieHeader.length);
+
+ data.s4USgwFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: s4USgwFTeid\n");
+ return false;
+ }
+ }
+
+ else if(ieHeader.instance == 8)
+ {
+
+ rc = ieObject.decodeFTeidIe(buffer, data.s2bUEpdgFTeid, ieHeader.length);
+
+ data.s2bUEpdgFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: s2bUEpdgFTeid\n");
+ return false;
+ }
+ }
+
+ else if(ieHeader.instance == 9)
+ {
+
+ rc = ieObject.decodeFTeidIe(buffer, data.s2bUPgwFTeid, ieHeader.length);
+
+ data.s2bUPgwFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: s2bUPgwFTeid\n");
+ return false;
+ }
+ }
+
+ else if(ieHeader.instance == 10)
+ {
+
+ rc = ieObject.decodeFTeidIe(buffer, data.s2aUTwanFTeid, ieHeader.length);
+
+ data.s2aUTwanFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: s2aUTwanFTeid\n");
+ return false;
+ }
+ }
+
+ else if(ieHeader.instance == 11)
+ {
+
+ rc = ieObject.decodeFTeidIe(buffer, data.s2aUPgwFTeid, ieHeader.length);
+
+ data.s2aUPgwFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: s2aUPgwFTeid\n");
+ return false;
+ }
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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 TODO
+ 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.ranNasCause, ieHeader.length);
+
+ data.ranNasCauseIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: ranNasCause\n");
+ return false;
+ }
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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 TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void BearerContextsInCreateBearerResponse::
+displayBearerContextsInCreateBearerResponseData_v
+(BearerContextsInCreateBearerResponseData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"BearerContextsInCreateBearerResponse:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+ if (data.s1UEnodebFTeidIePresent)
+ {
+
+ stream.add((char *)"s1UEnodebFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.s1UEnodebFTeid, stream);
+
+ }
+
+ if (data.s1USgwFTeidIePresent)
+ {
+
+ stream.add((char *)"s1USgwFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.s1USgwFTeid, stream);
+
+ }
+
+ if (data.s58USgwFTeidIePresent)
+ {
+
+ stream.add((char *)"s58USgwFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.s58USgwFTeid, stream);
+
+ }
+
+ if (data.s58UPgwFTeidIePresent)
+ {
+
+ stream.add((char *)"s58UPgwFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.s58UPgwFTeid, stream);
+
+ }
+
+ if (data.s12RncFTeidIePresent)
+ {
+
+ stream.add((char *)"s12RncFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.s12RncFTeid, stream);
+
+ }
+
+ if (data.s12SgwFTeidIePresent)
+ {
+
+ stream.add((char *)"s12SgwFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.s12SgwFTeid, stream);
+
+ }
+
+ if (data.s4USgsnFTeidIePresent)
+ {
+
+ stream.add((char *)"s4USgsnFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.s4USgsnFTeid, stream);
+
+ }
+
+ if (data.s4USgwFTeidIePresent)
+ {
+
+ stream.add((char *)"s4USgwFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.s4USgwFTeid, stream);
+
+ }
+
+ if (data.s2bUEpdgFTeidIePresent)
+ {
+
+ stream.add((char *)"s2bUEpdgFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.s2bUEpdgFTeid, stream);
+
+ }
+
+ if (data.s2bUPgwFTeidIePresent)
+ {
+
+ stream.add((char *)"s2bUPgwFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.s2bUPgwFTeid, stream);
+
+ }
+
+ if (data.s2aUTwanFTeidIePresent)
+ {
+
+ stream.add((char *)"s2aUTwanFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.s2aUTwanFTeid, stream);
+
+ }
+
+ if (data.s2aUPgwFTeidIePresent)
+ {
+
+ stream.add((char *)"s2aUPgwFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.s2aUPgwFTeid, stream);
+
+ }
+
+ if (data.protocolConfigurationOptionsIePresent)
+ {
+
+ stream.add((char *)"protocolConfigurationOptions:");
+ stream.endOfLine();
+ PcoIe pco=
+ dynamic_cast<
+ PcoIe&>(GtpV2IeFactory::getInstance().getIeObject(PcoIeType));
+ pco.displayPcoIe_v(data.protocolConfigurationOptions, stream);
+
+ }
+
+ if (data.ranNasCauseIePresent)
+ {
+
+ stream.add((char *)"ranNasCause:");
+ stream.endOfLine();
+ RanNasCauseIe ranNasCause=
+ dynamic_cast<
+ RanNasCauseIe&>(GtpV2IeFactory::getInstance().getIeObject(RanNasCauseIeType));
+ ranNasCause.displayRanNasCauseIe_v(data.ranNasCause, stream);
+
+ }
+
+ if (data.extendedProtocolConfigurationOptionsIePresent)
+ {
+
+ stream.add((char *)"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/ieClasses/bearerContextsInCreateBearerResponse.h b/src/gtpV2Codec/ieClasses/bearerContextsInCreateBearerResponse.h
new file mode 100644
index 0000000..4bf8ec4
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/bearerContextsInCreateBearerResponse.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef BEARERCONTEXTSINCREATEBEARERRESPONSE_H_
+#define BEARERCONTEXTSINCREATEBEARERRESPONSE_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class BearerContextsInCreateBearerResponse:public GtpV2GroupedIe
+{
+public:
+ BearerContextsInCreateBearerResponse();
+ virtual ~BearerContextsInCreateBearerResponse();
+ bool encodeBearerContextsInCreateBearerResponse(MsgBuffer &buffer,
+ BearerContextsInCreateBearerResponseData
+ const &data);
+
+ bool decodeBearerContextsInCreateBearerResponse (MsgBuffer &buffer,
+ BearerContextsInCreateBearerResponseData
+ & data, Uint16 length);
+
+ void displayBearerContextsInCreateBearerResponseData_v
+ (BearerContextsInCreateBearerResponseData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/bearerContextsInDeleteBearerResponse.cpp b/src/gtpV2Codec/ieClasses/bearerContextsInDeleteBearerResponse.cpp
new file mode 100644
index 0000000..87d3028
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/bearerContextsInDeleteBearerResponse.cpp
@@ -0,0 +1,457 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "bearerContextsInDeleteBearerResponse.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "ebiIe.h"
+#include "causeIe.h"
+#include "pcoIe.h"
+#include "ranNasCauseIe.h"
+#include "epcoIe.h"
+
+BearerContextsInDeleteBearerResponse::
+BearerContextsInDeleteBearerResponse()
+{
+ Uint16 mandIe;
+ mandIe = EbiIeType;
+ mandIe = (mandIe << 8) | 0; // epsBearerId
+ mandatoryIeSet.insert(mandIe);
+ mandIe = CauseIeType;
+ mandIe = (mandIe << 8) | 0; // cause
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+BearerContextsInDeleteBearerResponse::
+~BearerContextsInDeleteBearerResponse()
+{
+
+}
+bool BearerContextsInDeleteBearerResponse::
+encodeBearerContextsInDeleteBearerResponse(MsgBuffer &buffer,
+ BearerContextsInDeleteBearerResponseData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // 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;
+ }
+
+
+
+ // 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.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.ranNasCauseIePresent)
+ {
+
+ // 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.ranNasCause);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: ranNasCause\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 BearerContextsInDeleteBearerResponse::
+decodeBearerContextsInDeleteBearerResponse(MsgBuffer &buffer,
+ BearerContextsInDeleteBearerResponseData
+ &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.epsBearerId, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: epsBearerId\n");
+ return false;
+ }
+ Uint16 mandIe = EbiIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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;
+ }
+ Uint16 mandIe = CauseIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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 TODO
+ 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.ranNasCause, ieHeader.length);
+
+ data.ranNasCauseIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: ranNasCause\n");
+ return false;
+ }
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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 TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void BearerContextsInDeleteBearerResponse::
+displayBearerContextsInDeleteBearerResponseData_v
+(BearerContextsInDeleteBearerResponseData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"BearerContextsInDeleteBearerResponse:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+ if (data.protocolConfigurationOptionsIePresent)
+ {
+
+ stream.add((char *)"protocolConfigurationOptions:");
+ stream.endOfLine();
+ PcoIe pco=
+ dynamic_cast<
+ PcoIe&>(GtpV2IeFactory::getInstance().getIeObject(PcoIeType));
+ pco.displayPcoIe_v(data.protocolConfigurationOptions, stream);
+
+ }
+
+ if (data.ranNasCauseIePresent)
+ {
+
+ stream.add((char *)"ranNasCause:");
+ stream.endOfLine();
+ RanNasCauseIe ranNasCause=
+ dynamic_cast<
+ RanNasCauseIe&>(GtpV2IeFactory::getInstance().getIeObject(RanNasCauseIeType));
+ ranNasCause.displayRanNasCauseIe_v(data.ranNasCause, stream);
+
+ }
+
+ if (data.extendedProtocolConfigurationOptionsIePresent)
+ {
+
+ stream.add((char *)"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/ieClasses/bearerContextsInDeleteBearerResponse.h b/src/gtpV2Codec/ieClasses/bearerContextsInDeleteBearerResponse.h
new file mode 100644
index 0000000..fde62ee
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/bearerContextsInDeleteBearerResponse.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef BEARERCONTEXTSINDELETEBEARERRESPONSE_H_
+#define BEARERCONTEXTSINDELETEBEARERRESPONSE_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class BearerContextsInDeleteBearerResponse:public GtpV2GroupedIe
+{
+public:
+ BearerContextsInDeleteBearerResponse();
+ virtual ~BearerContextsInDeleteBearerResponse();
+ bool encodeBearerContextsInDeleteBearerResponse(MsgBuffer &buffer,
+ BearerContextsInDeleteBearerResponseData
+ const &data);
+
+ bool decodeBearerContextsInDeleteBearerResponse (MsgBuffer &buffer,
+ BearerContextsInDeleteBearerResponseData
+ & data, Uint16 length);
+
+ void displayBearerContextsInDeleteBearerResponseData_v
+ (BearerContextsInDeleteBearerResponseData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/bearerContextsMarkedForRemovalInCreateSessionResponse.cpp b/src/gtpV2Codec/ieClasses/bearerContextsMarkedForRemovalInCreateSessionResponse.cpp
new file mode 100644
index 0000000..532b064
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/bearerContextsMarkedForRemovalInCreateSessionResponse.cpp
@@ -0,0 +1,244 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "bearerContextsMarkedForRemovalInCreateSessionResponse.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "ebiIe.h"
+#include "causeIe.h"
+
+BearerContextsMarkedForRemovalInCreateSessionResponse::
+BearerContextsMarkedForRemovalInCreateSessionResponse()
+{
+ Uint16 mandIe;
+ mandIe = EbiIeType;
+ mandIe = (mandIe << 8) | 0; // epsBearerId
+ mandatoryIeSet.insert(mandIe);
+ mandIe = CauseIeType;
+ mandIe = (mandIe << 8) | 0; // cause
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+BearerContextsMarkedForRemovalInCreateSessionResponse::
+~BearerContextsMarkedForRemovalInCreateSessionResponse()
+{
+
+}
+bool BearerContextsMarkedForRemovalInCreateSessionResponse::
+encodeBearerContextsMarkedForRemovalInCreateSessionResponse(MsgBuffer &buffer,
+ BearerContextsMarkedForRemovalInCreateSessionResponseData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // 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;
+ }
+
+
+
+ // 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;
+ }
+ return rc;
+}
+
+bool BearerContextsMarkedForRemovalInCreateSessionResponse::
+decodeBearerContextsMarkedForRemovalInCreateSessionResponse(MsgBuffer &buffer,
+ BearerContextsMarkedForRemovalInCreateSessionResponseData
+ &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.epsBearerId, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: epsBearerId\n");
+ return false;
+ }
+ Uint16 mandIe = EbiIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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;
+ }
+ Uint16 mandIe = CauseIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void BearerContextsMarkedForRemovalInCreateSessionResponse::
+displayBearerContextsMarkedForRemovalInCreateSessionResponseData_v
+(BearerContextsMarkedForRemovalInCreateSessionResponseData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"BearerContextsMarkedForRemovalInCreateSessionResponse:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/bearerContextsMarkedForRemovalInCreateSessionResponse.h b/src/gtpV2Codec/ieClasses/bearerContextsMarkedForRemovalInCreateSessionResponse.h
new file mode 100644
index 0000000..a528d97
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/bearerContextsMarkedForRemovalInCreateSessionResponse.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef BEARERCONTEXTSMARKEDFORREMOVALINCREATESESSIONRESPONSE_H_
+#define BEARERCONTEXTSMARKEDFORREMOVALINCREATESESSIONRESPONSE_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class BearerContextsMarkedForRemovalInCreateSessionResponse:public GtpV2GroupedIe
+{
+public:
+ BearerContextsMarkedForRemovalInCreateSessionResponse();
+ virtual ~BearerContextsMarkedForRemovalInCreateSessionResponse();
+ bool encodeBearerContextsMarkedForRemovalInCreateSessionResponse(MsgBuffer &buffer,
+ BearerContextsMarkedForRemovalInCreateSessionResponseData
+ const &data);
+
+ bool decodeBearerContextsMarkedForRemovalInCreateSessionResponse (MsgBuffer &buffer,
+ BearerContextsMarkedForRemovalInCreateSessionResponseData
+ & data, Uint16 length);
+
+ void displayBearerContextsMarkedForRemovalInCreateSessionResponseData_v
+ (BearerContextsMarkedForRemovalInCreateSessionResponseData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/bearerContextsMarkedForRemovalInModifyBearerResponse.cpp b/src/gtpV2Codec/ieClasses/bearerContextsMarkedForRemovalInModifyBearerResponse.cpp
new file mode 100644
index 0000000..19dcda3
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/bearerContextsMarkedForRemovalInModifyBearerResponse.cpp
@@ -0,0 +1,244 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "bearerContextsMarkedForRemovalInModifyBearerResponse.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "ebiIe.h"
+#include "causeIe.h"
+
+BearerContextsMarkedForRemovalInModifyBearerResponse::
+BearerContextsMarkedForRemovalInModifyBearerResponse()
+{
+ Uint16 mandIe;
+ mandIe = EbiIeType;
+ mandIe = (mandIe << 8) | 0; // epsBearerId
+ mandatoryIeSet.insert(mandIe);
+ mandIe = CauseIeType;
+ mandIe = (mandIe << 8) | 0; // cause
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+BearerContextsMarkedForRemovalInModifyBearerResponse::
+~BearerContextsMarkedForRemovalInModifyBearerResponse()
+{
+
+}
+bool BearerContextsMarkedForRemovalInModifyBearerResponse::
+encodeBearerContextsMarkedForRemovalInModifyBearerResponse(MsgBuffer &buffer,
+ BearerContextsMarkedForRemovalInModifyBearerResponseData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // 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;
+ }
+
+
+
+ // 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;
+ }
+ return rc;
+}
+
+bool BearerContextsMarkedForRemovalInModifyBearerResponse::
+decodeBearerContextsMarkedForRemovalInModifyBearerResponse(MsgBuffer &buffer,
+ BearerContextsMarkedForRemovalInModifyBearerResponseData
+ &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.epsBearerId, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: epsBearerId\n");
+ return false;
+ }
+ Uint16 mandIe = EbiIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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;
+ }
+ Uint16 mandIe = CauseIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void BearerContextsMarkedForRemovalInModifyBearerResponse::
+displayBearerContextsMarkedForRemovalInModifyBearerResponseData_v
+(BearerContextsMarkedForRemovalInModifyBearerResponseData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"BearerContextsMarkedForRemovalInModifyBearerResponse:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/bearerContextsMarkedForRemovalInModifyBearerResponse.h b/src/gtpV2Codec/ieClasses/bearerContextsMarkedForRemovalInModifyBearerResponse.h
new file mode 100644
index 0000000..e94afcb
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/bearerContextsMarkedForRemovalInModifyBearerResponse.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef BEARERCONTEXTSMARKEDFORREMOVALINMODIFYBEARERRESPONSE_H_
+#define BEARERCONTEXTSMARKEDFORREMOVALINMODIFYBEARERRESPONSE_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class BearerContextsMarkedForRemovalInModifyBearerResponse:public GtpV2GroupedIe
+{
+public:
+ BearerContextsMarkedForRemovalInModifyBearerResponse();
+ virtual ~BearerContextsMarkedForRemovalInModifyBearerResponse();
+ bool encodeBearerContextsMarkedForRemovalInModifyBearerResponse(MsgBuffer &buffer,
+ BearerContextsMarkedForRemovalInModifyBearerResponseData
+ const &data);
+
+ bool decodeBearerContextsMarkedForRemovalInModifyBearerResponse (MsgBuffer &buffer,
+ BearerContextsMarkedForRemovalInModifyBearerResponseData
+ & data, Uint16 length);
+
+ void displayBearerContextsMarkedForRemovalInModifyBearerResponseData_v
+ (BearerContextsMarkedForRemovalInModifyBearerResponseData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/bearerContextsModifiedInModifyBearerResponse.cpp b/src/gtpV2Codec/ieClasses/bearerContextsModifiedInModifyBearerResponse.cpp
new file mode 100644
index 0000000..b3ec936
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/bearerContextsModifiedInModifyBearerResponse.cpp
@@ -0,0 +1,619 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "bearerContextsModifiedInModifyBearerResponse.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "ebiIe.h"
+#include "causeIe.h"
+#include "fTeidIe.h"
+#include "fTeidIe.h"
+#include "fTeidIe.h"
+#include "chargingIdIe.h"
+#include "bearerFlagsIe.h"
+#include "fTeidIe.h"
+
+BearerContextsModifiedInModifyBearerResponse::
+BearerContextsModifiedInModifyBearerResponse()
+{
+ Uint16 mandIe;
+ mandIe = EbiIeType;
+ mandIe = (mandIe << 8) | 0; // epsBearerId
+ mandatoryIeSet.insert(mandIe);
+ mandIe = CauseIeType;
+ mandIe = (mandIe << 8) | 0; // cause
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+BearerContextsModifiedInModifyBearerResponse::
+~BearerContextsModifiedInModifyBearerResponse()
+{
+
+}
+bool BearerContextsModifiedInModifyBearerResponse::
+encodeBearerContextsModifiedInModifyBearerResponse(MsgBuffer &buffer,
+ BearerContextsModifiedInModifyBearerResponseData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // 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;
+ }
+
+
+
+ // 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.s1USgwFTeidIePresent)
+ {
+
+ // 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.s1USgwFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: s1USgwFTeid\n");
+ return false;
+ }
+ }
+
+ if (data.s12SgwFTeidIePresent)
+ {
+
+ // 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.s12SgwFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: s12SgwFTeid\n");
+ return false;
+ }
+ }
+
+ if (data.s4USgwFTeidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FTeidIeType;
+ header.instance = 2;
+ 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.s4USgwFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: s4USgwFTeid\n");
+ return false;
+ }
+ }
+
+ if (data.chargingIdIePresent)
+ {
+
+ // 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.chargingId);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: chargingId\n");
+ return false;
+ }
+ }
+
+ if (data.bearerFlagsIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = BearerFlagsIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ BearerFlagsIe bearerFlags=
+ dynamic_cast<
+ BearerFlagsIe&>(GtpV2IeFactory::getInstance().getIeObject(BearerFlagsIeType));
+ rc = bearerFlags.encodeBearerFlagsIe(buffer, data.bearerFlags);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: bearerFlags\n");
+ return false;
+ }
+ }
+
+ if (data.s11USgwFTeidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FTeidIeType;
+ header.instance = 3;
+ 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.s11USgwFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: s11USgwFTeid\n");
+ return false;
+ }
+ }
+ return rc;
+}
+
+bool BearerContextsModifiedInModifyBearerResponse::
+decodeBearerContextsModifiedInModifyBearerResponse(MsgBuffer &buffer,
+ BearerContextsModifiedInModifyBearerResponseData
+ &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.epsBearerId, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: epsBearerId\n");
+ return false;
+ }
+ Uint16 mandIe = EbiIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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;
+ }
+ Uint16 mandIe = CauseIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.s1USgwFTeid, ieHeader.length);
+
+ data.s1USgwFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: s1USgwFTeid\n");
+ return false;
+ }
+ }
+
+ else if(ieHeader.instance == 1)
+ {
+
+ rc = ieObject.decodeFTeidIe(buffer, data.s12SgwFTeid, ieHeader.length);
+
+ data.s12SgwFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: s12SgwFTeid\n");
+ return false;
+ }
+ }
+
+ else if(ieHeader.instance == 2)
+ {
+
+ rc = ieObject.decodeFTeidIe(buffer, data.s4USgwFTeid, ieHeader.length);
+
+ data.s4USgwFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: s4USgwFTeid\n");
+ return false;
+ }
+ }
+
+ else if(ieHeader.instance == 3)
+ {
+
+ rc = ieObject.decodeFTeidIe(buffer, data.s11USgwFTeid, ieHeader.length);
+
+ data.s11USgwFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: s11USgwFTeid\n");
+ return false;
+ }
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.chargingId, ieHeader.length);
+
+ data.chargingIdIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: chargingId\n");
+ return false;
+ }
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case BearerFlagsIeType:
+ {
+ BearerFlagsIe ieObject =
+ dynamic_cast<
+ BearerFlagsIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(BearerFlagsIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeBearerFlagsIe(buffer, data.bearerFlags, ieHeader.length);
+
+ data.bearerFlagsIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: bearerFlags\n");
+ return false;
+ }
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void BearerContextsModifiedInModifyBearerResponse::
+displayBearerContextsModifiedInModifyBearerResponseData_v
+(BearerContextsModifiedInModifyBearerResponseData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"BearerContextsModifiedInModifyBearerResponse:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+ if (data.s1USgwFTeidIePresent)
+ {
+
+ stream.add((char *)"s1USgwFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.s1USgwFTeid, stream);
+
+ }
+
+ if (data.s12SgwFTeidIePresent)
+ {
+
+ stream.add((char *)"s12SgwFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.s12SgwFTeid, stream);
+
+ }
+
+ if (data.s4USgwFTeidIePresent)
+ {
+
+ stream.add((char *)"s4USgwFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.s4USgwFTeid, stream);
+
+ }
+
+ if (data.chargingIdIePresent)
+ {
+
+ stream.add((char *)"chargingId:");
+ stream.endOfLine();
+ ChargingIdIe chargingId=
+ dynamic_cast<
+ ChargingIdIe&>(GtpV2IeFactory::getInstance().getIeObject(ChargingIdIeType));
+ chargingId.displayChargingIdIe_v(data.chargingId, stream);
+
+ }
+
+ if (data.bearerFlagsIePresent)
+ {
+
+ stream.add((char *)"bearerFlags:");
+ stream.endOfLine();
+ BearerFlagsIe bearerFlags=
+ dynamic_cast<
+ BearerFlagsIe&>(GtpV2IeFactory::getInstance().getIeObject(BearerFlagsIeType));
+ bearerFlags.displayBearerFlagsIe_v(data.bearerFlags, stream);
+
+ }
+
+ if (data.s11USgwFTeidIePresent)
+ {
+
+ stream.add((char *)"s11USgwFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.s11USgwFTeid, stream);
+
+ }
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/bearerContextsModifiedInModifyBearerResponse.h b/src/gtpV2Codec/ieClasses/bearerContextsModifiedInModifyBearerResponse.h
new file mode 100644
index 0000000..9bb5ac9
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/bearerContextsModifiedInModifyBearerResponse.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef BEARERCONTEXTSMODIFIEDINMODIFYBEARERRESPONSE_H_
+#define BEARERCONTEXTSMODIFIEDINMODIFYBEARERRESPONSE_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class BearerContextsModifiedInModifyBearerResponse:public GtpV2GroupedIe
+{
+public:
+ BearerContextsModifiedInModifyBearerResponse();
+ virtual ~BearerContextsModifiedInModifyBearerResponse();
+ bool encodeBearerContextsModifiedInModifyBearerResponse(MsgBuffer &buffer,
+ BearerContextsModifiedInModifyBearerResponseData
+ const &data);
+
+ bool decodeBearerContextsModifiedInModifyBearerResponse (MsgBuffer &buffer,
+ BearerContextsModifiedInModifyBearerResponseData
+ & data, Uint16 length);
+
+ void displayBearerContextsModifiedInModifyBearerResponseData_v
+ (BearerContextsModifiedInModifyBearerResponseData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/bearerContextsToBeCreatedInCreateSessionRequest.cpp b/src/gtpV2Codec/ieClasses/bearerContextsToBeCreatedInCreateSessionRequest.cpp
new file mode 100644
index 0000000..2aeac30
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/bearerContextsToBeCreatedInCreateSessionRequest.cpp
@@ -0,0 +1,764 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "bearerContextsToBeCreatedInCreateSessionRequest.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "ebiIe.h"
+#include "bearerTftIe.h"
+#include "fTeidIe.h"
+#include "fTeidIe.h"
+#include "fTeidIe.h"
+#include "fTeidIe.h"
+#include "fTeidIe.h"
+#include "fTeidIe.h"
+#include "fTeidIe.h"
+#include "bearerQosIe.h"
+#include "fTeidIe.h"
+
+BearerContextsToBeCreatedInCreateSessionRequest::
+BearerContextsToBeCreatedInCreateSessionRequest()
+{
+ Uint16 mandIe;
+ mandIe = EbiIeType;
+ mandIe = (mandIe << 8) | 0; // epsBearerId
+ mandatoryIeSet.insert(mandIe);
+ mandIe = BearerQosIeType;
+ mandIe = (mandIe << 8) | 0; // bearerLevelQos
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+BearerContextsToBeCreatedInCreateSessionRequest::
+~BearerContextsToBeCreatedInCreateSessionRequest()
+{
+
+}
+bool BearerContextsToBeCreatedInCreateSessionRequest::
+encodeBearerContextsToBeCreatedInCreateSessionRequest(MsgBuffer &buffer,
+ BearerContextsToBeCreatedInCreateSessionRequestData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // 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.tftIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = BearerTftIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ BearerTftIe bearerTft=
+ dynamic_cast<
+ BearerTftIe&>(GtpV2IeFactory::getInstance().getIeObject(BearerTftIeType));
+ rc = bearerTft.encodeBearerTftIe(buffer, data.tft);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: tft\n");
+ return false;
+ }
+ }
+
+ if (data.s1UEnodebFTeidIePresent)
+ {
+
+ // 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.s1UEnodebFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: s1UEnodebFTeid\n");
+ return false;
+ }
+ }
+
+ if (data.s4USgsnFTeidIePresent)
+ {
+
+ // 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.s4USgsnFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: s4USgsnFTeid\n");
+ return false;
+ }
+ }
+
+ if (data.s5S8USgwFTeidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FTeidIeType;
+ header.instance = 2;
+ 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.s5S8USgwFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: s5S8USgwFTeid\n");
+ return false;
+ }
+ }
+
+ if (data.s5S8UPgwFTeidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FTeidIeType;
+ header.instance = 3;
+ 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.s5S8UPgwFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: s5S8UPgwFTeid\n");
+ return false;
+ }
+ }
+
+ if (data.s12RncFTeidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FTeidIeType;
+ header.instance = 4;
+ 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.s12RncFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: s12RncFTeid\n");
+ return false;
+ }
+ }
+
+ if (data.s2bUEpdgFTeidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FTeidIeType;
+ header.instance = 5;
+ 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.s2bUEpdgFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: s2bUEpdgFTeid\n");
+ return false;
+ }
+ }
+
+ if (data.s2aUTwanFTeidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FTeidIeType;
+ header.instance = 6;
+ 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.s2aUTwanFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: s2aUTwanFTeid\n");
+ return false;
+ }
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = BearerQosIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ BearerQosIe bearerQos=
+ dynamic_cast<
+ BearerQosIe&>(GtpV2IeFactory::getInstance().getIeObject(BearerQosIeType));
+ rc = bearerQos.encodeBearerQosIe(buffer, data.bearerLevelQos);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: bearerLevelQos\n");
+ return false;
+ }
+
+ if (data.s11UMmeFTeidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FTeidIeType;
+ header.instance = 7;
+ 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.s11UMmeFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: s11UMmeFTeid\n");
+ return false;
+ }
+ }
+ return rc;
+}
+
+bool BearerContextsToBeCreatedInCreateSessionRequest::
+decodeBearerContextsToBeCreatedInCreateSessionRequest(MsgBuffer &buffer,
+ BearerContextsToBeCreatedInCreateSessionRequestData
+ &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.epsBearerId, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: epsBearerId\n");
+ return false;
+ }
+ Uint16 mandIe = EbiIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case BearerTftIeType:
+ {
+ BearerTftIe ieObject =
+ dynamic_cast<
+ BearerTftIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(BearerTftIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeBearerTftIe(buffer, data.tft, ieHeader.length);
+
+ data.tftIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: tft\n");
+ return false;
+ }
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.s1UEnodebFTeid, ieHeader.length);
+
+ data.s1UEnodebFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: s1UEnodebFTeid\n");
+ return false;
+ }
+ }
+
+ else if(ieHeader.instance == 1)
+ {
+
+ rc = ieObject.decodeFTeidIe(buffer, data.s4USgsnFTeid, ieHeader.length);
+
+ data.s4USgsnFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: s4USgsnFTeid\n");
+ return false;
+ }
+ }
+
+ else if(ieHeader.instance == 2)
+ {
+
+ rc = ieObject.decodeFTeidIe(buffer, data.s5S8USgwFTeid, ieHeader.length);
+
+ data.s5S8USgwFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: s5S8USgwFTeid\n");
+ return false;
+ }
+ }
+
+ else if(ieHeader.instance == 3)
+ {
+
+ rc = ieObject.decodeFTeidIe(buffer, data.s5S8UPgwFTeid, ieHeader.length);
+
+ data.s5S8UPgwFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: s5S8UPgwFTeid\n");
+ return false;
+ }
+ }
+
+ else if(ieHeader.instance == 4)
+ {
+
+ rc = ieObject.decodeFTeidIe(buffer, data.s12RncFTeid, ieHeader.length);
+
+ data.s12RncFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: s12RncFTeid\n");
+ return false;
+ }
+ }
+
+ else if(ieHeader.instance == 5)
+ {
+
+ rc = ieObject.decodeFTeidIe(buffer, data.s2bUEpdgFTeid, ieHeader.length);
+
+ data.s2bUEpdgFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: s2bUEpdgFTeid\n");
+ return false;
+ }
+ }
+
+ else if(ieHeader.instance == 6)
+ {
+
+ rc = ieObject.decodeFTeidIe(buffer, data.s2aUTwanFTeid, ieHeader.length);
+
+ data.s2aUTwanFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: s2aUTwanFTeid\n");
+ return false;
+ }
+ }
+
+ else if(ieHeader.instance == 7)
+ {
+
+ rc = ieObject.decodeFTeidIe(buffer, data.s11UMmeFTeid, ieHeader.length);
+
+ data.s11UMmeFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: s11UMmeFTeid\n");
+ return false;
+ }
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case BearerQosIeType:
+ {
+ BearerQosIe ieObject =
+ dynamic_cast<
+ BearerQosIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(BearerQosIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeBearerQosIe(buffer, data.bearerLevelQos, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: bearerLevelQos\n");
+ return false;
+ }
+ Uint16 mandIe = BearerQosIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void BearerContextsToBeCreatedInCreateSessionRequest::
+displayBearerContextsToBeCreatedInCreateSessionRequestData_v
+(BearerContextsToBeCreatedInCreateSessionRequestData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"BearerContextsToBeCreatedInCreateSessionRequest:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+ if (data.tftIePresent)
+ {
+
+ stream.add((char *)"tft:");
+ stream.endOfLine();
+ BearerTftIe bearerTft=
+ dynamic_cast<
+ BearerTftIe&>(GtpV2IeFactory::getInstance().getIeObject(BearerTftIeType));
+ bearerTft.displayBearerTftIe_v(data.tft, stream);
+
+ }
+
+ if (data.s1UEnodebFTeidIePresent)
+ {
+
+ stream.add((char *)"s1UEnodebFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.s1UEnodebFTeid, stream);
+
+ }
+
+ if (data.s4USgsnFTeidIePresent)
+ {
+
+ stream.add((char *)"s4USgsnFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.s4USgsnFTeid, stream);
+
+ }
+
+ if (data.s5S8USgwFTeidIePresent)
+ {
+
+ stream.add((char *)"s5S8USgwFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.s5S8USgwFTeid, stream);
+
+ }
+
+ if (data.s5S8UPgwFTeidIePresent)
+ {
+
+ stream.add((char *)"s5S8UPgwFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.s5S8UPgwFTeid, stream);
+
+ }
+
+ if (data.s12RncFTeidIePresent)
+ {
+
+ stream.add((char *)"s12RncFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.s12RncFTeid, stream);
+
+ }
+
+ if (data.s2bUEpdgFTeidIePresent)
+ {
+
+ stream.add((char *)"s2bUEpdgFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.s2bUEpdgFTeid, stream);
+
+ }
+
+ if (data.s2aUTwanFTeidIePresent)
+ {
+
+ stream.add((char *)"s2aUTwanFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.s2aUTwanFTeid, stream);
+
+ }
+
+
+ if (data.s11UMmeFTeidIePresent)
+ {
+
+ stream.add((char *)"s11UMmeFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.s11UMmeFTeid, stream);
+
+ }
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/bearerContextsToBeCreatedInCreateSessionRequest.h b/src/gtpV2Codec/ieClasses/bearerContextsToBeCreatedInCreateSessionRequest.h
new file mode 100644
index 0000000..a63caf5
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/bearerContextsToBeCreatedInCreateSessionRequest.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef BEARERCONTEXTSTOBECREATEDINCREATESESSIONREQUEST_H_
+#define BEARERCONTEXTSTOBECREATEDINCREATESESSIONREQUEST_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class BearerContextsToBeCreatedInCreateSessionRequest:public GtpV2GroupedIe
+{
+public:
+ BearerContextsToBeCreatedInCreateSessionRequest();
+ virtual ~BearerContextsToBeCreatedInCreateSessionRequest();
+ bool encodeBearerContextsToBeCreatedInCreateSessionRequest(MsgBuffer &buffer,
+ BearerContextsToBeCreatedInCreateSessionRequestData
+ const &data);
+
+ bool decodeBearerContextsToBeCreatedInCreateSessionRequest (MsgBuffer &buffer,
+ BearerContextsToBeCreatedInCreateSessionRequestData
+ & data, Uint16 length);
+
+ void displayBearerContextsToBeCreatedInCreateSessionRequestData_v
+ (BearerContextsToBeCreatedInCreateSessionRequestData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/bearerContextsToBeModifiedInModifyBearerRequest.cpp b/src/gtpV2Codec/ieClasses/bearerContextsToBeModifiedInModifyBearerRequest.cpp
new file mode 100644
index 0000000..5e3680c
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/bearerContextsToBeModifiedInModifyBearerRequest.cpp
@@ -0,0 +1,469 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "bearerContextsToBeModifiedInModifyBearerRequest.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "ebiIe.h"
+#include "fTeidIe.h"
+#include "fTeidIe.h"
+#include "fTeidIe.h"
+#include "fTeidIe.h"
+#include "fTeidIe.h"
+
+BearerContextsToBeModifiedInModifyBearerRequest::
+BearerContextsToBeModifiedInModifyBearerRequest()
+{
+ Uint16 mandIe;
+ mandIe = EbiIeType;
+ mandIe = (mandIe << 8) | 0; // epsBearerId
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+BearerContextsToBeModifiedInModifyBearerRequest::
+~BearerContextsToBeModifiedInModifyBearerRequest()
+{
+
+}
+bool BearerContextsToBeModifiedInModifyBearerRequest::
+encodeBearerContextsToBeModifiedInModifyBearerRequest(MsgBuffer &buffer,
+ BearerContextsToBeModifiedInModifyBearerRequestData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // 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.s1EnodebFTeidIePresent)
+ {
+
+ // 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.s1EnodebFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: s1EnodebFTeid\n");
+ return false;
+ }
+ }
+
+ if (data.s58USgwFTeidIePresent)
+ {
+
+ // 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.s58USgwFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: s58USgwFTeid\n");
+ return false;
+ }
+ }
+
+ if (data.s12RncFTeidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FTeidIeType;
+ header.instance = 2;
+ 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.s12RncFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: s12RncFTeid\n");
+ return false;
+ }
+ }
+
+ if (data.s4USgsnFTeidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FTeidIeType;
+ header.instance = 3;
+ 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.s4USgsnFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: s4USgsnFTeid\n");
+ return false;
+ }
+ }
+
+ if (data.s11UMmeFTeidIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = FTeidIeType;
+ header.instance = 4;
+ 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.s11UMmeFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: s11UMmeFTeid\n");
+ return false;
+ }
+ }
+ return rc;
+}
+
+bool BearerContextsToBeModifiedInModifyBearerRequest::
+decodeBearerContextsToBeModifiedInModifyBearerRequest(MsgBuffer &buffer,
+ BearerContextsToBeModifiedInModifyBearerRequestData
+ &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.epsBearerId, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: epsBearerId\n");
+ return false;
+ }
+ Uint16 mandIe = EbiIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.s1EnodebFTeid, ieHeader.length);
+
+ data.s1EnodebFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: s1EnodebFTeid\n");
+ return false;
+ }
+ }
+
+ else if(ieHeader.instance == 1)
+ {
+
+ rc = ieObject.decodeFTeidIe(buffer, data.s58USgwFTeid, ieHeader.length);
+
+ data.s58USgwFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: s58USgwFTeid\n");
+ return false;
+ }
+ }
+
+ else if(ieHeader.instance == 2)
+ {
+
+ rc = ieObject.decodeFTeidIe(buffer, data.s12RncFTeid, ieHeader.length);
+
+ data.s12RncFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: s12RncFTeid\n");
+ return false;
+ }
+ }
+
+ else if(ieHeader.instance == 3)
+ {
+
+ rc = ieObject.decodeFTeidIe(buffer, data.s4USgsnFTeid, ieHeader.length);
+
+ data.s4USgsnFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: s4USgsnFTeid\n");
+ return false;
+ }
+ }
+
+ else if(ieHeader.instance == 4)
+ {
+
+ rc = ieObject.decodeFTeidIe(buffer, data.s11UMmeFTeid, ieHeader.length);
+
+ data.s11UMmeFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: s11UMmeFTeid\n");
+ return false;
+ }
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void BearerContextsToBeModifiedInModifyBearerRequest::
+displayBearerContextsToBeModifiedInModifyBearerRequestData_v
+(BearerContextsToBeModifiedInModifyBearerRequestData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"BearerContextsToBeModifiedInModifyBearerRequest:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+ if (data.s1EnodebFTeidIePresent)
+ {
+
+ stream.add((char *)"s1EnodebFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.s1EnodebFTeid, stream);
+
+ }
+
+ if (data.s58USgwFTeidIePresent)
+ {
+
+ stream.add((char *)"s58USgwFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.s58USgwFTeid, stream);
+
+ }
+
+ if (data.s12RncFTeidIePresent)
+ {
+
+ stream.add((char *)"s12RncFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.s12RncFTeid, stream);
+
+ }
+
+ if (data.s4USgsnFTeidIePresent)
+ {
+
+ stream.add((char *)"s4USgsnFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.s4USgsnFTeid, stream);
+
+ }
+
+ if (data.s11UMmeFTeidIePresent)
+ {
+
+ stream.add((char *)"s11UMmeFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.s11UMmeFTeid, stream);
+
+ }
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/bearerContextsToBeModifiedInModifyBearerRequest.h b/src/gtpV2Codec/ieClasses/bearerContextsToBeModifiedInModifyBearerRequest.h
new file mode 100644
index 0000000..ad0fa8a
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/bearerContextsToBeModifiedInModifyBearerRequest.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef BEARERCONTEXTSTOBEMODIFIEDINMODIFYBEARERREQUEST_H_
+#define BEARERCONTEXTSTOBEMODIFIEDINMODIFYBEARERREQUEST_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class BearerContextsToBeModifiedInModifyBearerRequest:public GtpV2GroupedIe
+{
+public:
+ BearerContextsToBeModifiedInModifyBearerRequest();
+ virtual ~BearerContextsToBeModifiedInModifyBearerRequest();
+ bool encodeBearerContextsToBeModifiedInModifyBearerRequest(MsgBuffer &buffer,
+ BearerContextsToBeModifiedInModifyBearerRequestData
+ const &data);
+
+ bool decodeBearerContextsToBeModifiedInModifyBearerRequest (MsgBuffer &buffer,
+ BearerContextsToBeModifiedInModifyBearerRequestData
+ & data, Uint16 length);
+
+ void displayBearerContextsToBeModifiedInModifyBearerRequestData_v
+ (BearerContextsToBeModifiedInModifyBearerRequestData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/bearerContextsToBeRemovedInCreateSessionRequest.cpp b/src/gtpV2Codec/ieClasses/bearerContextsToBeRemovedInCreateSessionRequest.cpp
new file mode 100644
index 0000000..946f035
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/bearerContextsToBeRemovedInCreateSessionRequest.cpp
@@ -0,0 +1,253 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "bearerContextsToBeRemovedInCreateSessionRequest.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "ebiIe.h"
+#include "fTeidIe.h"
+
+BearerContextsToBeRemovedInCreateSessionRequest::
+BearerContextsToBeRemovedInCreateSessionRequest()
+{
+ Uint16 mandIe;
+ mandIe = EbiIeType;
+ mandIe = (mandIe << 8) | 0; // epsBearerId
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+BearerContextsToBeRemovedInCreateSessionRequest::
+~BearerContextsToBeRemovedInCreateSessionRequest()
+{
+
+}
+bool BearerContextsToBeRemovedInCreateSessionRequest::
+encodeBearerContextsToBeRemovedInCreateSessionRequest(MsgBuffer &buffer,
+ BearerContextsToBeRemovedInCreateSessionRequestData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // 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.s4USgsnFTeidIePresent)
+ {
+
+ // 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.s4USgsnFTeid);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: s4USgsnFTeid\n");
+ return false;
+ }
+ }
+ return rc;
+}
+
+bool BearerContextsToBeRemovedInCreateSessionRequest::
+decodeBearerContextsToBeRemovedInCreateSessionRequest(MsgBuffer &buffer,
+ BearerContextsToBeRemovedInCreateSessionRequestData
+ &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.epsBearerId, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: epsBearerId\n");
+ return false;
+ }
+ Uint16 mandIe = EbiIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.s4USgsnFTeid, ieHeader.length);
+
+ data.s4USgsnFTeidIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: s4USgsnFTeid\n");
+ return false;
+ }
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void BearerContextsToBeRemovedInCreateSessionRequest::
+displayBearerContextsToBeRemovedInCreateSessionRequestData_v
+(BearerContextsToBeRemovedInCreateSessionRequestData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"BearerContextsToBeRemovedInCreateSessionRequest:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+ if (data.s4USgsnFTeidIePresent)
+ {
+
+ stream.add((char *)"s4USgsnFTeid:");
+ stream.endOfLine();
+ FTeidIe fTeid=
+ dynamic_cast<
+ FTeidIe&>(GtpV2IeFactory::getInstance().getIeObject(FTeidIeType));
+ fTeid.displayFTeidIe_v(data.s4USgsnFTeid, stream);
+
+ }
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/bearerContextsToBeRemovedInCreateSessionRequest.h b/src/gtpV2Codec/ieClasses/bearerContextsToBeRemovedInCreateSessionRequest.h
new file mode 100644
index 0000000..0e9383d
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/bearerContextsToBeRemovedInCreateSessionRequest.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef BEARERCONTEXTSTOBEREMOVEDINCREATESESSIONREQUEST_H_
+#define BEARERCONTEXTSTOBEREMOVEDINCREATESESSIONREQUEST_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class BearerContextsToBeRemovedInCreateSessionRequest:public GtpV2GroupedIe
+{
+public:
+ BearerContextsToBeRemovedInCreateSessionRequest();
+ virtual ~BearerContextsToBeRemovedInCreateSessionRequest();
+ bool encodeBearerContextsToBeRemovedInCreateSessionRequest(MsgBuffer &buffer,
+ BearerContextsToBeRemovedInCreateSessionRequestData
+ const &data);
+
+ bool decodeBearerContextsToBeRemovedInCreateSessionRequest (MsgBuffer &buffer,
+ BearerContextsToBeRemovedInCreateSessionRequestData
+ & data, Uint16 length);
+
+ void displayBearerContextsToBeRemovedInCreateSessionRequestData_v
+ (BearerContextsToBeRemovedInCreateSessionRequestData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/bearerContextsToBeRemovedInModifyBearerRequest.cpp b/src/gtpV2Codec/ieClasses/bearerContextsToBeRemovedInModifyBearerRequest.cpp
new file mode 100644
index 0000000..7d545ac
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/bearerContextsToBeRemovedInModifyBearerRequest.cpp
@@ -0,0 +1,182 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "bearerContextsToBeRemovedInModifyBearerRequest.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "ebiIe.h"
+
+BearerContextsToBeRemovedInModifyBearerRequest::
+BearerContextsToBeRemovedInModifyBearerRequest()
+{
+ Uint16 mandIe;
+ mandIe = EbiIeType;
+ mandIe = (mandIe << 8) | 0; // epsBearerId
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+BearerContextsToBeRemovedInModifyBearerRequest::
+~BearerContextsToBeRemovedInModifyBearerRequest()
+{
+
+}
+bool BearerContextsToBeRemovedInModifyBearerRequest::
+encodeBearerContextsToBeRemovedInModifyBearerRequest(MsgBuffer &buffer,
+ BearerContextsToBeRemovedInModifyBearerRequestData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // 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;
+ }
+ return rc;
+}
+
+bool BearerContextsToBeRemovedInModifyBearerRequest::
+decodeBearerContextsToBeRemovedInModifyBearerRequest(MsgBuffer &buffer,
+ BearerContextsToBeRemovedInModifyBearerRequestData
+ &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.epsBearerId, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: epsBearerId\n");
+ return false;
+ }
+ Uint16 mandIe = EbiIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void BearerContextsToBeRemovedInModifyBearerRequest::
+displayBearerContextsToBeRemovedInModifyBearerRequestData_v
+(BearerContextsToBeRemovedInModifyBearerRequestData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"BearerContextsToBeRemovedInModifyBearerRequest:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/bearerContextsToBeRemovedInModifyBearerRequest.h b/src/gtpV2Codec/ieClasses/bearerContextsToBeRemovedInModifyBearerRequest.h
new file mode 100644
index 0000000..578f489
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/bearerContextsToBeRemovedInModifyBearerRequest.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef BEARERCONTEXTSTOBEREMOVEDINMODIFYBEARERREQUEST_H_
+#define BEARERCONTEXTSTOBEREMOVEDINMODIFYBEARERREQUEST_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class BearerContextsToBeRemovedInModifyBearerRequest:public GtpV2GroupedIe
+{
+public:
+ BearerContextsToBeRemovedInModifyBearerRequest();
+ virtual ~BearerContextsToBeRemovedInModifyBearerRequest();
+ bool encodeBearerContextsToBeRemovedInModifyBearerRequest(MsgBuffer &buffer,
+ BearerContextsToBeRemovedInModifyBearerRequestData
+ const &data);
+
+ bool decodeBearerContextsToBeRemovedInModifyBearerRequest (MsgBuffer &buffer,
+ BearerContextsToBeRemovedInModifyBearerRequestData
+ & data, Uint16 length);
+
+ void displayBearerContextsToBeRemovedInModifyBearerRequestData_v
+ (BearerContextsToBeRemovedInModifyBearerRequestData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/bearerFlagsIe.cpp b/src/gtpV2Codec/ieClasses/bearerFlagsIe.cpp
new file mode 100644
index 0000000..a404ebb
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/bearerFlagsIe.cpp
@@ -0,0 +1,102 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "bearerFlagsIe.h"
+#include "dataTypeCodecUtils.h"
+
+BearerFlagsIe::BearerFlagsIe()
+{
+ ieType = 97;
+ // TODO
+
+}
+
+BearerFlagsIe::~BearerFlagsIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool BearerFlagsIe::encodeBearerFlagsIe(MsgBuffer &buffer, BearerFlagsIeData const &data)
+{
+ buffer.skipBits(6);
+
+ if(!(buffer.writeBits(data.vb, 1)))
+ {
+ errorStream.add((char *)"Encoding of vb failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.ppc, 1)))
+ {
+ errorStream.add((char *)"Encoding of ppc failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool BearerFlagsIe::decodeBearerFlagsIe(MsgBuffer &buffer, BearerFlagsIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+ buffer.skipBits(6);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: \n");
+ return false;
+ }
+
+ data.vb = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: vb\n");
+ return false;
+ }
+ data.ppc = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: ppc\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE BearerFlagsIe\n");
+ return false;
+ }
+}
+void BearerFlagsIe::displayBearerFlagsIe_v(BearerFlagsIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"BearerFlagsIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add( (char *)"vb: ");
+ stream.add((Uint8)data.vb);
+ stream.endOfLine();
+
+ stream.add( (char *)"ppc: ");
+ stream.add((Uint8)data.ppc);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/bearerFlagsIe.h b/src/gtpV2Codec/ieClasses/bearerFlagsIe.h
new file mode 100644
index 0000000..cb4d7d1
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/bearerFlagsIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef BEARERFLAGSIE_H_
+#define BEARERFLAGSIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class BearerFlagsIe: public GtpV2Ie {
+public:
+ BearerFlagsIe();
+ virtual ~BearerFlagsIe();
+
+ bool encodeBearerFlagsIe(MsgBuffer &buffer,
+ BearerFlagsIeData const &data);
+ bool decodeBearerFlagsIe(MsgBuffer &buffer,
+ BearerFlagsIeData &data, Uint16 length);
+ void displayBearerFlagsIe_v(BearerFlagsIeData const &data,
+ Debug &stream);
+};
+
+#endif /* BEARERFLAGSIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/bearerQosIe.cpp b/src/gtpV2Codec/ieClasses/bearerQosIe.cpp
new file mode 100644
index 0000000..023e0ba
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/bearerQosIe.cpp
@@ -0,0 +1,205 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "bearerQosIe.h"
+#include "dataTypeCodecUtils.h"
+
+BearerQosIe::BearerQosIe()
+{
+ ieType = 80;
+ // TODO
+
+}
+
+BearerQosIe::~BearerQosIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool BearerQosIe::encodeBearerQosIe(MsgBuffer &buffer, BearerQosIeData const &data)
+{
+ buffer.skipBits(1);
+
+ if(!(buffer.writeBits(data.pci, 1)))
+ {
+ errorStream.add((char *)"Encoding of pci failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.pl, 4)))
+ {
+ errorStream.add((char *)"Encoding of pl failed\n");
+ return false;
+ }
+ buffer.skipBits(1);
+
+ if(!(buffer.writeBits(data.pvi, 1)))
+ {
+ errorStream.add((char *)"Encoding of pvi failed\n");
+ return false;
+ }
+ if (!(buffer.writeUint8(data.qci)))
+ {
+ errorStream.add((char *)"Encoding of qci failed\n");
+ return false;
+ }
+ if (!(DataTypeCodecUtils::encodeUint8Array5(buffer, data.maxBitRateUl)))
+ {
+ errorStream.add((char *)"Encoding of maxBitRateUl failed\n");
+ return false;
+ }
+ if (!(DataTypeCodecUtils::encodeUint8Array5(buffer, data.maxBitRateDl)))
+ {
+ errorStream.add((char *)"Encoding of maxBitRateDl failed\n");
+ return false;
+ }
+ if (!(DataTypeCodecUtils::encodeUint8Array5(buffer, data.guraranteedBitRateUl)))
+ {
+ errorStream.add((char *)"Encoding of guraranteedBitRateUl failed\n");
+ return false;
+ }
+ if (!(DataTypeCodecUtils::encodeUint8Array5(buffer, data.guaranteedBitRateDl)))
+ {
+ errorStream.add((char *)"Encoding of guaranteedBitRateDl failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool BearerQosIe::decodeBearerQosIe(MsgBuffer &buffer, BearerQosIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+ buffer.skipBits(1);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: \n");
+ return false;
+ }
+
+ data.pci = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: pci\n");
+ return false;
+ }
+ data.pl = buffer.readBits(4);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: pl\n");
+ return false;
+ }
+ buffer.skipBits(1);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: \n");
+ return false;
+ }
+
+ data.pvi = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: pvi\n");
+ return false;
+ }
+
+ buffer.readUint8(data.qci);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: qci\n");
+ return false;
+ }
+
+ Uint16 lengthLeft = length;
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeUint8Array5(buffer, data.maxBitRateUl, lengthLeft, 5)))
+ {
+ errorStream.add((char *)"Failed to decode: maxBitRateUl\n");
+ return false;
+ }
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeUint8Array5(buffer, data.maxBitRateDl, lengthLeft, 5)))
+ {
+ errorStream.add((char *)"Failed to decode: maxBitRateDl\n");
+ return false;
+ }
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeUint8Array5(buffer, data.guraranteedBitRateUl, lengthLeft, 5)))
+ {
+ errorStream.add((char *)"Failed to decode: guraranteedBitRateUl\n");
+ return false;
+ }
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeUint8Array5(buffer, data.guaranteedBitRateDl, lengthLeft, 5)))
+ {
+ errorStream.add((char *)"Failed to decode: guaranteedBitRateDl\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE BearerQosIe\n");
+ return false;
+ }
+}
+void BearerQosIe::displayBearerQosIe_v(BearerQosIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"BearerQosIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add( (char *)"pci: ");
+ stream.add((Uint8)data.pci);
+ stream.endOfLine();
+
+ stream.add( (char *)"pl: ");
+ stream.add((Uint8)data.pl);
+ stream.endOfLine();
+
+ stream.add( (char *)"pvi: ");
+ stream.add((Uint8)data.pvi);
+ stream.endOfLine();
+
+ stream.add((char *)"qci: ");
+ stream.add(data.qci);
+ stream.endOfLine();
+
+ stream.add((char *)"maxBitRateUl:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displayUint8Array5_v(data.maxBitRateUl, stream);
+
+ stream.add((char *)"maxBitRateDl:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displayUint8Array5_v(data.maxBitRateDl, stream);
+
+ stream.add((char *)"guraranteedBitRateUl:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displayUint8Array5_v(data.guraranteedBitRateUl, stream);
+
+ stream.add((char *)"guaranteedBitRateDl:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displayUint8Array5_v(data.guaranteedBitRateDl, stream);
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/bearerQosIe.h b/src/gtpV2Codec/ieClasses/bearerQosIe.h
new file mode 100644
index 0000000..a998ea7
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/bearerQosIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef BEARERQOSIE_H_
+#define BEARERQOSIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class BearerQosIe: public GtpV2Ie {
+public:
+ BearerQosIe();
+ virtual ~BearerQosIe();
+
+ bool encodeBearerQosIe(MsgBuffer &buffer,
+ BearerQosIeData const &data);
+ bool decodeBearerQosIe(MsgBuffer &buffer,
+ BearerQosIeData &data, Uint16 length);
+ void displayBearerQosIe_v(BearerQosIeData const &data,
+ Debug &stream);
+};
+
+#endif /* BEARERQOSIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/bearerTftIe.cpp b/src/gtpV2Codec/ieClasses/bearerTftIe.cpp
new file mode 100644
index 0000000..a20fe38
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/bearerTftIe.cpp
@@ -0,0 +1,78 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "bearerTftIe.h"
+#include "dataTypeCodecUtils.h"
+
+BearerTftIe::BearerTftIe()
+{
+ ieType = 84;
+ // TODO
+
+}
+
+BearerTftIe::~BearerTftIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool BearerTftIe::encodeBearerTftIe(MsgBuffer &buffer, BearerTftIeData const &data)
+{
+ if (!(DataTypeCodecUtils::encodeUint8Array16(buffer, data.tft)))
+ {
+ errorStream.add((char *)"Encoding of tft failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool BearerTftIe::decodeBearerTftIe(MsgBuffer &buffer, BearerTftIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+
+ Uint16 lengthLeft = length;
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeUint8Array16(buffer, data.tft, lengthLeft, 0)))
+ {
+ errorStream.add((char *)"Failed to decode: tft\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE BearerTftIe\n");
+ return false;
+ }
+}
+void BearerTftIe::displayBearerTftIe_v(BearerTftIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"BearerTftIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add((char *)"tft:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displayUint8Array16_v(data.tft, stream);
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/bearerTftIe.h b/src/gtpV2Codec/ieClasses/bearerTftIe.h
new file mode 100644
index 0000000..8d2a322
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/bearerTftIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef BEARERTFTIE_H_
+#define BEARERTFTIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class BearerTftIe: public GtpV2Ie {
+public:
+ BearerTftIe();
+ virtual ~BearerTftIe();
+
+ bool encodeBearerTftIe(MsgBuffer &buffer,
+ BearerTftIeData const &data);
+ bool decodeBearerTftIe(MsgBuffer &buffer,
+ BearerTftIeData &data, Uint16 length);
+ void displayBearerTftIe_v(BearerTftIeData const &data,
+ Debug &stream);
+};
+
+#endif /* BEARERTFTIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/causeIe.cpp b/src/gtpV2Codec/ieClasses/causeIe.cpp
new file mode 100644
index 0000000..7629c05
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/causeIe.cpp
@@ -0,0 +1,162 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "causeIe.h"
+#include "dataTypeCodecUtils.h"
+
+CauseIe::CauseIe()
+{
+ ieType = 2;
+ // TODO
+
+}
+
+CauseIe::~CauseIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool CauseIe::encodeCauseIe(MsgBuffer &buffer, CauseIeData const &data)
+{
+ if (!(buffer.writeUint8(data.causeValue)))
+ {
+ errorStream.add((char *)"Encoding of causeValue failed\n");
+ return false;
+ }
+ buffer.skipBits(5);
+
+ if(!(buffer.writeBits(data.pce, 1)))
+ {
+ errorStream.add((char *)"Encoding of pce failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.pbe, 1)))
+ {
+ errorStream.add((char *)"Encoding of pbe failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.cs, 1)))
+ {
+ errorStream.add((char *)"Encoding of cs failed\n");
+ return false;
+ }
+ if (data.offendingIeDataPresent)
+ {
+ if (!(DataTypeCodecUtils::encodeOffendingIeData(buffer, data.offendingIeData)))
+ {
+ errorStream.add((char *)"Encoding of offendingIeData failed\n");
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool CauseIe::decodeCauseIe(MsgBuffer &buffer, CauseIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+
+ buffer.readUint8(data.causeValue);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: causeValue\n");
+ return false;
+ }
+ buffer.skipBits(5);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: \n");
+ return false;
+ }
+
+ data.pce = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: pce\n");
+ return false;
+ }
+ data.pbe = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: pbe\n");
+ return false;
+ }
+ data.cs = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: cs\n");
+ return false;
+ }
+
+ Uint16 lengthLeft = length;
+
+ if (length == 6)
+ {
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeOffendingIeData(buffer, data.offendingIeData, lengthLeft)))
+ {
+ errorStream.add((char *)"Failed to decode: offendingIeData\n");
+ return false;
+ }
+ data.offendingIeDataPresent = true;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE CauseIe\n");
+ return false;
+ }
+}
+void CauseIe::displayCauseIe_v(CauseIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"CauseIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add((char *)"causeValue: ");
+ stream.add(data.causeValue);
+ stream.endOfLine();
+
+ stream.add( (char *)"pce: ");
+ stream.add((Uint8)data.pce);
+ stream.endOfLine();
+
+ stream.add( (char *)"pbe: ");
+ stream.add((Uint8)data.pbe);
+ stream.endOfLine();
+
+ stream.add( (char *)"cs: ");
+ stream.add((Uint8)data.cs);
+ stream.endOfLine();
+
+ if (data.offendingIeDataPresent)
+ {
+ stream.add((char *)"offendingIeData:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displayOffendingIeData_v(data.offendingIeData, stream);
+ }
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/causeIe.h b/src/gtpV2Codec/ieClasses/causeIe.h
new file mode 100644
index 0000000..597ab2f
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/causeIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef CAUSEIE_H_
+#define CAUSEIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class CauseIe: public GtpV2Ie {
+public:
+ CauseIe();
+ virtual ~CauseIe();
+
+ bool encodeCauseIe(MsgBuffer &buffer,
+ CauseIeData const &data);
+ bool decodeCauseIe(MsgBuffer &buffer,
+ CauseIeData &data, Uint16 length);
+ void displayCauseIe_v(CauseIeData const &data,
+ Debug &stream);
+};
+
+#endif /* CAUSEIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/changeReportingActionIe.cpp b/src/gtpV2Codec/ieClasses/changeReportingActionIe.cpp
new file mode 100644
index 0000000..e217b7a
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/changeReportingActionIe.cpp
@@ -0,0 +1,87 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "changeReportingActionIe.h"
+#include "dataTypeCodecUtils.h"
+
+ChangeReportingActionIe::ChangeReportingActionIe()
+{
+ ieType = 131;
+ // TODO
+
+}
+
+ChangeReportingActionIe::~ChangeReportingActionIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool ChangeReportingActionIe::encodeChangeReportingActionIe(MsgBuffer &buffer, ChangeReportingActionIeData const &data)
+{
+ if (!(data.action< 7))
+ {
+ errorStream.add((char *)"Data validation failure: action\n");
+ return false;
+ }
+ if (!(buffer.writeUint8(data.action)))
+ {
+ errorStream.add((char *)"Encoding of action failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool ChangeReportingActionIe::decodeChangeReportingActionIe(MsgBuffer &buffer, ChangeReportingActionIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+
+ buffer.readUint8(data.action);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: action\n");
+ return false;
+ }
+ if (!(data.action< 7))
+ {
+ errorStream.add((char *)"Data validation failure : action\n");
+ return false; //TODO need to add validations
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE ChangeReportingActionIe\n");
+ return false;
+ }
+}
+void ChangeReportingActionIe::displayChangeReportingActionIe_v(ChangeReportingActionIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"ChangeReportingActionIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add((char *)"action: ");
+ stream.add(data.action);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/changeReportingActionIe.h b/src/gtpV2Codec/ieClasses/changeReportingActionIe.h
new file mode 100644
index 0000000..ec9a520
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/changeReportingActionIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef CHANGEREPORTINGACTIONIE_H_
+#define CHANGEREPORTINGACTIONIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class ChangeReportingActionIe: public GtpV2Ie {
+public:
+ ChangeReportingActionIe();
+ virtual ~ChangeReportingActionIe();
+
+ bool encodeChangeReportingActionIe(MsgBuffer &buffer,
+ ChangeReportingActionIeData const &data);
+ bool decodeChangeReportingActionIe(MsgBuffer &buffer,
+ ChangeReportingActionIeData &data, Uint16 length);
+ void displayChangeReportingActionIe_v(ChangeReportingActionIeData const &data,
+ Debug &stream);
+};
+
+#endif /* CHANGEREPORTINGACTIONIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/chargingCharacteristicsIe.cpp b/src/gtpV2Codec/ieClasses/chargingCharacteristicsIe.cpp
new file mode 100644
index 0000000..9724634
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/chargingCharacteristicsIe.cpp
@@ -0,0 +1,77 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "chargingCharacteristicsIe.h"
+#include "dataTypeCodecUtils.h"
+
+ChargingCharacteristicsIe::ChargingCharacteristicsIe()
+{
+ ieType = 95;
+ // TODO
+
+}
+
+ChargingCharacteristicsIe::~ChargingCharacteristicsIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool ChargingCharacteristicsIe::encodeChargingCharacteristicsIe(MsgBuffer &buffer, ChargingCharacteristicsIeData const &data)
+{
+ if (!(buffer.writeUint16(data.value)))
+ {
+ errorStream.add((char *)"Encoding of value failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool ChargingCharacteristicsIe::decodeChargingCharacteristicsIe(MsgBuffer &buffer, ChargingCharacteristicsIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+
+ buffer.readUint16(data.value);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: value\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE ChargingCharacteristicsIe\n");
+ return false;
+ }
+}
+void ChargingCharacteristicsIe::displayChargingCharacteristicsIe_v(ChargingCharacteristicsIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"ChargingCharacteristicsIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add((char *)"value: ");
+ stream.add(data.value);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/chargingCharacteristicsIe.h b/src/gtpV2Codec/ieClasses/chargingCharacteristicsIe.h
new file mode 100644
index 0000000..9e7eec5
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/chargingCharacteristicsIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef CHARGINGCHARACTERISTICSIE_H_
+#define CHARGINGCHARACTERISTICSIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class ChargingCharacteristicsIe: public GtpV2Ie {
+public:
+ ChargingCharacteristicsIe();
+ virtual ~ChargingCharacteristicsIe();
+
+ bool encodeChargingCharacteristicsIe(MsgBuffer &buffer,
+ ChargingCharacteristicsIeData const &data);
+ bool decodeChargingCharacteristicsIe(MsgBuffer &buffer,
+ ChargingCharacteristicsIeData &data, Uint16 length);
+ void displayChargingCharacteristicsIe_v(ChargingCharacteristicsIeData const &data,
+ Debug &stream);
+};
+
+#endif /* CHARGINGCHARACTERISTICSIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/chargingIdIe.cpp b/src/gtpV2Codec/ieClasses/chargingIdIe.cpp
new file mode 100644
index 0000000..c0585a4
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/chargingIdIe.cpp
@@ -0,0 +1,77 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "chargingIdIe.h"
+#include "dataTypeCodecUtils.h"
+
+ChargingIdIe::ChargingIdIe()
+{
+ ieType = 94;
+ // TODO
+
+}
+
+ChargingIdIe::~ChargingIdIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool ChargingIdIe::encodeChargingIdIe(MsgBuffer &buffer, ChargingIdIeData const &data)
+{
+ if (!(buffer.writeUint32(data.chargingIdValue)))
+ {
+ errorStream.add((char *)"Encoding of chargingIdValue failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool ChargingIdIe::decodeChargingIdIe(MsgBuffer &buffer, ChargingIdIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+
+ buffer.readUint32(data.chargingIdValue);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: chargingIdValue\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE ChargingIdIe\n");
+ return false;
+ }
+}
+void ChargingIdIe::displayChargingIdIe_v(ChargingIdIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"ChargingIdIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add((char *)"chargingIdValue: ");
+ stream.add(data.chargingIdValue);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/chargingIdIe.h b/src/gtpV2Codec/ieClasses/chargingIdIe.h
new file mode 100644
index 0000000..ef9ac61
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/chargingIdIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef CHARGINGIDIE_H_
+#define CHARGINGIDIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class ChargingIdIe: public GtpV2Ie {
+public:
+ ChargingIdIe();
+ virtual ~ChargingIdIe();
+
+ bool encodeChargingIdIe(MsgBuffer &buffer,
+ ChargingIdIeData const &data);
+ bool decodeChargingIdIe(MsgBuffer &buffer,
+ ChargingIdIeData &data, Uint16 length);
+ void displayChargingIdIe_v(ChargingIdIeData const &data,
+ Debug &stream);
+};
+
+#endif /* CHARGINGIDIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/cnOperatorSelectionEntityIe.cpp b/src/gtpV2Codec/ieClasses/cnOperatorSelectionEntityIe.cpp
new file mode 100644
index 0000000..5cd6480
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/cnOperatorSelectionEntityIe.cpp
@@ -0,0 +1,96 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "cnOperatorSelectionEntityIe.h"
+#include "dataTypeCodecUtils.h"
+
+CnOperatorSelectionEntityIe::CnOperatorSelectionEntityIe()
+{
+ ieType = 173;
+ // TODO
+
+}
+
+CnOperatorSelectionEntityIe::~CnOperatorSelectionEntityIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool CnOperatorSelectionEntityIe::encodeCnOperatorSelectionEntityIe(MsgBuffer &buffer, CnOperatorSelectionEntityIeData const &data)
+{
+ buffer.skipBits(6);
+
+ if (!(data.cnOpselectionEntity<= 3))
+ {
+ errorStream.add((char *)"Data validation failure: cnOpselectionEntity\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.cnOpselectionEntity, 2)))
+ {
+ errorStream.add((char *)"Encoding of cnOpselectionEntity failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool CnOperatorSelectionEntityIe::decodeCnOperatorSelectionEntityIe(MsgBuffer &buffer, CnOperatorSelectionEntityIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+ buffer.skipBits(6);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: \n");
+ return false;
+ }
+
+ data.cnOpselectionEntity = buffer.readBits(2);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: cnOpselectionEntity\n");
+ return false;
+ }
+ if (!(data.cnOpselectionEntity<= 3))
+ {
+ errorStream.add((char *)"Data validation failure : cnOpselectionEntity\n");
+ return false; //TODO need to add validations
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE CnOperatorSelectionEntityIe\n");
+ return false;
+ }
+}
+void CnOperatorSelectionEntityIe::displayCnOperatorSelectionEntityIe_v(CnOperatorSelectionEntityIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"CnOperatorSelectionEntityIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add( (char *)"cnOpselectionEntity: ");
+ stream.add((Uint8)data.cnOpselectionEntity);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/cnOperatorSelectionEntityIe.h b/src/gtpV2Codec/ieClasses/cnOperatorSelectionEntityIe.h
new file mode 100644
index 0000000..c6402f3
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/cnOperatorSelectionEntityIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef CNOPERATORSELECTIONENTITYIE_H_
+#define CNOPERATORSELECTIONENTITYIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class CnOperatorSelectionEntityIe: public GtpV2Ie {
+public:
+ CnOperatorSelectionEntityIe();
+ virtual ~CnOperatorSelectionEntityIe();
+
+ bool encodeCnOperatorSelectionEntityIe(MsgBuffer &buffer,
+ CnOperatorSelectionEntityIeData const &data);
+ bool decodeCnOperatorSelectionEntityIe(MsgBuffer &buffer,
+ CnOperatorSelectionEntityIeData &data, Uint16 length);
+ void displayCnOperatorSelectionEntityIe_v(CnOperatorSelectionEntityIeData const &data,
+ Debug &stream);
+};
+
+#endif /* CNOPERATORSELECTIONENTITYIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/counterIe.cpp b/src/gtpV2Codec/ieClasses/counterIe.cpp
new file mode 100644
index 0000000..51bd2fa
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/counterIe.cpp
@@ -0,0 +1,93 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "counterIe.h"
+#include "dataTypeCodecUtils.h"
+
+CounterIe::CounterIe()
+{
+ ieType = 199;
+ // TODO
+
+}
+
+CounterIe::~CounterIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool CounterIe::encodeCounterIe(MsgBuffer &buffer, CounterIeData const &data)
+{
+ if (!(buffer.writeUint32(data.timeStampValue)))
+ {
+ errorStream.add((char *)"Encoding of timeStampValue failed\n");
+ return false;
+ }
+ if (!(buffer.writeUint8(data.counterValue)))
+ {
+ errorStream.add((char *)"Encoding of counterValue failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool CounterIe::decodeCounterIe(MsgBuffer &buffer, CounterIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+
+ buffer.readUint32(data.timeStampValue);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: timeStampValue\n");
+ return false;
+ }
+
+ buffer.readUint8(data.counterValue);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: counterValue\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE CounterIe\n");
+ return false;
+ }
+}
+void CounterIe::displayCounterIe_v(CounterIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"CounterIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add((char *)"timeStampValue: ");
+ stream.add(data.timeStampValue);
+ stream.endOfLine();
+
+ stream.add((char *)"counterValue: ");
+ stream.add(data.counterValue);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/counterIe.h b/src/gtpV2Codec/ieClasses/counterIe.h
new file mode 100644
index 0000000..3d92082
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/counterIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef COUNTERIE_H_
+#define COUNTERIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class CounterIe: public GtpV2Ie {
+public:
+ CounterIe();
+ virtual ~CounterIe();
+
+ bool encodeCounterIe(MsgBuffer &buffer,
+ CounterIeData const &data);
+ bool decodeCounterIe(MsgBuffer &buffer,
+ CounterIeData &data, Uint16 length);
+ void displayCounterIe_v(CounterIeData const &data,
+ Debug &stream);
+};
+
+#endif /* COUNTERIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/csgInformationReportingActionIe.cpp b/src/gtpV2Codec/ieClasses/csgInformationReportingActionIe.cpp
new file mode 100644
index 0000000..4bd1461
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/csgInformationReportingActionIe.cpp
@@ -0,0 +1,118 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "csgInformationReportingActionIe.h"
+#include "dataTypeCodecUtils.h"
+
+CsgInformationReportingActionIe::CsgInformationReportingActionIe()
+{
+ ieType = 146;
+ // TODO
+
+}
+
+CsgInformationReportingActionIe::~CsgInformationReportingActionIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool CsgInformationReportingActionIe::encodeCsgInformationReportingActionIe(MsgBuffer &buffer, CsgInformationReportingActionIeData const &data)
+{
+ buffer.skipBits(5);
+
+ if(!(buffer.writeBits(data.uciuhc, 1)))
+ {
+ errorStream.add((char *)"Encoding of uciuhc failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.ucishc, 1)))
+ {
+ errorStream.add((char *)"Encoding of ucishc failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.ucicsg, 1)))
+ {
+ errorStream.add((char *)"Encoding of ucicsg failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool CsgInformationReportingActionIe::decodeCsgInformationReportingActionIe(MsgBuffer &buffer, CsgInformationReportingActionIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+ buffer.skipBits(5);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: \n");
+ return false;
+ }
+
+ data.uciuhc = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: uciuhc\n");
+ return false;
+ }
+ data.ucishc = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: ucishc\n");
+ return false;
+ }
+ data.ucicsg = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: ucicsg\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE CsgInformationReportingActionIe\n");
+ return false;
+ }
+}
+void CsgInformationReportingActionIe::displayCsgInformationReportingActionIe_v(CsgInformationReportingActionIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"CsgInformationReportingActionIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add( (char *)"uciuhc: ");
+ stream.add((Uint8)data.uciuhc);
+ stream.endOfLine();
+
+ stream.add( (char *)"ucishc: ");
+ stream.add((Uint8)data.ucishc);
+ stream.endOfLine();
+
+ stream.add( (char *)"ucicsg: ");
+ stream.add((Uint8)data.ucicsg);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/csgInformationReportingActionIe.h b/src/gtpV2Codec/ieClasses/csgInformationReportingActionIe.h
new file mode 100644
index 0000000..30499ae
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/csgInformationReportingActionIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef CSGINFORMATIONREPORTINGACTIONIE_H_
+#define CSGINFORMATIONREPORTINGACTIONIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class CsgInformationReportingActionIe: public GtpV2Ie {
+public:
+ CsgInformationReportingActionIe();
+ virtual ~CsgInformationReportingActionIe();
+
+ bool encodeCsgInformationReportingActionIe(MsgBuffer &buffer,
+ CsgInformationReportingActionIeData const &data);
+ bool decodeCsgInformationReportingActionIe(MsgBuffer &buffer,
+ CsgInformationReportingActionIeData &data, Uint16 length);
+ void displayCsgInformationReportingActionIe_v(CsgInformationReportingActionIeData const &data,
+ Debug &stream);
+};
+
+#endif /* CSGINFORMATIONREPORTINGACTIONIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/dataTypeCodecUtils.cpp b/src/gtpV2Codec/ieClasses/dataTypeCodecUtils.cpp
new file mode 100644
index 0000000..5444c3c
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/dataTypeCodecUtils.cpp
@@ -0,0 +1,1408 @@
+/*
+ * 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/datatypetemplate.cpp.tt>
+ ******************************************************************************/
+#include "dataTypeCodecUtils.h"
+
+// TODO
+
+DataTypeCodecUtils::DataTypeCodecUtils()
+{
+ // TODO
+}
+
+DataTypeCodecUtils::~DataTypeCodecUtils() {
+ // TODO Auto-generated destructor stub
+}
+
+
+bool DataTypeCodecUtils::encodeCgiField(MsgBuffer &buffer, CgiField const &data)
+{
+ buffer.writeBits(data.mccDigit2, 4);
+ buffer.writeBits(data.mccDigit1, 4);
+ buffer.writeBits(data.mncDigit3, 4);
+ buffer.writeBits(data.mccDigit3, 4);
+ buffer.writeBits(data.mncDigit2, 4);
+ buffer.writeBits(data.mncDigit1, 4);
+ buffer.writeUint16(data.locationAreaCode);
+ buffer.writeUint16(data.cellIdentity);
+ return true;
+}
+
+bool DataTypeCodecUtils::decodeCgiField(MsgBuffer &buffer,CgiField &data,
+ Uint16 length)
+{
+
+ Uint16 typeBoundary = buffer.getCurrentIndex() + length;
+ data.mccDigit2 = buffer.readBits(4);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: mccDigit2\n");
+ return false;
+ }
+ data.mccDigit1 = buffer.readBits(4);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: mccDigit1\n");
+ return false;
+ }
+ data.mncDigit3 = buffer.readBits(4);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: mncDigit3\n");
+ return false;
+ }
+ data.mccDigit3 = buffer.readBits(4);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: mccDigit3\n");
+ return false;
+ }
+ data.mncDigit2 = buffer.readBits(4);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: mncDigit2\n");
+ return false;
+ }
+ data.mncDigit1 = buffer.readBits(4);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: mncDigit1\n");
+ return false;
+ }
+
+ buffer.readUint16(data.locationAreaCode);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: locationAreaCode\n");
+ return false;
+ }
+
+ buffer.readUint16(data.cellIdentity);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: cellIdentity\n");
+ return false;
+ }
+
+ return true;
+}
+
+void DataTypeCodecUtils::displayCgiField_v(CgiField const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"CgiField:");
+ stream.incrIndent();
+ stream.endOfLine();
+ stream.add((char *)"mccDigit2 = ");
+ stream.add(data.mccDigit2);
+ stream.endOfLine();
+ stream.add((char *)"mccDigit1 = ");
+ stream.add(data.mccDigit1);
+ stream.endOfLine();
+ stream.add((char *)"mncDigit3 = ");
+ stream.add(data.mncDigit3);
+ stream.endOfLine();
+ stream.add((char *)"mccDigit3 = ");
+ stream.add(data.mccDigit3);
+ stream.endOfLine();
+ stream.add((char *)"mncDigit2 = ");
+ stream.add(data.mncDigit2);
+ stream.endOfLine();
+ stream.add((char *)"mncDigit1 = ");
+ stream.add(data.mncDigit1);
+ stream.endOfLine();
+ stream.add((char *)"locationAreaCode = ");
+ stream.add(data.locationAreaCode);
+ stream.endOfLine();
+ stream.add((char *)"cellIdentity = ");
+ stream.add(data.cellIdentity);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+bool DataTypeCodecUtils::encodeOffendingIeData(MsgBuffer &buffer, OffendingIeData const &data)
+{
+ buffer.writeUint8(data.typeOfOffendingIe);
+ buffer.skipBits(4);
+
+ buffer.writeUint16(data.lengthOfOffendingIe);
+ buffer.writeBits(data.instanceOfOffendingIe, 4);
+ return true;
+}
+
+bool DataTypeCodecUtils::decodeOffendingIeData(MsgBuffer &buffer,OffendingIeData &data,
+ Uint16 length)
+{
+
+ Uint16 typeBoundary = buffer.getCurrentIndex() + length;
+
+ buffer.readUint8(data.typeOfOffendingIe);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: typeOfOffendingIe\n");
+ return false;
+ }
+ buffer.skipBits(4);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: \n");
+ return false;
+ }
+
+ buffer.readUint16(data.lengthOfOffendingIe);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: lengthOfOffendingIe\n");
+ return false;
+ }
+ data.instanceOfOffendingIe = buffer.readBits(4);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: instanceOfOffendingIe\n");
+ return false;
+ }
+
+ return true;
+}
+
+void DataTypeCodecUtils::displayOffendingIeData_v(OffendingIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"OffendingIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+ stream.add((char *)"typeOfOffendingIe = ");
+ stream.add(data.typeOfOffendingIe);
+ stream.endOfLine();
+ stream.add((char *)"lengthOfOffendingIe = ");
+ stream.add(data.lengthOfOffendingIe);
+ stream.endOfLine();
+ stream.add((char *)"instanceOfOffendingIe = ");
+ stream.add(data.instanceOfOffendingIe);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+bool DataTypeCodecUtils::encodeSaiField(MsgBuffer &buffer, SaiField const &data)
+{
+ buffer.writeBits(data.mccDigit2, 4);
+ buffer.writeBits(data.mccDigit1, 4);
+ buffer.writeBits(data.mncDigit3, 4);
+ buffer.writeBits(data.mccDigit3, 4);
+ buffer.writeBits(data.mncDigit2, 4);
+ buffer.writeBits(data.mncDigit1, 4);
+ buffer.writeUint16(data.locationAreaCode);
+ buffer.writeUint16(data.serviceAreaCode);
+ return true;
+}
+
+bool DataTypeCodecUtils::decodeSaiField(MsgBuffer &buffer,SaiField &data,
+ Uint16 length)
+{
+
+ Uint16 typeBoundary = buffer.getCurrentIndex() + length;
+ data.mccDigit2 = buffer.readBits(4);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: mccDigit2\n");
+ return false;
+ }
+ data.mccDigit1 = buffer.readBits(4);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: mccDigit1\n");
+ return false;
+ }
+ data.mncDigit3 = buffer.readBits(4);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: mncDigit3\n");
+ return false;
+ }
+ data.mccDigit3 = buffer.readBits(4);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: mccDigit3\n");
+ return false;
+ }
+ data.mncDigit2 = buffer.readBits(4);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: mncDigit2\n");
+ return false;
+ }
+ data.mncDigit1 = buffer.readBits(4);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: mncDigit1\n");
+ return false;
+ }
+
+ buffer.readUint16(data.locationAreaCode);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: locationAreaCode\n");
+ return false;
+ }
+
+ buffer.readUint16(data.serviceAreaCode);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: serviceAreaCode\n");
+ return false;
+ }
+
+ return true;
+}
+
+void DataTypeCodecUtils::displaySaiField_v(SaiField const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"SaiField:");
+ stream.incrIndent();
+ stream.endOfLine();
+ stream.add((char *)"mccDigit2 = ");
+ stream.add(data.mccDigit2);
+ stream.endOfLine();
+ stream.add((char *)"mccDigit1 = ");
+ stream.add(data.mccDigit1);
+ stream.endOfLine();
+ stream.add((char *)"mncDigit3 = ");
+ stream.add(data.mncDigit3);
+ stream.endOfLine();
+ stream.add((char *)"mccDigit3 = ");
+ stream.add(data.mccDigit3);
+ stream.endOfLine();
+ stream.add((char *)"mncDigit2 = ");
+ stream.add(data.mncDigit2);
+ stream.endOfLine();
+ stream.add((char *)"mncDigit1 = ");
+ stream.add(data.mncDigit1);
+ stream.endOfLine();
+ stream.add((char *)"locationAreaCode = ");
+ stream.add(data.locationAreaCode);
+ stream.endOfLine();
+ stream.add((char *)"serviceAreaCode = ");
+ stream.add(data.serviceAreaCode);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+bool DataTypeCodecUtils::encodeRaiField(MsgBuffer &buffer, RaiField const &data)
+{
+ buffer.writeBits(data.mccDigit2, 4);
+ buffer.writeBits(data.mccDigit1, 4);
+ buffer.writeBits(data.mncDigit3, 4);
+ buffer.writeBits(data.mccDigit3, 4);
+ buffer.writeBits(data.mncDigit2, 4);
+ buffer.writeBits(data.mncDigit1, 4);
+ buffer.writeUint16(data.locationAreaCode);
+ buffer.writeUint16(data.routintAreaCode);
+ return true;
+}
+
+bool DataTypeCodecUtils::decodeRaiField(MsgBuffer &buffer,RaiField &data,
+ Uint16 length)
+{
+
+ Uint16 typeBoundary = buffer.getCurrentIndex() + length;
+ data.mccDigit2 = buffer.readBits(4);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: mccDigit2\n");
+ return false;
+ }
+ data.mccDigit1 = buffer.readBits(4);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: mccDigit1\n");
+ return false;
+ }
+ data.mncDigit3 = buffer.readBits(4);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: mncDigit3\n");
+ return false;
+ }
+ data.mccDigit3 = buffer.readBits(4);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: mccDigit3\n");
+ return false;
+ }
+ data.mncDigit2 = buffer.readBits(4);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: mncDigit2\n");
+ return false;
+ }
+ data.mncDigit1 = buffer.readBits(4);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: mncDigit1\n");
+ return false;
+ }
+
+ buffer.readUint16(data.locationAreaCode);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: locationAreaCode\n");
+ return false;
+ }
+
+ buffer.readUint16(data.routintAreaCode);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: routintAreaCode\n");
+ return false;
+ }
+
+ return true;
+}
+
+void DataTypeCodecUtils::displayRaiField_v(RaiField const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"RaiField:");
+ stream.incrIndent();
+ stream.endOfLine();
+ stream.add((char *)"mccDigit2 = ");
+ stream.add(data.mccDigit2);
+ stream.endOfLine();
+ stream.add((char *)"mccDigit1 = ");
+ stream.add(data.mccDigit1);
+ stream.endOfLine();
+ stream.add((char *)"mncDigit3 = ");
+ stream.add(data.mncDigit3);
+ stream.endOfLine();
+ stream.add((char *)"mccDigit3 = ");
+ stream.add(data.mccDigit3);
+ stream.endOfLine();
+ stream.add((char *)"mncDigit2 = ");
+ stream.add(data.mncDigit2);
+ stream.endOfLine();
+ stream.add((char *)"mncDigit1 = ");
+ stream.add(data.mncDigit1);
+ stream.endOfLine();
+ stream.add((char *)"locationAreaCode = ");
+ stream.add(data.locationAreaCode);
+ stream.endOfLine();
+ stream.add((char *)"routintAreaCode = ");
+ stream.add(data.routintAreaCode);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+bool DataTypeCodecUtils::encodeTaiField(MsgBuffer &buffer, TaiField const &data)
+{
+ buffer.writeBits(data.mccDigit2, 4);
+ buffer.writeBits(data.mccDigit1, 4);
+ buffer.writeBits(data.mncDigit3, 4);
+ buffer.writeBits(data.mccDigit3, 4);
+ buffer.writeBits(data.mncDigit2, 4);
+ buffer.writeBits(data.mncDigit1, 4);
+ buffer.writeUint16(data.trackingAreaCode);
+ return true;
+}
+
+bool DataTypeCodecUtils::decodeTaiField(MsgBuffer &buffer,TaiField &data,
+ Uint16 length)
+{
+
+ Uint16 typeBoundary = buffer.getCurrentIndex() + length;
+ data.mccDigit2 = buffer.readBits(4);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: mccDigit2\n");
+ return false;
+ }
+ data.mccDigit1 = buffer.readBits(4);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: mccDigit1\n");
+ return false;
+ }
+ data.mncDigit3 = buffer.readBits(4);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: mncDigit3\n");
+ return false;
+ }
+ data.mccDigit3 = buffer.readBits(4);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: mccDigit3\n");
+ return false;
+ }
+ data.mncDigit2 = buffer.readBits(4);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: mncDigit2\n");
+ return false;
+ }
+ data.mncDigit1 = buffer.readBits(4);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: mncDigit1\n");
+ return false;
+ }
+
+ buffer.readUint16(data.trackingAreaCode);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: trackingAreaCode\n");
+ return false;
+ }
+
+ return true;
+}
+
+void DataTypeCodecUtils::displayTaiField_v(TaiField const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"TaiField:");
+ stream.incrIndent();
+ stream.endOfLine();
+ stream.add((char *)"mccDigit2 = ");
+ stream.add(data.mccDigit2);
+ stream.endOfLine();
+ stream.add((char *)"mccDigit1 = ");
+ stream.add(data.mccDigit1);
+ stream.endOfLine();
+ stream.add((char *)"mncDigit3 = ");
+ stream.add(data.mncDigit3);
+ stream.endOfLine();
+ stream.add((char *)"mccDigit3 = ");
+ stream.add(data.mccDigit3);
+ stream.endOfLine();
+ stream.add((char *)"mncDigit2 = ");
+ stream.add(data.mncDigit2);
+ stream.endOfLine();
+ stream.add((char *)"mncDigit1 = ");
+ stream.add(data.mncDigit1);
+ stream.endOfLine();
+ stream.add((char *)"trackingAreaCode = ");
+ stream.add(data.trackingAreaCode);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+bool DataTypeCodecUtils::encodeEcgiField(MsgBuffer &buffer, EcgiField const &data)
+{
+ buffer.writeBits(data.mccDigit2, 4);
+ buffer.writeBits(data.mccDigit1, 4);
+ buffer.writeBits(data.mncDigit3, 4);
+ buffer.writeBits(data.mccDigit3, 4);
+ buffer.writeBits(data.mncDigit2, 4);
+ buffer.writeBits(data.mncDigit1, 4);
+ if (!(data.eUtranCellId<0x0FFFFFFF))
+ {
+ errorStream.add((char *)"Data validation failure: eUtranCellId\n");
+ return false; //TODO need to add validations
+ }
+ buffer.writeUint32(data.eUtranCellId);
+ return true;
+}
+
+bool DataTypeCodecUtils::decodeEcgiField(MsgBuffer &buffer,EcgiField &data,
+ Uint16 length)
+{
+
+ Uint16 typeBoundary = buffer.getCurrentIndex() + length;
+ data.mccDigit2 = buffer.readBits(4);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: mccDigit2\n");
+ return false;
+ }
+ data.mccDigit1 = buffer.readBits(4);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: mccDigit1\n");
+ return false;
+ }
+ data.mncDigit3 = buffer.readBits(4);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: mncDigit3\n");
+ return false;
+ }
+ data.mccDigit3 = buffer.readBits(4);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: mccDigit3\n");
+ return false;
+ }
+ data.mncDigit2 = buffer.readBits(4);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: mncDigit2\n");
+ return false;
+ }
+ data.mncDigit1 = buffer.readBits(4);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: mncDigit1\n");
+ return false;
+ }
+
+ buffer.readUint32(data.eUtranCellId);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: eUtranCellId\n");
+ return false;
+ }
+ if (!(data.eUtranCellId<0x0FFFFFFF))
+ {
+ errorStream.add((char *)"Data validation failure: eUtranCellId\n");
+ return false; //TODO need to add validations
+ }
+
+ return true;
+}
+
+void DataTypeCodecUtils::displayEcgiField_v(EcgiField const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"EcgiField:");
+ stream.incrIndent();
+ stream.endOfLine();
+ stream.add((char *)"mccDigit2 = ");
+ stream.add(data.mccDigit2);
+ stream.endOfLine();
+ stream.add((char *)"mccDigit1 = ");
+ stream.add(data.mccDigit1);
+ stream.endOfLine();
+ stream.add((char *)"mncDigit3 = ");
+ stream.add(data.mncDigit3);
+ stream.endOfLine();
+ stream.add((char *)"mccDigit3 = ");
+ stream.add(data.mccDigit3);
+ stream.endOfLine();
+ stream.add((char *)"mncDigit2 = ");
+ stream.add(data.mncDigit2);
+ stream.endOfLine();
+ stream.add((char *)"mncDigit1 = ");
+ stream.add(data.mncDigit1);
+ stream.endOfLine();
+ stream.add((char *)"eUtranCellId = ");
+ stream.add(data.eUtranCellId);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+bool DataTypeCodecUtils::encodeLaiField(MsgBuffer &buffer, LaiField const &data)
+{
+ buffer.writeBits(data.mccDigit2, 4);
+ buffer.writeBits(data.mccDigit1, 4);
+ buffer.writeBits(data.mncDigit3, 4);
+ buffer.writeBits(data.mccDigit3, 4);
+ buffer.writeBits(data.mncDigit2, 4);
+ buffer.writeBits(data.mncDigit1, 4);
+ buffer.writeUint16(data.locationAreaCode);
+ return true;
+}
+
+bool DataTypeCodecUtils::decodeLaiField(MsgBuffer &buffer,LaiField &data,
+ Uint16 length)
+{
+
+ Uint16 typeBoundary = buffer.getCurrentIndex() + length;
+ data.mccDigit2 = buffer.readBits(4);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: mccDigit2\n");
+ return false;
+ }
+ data.mccDigit1 = buffer.readBits(4);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: mccDigit1\n");
+ return false;
+ }
+ data.mncDigit3 = buffer.readBits(4);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: mncDigit3\n");
+ return false;
+ }
+ data.mccDigit3 = buffer.readBits(4);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: mccDigit3\n");
+ return false;
+ }
+ data.mncDigit2 = buffer.readBits(4);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: mncDigit2\n");
+ return false;
+ }
+ data.mncDigit1 = buffer.readBits(4);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: mncDigit1\n");
+ return false;
+ }
+
+ buffer.readUint16(data.locationAreaCode);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: locationAreaCode\n");
+ return false;
+ }
+
+ return true;
+}
+
+void DataTypeCodecUtils::displayLaiField_v(LaiField const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"LaiField:");
+ stream.incrIndent();
+ stream.endOfLine();
+ stream.add((char *)"mccDigit2 = ");
+ stream.add(data.mccDigit2);
+ stream.endOfLine();
+ stream.add((char *)"mccDigit1 = ");
+ stream.add(data.mccDigit1);
+ stream.endOfLine();
+ stream.add((char *)"mncDigit3 = ");
+ stream.add(data.mncDigit3);
+ stream.endOfLine();
+ stream.add((char *)"mccDigit3 = ");
+ stream.add(data.mccDigit3);
+ stream.endOfLine();
+ stream.add((char *)"mncDigit2 = ");
+ stream.add(data.mncDigit2);
+ stream.endOfLine();
+ stream.add((char *)"mncDigit1 = ");
+ stream.add(data.mncDigit1);
+ stream.endOfLine();
+ stream.add((char *)"locationAreaCode = ");
+ stream.add(data.locationAreaCode);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+bool DataTypeCodecUtils::encodeIpAddressV4(MsgBuffer &buffer, IpAddressV4 const &data)
+{
+ buffer.writeUint32(data.ipValue);
+ return true;
+}
+
+bool DataTypeCodecUtils::decodeIpAddressV4(MsgBuffer &buffer,IpAddressV4 &data,
+ Uint16 length)
+{
+
+ Uint16 typeBoundary = buffer.getCurrentIndex() + length;
+
+ buffer.readUint32(data.ipValue);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary: ipValue\n");
+ return false;
+ }
+
+ return true;
+}
+
+void DataTypeCodecUtils::displayIpAddressV4_v(IpAddressV4 const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"IpAddressV4:");
+ stream.incrIndent();
+ stream.endOfLine();
+ stream.add((char *)"ipValue = ");
+ stream.add(data.ipValue);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+bool DataTypeCodecUtils::encodeIpAddressV6(MsgBuffer &buffer, IpAddressV6 const &data)
+{
+ if (!(DataTypeCodecUtils::encodeUint8Array16(buffer, data.ipValue)))
+ {
+ errorStream.add((char *)"Failed to encode ipValue\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool DataTypeCodecUtils::decodeIpAddressV6(MsgBuffer &buffer,IpAddressV6 &data,
+ Uint16 length)
+{
+
+ Uint16 typeBoundary = buffer.getCurrentIndex() + length;
+ Uint16 lengthLeft = typeBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeUint8Array16(buffer, data.ipValue, lengthLeft, 0)))
+ {
+ errorStream.add((char *)"Failed to decode: ipValue\n");
+ return false;
+ }
+
+ return true;
+}
+
+void DataTypeCodecUtils::displayIpAddressV6_v(IpAddressV6 const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"IpAddressV6:");
+ stream.incrIndent();
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+bool DataTypeCodecUtils::encodeUint16Array16(MsgBuffer &buffer,
+ Uint16Array16 const &data)
+{
+ Uint16 i;
+ for (i = 0; i < data.count; i++)
+ {
+ buffer.writeUint16(data.values[i]);
+ }
+ return true;
+}
+
+bool DataTypeCodecUtils::decodeUint16Array16(MsgBuffer &buffer,
+ Uint16Array16 &data, Uint16 length, Uint16 count)
+{
+ Uint16 i = 0;
+ data.count = 0;
+ bool readTillEnd = (count == 0);
+ Uint16 startIndex = buffer.getCurrentIndex();
+ Uint16 typeBoundary = startIndex+length;
+
+ while ((i < count)||(readTillEnd && (buffer.getCurrentIndex() < typeBoundary)))
+ {
+ buffer.readUint16(data.values[i]);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary:Uint16Array16\n");
+ return false;
+ }
+ data.count++;
+ i++;
+ }
+ return true;
+}
+
+void DataTypeCodecUtils::displayUint16Array16_v(Uint16Array16 const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"Uint16Array16: Count: ");
+ stream.add(data.count);
+ stream.incrIndent();
+ stream.endOfLine();
+ Uint16 i;
+ for (i = 0; i < data.count; i++)
+ {
+ stream.add(data.values[i]);
+ stream.endOfLine();
+ }
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+bool DataTypeCodecUtils::encodeUint8Array16(MsgBuffer &buffer,
+ Uint8Array16 const &data)
+{
+ Uint16 i;
+ for (i = 0; i < data.count; i++)
+ {
+ buffer.writeUint8(data.values[i]);
+ }
+ return true;
+}
+
+bool DataTypeCodecUtils::decodeUint8Array16(MsgBuffer &buffer,
+ Uint8Array16 &data, Uint16 length, Uint16 count)
+{
+ Uint16 i = 0;
+ data.count = 0;
+ bool readTillEnd = (count == 0);
+ Uint16 startIndex = buffer.getCurrentIndex();
+ Uint16 typeBoundary = startIndex+length;
+
+ while ((i < count)||(readTillEnd && (buffer.getCurrentIndex() < typeBoundary)))
+ {
+ buffer.readUint8(data.values[i]);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary:Uint8Array16\n");
+ return false;
+ }
+ data.count++;
+ i++;
+ }
+ return true;
+}
+
+void DataTypeCodecUtils::displayUint8Array16_v(Uint8Array16 const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"Uint8Array16: Count: ");
+ stream.add(data.count);
+ stream.incrIndent();
+ stream.endOfLine();
+ Uint16 i;
+ for (i = 0; i < data.count; i++)
+ {
+ stream.add(data.values[i]);
+ stream.endOfLine();
+ }
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+bool DataTypeCodecUtils::encodeUint8Array32(MsgBuffer &buffer,
+ Uint8Array32 const &data)
+{
+ Uint16 i;
+ for (i = 0; i < data.count; i++)
+ {
+ buffer.writeUint8(data.values[i]);
+ }
+ return true;
+}
+
+bool DataTypeCodecUtils::decodeUint8Array32(MsgBuffer &buffer,
+ Uint8Array32 &data, Uint16 length, Uint16 count)
+{
+ Uint16 i = 0;
+ data.count = 0;
+ bool readTillEnd = (count == 0);
+ Uint16 startIndex = buffer.getCurrentIndex();
+ Uint16 typeBoundary = startIndex+length;
+
+ while ((i < count)||(readTillEnd && (buffer.getCurrentIndex() < typeBoundary)))
+ {
+ buffer.readUint8(data.values[i]);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary:Uint8Array32\n");
+ return false;
+ }
+ data.count++;
+ i++;
+ }
+ return true;
+}
+
+void DataTypeCodecUtils::displayUint8Array32_v(Uint8Array32 const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"Uint8Array32: Count: ");
+ stream.add(data.count);
+ stream.incrIndent();
+ stream.endOfLine();
+ Uint16 i;
+ for (i = 0; i < data.count; i++)
+ {
+ stream.add(data.values[i]);
+ stream.endOfLine();
+ }
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+bool DataTypeCodecUtils::encodeUint8Array5(MsgBuffer &buffer,
+ Uint8Array5 const &data)
+{
+ Uint16 i;
+ for (i = 0; i < data.count; i++)
+ {
+ buffer.writeUint8(data.values[i]);
+ }
+ return true;
+}
+
+bool DataTypeCodecUtils::decodeUint8Array5(MsgBuffer &buffer,
+ Uint8Array5 &data, Uint16 length, Uint16 count)
+{
+ Uint16 i = 0;
+ data.count = 0;
+ bool readTillEnd = (count == 0);
+ Uint16 startIndex = buffer.getCurrentIndex();
+ Uint16 typeBoundary = startIndex+length;
+
+ while ((i < count)||(readTillEnd && (buffer.getCurrentIndex() < typeBoundary)))
+ {
+ buffer.readUint8(data.values[i]);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary:Uint8Array5\n");
+ return false;
+ }
+ data.count++;
+ i++;
+ }
+ return true;
+}
+
+void DataTypeCodecUtils::displayUint8Array5_v(Uint8Array5 const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"Uint8Array5: Count: ");
+ stream.add(data.count);
+ stream.incrIndent();
+ stream.endOfLine();
+ Uint16 i;
+ for (i = 0; i < data.count; i++)
+ {
+ stream.add(data.values[i]);
+ stream.endOfLine();
+ }
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+bool DataTypeCodecUtils::encodeUint8Array4(MsgBuffer &buffer,
+ Uint8Array4 const &data)
+{
+ Uint16 i;
+ for (i = 0; i < data.count; i++)
+ {
+ buffer.writeUint8(data.values[i]);
+ }
+ return true;
+}
+
+bool DataTypeCodecUtils::decodeUint8Array4(MsgBuffer &buffer,
+ Uint8Array4 &data, Uint16 length, Uint16 count)
+{
+ Uint16 i = 0;
+ data.count = 0;
+ bool readTillEnd = (count == 0);
+ Uint16 startIndex = buffer.getCurrentIndex();
+ Uint16 typeBoundary = startIndex+length;
+
+ while ((i < count)||(readTillEnd && (buffer.getCurrentIndex() < typeBoundary)))
+ {
+ buffer.readUint8(data.values[i]);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary:Uint8Array4\n");
+ return false;
+ }
+ data.count++;
+ i++;
+ }
+ return true;
+}
+
+void DataTypeCodecUtils::displayUint8Array4_v(Uint8Array4 const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"Uint8Array4: Count: ");
+ stream.add(data.count);
+ stream.incrIndent();
+ stream.endOfLine();
+ Uint16 i;
+ for (i = 0; i < data.count; i++)
+ {
+ stream.add(data.values[i]);
+ stream.endOfLine();
+ }
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+bool DataTypeCodecUtils::encodeUint8Array512(MsgBuffer &buffer,
+ Uint8Array512 const &data)
+{
+ Uint16 i;
+ for (i = 0; i < data.count; i++)
+ {
+ buffer.writeUint8(data.values[i]);
+ }
+ return true;
+}
+
+bool DataTypeCodecUtils::decodeUint8Array512(MsgBuffer &buffer,
+ Uint8Array512 &data, Uint16 length, Uint16 count)
+{
+ Uint16 i = 0;
+ data.count = 0;
+ bool readTillEnd = (count == 0);
+ Uint16 startIndex = buffer.getCurrentIndex();
+ Uint16 typeBoundary = startIndex+length;
+
+ while ((i < count)||(readTillEnd && (buffer.getCurrentIndex() < typeBoundary)))
+ {
+ buffer.readUint8(data.values[i]);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary:Uint8Array512\n");
+ return false;
+ }
+ data.count++;
+ i++;
+ }
+ return true;
+}
+
+void DataTypeCodecUtils::displayUint8Array512_v(Uint8Array512 const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"Uint8Array512: Count: ");
+ stream.add(data.count);
+ stream.incrIndent();
+ stream.endOfLine();
+ Uint16 i;
+ for (i = 0; i < data.count; i++)
+ {
+ stream.add(data.values[i]);
+ stream.endOfLine();
+ }
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+bool DataTypeCodecUtils::encodeUint8Array255(MsgBuffer &buffer,
+ Uint8Array255 const &data)
+{
+ Uint16 i;
+ for (i = 0; i < data.count; i++)
+ {
+ buffer.writeUint8(data.values[i]);
+ }
+ return true;
+}
+
+bool DataTypeCodecUtils::decodeUint8Array255(MsgBuffer &buffer,
+ Uint8Array255 &data, Uint16 length, Uint16 count)
+{
+ Uint16 i = 0;
+ data.count = 0;
+ bool readTillEnd = (count == 0);
+ Uint16 startIndex = buffer.getCurrentIndex();
+ Uint16 typeBoundary = startIndex+length;
+
+ while ((i < count)||(readTillEnd && (buffer.getCurrentIndex() < typeBoundary)))
+ {
+ buffer.readUint8(data.values[i]);
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary:Uint8Array255\n");
+ return false;
+ }
+ data.count++;
+ i++;
+ }
+ return true;
+}
+
+void DataTypeCodecUtils::displayUint8Array255_v(Uint8Array255 const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"Uint8Array255: Count: ");
+ stream.add(data.count);
+ stream.incrIndent();
+ stream.endOfLine();
+ Uint16 i;
+ for (i = 0; i < data.count; i++)
+ {
+ stream.add(data.values[i]);
+ stream.endOfLine();
+ }
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+bool DataTypeCodecUtils::encodeCgiFieldArray64(MsgBuffer &buffer,
+ CgiFieldArray64 const &data)
+{
+ Uint16 i;
+ for (i = 0; i < data.count; i++)
+ {
+ if (!(DataTypeCodecUtils::encodeCgiField(buffer, data.values[i])))
+ {
+ errorStream.add((char *)"Failed to encode CgiFieldArray64\n");
+ return false;
+ }
+ }
+ return true;
+}
+
+bool DataTypeCodecUtils::decodeCgiFieldArray64(MsgBuffer &buffer,
+ CgiFieldArray64 &data, Uint16 length, Uint16 count)
+{
+ Uint16 i = 0;
+ data.count = 0;
+ bool readTillEnd = (count == 0);
+ Uint16 startIndex = buffer.getCurrentIndex();
+ Uint16 typeBoundary = startIndex+length;
+
+ while ((i < count)||(readTillEnd && (buffer.getCurrentIndex() < typeBoundary)))
+ {
+ Uint16 lengthLeft = typeBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeCgiField(buffer, data.values[i], lengthLeft)))
+
+ {
+ errorStream.add((char *)"Failed to encode CgiFieldArray64\n");
+ return false;
+ }
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary:CgiFieldArray64\n");
+ return false;
+ }
+ data.count++;
+ i++;
+ }
+ return true;
+}
+
+void DataTypeCodecUtils::displayCgiFieldArray64_v(CgiFieldArray64 const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"CgiFieldArray64: Count: ");
+ stream.add(data.count);
+ stream.incrIndent();
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+bool DataTypeCodecUtils::encodeSaiFieldArray64(MsgBuffer &buffer,
+ SaiFieldArray64 const &data)
+{
+ Uint16 i;
+ for (i = 0; i < data.count; i++)
+ {
+ if (!(DataTypeCodecUtils::encodeSaiField(buffer, data.values[i])))
+ {
+ errorStream.add((char *)"Failed to encode SaiFieldArray64\n");
+ return false;
+ }
+ }
+ return true;
+}
+
+bool DataTypeCodecUtils::decodeSaiFieldArray64(MsgBuffer &buffer,
+ SaiFieldArray64 &data, Uint16 length, Uint16 count)
+{
+ Uint16 i = 0;
+ data.count = 0;
+ bool readTillEnd = (count == 0);
+ Uint16 startIndex = buffer.getCurrentIndex();
+ Uint16 typeBoundary = startIndex+length;
+
+ while ((i < count)||(readTillEnd && (buffer.getCurrentIndex() < typeBoundary)))
+ {
+ Uint16 lengthLeft = typeBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeSaiField(buffer, data.values[i], lengthLeft)))
+
+ {
+ errorStream.add((char *)"Failed to encode SaiFieldArray64\n");
+ return false;
+ }
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary:SaiFieldArray64\n");
+ return false;
+ }
+ data.count++;
+ i++;
+ }
+ return true;
+}
+
+void DataTypeCodecUtils::displaySaiFieldArray64_v(SaiFieldArray64 const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"SaiFieldArray64: Count: ");
+ stream.add(data.count);
+ stream.incrIndent();
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+bool DataTypeCodecUtils::encodeEcgiFieldArray64(MsgBuffer &buffer,
+ EcgiFieldArray64 const &data)
+{
+ Uint16 i;
+ for (i = 0; i < data.count; i++)
+ {
+ if (!(DataTypeCodecUtils::encodeEcgiField(buffer, data.values[i])))
+ {
+ errorStream.add((char *)"Failed to encode EcgiFieldArray64\n");
+ return false;
+ }
+ }
+ return true;
+}
+
+bool DataTypeCodecUtils::decodeEcgiFieldArray64(MsgBuffer &buffer,
+ EcgiFieldArray64 &data, Uint16 length, Uint16 count)
+{
+ Uint16 i = 0;
+ data.count = 0;
+ bool readTillEnd = (count == 0);
+ Uint16 startIndex = buffer.getCurrentIndex();
+ Uint16 typeBoundary = startIndex+length;
+
+ while ((i < count)||(readTillEnd && (buffer.getCurrentIndex() < typeBoundary)))
+ {
+ Uint16 lengthLeft = typeBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeEcgiField(buffer, data.values[i], lengthLeft)))
+
+ {
+ errorStream.add((char *)"Failed to encode EcgiFieldArray64\n");
+ return false;
+ }
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary:EcgiFieldArray64\n");
+ return false;
+ }
+ data.count++;
+ i++;
+ }
+ return true;
+}
+
+void DataTypeCodecUtils::displayEcgiFieldArray64_v(EcgiFieldArray64 const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"EcgiFieldArray64: Count: ");
+ stream.add(data.count);
+ stream.incrIndent();
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+bool DataTypeCodecUtils::encodeTaiFieldArray15(MsgBuffer &buffer,
+ TaiFieldArray15 const &data)
+{
+ Uint16 i;
+ for (i = 0; i < data.count; i++)
+ {
+ if (!(DataTypeCodecUtils::encodeTaiField(buffer, data.values[i])))
+ {
+ errorStream.add((char *)"Failed to encode TaiFieldArray15\n");
+ return false;
+ }
+ }
+ return true;
+}
+
+bool DataTypeCodecUtils::decodeTaiFieldArray15(MsgBuffer &buffer,
+ TaiFieldArray15 &data, Uint16 length, Uint16 count)
+{
+ Uint16 i = 0;
+ data.count = 0;
+ bool readTillEnd = (count == 0);
+ Uint16 startIndex = buffer.getCurrentIndex();
+ Uint16 typeBoundary = startIndex+length;
+
+ while ((i < count)||(readTillEnd && (buffer.getCurrentIndex() < typeBoundary)))
+ {
+ Uint16 lengthLeft = typeBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeTaiField(buffer, data.values[i], lengthLeft)))
+
+ {
+ errorStream.add((char *)"Failed to encode TaiFieldArray15\n");
+ return false;
+ }
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary:TaiFieldArray15\n");
+ return false;
+ }
+ data.count++;
+ i++;
+ }
+ return true;
+}
+
+void DataTypeCodecUtils::displayTaiFieldArray15_v(TaiFieldArray15 const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"TaiFieldArray15: Count: ");
+ stream.add(data.count);
+ stream.incrIndent();
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+bool DataTypeCodecUtils::encodeRaiFieldArray15(MsgBuffer &buffer,
+ RaiFieldArray15 const &data)
+{
+ Uint16 i;
+ for (i = 0; i < data.count; i++)
+ {
+ if (!(DataTypeCodecUtils::encodeRaiField(buffer, data.values[i])))
+ {
+ errorStream.add((char *)"Failed to encode RaiFieldArray15\n");
+ return false;
+ }
+ }
+ return true;
+}
+
+bool DataTypeCodecUtils::decodeRaiFieldArray15(MsgBuffer &buffer,
+ RaiFieldArray15 &data, Uint16 length, Uint16 count)
+{
+ Uint16 i = 0;
+ data.count = 0;
+ bool readTillEnd = (count == 0);
+ Uint16 startIndex = buffer.getCurrentIndex();
+ Uint16 typeBoundary = startIndex+length;
+
+ while ((i < count)||(readTillEnd && (buffer.getCurrentIndex() < typeBoundary)))
+ {
+ Uint16 lengthLeft = typeBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeRaiField(buffer, data.values[i], lengthLeft)))
+
+ {
+ errorStream.add((char *)"Failed to encode RaiFieldArray15\n");
+ return false;
+ }
+ if (buffer.getCurrentIndex() > typeBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond type boundary:RaiFieldArray15\n");
+ return false;
+ }
+ data.count++;
+ i++;
+ }
+ return true;
+}
+
+void DataTypeCodecUtils::displayRaiFieldArray15_v(RaiFieldArray15 const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"RaiFieldArray15: Count: ");
+ stream.add(data.count);
+ stream.incrIndent();
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/dataTypeCodecUtils.h b/src/gtpV2Codec/ieClasses/dataTypeCodecUtils.h
new file mode 100644
index 0000000..d5ac028
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/dataTypeCodecUtils.h
@@ -0,0 +1,171 @@
+/*
+ * 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/datatypetemplate.h.tt>
+ ******************************************************************************/
+
+#ifndef DATATYPECODECUTILS_H_
+#define DATATYPECODECUTILS_H_
+
+#include <sstream>
+#include <msgBuffer.h>
+#include "gtpV2IeDataTypes.h"
+#include "gtpV2DataTypes.h"
+#include "manual/gtpV2DataTypes_Manual.h"
+
+//TODO Includes
+
+class DataTypeCodecUtils {
+public:
+ DataTypeCodecUtils();
+ virtual ~DataTypeCodecUtils();
+
+
+ static bool encodeCgiField(MsgBuffer &buffer, CgiField const &data);
+ static bool decodeCgiField(MsgBuffer &buffer, CgiField &data,
+ Uint16 length);
+ static void displayCgiField_v(CgiField const &data, Debug &stream);
+
+ static bool encodeOffendingIeData(MsgBuffer &buffer, OffendingIeData const &data);
+ static bool decodeOffendingIeData(MsgBuffer &buffer, OffendingIeData &data,
+ Uint16 length);
+ static void displayOffendingIeData_v(OffendingIeData const &data, Debug &stream);
+
+ static bool encodeSaiField(MsgBuffer &buffer, SaiField const &data);
+ static bool decodeSaiField(MsgBuffer &buffer, SaiField &data,
+ Uint16 length);
+ static void displaySaiField_v(SaiField const &data, Debug &stream);
+
+ static bool encodeRaiField(MsgBuffer &buffer, RaiField const &data);
+ static bool decodeRaiField(MsgBuffer &buffer, RaiField &data,
+ Uint16 length);
+ static void displayRaiField_v(RaiField const &data, Debug &stream);
+
+ static bool encodeTaiField(MsgBuffer &buffer, TaiField const &data);
+ static bool decodeTaiField(MsgBuffer &buffer, TaiField &data,
+ Uint16 length);
+ static void displayTaiField_v(TaiField const &data, Debug &stream);
+
+ static bool encodeEcgiField(MsgBuffer &buffer, EcgiField const &data);
+ static bool decodeEcgiField(MsgBuffer &buffer, EcgiField &data,
+ Uint16 length);
+ static void displayEcgiField_v(EcgiField const &data, Debug &stream);
+
+ static bool encodeLaiField(MsgBuffer &buffer, LaiField const &data);
+ static bool decodeLaiField(MsgBuffer &buffer, LaiField &data,
+ Uint16 length);
+ static void displayLaiField_v(LaiField const &data, Debug &stream);
+
+ static bool encodeIpAddressV4(MsgBuffer &buffer, IpAddressV4 const &data);
+ static bool decodeIpAddressV4(MsgBuffer &buffer, IpAddressV4 &data,
+ Uint16 length);
+ static void displayIpAddressV4_v(IpAddressV4 const &data, Debug &stream);
+
+ static bool encodeIpAddressV6(MsgBuffer &buffer, IpAddressV6 const &data);
+ static bool decodeIpAddressV6(MsgBuffer &buffer, IpAddressV6 &data,
+ Uint16 length);
+ static void displayIpAddressV6_v(IpAddressV6 const &data, Debug &stream);
+
+
+ // The following methods are generated to encode, decode and display array types
+
+ static bool encodeUint16Array16(MsgBuffer &buffer, Uint16Array16 const &data);
+ static bool decodeUint16Array16(MsgBuffer &buffer, Uint16Array16 &data,
+ Uint16 length, Uint16 count);
+ static void displayUint16Array16_v(Uint16Array16 const &data, Debug &stream);
+
+
+ static bool encodeUint8Array16(MsgBuffer &buffer, Uint8Array16 const &data);
+ static bool decodeUint8Array16(MsgBuffer &buffer, Uint8Array16 &data,
+ Uint16 length, Uint16 count);
+ static void displayUint8Array16_v(Uint8Array16 const &data, Debug &stream);
+
+
+ static bool encodeUint8Array32(MsgBuffer &buffer, Uint8Array32 const &data);
+ static bool decodeUint8Array32(MsgBuffer &buffer, Uint8Array32 &data,
+ Uint16 length, Uint16 count);
+ static void displayUint8Array32_v(Uint8Array32 const &data, Debug &stream);
+
+
+ static bool encodeUint8Array5(MsgBuffer &buffer, Uint8Array5 const &data);
+ static bool decodeUint8Array5(MsgBuffer &buffer, Uint8Array5 &data,
+ Uint16 length, Uint16 count);
+ static void displayUint8Array5_v(Uint8Array5 const &data, Debug &stream);
+
+
+ static bool encodeUint8Array4(MsgBuffer &buffer, Uint8Array4 const &data);
+ static bool decodeUint8Array4(MsgBuffer &buffer, Uint8Array4 &data,
+ Uint16 length, Uint16 count);
+ static void displayUint8Array4_v(Uint8Array4 const &data, Debug &stream);
+
+
+ static bool encodeUint8Array512(MsgBuffer &buffer, Uint8Array512 const &data);
+ static bool decodeUint8Array512(MsgBuffer &buffer, Uint8Array512 &data,
+ Uint16 length, Uint16 count);
+ static void displayUint8Array512_v(Uint8Array512 const &data, Debug &stream);
+
+
+ static bool encodeUint8Array255(MsgBuffer &buffer, Uint8Array255 const &data);
+ static bool decodeUint8Array255(MsgBuffer &buffer, Uint8Array255 &data,
+ Uint16 length, Uint16 count);
+ static void displayUint8Array255_v(Uint8Array255 const &data, Debug &stream);
+
+
+ static bool encodeCgiFieldArray64(MsgBuffer &buffer, CgiFieldArray64 const &data);
+ static bool decodeCgiFieldArray64(MsgBuffer &buffer, CgiFieldArray64 &data,
+ Uint16 length, Uint16 count);
+ static void displayCgiFieldArray64_v(CgiFieldArray64 const &data, Debug &stream);
+
+
+ static bool encodeSaiFieldArray64(MsgBuffer &buffer, SaiFieldArray64 const &data);
+ static bool decodeSaiFieldArray64(MsgBuffer &buffer, SaiFieldArray64 &data,
+ Uint16 length, Uint16 count);
+ static void displaySaiFieldArray64_v(SaiFieldArray64 const &data, Debug &stream);
+
+
+ static bool encodeEcgiFieldArray64(MsgBuffer &buffer, EcgiFieldArray64 const &data);
+ static bool decodeEcgiFieldArray64(MsgBuffer &buffer, EcgiFieldArray64 &data,
+ Uint16 length, Uint16 count);
+ static void displayEcgiFieldArray64_v(EcgiFieldArray64 const &data, Debug &stream);
+
+
+ static bool encodeTaiFieldArray15(MsgBuffer &buffer, TaiFieldArray15 const &data);
+ static bool decodeTaiFieldArray15(MsgBuffer &buffer, TaiFieldArray15 &data,
+ Uint16 length, Uint16 count);
+ static void displayTaiFieldArray15_v(TaiFieldArray15 const &data, Debug &stream);
+
+
+ static bool encodeRaiFieldArray15(MsgBuffer &buffer, RaiFieldArray15 const &data);
+ static bool decodeRaiFieldArray15(MsgBuffer &buffer, RaiFieldArray15 &data,
+ Uint16 length, Uint16 count);
+ static void displayRaiFieldArray15_v(RaiFieldArray15 const &data, Debug &stream);
+
+
+ // The following methods are to be written manually
+ // See DataTypeCodecUtils_Manual.cc for implementation
+
+ static bool encodeDigitRegister(MsgBuffer &buffer, DigitRegister const &data);
+ static bool decodeDigitRegister(MsgBuffer &buffer, DigitRegister &data,
+ Uint16 length);
+ static void displayDigitRegister_v(DigitRegister const &data, Debug &stream);
+
+
+};
+
+#endif /*DATATYPECODECUTILS_H_*/
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/delayValueIe.cpp b/src/gtpV2Codec/ieClasses/delayValueIe.cpp
new file mode 100644
index 0000000..a6504d4
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/delayValueIe.cpp
@@ -0,0 +1,87 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "delayValueIe.h"
+#include "dataTypeCodecUtils.h"
+
+DelayValueIe::DelayValueIe()
+{
+ ieType = 92;
+ // TODO
+
+}
+
+DelayValueIe::~DelayValueIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool DelayValueIe::encodeDelayValueIe(MsgBuffer &buffer, DelayValueIeData const &data)
+{
+ if (!(data.delayValue% 50 == 0 || data.delayValue== 0))
+ {
+ errorStream.add((char *)"Data validation failure: delayValue\n");
+ return false;
+ }
+ if (!(buffer.writeUint8(data.delayValue)))
+ {
+ errorStream.add((char *)"Encoding of delayValue failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool DelayValueIe::decodeDelayValueIe(MsgBuffer &buffer, DelayValueIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+
+ buffer.readUint8(data.delayValue);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: delayValue\n");
+ return false;
+ }
+ if (!(data.delayValue% 50 == 0 || data.delayValue== 0))
+ {
+ errorStream.add((char *)"Data validation failure : delayValue\n");
+ return false; //TODO need to add validations
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE DelayValueIe\n");
+ return false;
+ }
+}
+void DelayValueIe::displayDelayValueIe_v(DelayValueIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"DelayValueIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add((char *)"delayValue: ");
+ stream.add(data.delayValue);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/delayValueIe.h b/src/gtpV2Codec/ieClasses/delayValueIe.h
new file mode 100644
index 0000000..ff01eaf
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/delayValueIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef DELAYVALUEIE_H_
+#define DELAYVALUEIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class DelayValueIe: public GtpV2Ie {
+public:
+ DelayValueIe();
+ virtual ~DelayValueIe();
+
+ bool encodeDelayValueIe(MsgBuffer &buffer,
+ DelayValueIeData const &data);
+ bool decodeDelayValueIe(MsgBuffer &buffer,
+ DelayValueIeData &data, Uint16 length);
+ void displayDelayValueIe_v(DelayValueIeData const &data,
+ Debug &stream);
+};
+
+#endif /* DELAYVALUEIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/ebiIe.cpp b/src/gtpV2Codec/ieClasses/ebiIe.cpp
new file mode 100644
index 0000000..f58c7ad
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/ebiIe.cpp
@@ -0,0 +1,86 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "ebiIe.h"
+#include "dataTypeCodecUtils.h"
+
+EbiIe::EbiIe()
+{
+ ieType = 73;
+ // TODO
+
+}
+
+EbiIe::~EbiIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool EbiIe::encodeEbiIe(MsgBuffer &buffer, EbiIeData const &data)
+{
+ buffer.skipBits(4);
+
+ if(!(buffer.writeBits(data.epsBearerId, 4)))
+ {
+ errorStream.add((char *)"Encoding of epsBearerId failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool EbiIe::decodeEbiIe(MsgBuffer &buffer, EbiIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+ buffer.skipBits(4);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: \n");
+ return false;
+ }
+
+ data.epsBearerId = buffer.readBits(4);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: epsBearerId\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE EbiIe\n");
+ return false;
+ }
+}
+void EbiIe::displayEbiIe_v(EbiIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"EbiIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add( (char *)"epsBearerId: ");
+ stream.add((Uint8)data.epsBearerId);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/ebiIe.h b/src/gtpV2Codec/ieClasses/ebiIe.h
new file mode 100644
index 0000000..32ca2cc
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/ebiIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef EBIIE_H_
+#define EBIIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class EbiIe: public GtpV2Ie {
+public:
+ EbiIe();
+ virtual ~EbiIe();
+
+ bool encodeEbiIe(MsgBuffer &buffer,
+ EbiIeData const &data);
+ bool decodeEbiIe(MsgBuffer &buffer,
+ EbiIeData &data, Uint16 length);
+ void displayEbiIe_v(EbiIeData const &data,
+ Debug &stream);
+};
+
+#endif /* EBIIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/epcTimerIe.cpp b/src/gtpV2Codec/ieClasses/epcTimerIe.cpp
new file mode 100644
index 0000000..06309be
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/epcTimerIe.cpp
@@ -0,0 +1,93 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "epcTimerIe.h"
+#include "dataTypeCodecUtils.h"
+
+EpcTimerIe::EpcTimerIe()
+{
+ ieType = 156;
+ // TODO
+
+}
+
+EpcTimerIe::~EpcTimerIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool EpcTimerIe::encodeEpcTimerIe(MsgBuffer &buffer, EpcTimerIeData const &data)
+{
+ if(!(buffer.writeBits(data.timerUnit, 3)))
+ {
+ errorStream.add((char *)"Encoding of timerUnit failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.timerValue, 5)))
+ {
+ errorStream.add((char *)"Encoding of timerValue failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool EpcTimerIe::decodeEpcTimerIe(MsgBuffer &buffer, EpcTimerIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+ data.timerUnit = buffer.readBits(3);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: timerUnit\n");
+ return false;
+ }
+ data.timerValue = buffer.readBits(5);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: timerValue\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE EpcTimerIe\n");
+ return false;
+ }
+}
+void EpcTimerIe::displayEpcTimerIe_v(EpcTimerIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"EpcTimerIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add( (char *)"timerUnit: ");
+ stream.add((Uint8)data.timerUnit);
+ stream.endOfLine();
+
+ stream.add( (char *)"timerValue: ");
+ stream.add((Uint8)data.timerValue);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/epcTimerIe.h b/src/gtpV2Codec/ieClasses/epcTimerIe.h
new file mode 100644
index 0000000..cdb6056
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/epcTimerIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef EPCTIMERIE_H_
+#define EPCTIMERIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class EpcTimerIe: public GtpV2Ie {
+public:
+ EpcTimerIe();
+ virtual ~EpcTimerIe();
+
+ bool encodeEpcTimerIe(MsgBuffer &buffer,
+ EpcTimerIeData const &data);
+ bool decodeEpcTimerIe(MsgBuffer &buffer,
+ EpcTimerIeData &data, Uint16 length);
+ void displayEpcTimerIe_v(EpcTimerIeData const &data,
+ Debug &stream);
+};
+
+#endif /* EPCTIMERIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/epcoIe.cpp b/src/gtpV2Codec/ieClasses/epcoIe.cpp
new file mode 100644
index 0000000..8c9ed11
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/epcoIe.cpp
@@ -0,0 +1,78 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "epcoIe.h"
+#include "dataTypeCodecUtils.h"
+
+EpcoIe::EpcoIe()
+{
+ ieType = 197;
+ // TODO
+
+}
+
+EpcoIe::~EpcoIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool EpcoIe::encodeEpcoIe(MsgBuffer &buffer, EpcoIeData const &data)
+{
+ if (!(DataTypeCodecUtils::encodeUint8Array16(buffer, data.epco)))
+ {
+ errorStream.add((char *)"Encoding of epco failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool EpcoIe::decodeEpcoIe(MsgBuffer &buffer, EpcoIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+
+ Uint16 lengthLeft = length;
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeUint8Array16(buffer, data.epco, lengthLeft, 0)))
+ {
+ errorStream.add((char *)"Failed to decode: epco\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE EpcoIe\n");
+ return false;
+ }
+}
+void EpcoIe::displayEpcoIe_v(EpcoIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"EpcoIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add((char *)"epco:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displayUint8Array16_v(data.epco, stream);
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/epcoIe.h b/src/gtpV2Codec/ieClasses/epcoIe.h
new file mode 100644
index 0000000..2661c45
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/epcoIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef EPCOIE_H_
+#define EPCOIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class EpcoIe: public GtpV2Ie {
+public:
+ EpcoIe();
+ virtual ~EpcoIe();
+
+ bool encodeEpcoIe(MsgBuffer &buffer,
+ EpcoIeData const &data);
+ bool decodeEpcoIe(MsgBuffer &buffer,
+ EpcoIeData &data, Uint16 length);
+ void displayEpcoIe_v(EpcoIeData const &data,
+ Debug &stream);
+};
+
+#endif /* EPCOIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/epdgsOverloadControlInformationInModifyBearerRequest.cpp b/src/gtpV2Codec/ieClasses/epdgsOverloadControlInformationInModifyBearerRequest.cpp
new file mode 100644
index 0000000..9d7477c
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/epdgsOverloadControlInformationInModifyBearerRequest.cpp
@@ -0,0 +1,306 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "epdgsOverloadControlInformationInModifyBearerRequest.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+#include "epcTimerIe.h"
+
+EpdgsOverloadControlInformationInModifyBearerRequest::
+EpdgsOverloadControlInformationInModifyBearerRequest()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // overloadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // overloadReductionMetric
+ mandatoryIeSet.insert(mandIe);
+ mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0; // periodOfValidity
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+EpdgsOverloadControlInformationInModifyBearerRequest::
+~EpdgsOverloadControlInformationInModifyBearerRequest()
+{
+
+}
+bool EpdgsOverloadControlInformationInModifyBearerRequest::
+encodeEpdgsOverloadControlInformationInModifyBearerRequest(MsgBuffer &buffer,
+ EpdgsOverloadControlInformationInModifyBearerRequestData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.overloadReductionMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadReductionMetric\n");
+ return false;
+ }
+
+
+
+ // 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.periodOfValidity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: periodOfValidity\n");
+ return false;
+ }
+ return rc;
+}
+
+bool EpdgsOverloadControlInformationInModifyBearerRequest::
+decodeEpdgsOverloadControlInformationInModifyBearerRequest(MsgBuffer &buffer,
+ EpdgsOverloadControlInformationInModifyBearerRequestData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.overloadReductionMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadReductionMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.periodOfValidity, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: periodOfValidity\n");
+ return false;
+ }
+ Uint16 mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void EpdgsOverloadControlInformationInModifyBearerRequest::
+displayEpdgsOverloadControlInformationInModifyBearerRequestData_v
+(EpdgsOverloadControlInformationInModifyBearerRequestData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"EpdgsOverloadControlInformationInModifyBearerRequest:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/epdgsOverloadControlInformationInModifyBearerRequest.h b/src/gtpV2Codec/ieClasses/epdgsOverloadControlInformationInModifyBearerRequest.h
new file mode 100644
index 0000000..fe8f7f9
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/epdgsOverloadControlInformationInModifyBearerRequest.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef EPDGSOVERLOADCONTROLINFORMATIONINMODIFYBEARERREQUEST_H_
+#define EPDGSOVERLOADCONTROLINFORMATIONINMODIFYBEARERREQUEST_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class EpdgsOverloadControlInformationInModifyBearerRequest:public GtpV2GroupedIe
+{
+public:
+ EpdgsOverloadControlInformationInModifyBearerRequest();
+ virtual ~EpdgsOverloadControlInformationInModifyBearerRequest();
+ bool encodeEpdgsOverloadControlInformationInModifyBearerRequest(MsgBuffer &buffer,
+ EpdgsOverloadControlInformationInModifyBearerRequestData
+ const &data);
+
+ bool decodeEpdgsOverloadControlInformationInModifyBearerRequest (MsgBuffer &buffer,
+ EpdgsOverloadControlInformationInModifyBearerRequestData
+ & data, Uint16 length);
+
+ void displayEpdgsOverloadControlInformationInModifyBearerRequestData_v
+ (EpdgsOverloadControlInformationInModifyBearerRequestData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/fContainerIe.cpp b/src/gtpV2Codec/ieClasses/fContainerIe.cpp
new file mode 100644
index 0000000..a387c44
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/fContainerIe.cpp
@@ -0,0 +1,112 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "fContainerIe.h"
+#include "dataTypeCodecUtils.h"
+
+FContainerIe::FContainerIe()
+{
+ ieType = 118;
+ // TODO
+
+}
+
+FContainerIe::~FContainerIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool FContainerIe::encodeFContainerIe(MsgBuffer &buffer, FContainerIeData const &data)
+{
+ buffer.skipBits(4);
+
+ if (!(data.containerType<= 4))
+ {
+ errorStream.add((char *)"Data validation failure: containerType\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.containerType, 4)))
+ {
+ errorStream.add((char *)"Encoding of containerType failed\n");
+ return false;
+ }
+ if (!(buffer.writeUint8(data.fContainerField)))
+ {
+ errorStream.add((char *)"Encoding of fContainerField failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool FContainerIe::decodeFContainerIe(MsgBuffer &buffer, FContainerIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+ buffer.skipBits(4);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: \n");
+ return false;
+ }
+
+ data.containerType = buffer.readBits(4);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: containerType\n");
+ return false;
+ }
+ if (!(data.containerType<= 4))
+ {
+ errorStream.add((char *)"Data validation failure : containerType\n");
+ return false; //TODO need to add validations
+ }
+
+ buffer.readUint8(data.fContainerField);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: fContainerField\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE FContainerIe\n");
+ return false;
+ }
+}
+void FContainerIe::displayFContainerIe_v(FContainerIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"FContainerIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add( (char *)"containerType: ");
+ stream.add((Uint8)data.containerType);
+ stream.endOfLine();
+
+ stream.add((char *)"fContainerField: ");
+ stream.add(data.fContainerField);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/fContainerIe.h b/src/gtpV2Codec/ieClasses/fContainerIe.h
new file mode 100644
index 0000000..298cbe2
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/fContainerIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef FCONTAINERIE_H_
+#define FCONTAINERIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class FContainerIe: public GtpV2Ie {
+public:
+ FContainerIe();
+ virtual ~FContainerIe();
+
+ bool encodeFContainerIe(MsgBuffer &buffer,
+ FContainerIeData const &data);
+ bool decodeFContainerIe(MsgBuffer &buffer,
+ FContainerIeData &data, Uint16 length);
+ void displayFContainerIe_v(FContainerIeData const &data,
+ Debug &stream);
+};
+
+#endif /* FCONTAINERIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/fTeidIe.cpp b/src/gtpV2Codec/ieClasses/fTeidIe.cpp
new file mode 100644
index 0000000..250d168
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/fTeidIe.cpp
@@ -0,0 +1,177 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "fTeidIe.h"
+#include "dataTypeCodecUtils.h"
+
+FTeidIe::FTeidIe()
+{
+ ieType = 87;
+ // TODO
+
+}
+
+FTeidIe::~FTeidIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool FTeidIe::encodeFTeidIe(MsgBuffer &buffer, FTeidIeData const &data)
+{
+ if(!(buffer.writeBits(data.ipv4present, 1)))
+ {
+ errorStream.add((char *)"Encoding of ipv4present failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.ipv6present, 1)))
+ {
+ errorStream.add((char *)"Encoding of ipv6present failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.interfaceType, 6)))
+ {
+ errorStream.add((char *)"Encoding of interfaceType failed\n");
+ return false;
+ }
+ if (!(buffer.writeUint32(data.teidGreKey)))
+ {
+ errorStream.add((char *)"Encoding of teidGreKey failed\n");
+ return false;
+ }
+ if (data.ipv4present)
+ {
+ if (!(DataTypeCodecUtils::encodeIpAddressV4(buffer, data.ipV4Address)))
+ {
+ errorStream.add((char *)"Encoding of ipV4Address failed\n");
+ return false;
+ }
+ }
+ if (data.ipv6present)
+ {
+ if (!(DataTypeCodecUtils::encodeIpAddressV6(buffer, data.ipV6Address)))
+ {
+ errorStream.add((char *)"Encoding of ipV6Address failed\n");
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool FTeidIe::decodeFTeidIe(MsgBuffer &buffer, FTeidIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+ data.ipv4present = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: ipv4present\n");
+ return false;
+ }
+ data.ipv6present = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: ipv6present\n");
+ return false;
+ }
+ data.interfaceType = buffer.readBits(6);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: interfaceType\n");
+ return false;
+ }
+
+ buffer.readUint32(data.teidGreKey);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: teidGreKey\n");
+ return false;
+ }
+
+ Uint16 lengthLeft = length;
+
+ if (data.ipv4present)
+ {
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeIpAddressV4(buffer, data.ipV4Address, lengthLeft)))
+ {
+ errorStream.add((char *)"Failed to decode: ipV4Address\n");
+ return false;
+ }
+ }
+
+ if (data.ipv6present)
+ {
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeIpAddressV6(buffer, data.ipV6Address, lengthLeft)))
+ {
+ errorStream.add((char *)"Failed to decode: ipV6Address\n");
+ return false;
+ }
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE FTeidIe\n");
+ return false;
+ }
+}
+void FTeidIe::displayFTeidIe_v(FTeidIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"FTeidIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add( (char *)"ipv4present: ");
+ stream.add((Uint8)data.ipv4present);
+ stream.endOfLine();
+
+ stream.add( (char *)"ipv6present: ");
+ stream.add((Uint8)data.ipv6present);
+ stream.endOfLine();
+
+ stream.add( (char *)"interfaceType: ");
+ stream.add((Uint8)data.interfaceType);
+ stream.endOfLine();
+
+ stream.add((char *)"teidGreKey: ");
+ stream.add(data.teidGreKey);
+ stream.endOfLine();
+
+ if (data.ipv4present)
+ {
+ stream.add((char *)"ipV4Address:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displayIpAddressV4_v(data.ipV4Address, stream);
+ }
+
+ if (data.ipv6present)
+ {
+ stream.add((char *)"ipV6Address:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displayIpAddressV6_v(data.ipV6Address, stream);
+ }
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/fTeidIe.h b/src/gtpV2Codec/ieClasses/fTeidIe.h
new file mode 100644
index 0000000..8e8d75c
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/fTeidIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef FTEIDIE_H_
+#define FTEIDIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class FTeidIe: public GtpV2Ie {
+public:
+ FTeidIe();
+ virtual ~FTeidIe();
+
+ bool encodeFTeidIe(MsgBuffer &buffer,
+ FTeidIeData const &data);
+ bool decodeFTeidIe(MsgBuffer &buffer,
+ FTeidIeData &data, Uint16 length);
+ void displayFTeidIe_v(FTeidIeData const &data,
+ Debug &stream);
+};
+
+#endif /* FTEIDIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/failedBearerContextsInDeleteBearerRequest.cpp b/src/gtpV2Codec/ieClasses/failedBearerContextsInDeleteBearerRequest.cpp
new file mode 100644
index 0000000..522341c
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/failedBearerContextsInDeleteBearerRequest.cpp
@@ -0,0 +1,244 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "failedBearerContextsInDeleteBearerRequest.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "ebiIe.h"
+#include "causeIe.h"
+
+FailedBearerContextsInDeleteBearerRequest::
+FailedBearerContextsInDeleteBearerRequest()
+{
+ Uint16 mandIe;
+ mandIe = EbiIeType;
+ mandIe = (mandIe << 8) | 0; // epsBearerId
+ mandatoryIeSet.insert(mandIe);
+ mandIe = CauseIeType;
+ mandIe = (mandIe << 8) | 0; // cause
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+FailedBearerContextsInDeleteBearerRequest::
+~FailedBearerContextsInDeleteBearerRequest()
+{
+
+}
+bool FailedBearerContextsInDeleteBearerRequest::
+encodeFailedBearerContextsInDeleteBearerRequest(MsgBuffer &buffer,
+ FailedBearerContextsInDeleteBearerRequestData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // 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;
+ }
+
+
+
+ // 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;
+ }
+ return rc;
+}
+
+bool FailedBearerContextsInDeleteBearerRequest::
+decodeFailedBearerContextsInDeleteBearerRequest(MsgBuffer &buffer,
+ FailedBearerContextsInDeleteBearerRequestData
+ &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.epsBearerId, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: epsBearerId\n");
+ return false;
+ }
+ Uint16 mandIe = EbiIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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;
+ }
+ Uint16 mandIe = CauseIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void FailedBearerContextsInDeleteBearerRequest::
+displayFailedBearerContextsInDeleteBearerRequestData_v
+(FailedBearerContextsInDeleteBearerRequestData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"FailedBearerContextsInDeleteBearerRequest:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/failedBearerContextsInDeleteBearerRequest.h b/src/gtpV2Codec/ieClasses/failedBearerContextsInDeleteBearerRequest.h
new file mode 100644
index 0000000..c2c9ea0
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/failedBearerContextsInDeleteBearerRequest.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef FAILEDBEARERCONTEXTSINDELETEBEARERREQUEST_H_
+#define FAILEDBEARERCONTEXTSINDELETEBEARERREQUEST_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class FailedBearerContextsInDeleteBearerRequest:public GtpV2GroupedIe
+{
+public:
+ FailedBearerContextsInDeleteBearerRequest();
+ virtual ~FailedBearerContextsInDeleteBearerRequest();
+ bool encodeFailedBearerContextsInDeleteBearerRequest(MsgBuffer &buffer,
+ FailedBearerContextsInDeleteBearerRequestData
+ const &data);
+
+ bool decodeFailedBearerContextsInDeleteBearerRequest (MsgBuffer &buffer,
+ FailedBearerContextsInDeleteBearerRequestData
+ & data, Uint16 length);
+
+ void displayFailedBearerContextsInDeleteBearerRequestData_v
+ (FailedBearerContextsInDeleteBearerRequestData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/fqCsidIe.cpp b/src/gtpV2Codec/ieClasses/fqCsidIe.cpp
new file mode 100644
index 0000000..aa43dbe
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/fqCsidIe.cpp
@@ -0,0 +1,186 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "fqCsidIe.h"
+#include "dataTypeCodecUtils.h"
+
+FqCsidIe::FqCsidIe()
+{
+ ieType = 132;
+ // TODO
+
+}
+
+FqCsidIe::~FqCsidIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool FqCsidIe::encodeFqCsidIe(MsgBuffer &buffer, FqCsidIeData const &data)
+{
+ if(!(buffer.writeBits(data.nodeIdType, 4)))
+ {
+ errorStream.add((char *)"Encoding of nodeIdType failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.numberOfCsids, 4)))
+ {
+ errorStream.add((char *)"Encoding of numberOfCsids failed\n");
+ return false;
+ }
+ if (data.nodeIdType == 0)
+ {
+ if (!(DataTypeCodecUtils::encodeIpAddressV4(buffer, data.nodeIdIpv4)))
+ {
+ errorStream.add((char *)"Encoding of nodeIdIpv4 failed\n");
+ return false;
+ }
+ }
+ if (data.nodeIdType == 1)
+ {
+ if (!(DataTypeCodecUtils::encodeIpAddressV6(buffer, data.nodeIdIpv6)))
+ {
+ errorStream.add((char *)"Encoding of nodeIdIpv6 failed\n");
+ return false;
+ }
+ }
+ if (data.nodeIdType == 2)
+ {
+ if (!(buffer.writeUint32(data.nodeIdUint32)))
+ {
+ errorStream.add((char *)"Encoding of nodeIdUint32 failed\n");
+ return false;
+ }
+ }
+ if (!(DataTypeCodecUtils::encodeUint16Array16(buffer, data.csidList)))
+ {
+ errorStream.add((char *)"Encoding of csidList failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool FqCsidIe::decodeFqCsidIe(MsgBuffer &buffer, FqCsidIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+ data.nodeIdType = buffer.readBits(4);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: nodeIdType\n");
+ return false;
+ }
+ data.numberOfCsids = buffer.readBits(4);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: numberOfCsids\n");
+ return false;
+ }
+
+ Uint16 lengthLeft = length;
+
+ if (data.nodeIdType == 0)
+ {
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeIpAddressV4(buffer, data.nodeIdIpv4, lengthLeft)))
+ {
+ errorStream.add((char *)"Failed to decode: nodeIdIpv4\n");
+ return false;
+ }
+ }
+
+ if (data.nodeIdType == 1)
+ {
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeIpAddressV6(buffer, data.nodeIdIpv6, lengthLeft)))
+ {
+ errorStream.add((char *)"Failed to decode: nodeIdIpv6\n");
+ return false;
+ }
+ }
+
+ if (data.nodeIdType == 2)
+ {
+
+ buffer.readUint32(data.nodeIdUint32);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: nodeIdUint32\n");
+ return false;
+ }
+ }
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeUint16Array16(buffer, data.csidList, lengthLeft, data.numberOfCsids)))
+ {
+ errorStream.add((char *)"Failed to decode: csidList\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE FqCsidIe\n");
+ return false;
+ }
+}
+void FqCsidIe::displayFqCsidIe_v(FqCsidIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"FqCsidIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add( (char *)"nodeIdType: ");
+ stream.add((Uint8)data.nodeIdType);
+ stream.endOfLine();
+
+ stream.add( (char *)"numberOfCsids: ");
+ stream.add((Uint8)data.numberOfCsids);
+ stream.endOfLine();
+
+ if (data.nodeIdType == 0)
+ {
+ stream.add((char *)"nodeIdIpv4:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displayIpAddressV4_v(data.nodeIdIpv4, stream);
+ }
+
+ if (data.nodeIdType == 1)
+ {
+ stream.add((char *)"nodeIdIpv6:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displayIpAddressV6_v(data.nodeIdIpv6, stream);
+ }
+
+ if (data.nodeIdType == 2)
+ {
+ stream.add((char *)"nodeIdUint32: ");
+ stream.add(data.nodeIdUint32);
+ stream.endOfLine();
+ }
+
+ stream.add((char *)"csidList:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displayUint16Array16_v(data.csidList, stream);
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/fqCsidIe.h b/src/gtpV2Codec/ieClasses/fqCsidIe.h
new file mode 100644
index 0000000..316673b
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/fqCsidIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef FQCSIDIE_H_
+#define FQCSIDIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class FqCsidIe: public GtpV2Ie {
+public:
+ FqCsidIe();
+ virtual ~FqCsidIe();
+
+ bool encodeFqCsidIe(MsgBuffer &buffer,
+ FqCsidIeData const &data);
+ bool decodeFqCsidIe(MsgBuffer &buffer,
+ FqCsidIeData &data, Uint16 length);
+ void displayFqCsidIe_v(FqCsidIeData const &data,
+ Debug &stream);
+};
+
+#endif /* FQCSIDIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/fqdnIe.cpp b/src/gtpV2Codec/ieClasses/fqdnIe.cpp
new file mode 100644
index 0000000..377c73f
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/fqdnIe.cpp
@@ -0,0 +1,78 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "fqdnIe.h"
+#include "dataTypeCodecUtils.h"
+
+FqdnIe::FqdnIe()
+{
+ ieType = 136;
+ // TODO
+
+}
+
+FqdnIe::~FqdnIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool FqdnIe::encodeFqdnIe(MsgBuffer &buffer, FqdnIeData const &data)
+{
+ if (!(DataTypeCodecUtils::encodeUint8Array32(buffer, data.fqdn)))
+ {
+ errorStream.add((char *)"Encoding of fqdn failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool FqdnIe::decodeFqdnIe(MsgBuffer &buffer, FqdnIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+
+ Uint16 lengthLeft = length;
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeUint8Array32(buffer, data.fqdn, lengthLeft, 0)))
+ {
+ errorStream.add((char *)"Failed to decode: fqdn\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE FqdnIe\n");
+ return false;
+ }
+}
+void FqdnIe::displayFqdnIe_v(FqdnIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"FqdnIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add((char *)"fqdn:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displayUint8Array32_v(data.fqdn, stream);
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/fqdnIe.h b/src/gtpV2Codec/ieClasses/fqdnIe.h
new file mode 100644
index 0000000..d9095f0
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/fqdnIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef FQDNIE_H_
+#define FQDNIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class FqdnIe: public GtpV2Ie {
+public:
+ FqdnIe();
+ virtual ~FqdnIe();
+
+ bool encodeFqdnIe(MsgBuffer &buffer,
+ FqdnIeData const &data);
+ bool decodeFqdnIe(MsgBuffer &buffer,
+ FqdnIeData &data, Uint16 length);
+ void displayFqdnIe_v(FqdnIeData const &data,
+ Debug &stream);
+};
+
+#endif /* FQDNIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/gtpV2DataTypes.h b/src/gtpV2Codec/ieClasses/gtpV2DataTypes.h
new file mode 100644
index 0000000..6b3ef1c
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/gtpV2DataTypes.h
@@ -0,0 +1,200 @@
+/*
+ * 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/v2DataTypetemplate.h.tt>
+ ******************************************************************************/
+#ifndef GTPV2DATATYPES_H_
+#define GTPV2DATATYPES_H_
+#include <basicTypes.h>
+
+typedef struct
+{
+ Uint16 count;
+ Uint8 values[16];
+
+}Uint8Array16;
+
+typedef struct
+{
+ Uint8 mccDigit2;
+ Uint8 mccDigit1;
+ Uint8 mncDigit3;
+ Uint8 mccDigit3;
+ Uint8 mncDigit2;
+ Uint8 mncDigit1;
+ Uint16 locationAreaCode;
+ Uint16 cellIdentity;
+}CgiField;
+
+typedef struct
+{
+ Uint8 typeOfOffendingIe;
+ Uint16 lengthOfOffendingIe;
+ Uint8 instanceOfOffendingIe;
+}OffendingIeData;
+
+typedef struct
+{
+ Uint8 mccDigit2;
+ Uint8 mccDigit1;
+ Uint8 mncDigit3;
+ Uint8 mccDigit3;
+ Uint8 mncDigit2;
+ Uint8 mncDigit1;
+ Uint16 locationAreaCode;
+ Uint16 serviceAreaCode;
+}SaiField;
+
+typedef struct
+{
+ Uint8 mccDigit2;
+ Uint8 mccDigit1;
+ Uint8 mncDigit3;
+ Uint8 mccDigit3;
+ Uint8 mncDigit2;
+ Uint8 mncDigit1;
+ Uint16 locationAreaCode;
+ Uint16 routintAreaCode;
+}RaiField;
+
+typedef struct
+{
+ Uint8 mccDigit2;
+ Uint8 mccDigit1;
+ Uint8 mncDigit3;
+ Uint8 mccDigit3;
+ Uint8 mncDigit2;
+ Uint8 mncDigit1;
+ Uint16 trackingAreaCode;
+}TaiField;
+
+typedef struct
+{
+ Uint8 mccDigit2;
+ Uint8 mccDigit1;
+ Uint8 mncDigit3;
+ Uint8 mccDigit3;
+ Uint8 mncDigit2;
+ Uint8 mncDigit1;
+ Uint32 eUtranCellId;
+}EcgiField;
+
+typedef struct
+{
+ Uint8 mccDigit2;
+ Uint8 mccDigit1;
+ Uint8 mncDigit3;
+ Uint8 mccDigit3;
+ Uint8 mncDigit2;
+ Uint8 mncDigit1;
+ Uint16 locationAreaCode;
+}LaiField;
+
+typedef struct
+{
+ Uint32 ipValue;
+}IpAddressV4;
+
+typedef struct
+{
+ Uint8Array16 ipValue;
+}IpAddressV6;
+
+
+
+typedef struct
+{
+ Uint16 count;
+ Uint16 values[16];
+
+}Uint16Array16;
+
+
+
+typedef struct
+{
+ Uint16 count;
+ Uint8 values[32];
+
+}Uint8Array32;
+
+typedef struct
+{
+ Uint16 count;
+ Uint8 values[5];
+
+}Uint8Array5;
+
+typedef struct
+{
+ Uint16 count;
+ Uint8 values[4];
+
+}Uint8Array4;
+
+typedef struct
+{
+ Uint16 count;
+ Uint8 values[512];
+
+}Uint8Array512;
+
+typedef struct
+{
+ Uint16 count;
+ Uint8 values[255];
+
+}Uint8Array255;
+
+typedef struct
+{
+ Uint16 count;
+ CgiField values[64];
+
+}CgiFieldArray64;
+
+typedef struct
+{
+ Uint16 count;
+ SaiField values[64];
+
+}SaiFieldArray64;
+
+typedef struct
+{
+ Uint16 count;
+ EcgiField values[64];
+
+}EcgiFieldArray64;
+
+typedef struct
+{
+ Uint16 count;
+ TaiField values[15];
+
+}TaiFieldArray15;
+
+typedef struct
+{
+ Uint16 count;
+ RaiField values[15];
+
+}RaiFieldArray15;
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/gtpV2GrpIeDataTypes.h b/src/gtpV2Codec/ieClasses/gtpV2GrpIeDataTypes.h
new file mode 100644
index 0000000..3d8f880
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/gtpV2GrpIeDataTypes.h
@@ -0,0 +1,677 @@
+/*
+ * 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/grpIeDataTypetemplate.h.tt>
+ ******************************************************************************/
+#ifndef GTPV2GRPIEDATATYPES_H_
+#define GTPV2GRPIEDATATYPES_H_
+
+#include "../../gtpV2Codec/ieClasses/gtpV2IeDataTypes.h"
+
+typedef struct
+{
+ bool s1EnodebFTeidIePresent;
+ bool s58USgwFTeidIePresent;
+ bool s12RncFTeidIePresent;
+ bool s4USgsnFTeidIePresent;
+ bool s11UMmeFTeidIePresent;
+
+ EbiIeData epsBearerId;
+ FTeidIeData s1EnodebFTeid;
+ FTeidIeData s58USgwFTeid;
+ FTeidIeData s12RncFTeid;
+ FTeidIeData s4USgsnFTeid;
+ FTeidIeData s11UMmeFTeid;
+
+}BearerContextsToBeModifiedInModifyBearerRequestData;
+
+typedef struct
+{
+
+ EbiIeData epsBearerId;
+
+}BearerContextsToBeRemovedInModifyBearerRequestData;
+
+typedef struct
+{
+
+ EbiIeData epsBearerId;
+ CauseIeData cause;
+
+}BearerContextsMarkedForRemovalInModifyBearerResponseData;
+
+typedef struct
+{
+ bool s1USgwFTeidIePresent;
+ bool s12SgwFTeidIePresent;
+ bool s4USgwFTeidIePresent;
+ bool chargingIdIePresent;
+ bool bearerFlagsIePresent;
+ bool s11USgwFTeidIePresent;
+
+ EbiIeData epsBearerId;
+ CauseIeData cause;
+ FTeidIeData s1USgwFTeid;
+ FTeidIeData s12SgwFTeid;
+ FTeidIeData s4USgwFTeid;
+ ChargingIdIeData chargingId;
+ BearerFlagsIeData bearerFlags;
+ FTeidIeData s11USgwFTeid;
+
+}BearerContextsModifiedInModifyBearerResponseData;
+
+typedef struct
+{
+ bool tftIePresent;
+ bool s1UEnodebFTeidIePresent;
+ bool s4USgsnFTeidIePresent;
+ bool s5S8USgwFTeidIePresent;
+ bool s5S8UPgwFTeidIePresent;
+ bool s12RncFTeidIePresent;
+ bool s2bUEpdgFTeidIePresent;
+ bool s2aUTwanFTeidIePresent;
+ bool s11UMmeFTeidIePresent;
+
+ EbiIeData epsBearerId;
+ BearerTftIeData tft;
+ FTeidIeData s1UEnodebFTeid;
+ FTeidIeData s4USgsnFTeid;
+ FTeidIeData s5S8USgwFTeid;
+ FTeidIeData s5S8UPgwFTeid;
+ FTeidIeData s12RncFTeid;
+ FTeidIeData s2bUEpdgFTeid;
+ FTeidIeData s2aUTwanFTeid;
+ BearerQosIeData bearerLevelQos;
+ FTeidIeData s11UMmeFTeid;
+
+}BearerContextsToBeCreatedInCreateSessionRequestData;
+
+typedef struct
+{
+ bool s4USgsnFTeidIePresent;
+
+ EbiIeData epsBearerId;
+ FTeidIeData s4USgsnFTeid;
+
+}BearerContextsToBeRemovedInCreateSessionRequestData;
+
+typedef struct
+{
+ bool s1USgwFTeidIePresent;
+ bool s4USgwFTeidIePresent;
+ bool s5S8UPgwFTeidIePresent;
+ bool s12SgwFTeidIePresent;
+ bool s2bUPgwFTeidIePresent;
+ bool s2aUPgwFTeidIePresent;
+ bool bearerLevelQosIePresent;
+ bool chargingIdIePresent;
+ bool bearerFlagsIePresent;
+ bool s11USgwFTeidIePresent;
+
+ EbiIeData epsBearerId;
+ CauseIeData cause;
+ FTeidIeData s1USgwFTeid;
+ FTeidIeData s4USgwFTeid;
+ FTeidIeData s5S8UPgwFTeid;
+ FTeidIeData s12SgwFTeid;
+ FTeidIeData s2bUPgwFTeid;
+ FTeidIeData s2aUPgwFTeid;
+ BearerQosIeData bearerLevelQos;
+ ChargingIdIeData chargingId;
+ BearerFlagsIeData bearerFlags;
+ FTeidIeData s11USgwFTeid;
+
+}BearerContextsCreatedInCreateSessionResponseData;
+
+typedef struct
+{
+
+ EbiIeData epsBearerId;
+ CauseIeData cause;
+
+}BearerContextsMarkedForRemovalInCreateSessionResponseData;
+
+typedef struct
+{
+
+ SequenceNumberIeData overloadControlSequenceNumber;
+ MetricIeData overloadReductionMetric;
+ EpcTimerIeData periodOfValidity;
+
+}SgwsOverloadControlInformationInCreateSessionRequestData;
+
+typedef struct
+{
+
+ SequenceNumberIeData overloadControlSequenceNumber;
+ MetricIeData overloadReductionMetric;
+ EpcTimerIeData periodOfValidity;
+
+}TwanEpdgsOverloadControlInformationInCreateSessionRequestData;
+
+typedef struct
+{
+
+ SequenceNumberIeData overloadControlSequenceNumber;
+ MetricIeData overloadReductionMetric;
+ EpcTimerIeData periodOfValidity;
+
+}MmeS4SgsnsOverloadControlInformationInCreateSessionRequestData;
+
+typedef struct
+{
+
+ RemoteUserIdIeData remoteUserId;
+ RemoteUeIpInformationIeData remoteUeIpInformation;
+
+}RemoteUeContextConnectedInCreateSessionRequestData;
+
+typedef struct
+{
+ bool listOfAccessPointNameIePresent;
+
+ SequenceNumberIeData overloadControlSequenceNumber;
+ MetricIeData overloadReductionMetric;
+ EpcTimerIeData periodOfValidity;
+ ApnIeData listOfAccessPointName;
+
+}PgwsOverloadControlInformationInCreateSessionResponseData;
+
+typedef struct
+{
+ bool listOfAccessPointNameIePresent;
+
+ SequenceNumberIeData overloadControlSequenceNumber;
+ MetricIeData overloadReductionMetric;
+ EpcTimerIeData periodOfValidity;
+ ApnIeData listOfAccessPointName;
+
+}SgwsOverloadControlInformationInCreateSessionResponseData;
+
+typedef struct
+{
+
+ SequenceNumberIeData loadControlSequenceNumber;
+ MetricIeData loadMetric;
+ ApnAndRelativeCapacityIeData listOfApnAndRelativeCapacity;
+
+}PgwsNodeLevelLoadControlInformationInCreateSessionResponseData;
+
+typedef struct
+{
+
+ SequenceNumberIeData loadControlSequenceNumber;
+ MetricIeData loadMetric;
+ ApnAndRelativeCapacityIeData listOfApnAndRelativeCapacity;
+
+}PgwsApnLevelLoadControlInformationInCreateSessionResponseData;
+
+typedef struct
+{
+
+ SequenceNumberIeData loadControlSequenceNumber;
+ MetricIeData loadMetric;
+ ApnAndRelativeCapacityIeData listOfApnAndRelativeCapacity;
+
+}SgwsNodeLevelLoadControlInformationInCreateSessionResponseData;
+
+typedef struct
+{
+
+ SequenceNumberIeData overloadControlSequenceNumber;
+ MetricIeData overloadReductionMetric;
+ EpcTimerIeData periodOfValidity;
+
+}MmeS4SgsnsOverloadControlInformationInModifyBearerRequestData;
+
+typedef struct
+{
+
+ SequenceNumberIeData overloadControlSequenceNumber;
+ MetricIeData overloadReductionMetric;
+ EpcTimerIeData periodOfValidity;
+
+}SgwsOverloadControlInformationInModifyBearerRequestData;
+
+typedef struct
+{
+
+ SequenceNumberIeData overloadControlSequenceNumber;
+ MetricIeData overloadReductionMetric;
+ EpcTimerIeData periodOfValidity;
+
+}EpdgsOverloadControlInformationInModifyBearerRequestData;
+
+typedef struct
+{
+ bool listOfAccessPointNameIePresent;
+
+ SequenceNumberIeData overloadControlSequenceNumber;
+ MetricIeData overloadReductionMetric;
+ EpcTimerIeData periodOfValidity;
+ ApnIeData listOfAccessPointName;
+
+}SgwsOverloadControlInformationInModifyBearerResponseData;
+
+typedef struct
+{
+ bool listOfAccessPointNameIePresent;
+
+ SequenceNumberIeData overloadControlSequenceNumber;
+ MetricIeData overloadReductionMetric;
+ EpcTimerIeData periodOfValidity;
+ ApnIeData listOfAccessPointName;
+
+}PgwsOverloadControlInformationInModifyBearerResponseData;
+
+typedef struct
+{
+
+ SequenceNumberIeData loadControlSequenceNumber;
+ MetricIeData loadMetric;
+ ApnAndRelativeCapacityIeData listOfApnAndRelativeCapacity;
+
+}SgwsNodeLevelLoadControlInformationInModifyBearerResponseData;
+
+typedef struct
+{
+
+ SequenceNumberIeData loadControlSequenceNumber;
+ MetricIeData loadMetric;
+ ApnAndRelativeCapacityIeData listOfApnAndRelativeCapacity;
+
+}PgwsApnLevelLoadControlInformationInModifyBearerResponseData;
+
+typedef struct
+{
+
+ SequenceNumberIeData loadControlSequenceNumber;
+ MetricIeData loadMetric;
+ ApnAndRelativeCapacityIeData listOfApnAndRelativeCapacity;
+
+}PgwsNodeLevelLoadControlInformationInModifyBearerResponseData;
+
+typedef struct
+{
+
+ SequenceNumberIeData overloadControlSequenceNumber;
+ MetricIeData overloadReductionMetric;
+ EpcTimerIeData periodOfValidity;
+
+}MmeS4SgsnsOverloadControlInformationInDeleteSessionRequestData;
+
+typedef struct
+{
+
+ SequenceNumberIeData overloadControlSequenceNumber;
+ MetricIeData overloadReductionMetric;
+ EpcTimerIeData periodOfValidity;
+
+}SgwsOverloadControlInformationInDeleteSessionRequestData;
+
+typedef struct
+{
+
+ SequenceNumberIeData overloadControlSequenceNumber;
+ MetricIeData overloadReductionMetric;
+ EpcTimerIeData periodOfValidity;
+
+}TwanEpdgsOverloadControlInformationInDeleteSessionRequestData;
+
+typedef struct
+{
+ bool listOfAccessPointNameIePresent;
+
+ SequenceNumberIeData overloadControlSequenceNumber;
+ MetricIeData overloadReductionMetric;
+ EpcTimerIeData periodOfValidity;
+ ApnIeData listOfAccessPointName;
+
+}SgwsOverloadControlInformationInDeleteSessionResponseData;
+
+typedef struct
+{
+ bool listOfAccessPointNameIePresent;
+
+ SequenceNumberIeData overloadControlSequenceNumber;
+ MetricIeData overloadReductionMetric;
+ EpcTimerIeData periodOfValidity;
+ ApnIeData listOfAccessPointName;
+
+}PgwsOverloadControlInformationInDeleteSessionResponseData;
+
+typedef struct
+{
+
+ SequenceNumberIeData loadControlSequenceNumber;
+ MetricIeData loadMetric;
+ ApnAndRelativeCapacityIeData listOfApnAndRelativeCapacity;
+
+}PgwsNodeLevelLoadControlInformationInDeleteSessionResponseData;
+
+typedef struct
+{
+
+ SequenceNumberIeData loadControlSequenceNumber;
+ MetricIeData loadMetric;
+ ApnAndRelativeCapacityIeData listOfApnAndRelativeCapacity;
+
+}PgwsApnLevelLoadControlInformationInDeleteSessionResponseData;
+
+typedef struct
+{
+
+ SequenceNumberIeData loadControlSequenceNumber;
+ MetricIeData loadMetric;
+ ApnAndRelativeCapacityIeData listOfApnAndRelativeCapacity;
+
+}SgwsNodeLevelLoadControlInformationInDeleteSessionResponseData;
+
+typedef struct
+{
+ bool listOfAccessPointNameIePresent;
+
+ SequenceNumberIeData overloadControlSequenceNumber;
+ MetricIeData overloadReductionMetric;
+ EpcTimerIeData periodOfValidity;
+ ApnIeData listOfAccessPointName;
+
+}SgwsOverloadControlInformationInReleaseAccessBearersResponseData;
+
+typedef struct
+{
+
+ SequenceNumberIeData loadControlSequenceNumber;
+ MetricIeData loadMetric;
+ ApnAndRelativeCapacityIeData listOfApnAndRelativeCapacity;
+
+}SgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponseData;
+
+typedef struct
+{
+ bool s1USgwFTeidIePresent;
+ bool s58UPgwFTeidIePresent;
+ bool s12SgwFTeidIePresent;
+ bool s4USgwFTeidIePresent;
+ bool s2bUPgwFTeidIePresent;
+ bool s2aUPgwFTeidIePresent;
+ bool chargingIdIePresent;
+ bool bearerFlagsIePresent;
+ bool protocolConfigurationOptionsIePresent;
+ bool extendedProtocolConfigurationOptionsIePresent;
+ bool maximumPacketLossRateIePresent;
+
+ EbiIeData epsBearerId;
+ BearerTftIeData tft;
+ FTeidIeData s1USgwFTeid;
+ FTeidIeData s58UPgwFTeid;
+ FTeidIeData s12SgwFTeid;
+ FTeidIeData s4USgwFTeid;
+ FTeidIeData s2bUPgwFTeid;
+ FTeidIeData s2aUPgwFTeid;
+ BearerQosIeData bearerLevelQos;
+ ChargingIdIeData chargingId;
+ BearerFlagsIeData bearerFlags;
+ PcoIeData protocolConfigurationOptions;
+ EpcoIeData extendedProtocolConfigurationOptions;
+ MaximumPacketLossRateIeData maximumPacketLossRate;
+
+}BearerContextsInCreateBearerRequestData;
+
+typedef struct
+{
+
+ SequenceNumberIeData loadControlSequenceNumber;
+ MetricIeData loadMetric;
+ ApnAndRelativeCapacityIeData listOfApnAndRelativeCapacity;
+
+}PgwsNodeLevelLoadControlInformationInCreateBearerRequestData;
+
+typedef struct
+{
+
+ SequenceNumberIeData loadControlSequenceNumber;
+ MetricIeData loadMetric;
+ ApnAndRelativeCapacityIeData listOfApnAndRelativeCapacity;
+
+}PgwsApnLevelLoadControlInformationInCreateBearerRequestData;
+
+typedef struct
+{
+
+ SequenceNumberIeData loadControlSequenceNumber;
+ MetricIeData loadMetric;
+ ApnAndRelativeCapacityIeData listOfApnAndRelativeCapacity;
+
+}SgwsNodeLevelLoadControlInformationInCreateBearerRequestData;
+
+typedef struct
+{
+ bool listOfAccessPointNameIePresent;
+
+ SequenceNumberIeData overloadControlSequenceNumber;
+ MetricIeData overloadReductionMetric;
+ EpcTimerIeData periodOfValidity;
+ ApnIeData listOfAccessPointName;
+
+}PgwsOverloadControlInformationInCreateBearerRequestData;
+
+typedef struct
+{
+ bool listOfAccessPointNameIePresent;
+
+ SequenceNumberIeData overloadControlSequenceNumber;
+ MetricIeData overloadReductionMetric;
+ EpcTimerIeData periodOfValidity;
+ ApnIeData listOfAccessPointName;
+
+}SgwsOverloadControlInformationInCreateBearerRequestData;
+
+typedef struct
+{
+ bool s1UEnodebFTeidIePresent;
+ bool s1USgwFTeidIePresent;
+ bool s58USgwFTeidIePresent;
+ bool s58UPgwFTeidIePresent;
+ bool s12RncFTeidIePresent;
+ bool s12SgwFTeidIePresent;
+ bool s4USgsnFTeidIePresent;
+ bool s4USgwFTeidIePresent;
+ bool s2bUEpdgFTeidIePresent;
+ bool s2bUPgwFTeidIePresent;
+ bool s2aUTwanFTeidIePresent;
+ bool s2aUPgwFTeidIePresent;
+ bool protocolConfigurationOptionsIePresent;
+ bool ranNasCauseIePresent;
+ bool extendedProtocolConfigurationOptionsIePresent;
+
+ EbiIeData epsBearerId;
+ CauseIeData cause;
+ FTeidIeData s1UEnodebFTeid;
+ FTeidIeData s1USgwFTeid;
+ FTeidIeData s58USgwFTeid;
+ FTeidIeData s58UPgwFTeid;
+ FTeidIeData s12RncFTeid;
+ FTeidIeData s12SgwFTeid;
+ FTeidIeData s4USgsnFTeid;
+ FTeidIeData s4USgwFTeid;
+ FTeidIeData s2bUEpdgFTeid;
+ FTeidIeData s2bUPgwFTeid;
+ FTeidIeData s2aUTwanFTeid;
+ FTeidIeData s2aUPgwFTeid;
+ PcoIeData protocolConfigurationOptions;
+ RanNasCauseIeData ranNasCause;
+ EpcoIeData extendedProtocolConfigurationOptions;
+
+}BearerContextsInCreateBearerResponseData;
+
+typedef struct
+{
+
+ SequenceNumberIeData overloadControlSequenceNumber;
+ MetricIeData overloadReductionMetric;
+ EpcTimerIeData periodOfValidity;
+
+}MmeS4SgsnsOverloadControlInformationInCreateBearerResponseData;
+
+typedef struct
+{
+
+ SequenceNumberIeData overloadControlSequenceNumber;
+ MetricIeData overloadReductionMetric;
+ EpcTimerIeData periodOfValidity;
+
+}SgwsOverloadControlInformationInCreateBearerResponseData;
+
+typedef struct
+{
+
+ SequenceNumberIeData overloadControlSequenceNumber;
+ MetricIeData overloadReductionMetric;
+ EpcTimerIeData periodOfValidity;
+
+}TwanEpdgsOverloadControlInformationInCreateBearerResponseData;
+
+typedef struct
+{
+
+ EbiIeData epsBearerId;
+ CauseIeData cause;
+
+}FailedBearerContextsInDeleteBearerRequestData;
+
+typedef struct
+{
+ bool listOfApnAndRelativeCapacityIePresent;
+
+ SequenceNumberIeData loadControlSequenceNumber;
+ MetricIeData loadMetric;
+ ApnAndRelativeCapacityIeData listOfApnAndRelativeCapacity;
+
+}PgwsNodeLevelLoadControlInformationInDeleteBearerRequestData;
+
+typedef struct
+{
+ bool listOfApnAndRelativeCapacityIePresent;
+
+ SequenceNumberIeData loadControlSequenceNumber;
+ MetricIeData loadMetric;
+ ApnAndRelativeCapacityIeData listOfApnAndRelativeCapacity;
+
+}PgwsApnLevelLoadControlInformationInDeleteBearerRequestData;
+
+typedef struct
+{
+ bool listOfApnAndRelativeCapacityIePresent;
+
+ SequenceNumberIeData loadControlSequenceNumber;
+ MetricIeData loadMetric;
+ ApnAndRelativeCapacityIeData listOfApnAndRelativeCapacity;
+
+}SgwsNodeLevelLoadControlInformationInDeleteBearerRequestData;
+
+typedef struct
+{
+ bool listOfAccessPointNameIePresent;
+
+ SequenceNumberIeData overloadControlSequenceNumber;
+ MetricIeData overloadReductionMetric;
+ EpcTimerIeData periodOfValidity;
+ ApnIeData listOfAccessPointName;
+
+}PgwsOverloadControlInformationInDeleteBearerRequestData;
+
+typedef struct
+{
+ bool listOfAccessPointNameIePresent;
+
+ SequenceNumberIeData overloadControlSequenceNumber;
+ MetricIeData overloadReductionMetric;
+ EpcTimerIeData periodOfValidity;
+ ApnIeData listOfAccessPointName;
+
+}SgwsOverloadControlInformationInDeleteBearerRequestData;
+
+typedef struct
+{
+ bool protocolConfigurationOptionsIePresent;
+ bool ranNasCauseIePresent;
+ bool extendedProtocolConfigurationOptionsIePresent;
+
+ EbiIeData epsBearerId;
+ CauseIeData cause;
+ PcoIeData protocolConfigurationOptions;
+ RanNasCauseIeData ranNasCause;
+ EpcoIeData extendedProtocolConfigurationOptions;
+
+}BearerContextsInDeleteBearerResponseData;
+
+typedef struct
+{
+
+ SequenceNumberIeData overloadControlSequenceNumber;
+ MetricIeData overloadReductionMetric;
+ EpcTimerIeData periodOfValidity;
+
+}MmeS4SgsnsOverloadControlInformationInDeleteBearerResponseData;
+
+typedef struct
+{
+
+ SequenceNumberIeData overloadControlSequenceNumber;
+ MetricIeData overloadReductionMetric;
+ EpcTimerIeData periodOfValidity;
+
+}SgwsOverloadControlInformationInDeleteBearerResponseData;
+
+typedef struct
+{
+
+ SequenceNumberIeData overloadControlSequenceNumber;
+ MetricIeData overloadReductionMetric;
+ EpcTimerIeData periodOfValidity;
+
+}TwanEpdgsOverloadControlInformationInDeleteBearerResponseData;
+
+typedef struct
+{
+
+ SequenceNumberIeData loadControlSequenceNumber;
+ MetricIeData loadMetric;
+
+}SgwsNodeLevelLoadControlInformationInDownlinkDataNotificationData;
+
+typedef struct
+{
+
+ SequenceNumberIeData overloadControlSequenceNumber;
+ MetricIeData overloadReductionMetric;
+ EpcTimerIeData periodOfValidity;
+
+}SgwsOverloadControlInformationInDownlinkDataNotificationData;
+
+
+//Ie Type Constants
+static const Uint8 BearerContextIeType = 93;
+static const Uint8 OverloadControlInformationIeType = 180;
+static const Uint8 RemoteUeContextIeType = 191;
+static const Uint8 LoadControlInformationIeType = 181;
+
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/gtpV2IeDataTypes.h b/src/gtpV2Codec/ieClasses/gtpV2IeDataTypes.h
new file mode 100644
index 0000000..ec076e5
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/gtpV2IeDataTypes.h
@@ -0,0 +1,667 @@
+/*
+ * 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/ieDataTypetemplate.h.tt>
+ ******************************************************************************/
+#ifndef GTPV2IEDATATYPES_H_
+#define GTPV2IEDATATYPES_H_
+
+#include "gtpV2DataTypes.h"
+#include "manual/gtpV2DataTypes_Manual.h"
+
+typedef struct
+{
+ DigitRegister imsiValue;
+
+}ImsiIeData;
+
+typedef struct
+{
+ Uint8 causeValue;
+ bool pce;
+ bool pbe;
+ bool cs;
+ bool offendingIeDataPresent;
+ OffendingIeData offendingIeData;
+
+}CauseIeData;
+
+typedef struct
+{
+ DigitRegister msisdnValue;
+
+}MsisdnIeData;
+
+typedef struct
+{
+ DigitRegister imeiSvValue;
+
+}MeiIeData;
+
+typedef struct
+{
+ bool laipresent;
+ bool ecgipresent;
+ bool taipresent;
+ bool raipresent;
+ bool saipresent;
+ bool cgipresent;
+ CgiField cgi;
+ SaiField sai;
+ RaiField rai;
+ TaiField tai;
+ EcgiField ecgi;
+ LaiField lai;
+
+}UliIeData;
+
+typedef struct
+{
+ Uint8 mccDigit2;
+ Uint8 mccDigit1;
+ Uint8 mncDigit3;
+ Uint8 mccDigit3;
+ Uint8 mncDigit2;
+ Uint8 mncDigit1;
+
+}ServingNetworkIeData;
+
+typedef struct
+{
+ Uint8 ratType;
+
+}RatTypeIeData;
+
+typedef struct
+{
+ bool iDAF;
+ bool iDTF;
+ bool iHI;
+ bool iDFI;
+ bool iOI;
+ bool iISRSI;
+ bool iISRAI;
+ bool iSGWCI;
+ bool iSQCI;
+ bool iUIMSI;
+ bool iCFSI;
+ bool iCRSI;
+ bool iP;
+ bool iPT;
+ bool iSI;
+ bool iMSV;
+ bool iS6AF;
+ bool iS4AF;
+ bool iMBMDT;
+ bool iISRAU;
+ bool iCCRSI;
+
+}IndicationIeData;
+
+typedef struct
+{
+ bool ipv4present;
+ bool ipv6present;
+ Uint8 interfaceType;
+ Uint32 teidGreKey;
+ IpAddressV4 ipV4Address;
+ IpAddressV6 ipV6Address;
+
+}FTeidIeData;
+
+typedef struct
+{
+ Uint8Array32 apnValue;
+
+}ApnIeData;
+
+typedef struct
+{
+ Uint8 selectionMode;
+
+}SelectionModeIeData;
+
+typedef struct
+{
+ Uint8 pdnType;
+
+}PdnTypeIeData;
+
+typedef struct
+{
+ Uint8 pdnType;
+ Uint8 ipv6PrefixLength;
+ IpAddressV6 ipV6Address;
+ IpAddressV4 ipV4Address;
+
+}PaaIeData;
+
+typedef struct
+{
+ Uint8 restrictionValue;
+
+}ApnRestrictionIeData;
+
+typedef struct
+{
+ Uint32 maxMbrUplink;
+ Uint32 maxMbrDownlink;
+
+}AmbrMmbrIeData;
+
+typedef struct
+{
+ Uint32 maxMbrUplink;
+ Uint32 maxMbrDownlink;
+
+}AmbrIeData;
+
+typedef struct
+{
+ Uint8 epsBearerId;
+
+}EbiIeData;
+
+typedef struct
+{
+ Uint8Array255 pcoValue;
+
+}PcoIeData;
+
+typedef struct
+{
+ Uint8 mccDigit2;
+ Uint8 mccDigit1;
+ Uint8 mncDigit3;
+ Uint8 mccDigit3;
+ Uint8 mncDigit2;
+ Uint8 mncDigit1;
+ Uint8Array4 traceId;
+ Uint8Array16 triggeringEvents;
+ Uint16 listOfNeTypes;
+ Uint8 sessionTraceDepth;
+ Uint8Array16 listOfInterfaces;
+ IpAddressV4 ipAddressOfTce;
+
+}TraceInformationIeData;
+
+typedef struct
+{
+ Uint8 restartCounter;
+
+}RecoveryIeData;
+
+typedef struct
+{
+ Uint8 daylightSavingTime;
+
+}UeTimeZoneIeData;
+
+typedef struct
+{
+ Uint8 mccDigit2;
+ Uint8 mccDigit1;
+ Uint8 mncDigit3;
+ Uint8 mccDigit3;
+ Uint8 mncDigit2;
+ Uint8 mncDigit1;
+ Uint32 csgId;
+ Uint8 accessMode;
+ Uint8 lcsg;
+ Uint8 cmi;
+
+}UciIeData;
+
+typedef struct
+{
+ Uint16 value;
+
+}ChargingCharacteristicsIeData;
+
+typedef struct
+{
+ Uint8Array512 ldn;
+
+}LocalDistinguishedNameIeData;
+
+typedef struct
+{
+
+}SignallingPriorityIndicationIeData;
+
+typedef struct
+{
+ Uint8Array16 apco;
+
+}AdditionalProtocolConfigurationOptionsIeData;
+
+typedef struct
+{
+ Uint8 nodeIdType;
+ Uint8 numberOfCsids;
+ IpAddressV4 nodeIdIpv4;
+ IpAddressV6 nodeIdIpv6;
+ Uint32 nodeIdUint32;
+ Uint16Array16 csidList;
+
+}FqCsidIeData;
+
+typedef struct
+{
+ Uint8Array16 tft;
+
+}BearerTftIeData;
+
+typedef struct
+{
+ Uint8 pci;
+ Uint8 pl;
+ Uint8 pvi;
+ Uint8 qci;
+ Uint8Array5 maxBitRateUl;
+ Uint8Array5 maxBitRateDl;
+ Uint8Array5 guraranteedBitRateUl;
+ Uint8Array5 guaranteedBitRateDl;
+
+}BearerQosIeData;
+
+typedef struct
+{
+ Uint8 action;
+
+}ChangeReportingActionIeData;
+
+typedef struct
+{
+ bool uciuhc;
+ bool ucishc;
+ bool ucicsg;
+
+}CsgInformationReportingActionIeData;
+
+typedef struct
+{
+ Uint8Array32 fqdn;
+
+}FqdnIeData;
+
+typedef struct
+{
+ Uint8 timerUnit;
+ Uint8 timerValue;
+
+}EpcTimerIeData;
+
+typedef struct
+{
+ Uint32 chargingIdValue;
+
+}ChargingIdIeData;
+
+typedef struct
+{
+ bool vb;
+ bool ppc;
+
+}BearerFlagsIeData;
+
+typedef struct
+{
+ bool ipAddressV4Present;
+ IpAddressV4 ipAddressV4;
+ bool ipAddressV6Present;
+ IpAddressV6 ipAddressV6;
+
+}IpAddressIeData;
+
+typedef struct
+{
+ Uint8 delayValue;
+
+}DelayValueIeData;
+
+typedef struct
+{
+ Uint16 portNumber;
+
+}PortNumberIeData;
+
+typedef struct
+{
+ Uint8 cnOpselectionEntity;
+
+}CnOperatorSelectionEntityIeData;
+
+typedef struct
+{
+ Uint16 uplinkRateLimit;
+ Uint16 downlinkRateLimit;
+
+}ServingPlmnRateControlIeData;
+
+typedef struct
+{
+ Uint32 timeStampValue;
+ Uint8 counterValue;
+
+}CounterIeData;
+
+typedef struct
+{
+ bool laiipresent;
+ bool opnaipresent;
+ bool plmnipresent;
+ bool civaipresent;
+ bool bssidipresent;
+ Uint64 ssidLength;
+ Uint8 ssid;
+ Uint8 bssid;
+ Uint8 civicAddressLength;
+ Uint8 civicAddressInformation;
+ Uint8 twanplmnid;
+ Uint8 twanOperatorNameLength;
+ Uint8 twanOperatorName;
+ Uint8 relayIdentityType;
+ Uint8 relayIdentityLength;
+ Uint8 relayIdentity;
+ Uint8 circuitIDLength;
+ Uint8 circuitID;
+
+}TwanIdentifierIeData;
+
+typedef struct
+{
+ Uint32 twanIdentifierTimestampvalue;
+
+}TwanIdentifierTimestampIeData;
+
+typedef struct
+{
+ bool irsgw;
+ bool irpgw;
+ Uint8 secondaryRatType;
+ Uint8 epsBearerId;
+ Uint32 starttimestamp;
+ Uint32 endtimestamp;
+ Uint64 usageDataDL;
+ Uint64 usageDataUL;
+
+}SecondaryRatUsageDataReportIeData;
+
+typedef struct
+{
+ Uint8 protocolType;
+ Uint8 causeType;
+ Uint8 causeValue;
+
+}RanNasCauseIeData;
+
+typedef struct
+{
+ Uint8Array16 epco;
+
+}EpcoIeData;
+
+typedef struct
+{
+ Uint8 dl;
+ Uint8 ul;
+ Uint16 ulValue;
+ Uint16 dlValue;
+
+}MaximumPacketLossRateIeData;
+
+typedef struct
+{
+ Uint8 containerType;
+ Uint8 fContainerField;
+
+}FContainerIeData;
+
+typedef struct
+{
+ Uint8 lengthOfNodeName;
+ Uint8 nodeName;
+ Uint8 lengthOfNodeRealm;
+ Uint8 nodeRealm;
+
+}NodeIdentifierIeData;
+
+typedef struct
+{
+ bool dcnr;
+
+}UpFunctionSelectionIndicationFlagsIeData;
+
+typedef struct
+{
+ bool fti;
+
+}HenbInformationReportingIeData;
+
+typedef struct
+{
+ Uint8 subnetPrefixLength;
+ IpAddressV4 iPv4DefaultRouterAddress;
+
+}Ip4cpIeData;
+
+typedef struct
+{
+ bool inapra;
+ Uint8 action;
+ Uint32 presenceReportingAreaIdentifier;
+ Uint8 numberOfTAI;
+ Uint8 numberOfRAI;
+ Uint8 numberOfMacroeNodeB;
+ Uint8 numberOfHomeeNodeB;
+ Uint8 numberOfECGI;
+ Uint8 numberOfSAI;
+ Uint8 numberOfCGI;
+ TaiFieldArray15 tais;
+ Uint8 macroeNBIds;
+ Uint8 homeeNBIds;
+ EcgiFieldArray64 ecgis;
+ RaiFieldArray15 raiss;
+ SaiFieldArray64 saiss;
+ CgiFieldArray64 cgiss;
+ Uint8 numberOfExtendedMacroeNodeB;
+ Uint8 extendedMacroeNBIds;
+
+}PresenceReportingAreaActionIeData;
+
+typedef struct
+{
+ Uint8 nodeType;
+
+}NodeTypeIeData;
+
+typedef struct
+{
+ Uint8 procedureTransactionId;
+
+}PtiIeData;
+
+typedef struct
+{
+ bool mcm;
+ bool scm;
+
+}TwmiIeData;
+
+typedef struct
+{
+ Uint64 millisecondTimeStampValue;
+
+}MillisecondTimeStampIeData;
+
+typedef struct
+{
+ Uint64 integerNumberValue;
+
+}IntegerNumberIeData;
+
+typedef struct
+{
+ Uint16 mappedUEUsageType;
+
+}MappedUeUsageTypeIeData;
+
+typedef struct
+{
+ Uint32 uliTimestampvalue;
+
+}UliTimestampIeData;
+
+typedef struct
+{
+ Uint8 metric;
+
+}MetricIeData;
+
+typedef struct
+{
+ bool imeifpresent;
+ bool msisdnfpresent;
+ Uint8 lengthofIMSI;
+ DigitRegister imsi;
+ Uint8 lengthOfMSISDN;
+ DigitRegister msisdn;
+ Uint8 lengthOfIMEI;
+ DigitRegister imei;
+
+}RemoteUserIdIeData;
+
+typedef struct
+{
+ Uint64 remoteUeIpInformation;
+
+}RemoteUeIpInformationIeData;
+
+typedef struct
+{
+ Uint32 sequenceNumber;
+
+}SequenceNumberIeData;
+
+typedef struct
+{
+ Uint8 relativeCapacity;
+ Uint8 apnLength;
+ Uint8Array32 apn;
+
+}ApnAndRelativeCapacityIeData;
+
+typedef struct
+{
+ Uint8 pci;
+ Uint8 pl;
+ Uint8 pvi;
+
+}ArpIeData;
+
+typedef struct
+{
+ Uint8 throttlingDelayUnit;
+ Uint8 throttlingDelayValue;
+ Uint8 throttlingFactor;
+
+}ThrottlingIeData;
+
+typedef struct
+{
+ Uint8 epsBearerId;
+ Uint8 ppi;
+ Uint8 ppiValue;
+
+}PagingAndServiceInformationIeData;
+
+
+//Ie Type Constants
+static const Uint8 ImsiIeType = 1;
+static const Uint8 CauseIeType = 2;
+static const Uint8 MsisdnIeType = 76;
+static const Uint8 MeiIeType = 75;
+static const Uint8 UliIeType = 86;
+static const Uint8 ServingNetworkIeType = 83;
+static const Uint8 RatTypeIeType = 82;
+static const Uint8 IndicationIeType = 77;
+static const Uint8 FTeidIeType = 87;
+static const Uint8 ApnIeType = 71;
+static const Uint8 SelectionModeIeType = 128;
+static const Uint8 PdnTypeIeType = 99;
+static const Uint8 PaaIeType = 79;
+static const Uint8 ApnRestrictionIeType = 127;
+static const Uint8 AmbrMmbrIeType = 161;
+static const Uint8 AmbrIeType = 72;
+static const Uint8 EbiIeType = 73;
+static const Uint8 PcoIeType = 78;
+static const Uint8 TraceInformationIeType = 96;
+static const Uint8 RecoveryIeType = 3;
+static const Uint8 UeTimeZoneIeType = 114;
+static const Uint8 UciIeType = 145;
+static const Uint8 ChargingCharacteristicsIeType = 95;
+static const Uint8 LocalDistinguishedNameIeType = 151;
+static const Uint8 SignallingPriorityIndicationIeType = 157;
+static const Uint8 AdditionalProtocolConfigurationOptionsIeType = 163;
+static const Uint8 FqCsidIeType = 132;
+static const Uint8 BearerTftIeType = 84;
+static const Uint8 BearerQosIeType = 80;
+static const Uint8 ChangeReportingActionIeType = 131;
+static const Uint8 CsgInformationReportingActionIeType = 146;
+static const Uint8 FqdnIeType = 136;
+static const Uint8 EpcTimerIeType = 156;
+static const Uint8 ChargingIdIeType = 94;
+static const Uint8 BearerFlagsIeType = 97;
+static const Uint8 IpAddressIeType = 74;
+static const Uint8 DelayValueIeType = 92;
+static const Uint8 PortNumberIeType = 126;
+static const Uint8 CnOperatorSelectionEntityIeType = 173;
+static const Uint8 ServingPlmnRateControlIeType = 198;
+static const Uint8 CounterIeType = 199;
+static const Uint8 TwanIdentifierIeType = 169;
+static const Uint8 TwanIdentifierTimestampIeType = 179;
+static const Uint8 SecondaryRatUsageDataReportIeType = 201;
+static const Uint8 RanNasCauseIeType = 172;
+static const Uint8 EpcoIeType = 197;
+static const Uint8 MaximumPacketLossRateIeType = 203;
+static const Uint8 FContainerIeType = 118;
+static const Uint8 NodeIdentifierIeType = 176;
+static const Uint8 UpFunctionSelectionIndicationFlagsIeType = 202;
+static const Uint8 HenbInformationReportingIeType = 165;
+static const Uint8 Ip4cpIeType = 166;
+static const Uint8 PresenceReportingAreaActionIeType = 177;
+static const Uint8 NodeTypeIeType = 135;
+static const Uint8 PtiIeType = 100;
+static const Uint8 TwmiIeType = 174;
+static const Uint8 MillisecondTimeStampIeType = 188;
+static const Uint8 IntegerNumberIeType = 187;
+static const Uint8 MappedUeUsageTypeIeType = 200;
+static const Uint8 UliTimestampIeType = 170;
+static const Uint8 MetricIeType = 182;
+static const Uint8 RemoteUserIdIeType = 192;
+static const Uint8 RemoteUeIpInformationIeType = 193;
+static const Uint8 SequenceNumberIeType = 183;
+static const Uint8 ApnAndRelativeCapacityIeType = 184;
+static const Uint8 ArpIeType = 155;
+static const Uint8 ThrottlingIeType = 154;
+static const Uint8 PagingAndServiceInformationIeType = 186;
+
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/gtpV2IeFactory.cpp b/src/gtpV2Codec/ieClasses/gtpV2IeFactory.cpp
new file mode 100644
index 0000000..f10109f
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/gtpV2IeFactory.cpp
@@ -0,0 +1,329 @@
+/*
+ * 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/iefactorytemplate.cpp.tt>
+ ******************************************************************************/
+
+#include <map>
+#include "gtpV2IeFactory.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2GrpIeDataTypes.h"
+#include "imsiIe.h"
+#include "causeIe.h"
+#include "msisdnIe.h"
+#include "meiIe.h"
+#include "uliIe.h"
+#include "servingNetworkIe.h"
+#include "ratTypeIe.h"
+#include "indicationIe.h"
+#include "fTeidIe.h"
+#include "apnIe.h"
+#include "selectionModeIe.h"
+#include "pdnTypeIe.h"
+#include "paaIe.h"
+#include "apnRestrictionIe.h"
+#include "ambrMmbrIe.h"
+#include "ambrIe.h"
+#include "ebiIe.h"
+#include "pcoIe.h"
+#include "traceInformationIe.h"
+#include "recoveryIe.h"
+#include "ueTimeZoneIe.h"
+#include "uciIe.h"
+#include "chargingCharacteristicsIe.h"
+#include "localDistinguishedNameIe.h"
+#include "signallingPriorityIndicationIe.h"
+#include "additionalProtocolConfigurationOptionsIe.h"
+#include "fqCsidIe.h"
+#include "bearerTftIe.h"
+#include "bearerQosIe.h"
+#include "changeReportingActionIe.h"
+#include "csgInformationReportingActionIe.h"
+#include "fqdnIe.h"
+#include "epcTimerIe.h"
+#include "chargingIdIe.h"
+#include "bearerFlagsIe.h"
+#include "ipAddressIe.h"
+#include "delayValueIe.h"
+#include "portNumberIe.h"
+#include "cnOperatorSelectionEntityIe.h"
+#include "servingPlmnRateControlIe.h"
+#include "counterIe.h"
+#include "twanIdentifierIe.h"
+#include "twanIdentifierTimestampIe.h"
+#include "secondaryRatUsageDataReportIe.h"
+#include "ranNasCauseIe.h"
+#include "epcoIe.h"
+#include "maximumPacketLossRateIe.h"
+#include "fContainerIe.h"
+#include "nodeIdentifierIe.h"
+#include "upFunctionSelectionIndicationFlagsIe.h"
+#include "henbInformationReportingIe.h"
+#include "ip4cpIe.h"
+#include "presenceReportingAreaActionIe.h"
+#include "nodeTypeIe.h"
+#include "ptiIe.h"
+#include "twmiIe.h"
+#include "millisecondTimeStampIe.h"
+#include "integerNumberIe.h"
+#include "mappedUeUsageTypeIe.h"
+#include "uliTimestampIe.h"
+#include "metricIe.h"
+#include "remoteUserIdIe.h"
+#include "remoteUeIpInformationIe.h"
+#include "sequenceNumberIe.h"
+#include "apnAndRelativeCapacityIe.h"
+#include "arpIe.h"
+#include "throttlingIe.h"
+#include "pagingAndServiceInformationIe.h"
+#include "bearerContextIe.h"
+#include "overloadControlInformationIe.h"
+#include "loadControlInformationIe.h"
+#include "remoteUeContextIe.h"
+
+GtpV2IeFactory::GtpV2IeFactory()
+{
+ //Create Message Objects
+ ImsiIe* imsiIe_p = new (ImsiIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(ImsiIeType, imsiIe_p));
+
+ CauseIe* causeIe_p = new (CauseIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(CauseIeType, causeIe_p));
+
+ MsisdnIe* msisdnIe_p = new (MsisdnIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(MsisdnIeType, msisdnIe_p));
+
+ MeiIe* meiIe_p = new (MeiIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(MeiIeType, meiIe_p));
+
+ UliIe* uliIe_p = new (UliIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(UliIeType, uliIe_p));
+
+ ServingNetworkIe* servingNetworkIe_p = new (ServingNetworkIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(ServingNetworkIeType, servingNetworkIe_p));
+
+ RatTypeIe* ratTypeIe_p = new (RatTypeIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(RatTypeIeType, ratTypeIe_p));
+
+ IndicationIe* indicationIe_p = new (IndicationIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(IndicationIeType, indicationIe_p));
+
+ FTeidIe* fTeidIe_p = new (FTeidIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(FTeidIeType, fTeidIe_p));
+
+ ApnIe* apnIe_p = new (ApnIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(ApnIeType, apnIe_p));
+
+ SelectionModeIe* selectionModeIe_p = new (SelectionModeIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(SelectionModeIeType, selectionModeIe_p));
+
+ PdnTypeIe* pdnTypeIe_p = new (PdnTypeIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(PdnTypeIeType, pdnTypeIe_p));
+
+ PaaIe* paaIe_p = new (PaaIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(PaaIeType, paaIe_p));
+
+ ApnRestrictionIe* apnRestrictionIe_p = new (ApnRestrictionIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(ApnRestrictionIeType, apnRestrictionIe_p));
+
+ AmbrMmbrIe* ambrMmbrIe_p = new (AmbrMmbrIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(AmbrMmbrIeType, ambrMmbrIe_p));
+
+ AmbrIe* ambrIe_p = new (AmbrIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(AmbrIeType, ambrIe_p));
+
+ EbiIe* ebiIe_p = new (EbiIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(EbiIeType, ebiIe_p));
+
+ PcoIe* pcoIe_p = new (PcoIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(PcoIeType, pcoIe_p));
+
+ TraceInformationIe* traceInformationIe_p = new (TraceInformationIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(TraceInformationIeType, traceInformationIe_p));
+
+ RecoveryIe* recoveryIe_p = new (RecoveryIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(RecoveryIeType, recoveryIe_p));
+
+ UeTimeZoneIe* ueTimeZoneIe_p = new (UeTimeZoneIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(UeTimeZoneIeType, ueTimeZoneIe_p));
+
+ UciIe* uciIe_p = new (UciIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(UciIeType, uciIe_p));
+
+ ChargingCharacteristicsIe* chargingCharacteristicsIe_p = new (ChargingCharacteristicsIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(ChargingCharacteristicsIeType, chargingCharacteristicsIe_p));
+
+ LocalDistinguishedNameIe* localDistinguishedNameIe_p = new (LocalDistinguishedNameIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(LocalDistinguishedNameIeType, localDistinguishedNameIe_p));
+
+ SignallingPriorityIndicationIe* signallingPriorityIndicationIe_p = new (SignallingPriorityIndicationIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(SignallingPriorityIndicationIeType, signallingPriorityIndicationIe_p));
+
+ AdditionalProtocolConfigurationOptionsIe* additionalProtocolConfigurationOptionsIe_p = new (AdditionalProtocolConfigurationOptionsIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(AdditionalProtocolConfigurationOptionsIeType, additionalProtocolConfigurationOptionsIe_p));
+
+ FqCsidIe* fqCsidIe_p = new (FqCsidIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(FqCsidIeType, fqCsidIe_p));
+
+ BearerTftIe* bearerTftIe_p = new (BearerTftIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(BearerTftIeType, bearerTftIe_p));
+
+ BearerQosIe* bearerQosIe_p = new (BearerQosIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(BearerQosIeType, bearerQosIe_p));
+
+ ChangeReportingActionIe* changeReportingActionIe_p = new (ChangeReportingActionIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(ChangeReportingActionIeType, changeReportingActionIe_p));
+
+ CsgInformationReportingActionIe* csgInformationReportingActionIe_p = new (CsgInformationReportingActionIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(CsgInformationReportingActionIeType, csgInformationReportingActionIe_p));
+
+ FqdnIe* fqdnIe_p = new (FqdnIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(FqdnIeType, fqdnIe_p));
+
+ EpcTimerIe* epcTimerIe_p = new (EpcTimerIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(EpcTimerIeType, epcTimerIe_p));
+
+ ChargingIdIe* chargingIdIe_p = new (ChargingIdIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(ChargingIdIeType, chargingIdIe_p));
+
+ BearerFlagsIe* bearerFlagsIe_p = new (BearerFlagsIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(BearerFlagsIeType, bearerFlagsIe_p));
+
+ IpAddressIe* ipAddressIe_p = new (IpAddressIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(IpAddressIeType, ipAddressIe_p));
+
+ DelayValueIe* delayValueIe_p = new (DelayValueIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(DelayValueIeType, delayValueIe_p));
+
+ PortNumberIe* portNumberIe_p = new (PortNumberIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(PortNumberIeType, portNumberIe_p));
+
+ CnOperatorSelectionEntityIe* cnOperatorSelectionEntityIe_p = new (CnOperatorSelectionEntityIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(CnOperatorSelectionEntityIeType, cnOperatorSelectionEntityIe_p));
+
+ ServingPlmnRateControlIe* servingPlmnRateControlIe_p = new (ServingPlmnRateControlIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(ServingPlmnRateControlIeType, servingPlmnRateControlIe_p));
+
+ CounterIe* counterIe_p = new (CounterIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(CounterIeType, counterIe_p));
+
+ TwanIdentifierIe* twanIdentifierIe_p = new (TwanIdentifierIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(TwanIdentifierIeType, twanIdentifierIe_p));
+
+ TwanIdentifierTimestampIe* twanIdentifierTimestampIe_p = new (TwanIdentifierTimestampIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(TwanIdentifierTimestampIeType, twanIdentifierTimestampIe_p));
+
+ SecondaryRatUsageDataReportIe* secondaryRatUsageDataReportIe_p = new (SecondaryRatUsageDataReportIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(SecondaryRatUsageDataReportIeType, secondaryRatUsageDataReportIe_p));
+
+ RanNasCauseIe* ranNasCauseIe_p = new (RanNasCauseIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(RanNasCauseIeType, ranNasCauseIe_p));
+
+ EpcoIe* epcoIe_p = new (EpcoIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(EpcoIeType, epcoIe_p));
+
+ MaximumPacketLossRateIe* maximumPacketLossRateIe_p = new (MaximumPacketLossRateIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(MaximumPacketLossRateIeType, maximumPacketLossRateIe_p));
+
+ FContainerIe* fContainerIe_p = new (FContainerIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(FContainerIeType, fContainerIe_p));
+
+ NodeIdentifierIe* nodeIdentifierIe_p = new (NodeIdentifierIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(NodeIdentifierIeType, nodeIdentifierIe_p));
+
+ UpFunctionSelectionIndicationFlagsIe* upFunctionSelectionIndicationFlagsIe_p = new (UpFunctionSelectionIndicationFlagsIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(UpFunctionSelectionIndicationFlagsIeType, upFunctionSelectionIndicationFlagsIe_p));
+
+ HenbInformationReportingIe* henbInformationReportingIe_p = new (HenbInformationReportingIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(HenbInformationReportingIeType, henbInformationReportingIe_p));
+
+ Ip4cpIe* ip4cpIe_p = new (Ip4cpIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(Ip4cpIeType, ip4cpIe_p));
+
+ PresenceReportingAreaActionIe* presenceReportingAreaActionIe_p = new (PresenceReportingAreaActionIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(PresenceReportingAreaActionIeType, presenceReportingAreaActionIe_p));
+
+ NodeTypeIe* nodeTypeIe_p = new (NodeTypeIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(NodeTypeIeType, nodeTypeIe_p));
+
+ PtiIe* ptiIe_p = new (PtiIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(PtiIeType, ptiIe_p));
+
+ TwmiIe* twmiIe_p = new (TwmiIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(TwmiIeType, twmiIe_p));
+
+ MillisecondTimeStampIe* millisecondTimeStampIe_p = new (MillisecondTimeStampIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(MillisecondTimeStampIeType, millisecondTimeStampIe_p));
+
+ IntegerNumberIe* integerNumberIe_p = new (IntegerNumberIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(IntegerNumberIeType, integerNumberIe_p));
+
+ MappedUeUsageTypeIe* mappedUeUsageTypeIe_p = new (MappedUeUsageTypeIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(MappedUeUsageTypeIeType, mappedUeUsageTypeIe_p));
+
+ UliTimestampIe* uliTimestampIe_p = new (UliTimestampIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(UliTimestampIeType, uliTimestampIe_p));
+
+ MetricIe* metricIe_p = new (MetricIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(MetricIeType, metricIe_p));
+
+ RemoteUserIdIe* remoteUserIdIe_p = new (RemoteUserIdIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(RemoteUserIdIeType, remoteUserIdIe_p));
+
+ RemoteUeIpInformationIe* remoteUeIpInformationIe_p = new (RemoteUeIpInformationIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(RemoteUeIpInformationIeType, remoteUeIpInformationIe_p));
+
+ SequenceNumberIe* sequenceNumberIe_p = new (SequenceNumberIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(SequenceNumberIeType, sequenceNumberIe_p));
+
+ ApnAndRelativeCapacityIe* apnAndRelativeCapacityIe_p = new (ApnAndRelativeCapacityIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(ApnAndRelativeCapacityIeType, apnAndRelativeCapacityIe_p));
+
+ ArpIe* arpIe_p = new (ArpIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(ArpIeType, arpIe_p));
+
+ ThrottlingIe* throttlingIe_p = new (ThrottlingIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(ThrottlingIeType, throttlingIe_p));
+
+ PagingAndServiceInformationIe* pagingAndServiceInformationIe_p = new (PagingAndServiceInformationIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(PagingAndServiceInformationIeType, pagingAndServiceInformationIe_p));
+
+ BearerContextIe* bearerContextIe_p = new (BearerContextIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(BearerContextIeType, bearerContextIe_p));
+
+ OverloadControlInformationIe* overloadControlInformationIe_p = new (OverloadControlInformationIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(OverloadControlInformationIeType, overloadControlInformationIe_p));
+
+ LoadControlInformationIe* loadControlInformationIe_p = new (LoadControlInformationIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(LoadControlInformationIeType, loadControlInformationIe_p));
+
+ RemoteUeContextIe* remoteUeContextIe_p = new (RemoteUeContextIe);
+ ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>(RemoteUeContextIeType, remoteUeContextIe_p));
+
+
+}
+
+GtpV2IeFactory::~GtpV2IeFactory() {
+ // TODO clean up the allocated memory for message objects
+}
+
+GtpV2IeFactory& GtpV2IeFactory::getInstance()
+{
+ static GtpV2IeFactory gtpV2IeFactory;
+ return gtpV2IeFactory;
+}
+
+GtpV2Ie& GtpV2IeFactory::getIeObject(Uint8 ieType)
+{
+ std::map<Uint8, GtpV2Ie*>::iterator it;
+ it = ieObjectContainer.find(ieType);
+ return *(it->second);
+}
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/gtpV2IeFactory.h b/src/gtpV2Codec/ieClasses/gtpV2IeFactory.h
new file mode 100644
index 0000000..b04eb47
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/gtpV2IeFactory.h
@@ -0,0 +1,44 @@
+/*
+ * 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/iefactorytemplate.h.tt>
+ ******************************************************************************/
+#ifndef GTPV2IEFACTORY_H_
+#define GTPV2IEFACTORY_H_
+
+#include <map>
+#include "manual/gtpV2Ie.h"
+
+class GtpV2IeFactory {
+public:
+ GtpV2IeFactory();
+ virtual ~GtpV2IeFactory();
+
+ static GtpV2IeFactory& getInstance();
+
+ GtpV2Ie& getIeObject(Uint8 ieType);
+
+private:
+
+ map<Uint8, GtpV2Ie*> ieObjectContainer;
+
+};
+
+
+#endif /* GTPV2MSGFACTORY_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/henbInformationReportingIe.cpp b/src/gtpV2Codec/ieClasses/henbInformationReportingIe.cpp
new file mode 100644
index 0000000..80ceccc
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/henbInformationReportingIe.cpp
@@ -0,0 +1,86 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "henbInformationReportingIe.h"
+#include "dataTypeCodecUtils.h"
+
+HenbInformationReportingIe::HenbInformationReportingIe()
+{
+ ieType = 165;
+ // TODO
+
+}
+
+HenbInformationReportingIe::~HenbInformationReportingIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool HenbInformationReportingIe::encodeHenbInformationReportingIe(MsgBuffer &buffer, HenbInformationReportingIeData const &data)
+{
+ buffer.skipBits(4);
+
+ if(!(buffer.writeBits(data.fti, 4)))
+ {
+ errorStream.add((char *)"Encoding of fti failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool HenbInformationReportingIe::decodeHenbInformationReportingIe(MsgBuffer &buffer, HenbInformationReportingIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+ buffer.skipBits(4);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: \n");
+ return false;
+ }
+
+ data.fti = buffer.readBits(4);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: fti\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE HenbInformationReportingIe\n");
+ return false;
+ }
+}
+void HenbInformationReportingIe::displayHenbInformationReportingIe_v(HenbInformationReportingIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"HenbInformationReportingIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add( (char *)"fti: ");
+ stream.add((Uint8)data.fti);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/henbInformationReportingIe.h b/src/gtpV2Codec/ieClasses/henbInformationReportingIe.h
new file mode 100644
index 0000000..1c16062
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/henbInformationReportingIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef HENBINFORMATIONREPORTINGIE_H_
+#define HENBINFORMATIONREPORTINGIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class HenbInformationReportingIe: public GtpV2Ie {
+public:
+ HenbInformationReportingIe();
+ virtual ~HenbInformationReportingIe();
+
+ bool encodeHenbInformationReportingIe(MsgBuffer &buffer,
+ HenbInformationReportingIeData const &data);
+ bool decodeHenbInformationReportingIe(MsgBuffer &buffer,
+ HenbInformationReportingIeData &data, Uint16 length);
+ void displayHenbInformationReportingIe_v(HenbInformationReportingIeData const &data,
+ Debug &stream);
+};
+
+#endif /* HENBINFORMATIONREPORTINGIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/imsiIe.cpp b/src/gtpV2Codec/ieClasses/imsiIe.cpp
new file mode 100644
index 0000000..1991b06
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/imsiIe.cpp
@@ -0,0 +1,88 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "imsiIe.h"
+#include "dataTypeCodecUtils.h"
+
+ImsiIe::ImsiIe()
+{
+ ieType = 1;
+ // TODO
+
+}
+
+ImsiIe::~ImsiIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool ImsiIe::encodeImsiIe(MsgBuffer &buffer, ImsiIeData const &data)
+{
+ if (!(data.imsiValue.length>=9 && data.imsiValue.length <=15))
+ {
+ errorStream.add((char *)"Data validation failure: imsiValue\n");
+ return false;
+ }
+ if (!(DataTypeCodecUtils::encodeDigitRegister(buffer, data.imsiValue)))
+ {
+ errorStream.add((char *)"Encoding of imsiValue failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool ImsiIe::decodeImsiIe(MsgBuffer &buffer, ImsiIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+
+ Uint16 lengthLeft = length;
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeDigitRegister(buffer, data.imsiValue, lengthLeft)))
+ {
+ errorStream.add((char *)"Failed to decode: imsiValue\n");
+ return false;
+ }
+ if (!(data.imsiValue.length>=9 && data.imsiValue.length <=15))
+ {
+ errorStream.add((char *)"Data validation failure : imsiValue\n");
+ return false; //TODO need to add validations
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE ImsiIe\n");
+ return false;
+ }
+}
+void ImsiIe::displayImsiIe_v(ImsiIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"ImsiIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add((char *)"imsiValue:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displayDigitRegister_v(data.imsiValue, stream);
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/imsiIe.h b/src/gtpV2Codec/ieClasses/imsiIe.h
new file mode 100644
index 0000000..c7bc17d
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/imsiIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef IMSIIE_H_
+#define IMSIIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class ImsiIe: public GtpV2Ie {
+public:
+ ImsiIe();
+ virtual ~ImsiIe();
+
+ bool encodeImsiIe(MsgBuffer &buffer,
+ ImsiIeData const &data);
+ bool decodeImsiIe(MsgBuffer &buffer,
+ ImsiIeData &data, Uint16 length);
+ void displayImsiIe_v(ImsiIeData const &data,
+ Debug &stream);
+};
+
+#endif /* IMSIIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/indicationIe.cpp b/src/gtpV2Codec/ieClasses/indicationIe.cpp
new file mode 100644
index 0000000..b70471c
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/indicationIe.cpp
@@ -0,0 +1,406 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "indicationIe.h"
+#include "dataTypeCodecUtils.h"
+
+IndicationIe::IndicationIe()
+{
+ ieType = 77;
+ // TODO
+
+}
+
+IndicationIe::~IndicationIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool IndicationIe::encodeIndicationIe(MsgBuffer &buffer, IndicationIeData const &data)
+{
+ if(!(buffer.writeBits(data.iDAF, 1)))
+ {
+ errorStream.add((char *)"Encoding of iDAF failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.iDTF, 1)))
+ {
+ errorStream.add((char *)"Encoding of iDTF failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.iHI, 1)))
+ {
+ errorStream.add((char *)"Encoding of iHI failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.iDFI, 1)))
+ {
+ errorStream.add((char *)"Encoding of iDFI failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.iOI, 1)))
+ {
+ errorStream.add((char *)"Encoding of iOI failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.iISRSI, 1)))
+ {
+ errorStream.add((char *)"Encoding of iISRSI failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.iISRAI, 1)))
+ {
+ errorStream.add((char *)"Encoding of iISRAI failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.iSGWCI, 1)))
+ {
+ errorStream.add((char *)"Encoding of iSGWCI failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.iSQCI, 1)))
+ {
+ errorStream.add((char *)"Encoding of iSQCI failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.iUIMSI, 1)))
+ {
+ errorStream.add((char *)"Encoding of iUIMSI failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.iCFSI, 1)))
+ {
+ errorStream.add((char *)"Encoding of iCFSI failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.iCRSI, 1)))
+ {
+ errorStream.add((char *)"Encoding of iCRSI failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.iP, 1)))
+ {
+ errorStream.add((char *)"Encoding of iP failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.iPT, 1)))
+ {
+ errorStream.add((char *)"Encoding of iPT failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.iSI, 1)))
+ {
+ errorStream.add((char *)"Encoding of iSI failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.iMSV, 1)))
+ {
+ errorStream.add((char *)"Encoding of iMSV failed\n");
+ return false;
+ }
+ buffer.skipBits(3);
+
+ if(!(buffer.writeBits(data.iS6AF, 1)))
+ {
+ errorStream.add((char *)"Encoding of iS6AF failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.iS4AF, 1)))
+ {
+ errorStream.add((char *)"Encoding of iS4AF failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.iMBMDT, 1)))
+ {
+ errorStream.add((char *)"Encoding of iMBMDT failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.iISRAU, 1)))
+ {
+ errorStream.add((char *)"Encoding of iISRAU failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.iCCRSI, 1)))
+ {
+ errorStream.add((char *)"Encoding of iCCRSI failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool IndicationIe::decodeIndicationIe(MsgBuffer &buffer, IndicationIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+ data.iDAF = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: iDAF\n");
+ return false;
+ }
+ data.iDTF = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: iDTF\n");
+ return false;
+ }
+ data.iHI = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: iHI\n");
+ return false;
+ }
+ data.iDFI = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: iDFI\n");
+ return false;
+ }
+ data.iOI = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: iOI\n");
+ return false;
+ }
+ data.iISRSI = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: iISRSI\n");
+ return false;
+ }
+ data.iISRAI = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: iISRAI\n");
+ return false;
+ }
+ data.iSGWCI = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: iSGWCI\n");
+ return false;
+ }
+ data.iSQCI = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: iSQCI\n");
+ return false;
+ }
+ data.iUIMSI = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: iUIMSI\n");
+ return false;
+ }
+ data.iCFSI = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: iCFSI\n");
+ return false;
+ }
+ data.iCRSI = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: iCRSI\n");
+ return false;
+ }
+ data.iP = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: iP\n");
+ return false;
+ }
+ data.iPT = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: iPT\n");
+ return false;
+ }
+ data.iSI = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: iSI\n");
+ return false;
+ }
+ data.iMSV = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: iMSV\n");
+ return false;
+ }
+ buffer.skipBits(3);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: \n");
+ return false;
+ }
+
+ data.iS6AF = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: iS6AF\n");
+ return false;
+ }
+ data.iS4AF = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: iS4AF\n");
+ return false;
+ }
+ data.iMBMDT = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: iMBMDT\n");
+ return false;
+ }
+ data.iISRAU = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: iISRAU\n");
+ return false;
+ }
+ data.iCCRSI = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: iCCRSI\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE IndicationIe\n");
+ return false;
+ }
+}
+void IndicationIe::displayIndicationIe_v(IndicationIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"IndicationIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add( (char *)"iDAF: ");
+ stream.add((Uint8)data.iDAF);
+ stream.endOfLine();
+
+ stream.add( (char *)"iDTF: ");
+ stream.add((Uint8)data.iDTF);
+ stream.endOfLine();
+
+ stream.add( (char *)"iHI: ");
+ stream.add((Uint8)data.iHI);
+ stream.endOfLine();
+
+ stream.add( (char *)"iDFI: ");
+ stream.add((Uint8)data.iDFI);
+ stream.endOfLine();
+
+ stream.add( (char *)"iOI: ");
+ stream.add((Uint8)data.iOI);
+ stream.endOfLine();
+
+ stream.add( (char *)"iISRSI: ");
+ stream.add((Uint8)data.iISRSI);
+ stream.endOfLine();
+
+ stream.add( (char *)"iISRAI: ");
+ stream.add((Uint8)data.iISRAI);
+ stream.endOfLine();
+
+ stream.add( (char *)"iSGWCI: ");
+ stream.add((Uint8)data.iSGWCI);
+ stream.endOfLine();
+
+ stream.add( (char *)"iSQCI: ");
+ stream.add((Uint8)data.iSQCI);
+ stream.endOfLine();
+
+ stream.add( (char *)"iUIMSI: ");
+ stream.add((Uint8)data.iUIMSI);
+ stream.endOfLine();
+
+ stream.add( (char *)"iCFSI: ");
+ stream.add((Uint8)data.iCFSI);
+ stream.endOfLine();
+
+ stream.add( (char *)"iCRSI: ");
+ stream.add((Uint8)data.iCRSI);
+ stream.endOfLine();
+
+ stream.add( (char *)"iP: ");
+ stream.add((Uint8)data.iP);
+ stream.endOfLine();
+
+ stream.add( (char *)"iPT: ");
+ stream.add((Uint8)data.iPT);
+ stream.endOfLine();
+
+ stream.add( (char *)"iSI: ");
+ stream.add((Uint8)data.iSI);
+ stream.endOfLine();
+
+ stream.add( (char *)"iMSV: ");
+ stream.add((Uint8)data.iMSV);
+ stream.endOfLine();
+
+ stream.add( (char *)"iS6AF: ");
+ stream.add((Uint8)data.iS6AF);
+ stream.endOfLine();
+
+ stream.add( (char *)"iS4AF: ");
+ stream.add((Uint8)data.iS4AF);
+ stream.endOfLine();
+
+ stream.add( (char *)"iMBMDT: ");
+ stream.add((Uint8)data.iMBMDT);
+ stream.endOfLine();
+
+ stream.add( (char *)"iISRAU: ");
+ stream.add((Uint8)data.iISRAU);
+ stream.endOfLine();
+
+ stream.add( (char *)"iCCRSI: ");
+ stream.add((Uint8)data.iCCRSI);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/indicationIe.h b/src/gtpV2Codec/ieClasses/indicationIe.h
new file mode 100644
index 0000000..d328db0
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/indicationIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef INDICATIONIE_H_
+#define INDICATIONIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class IndicationIe: public GtpV2Ie {
+public:
+ IndicationIe();
+ virtual ~IndicationIe();
+
+ bool encodeIndicationIe(MsgBuffer &buffer,
+ IndicationIeData const &data);
+ bool decodeIndicationIe(MsgBuffer &buffer,
+ IndicationIeData &data, Uint16 length);
+ void displayIndicationIe_v(IndicationIeData const &data,
+ Debug &stream);
+};
+
+#endif /* INDICATIONIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/integerNumberIe.cpp b/src/gtpV2Codec/ieClasses/integerNumberIe.cpp
new file mode 100644
index 0000000..c9201c0
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/integerNumberIe.cpp
@@ -0,0 +1,77 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "integerNumberIe.h"
+#include "dataTypeCodecUtils.h"
+
+IntegerNumberIe::IntegerNumberIe()
+{
+ ieType = 187;
+ // TODO
+
+}
+
+IntegerNumberIe::~IntegerNumberIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool IntegerNumberIe::encodeIntegerNumberIe(MsgBuffer &buffer, IntegerNumberIeData const &data)
+{
+ if (!(buffer.writeUint64(data.integerNumberValue)))
+ {
+ errorStream.add((char *)"Encoding of integerNumberValue failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool IntegerNumberIe::decodeIntegerNumberIe(MsgBuffer &buffer, IntegerNumberIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+
+ buffer.readUint64(data.integerNumberValue);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: integerNumberValue\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE IntegerNumberIe\n");
+ return false;
+ }
+}
+void IntegerNumberIe::displayIntegerNumberIe_v(IntegerNumberIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"IntegerNumberIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add((char *)"integerNumberValue: ");
+ stream.add(data.integerNumberValue);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/integerNumberIe.h b/src/gtpV2Codec/ieClasses/integerNumberIe.h
new file mode 100644
index 0000000..f7bac42
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/integerNumberIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef INTEGERNUMBERIE_H_
+#define INTEGERNUMBERIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class IntegerNumberIe: public GtpV2Ie {
+public:
+ IntegerNumberIe();
+ virtual ~IntegerNumberIe();
+
+ bool encodeIntegerNumberIe(MsgBuffer &buffer,
+ IntegerNumberIeData const &data);
+ bool decodeIntegerNumberIe(MsgBuffer &buffer,
+ IntegerNumberIeData &data, Uint16 length);
+ void displayIntegerNumberIe_v(IntegerNumberIeData const &data,
+ Debug &stream);
+};
+
+#endif /* INTEGERNUMBERIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/ip4cpIe.cpp b/src/gtpV2Codec/ieClasses/ip4cpIe.cpp
new file mode 100644
index 0000000..c3a216f
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/ip4cpIe.cpp
@@ -0,0 +1,94 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "ip4cpIe.h"
+#include "dataTypeCodecUtils.h"
+
+Ip4cpIe::Ip4cpIe()
+{
+ ieType = 166;
+ // TODO
+
+}
+
+Ip4cpIe::~Ip4cpIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool Ip4cpIe::encodeIp4cpIe(MsgBuffer &buffer, Ip4cpIeData const &data)
+{
+ if (!(buffer.writeUint8(data.subnetPrefixLength)))
+ {
+ errorStream.add((char *)"Encoding of subnetPrefixLength failed\n");
+ return false;
+ }
+ if (!(DataTypeCodecUtils::encodeIpAddressV4(buffer, data.iPv4DefaultRouterAddress)))
+ {
+ errorStream.add((char *)"Encoding of iPv4DefaultRouterAddress failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool Ip4cpIe::decodeIp4cpIe(MsgBuffer &buffer, Ip4cpIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+
+ buffer.readUint8(data.subnetPrefixLength);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: subnetPrefixLength\n");
+ return false;
+ }
+
+ Uint16 lengthLeft = length;
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeIpAddressV4(buffer, data.iPv4DefaultRouterAddress, lengthLeft)))
+ {
+ errorStream.add((char *)"Failed to decode: iPv4DefaultRouterAddress\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE Ip4cpIe\n");
+ return false;
+ }
+}
+void Ip4cpIe::displayIp4cpIe_v(Ip4cpIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"Ip4cpIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add((char *)"subnetPrefixLength: ");
+ stream.add(data.subnetPrefixLength);
+ stream.endOfLine();
+
+ stream.add((char *)"iPv4DefaultRouterAddress:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displayIpAddressV4_v(data.iPv4DefaultRouterAddress, stream);
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/ip4cpIe.h b/src/gtpV2Codec/ieClasses/ip4cpIe.h
new file mode 100644
index 0000000..e41936b
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/ip4cpIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef IP4CPIE_H_
+#define IP4CPIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class Ip4cpIe: public GtpV2Ie {
+public:
+ Ip4cpIe();
+ virtual ~Ip4cpIe();
+
+ bool encodeIp4cpIe(MsgBuffer &buffer,
+ Ip4cpIeData const &data);
+ bool decodeIp4cpIe(MsgBuffer &buffer,
+ Ip4cpIeData &data, Uint16 length);
+ void displayIp4cpIe_v(Ip4cpIeData const &data,
+ Debug &stream);
+};
+
+#endif /* IP4CPIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/ipAddressIe.cpp b/src/gtpV2Codec/ieClasses/ipAddressIe.cpp
new file mode 100644
index 0000000..21e6264
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/ipAddressIe.cpp
@@ -0,0 +1,115 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "ipAddressIe.h"
+#include "dataTypeCodecUtils.h"
+
+IpAddressIe::IpAddressIe()
+{
+ ieType = 74;
+ // TODO
+
+}
+
+IpAddressIe::~IpAddressIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool IpAddressIe::encodeIpAddressIe(MsgBuffer &buffer, IpAddressIeData const &data)
+{
+ if (data.ipAddressV4Present)
+ {
+ if (!(DataTypeCodecUtils::encodeIpAddressV4(buffer, data.ipAddressV4)))
+ {
+ errorStream.add((char *)"Encoding of ipAddressV4 failed\n");
+ return false;
+ }
+ }
+ if (data.ipAddressV6Present)
+ {
+ if (!(DataTypeCodecUtils::encodeIpAddressV6(buffer, data.ipAddressV6)))
+ {
+ errorStream.add((char *)"Encoding of ipAddressV6 failed\n");
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool IpAddressIe::decodeIpAddressIe(MsgBuffer &buffer, IpAddressIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+
+ Uint16 lengthLeft = length;
+
+ if (length == 4)
+ {
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeIpAddressV4(buffer, data.ipAddressV4, lengthLeft)))
+ {
+ errorStream.add((char *)"Failed to decode: ipAddressV4\n");
+ return false;
+ }
+ data.ipAddressV4Present = true;
+ }
+
+ if (length == 6)
+ {
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeIpAddressV6(buffer, data.ipAddressV6, lengthLeft)))
+ {
+ errorStream.add((char *)"Failed to decode: ipAddressV6\n");
+ return false;
+ }
+ data.ipAddressV6Present = true;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE IpAddressIe\n");
+ return false;
+ }
+}
+void IpAddressIe::displayIpAddressIe_v(IpAddressIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"IpAddressIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ if (data.ipAddressV4Present)
+ {
+ stream.add((char *)"ipAddressV4:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displayIpAddressV4_v(data.ipAddressV4, stream);
+ }
+
+ if (data.ipAddressV6Present)
+ {
+ stream.add((char *)"ipAddressV6:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displayIpAddressV6_v(data.ipAddressV6, stream);
+ }
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/ipAddressIe.h b/src/gtpV2Codec/ieClasses/ipAddressIe.h
new file mode 100644
index 0000000..6d6fdfd
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/ipAddressIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef IPADDRESSIE_H_
+#define IPADDRESSIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class IpAddressIe: public GtpV2Ie {
+public:
+ IpAddressIe();
+ virtual ~IpAddressIe();
+
+ bool encodeIpAddressIe(MsgBuffer &buffer,
+ IpAddressIeData const &data);
+ bool decodeIpAddressIe(MsgBuffer &buffer,
+ IpAddressIeData &data, Uint16 length);
+ void displayIpAddressIe_v(IpAddressIeData const &data,
+ Debug &stream);
+};
+
+#endif /* IPADDRESSIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/loadControlInformationIe.cpp b/src/gtpV2Codec/ieClasses/loadControlInformationIe.cpp
new file mode 100644
index 0000000..1c1e8e3
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/loadControlInformationIe.cpp
@@ -0,0 +1,97 @@
+/*
+ * 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/grpietemplate.cpp.tt>
+ ******************************************************************************/
+#include "loadControlInformationIe.h"
+#include "gtpV2GrpIeDataTypes.h"
+#include "manual/gtpV2GroupedIe.h"
+
+#include "pgwsNodeLevelLoadControlInformationInCreateSessionResponse.h"
+#include "pgwsApnLevelLoadControlInformationInCreateSessionResponse.h"
+#include "sgwsNodeLevelLoadControlInformationInCreateSessionResponse.h"
+#include "sgwsNodeLevelLoadControlInformationInModifyBearerResponse.h"
+#include "pgwsApnLevelLoadControlInformationInModifyBearerResponse.h"
+#include "pgwsNodeLevelLoadControlInformationInModifyBearerResponse.h"
+#include "pgwsNodeLevelLoadControlInformationInDeleteSessionResponse.h"
+#include "pgwsApnLevelLoadControlInformationInDeleteSessionResponse.h"
+#include "sgwsNodeLevelLoadControlInformationInDeleteSessionResponse.h"
+#include "sgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponse.h"
+#include "pgwsNodeLevelLoadControlInformationInCreateBearerRequest.h"
+#include "pgwsApnLevelLoadControlInformationInCreateBearerRequest.h"
+#include "sgwsNodeLevelLoadControlInformationInCreateBearerRequest.h"
+#include "pgwsNodeLevelLoadControlInformationInDeleteBearerRequest.h"
+#include "pgwsApnLevelLoadControlInformationInDeleteBearerRequest.h"
+#include "sgwsNodeLevelLoadControlInformationInDeleteBearerRequest.h"
+#include "sgwsNodeLevelLoadControlInformationInDownlinkDataNotification.h"
+
+LoadControlInformationIe::LoadControlInformationIe()
+{
+ ieType = LoadControlInformationIeType;
+
+ PgwsNodeLevelLoadControlInformationInCreateSessionResponse* pgwsNodeLevelLoadControlInformationInCreateSessionResponse_p = new (PgwsNodeLevelLoadControlInformationInCreateSessionResponse);
+ insertGroupedIeObject(CreateSessionResponseMsgType, 0, pgwsNodeLevelLoadControlInformationInCreateSessionResponse_p);
+ PgwsApnLevelLoadControlInformationInCreateSessionResponse* pgwsApnLevelLoadControlInformationInCreateSessionResponse_p = new (PgwsApnLevelLoadControlInformationInCreateSessionResponse);
+ insertGroupedIeObject(CreateSessionResponseMsgType, 1, pgwsApnLevelLoadControlInformationInCreateSessionResponse_p);
+ SgwsNodeLevelLoadControlInformationInCreateSessionResponse* sgwsNodeLevelLoadControlInformationInCreateSessionResponse_p = new (SgwsNodeLevelLoadControlInformationInCreateSessionResponse);
+ insertGroupedIeObject(CreateSessionResponseMsgType, 2, sgwsNodeLevelLoadControlInformationInCreateSessionResponse_p);
+ SgwsNodeLevelLoadControlInformationInModifyBearerResponse* sgwsNodeLevelLoadControlInformationInModifyBearerResponse_p = new (SgwsNodeLevelLoadControlInformationInModifyBearerResponse);
+ insertGroupedIeObject(ModifyBearerResponseMsgType, 2, sgwsNodeLevelLoadControlInformationInModifyBearerResponse_p);
+ PgwsApnLevelLoadControlInformationInModifyBearerResponse* pgwsApnLevelLoadControlInformationInModifyBearerResponse_p = new (PgwsApnLevelLoadControlInformationInModifyBearerResponse);
+ insertGroupedIeObject(ModifyBearerResponseMsgType, 1, pgwsApnLevelLoadControlInformationInModifyBearerResponse_p);
+ PgwsNodeLevelLoadControlInformationInModifyBearerResponse* pgwsNodeLevelLoadControlInformationInModifyBearerResponse_p = new (PgwsNodeLevelLoadControlInformationInModifyBearerResponse);
+ insertGroupedIeObject(ModifyBearerResponseMsgType, 0, pgwsNodeLevelLoadControlInformationInModifyBearerResponse_p);
+ PgwsNodeLevelLoadControlInformationInDeleteSessionResponse* pgwsNodeLevelLoadControlInformationInDeleteSessionResponse_p = new (PgwsNodeLevelLoadControlInformationInDeleteSessionResponse);
+ insertGroupedIeObject(DeleteSessionResponseMsgType, 0, pgwsNodeLevelLoadControlInformationInDeleteSessionResponse_p);
+ PgwsApnLevelLoadControlInformationInDeleteSessionResponse* pgwsApnLevelLoadControlInformationInDeleteSessionResponse_p = new (PgwsApnLevelLoadControlInformationInDeleteSessionResponse);
+ insertGroupedIeObject(DeleteSessionResponseMsgType, 1, pgwsApnLevelLoadControlInformationInDeleteSessionResponse_p);
+ SgwsNodeLevelLoadControlInformationInDeleteSessionResponse* sgwsNodeLevelLoadControlInformationInDeleteSessionResponse_p = new (SgwsNodeLevelLoadControlInformationInDeleteSessionResponse);
+ insertGroupedIeObject(DeleteSessionResponseMsgType, 2, sgwsNodeLevelLoadControlInformationInDeleteSessionResponse_p);
+ SgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponse* sgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponse_p = new (SgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponse);
+ insertGroupedIeObject(ReleaseAccessBearersResponseMsgType, 0, sgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponse_p);
+ PgwsNodeLevelLoadControlInformationInCreateBearerRequest* pgwsNodeLevelLoadControlInformationInCreateBearerRequest_p = new (PgwsNodeLevelLoadControlInformationInCreateBearerRequest);
+ insertGroupedIeObject(CreateBearerRequestMsgType, 0, pgwsNodeLevelLoadControlInformationInCreateBearerRequest_p);
+ PgwsApnLevelLoadControlInformationInCreateBearerRequest* pgwsApnLevelLoadControlInformationInCreateBearerRequest_p = new (PgwsApnLevelLoadControlInformationInCreateBearerRequest);
+ insertGroupedIeObject(CreateBearerRequestMsgType, 1, pgwsApnLevelLoadControlInformationInCreateBearerRequest_p);
+ SgwsNodeLevelLoadControlInformationInCreateBearerRequest* sgwsNodeLevelLoadControlInformationInCreateBearerRequest_p = new (SgwsNodeLevelLoadControlInformationInCreateBearerRequest);
+ insertGroupedIeObject(CreateBearerRequestMsgType, 2, sgwsNodeLevelLoadControlInformationInCreateBearerRequest_p);
+ PgwsNodeLevelLoadControlInformationInDeleteBearerRequest* pgwsNodeLevelLoadControlInformationInDeleteBearerRequest_p = new (PgwsNodeLevelLoadControlInformationInDeleteBearerRequest);
+ insertGroupedIeObject(DeleteBearerRequestMsgType, 0, pgwsNodeLevelLoadControlInformationInDeleteBearerRequest_p);
+ PgwsApnLevelLoadControlInformationInDeleteBearerRequest* pgwsApnLevelLoadControlInformationInDeleteBearerRequest_p = new (PgwsApnLevelLoadControlInformationInDeleteBearerRequest);
+ insertGroupedIeObject(DeleteBearerRequestMsgType, 1, pgwsApnLevelLoadControlInformationInDeleteBearerRequest_p);
+ SgwsNodeLevelLoadControlInformationInDeleteBearerRequest* sgwsNodeLevelLoadControlInformationInDeleteBearerRequest_p = new (SgwsNodeLevelLoadControlInformationInDeleteBearerRequest);
+ insertGroupedIeObject(DeleteBearerRequestMsgType, 2, sgwsNodeLevelLoadControlInformationInDeleteBearerRequest_p);
+ SgwsNodeLevelLoadControlInformationInDownlinkDataNotification* sgwsNodeLevelLoadControlInformationInDownlinkDataNotification_p = new (SgwsNodeLevelLoadControlInformationInDownlinkDataNotification);
+ insertGroupedIeObject(DownlinkDataNotificationMsgType, 0, sgwsNodeLevelLoadControlInformationInDownlinkDataNotification_p);
+}
+
+LoadControlInformationIe::~LoadControlInformationIe() {
+// TODO Auto-generated destructor stub
+}
+
+GtpV2GroupedIe& LoadControlInformationIe::getGroupedIe(Uint8 msgType, Uint8 instance)
+{
+ std::map<Uint16, GtpV2GroupedIe*>::iterator it;
+ Uint16 key = msgType;
+ key = (key << 8) + instance;
+ it = groupedIeObjectContainer.find(key);
+ return *(it->second);
+}
+
+void LoadControlInformationIe::insertGroupedIeObject(Uint8 msgType, Uint8 instance, GtpV2GroupedIe* grpIe_p)
+{
+
+ Uint16 key = msgType;
+ key = (key << 8) + instance;
+
+ groupedIeObjectContainer.insert(std::pair<Uint16, GtpV2GroupedIe*>(key, grpIe_p));
+
+}
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/loadControlInformationIe.h b/src/gtpV2Codec/ieClasses/loadControlInformationIe.h
new file mode 100644
index 0000000..dbd7b52
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/loadControlInformationIe.h
@@ -0,0 +1,44 @@
+/*
+ * 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/grpietemplate.h.tt>
+ ******************************************************************************/
+#ifndef LOADCONTROLINFORMATIONIE_H_
+#define LOADCONTROLINFORMATIONIE_H_
+
+#include <map>
+#include "manual/gtpV2Ie.h"
+#include "manual/gtpV2GroupedIe.h"
+#include "gtpV2DataTypes.h"
+
+class LoadControlInformationIe:public GtpV2Ie
+{
+public:
+ LoadControlInformationIe ();
+ virtual ~ LoadControlInformationIe ();
+
+ GtpV2GroupedIe & getGroupedIe (Uint8 msgType, Uint8 instance);
+ void insertGroupedIeObject (Uint8 msgType, Uint8 instance,
+ GtpV2GroupedIe * grpIe_p);
+
+private:
+ map < Uint16, GtpV2GroupedIe * >groupedIeObjectContainer; // map[msgType || instance]
+};
+
+#endif
diff --git a/src/gtpV2Codec/ieClasses/localDistinguishedNameIe.cpp b/src/gtpV2Codec/ieClasses/localDistinguishedNameIe.cpp
new file mode 100644
index 0000000..a5a450c
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/localDistinguishedNameIe.cpp
@@ -0,0 +1,78 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "localDistinguishedNameIe.h"
+#include "dataTypeCodecUtils.h"
+
+LocalDistinguishedNameIe::LocalDistinguishedNameIe()
+{
+ ieType = 151;
+ // TODO
+
+}
+
+LocalDistinguishedNameIe::~LocalDistinguishedNameIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool LocalDistinguishedNameIe::encodeLocalDistinguishedNameIe(MsgBuffer &buffer, LocalDistinguishedNameIeData const &data)
+{
+ if (!(DataTypeCodecUtils::encodeUint8Array512(buffer, data.ldn)))
+ {
+ errorStream.add((char *)"Encoding of ldn failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool LocalDistinguishedNameIe::decodeLocalDistinguishedNameIe(MsgBuffer &buffer, LocalDistinguishedNameIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+
+ Uint16 lengthLeft = length;
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeUint8Array512(buffer, data.ldn, lengthLeft, 0)))
+ {
+ errorStream.add((char *)"Failed to decode: ldn\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE LocalDistinguishedNameIe\n");
+ return false;
+ }
+}
+void LocalDistinguishedNameIe::displayLocalDistinguishedNameIe_v(LocalDistinguishedNameIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"LocalDistinguishedNameIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add((char *)"ldn:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displayUint8Array512_v(data.ldn, stream);
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/localDistinguishedNameIe.h b/src/gtpV2Codec/ieClasses/localDistinguishedNameIe.h
new file mode 100644
index 0000000..cdfd380
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/localDistinguishedNameIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef LOCALDISTINGUISHEDNAMEIE_H_
+#define LOCALDISTINGUISHEDNAMEIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class LocalDistinguishedNameIe: public GtpV2Ie {
+public:
+ LocalDistinguishedNameIe();
+ virtual ~LocalDistinguishedNameIe();
+
+ bool encodeLocalDistinguishedNameIe(MsgBuffer &buffer,
+ LocalDistinguishedNameIeData const &data);
+ bool decodeLocalDistinguishedNameIe(MsgBuffer &buffer,
+ LocalDistinguishedNameIeData &data, Uint16 length);
+ void displayLocalDistinguishedNameIe_v(LocalDistinguishedNameIeData const &data,
+ Debug &stream);
+};
+
+#endif /* LOCALDISTINGUISHEDNAMEIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/manual/dataTypeCodecUtils_manual.cpp b/src/gtpV2Codec/ieClasses/manual/dataTypeCodecUtils_manual.cpp
new file mode 100644
index 0000000..b15a798
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/manual/dataTypeCodecUtils_manual.cpp
@@ -0,0 +1,99 @@
+ /*
+Copyright 2019-present Infosys Limited
+
+SPDX-License-Identifier: Apache-2.0
+
+*/
+
+
+#include "../../../gtpV2Codec/ieClasses/dataTypeCodecUtils.h"
+#include "../../../gtpV2Codec/ieClasses/manual/gtpV2DataTypes_Manual.h"
+
+bool
+DataTypeCodecUtils::encodeDigitRegister (MsgBuffer & buffer,
+ DigitRegister const & data)
+{
+ Uint8 i;
+ for (i = 0; i< data.length; i+= 2)
+ {
+ Uint8 digit1 = data.digits[i];
+ Uint8 digit2 = data.digits[i+1];
+
+ if (digit1 >9 || (digit2 > 9 && digit2 != 0x0F))
+ {
+ errorStream.add((char *)"Data validation failure: Non BCD digit encountered in DigitRegister\n");
+ return false;
+ }
+ else
+ {
+ buffer.writeBits(digit2, 4);
+ buffer.writeBits(digit1, 4);
+ }
+ }
+ return true;
+}
+
+bool
+DataTypeCodecUtils::decodeDigitRegister (MsgBuffer & buffer,
+ DigitRegister & data,
+ Uint16 length)
+{
+ Uint8 i;
+ Uint8 digitLength = 0;
+ if (length > 8)
+ {
+ errorStream.add((char *)"Data validation failure:DigitRegister.Length\n");
+ return false;
+ }
+ for (i = 0; i < length; i ++)
+ {
+ Uint8 digit1;
+ Uint8 digit2;
+ digit2 = buffer.readBits(4);
+ digit1 = buffer.readBits(4);
+ if (digit1 >9 || (digit2 > 9 && digit2 != 0x0F))
+ {
+ errorStream.add((char *)"Data validation failure: Non BCD Digit in DigitRegister\n");
+ return false;
+ }
+ else
+ {
+ data.digits[i*2] = digit1;
+ data.digits[i*2+1] = digit2;
+ }
+ digitLength += 2;
+ if (digit2 == 0x0F)
+ {
+ // Reached the last digit stop here
+ digitLength--;
+ break;
+ }
+ }
+ data.length = digitLength;
+ return true;
+
+}
+
+void
+DataTypeCodecUtils::displayDigitRegister_v (DigitRegister const & data,
+ Debug & stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"DigitRegister:");
+ stream.endOfLine();
+ stream.incrIndent();
+ stream.add((char *)"Length:");
+ stream.add(data.length);
+ stream.endOfLine();
+ Uint8 i;
+ for (i = 0; i < data.length; i++)
+ {
+ stream.add(data.digits[i]);
+ stream.add((char *)" ");
+ }
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
diff --git a/src/gtpV2Codec/ieClasses/manual/gtpV2DataTypes_Manual.h b/src/gtpV2Codec/ieClasses/manual/gtpV2DataTypes_Manual.h
new file mode 100644
index 0000000..2c7e5f9
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/manual/gtpV2DataTypes_Manual.h
@@ -0,0 +1,40 @@
+ /*
+Copyright 2019-present Infosys Limited
+
+SPDX-License-Identifier: Apache-2.0
+
+*/
+
+
+
+
+#ifndef GTPV2DATATYPES_MANUAL_H_
+#define GTPV2DATATYPES_MANUAL_H_
+
+typedef struct
+{
+ Uint8 length;
+ Uint8 digits[16];
+}DigitRegister;
+
+typedef struct
+{
+ Uint16 length;
+ Uint8 octets[16];
+}OctetArraySmall;
+
+
+typedef struct
+{
+ Uint16 length;
+ Uint8 octets[64];
+}OctetArrayMedium;
+
+typedef struct
+{
+ Uint16 length;
+ Uint8 octets[256];
+}OctetArrayLarge;
+
+
+#endif /*GTPV2DATATYPES_MANUAL_H_*/
diff --git a/src/gtpV2Codec/ieClasses/manual/gtpV2GroupedIe.cpp b/src/gtpV2Codec/ieClasses/manual/gtpV2GroupedIe.cpp
new file mode 100644
index 0000000..ee0c2c1
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/manual/gtpV2GroupedIe.cpp
@@ -0,0 +1,20 @@
+ /*
+Copyright 2019-present Infosys Limited
+
+SPDX-License-Identifier: Apache-2.0
+
+*/
+
+
+
+#include "../../../gtpV2Codec/ieClasses/manual/gtpV2GroupedIe.h"
+
+GtpV2GroupedIe::GtpV2GroupedIe() {
+ // TODO Auto-generated constructor stub
+
+}
+
+GtpV2GroupedIe::~GtpV2GroupedIe() {
+ // TODO Auto-generated destructor stub
+}
+
diff --git a/src/gtpV2Codec/ieClasses/manual/gtpV2GroupedIe.h b/src/gtpV2Codec/ieClasses/manual/gtpV2GroupedIe.h
new file mode 100644
index 0000000..df4da85
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/manual/gtpV2GroupedIe.h
@@ -0,0 +1,18 @@
+ /*
+Copyright 2019-present Infosys Limited
+
+SPDX-License-Identifier: Apache-2.0
+
+*/
+
+
+#ifndef GTPV2GROUPEDIE_H_
+#define GTPV2GROUPEDIE_H_
+
+class GtpV2GroupedIe {
+public:
+ GtpV2GroupedIe();
+ virtual ~GtpV2GroupedIe();
+};
+
+#endif /* GTPV2GROUPEDIE_H_ */
diff --git a/src/gtpV2Codec/ieClasses/manual/gtpV2Ie.cpp b/src/gtpV2Codec/ieClasses/manual/gtpV2Ie.cpp
new file mode 100644
index 0000000..a82512e
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/manual/gtpV2Ie.cpp
@@ -0,0 +1,45 @@
+ /*
+Copyright 2019-present Infosys Limited
+
+SPDX-License-Identifier: Apache-2.0
+
+*/
+
+
+
+#include "../../../gtpV2Codec/ieClasses/manual/gtpV2Ie.h"
+
+#include "msgBuffer.h"
+
+#define GTP_V2_IE_HEADER_LENGTH 4
+GtpV2Ie::GtpV2Ie() {
+ // TODO Auto-generated constructor stub
+
+}
+
+GtpV2Ie::~GtpV2Ie() {
+ // TODO Auto-generated destructor stub
+}
+
+void GtpV2Ie::decodeGtpV2IeHeader(MsgBuffer &buffer, GtpV2IeHeader &data)
+{
+ // Assume that the pointer in the MsgBuffer is pointing to the start of the IE
+ buffer.readUint8(data.ieType);
+ buffer.readUint16(data.length);
+ buffer.skipBits(4);
+ data.instance = buffer.readBits(4);
+}
+
+void GtpV2Ie::encodeGtpV2IeHeader(MsgBuffer &buffer, GtpV2IeHeader const &data)
+{
+ // Assume that the pointer in the MsgBuffer is pointing to the start of the IE
+ buffer.writeUint8(data.ieType, false);
+ buffer.writeUint16(data.length, false);
+ buffer.skipBits(4);
+ buffer.writeBits(data.instance, 4, false);
+}
+
+void GtpV2Ie::reserveHeaderSpace(MsgBuffer &buffer)
+{
+ buffer.skipBytes(GTP_V2_IE_HEADER_LENGTH);
+}
diff --git a/src/gtpV2Codec/ieClasses/manual/gtpV2Ie.h b/src/gtpV2Codec/ieClasses/manual/gtpV2Ie.h
new file mode 100644
index 0000000..6de3172
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/manual/gtpV2Ie.h
@@ -0,0 +1,39 @@
+ /*
+Copyright 2019-present Infosys Limited
+
+SPDX-License-Identifier: Apache-2.0
+
+*/
+
+
+
+#ifndef GTPV2IE_H_
+#define GTPV2IE_H_
+
+#include "basicTypes.h"
+#include "msgBuffer.h"
+#include "../gtpV2IeDataTypes.h"
+
+#define IE_HEADER_SIZE 4
+
+typedef struct
+{
+ Uint8 ieType;
+ Uint16 length;
+ Uint8 instance;
+}GtpV2IeHeader;
+
+class GtpV2Ie {
+public:
+ GtpV2Ie();
+ virtual ~GtpV2Ie();
+
+ static void encodeGtpV2IeHeader(MsgBuffer &buffer, GtpV2IeHeader const &data);
+ static void decodeGtpV2IeHeader(MsgBuffer &buffer, GtpV2IeHeader &data);
+ static void reserveHeaderSpace(MsgBuffer &buffer);
+
+protected:
+ Uint8 ieType;
+};
+
+#endif /* GTPV2IE_H_ */
diff --git a/src/gtpV2Codec/ieClasses/mappedUeUsageTypeIe.cpp b/src/gtpV2Codec/ieClasses/mappedUeUsageTypeIe.cpp
new file mode 100644
index 0000000..170e237
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/mappedUeUsageTypeIe.cpp
@@ -0,0 +1,77 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "mappedUeUsageTypeIe.h"
+#include "dataTypeCodecUtils.h"
+
+MappedUeUsageTypeIe::MappedUeUsageTypeIe()
+{
+ ieType = 200;
+ // TODO
+
+}
+
+MappedUeUsageTypeIe::~MappedUeUsageTypeIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool MappedUeUsageTypeIe::encodeMappedUeUsageTypeIe(MsgBuffer &buffer, MappedUeUsageTypeIeData const &data)
+{
+ if (!(buffer.writeUint16(data.mappedUEUsageType)))
+ {
+ errorStream.add((char *)"Encoding of mappedUEUsageType failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool MappedUeUsageTypeIe::decodeMappedUeUsageTypeIe(MsgBuffer &buffer, MappedUeUsageTypeIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+
+ buffer.readUint16(data.mappedUEUsageType);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: mappedUEUsageType\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE MappedUeUsageTypeIe\n");
+ return false;
+ }
+}
+void MappedUeUsageTypeIe::displayMappedUeUsageTypeIe_v(MappedUeUsageTypeIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"MappedUeUsageTypeIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add((char *)"mappedUEUsageType: ");
+ stream.add(data.mappedUEUsageType);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/mappedUeUsageTypeIe.h b/src/gtpV2Codec/ieClasses/mappedUeUsageTypeIe.h
new file mode 100644
index 0000000..ae9749a
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/mappedUeUsageTypeIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef MAPPEDUEUSAGETYPEIE_H_
+#define MAPPEDUEUSAGETYPEIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class MappedUeUsageTypeIe: public GtpV2Ie {
+public:
+ MappedUeUsageTypeIe();
+ virtual ~MappedUeUsageTypeIe();
+
+ bool encodeMappedUeUsageTypeIe(MsgBuffer &buffer,
+ MappedUeUsageTypeIeData const &data);
+ bool decodeMappedUeUsageTypeIe(MsgBuffer &buffer,
+ MappedUeUsageTypeIeData &data, Uint16 length);
+ void displayMappedUeUsageTypeIe_v(MappedUeUsageTypeIeData const &data,
+ Debug &stream);
+};
+
+#endif /* MAPPEDUEUSAGETYPEIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/maximumPacketLossRateIe.cpp b/src/gtpV2Codec/ieClasses/maximumPacketLossRateIe.cpp
new file mode 100644
index 0000000..5c7f762
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/maximumPacketLossRateIe.cpp
@@ -0,0 +1,154 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "maximumPacketLossRateIe.h"
+#include "dataTypeCodecUtils.h"
+
+MaximumPacketLossRateIe::MaximumPacketLossRateIe()
+{
+ ieType = 203;
+ // TODO
+
+}
+
+MaximumPacketLossRateIe::~MaximumPacketLossRateIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool MaximumPacketLossRateIe::encodeMaximumPacketLossRateIe(MsgBuffer &buffer, MaximumPacketLossRateIeData const &data)
+{
+ buffer.skipBits(6);
+
+ if(!(buffer.writeBits(data.dl, 1)))
+ {
+ errorStream.add((char *)"Encoding of dl failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.ul, 1)))
+ {
+ errorStream.add((char *)"Encoding of ul failed\n");
+ return false;
+ }
+ if (!(data.ulValue> 0 && data.ulValue<1000))
+ {
+ errorStream.add((char *)"Data validation failure: ulValue\n");
+ return false;
+ }
+ if (!(buffer.writeUint16(data.ulValue)))
+ {
+ errorStream.add((char *)"Encoding of ulValue failed\n");
+ return false;
+ }
+ if (!(data.dlValue> 0 && data.dlValue<1000))
+ {
+ errorStream.add((char *)"Data validation failure: dlValue\n");
+ return false;
+ }
+ if (!(buffer.writeUint16(data.dlValue)))
+ {
+ errorStream.add((char *)"Encoding of dlValue failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool MaximumPacketLossRateIe::decodeMaximumPacketLossRateIe(MsgBuffer &buffer, MaximumPacketLossRateIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+ buffer.skipBits(6);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: \n");
+ return false;
+ }
+
+ data.dl = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: dl\n");
+ return false;
+ }
+ data.ul = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: ul\n");
+ return false;
+ }
+
+ buffer.readUint16(data.ulValue);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: ulValue\n");
+ return false;
+ }
+ if (!(data.ulValue> 0 && data.ulValue<1000))
+ {
+ errorStream.add((char *)"Data validation failure : ulValue\n");
+ return false; //TODO need to add validations
+ }
+
+ buffer.readUint16(data.dlValue);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: dlValue\n");
+ return false;
+ }
+ if (!(data.dlValue> 0 && data.dlValue<1000))
+ {
+ errorStream.add((char *)"Data validation failure : dlValue\n");
+ return false; //TODO need to add validations
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE MaximumPacketLossRateIe\n");
+ return false;
+ }
+}
+void MaximumPacketLossRateIe::displayMaximumPacketLossRateIe_v(MaximumPacketLossRateIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"MaximumPacketLossRateIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add( (char *)"dl: ");
+ stream.add((Uint8)data.dl);
+ stream.endOfLine();
+
+ stream.add( (char *)"ul: ");
+ stream.add((Uint8)data.ul);
+ stream.endOfLine();
+
+ stream.add((char *)"ulValue: ");
+ stream.add(data.ulValue);
+ stream.endOfLine();
+
+ stream.add((char *)"dlValue: ");
+ stream.add(data.dlValue);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/maximumPacketLossRateIe.h b/src/gtpV2Codec/ieClasses/maximumPacketLossRateIe.h
new file mode 100644
index 0000000..2f9cba1
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/maximumPacketLossRateIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef MAXIMUMPACKETLOSSRATEIE_H_
+#define MAXIMUMPACKETLOSSRATEIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class MaximumPacketLossRateIe: public GtpV2Ie {
+public:
+ MaximumPacketLossRateIe();
+ virtual ~MaximumPacketLossRateIe();
+
+ bool encodeMaximumPacketLossRateIe(MsgBuffer &buffer,
+ MaximumPacketLossRateIeData const &data);
+ bool decodeMaximumPacketLossRateIe(MsgBuffer &buffer,
+ MaximumPacketLossRateIeData &data, Uint16 length);
+ void displayMaximumPacketLossRateIe_v(MaximumPacketLossRateIeData const &data,
+ Debug &stream);
+};
+
+#endif /* MAXIMUMPACKETLOSSRATEIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/meiIe.cpp b/src/gtpV2Codec/ieClasses/meiIe.cpp
new file mode 100644
index 0000000..9fb328a
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/meiIe.cpp
@@ -0,0 +1,88 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "meiIe.h"
+#include "dataTypeCodecUtils.h"
+
+MeiIe::MeiIe()
+{
+ ieType = 75;
+ // TODO
+
+}
+
+MeiIe::~MeiIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool MeiIe::encodeMeiIe(MsgBuffer &buffer, MeiIeData const &data)
+{
+ if (!(data.imeiSvValue.length ==15 || data.imeiSvValue.length == 16))
+ {
+ errorStream.add((char *)"Data validation failure: imeiSvValue\n");
+ return false;
+ }
+ if (!(DataTypeCodecUtils::encodeDigitRegister(buffer, data.imeiSvValue)))
+ {
+ errorStream.add((char *)"Encoding of imeiSvValue failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool MeiIe::decodeMeiIe(MsgBuffer &buffer, MeiIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+
+ Uint16 lengthLeft = length;
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeDigitRegister(buffer, data.imeiSvValue, lengthLeft)))
+ {
+ errorStream.add((char *)"Failed to decode: imeiSvValue\n");
+ return false;
+ }
+ if (!(data.imeiSvValue.length ==15 || data.imeiSvValue.length == 16))
+ {
+ errorStream.add((char *)"Data validation failure : imeiSvValue\n");
+ return false; //TODO need to add validations
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE MeiIe\n");
+ return false;
+ }
+}
+void MeiIe::displayMeiIe_v(MeiIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"MeiIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add((char *)"imeiSvValue:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displayDigitRegister_v(data.imeiSvValue, stream);
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/meiIe.h b/src/gtpV2Codec/ieClasses/meiIe.h
new file mode 100644
index 0000000..39988d8
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/meiIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef MEIIE_H_
+#define MEIIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class MeiIe: public GtpV2Ie {
+public:
+ MeiIe();
+ virtual ~MeiIe();
+
+ bool encodeMeiIe(MsgBuffer &buffer,
+ MeiIeData const &data);
+ bool decodeMeiIe(MsgBuffer &buffer,
+ MeiIeData &data, Uint16 length);
+ void displayMeiIe_v(MeiIeData const &data,
+ Debug &stream);
+};
+
+#endif /* MEIIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/metricIe.cpp b/src/gtpV2Codec/ieClasses/metricIe.cpp
new file mode 100644
index 0000000..acaefea
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/metricIe.cpp
@@ -0,0 +1,77 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "metricIe.h"
+#include "dataTypeCodecUtils.h"
+
+MetricIe::MetricIe()
+{
+ ieType = 182;
+ // TODO
+
+}
+
+MetricIe::~MetricIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool MetricIe::encodeMetricIe(MsgBuffer &buffer, MetricIeData const &data)
+{
+ if (!(buffer.writeUint8(data.metric)))
+ {
+ errorStream.add((char *)"Encoding of metric failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool MetricIe::decodeMetricIe(MsgBuffer &buffer, MetricIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+
+ buffer.readUint8(data.metric);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: metric\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE MetricIe\n");
+ return false;
+ }
+}
+void MetricIe::displayMetricIe_v(MetricIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"MetricIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add((char *)"metric: ");
+ stream.add(data.metric);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/metricIe.h b/src/gtpV2Codec/ieClasses/metricIe.h
new file mode 100644
index 0000000..bfdc86e
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/metricIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef METRICIE_H_
+#define METRICIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class MetricIe: public GtpV2Ie {
+public:
+ MetricIe();
+ virtual ~MetricIe();
+
+ bool encodeMetricIe(MsgBuffer &buffer,
+ MetricIeData const &data);
+ bool decodeMetricIe(MsgBuffer &buffer,
+ MetricIeData &data, Uint16 length);
+ void displayMetricIe_v(MetricIeData const &data,
+ Debug &stream);
+};
+
+#endif /* METRICIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/millisecondTimeStampIe.cpp b/src/gtpV2Codec/ieClasses/millisecondTimeStampIe.cpp
new file mode 100644
index 0000000..111085a
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/millisecondTimeStampIe.cpp
@@ -0,0 +1,77 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "millisecondTimeStampIe.h"
+#include "dataTypeCodecUtils.h"
+
+MillisecondTimeStampIe::MillisecondTimeStampIe()
+{
+ ieType = 188;
+ // TODO
+
+}
+
+MillisecondTimeStampIe::~MillisecondTimeStampIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool MillisecondTimeStampIe::encodeMillisecondTimeStampIe(MsgBuffer &buffer, MillisecondTimeStampIeData const &data)
+{
+ if (!(buffer.writeUint64(data.millisecondTimeStampValue)))
+ {
+ errorStream.add((char *)"Encoding of millisecondTimeStampValue failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool MillisecondTimeStampIe::decodeMillisecondTimeStampIe(MsgBuffer &buffer, MillisecondTimeStampIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+
+ buffer.readUint64(data.millisecondTimeStampValue);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: millisecondTimeStampValue\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE MillisecondTimeStampIe\n");
+ return false;
+ }
+}
+void MillisecondTimeStampIe::displayMillisecondTimeStampIe_v(MillisecondTimeStampIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"MillisecondTimeStampIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add((char *)"millisecondTimeStampValue: ");
+ stream.add(data.millisecondTimeStampValue);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/millisecondTimeStampIe.h b/src/gtpV2Codec/ieClasses/millisecondTimeStampIe.h
new file mode 100644
index 0000000..32d4c5e
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/millisecondTimeStampIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef MILLISECONDTIMESTAMPIE_H_
+#define MILLISECONDTIMESTAMPIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class MillisecondTimeStampIe: public GtpV2Ie {
+public:
+ MillisecondTimeStampIe();
+ virtual ~MillisecondTimeStampIe();
+
+ bool encodeMillisecondTimeStampIe(MsgBuffer &buffer,
+ MillisecondTimeStampIeData const &data);
+ bool decodeMillisecondTimeStampIe(MsgBuffer &buffer,
+ MillisecondTimeStampIeData &data, Uint16 length);
+ void displayMillisecondTimeStampIe_v(MillisecondTimeStampIeData const &data,
+ Debug &stream);
+};
+
+#endif /* MILLISECONDTIMESTAMPIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/mmeS4SgsnsOverloadControlInformationInCreateBearerResponse.cpp b/src/gtpV2Codec/ieClasses/mmeS4SgsnsOverloadControlInformationInCreateBearerResponse.cpp
new file mode 100644
index 0000000..be7326d
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/mmeS4SgsnsOverloadControlInformationInCreateBearerResponse.cpp
@@ -0,0 +1,306 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "mmeS4SgsnsOverloadControlInformationInCreateBearerResponse.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+#include "epcTimerIe.h"
+
+MmeS4SgsnsOverloadControlInformationInCreateBearerResponse::
+MmeS4SgsnsOverloadControlInformationInCreateBearerResponse()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // overloadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // overloadReductionMetric
+ mandatoryIeSet.insert(mandIe);
+ mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0; // periodOfValidity
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+MmeS4SgsnsOverloadControlInformationInCreateBearerResponse::
+~MmeS4SgsnsOverloadControlInformationInCreateBearerResponse()
+{
+
+}
+bool MmeS4SgsnsOverloadControlInformationInCreateBearerResponse::
+encodeMmeS4SgsnsOverloadControlInformationInCreateBearerResponse(MsgBuffer &buffer,
+ MmeS4SgsnsOverloadControlInformationInCreateBearerResponseData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.overloadReductionMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadReductionMetric\n");
+ return false;
+ }
+
+
+
+ // 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.periodOfValidity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: periodOfValidity\n");
+ return false;
+ }
+ return rc;
+}
+
+bool MmeS4SgsnsOverloadControlInformationInCreateBearerResponse::
+decodeMmeS4SgsnsOverloadControlInformationInCreateBearerResponse(MsgBuffer &buffer,
+ MmeS4SgsnsOverloadControlInformationInCreateBearerResponseData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.overloadReductionMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadReductionMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.periodOfValidity, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: periodOfValidity\n");
+ return false;
+ }
+ Uint16 mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void MmeS4SgsnsOverloadControlInformationInCreateBearerResponse::
+displayMmeS4SgsnsOverloadControlInformationInCreateBearerResponseData_v
+(MmeS4SgsnsOverloadControlInformationInCreateBearerResponseData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"MmeS4SgsnsOverloadControlInformationInCreateBearerResponse:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/mmeS4SgsnsOverloadControlInformationInCreateBearerResponse.h b/src/gtpV2Codec/ieClasses/mmeS4SgsnsOverloadControlInformationInCreateBearerResponse.h
new file mode 100644
index 0000000..97a2aeb
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/mmeS4SgsnsOverloadControlInformationInCreateBearerResponse.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef MMES4SGSNSOVERLOADCONTROLINFORMATIONINCREATEBEARERRESPONSE_H_
+#define MMES4SGSNSOVERLOADCONTROLINFORMATIONINCREATEBEARERRESPONSE_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class MmeS4SgsnsOverloadControlInformationInCreateBearerResponse:public GtpV2GroupedIe
+{
+public:
+ MmeS4SgsnsOverloadControlInformationInCreateBearerResponse();
+ virtual ~MmeS4SgsnsOverloadControlInformationInCreateBearerResponse();
+ bool encodeMmeS4SgsnsOverloadControlInformationInCreateBearerResponse(MsgBuffer &buffer,
+ MmeS4SgsnsOverloadControlInformationInCreateBearerResponseData
+ const &data);
+
+ bool decodeMmeS4SgsnsOverloadControlInformationInCreateBearerResponse (MsgBuffer &buffer,
+ MmeS4SgsnsOverloadControlInformationInCreateBearerResponseData
+ & data, Uint16 length);
+
+ void displayMmeS4SgsnsOverloadControlInformationInCreateBearerResponseData_v
+ (MmeS4SgsnsOverloadControlInformationInCreateBearerResponseData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/mmeS4SgsnsOverloadControlInformationInCreateSessionRequest.cpp b/src/gtpV2Codec/ieClasses/mmeS4SgsnsOverloadControlInformationInCreateSessionRequest.cpp
new file mode 100644
index 0000000..4206a97
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/mmeS4SgsnsOverloadControlInformationInCreateSessionRequest.cpp
@@ -0,0 +1,306 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "mmeS4SgsnsOverloadControlInformationInCreateSessionRequest.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+#include "epcTimerIe.h"
+
+MmeS4SgsnsOverloadControlInformationInCreateSessionRequest::
+MmeS4SgsnsOverloadControlInformationInCreateSessionRequest()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // overloadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // overloadReductionMetric
+ mandatoryIeSet.insert(mandIe);
+ mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0; // periodOfValidity
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+MmeS4SgsnsOverloadControlInformationInCreateSessionRequest::
+~MmeS4SgsnsOverloadControlInformationInCreateSessionRequest()
+{
+
+}
+bool MmeS4SgsnsOverloadControlInformationInCreateSessionRequest::
+encodeMmeS4SgsnsOverloadControlInformationInCreateSessionRequest(MsgBuffer &buffer,
+ MmeS4SgsnsOverloadControlInformationInCreateSessionRequestData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.overloadReductionMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadReductionMetric\n");
+ return false;
+ }
+
+
+
+ // 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.periodOfValidity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: periodOfValidity\n");
+ return false;
+ }
+ return rc;
+}
+
+bool MmeS4SgsnsOverloadControlInformationInCreateSessionRequest::
+decodeMmeS4SgsnsOverloadControlInformationInCreateSessionRequest(MsgBuffer &buffer,
+ MmeS4SgsnsOverloadControlInformationInCreateSessionRequestData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.overloadReductionMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadReductionMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.periodOfValidity, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: periodOfValidity\n");
+ return false;
+ }
+ Uint16 mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void MmeS4SgsnsOverloadControlInformationInCreateSessionRequest::
+displayMmeS4SgsnsOverloadControlInformationInCreateSessionRequestData_v
+(MmeS4SgsnsOverloadControlInformationInCreateSessionRequestData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"MmeS4SgsnsOverloadControlInformationInCreateSessionRequest:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/mmeS4SgsnsOverloadControlInformationInCreateSessionRequest.h b/src/gtpV2Codec/ieClasses/mmeS4SgsnsOverloadControlInformationInCreateSessionRequest.h
new file mode 100644
index 0000000..1c6abbb
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/mmeS4SgsnsOverloadControlInformationInCreateSessionRequest.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef MMES4SGSNSOVERLOADCONTROLINFORMATIONINCREATESESSIONREQUEST_H_
+#define MMES4SGSNSOVERLOADCONTROLINFORMATIONINCREATESESSIONREQUEST_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class MmeS4SgsnsOverloadControlInformationInCreateSessionRequest:public GtpV2GroupedIe
+{
+public:
+ MmeS4SgsnsOverloadControlInformationInCreateSessionRequest();
+ virtual ~MmeS4SgsnsOverloadControlInformationInCreateSessionRequest();
+ bool encodeMmeS4SgsnsOverloadControlInformationInCreateSessionRequest(MsgBuffer &buffer,
+ MmeS4SgsnsOverloadControlInformationInCreateSessionRequestData
+ const &data);
+
+ bool decodeMmeS4SgsnsOverloadControlInformationInCreateSessionRequest (MsgBuffer &buffer,
+ MmeS4SgsnsOverloadControlInformationInCreateSessionRequestData
+ & data, Uint16 length);
+
+ void displayMmeS4SgsnsOverloadControlInformationInCreateSessionRequestData_v
+ (MmeS4SgsnsOverloadControlInformationInCreateSessionRequestData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/mmeS4SgsnsOverloadControlInformationInDeleteBearerResponse.cpp b/src/gtpV2Codec/ieClasses/mmeS4SgsnsOverloadControlInformationInDeleteBearerResponse.cpp
new file mode 100644
index 0000000..c7dde91
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/mmeS4SgsnsOverloadControlInformationInDeleteBearerResponse.cpp
@@ -0,0 +1,306 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "mmeS4SgsnsOverloadControlInformationInDeleteBearerResponse.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+#include "epcTimerIe.h"
+
+MmeS4SgsnsOverloadControlInformationInDeleteBearerResponse::
+MmeS4SgsnsOverloadControlInformationInDeleteBearerResponse()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // overloadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // overloadReductionMetric
+ mandatoryIeSet.insert(mandIe);
+ mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0; // periodOfValidity
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+MmeS4SgsnsOverloadControlInformationInDeleteBearerResponse::
+~MmeS4SgsnsOverloadControlInformationInDeleteBearerResponse()
+{
+
+}
+bool MmeS4SgsnsOverloadControlInformationInDeleteBearerResponse::
+encodeMmeS4SgsnsOverloadControlInformationInDeleteBearerResponse(MsgBuffer &buffer,
+ MmeS4SgsnsOverloadControlInformationInDeleteBearerResponseData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.overloadReductionMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadReductionMetric\n");
+ return false;
+ }
+
+
+
+ // 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.periodOfValidity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: periodOfValidity\n");
+ return false;
+ }
+ return rc;
+}
+
+bool MmeS4SgsnsOverloadControlInformationInDeleteBearerResponse::
+decodeMmeS4SgsnsOverloadControlInformationInDeleteBearerResponse(MsgBuffer &buffer,
+ MmeS4SgsnsOverloadControlInformationInDeleteBearerResponseData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.overloadReductionMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadReductionMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.periodOfValidity, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: periodOfValidity\n");
+ return false;
+ }
+ Uint16 mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void MmeS4SgsnsOverloadControlInformationInDeleteBearerResponse::
+displayMmeS4SgsnsOverloadControlInformationInDeleteBearerResponseData_v
+(MmeS4SgsnsOverloadControlInformationInDeleteBearerResponseData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"MmeS4SgsnsOverloadControlInformationInDeleteBearerResponse:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/mmeS4SgsnsOverloadControlInformationInDeleteBearerResponse.h b/src/gtpV2Codec/ieClasses/mmeS4SgsnsOverloadControlInformationInDeleteBearerResponse.h
new file mode 100644
index 0000000..5943324
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/mmeS4SgsnsOverloadControlInformationInDeleteBearerResponse.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef MMES4SGSNSOVERLOADCONTROLINFORMATIONINDELETEBEARERRESPONSE_H_
+#define MMES4SGSNSOVERLOADCONTROLINFORMATIONINDELETEBEARERRESPONSE_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class MmeS4SgsnsOverloadControlInformationInDeleteBearerResponse:public GtpV2GroupedIe
+{
+public:
+ MmeS4SgsnsOverloadControlInformationInDeleteBearerResponse();
+ virtual ~MmeS4SgsnsOverloadControlInformationInDeleteBearerResponse();
+ bool encodeMmeS4SgsnsOverloadControlInformationInDeleteBearerResponse(MsgBuffer &buffer,
+ MmeS4SgsnsOverloadControlInformationInDeleteBearerResponseData
+ const &data);
+
+ bool decodeMmeS4SgsnsOverloadControlInformationInDeleteBearerResponse (MsgBuffer &buffer,
+ MmeS4SgsnsOverloadControlInformationInDeleteBearerResponseData
+ & data, Uint16 length);
+
+ void displayMmeS4SgsnsOverloadControlInformationInDeleteBearerResponseData_v
+ (MmeS4SgsnsOverloadControlInformationInDeleteBearerResponseData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/mmeS4SgsnsOverloadControlInformationInDeleteSessionRequest.cpp b/src/gtpV2Codec/ieClasses/mmeS4SgsnsOverloadControlInformationInDeleteSessionRequest.cpp
new file mode 100644
index 0000000..53915de
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/mmeS4SgsnsOverloadControlInformationInDeleteSessionRequest.cpp
@@ -0,0 +1,306 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "mmeS4SgsnsOverloadControlInformationInDeleteSessionRequest.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+#include "epcTimerIe.h"
+
+MmeS4SgsnsOverloadControlInformationInDeleteSessionRequest::
+MmeS4SgsnsOverloadControlInformationInDeleteSessionRequest()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // overloadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // overloadReductionMetric
+ mandatoryIeSet.insert(mandIe);
+ mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0; // periodOfValidity
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+MmeS4SgsnsOverloadControlInformationInDeleteSessionRequest::
+~MmeS4SgsnsOverloadControlInformationInDeleteSessionRequest()
+{
+
+}
+bool MmeS4SgsnsOverloadControlInformationInDeleteSessionRequest::
+encodeMmeS4SgsnsOverloadControlInformationInDeleteSessionRequest(MsgBuffer &buffer,
+ MmeS4SgsnsOverloadControlInformationInDeleteSessionRequestData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.overloadReductionMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadReductionMetric\n");
+ return false;
+ }
+
+
+
+ // 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.periodOfValidity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: periodOfValidity\n");
+ return false;
+ }
+ return rc;
+}
+
+bool MmeS4SgsnsOverloadControlInformationInDeleteSessionRequest::
+decodeMmeS4SgsnsOverloadControlInformationInDeleteSessionRequest(MsgBuffer &buffer,
+ MmeS4SgsnsOverloadControlInformationInDeleteSessionRequestData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.overloadReductionMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadReductionMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.periodOfValidity, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: periodOfValidity\n");
+ return false;
+ }
+ Uint16 mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void MmeS4SgsnsOverloadControlInformationInDeleteSessionRequest::
+displayMmeS4SgsnsOverloadControlInformationInDeleteSessionRequestData_v
+(MmeS4SgsnsOverloadControlInformationInDeleteSessionRequestData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"MmeS4SgsnsOverloadControlInformationInDeleteSessionRequest:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/mmeS4SgsnsOverloadControlInformationInDeleteSessionRequest.h b/src/gtpV2Codec/ieClasses/mmeS4SgsnsOverloadControlInformationInDeleteSessionRequest.h
new file mode 100644
index 0000000..5863e87
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/mmeS4SgsnsOverloadControlInformationInDeleteSessionRequest.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef MMES4SGSNSOVERLOADCONTROLINFORMATIONINDELETESESSIONREQUEST_H_
+#define MMES4SGSNSOVERLOADCONTROLINFORMATIONINDELETESESSIONREQUEST_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class MmeS4SgsnsOverloadControlInformationInDeleteSessionRequest:public GtpV2GroupedIe
+{
+public:
+ MmeS4SgsnsOverloadControlInformationInDeleteSessionRequest();
+ virtual ~MmeS4SgsnsOverloadControlInformationInDeleteSessionRequest();
+ bool encodeMmeS4SgsnsOverloadControlInformationInDeleteSessionRequest(MsgBuffer &buffer,
+ MmeS4SgsnsOverloadControlInformationInDeleteSessionRequestData
+ const &data);
+
+ bool decodeMmeS4SgsnsOverloadControlInformationInDeleteSessionRequest (MsgBuffer &buffer,
+ MmeS4SgsnsOverloadControlInformationInDeleteSessionRequestData
+ & data, Uint16 length);
+
+ void displayMmeS4SgsnsOverloadControlInformationInDeleteSessionRequestData_v
+ (MmeS4SgsnsOverloadControlInformationInDeleteSessionRequestData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/mmeS4SgsnsOverloadControlInformationInModifyBearerRequest.cpp b/src/gtpV2Codec/ieClasses/mmeS4SgsnsOverloadControlInformationInModifyBearerRequest.cpp
new file mode 100644
index 0000000..f85223e
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/mmeS4SgsnsOverloadControlInformationInModifyBearerRequest.cpp
@@ -0,0 +1,306 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "mmeS4SgsnsOverloadControlInformationInModifyBearerRequest.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+#include "epcTimerIe.h"
+
+MmeS4SgsnsOverloadControlInformationInModifyBearerRequest::
+MmeS4SgsnsOverloadControlInformationInModifyBearerRequest()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // overloadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // overloadReductionMetric
+ mandatoryIeSet.insert(mandIe);
+ mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0; // periodOfValidity
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+MmeS4SgsnsOverloadControlInformationInModifyBearerRequest::
+~MmeS4SgsnsOverloadControlInformationInModifyBearerRequest()
+{
+
+}
+bool MmeS4SgsnsOverloadControlInformationInModifyBearerRequest::
+encodeMmeS4SgsnsOverloadControlInformationInModifyBearerRequest(MsgBuffer &buffer,
+ MmeS4SgsnsOverloadControlInformationInModifyBearerRequestData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.overloadReductionMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadReductionMetric\n");
+ return false;
+ }
+
+
+
+ // 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.periodOfValidity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: periodOfValidity\n");
+ return false;
+ }
+ return rc;
+}
+
+bool MmeS4SgsnsOverloadControlInformationInModifyBearerRequest::
+decodeMmeS4SgsnsOverloadControlInformationInModifyBearerRequest(MsgBuffer &buffer,
+ MmeS4SgsnsOverloadControlInformationInModifyBearerRequestData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.overloadReductionMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadReductionMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.periodOfValidity, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: periodOfValidity\n");
+ return false;
+ }
+ Uint16 mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void MmeS4SgsnsOverloadControlInformationInModifyBearerRequest::
+displayMmeS4SgsnsOverloadControlInformationInModifyBearerRequestData_v
+(MmeS4SgsnsOverloadControlInformationInModifyBearerRequestData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"MmeS4SgsnsOverloadControlInformationInModifyBearerRequest:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/mmeS4SgsnsOverloadControlInformationInModifyBearerRequest.h b/src/gtpV2Codec/ieClasses/mmeS4SgsnsOverloadControlInformationInModifyBearerRequest.h
new file mode 100644
index 0000000..7bb9db6
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/mmeS4SgsnsOverloadControlInformationInModifyBearerRequest.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef MMES4SGSNSOVERLOADCONTROLINFORMATIONINMODIFYBEARERREQUEST_H_
+#define MMES4SGSNSOVERLOADCONTROLINFORMATIONINMODIFYBEARERREQUEST_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class MmeS4SgsnsOverloadControlInformationInModifyBearerRequest:public GtpV2GroupedIe
+{
+public:
+ MmeS4SgsnsOverloadControlInformationInModifyBearerRequest();
+ virtual ~MmeS4SgsnsOverloadControlInformationInModifyBearerRequest();
+ bool encodeMmeS4SgsnsOverloadControlInformationInModifyBearerRequest(MsgBuffer &buffer,
+ MmeS4SgsnsOverloadControlInformationInModifyBearerRequestData
+ const &data);
+
+ bool decodeMmeS4SgsnsOverloadControlInformationInModifyBearerRequest (MsgBuffer &buffer,
+ MmeS4SgsnsOverloadControlInformationInModifyBearerRequestData
+ & data, Uint16 length);
+
+ void displayMmeS4SgsnsOverloadControlInformationInModifyBearerRequestData_v
+ (MmeS4SgsnsOverloadControlInformationInModifyBearerRequestData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/msisdnIe.cpp b/src/gtpV2Codec/ieClasses/msisdnIe.cpp
new file mode 100644
index 0000000..8e8f751
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/msisdnIe.cpp
@@ -0,0 +1,88 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "msisdnIe.h"
+#include "dataTypeCodecUtils.h"
+
+MsisdnIe::MsisdnIe()
+{
+ ieType = 76;
+ // TODO
+
+}
+
+MsisdnIe::~MsisdnIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool MsisdnIe::encodeMsisdnIe(MsgBuffer &buffer, MsisdnIeData const &data)
+{
+ if (!(data.msisdnValue.length>=9 && data.msisdnValue.length <=15))
+ {
+ errorStream.add((char *)"Data validation failure: msisdnValue\n");
+ return false;
+ }
+ if (!(DataTypeCodecUtils::encodeDigitRegister(buffer, data.msisdnValue)))
+ {
+ errorStream.add((char *)"Encoding of msisdnValue failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool MsisdnIe::decodeMsisdnIe(MsgBuffer &buffer, MsisdnIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+
+ Uint16 lengthLeft = length;
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeDigitRegister(buffer, data.msisdnValue, lengthLeft)))
+ {
+ errorStream.add((char *)"Failed to decode: msisdnValue\n");
+ return false;
+ }
+ if (!(data.msisdnValue.length>=9 && data.msisdnValue.length <=15))
+ {
+ errorStream.add((char *)"Data validation failure : msisdnValue\n");
+ return false; //TODO need to add validations
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE MsisdnIe\n");
+ return false;
+ }
+}
+void MsisdnIe::displayMsisdnIe_v(MsisdnIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"MsisdnIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add((char *)"msisdnValue:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displayDigitRegister_v(data.msisdnValue, stream);
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/msisdnIe.h b/src/gtpV2Codec/ieClasses/msisdnIe.h
new file mode 100644
index 0000000..1a8486d
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/msisdnIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef MSISDNIE_H_
+#define MSISDNIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class MsisdnIe: public GtpV2Ie {
+public:
+ MsisdnIe();
+ virtual ~MsisdnIe();
+
+ bool encodeMsisdnIe(MsgBuffer &buffer,
+ MsisdnIeData const &data);
+ bool decodeMsisdnIe(MsgBuffer &buffer,
+ MsisdnIeData &data, Uint16 length);
+ void displayMsisdnIe_v(MsisdnIeData const &data,
+ Debug &stream);
+};
+
+#endif /* MSISDNIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/nodeIdentifierIe.cpp b/src/gtpV2Codec/ieClasses/nodeIdentifierIe.cpp
new file mode 100644
index 0000000..07f92de
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/nodeIdentifierIe.cpp
@@ -0,0 +1,145 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "nodeIdentifierIe.h"
+#include "dataTypeCodecUtils.h"
+
+NodeIdentifierIe::NodeIdentifierIe()
+{
+ ieType = 176;
+ // TODO
+
+}
+
+NodeIdentifierIe::~NodeIdentifierIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool NodeIdentifierIe::encodeNodeIdentifierIe(MsgBuffer &buffer, NodeIdentifierIeData const &data)
+{
+ if (!(data.lengthOfNodeName!=0))
+ {
+ errorStream.add((char *)"Data validation failure: lengthOfNodeName\n");
+ return false;
+ }
+ if (!(buffer.writeUint8(data.lengthOfNodeName)))
+ {
+ errorStream.add((char *)"Encoding of lengthOfNodeName failed\n");
+ return false;
+ }
+ if (!(buffer.writeUint8(data.nodeName)))
+ {
+ errorStream.add((char *)"Encoding of nodeName failed\n");
+ return false;
+ }
+ if (!(data.lengthOfNodeRealm!=0))
+ {
+ errorStream.add((char *)"Data validation failure: lengthOfNodeRealm\n");
+ return false;
+ }
+ if (!(buffer.writeUint8(data.lengthOfNodeRealm)))
+ {
+ errorStream.add((char *)"Encoding of lengthOfNodeRealm failed\n");
+ return false;
+ }
+ if (!(buffer.writeUint8(data.nodeRealm)))
+ {
+ errorStream.add((char *)"Encoding of nodeRealm failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool NodeIdentifierIe::decodeNodeIdentifierIe(MsgBuffer &buffer, NodeIdentifierIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+
+ buffer.readUint8(data.lengthOfNodeName);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: lengthOfNodeName\n");
+ return false;
+ }
+ if (!(data.lengthOfNodeName!=0))
+ {
+ errorStream.add((char *)"Data validation failure : lengthOfNodeName\n");
+ return false; //TODO need to add validations
+ }
+
+ buffer.readUint8(data.nodeName);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: nodeName\n");
+ return false;
+ }
+
+ buffer.readUint8(data.lengthOfNodeRealm);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: lengthOfNodeRealm\n");
+ return false;
+ }
+ if (!(data.lengthOfNodeRealm!=0))
+ {
+ errorStream.add((char *)"Data validation failure : lengthOfNodeRealm\n");
+ return false; //TODO need to add validations
+ }
+
+ buffer.readUint8(data.nodeRealm);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: nodeRealm\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE NodeIdentifierIe\n");
+ return false;
+ }
+}
+void NodeIdentifierIe::displayNodeIdentifierIe_v(NodeIdentifierIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"NodeIdentifierIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add((char *)"lengthOfNodeName: ");
+ stream.add(data.lengthOfNodeName);
+ stream.endOfLine();
+
+ stream.add((char *)"nodeName: ");
+ stream.add(data.nodeName);
+ stream.endOfLine();
+
+ stream.add((char *)"lengthOfNodeRealm: ");
+ stream.add(data.lengthOfNodeRealm);
+ stream.endOfLine();
+
+ stream.add((char *)"nodeRealm: ");
+ stream.add(data.nodeRealm);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/nodeIdentifierIe.h b/src/gtpV2Codec/ieClasses/nodeIdentifierIe.h
new file mode 100644
index 0000000..98067da
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/nodeIdentifierIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef NODEIDENTIFIERIE_H_
+#define NODEIDENTIFIERIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class NodeIdentifierIe: public GtpV2Ie {
+public:
+ NodeIdentifierIe();
+ virtual ~NodeIdentifierIe();
+
+ bool encodeNodeIdentifierIe(MsgBuffer &buffer,
+ NodeIdentifierIeData const &data);
+ bool decodeNodeIdentifierIe(MsgBuffer &buffer,
+ NodeIdentifierIeData &data, Uint16 length);
+ void displayNodeIdentifierIe_v(NodeIdentifierIeData const &data,
+ Debug &stream);
+};
+
+#endif /* NODEIDENTIFIERIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/nodeTypeIe.cpp b/src/gtpV2Codec/ieClasses/nodeTypeIe.cpp
new file mode 100644
index 0000000..3de9de9
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/nodeTypeIe.cpp
@@ -0,0 +1,87 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "nodeTypeIe.h"
+#include "dataTypeCodecUtils.h"
+
+NodeTypeIe::NodeTypeIe()
+{
+ ieType = 135;
+ // TODO
+
+}
+
+NodeTypeIe::~NodeTypeIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool NodeTypeIe::encodeNodeTypeIe(MsgBuffer &buffer, NodeTypeIeData const &data)
+{
+ if (!(data.nodeType==0||data.nodeType==1))
+ {
+ errorStream.add((char *)"Data validation failure: nodeType\n");
+ return false;
+ }
+ if (!(buffer.writeUint8(data.nodeType)))
+ {
+ errorStream.add((char *)"Encoding of nodeType failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool NodeTypeIe::decodeNodeTypeIe(MsgBuffer &buffer, NodeTypeIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+
+ buffer.readUint8(data.nodeType);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: nodeType\n");
+ return false;
+ }
+ if (!(data.nodeType==0||data.nodeType==1))
+ {
+ errorStream.add((char *)"Data validation failure : nodeType\n");
+ return false; //TODO need to add validations
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE NodeTypeIe\n");
+ return false;
+ }
+}
+void NodeTypeIe::displayNodeTypeIe_v(NodeTypeIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"NodeTypeIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add((char *)"nodeType: ");
+ stream.add(data.nodeType);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/nodeTypeIe.h b/src/gtpV2Codec/ieClasses/nodeTypeIe.h
new file mode 100644
index 0000000..f3896e1
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/nodeTypeIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef NODETYPEIE_H_
+#define NODETYPEIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class NodeTypeIe: public GtpV2Ie {
+public:
+ NodeTypeIe();
+ virtual ~NodeTypeIe();
+
+ bool encodeNodeTypeIe(MsgBuffer &buffer,
+ NodeTypeIeData const &data);
+ bool decodeNodeTypeIe(MsgBuffer &buffer,
+ NodeTypeIeData &data, Uint16 length);
+ void displayNodeTypeIe_v(NodeTypeIeData const &data,
+ Debug &stream);
+};
+
+#endif /* NODETYPEIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/overloadControlInformationIe.cpp b/src/gtpV2Codec/ieClasses/overloadControlInformationIe.cpp
new file mode 100644
index 0000000..d2c81ab
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/overloadControlInformationIe.cpp
@@ -0,0 +1,127 @@
+/*
+ * 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/grpietemplate.cpp.tt>
+ ******************************************************************************/
+#include "overloadControlInformationIe.h"
+#include "gtpV2GrpIeDataTypes.h"
+#include "manual/gtpV2GroupedIe.h"
+
+#include "sgwsOverloadControlInformationInCreateSessionRequest.h"
+#include "twanEpdgsOverloadControlInformationInCreateSessionRequest.h"
+#include "mmeS4SgsnsOverloadControlInformationInCreateSessionRequest.h"
+#include "pgwsOverloadControlInformationInCreateSessionResponse.h"
+#include "sgwsOverloadControlInformationInCreateSessionResponse.h"
+#include "mmeS4SgsnsOverloadControlInformationInModifyBearerRequest.h"
+#include "sgwsOverloadControlInformationInModifyBearerRequest.h"
+#include "epdgsOverloadControlInformationInModifyBearerRequest.h"
+#include "sgwsOverloadControlInformationInModifyBearerResponse.h"
+#include "pgwsOverloadControlInformationInModifyBearerResponse.h"
+#include "mmeS4SgsnsOverloadControlInformationInDeleteSessionRequest.h"
+#include "sgwsOverloadControlInformationInDeleteSessionRequest.h"
+#include "twanEpdgsOverloadControlInformationInDeleteSessionRequest.h"
+#include "sgwsOverloadControlInformationInDeleteSessionResponse.h"
+#include "pgwsOverloadControlInformationInDeleteSessionResponse.h"
+#include "sgwsOverloadControlInformationInReleaseAccessBearersResponse.h"
+#include "pgwsOverloadControlInformationInCreateBearerRequest.h"
+#include "sgwsOverloadControlInformationInCreateBearerRequest.h"
+#include "mmeS4SgsnsOverloadControlInformationInCreateBearerResponse.h"
+#include "sgwsOverloadControlInformationInCreateBearerResponse.h"
+#include "twanEpdgsOverloadControlInformationInCreateBearerResponse.h"
+#include "pgwsOverloadControlInformationInDeleteBearerRequest.h"
+#include "sgwsOverloadControlInformationInDeleteBearerRequest.h"
+#include "mmeS4SgsnsOverloadControlInformationInDeleteBearerResponse.h"
+#include "sgwsOverloadControlInformationInDeleteBearerResponse.h"
+#include "twanEpdgsOverloadControlInformationInDeleteBearerResponse.h"
+#include "sgwsOverloadControlInformationInDownlinkDataNotification.h"
+
+OverloadControlInformationIe::OverloadControlInformationIe()
+{
+ ieType = OverloadControlInformationIeType;
+
+ SgwsOverloadControlInformationInCreateSessionRequest* sgwsOverloadControlInformationInCreateSessionRequest_p = new (SgwsOverloadControlInformationInCreateSessionRequest);
+ insertGroupedIeObject(CreateSessionRequestMsgType, 1, sgwsOverloadControlInformationInCreateSessionRequest_p);
+ TwanEpdgsOverloadControlInformationInCreateSessionRequest* twanEpdgsOverloadControlInformationInCreateSessionRequest_p = new (TwanEpdgsOverloadControlInformationInCreateSessionRequest);
+ insertGroupedIeObject(CreateSessionRequestMsgType, 2, twanEpdgsOverloadControlInformationInCreateSessionRequest_p);
+ MmeS4SgsnsOverloadControlInformationInCreateSessionRequest* mmeS4SgsnsOverloadControlInformationInCreateSessionRequest_p = new (MmeS4SgsnsOverloadControlInformationInCreateSessionRequest);
+ insertGroupedIeObject(CreateSessionRequestMsgType, 0, mmeS4SgsnsOverloadControlInformationInCreateSessionRequest_p);
+ PgwsOverloadControlInformationInCreateSessionResponse* pgwsOverloadControlInformationInCreateSessionResponse_p = new (PgwsOverloadControlInformationInCreateSessionResponse);
+ insertGroupedIeObject(CreateSessionResponseMsgType, 0, pgwsOverloadControlInformationInCreateSessionResponse_p);
+ SgwsOverloadControlInformationInCreateSessionResponse* sgwsOverloadControlInformationInCreateSessionResponse_p = new (SgwsOverloadControlInformationInCreateSessionResponse);
+ insertGroupedIeObject(CreateSessionResponseMsgType, 1, sgwsOverloadControlInformationInCreateSessionResponse_p);
+ MmeS4SgsnsOverloadControlInformationInModifyBearerRequest* mmeS4SgsnsOverloadControlInformationInModifyBearerRequest_p = new (MmeS4SgsnsOverloadControlInformationInModifyBearerRequest);
+ insertGroupedIeObject(ModifyBearerRequestMsgType, 0, mmeS4SgsnsOverloadControlInformationInModifyBearerRequest_p);
+ SgwsOverloadControlInformationInModifyBearerRequest* sgwsOverloadControlInformationInModifyBearerRequest_p = new (SgwsOverloadControlInformationInModifyBearerRequest);
+ insertGroupedIeObject(ModifyBearerRequestMsgType, 1, sgwsOverloadControlInformationInModifyBearerRequest_p);
+ EpdgsOverloadControlInformationInModifyBearerRequest* epdgsOverloadControlInformationInModifyBearerRequest_p = new (EpdgsOverloadControlInformationInModifyBearerRequest);
+ insertGroupedIeObject(ModifyBearerRequestMsgType, 2, epdgsOverloadControlInformationInModifyBearerRequest_p);
+ SgwsOverloadControlInformationInModifyBearerResponse* sgwsOverloadControlInformationInModifyBearerResponse_p = new (SgwsOverloadControlInformationInModifyBearerResponse);
+ insertGroupedIeObject(ModifyBearerResponseMsgType, 1, sgwsOverloadControlInformationInModifyBearerResponse_p);
+ PgwsOverloadControlInformationInModifyBearerResponse* pgwsOverloadControlInformationInModifyBearerResponse_p = new (PgwsOverloadControlInformationInModifyBearerResponse);
+ insertGroupedIeObject(ModifyBearerResponseMsgType, 0, pgwsOverloadControlInformationInModifyBearerResponse_p);
+ MmeS4SgsnsOverloadControlInformationInDeleteSessionRequest* mmeS4SgsnsOverloadControlInformationInDeleteSessionRequest_p = new (MmeS4SgsnsOverloadControlInformationInDeleteSessionRequest);
+ insertGroupedIeObject(DeleteSessionRequestMsgType, 0, mmeS4SgsnsOverloadControlInformationInDeleteSessionRequest_p);
+ SgwsOverloadControlInformationInDeleteSessionRequest* sgwsOverloadControlInformationInDeleteSessionRequest_p = new (SgwsOverloadControlInformationInDeleteSessionRequest);
+ insertGroupedIeObject(DeleteSessionRequestMsgType, 1, sgwsOverloadControlInformationInDeleteSessionRequest_p);
+ TwanEpdgsOverloadControlInformationInDeleteSessionRequest* twanEpdgsOverloadControlInformationInDeleteSessionRequest_p = new (TwanEpdgsOverloadControlInformationInDeleteSessionRequest);
+ insertGroupedIeObject(DeleteSessionRequestMsgType, 2, twanEpdgsOverloadControlInformationInDeleteSessionRequest_p);
+ SgwsOverloadControlInformationInDeleteSessionResponse* sgwsOverloadControlInformationInDeleteSessionResponse_p = new (SgwsOverloadControlInformationInDeleteSessionResponse);
+ insertGroupedIeObject(DeleteSessionResponseMsgType, 1, sgwsOverloadControlInformationInDeleteSessionResponse_p);
+ PgwsOverloadControlInformationInDeleteSessionResponse* pgwsOverloadControlInformationInDeleteSessionResponse_p = new (PgwsOverloadControlInformationInDeleteSessionResponse);
+ insertGroupedIeObject(DeleteSessionResponseMsgType, 0, pgwsOverloadControlInformationInDeleteSessionResponse_p);
+ SgwsOverloadControlInformationInReleaseAccessBearersResponse* sgwsOverloadControlInformationInReleaseAccessBearersResponse_p = new (SgwsOverloadControlInformationInReleaseAccessBearersResponse);
+ insertGroupedIeObject(ReleaseAccessBearersResponseMsgType, 0, sgwsOverloadControlInformationInReleaseAccessBearersResponse_p);
+ PgwsOverloadControlInformationInCreateBearerRequest* pgwsOverloadControlInformationInCreateBearerRequest_p = new (PgwsOverloadControlInformationInCreateBearerRequest);
+ insertGroupedIeObject(CreateBearerRequestMsgType, 0, pgwsOverloadControlInformationInCreateBearerRequest_p);
+ SgwsOverloadControlInformationInCreateBearerRequest* sgwsOverloadControlInformationInCreateBearerRequest_p = new (SgwsOverloadControlInformationInCreateBearerRequest);
+ insertGroupedIeObject(CreateBearerRequestMsgType, 1, sgwsOverloadControlInformationInCreateBearerRequest_p);
+ MmeS4SgsnsOverloadControlInformationInCreateBearerResponse* mmeS4SgsnsOverloadControlInformationInCreateBearerResponse_p = new (MmeS4SgsnsOverloadControlInformationInCreateBearerResponse);
+ insertGroupedIeObject(CreateBearerResponseMsgType, 0, mmeS4SgsnsOverloadControlInformationInCreateBearerResponse_p);
+ SgwsOverloadControlInformationInCreateBearerResponse* sgwsOverloadControlInformationInCreateBearerResponse_p = new (SgwsOverloadControlInformationInCreateBearerResponse);
+ insertGroupedIeObject(CreateBearerResponseMsgType, 1, sgwsOverloadControlInformationInCreateBearerResponse_p);
+ TwanEpdgsOverloadControlInformationInCreateBearerResponse* twanEpdgsOverloadControlInformationInCreateBearerResponse_p = new (TwanEpdgsOverloadControlInformationInCreateBearerResponse);
+ insertGroupedIeObject(CreateBearerResponseMsgType, 2, twanEpdgsOverloadControlInformationInCreateBearerResponse_p);
+ PgwsOverloadControlInformationInDeleteBearerRequest* pgwsOverloadControlInformationInDeleteBearerRequest_p = new (PgwsOverloadControlInformationInDeleteBearerRequest);
+ insertGroupedIeObject(DeleteBearerRequestMsgType, 0, pgwsOverloadControlInformationInDeleteBearerRequest_p);
+ SgwsOverloadControlInformationInDeleteBearerRequest* sgwsOverloadControlInformationInDeleteBearerRequest_p = new (SgwsOverloadControlInformationInDeleteBearerRequest);
+ insertGroupedIeObject(DeleteBearerRequestMsgType, 1, sgwsOverloadControlInformationInDeleteBearerRequest_p);
+ MmeS4SgsnsOverloadControlInformationInDeleteBearerResponse* mmeS4SgsnsOverloadControlInformationInDeleteBearerResponse_p = new (MmeS4SgsnsOverloadControlInformationInDeleteBearerResponse);
+ insertGroupedIeObject(DeleteBearerResponseMsgType, 0, mmeS4SgsnsOverloadControlInformationInDeleteBearerResponse_p);
+ SgwsOverloadControlInformationInDeleteBearerResponse* sgwsOverloadControlInformationInDeleteBearerResponse_p = new (SgwsOverloadControlInformationInDeleteBearerResponse);
+ insertGroupedIeObject(DeleteBearerResponseMsgType, 1, sgwsOverloadControlInformationInDeleteBearerResponse_p);
+ TwanEpdgsOverloadControlInformationInDeleteBearerResponse* twanEpdgsOverloadControlInformationInDeleteBearerResponse_p = new (TwanEpdgsOverloadControlInformationInDeleteBearerResponse);
+ insertGroupedIeObject(DeleteBearerResponseMsgType, 2, twanEpdgsOverloadControlInformationInDeleteBearerResponse_p);
+ SgwsOverloadControlInformationInDownlinkDataNotification* sgwsOverloadControlInformationInDownlinkDataNotification_p = new (SgwsOverloadControlInformationInDownlinkDataNotification);
+ insertGroupedIeObject(DownlinkDataNotificationMsgType, 0, sgwsOverloadControlInformationInDownlinkDataNotification_p);
+}
+
+OverloadControlInformationIe::~OverloadControlInformationIe() {
+// TODO Auto-generated destructor stub
+}
+
+GtpV2GroupedIe& OverloadControlInformationIe::getGroupedIe(Uint8 msgType, Uint8 instance)
+{
+ std::map<Uint16, GtpV2GroupedIe*>::iterator it;
+ Uint16 key = msgType;
+ key = (key << 8) + instance;
+ it = groupedIeObjectContainer.find(key);
+ return *(it->second);
+}
+
+void OverloadControlInformationIe::insertGroupedIeObject(Uint8 msgType, Uint8 instance, GtpV2GroupedIe* grpIe_p)
+{
+
+ Uint16 key = msgType;
+ key = (key << 8) + instance;
+
+ groupedIeObjectContainer.insert(std::pair<Uint16, GtpV2GroupedIe*>(key, grpIe_p));
+
+}
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/overloadControlInformationIe.h b/src/gtpV2Codec/ieClasses/overloadControlInformationIe.h
new file mode 100644
index 0000000..7db8dad
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/overloadControlInformationIe.h
@@ -0,0 +1,44 @@
+/*
+ * 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/grpietemplate.h.tt>
+ ******************************************************************************/
+#ifndef OVERLOADCONTROLINFORMATIONIE_H_
+#define OVERLOADCONTROLINFORMATIONIE_H_
+
+#include <map>
+#include "manual/gtpV2Ie.h"
+#include "manual/gtpV2GroupedIe.h"
+#include "gtpV2DataTypes.h"
+
+class OverloadControlInformationIe:public GtpV2Ie
+{
+public:
+ OverloadControlInformationIe ();
+ virtual ~ OverloadControlInformationIe ();
+
+ GtpV2GroupedIe & getGroupedIe (Uint8 msgType, Uint8 instance);
+ void insertGroupedIeObject (Uint8 msgType, Uint8 instance,
+ GtpV2GroupedIe * grpIe_p);
+
+private:
+ map < Uint16, GtpV2GroupedIe * >groupedIeObjectContainer; // map[msgType || instance]
+};
+
+#endif
diff --git a/src/gtpV2Codec/ieClasses/paaIe.cpp b/src/gtpV2Codec/ieClasses/paaIe.cpp
new file mode 100644
index 0000000..887abb1
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/paaIe.cpp
@@ -0,0 +1,174 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "paaIe.h"
+#include "dataTypeCodecUtils.h"
+
+PaaIe::PaaIe()
+{
+ ieType = 79;
+ // TODO
+
+}
+
+PaaIe::~PaaIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool PaaIe::encodePaaIe(MsgBuffer &buffer, PaaIeData const &data)
+{
+ buffer.skipBits(5);
+
+ if (!(data.pdnType<= 3))
+ {
+ errorStream.add((char *)"Data validation failure: pdnType\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.pdnType, 3)))
+ {
+ errorStream.add((char *)"Encoding of pdnType failed\n");
+ return false;
+ }
+ if (data.pdnType == 2 || data.pdnType == 3)
+ {
+ if (!(buffer.writeUint8(data.ipv6PrefixLength)))
+ {
+ errorStream.add((char *)"Encoding of ipv6PrefixLength failed\n");
+ return false;
+ }
+ }
+ if (data.pdnType == 2 || data.pdnType == 3)
+ {
+ if (!(DataTypeCodecUtils::encodeIpAddressV6(buffer, data.ipV6Address)))
+ {
+ errorStream.add((char *)"Encoding of ipV6Address failed\n");
+ return false;
+ }
+ }
+ if (data.pdnType == 1)
+ {
+ if (!(DataTypeCodecUtils::encodeIpAddressV4(buffer, data.ipV4Address)))
+ {
+ errorStream.add((char *)"Encoding of ipV4Address failed\n");
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool PaaIe::decodePaaIe(MsgBuffer &buffer, PaaIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+ buffer.skipBits(5);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: \n");
+ return false;
+ }
+
+ data.pdnType = buffer.readBits(3);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: pdnType\n");
+ return false;
+ }
+ if (!(data.pdnType<= 3))
+ {
+ errorStream.add((char *)"Data validation failure : pdnType\n");
+ return false; //TODO need to add validations
+ }
+
+ if (data.pdnType == 2 || data.pdnType == 3)
+ {
+
+ buffer.readUint8(data.ipv6PrefixLength);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: ipv6PrefixLength\n");
+ return false;
+ }
+ }
+
+ Uint16 lengthLeft = length;
+
+ if (data.pdnType == 2 || data.pdnType == 3)
+ {
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeIpAddressV6(buffer, data.ipV6Address, lengthLeft)))
+ {
+ errorStream.add((char *)"Failed to decode: ipV6Address\n");
+ return false;
+ }
+ }
+
+ if (data.pdnType == 1)
+ {
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeIpAddressV4(buffer, data.ipV4Address, lengthLeft)))
+ {
+ errorStream.add((char *)"Failed to decode: ipV4Address\n");
+ return false;
+ }
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE PaaIe\n");
+ return false;
+ }
+}
+void PaaIe::displayPaaIe_v(PaaIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"PaaIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add( (char *)"pdnType: ");
+ stream.add((Uint8)data.pdnType);
+ stream.endOfLine();
+
+ if (data.pdnType == 2 || data.pdnType == 3)
+ {
+ stream.add((char *)"ipv6PrefixLength: ");
+ stream.add(data.ipv6PrefixLength);
+ stream.endOfLine();
+ }
+
+ if (data.pdnType == 2 || data.pdnType == 3)
+ {
+ stream.add((char *)"ipV6Address:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displayIpAddressV6_v(data.ipV6Address, stream);
+ }
+
+ if (data.pdnType == 1)
+ {
+ stream.add((char *)"ipV4Address:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displayIpAddressV4_v(data.ipV4Address, stream);
+ }
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/paaIe.h b/src/gtpV2Codec/ieClasses/paaIe.h
new file mode 100644
index 0000000..9be7b3e
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/paaIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef PAAIE_H_
+#define PAAIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class PaaIe: public GtpV2Ie {
+public:
+ PaaIe();
+ virtual ~PaaIe();
+
+ bool encodePaaIe(MsgBuffer &buffer,
+ PaaIeData const &data);
+ bool decodePaaIe(MsgBuffer &buffer,
+ PaaIeData &data, Uint16 length);
+ void displayPaaIe_v(PaaIeData const &data,
+ Debug &stream);
+};
+
+#endif /* PAAIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/pagingAndServiceInformationIe.cpp b/src/gtpV2Codec/ieClasses/pagingAndServiceInformationIe.cpp
new file mode 100644
index 0000000..8fa4625
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/pagingAndServiceInformationIe.cpp
@@ -0,0 +1,146 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "pagingAndServiceInformationIe.h"
+#include "dataTypeCodecUtils.h"
+
+PagingAndServiceInformationIe::PagingAndServiceInformationIe()
+{
+ ieType = 186;
+ // TODO
+
+}
+
+PagingAndServiceInformationIe::~PagingAndServiceInformationIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool PagingAndServiceInformationIe::encodePagingAndServiceInformationIe(MsgBuffer &buffer, PagingAndServiceInformationIeData const &data)
+{
+ buffer.skipBits(4);
+
+ if(!(buffer.writeBits(data.epsBearerId, 4)))
+ {
+ errorStream.add((char *)"Encoding of epsBearerId failed\n");
+ return false;
+ }
+ buffer.skipBits(7);
+
+ if(!(buffer.writeBits(data.ppi, 1)))
+ {
+ errorStream.add((char *)"Encoding of ppi failed\n");
+ return false;
+ }
+ buffer.skipBits(2);
+
+ if (!(data.ppiValue==1))
+ {
+ errorStream.add((char *)"Data validation failure: ppiValue\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.ppiValue, 6)))
+ {
+ errorStream.add((char *)"Encoding of ppiValue failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool PagingAndServiceInformationIe::decodePagingAndServiceInformationIe(MsgBuffer &buffer, PagingAndServiceInformationIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+ buffer.skipBits(4);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: \n");
+ return false;
+ }
+
+ data.epsBearerId = buffer.readBits(4);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: epsBearerId\n");
+ return false;
+ }
+ buffer.skipBits(7);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: \n");
+ return false;
+ }
+
+ data.ppi = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: ppi\n");
+ return false;
+ }
+ buffer.skipBits(2);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: \n");
+ return false;
+ }
+
+ data.ppiValue = buffer.readBits(6);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: ppiValue\n");
+ return false;
+ }
+ if (!(data.ppiValue==1))
+ {
+ errorStream.add((char *)"Data validation failure : ppiValue\n");
+ return false; //TODO need to add validations
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE PagingAndServiceInformationIe\n");
+ return false;
+ }
+}
+void PagingAndServiceInformationIe::displayPagingAndServiceInformationIe_v(PagingAndServiceInformationIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"PagingAndServiceInformationIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add( (char *)"epsBearerId: ");
+ stream.add((Uint8)data.epsBearerId);
+ stream.endOfLine();
+
+ stream.add( (char *)"ppi: ");
+ stream.add((Uint8)data.ppi);
+ stream.endOfLine();
+
+ stream.add( (char *)"ppiValue: ");
+ stream.add((Uint8)data.ppiValue);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/pagingAndServiceInformationIe.h b/src/gtpV2Codec/ieClasses/pagingAndServiceInformationIe.h
new file mode 100644
index 0000000..e4fe140
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/pagingAndServiceInformationIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef PAGINGANDSERVICEINFORMATIONIE_H_
+#define PAGINGANDSERVICEINFORMATIONIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class PagingAndServiceInformationIe: public GtpV2Ie {
+public:
+ PagingAndServiceInformationIe();
+ virtual ~PagingAndServiceInformationIe();
+
+ bool encodePagingAndServiceInformationIe(MsgBuffer &buffer,
+ PagingAndServiceInformationIeData const &data);
+ bool decodePagingAndServiceInformationIe(MsgBuffer &buffer,
+ PagingAndServiceInformationIeData &data, Uint16 length);
+ void displayPagingAndServiceInformationIe_v(PagingAndServiceInformationIeData const &data,
+ Debug &stream);
+};
+
+#endif /* PAGINGANDSERVICEINFORMATIONIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/pcoIe.cpp b/src/gtpV2Codec/ieClasses/pcoIe.cpp
new file mode 100644
index 0000000..cecb1c2
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/pcoIe.cpp
@@ -0,0 +1,78 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "pcoIe.h"
+#include "dataTypeCodecUtils.h"
+
+PcoIe::PcoIe()
+{
+ ieType = 78;
+ // TODO
+
+}
+
+PcoIe::~PcoIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool PcoIe::encodePcoIe(MsgBuffer &buffer, PcoIeData const &data)
+{
+ if (!(DataTypeCodecUtils::encodeUint8Array255(buffer, data.pcoValue)))
+ {
+ errorStream.add((char *)"Encoding of pcoValue failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool PcoIe::decodePcoIe(MsgBuffer &buffer, PcoIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+
+ Uint16 lengthLeft = length;
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeUint8Array255(buffer, data.pcoValue, lengthLeft, 0)))
+ {
+ errorStream.add((char *)"Failed to decode: pcoValue\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE PcoIe\n");
+ return false;
+ }
+}
+void PcoIe::displayPcoIe_v(PcoIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"PcoIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add((char *)"pcoValue:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displayUint8Array255_v(data.pcoValue, stream);
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/pcoIe.h b/src/gtpV2Codec/ieClasses/pcoIe.h
new file mode 100644
index 0000000..4b3b9a6
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/pcoIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef PCOIE_H_
+#define PCOIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class PcoIe: public GtpV2Ie {
+public:
+ PcoIe();
+ virtual ~PcoIe();
+
+ bool encodePcoIe(MsgBuffer &buffer,
+ PcoIeData const &data);
+ bool decodePcoIe(MsgBuffer &buffer,
+ PcoIeData &data, Uint16 length);
+ void displayPcoIe_v(PcoIeData const &data,
+ Debug &stream);
+};
+
+#endif /* PCOIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/pdnTypeIe.cpp b/src/gtpV2Codec/ieClasses/pdnTypeIe.cpp
new file mode 100644
index 0000000..35a8682
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/pdnTypeIe.cpp
@@ -0,0 +1,96 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "pdnTypeIe.h"
+#include "dataTypeCodecUtils.h"
+
+PdnTypeIe::PdnTypeIe()
+{
+ ieType = 99;
+ // TODO
+
+}
+
+PdnTypeIe::~PdnTypeIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool PdnTypeIe::encodePdnTypeIe(MsgBuffer &buffer, PdnTypeIeData const &data)
+{
+ buffer.skipBits(5);
+
+ if (!(data.pdnType<= 3))
+ {
+ errorStream.add((char *)"Data validation failure: pdnType\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.pdnType, 3)))
+ {
+ errorStream.add((char *)"Encoding of pdnType failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool PdnTypeIe::decodePdnTypeIe(MsgBuffer &buffer, PdnTypeIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+ buffer.skipBits(5);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: \n");
+ return false;
+ }
+
+ data.pdnType = buffer.readBits(3);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: pdnType\n");
+ return false;
+ }
+ if (!(data.pdnType<= 3))
+ {
+ errorStream.add((char *)"Data validation failure : pdnType\n");
+ return false; //TODO need to add validations
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE PdnTypeIe\n");
+ return false;
+ }
+}
+void PdnTypeIe::displayPdnTypeIe_v(PdnTypeIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"PdnTypeIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add( (char *)"pdnType: ");
+ stream.add((Uint8)data.pdnType);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/pdnTypeIe.h b/src/gtpV2Codec/ieClasses/pdnTypeIe.h
new file mode 100644
index 0000000..d245bad
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/pdnTypeIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef PDNTYPEIE_H_
+#define PDNTYPEIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class PdnTypeIe: public GtpV2Ie {
+public:
+ PdnTypeIe();
+ virtual ~PdnTypeIe();
+
+ bool encodePdnTypeIe(MsgBuffer &buffer,
+ PdnTypeIeData const &data);
+ bool decodePdnTypeIe(MsgBuffer &buffer,
+ PdnTypeIeData &data, Uint16 length);
+ void displayPdnTypeIe_v(PdnTypeIeData const &data,
+ Debug &stream);
+};
+
+#endif /* PDNTYPEIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/pgwsApnLevelLoadControlInformationInCreateBearerRequest.cpp b/src/gtpV2Codec/ieClasses/pgwsApnLevelLoadControlInformationInCreateBearerRequest.cpp
new file mode 100644
index 0000000..75b9136
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/pgwsApnLevelLoadControlInformationInCreateBearerRequest.cpp
@@ -0,0 +1,306 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "pgwsApnLevelLoadControlInformationInCreateBearerRequest.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+#include "apnAndRelativeCapacityIe.h"
+
+PgwsApnLevelLoadControlInformationInCreateBearerRequest::
+PgwsApnLevelLoadControlInformationInCreateBearerRequest()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // loadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // loadMetric
+ mandatoryIeSet.insert(mandIe);
+ mandIe = ApnAndRelativeCapacityIeType;
+ mandIe = (mandIe << 8) | 0; // listOfApnAndRelativeCapacity
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+PgwsApnLevelLoadControlInformationInCreateBearerRequest::
+~PgwsApnLevelLoadControlInformationInCreateBearerRequest()
+{
+
+}
+bool PgwsApnLevelLoadControlInformationInCreateBearerRequest::
+encodePgwsApnLevelLoadControlInformationInCreateBearerRequest(MsgBuffer &buffer,
+ PgwsApnLevelLoadControlInformationInCreateBearerRequestData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.loadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: loadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.loadMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: loadMetric\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = ApnAndRelativeCapacityIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ ApnAndRelativeCapacityIe apnAndRelativeCapacity=
+ dynamic_cast<
+ ApnAndRelativeCapacityIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnAndRelativeCapacityIeType));
+ rc = apnAndRelativeCapacity.encodeApnAndRelativeCapacityIe(buffer, data.listOfApnAndRelativeCapacity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: listOfApnAndRelativeCapacity\n");
+ return false;
+ }
+ return rc;
+}
+
+bool PgwsApnLevelLoadControlInformationInCreateBearerRequest::
+decodePgwsApnLevelLoadControlInformationInCreateBearerRequest(MsgBuffer &buffer,
+ PgwsApnLevelLoadControlInformationInCreateBearerRequestData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.loadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: loadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.loadMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: loadMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case ApnAndRelativeCapacityIeType:
+ {
+ ApnAndRelativeCapacityIe ieObject =
+ dynamic_cast<
+ ApnAndRelativeCapacityIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(ApnAndRelativeCapacityIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeApnAndRelativeCapacityIe(buffer, data.listOfApnAndRelativeCapacity, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: listOfApnAndRelativeCapacity\n");
+ return false;
+ }
+ Uint16 mandIe = ApnAndRelativeCapacityIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void PgwsApnLevelLoadControlInformationInCreateBearerRequest::
+displayPgwsApnLevelLoadControlInformationInCreateBearerRequestData_v
+(PgwsApnLevelLoadControlInformationInCreateBearerRequestData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"PgwsApnLevelLoadControlInformationInCreateBearerRequest:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/pgwsApnLevelLoadControlInformationInCreateBearerRequest.h b/src/gtpV2Codec/ieClasses/pgwsApnLevelLoadControlInformationInCreateBearerRequest.h
new file mode 100644
index 0000000..153f759
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/pgwsApnLevelLoadControlInformationInCreateBearerRequest.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef PGWSAPNLEVELLOADCONTROLINFORMATIONINCREATEBEARERREQUEST_H_
+#define PGWSAPNLEVELLOADCONTROLINFORMATIONINCREATEBEARERREQUEST_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class PgwsApnLevelLoadControlInformationInCreateBearerRequest:public GtpV2GroupedIe
+{
+public:
+ PgwsApnLevelLoadControlInformationInCreateBearerRequest();
+ virtual ~PgwsApnLevelLoadControlInformationInCreateBearerRequest();
+ bool encodePgwsApnLevelLoadControlInformationInCreateBearerRequest(MsgBuffer &buffer,
+ PgwsApnLevelLoadControlInformationInCreateBearerRequestData
+ const &data);
+
+ bool decodePgwsApnLevelLoadControlInformationInCreateBearerRequest (MsgBuffer &buffer,
+ PgwsApnLevelLoadControlInformationInCreateBearerRequestData
+ & data, Uint16 length);
+
+ void displayPgwsApnLevelLoadControlInformationInCreateBearerRequestData_v
+ (PgwsApnLevelLoadControlInformationInCreateBearerRequestData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/pgwsApnLevelLoadControlInformationInCreateSessionResponse.cpp b/src/gtpV2Codec/ieClasses/pgwsApnLevelLoadControlInformationInCreateSessionResponse.cpp
new file mode 100644
index 0000000..a004c0a
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/pgwsApnLevelLoadControlInformationInCreateSessionResponse.cpp
@@ -0,0 +1,306 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "pgwsApnLevelLoadControlInformationInCreateSessionResponse.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+#include "apnAndRelativeCapacityIe.h"
+
+PgwsApnLevelLoadControlInformationInCreateSessionResponse::
+PgwsApnLevelLoadControlInformationInCreateSessionResponse()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // loadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // loadMetric
+ mandatoryIeSet.insert(mandIe);
+ mandIe = ApnAndRelativeCapacityIeType;
+ mandIe = (mandIe << 8) | 0; // listOfApnAndRelativeCapacity
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+PgwsApnLevelLoadControlInformationInCreateSessionResponse::
+~PgwsApnLevelLoadControlInformationInCreateSessionResponse()
+{
+
+}
+bool PgwsApnLevelLoadControlInformationInCreateSessionResponse::
+encodePgwsApnLevelLoadControlInformationInCreateSessionResponse(MsgBuffer &buffer,
+ PgwsApnLevelLoadControlInformationInCreateSessionResponseData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.loadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: loadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.loadMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: loadMetric\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = ApnAndRelativeCapacityIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ ApnAndRelativeCapacityIe apnAndRelativeCapacity=
+ dynamic_cast<
+ ApnAndRelativeCapacityIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnAndRelativeCapacityIeType));
+ rc = apnAndRelativeCapacity.encodeApnAndRelativeCapacityIe(buffer, data.listOfApnAndRelativeCapacity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: listOfApnAndRelativeCapacity\n");
+ return false;
+ }
+ return rc;
+}
+
+bool PgwsApnLevelLoadControlInformationInCreateSessionResponse::
+decodePgwsApnLevelLoadControlInformationInCreateSessionResponse(MsgBuffer &buffer,
+ PgwsApnLevelLoadControlInformationInCreateSessionResponseData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.loadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: loadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.loadMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: loadMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case ApnAndRelativeCapacityIeType:
+ {
+ ApnAndRelativeCapacityIe ieObject =
+ dynamic_cast<
+ ApnAndRelativeCapacityIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(ApnAndRelativeCapacityIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeApnAndRelativeCapacityIe(buffer, data.listOfApnAndRelativeCapacity, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: listOfApnAndRelativeCapacity\n");
+ return false;
+ }
+ Uint16 mandIe = ApnAndRelativeCapacityIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void PgwsApnLevelLoadControlInformationInCreateSessionResponse::
+displayPgwsApnLevelLoadControlInformationInCreateSessionResponseData_v
+(PgwsApnLevelLoadControlInformationInCreateSessionResponseData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"PgwsApnLevelLoadControlInformationInCreateSessionResponse:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/pgwsApnLevelLoadControlInformationInCreateSessionResponse.h b/src/gtpV2Codec/ieClasses/pgwsApnLevelLoadControlInformationInCreateSessionResponse.h
new file mode 100644
index 0000000..b9ac321
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/pgwsApnLevelLoadControlInformationInCreateSessionResponse.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef PGWSAPNLEVELLOADCONTROLINFORMATIONINCREATESESSIONRESPONSE_H_
+#define PGWSAPNLEVELLOADCONTROLINFORMATIONINCREATESESSIONRESPONSE_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class PgwsApnLevelLoadControlInformationInCreateSessionResponse:public GtpV2GroupedIe
+{
+public:
+ PgwsApnLevelLoadControlInformationInCreateSessionResponse();
+ virtual ~PgwsApnLevelLoadControlInformationInCreateSessionResponse();
+ bool encodePgwsApnLevelLoadControlInformationInCreateSessionResponse(MsgBuffer &buffer,
+ PgwsApnLevelLoadControlInformationInCreateSessionResponseData
+ const &data);
+
+ bool decodePgwsApnLevelLoadControlInformationInCreateSessionResponse (MsgBuffer &buffer,
+ PgwsApnLevelLoadControlInformationInCreateSessionResponseData
+ & data, Uint16 length);
+
+ void displayPgwsApnLevelLoadControlInformationInCreateSessionResponseData_v
+ (PgwsApnLevelLoadControlInformationInCreateSessionResponseData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/pgwsApnLevelLoadControlInformationInDeleteBearerRequest.cpp b/src/gtpV2Codec/ieClasses/pgwsApnLevelLoadControlInformationInDeleteBearerRequest.cpp
new file mode 100644
index 0000000..d2fb9f5
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/pgwsApnLevelLoadControlInformationInDeleteBearerRequest.cpp
@@ -0,0 +1,315 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "pgwsApnLevelLoadControlInformationInDeleteBearerRequest.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+#include "apnAndRelativeCapacityIe.h"
+
+PgwsApnLevelLoadControlInformationInDeleteBearerRequest::
+PgwsApnLevelLoadControlInformationInDeleteBearerRequest()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // loadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // loadMetric
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+PgwsApnLevelLoadControlInformationInDeleteBearerRequest::
+~PgwsApnLevelLoadControlInformationInDeleteBearerRequest()
+{
+
+}
+bool PgwsApnLevelLoadControlInformationInDeleteBearerRequest::
+encodePgwsApnLevelLoadControlInformationInDeleteBearerRequest(MsgBuffer &buffer,
+ PgwsApnLevelLoadControlInformationInDeleteBearerRequestData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.loadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: loadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.loadMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: loadMetric\n");
+ return false;
+ }
+
+ if (data.listOfApnAndRelativeCapacityIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = ApnAndRelativeCapacityIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ ApnAndRelativeCapacityIe apnAndRelativeCapacity=
+ dynamic_cast<
+ ApnAndRelativeCapacityIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnAndRelativeCapacityIeType));
+ rc = apnAndRelativeCapacity.encodeApnAndRelativeCapacityIe(buffer, data.listOfApnAndRelativeCapacity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: listOfApnAndRelativeCapacity\n");
+ return false;
+ }
+ }
+ return rc;
+}
+
+bool PgwsApnLevelLoadControlInformationInDeleteBearerRequest::
+decodePgwsApnLevelLoadControlInformationInDeleteBearerRequest(MsgBuffer &buffer,
+ PgwsApnLevelLoadControlInformationInDeleteBearerRequestData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.loadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: loadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.loadMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: loadMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case ApnAndRelativeCapacityIeType:
+ {
+ ApnAndRelativeCapacityIe ieObject =
+ dynamic_cast<
+ ApnAndRelativeCapacityIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(ApnAndRelativeCapacityIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeApnAndRelativeCapacityIe(buffer, data.listOfApnAndRelativeCapacity, ieHeader.length);
+
+ data.listOfApnAndRelativeCapacityIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: listOfApnAndRelativeCapacity\n");
+ return false;
+ }
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void PgwsApnLevelLoadControlInformationInDeleteBearerRequest::
+displayPgwsApnLevelLoadControlInformationInDeleteBearerRequestData_v
+(PgwsApnLevelLoadControlInformationInDeleteBearerRequestData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"PgwsApnLevelLoadControlInformationInDeleteBearerRequest:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+ if (data.listOfApnAndRelativeCapacityIePresent)
+ {
+
+ stream.add((char *)"listOfApnAndRelativeCapacity:");
+ stream.endOfLine();
+ ApnAndRelativeCapacityIe apnAndRelativeCapacity=
+ dynamic_cast<
+ ApnAndRelativeCapacityIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnAndRelativeCapacityIeType));
+ apnAndRelativeCapacity.displayApnAndRelativeCapacityIe_v(data.listOfApnAndRelativeCapacity, stream);
+
+ }
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/pgwsApnLevelLoadControlInformationInDeleteBearerRequest.h b/src/gtpV2Codec/ieClasses/pgwsApnLevelLoadControlInformationInDeleteBearerRequest.h
new file mode 100644
index 0000000..6df0f59
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/pgwsApnLevelLoadControlInformationInDeleteBearerRequest.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef PGWSAPNLEVELLOADCONTROLINFORMATIONINDELETEBEARERREQUEST_H_
+#define PGWSAPNLEVELLOADCONTROLINFORMATIONINDELETEBEARERREQUEST_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class PgwsApnLevelLoadControlInformationInDeleteBearerRequest:public GtpV2GroupedIe
+{
+public:
+ PgwsApnLevelLoadControlInformationInDeleteBearerRequest();
+ virtual ~PgwsApnLevelLoadControlInformationInDeleteBearerRequest();
+ bool encodePgwsApnLevelLoadControlInformationInDeleteBearerRequest(MsgBuffer &buffer,
+ PgwsApnLevelLoadControlInformationInDeleteBearerRequestData
+ const &data);
+
+ bool decodePgwsApnLevelLoadControlInformationInDeleteBearerRequest (MsgBuffer &buffer,
+ PgwsApnLevelLoadControlInformationInDeleteBearerRequestData
+ & data, Uint16 length);
+
+ void displayPgwsApnLevelLoadControlInformationInDeleteBearerRequestData_v
+ (PgwsApnLevelLoadControlInformationInDeleteBearerRequestData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/pgwsApnLevelLoadControlInformationInDeleteSessionResponse.cpp b/src/gtpV2Codec/ieClasses/pgwsApnLevelLoadControlInformationInDeleteSessionResponse.cpp
new file mode 100644
index 0000000..602332b
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/pgwsApnLevelLoadControlInformationInDeleteSessionResponse.cpp
@@ -0,0 +1,306 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "pgwsApnLevelLoadControlInformationInDeleteSessionResponse.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+#include "apnAndRelativeCapacityIe.h"
+
+PgwsApnLevelLoadControlInformationInDeleteSessionResponse::
+PgwsApnLevelLoadControlInformationInDeleteSessionResponse()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // loadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // loadMetric
+ mandatoryIeSet.insert(mandIe);
+ mandIe = ApnAndRelativeCapacityIeType;
+ mandIe = (mandIe << 8) | 0; // listOfApnAndRelativeCapacity
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+PgwsApnLevelLoadControlInformationInDeleteSessionResponse::
+~PgwsApnLevelLoadControlInformationInDeleteSessionResponse()
+{
+
+}
+bool PgwsApnLevelLoadControlInformationInDeleteSessionResponse::
+encodePgwsApnLevelLoadControlInformationInDeleteSessionResponse(MsgBuffer &buffer,
+ PgwsApnLevelLoadControlInformationInDeleteSessionResponseData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.loadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: loadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.loadMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: loadMetric\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = ApnAndRelativeCapacityIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ ApnAndRelativeCapacityIe apnAndRelativeCapacity=
+ dynamic_cast<
+ ApnAndRelativeCapacityIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnAndRelativeCapacityIeType));
+ rc = apnAndRelativeCapacity.encodeApnAndRelativeCapacityIe(buffer, data.listOfApnAndRelativeCapacity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: listOfApnAndRelativeCapacity\n");
+ return false;
+ }
+ return rc;
+}
+
+bool PgwsApnLevelLoadControlInformationInDeleteSessionResponse::
+decodePgwsApnLevelLoadControlInformationInDeleteSessionResponse(MsgBuffer &buffer,
+ PgwsApnLevelLoadControlInformationInDeleteSessionResponseData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.loadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: loadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.loadMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: loadMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case ApnAndRelativeCapacityIeType:
+ {
+ ApnAndRelativeCapacityIe ieObject =
+ dynamic_cast<
+ ApnAndRelativeCapacityIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(ApnAndRelativeCapacityIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeApnAndRelativeCapacityIe(buffer, data.listOfApnAndRelativeCapacity, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: listOfApnAndRelativeCapacity\n");
+ return false;
+ }
+ Uint16 mandIe = ApnAndRelativeCapacityIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void PgwsApnLevelLoadControlInformationInDeleteSessionResponse::
+displayPgwsApnLevelLoadControlInformationInDeleteSessionResponseData_v
+(PgwsApnLevelLoadControlInformationInDeleteSessionResponseData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"PgwsApnLevelLoadControlInformationInDeleteSessionResponse:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/pgwsApnLevelLoadControlInformationInDeleteSessionResponse.h b/src/gtpV2Codec/ieClasses/pgwsApnLevelLoadControlInformationInDeleteSessionResponse.h
new file mode 100644
index 0000000..15c357d
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/pgwsApnLevelLoadControlInformationInDeleteSessionResponse.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef PGWSAPNLEVELLOADCONTROLINFORMATIONINDELETESESSIONRESPONSE_H_
+#define PGWSAPNLEVELLOADCONTROLINFORMATIONINDELETESESSIONRESPONSE_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class PgwsApnLevelLoadControlInformationInDeleteSessionResponse:public GtpV2GroupedIe
+{
+public:
+ PgwsApnLevelLoadControlInformationInDeleteSessionResponse();
+ virtual ~PgwsApnLevelLoadControlInformationInDeleteSessionResponse();
+ bool encodePgwsApnLevelLoadControlInformationInDeleteSessionResponse(MsgBuffer &buffer,
+ PgwsApnLevelLoadControlInformationInDeleteSessionResponseData
+ const &data);
+
+ bool decodePgwsApnLevelLoadControlInformationInDeleteSessionResponse (MsgBuffer &buffer,
+ PgwsApnLevelLoadControlInformationInDeleteSessionResponseData
+ & data, Uint16 length);
+
+ void displayPgwsApnLevelLoadControlInformationInDeleteSessionResponseData_v
+ (PgwsApnLevelLoadControlInformationInDeleteSessionResponseData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/pgwsApnLevelLoadControlInformationInModifyBearerResponse.cpp b/src/gtpV2Codec/ieClasses/pgwsApnLevelLoadControlInformationInModifyBearerResponse.cpp
new file mode 100644
index 0000000..0b831d2
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/pgwsApnLevelLoadControlInformationInModifyBearerResponse.cpp
@@ -0,0 +1,306 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "pgwsApnLevelLoadControlInformationInModifyBearerResponse.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+#include "apnAndRelativeCapacityIe.h"
+
+PgwsApnLevelLoadControlInformationInModifyBearerResponse::
+PgwsApnLevelLoadControlInformationInModifyBearerResponse()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // loadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // loadMetric
+ mandatoryIeSet.insert(mandIe);
+ mandIe = ApnAndRelativeCapacityIeType;
+ mandIe = (mandIe << 8) | 0; // listOfApnAndRelativeCapacity
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+PgwsApnLevelLoadControlInformationInModifyBearerResponse::
+~PgwsApnLevelLoadControlInformationInModifyBearerResponse()
+{
+
+}
+bool PgwsApnLevelLoadControlInformationInModifyBearerResponse::
+encodePgwsApnLevelLoadControlInformationInModifyBearerResponse(MsgBuffer &buffer,
+ PgwsApnLevelLoadControlInformationInModifyBearerResponseData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.loadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: loadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.loadMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: loadMetric\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = ApnAndRelativeCapacityIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ ApnAndRelativeCapacityIe apnAndRelativeCapacity=
+ dynamic_cast<
+ ApnAndRelativeCapacityIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnAndRelativeCapacityIeType));
+ rc = apnAndRelativeCapacity.encodeApnAndRelativeCapacityIe(buffer, data.listOfApnAndRelativeCapacity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: listOfApnAndRelativeCapacity\n");
+ return false;
+ }
+ return rc;
+}
+
+bool PgwsApnLevelLoadControlInformationInModifyBearerResponse::
+decodePgwsApnLevelLoadControlInformationInModifyBearerResponse(MsgBuffer &buffer,
+ PgwsApnLevelLoadControlInformationInModifyBearerResponseData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.loadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: loadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.loadMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: loadMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case ApnAndRelativeCapacityIeType:
+ {
+ ApnAndRelativeCapacityIe ieObject =
+ dynamic_cast<
+ ApnAndRelativeCapacityIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(ApnAndRelativeCapacityIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeApnAndRelativeCapacityIe(buffer, data.listOfApnAndRelativeCapacity, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: listOfApnAndRelativeCapacity\n");
+ return false;
+ }
+ Uint16 mandIe = ApnAndRelativeCapacityIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void PgwsApnLevelLoadControlInformationInModifyBearerResponse::
+displayPgwsApnLevelLoadControlInformationInModifyBearerResponseData_v
+(PgwsApnLevelLoadControlInformationInModifyBearerResponseData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"PgwsApnLevelLoadControlInformationInModifyBearerResponse:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/pgwsApnLevelLoadControlInformationInModifyBearerResponse.h b/src/gtpV2Codec/ieClasses/pgwsApnLevelLoadControlInformationInModifyBearerResponse.h
new file mode 100644
index 0000000..e2bbaa8
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/pgwsApnLevelLoadControlInformationInModifyBearerResponse.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef PGWSAPNLEVELLOADCONTROLINFORMATIONINMODIFYBEARERRESPONSE_H_
+#define PGWSAPNLEVELLOADCONTROLINFORMATIONINMODIFYBEARERRESPONSE_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class PgwsApnLevelLoadControlInformationInModifyBearerResponse:public GtpV2GroupedIe
+{
+public:
+ PgwsApnLevelLoadControlInformationInModifyBearerResponse();
+ virtual ~PgwsApnLevelLoadControlInformationInModifyBearerResponse();
+ bool encodePgwsApnLevelLoadControlInformationInModifyBearerResponse(MsgBuffer &buffer,
+ PgwsApnLevelLoadControlInformationInModifyBearerResponseData
+ const &data);
+
+ bool decodePgwsApnLevelLoadControlInformationInModifyBearerResponse (MsgBuffer &buffer,
+ PgwsApnLevelLoadControlInformationInModifyBearerResponseData
+ & data, Uint16 length);
+
+ void displayPgwsApnLevelLoadControlInformationInModifyBearerResponseData_v
+ (PgwsApnLevelLoadControlInformationInModifyBearerResponseData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/pgwsNodeLevelLoadControlInformationInCreateBearerRequest.cpp b/src/gtpV2Codec/ieClasses/pgwsNodeLevelLoadControlInformationInCreateBearerRequest.cpp
new file mode 100644
index 0000000..df900fe
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/pgwsNodeLevelLoadControlInformationInCreateBearerRequest.cpp
@@ -0,0 +1,306 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "pgwsNodeLevelLoadControlInformationInCreateBearerRequest.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+#include "apnAndRelativeCapacityIe.h"
+
+PgwsNodeLevelLoadControlInformationInCreateBearerRequest::
+PgwsNodeLevelLoadControlInformationInCreateBearerRequest()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // loadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // loadMetric
+ mandatoryIeSet.insert(mandIe);
+ mandIe = ApnAndRelativeCapacityIeType;
+ mandIe = (mandIe << 8) | 0; // listOfApnAndRelativeCapacity
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+PgwsNodeLevelLoadControlInformationInCreateBearerRequest::
+~PgwsNodeLevelLoadControlInformationInCreateBearerRequest()
+{
+
+}
+bool PgwsNodeLevelLoadControlInformationInCreateBearerRequest::
+encodePgwsNodeLevelLoadControlInformationInCreateBearerRequest(MsgBuffer &buffer,
+ PgwsNodeLevelLoadControlInformationInCreateBearerRequestData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.loadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: loadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.loadMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: loadMetric\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = ApnAndRelativeCapacityIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ ApnAndRelativeCapacityIe apnAndRelativeCapacity=
+ dynamic_cast<
+ ApnAndRelativeCapacityIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnAndRelativeCapacityIeType));
+ rc = apnAndRelativeCapacity.encodeApnAndRelativeCapacityIe(buffer, data.listOfApnAndRelativeCapacity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: listOfApnAndRelativeCapacity\n");
+ return false;
+ }
+ return rc;
+}
+
+bool PgwsNodeLevelLoadControlInformationInCreateBearerRequest::
+decodePgwsNodeLevelLoadControlInformationInCreateBearerRequest(MsgBuffer &buffer,
+ PgwsNodeLevelLoadControlInformationInCreateBearerRequestData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.loadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: loadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.loadMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: loadMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case ApnAndRelativeCapacityIeType:
+ {
+ ApnAndRelativeCapacityIe ieObject =
+ dynamic_cast<
+ ApnAndRelativeCapacityIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(ApnAndRelativeCapacityIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeApnAndRelativeCapacityIe(buffer, data.listOfApnAndRelativeCapacity, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: listOfApnAndRelativeCapacity\n");
+ return false;
+ }
+ Uint16 mandIe = ApnAndRelativeCapacityIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void PgwsNodeLevelLoadControlInformationInCreateBearerRequest::
+displayPgwsNodeLevelLoadControlInformationInCreateBearerRequestData_v
+(PgwsNodeLevelLoadControlInformationInCreateBearerRequestData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"PgwsNodeLevelLoadControlInformationInCreateBearerRequest:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/pgwsNodeLevelLoadControlInformationInCreateBearerRequest.h b/src/gtpV2Codec/ieClasses/pgwsNodeLevelLoadControlInformationInCreateBearerRequest.h
new file mode 100644
index 0000000..c6c87a3
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/pgwsNodeLevelLoadControlInformationInCreateBearerRequest.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef PGWSNODELEVELLOADCONTROLINFORMATIONINCREATEBEARERREQUEST_H_
+#define PGWSNODELEVELLOADCONTROLINFORMATIONINCREATEBEARERREQUEST_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class PgwsNodeLevelLoadControlInformationInCreateBearerRequest:public GtpV2GroupedIe
+{
+public:
+ PgwsNodeLevelLoadControlInformationInCreateBearerRequest();
+ virtual ~PgwsNodeLevelLoadControlInformationInCreateBearerRequest();
+ bool encodePgwsNodeLevelLoadControlInformationInCreateBearerRequest(MsgBuffer &buffer,
+ PgwsNodeLevelLoadControlInformationInCreateBearerRequestData
+ const &data);
+
+ bool decodePgwsNodeLevelLoadControlInformationInCreateBearerRequest (MsgBuffer &buffer,
+ PgwsNodeLevelLoadControlInformationInCreateBearerRequestData
+ & data, Uint16 length);
+
+ void displayPgwsNodeLevelLoadControlInformationInCreateBearerRequestData_v
+ (PgwsNodeLevelLoadControlInformationInCreateBearerRequestData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/pgwsNodeLevelLoadControlInformationInCreateSessionResponse.cpp b/src/gtpV2Codec/ieClasses/pgwsNodeLevelLoadControlInformationInCreateSessionResponse.cpp
new file mode 100644
index 0000000..b983ef4
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/pgwsNodeLevelLoadControlInformationInCreateSessionResponse.cpp
@@ -0,0 +1,306 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "pgwsNodeLevelLoadControlInformationInCreateSessionResponse.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+#include "apnAndRelativeCapacityIe.h"
+
+PgwsNodeLevelLoadControlInformationInCreateSessionResponse::
+PgwsNodeLevelLoadControlInformationInCreateSessionResponse()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // loadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // loadMetric
+ mandatoryIeSet.insert(mandIe);
+ mandIe = ApnAndRelativeCapacityIeType;
+ mandIe = (mandIe << 8) | 0; // listOfApnAndRelativeCapacity
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+PgwsNodeLevelLoadControlInformationInCreateSessionResponse::
+~PgwsNodeLevelLoadControlInformationInCreateSessionResponse()
+{
+
+}
+bool PgwsNodeLevelLoadControlInformationInCreateSessionResponse::
+encodePgwsNodeLevelLoadControlInformationInCreateSessionResponse(MsgBuffer &buffer,
+ PgwsNodeLevelLoadControlInformationInCreateSessionResponseData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.loadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: loadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.loadMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: loadMetric\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = ApnAndRelativeCapacityIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ ApnAndRelativeCapacityIe apnAndRelativeCapacity=
+ dynamic_cast<
+ ApnAndRelativeCapacityIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnAndRelativeCapacityIeType));
+ rc = apnAndRelativeCapacity.encodeApnAndRelativeCapacityIe(buffer, data.listOfApnAndRelativeCapacity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: listOfApnAndRelativeCapacity\n");
+ return false;
+ }
+ return rc;
+}
+
+bool PgwsNodeLevelLoadControlInformationInCreateSessionResponse::
+decodePgwsNodeLevelLoadControlInformationInCreateSessionResponse(MsgBuffer &buffer,
+ PgwsNodeLevelLoadControlInformationInCreateSessionResponseData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.loadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: loadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.loadMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: loadMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case ApnAndRelativeCapacityIeType:
+ {
+ ApnAndRelativeCapacityIe ieObject =
+ dynamic_cast<
+ ApnAndRelativeCapacityIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(ApnAndRelativeCapacityIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeApnAndRelativeCapacityIe(buffer, data.listOfApnAndRelativeCapacity, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: listOfApnAndRelativeCapacity\n");
+ return false;
+ }
+ Uint16 mandIe = ApnAndRelativeCapacityIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void PgwsNodeLevelLoadControlInformationInCreateSessionResponse::
+displayPgwsNodeLevelLoadControlInformationInCreateSessionResponseData_v
+(PgwsNodeLevelLoadControlInformationInCreateSessionResponseData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"PgwsNodeLevelLoadControlInformationInCreateSessionResponse:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/pgwsNodeLevelLoadControlInformationInCreateSessionResponse.h b/src/gtpV2Codec/ieClasses/pgwsNodeLevelLoadControlInformationInCreateSessionResponse.h
new file mode 100644
index 0000000..58eb8ca
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/pgwsNodeLevelLoadControlInformationInCreateSessionResponse.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef PGWSNODELEVELLOADCONTROLINFORMATIONINCREATESESSIONRESPONSE_H_
+#define PGWSNODELEVELLOADCONTROLINFORMATIONINCREATESESSIONRESPONSE_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class PgwsNodeLevelLoadControlInformationInCreateSessionResponse:public GtpV2GroupedIe
+{
+public:
+ PgwsNodeLevelLoadControlInformationInCreateSessionResponse();
+ virtual ~PgwsNodeLevelLoadControlInformationInCreateSessionResponse();
+ bool encodePgwsNodeLevelLoadControlInformationInCreateSessionResponse(MsgBuffer &buffer,
+ PgwsNodeLevelLoadControlInformationInCreateSessionResponseData
+ const &data);
+
+ bool decodePgwsNodeLevelLoadControlInformationInCreateSessionResponse (MsgBuffer &buffer,
+ PgwsNodeLevelLoadControlInformationInCreateSessionResponseData
+ & data, Uint16 length);
+
+ void displayPgwsNodeLevelLoadControlInformationInCreateSessionResponseData_v
+ (PgwsNodeLevelLoadControlInformationInCreateSessionResponseData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/pgwsNodeLevelLoadControlInformationInDeleteBearerRequest.cpp b/src/gtpV2Codec/ieClasses/pgwsNodeLevelLoadControlInformationInDeleteBearerRequest.cpp
new file mode 100644
index 0000000..6ea59b8
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/pgwsNodeLevelLoadControlInformationInDeleteBearerRequest.cpp
@@ -0,0 +1,315 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "pgwsNodeLevelLoadControlInformationInDeleteBearerRequest.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+#include "apnAndRelativeCapacityIe.h"
+
+PgwsNodeLevelLoadControlInformationInDeleteBearerRequest::
+PgwsNodeLevelLoadControlInformationInDeleteBearerRequest()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // loadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // loadMetric
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+PgwsNodeLevelLoadControlInformationInDeleteBearerRequest::
+~PgwsNodeLevelLoadControlInformationInDeleteBearerRequest()
+{
+
+}
+bool PgwsNodeLevelLoadControlInformationInDeleteBearerRequest::
+encodePgwsNodeLevelLoadControlInformationInDeleteBearerRequest(MsgBuffer &buffer,
+ PgwsNodeLevelLoadControlInformationInDeleteBearerRequestData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.loadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: loadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.loadMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: loadMetric\n");
+ return false;
+ }
+
+ if (data.listOfApnAndRelativeCapacityIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = ApnAndRelativeCapacityIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ ApnAndRelativeCapacityIe apnAndRelativeCapacity=
+ dynamic_cast<
+ ApnAndRelativeCapacityIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnAndRelativeCapacityIeType));
+ rc = apnAndRelativeCapacity.encodeApnAndRelativeCapacityIe(buffer, data.listOfApnAndRelativeCapacity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: listOfApnAndRelativeCapacity\n");
+ return false;
+ }
+ }
+ return rc;
+}
+
+bool PgwsNodeLevelLoadControlInformationInDeleteBearerRequest::
+decodePgwsNodeLevelLoadControlInformationInDeleteBearerRequest(MsgBuffer &buffer,
+ PgwsNodeLevelLoadControlInformationInDeleteBearerRequestData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.loadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: loadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.loadMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: loadMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case ApnAndRelativeCapacityIeType:
+ {
+ ApnAndRelativeCapacityIe ieObject =
+ dynamic_cast<
+ ApnAndRelativeCapacityIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(ApnAndRelativeCapacityIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeApnAndRelativeCapacityIe(buffer, data.listOfApnAndRelativeCapacity, ieHeader.length);
+
+ data.listOfApnAndRelativeCapacityIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: listOfApnAndRelativeCapacity\n");
+ return false;
+ }
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void PgwsNodeLevelLoadControlInformationInDeleteBearerRequest::
+displayPgwsNodeLevelLoadControlInformationInDeleteBearerRequestData_v
+(PgwsNodeLevelLoadControlInformationInDeleteBearerRequestData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"PgwsNodeLevelLoadControlInformationInDeleteBearerRequest:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+ if (data.listOfApnAndRelativeCapacityIePresent)
+ {
+
+ stream.add((char *)"listOfApnAndRelativeCapacity:");
+ stream.endOfLine();
+ ApnAndRelativeCapacityIe apnAndRelativeCapacity=
+ dynamic_cast<
+ ApnAndRelativeCapacityIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnAndRelativeCapacityIeType));
+ apnAndRelativeCapacity.displayApnAndRelativeCapacityIe_v(data.listOfApnAndRelativeCapacity, stream);
+
+ }
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/pgwsNodeLevelLoadControlInformationInDeleteBearerRequest.h b/src/gtpV2Codec/ieClasses/pgwsNodeLevelLoadControlInformationInDeleteBearerRequest.h
new file mode 100644
index 0000000..e5d6d5e
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/pgwsNodeLevelLoadControlInformationInDeleteBearerRequest.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef PGWSNODELEVELLOADCONTROLINFORMATIONINDELETEBEARERREQUEST_H_
+#define PGWSNODELEVELLOADCONTROLINFORMATIONINDELETEBEARERREQUEST_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class PgwsNodeLevelLoadControlInformationInDeleteBearerRequest:public GtpV2GroupedIe
+{
+public:
+ PgwsNodeLevelLoadControlInformationInDeleteBearerRequest();
+ virtual ~PgwsNodeLevelLoadControlInformationInDeleteBearerRequest();
+ bool encodePgwsNodeLevelLoadControlInformationInDeleteBearerRequest(MsgBuffer &buffer,
+ PgwsNodeLevelLoadControlInformationInDeleteBearerRequestData
+ const &data);
+
+ bool decodePgwsNodeLevelLoadControlInformationInDeleteBearerRequest (MsgBuffer &buffer,
+ PgwsNodeLevelLoadControlInformationInDeleteBearerRequestData
+ & data, Uint16 length);
+
+ void displayPgwsNodeLevelLoadControlInformationInDeleteBearerRequestData_v
+ (PgwsNodeLevelLoadControlInformationInDeleteBearerRequestData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/pgwsNodeLevelLoadControlInformationInDeleteSessionResponse.cpp b/src/gtpV2Codec/ieClasses/pgwsNodeLevelLoadControlInformationInDeleteSessionResponse.cpp
new file mode 100644
index 0000000..301b92e
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/pgwsNodeLevelLoadControlInformationInDeleteSessionResponse.cpp
@@ -0,0 +1,306 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "pgwsNodeLevelLoadControlInformationInDeleteSessionResponse.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+#include "apnAndRelativeCapacityIe.h"
+
+PgwsNodeLevelLoadControlInformationInDeleteSessionResponse::
+PgwsNodeLevelLoadControlInformationInDeleteSessionResponse()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // loadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // loadMetric
+ mandatoryIeSet.insert(mandIe);
+ mandIe = ApnAndRelativeCapacityIeType;
+ mandIe = (mandIe << 8) | 0; // listOfApnAndRelativeCapacity
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+PgwsNodeLevelLoadControlInformationInDeleteSessionResponse::
+~PgwsNodeLevelLoadControlInformationInDeleteSessionResponse()
+{
+
+}
+bool PgwsNodeLevelLoadControlInformationInDeleteSessionResponse::
+encodePgwsNodeLevelLoadControlInformationInDeleteSessionResponse(MsgBuffer &buffer,
+ PgwsNodeLevelLoadControlInformationInDeleteSessionResponseData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.loadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: loadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.loadMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: loadMetric\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = ApnAndRelativeCapacityIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ ApnAndRelativeCapacityIe apnAndRelativeCapacity=
+ dynamic_cast<
+ ApnAndRelativeCapacityIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnAndRelativeCapacityIeType));
+ rc = apnAndRelativeCapacity.encodeApnAndRelativeCapacityIe(buffer, data.listOfApnAndRelativeCapacity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: listOfApnAndRelativeCapacity\n");
+ return false;
+ }
+ return rc;
+}
+
+bool PgwsNodeLevelLoadControlInformationInDeleteSessionResponse::
+decodePgwsNodeLevelLoadControlInformationInDeleteSessionResponse(MsgBuffer &buffer,
+ PgwsNodeLevelLoadControlInformationInDeleteSessionResponseData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.loadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: loadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.loadMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: loadMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case ApnAndRelativeCapacityIeType:
+ {
+ ApnAndRelativeCapacityIe ieObject =
+ dynamic_cast<
+ ApnAndRelativeCapacityIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(ApnAndRelativeCapacityIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeApnAndRelativeCapacityIe(buffer, data.listOfApnAndRelativeCapacity, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: listOfApnAndRelativeCapacity\n");
+ return false;
+ }
+ Uint16 mandIe = ApnAndRelativeCapacityIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void PgwsNodeLevelLoadControlInformationInDeleteSessionResponse::
+displayPgwsNodeLevelLoadControlInformationInDeleteSessionResponseData_v
+(PgwsNodeLevelLoadControlInformationInDeleteSessionResponseData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"PgwsNodeLevelLoadControlInformationInDeleteSessionResponse:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/pgwsNodeLevelLoadControlInformationInDeleteSessionResponse.h b/src/gtpV2Codec/ieClasses/pgwsNodeLevelLoadControlInformationInDeleteSessionResponse.h
new file mode 100644
index 0000000..a3a1edf
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/pgwsNodeLevelLoadControlInformationInDeleteSessionResponse.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef PGWSNODELEVELLOADCONTROLINFORMATIONINDELETESESSIONRESPONSE_H_
+#define PGWSNODELEVELLOADCONTROLINFORMATIONINDELETESESSIONRESPONSE_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class PgwsNodeLevelLoadControlInformationInDeleteSessionResponse:public GtpV2GroupedIe
+{
+public:
+ PgwsNodeLevelLoadControlInformationInDeleteSessionResponse();
+ virtual ~PgwsNodeLevelLoadControlInformationInDeleteSessionResponse();
+ bool encodePgwsNodeLevelLoadControlInformationInDeleteSessionResponse(MsgBuffer &buffer,
+ PgwsNodeLevelLoadControlInformationInDeleteSessionResponseData
+ const &data);
+
+ bool decodePgwsNodeLevelLoadControlInformationInDeleteSessionResponse (MsgBuffer &buffer,
+ PgwsNodeLevelLoadControlInformationInDeleteSessionResponseData
+ & data, Uint16 length);
+
+ void displayPgwsNodeLevelLoadControlInformationInDeleteSessionResponseData_v
+ (PgwsNodeLevelLoadControlInformationInDeleteSessionResponseData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/pgwsNodeLevelLoadControlInformationInModifyBearerResponse.cpp b/src/gtpV2Codec/ieClasses/pgwsNodeLevelLoadControlInformationInModifyBearerResponse.cpp
new file mode 100644
index 0000000..9400e86
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/pgwsNodeLevelLoadControlInformationInModifyBearerResponse.cpp
@@ -0,0 +1,306 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "pgwsNodeLevelLoadControlInformationInModifyBearerResponse.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+#include "apnAndRelativeCapacityIe.h"
+
+PgwsNodeLevelLoadControlInformationInModifyBearerResponse::
+PgwsNodeLevelLoadControlInformationInModifyBearerResponse()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // loadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // loadMetric
+ mandatoryIeSet.insert(mandIe);
+ mandIe = ApnAndRelativeCapacityIeType;
+ mandIe = (mandIe << 8) | 0; // listOfApnAndRelativeCapacity
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+PgwsNodeLevelLoadControlInformationInModifyBearerResponse::
+~PgwsNodeLevelLoadControlInformationInModifyBearerResponse()
+{
+
+}
+bool PgwsNodeLevelLoadControlInformationInModifyBearerResponse::
+encodePgwsNodeLevelLoadControlInformationInModifyBearerResponse(MsgBuffer &buffer,
+ PgwsNodeLevelLoadControlInformationInModifyBearerResponseData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.loadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: loadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.loadMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: loadMetric\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = ApnAndRelativeCapacityIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ ApnAndRelativeCapacityIe apnAndRelativeCapacity=
+ dynamic_cast<
+ ApnAndRelativeCapacityIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnAndRelativeCapacityIeType));
+ rc = apnAndRelativeCapacity.encodeApnAndRelativeCapacityIe(buffer, data.listOfApnAndRelativeCapacity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: listOfApnAndRelativeCapacity\n");
+ return false;
+ }
+ return rc;
+}
+
+bool PgwsNodeLevelLoadControlInformationInModifyBearerResponse::
+decodePgwsNodeLevelLoadControlInformationInModifyBearerResponse(MsgBuffer &buffer,
+ PgwsNodeLevelLoadControlInformationInModifyBearerResponseData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.loadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: loadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.loadMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: loadMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case ApnAndRelativeCapacityIeType:
+ {
+ ApnAndRelativeCapacityIe ieObject =
+ dynamic_cast<
+ ApnAndRelativeCapacityIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(ApnAndRelativeCapacityIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeApnAndRelativeCapacityIe(buffer, data.listOfApnAndRelativeCapacity, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: listOfApnAndRelativeCapacity\n");
+ return false;
+ }
+ Uint16 mandIe = ApnAndRelativeCapacityIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void PgwsNodeLevelLoadControlInformationInModifyBearerResponse::
+displayPgwsNodeLevelLoadControlInformationInModifyBearerResponseData_v
+(PgwsNodeLevelLoadControlInformationInModifyBearerResponseData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"PgwsNodeLevelLoadControlInformationInModifyBearerResponse:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/pgwsNodeLevelLoadControlInformationInModifyBearerResponse.h b/src/gtpV2Codec/ieClasses/pgwsNodeLevelLoadControlInformationInModifyBearerResponse.h
new file mode 100644
index 0000000..7d47ec7
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/pgwsNodeLevelLoadControlInformationInModifyBearerResponse.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef PGWSNODELEVELLOADCONTROLINFORMATIONINMODIFYBEARERRESPONSE_H_
+#define PGWSNODELEVELLOADCONTROLINFORMATIONINMODIFYBEARERRESPONSE_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class PgwsNodeLevelLoadControlInformationInModifyBearerResponse:public GtpV2GroupedIe
+{
+public:
+ PgwsNodeLevelLoadControlInformationInModifyBearerResponse();
+ virtual ~PgwsNodeLevelLoadControlInformationInModifyBearerResponse();
+ bool encodePgwsNodeLevelLoadControlInformationInModifyBearerResponse(MsgBuffer &buffer,
+ PgwsNodeLevelLoadControlInformationInModifyBearerResponseData
+ const &data);
+
+ bool decodePgwsNodeLevelLoadControlInformationInModifyBearerResponse (MsgBuffer &buffer,
+ PgwsNodeLevelLoadControlInformationInModifyBearerResponseData
+ & data, Uint16 length);
+
+ void displayPgwsNodeLevelLoadControlInformationInModifyBearerResponseData_v
+ (PgwsNodeLevelLoadControlInformationInModifyBearerResponseData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/pgwsOverloadControlInformationInCreateBearerRequest.cpp b/src/gtpV2Codec/ieClasses/pgwsOverloadControlInformationInCreateBearerRequest.cpp
new file mode 100644
index 0000000..62dc0c2
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/pgwsOverloadControlInformationInCreateBearerRequest.cpp
@@ -0,0 +1,377 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "pgwsOverloadControlInformationInCreateBearerRequest.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+#include "epcTimerIe.h"
+#include "apnIe.h"
+
+PgwsOverloadControlInformationInCreateBearerRequest::
+PgwsOverloadControlInformationInCreateBearerRequest()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // overloadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // overloadReductionMetric
+ mandatoryIeSet.insert(mandIe);
+ mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0; // periodOfValidity
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+PgwsOverloadControlInformationInCreateBearerRequest::
+~PgwsOverloadControlInformationInCreateBearerRequest()
+{
+
+}
+bool PgwsOverloadControlInformationInCreateBearerRequest::
+encodePgwsOverloadControlInformationInCreateBearerRequest(MsgBuffer &buffer,
+ PgwsOverloadControlInformationInCreateBearerRequestData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.overloadReductionMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadReductionMetric\n");
+ return false;
+ }
+
+
+
+ // 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.periodOfValidity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: periodOfValidity\n");
+ return false;
+ }
+
+ if (data.listOfAccessPointNameIePresent)
+ {
+
+ // 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.listOfAccessPointName);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: listOfAccessPointName\n");
+ return false;
+ }
+ }
+ return rc;
+}
+
+bool PgwsOverloadControlInformationInCreateBearerRequest::
+decodePgwsOverloadControlInformationInCreateBearerRequest(MsgBuffer &buffer,
+ PgwsOverloadControlInformationInCreateBearerRequestData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.overloadReductionMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadReductionMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.periodOfValidity, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: periodOfValidity\n");
+ return false;
+ }
+ Uint16 mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.listOfAccessPointName, ieHeader.length);
+
+ data.listOfAccessPointNameIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: listOfAccessPointName\n");
+ return false;
+ }
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void PgwsOverloadControlInformationInCreateBearerRequest::
+displayPgwsOverloadControlInformationInCreateBearerRequestData_v
+(PgwsOverloadControlInformationInCreateBearerRequestData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"PgwsOverloadControlInformationInCreateBearerRequest:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+
+ if (data.listOfAccessPointNameIePresent)
+ {
+
+ stream.add((char *)"listOfAccessPointName:");
+ stream.endOfLine();
+ ApnIe apn=
+ dynamic_cast<
+ ApnIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnIeType));
+ apn.displayApnIe_v(data.listOfAccessPointName, stream);
+
+ }
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/pgwsOverloadControlInformationInCreateBearerRequest.h b/src/gtpV2Codec/ieClasses/pgwsOverloadControlInformationInCreateBearerRequest.h
new file mode 100644
index 0000000..929cfbb
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/pgwsOverloadControlInformationInCreateBearerRequest.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef PGWSOVERLOADCONTROLINFORMATIONINCREATEBEARERREQUEST_H_
+#define PGWSOVERLOADCONTROLINFORMATIONINCREATEBEARERREQUEST_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class PgwsOverloadControlInformationInCreateBearerRequest:public GtpV2GroupedIe
+{
+public:
+ PgwsOverloadControlInformationInCreateBearerRequest();
+ virtual ~PgwsOverloadControlInformationInCreateBearerRequest();
+ bool encodePgwsOverloadControlInformationInCreateBearerRequest(MsgBuffer &buffer,
+ PgwsOverloadControlInformationInCreateBearerRequestData
+ const &data);
+
+ bool decodePgwsOverloadControlInformationInCreateBearerRequest (MsgBuffer &buffer,
+ PgwsOverloadControlInformationInCreateBearerRequestData
+ & data, Uint16 length);
+
+ void displayPgwsOverloadControlInformationInCreateBearerRequestData_v
+ (PgwsOverloadControlInformationInCreateBearerRequestData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/pgwsOverloadControlInformationInCreateSessionResponse.cpp b/src/gtpV2Codec/ieClasses/pgwsOverloadControlInformationInCreateSessionResponse.cpp
new file mode 100644
index 0000000..8eb36a1
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/pgwsOverloadControlInformationInCreateSessionResponse.cpp
@@ -0,0 +1,377 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "pgwsOverloadControlInformationInCreateSessionResponse.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+#include "epcTimerIe.h"
+#include "apnIe.h"
+
+PgwsOverloadControlInformationInCreateSessionResponse::
+PgwsOverloadControlInformationInCreateSessionResponse()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // overloadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // overloadReductionMetric
+ mandatoryIeSet.insert(mandIe);
+ mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0; // periodOfValidity
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+PgwsOverloadControlInformationInCreateSessionResponse::
+~PgwsOverloadControlInformationInCreateSessionResponse()
+{
+
+}
+bool PgwsOverloadControlInformationInCreateSessionResponse::
+encodePgwsOverloadControlInformationInCreateSessionResponse(MsgBuffer &buffer,
+ PgwsOverloadControlInformationInCreateSessionResponseData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.overloadReductionMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadReductionMetric\n");
+ return false;
+ }
+
+
+
+ // 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.periodOfValidity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: periodOfValidity\n");
+ return false;
+ }
+
+ if (data.listOfAccessPointNameIePresent)
+ {
+
+ // 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.listOfAccessPointName);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: listOfAccessPointName\n");
+ return false;
+ }
+ }
+ return rc;
+}
+
+bool PgwsOverloadControlInformationInCreateSessionResponse::
+decodePgwsOverloadControlInformationInCreateSessionResponse(MsgBuffer &buffer,
+ PgwsOverloadControlInformationInCreateSessionResponseData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.overloadReductionMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadReductionMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.periodOfValidity, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: periodOfValidity\n");
+ return false;
+ }
+ Uint16 mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.listOfAccessPointName, ieHeader.length);
+
+ data.listOfAccessPointNameIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: listOfAccessPointName\n");
+ return false;
+ }
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void PgwsOverloadControlInformationInCreateSessionResponse::
+displayPgwsOverloadControlInformationInCreateSessionResponseData_v
+(PgwsOverloadControlInformationInCreateSessionResponseData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"PgwsOverloadControlInformationInCreateSessionResponse:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+
+ if (data.listOfAccessPointNameIePresent)
+ {
+
+ stream.add((char *)"listOfAccessPointName:");
+ stream.endOfLine();
+ ApnIe apn=
+ dynamic_cast<
+ ApnIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnIeType));
+ apn.displayApnIe_v(data.listOfAccessPointName, stream);
+
+ }
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/pgwsOverloadControlInformationInCreateSessionResponse.h b/src/gtpV2Codec/ieClasses/pgwsOverloadControlInformationInCreateSessionResponse.h
new file mode 100644
index 0000000..f7a2d05
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/pgwsOverloadControlInformationInCreateSessionResponse.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef PGWSOVERLOADCONTROLINFORMATIONINCREATESESSIONRESPONSE_H_
+#define PGWSOVERLOADCONTROLINFORMATIONINCREATESESSIONRESPONSE_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class PgwsOverloadControlInformationInCreateSessionResponse:public GtpV2GroupedIe
+{
+public:
+ PgwsOverloadControlInformationInCreateSessionResponse();
+ virtual ~PgwsOverloadControlInformationInCreateSessionResponse();
+ bool encodePgwsOverloadControlInformationInCreateSessionResponse(MsgBuffer &buffer,
+ PgwsOverloadControlInformationInCreateSessionResponseData
+ const &data);
+
+ bool decodePgwsOverloadControlInformationInCreateSessionResponse (MsgBuffer &buffer,
+ PgwsOverloadControlInformationInCreateSessionResponseData
+ & data, Uint16 length);
+
+ void displayPgwsOverloadControlInformationInCreateSessionResponseData_v
+ (PgwsOverloadControlInformationInCreateSessionResponseData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/pgwsOverloadControlInformationInDeleteBearerRequest.cpp b/src/gtpV2Codec/ieClasses/pgwsOverloadControlInformationInDeleteBearerRequest.cpp
new file mode 100644
index 0000000..1b90143
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/pgwsOverloadControlInformationInDeleteBearerRequest.cpp
@@ -0,0 +1,377 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "pgwsOverloadControlInformationInDeleteBearerRequest.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+#include "epcTimerIe.h"
+#include "apnIe.h"
+
+PgwsOverloadControlInformationInDeleteBearerRequest::
+PgwsOverloadControlInformationInDeleteBearerRequest()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // overloadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // overloadReductionMetric
+ mandatoryIeSet.insert(mandIe);
+ mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0; // periodOfValidity
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+PgwsOverloadControlInformationInDeleteBearerRequest::
+~PgwsOverloadControlInformationInDeleteBearerRequest()
+{
+
+}
+bool PgwsOverloadControlInformationInDeleteBearerRequest::
+encodePgwsOverloadControlInformationInDeleteBearerRequest(MsgBuffer &buffer,
+ PgwsOverloadControlInformationInDeleteBearerRequestData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.overloadReductionMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadReductionMetric\n");
+ return false;
+ }
+
+
+
+ // 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.periodOfValidity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: periodOfValidity\n");
+ return false;
+ }
+
+ if (data.listOfAccessPointNameIePresent)
+ {
+
+ // 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.listOfAccessPointName);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: listOfAccessPointName\n");
+ return false;
+ }
+ }
+ return rc;
+}
+
+bool PgwsOverloadControlInformationInDeleteBearerRequest::
+decodePgwsOverloadControlInformationInDeleteBearerRequest(MsgBuffer &buffer,
+ PgwsOverloadControlInformationInDeleteBearerRequestData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.overloadReductionMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadReductionMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.periodOfValidity, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: periodOfValidity\n");
+ return false;
+ }
+ Uint16 mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.listOfAccessPointName, ieHeader.length);
+
+ data.listOfAccessPointNameIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: listOfAccessPointName\n");
+ return false;
+ }
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void PgwsOverloadControlInformationInDeleteBearerRequest::
+displayPgwsOverloadControlInformationInDeleteBearerRequestData_v
+(PgwsOverloadControlInformationInDeleteBearerRequestData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"PgwsOverloadControlInformationInDeleteBearerRequest:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+
+ if (data.listOfAccessPointNameIePresent)
+ {
+
+ stream.add((char *)"listOfAccessPointName:");
+ stream.endOfLine();
+ ApnIe apn=
+ dynamic_cast<
+ ApnIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnIeType));
+ apn.displayApnIe_v(data.listOfAccessPointName, stream);
+
+ }
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/pgwsOverloadControlInformationInDeleteBearerRequest.h b/src/gtpV2Codec/ieClasses/pgwsOverloadControlInformationInDeleteBearerRequest.h
new file mode 100644
index 0000000..0974f70
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/pgwsOverloadControlInformationInDeleteBearerRequest.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef PGWSOVERLOADCONTROLINFORMATIONINDELETEBEARERREQUEST_H_
+#define PGWSOVERLOADCONTROLINFORMATIONINDELETEBEARERREQUEST_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class PgwsOverloadControlInformationInDeleteBearerRequest:public GtpV2GroupedIe
+{
+public:
+ PgwsOverloadControlInformationInDeleteBearerRequest();
+ virtual ~PgwsOverloadControlInformationInDeleteBearerRequest();
+ bool encodePgwsOverloadControlInformationInDeleteBearerRequest(MsgBuffer &buffer,
+ PgwsOverloadControlInformationInDeleteBearerRequestData
+ const &data);
+
+ bool decodePgwsOverloadControlInformationInDeleteBearerRequest (MsgBuffer &buffer,
+ PgwsOverloadControlInformationInDeleteBearerRequestData
+ & data, Uint16 length);
+
+ void displayPgwsOverloadControlInformationInDeleteBearerRequestData_v
+ (PgwsOverloadControlInformationInDeleteBearerRequestData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/pgwsOverloadControlInformationInDeleteSessionResponse.cpp b/src/gtpV2Codec/ieClasses/pgwsOverloadControlInformationInDeleteSessionResponse.cpp
new file mode 100644
index 0000000..4b0a25f
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/pgwsOverloadControlInformationInDeleteSessionResponse.cpp
@@ -0,0 +1,377 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "pgwsOverloadControlInformationInDeleteSessionResponse.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+#include "epcTimerIe.h"
+#include "apnIe.h"
+
+PgwsOverloadControlInformationInDeleteSessionResponse::
+PgwsOverloadControlInformationInDeleteSessionResponse()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // overloadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // overloadReductionMetric
+ mandatoryIeSet.insert(mandIe);
+ mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0; // periodOfValidity
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+PgwsOverloadControlInformationInDeleteSessionResponse::
+~PgwsOverloadControlInformationInDeleteSessionResponse()
+{
+
+}
+bool PgwsOverloadControlInformationInDeleteSessionResponse::
+encodePgwsOverloadControlInformationInDeleteSessionResponse(MsgBuffer &buffer,
+ PgwsOverloadControlInformationInDeleteSessionResponseData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.overloadReductionMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadReductionMetric\n");
+ return false;
+ }
+
+
+
+ // 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.periodOfValidity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: periodOfValidity\n");
+ return false;
+ }
+
+ if (data.listOfAccessPointNameIePresent)
+ {
+
+ // 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.listOfAccessPointName);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: listOfAccessPointName\n");
+ return false;
+ }
+ }
+ return rc;
+}
+
+bool PgwsOverloadControlInformationInDeleteSessionResponse::
+decodePgwsOverloadControlInformationInDeleteSessionResponse(MsgBuffer &buffer,
+ PgwsOverloadControlInformationInDeleteSessionResponseData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.overloadReductionMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadReductionMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.periodOfValidity, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: periodOfValidity\n");
+ return false;
+ }
+ Uint16 mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.listOfAccessPointName, ieHeader.length);
+
+ data.listOfAccessPointNameIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: listOfAccessPointName\n");
+ return false;
+ }
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void PgwsOverloadControlInformationInDeleteSessionResponse::
+displayPgwsOverloadControlInformationInDeleteSessionResponseData_v
+(PgwsOverloadControlInformationInDeleteSessionResponseData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"PgwsOverloadControlInformationInDeleteSessionResponse:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+
+ if (data.listOfAccessPointNameIePresent)
+ {
+
+ stream.add((char *)"listOfAccessPointName:");
+ stream.endOfLine();
+ ApnIe apn=
+ dynamic_cast<
+ ApnIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnIeType));
+ apn.displayApnIe_v(data.listOfAccessPointName, stream);
+
+ }
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/pgwsOverloadControlInformationInDeleteSessionResponse.h b/src/gtpV2Codec/ieClasses/pgwsOverloadControlInformationInDeleteSessionResponse.h
new file mode 100644
index 0000000..8a8df0a
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/pgwsOverloadControlInformationInDeleteSessionResponse.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef PGWSOVERLOADCONTROLINFORMATIONINDELETESESSIONRESPONSE_H_
+#define PGWSOVERLOADCONTROLINFORMATIONINDELETESESSIONRESPONSE_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class PgwsOverloadControlInformationInDeleteSessionResponse:public GtpV2GroupedIe
+{
+public:
+ PgwsOverloadControlInformationInDeleteSessionResponse();
+ virtual ~PgwsOverloadControlInformationInDeleteSessionResponse();
+ bool encodePgwsOverloadControlInformationInDeleteSessionResponse(MsgBuffer &buffer,
+ PgwsOverloadControlInformationInDeleteSessionResponseData
+ const &data);
+
+ bool decodePgwsOverloadControlInformationInDeleteSessionResponse (MsgBuffer &buffer,
+ PgwsOverloadControlInformationInDeleteSessionResponseData
+ & data, Uint16 length);
+
+ void displayPgwsOverloadControlInformationInDeleteSessionResponseData_v
+ (PgwsOverloadControlInformationInDeleteSessionResponseData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/pgwsOverloadControlInformationInModifyBearerResponse.cpp b/src/gtpV2Codec/ieClasses/pgwsOverloadControlInformationInModifyBearerResponse.cpp
new file mode 100644
index 0000000..0bf3674
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/pgwsOverloadControlInformationInModifyBearerResponse.cpp
@@ -0,0 +1,377 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "pgwsOverloadControlInformationInModifyBearerResponse.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+#include "epcTimerIe.h"
+#include "apnIe.h"
+
+PgwsOverloadControlInformationInModifyBearerResponse::
+PgwsOverloadControlInformationInModifyBearerResponse()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // overloadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // overloadReductionMetric
+ mandatoryIeSet.insert(mandIe);
+ mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0; // periodOfValidity
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+PgwsOverloadControlInformationInModifyBearerResponse::
+~PgwsOverloadControlInformationInModifyBearerResponse()
+{
+
+}
+bool PgwsOverloadControlInformationInModifyBearerResponse::
+encodePgwsOverloadControlInformationInModifyBearerResponse(MsgBuffer &buffer,
+ PgwsOverloadControlInformationInModifyBearerResponseData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.overloadReductionMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadReductionMetric\n");
+ return false;
+ }
+
+
+
+ // 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.periodOfValidity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: periodOfValidity\n");
+ return false;
+ }
+
+ if (data.listOfAccessPointNameIePresent)
+ {
+
+ // 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.listOfAccessPointName);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: listOfAccessPointName\n");
+ return false;
+ }
+ }
+ return rc;
+}
+
+bool PgwsOverloadControlInformationInModifyBearerResponse::
+decodePgwsOverloadControlInformationInModifyBearerResponse(MsgBuffer &buffer,
+ PgwsOverloadControlInformationInModifyBearerResponseData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.overloadReductionMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadReductionMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.periodOfValidity, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: periodOfValidity\n");
+ return false;
+ }
+ Uint16 mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.listOfAccessPointName, ieHeader.length);
+
+ data.listOfAccessPointNameIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: listOfAccessPointName\n");
+ return false;
+ }
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void PgwsOverloadControlInformationInModifyBearerResponse::
+displayPgwsOverloadControlInformationInModifyBearerResponseData_v
+(PgwsOverloadControlInformationInModifyBearerResponseData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"PgwsOverloadControlInformationInModifyBearerResponse:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+
+ if (data.listOfAccessPointNameIePresent)
+ {
+
+ stream.add((char *)"listOfAccessPointName:");
+ stream.endOfLine();
+ ApnIe apn=
+ dynamic_cast<
+ ApnIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnIeType));
+ apn.displayApnIe_v(data.listOfAccessPointName, stream);
+
+ }
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/pgwsOverloadControlInformationInModifyBearerResponse.h b/src/gtpV2Codec/ieClasses/pgwsOverloadControlInformationInModifyBearerResponse.h
new file mode 100644
index 0000000..ed0d31a
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/pgwsOverloadControlInformationInModifyBearerResponse.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef PGWSOVERLOADCONTROLINFORMATIONINMODIFYBEARERRESPONSE_H_
+#define PGWSOVERLOADCONTROLINFORMATIONINMODIFYBEARERRESPONSE_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class PgwsOverloadControlInformationInModifyBearerResponse:public GtpV2GroupedIe
+{
+public:
+ PgwsOverloadControlInformationInModifyBearerResponse();
+ virtual ~PgwsOverloadControlInformationInModifyBearerResponse();
+ bool encodePgwsOverloadControlInformationInModifyBearerResponse(MsgBuffer &buffer,
+ PgwsOverloadControlInformationInModifyBearerResponseData
+ const &data);
+
+ bool decodePgwsOverloadControlInformationInModifyBearerResponse (MsgBuffer &buffer,
+ PgwsOverloadControlInformationInModifyBearerResponseData
+ & data, Uint16 length);
+
+ void displayPgwsOverloadControlInformationInModifyBearerResponseData_v
+ (PgwsOverloadControlInformationInModifyBearerResponseData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/portNumberIe.cpp b/src/gtpV2Codec/ieClasses/portNumberIe.cpp
new file mode 100644
index 0000000..bacc726
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/portNumberIe.cpp
@@ -0,0 +1,77 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "portNumberIe.h"
+#include "dataTypeCodecUtils.h"
+
+PortNumberIe::PortNumberIe()
+{
+ ieType = 126;
+ // TODO
+
+}
+
+PortNumberIe::~PortNumberIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool PortNumberIe::encodePortNumberIe(MsgBuffer &buffer, PortNumberIeData const &data)
+{
+ if (!(buffer.writeUint16(data.portNumber)))
+ {
+ errorStream.add((char *)"Encoding of portNumber failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool PortNumberIe::decodePortNumberIe(MsgBuffer &buffer, PortNumberIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+
+ buffer.readUint16(data.portNumber);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: portNumber\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE PortNumberIe\n");
+ return false;
+ }
+}
+void PortNumberIe::displayPortNumberIe_v(PortNumberIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"PortNumberIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add((char *)"portNumber: ");
+ stream.add(data.portNumber);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/portNumberIe.h b/src/gtpV2Codec/ieClasses/portNumberIe.h
new file mode 100644
index 0000000..4016e48
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/portNumberIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef PORTNUMBERIE_H_
+#define PORTNUMBERIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class PortNumberIe: public GtpV2Ie {
+public:
+ PortNumberIe();
+ virtual ~PortNumberIe();
+
+ bool encodePortNumberIe(MsgBuffer &buffer,
+ PortNumberIeData const &data);
+ bool decodePortNumberIe(MsgBuffer &buffer,
+ PortNumberIeData &data, Uint16 length);
+ void displayPortNumberIe_v(PortNumberIeData const &data,
+ Debug &stream);
+};
+
+#endif /* PORTNUMBERIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/presenceReportingAreaActionIe.cpp b/src/gtpV2Codec/ieClasses/presenceReportingAreaActionIe.cpp
new file mode 100644
index 0000000..000b92a
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/presenceReportingAreaActionIe.cpp
@@ -0,0 +1,515 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "presenceReportingAreaActionIe.h"
+#include "dataTypeCodecUtils.h"
+
+PresenceReportingAreaActionIe::PresenceReportingAreaActionIe()
+{
+ ieType = 177;
+ // TODO
+
+}
+
+PresenceReportingAreaActionIe::~PresenceReportingAreaActionIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool PresenceReportingAreaActionIe::encodePresenceReportingAreaActionIe(MsgBuffer &buffer, PresenceReportingAreaActionIeData const &data)
+{
+ buffer.skipBits(4);
+
+ if(!(buffer.writeBits(data.inapra, 1)))
+ {
+ errorStream.add((char *)"Encoding of inapra failed\n");
+ return false;
+ }
+ if (!(data.action<=3))
+ {
+ errorStream.add((char *)"Data validation failure: action\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.action, 3)))
+ {
+ errorStream.add((char *)"Encoding of action failed\n");
+ return false;
+ }
+ if (!(buffer.writeUint32(data.presenceReportingAreaIdentifier)))
+ {
+ errorStream.add((char *)"Encoding of presenceReportingAreaIdentifier failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.numberOfTAI, 4)))
+ {
+ errorStream.add((char *)"Encoding of numberOfTAI failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.numberOfRAI, 4)))
+ {
+ errorStream.add((char *)"Encoding of numberOfRAI failed\n");
+ return false;
+ }
+ buffer.skipBits(2);
+
+ if(!(buffer.writeBits(data.numberOfMacroeNodeB, 6)))
+ {
+ errorStream.add((char *)"Encoding of numberOfMacroeNodeB failed\n");
+ return false;
+ }
+ buffer.skipBits(2);
+
+ if(!(buffer.writeBits(data.numberOfHomeeNodeB, 6)))
+ {
+ errorStream.add((char *)"Encoding of numberOfHomeeNodeB failed\n");
+ return false;
+ }
+ buffer.skipBits(2);
+
+ if(!(buffer.writeBits(data.numberOfECGI, 6)))
+ {
+ errorStream.add((char *)"Encoding of numberOfECGI failed\n");
+ return false;
+ }
+ buffer.skipBits(2);
+
+ if(!(buffer.writeBits(data.numberOfSAI, 6)))
+ {
+ errorStream.add((char *)"Encoding of numberOfSAI failed\n");
+ return false;
+ }
+ buffer.skipBits(2);
+
+ if(!(buffer.writeBits(data.numberOfCGI, 6)))
+ {
+ errorStream.add((char *)"Encoding of numberOfCGI failed\n");
+ return false;
+ }
+ if (data.numberOfTAI !=0)
+ {
+ if (!(DataTypeCodecUtils::encodeTaiFieldArray15(buffer, data.tais)))
+ {
+ errorStream.add((char *)"Encoding of tais failed\n");
+ return false;
+ }
+ }
+ if (data.numberOfMacroeNodeB !=0)
+ {
+ if (!(buffer.writeUint8(data.macroeNBIds)))
+ {
+ errorStream.add((char *)"Encoding of macroeNBIds failed\n");
+ return false;
+ }
+ }
+ if (data.numberOfHomeeNodeB !=0)
+ {
+ if (!(buffer.writeUint8(data.homeeNBIds)))
+ {
+ errorStream.add((char *)"Encoding of homeeNBIds failed\n");
+ return false;
+ }
+ }
+ if (data.numberOfECGI !=0)
+ {
+ if (!(DataTypeCodecUtils::encodeEcgiFieldArray64(buffer, data.ecgis)))
+ {
+ errorStream.add((char *)"Encoding of ecgis failed\n");
+ return false;
+ }
+ }
+ if (data.numberOfRAI !=0)
+ {
+ if (!(DataTypeCodecUtils::encodeRaiFieldArray15(buffer, data.raiss)))
+ {
+ errorStream.add((char *)"Encoding of raiss failed\n");
+ return false;
+ }
+ }
+ if (data.numberOfSAI !=0)
+ {
+ if (!(DataTypeCodecUtils::encodeSaiFieldArray64(buffer, data.saiss)))
+ {
+ errorStream.add((char *)"Encoding of saiss failed\n");
+ return false;
+ }
+ }
+ if (data.numberOfCGI !=0)
+ {
+ if (!(DataTypeCodecUtils::encodeCgiFieldArray64(buffer, data.cgiss)))
+ {
+ errorStream.add((char *)"Encoding of cgiss failed\n");
+ return false;
+ }
+ }
+ buffer.skipBits(2);
+
+ if(!(buffer.writeBits(data.numberOfExtendedMacroeNodeB, 6)))
+ {
+ errorStream.add((char *)"Encoding of numberOfExtendedMacroeNodeB failed\n");
+ return false;
+ }
+ if (data.numberOfExtendedMacroeNodeB !=0)
+ {
+ if (!(buffer.writeUint8(data.extendedMacroeNBIds)))
+ {
+ errorStream.add((char *)"Encoding of extendedMacroeNBIds failed\n");
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool PresenceReportingAreaActionIe::decodePresenceReportingAreaActionIe(MsgBuffer &buffer, PresenceReportingAreaActionIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+ buffer.skipBits(4);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: \n");
+ return false;
+ }
+
+ data.inapra = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: inapra\n");
+ return false;
+ }
+ data.action = buffer.readBits(3);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: action\n");
+ return false;
+ }
+ if (!(data.action<=3))
+ {
+ errorStream.add((char *)"Data validation failure : action\n");
+ return false; //TODO need to add validations
+ }
+
+ buffer.readUint32(data.presenceReportingAreaIdentifier);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: presenceReportingAreaIdentifier\n");
+ return false;
+ }
+ data.numberOfTAI = buffer.readBits(4);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: numberOfTAI\n");
+ return false;
+ }
+ data.numberOfRAI = buffer.readBits(4);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: numberOfRAI\n");
+ return false;
+ }
+ buffer.skipBits(2);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: \n");
+ return false;
+ }
+
+ data.numberOfMacroeNodeB = buffer.readBits(6);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: numberOfMacroeNodeB\n");
+ return false;
+ }
+ buffer.skipBits(2);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: \n");
+ return false;
+ }
+
+ data.numberOfHomeeNodeB = buffer.readBits(6);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: numberOfHomeeNodeB\n");
+ return false;
+ }
+ buffer.skipBits(2);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: \n");
+ return false;
+ }
+
+ data.numberOfECGI = buffer.readBits(6);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: numberOfECGI\n");
+ return false;
+ }
+ buffer.skipBits(2);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: \n");
+ return false;
+ }
+
+ data.numberOfSAI = buffer.readBits(6);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: numberOfSAI\n");
+ return false;
+ }
+ buffer.skipBits(2);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: \n");
+ return false;
+ }
+
+ data.numberOfCGI = buffer.readBits(6);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: numberOfCGI\n");
+ return false;
+ }
+
+ Uint16 lengthLeft = length;
+
+ if (data.numberOfTAI !=0)
+ {
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeTaiFieldArray15(buffer, data.tais, lengthLeft, 0)))
+ {
+ errorStream.add((char *)"Failed to decode: tais\n");
+ return false;
+ }
+ }
+
+ if (data.numberOfMacroeNodeB !=0)
+ {
+
+ buffer.readUint8(data.macroeNBIds);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: macroeNBIds\n");
+ return false;
+ }
+ }
+
+ if (data.numberOfHomeeNodeB !=0)
+ {
+
+ buffer.readUint8(data.homeeNBIds);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: homeeNBIds\n");
+ return false;
+ }
+ }
+
+ if (data.numberOfECGI !=0)
+ {
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeEcgiFieldArray64(buffer, data.ecgis, lengthLeft, 0)))
+ {
+ errorStream.add((char *)"Failed to decode: ecgis\n");
+ return false;
+ }
+ }
+
+ if (data.numberOfRAI !=0)
+ {
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeRaiFieldArray15(buffer, data.raiss, lengthLeft, 0)))
+ {
+ errorStream.add((char *)"Failed to decode: raiss\n");
+ return false;
+ }
+ }
+
+ if (data.numberOfSAI !=0)
+ {
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeSaiFieldArray64(buffer, data.saiss, lengthLeft, 0)))
+ {
+ errorStream.add((char *)"Failed to decode: saiss\n");
+ return false;
+ }
+ }
+
+ if (data.numberOfCGI !=0)
+ {
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeCgiFieldArray64(buffer, data.cgiss, lengthLeft, 0)))
+ {
+ errorStream.add((char *)"Failed to decode: cgiss\n");
+ return false;
+ }
+ }
+ buffer.skipBits(2);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: \n");
+ return false;
+ }
+
+ data.numberOfExtendedMacroeNodeB = buffer.readBits(6);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: numberOfExtendedMacroeNodeB\n");
+ return false;
+ }
+
+ if (data.numberOfExtendedMacroeNodeB !=0)
+ {
+
+ buffer.readUint8(data.extendedMacroeNBIds);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: extendedMacroeNBIds\n");
+ return false;
+ }
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE PresenceReportingAreaActionIe\n");
+ return false;
+ }
+}
+void PresenceReportingAreaActionIe::displayPresenceReportingAreaActionIe_v(PresenceReportingAreaActionIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"PresenceReportingAreaActionIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add( (char *)"inapra: ");
+ stream.add((Uint8)data.inapra);
+ stream.endOfLine();
+
+ stream.add( (char *)"action: ");
+ stream.add((Uint8)data.action);
+ stream.endOfLine();
+
+ stream.add((char *)"presenceReportingAreaIdentifier: ");
+ stream.add(data.presenceReportingAreaIdentifier);
+ stream.endOfLine();
+
+ stream.add( (char *)"numberOfTAI: ");
+ stream.add((Uint8)data.numberOfTAI);
+ stream.endOfLine();
+
+ stream.add( (char *)"numberOfRAI: ");
+ stream.add((Uint8)data.numberOfRAI);
+ stream.endOfLine();
+
+ stream.add( (char *)"numberOfMacroeNodeB: ");
+ stream.add((Uint8)data.numberOfMacroeNodeB);
+ stream.endOfLine();
+
+ stream.add( (char *)"numberOfHomeeNodeB: ");
+ stream.add((Uint8)data.numberOfHomeeNodeB);
+ stream.endOfLine();
+
+ stream.add( (char *)"numberOfECGI: ");
+ stream.add((Uint8)data.numberOfECGI);
+ stream.endOfLine();
+
+ stream.add( (char *)"numberOfSAI: ");
+ stream.add((Uint8)data.numberOfSAI);
+ stream.endOfLine();
+
+ stream.add( (char *)"numberOfCGI: ");
+ stream.add((Uint8)data.numberOfCGI);
+ stream.endOfLine();
+
+ if (data.numberOfTAI !=0)
+ {
+ stream.add((char *)"tais:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displayTaiFieldArray15_v(data.tais, stream);
+ }
+
+ if (data.numberOfMacroeNodeB !=0)
+ {
+ stream.add((char *)"macroeNBIds: ");
+ stream.add(data.macroeNBIds);
+ stream.endOfLine();
+ }
+
+ if (data.numberOfHomeeNodeB !=0)
+ {
+ stream.add((char *)"homeeNBIds: ");
+ stream.add(data.homeeNBIds);
+ stream.endOfLine();
+ }
+
+ if (data.numberOfECGI !=0)
+ {
+ stream.add((char *)"ecgis:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displayEcgiFieldArray64_v(data.ecgis, stream);
+ }
+
+ if (data.numberOfRAI !=0)
+ {
+ stream.add((char *)"raiss:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displayRaiFieldArray15_v(data.raiss, stream);
+ }
+
+ if (data.numberOfSAI !=0)
+ {
+ stream.add((char *)"saiss:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displaySaiFieldArray64_v(data.saiss, stream);
+ }
+
+ if (data.numberOfCGI !=0)
+ {
+ stream.add((char *)"cgiss:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displayCgiFieldArray64_v(data.cgiss, stream);
+ }
+
+ stream.add( (char *)"numberOfExtendedMacroeNodeB: ");
+ stream.add((Uint8)data.numberOfExtendedMacroeNodeB);
+ stream.endOfLine();
+
+ if (data.numberOfExtendedMacroeNodeB !=0)
+ {
+ stream.add((char *)"extendedMacroeNBIds: ");
+ stream.add(data.extendedMacroeNBIds);
+ stream.endOfLine();
+ }
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/presenceReportingAreaActionIe.h b/src/gtpV2Codec/ieClasses/presenceReportingAreaActionIe.h
new file mode 100644
index 0000000..5bdaed0
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/presenceReportingAreaActionIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef PRESENCEREPORTINGAREAACTIONIE_H_
+#define PRESENCEREPORTINGAREAACTIONIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class PresenceReportingAreaActionIe: public GtpV2Ie {
+public:
+ PresenceReportingAreaActionIe();
+ virtual ~PresenceReportingAreaActionIe();
+
+ bool encodePresenceReportingAreaActionIe(MsgBuffer &buffer,
+ PresenceReportingAreaActionIeData const &data);
+ bool decodePresenceReportingAreaActionIe(MsgBuffer &buffer,
+ PresenceReportingAreaActionIeData &data, Uint16 length);
+ void displayPresenceReportingAreaActionIe_v(PresenceReportingAreaActionIeData const &data,
+ Debug &stream);
+};
+
+#endif /* PRESENCEREPORTINGAREAACTIONIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/ptiIe.cpp b/src/gtpV2Codec/ieClasses/ptiIe.cpp
new file mode 100644
index 0000000..f5848b7
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/ptiIe.cpp
@@ -0,0 +1,77 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "ptiIe.h"
+#include "dataTypeCodecUtils.h"
+
+PtiIe::PtiIe()
+{
+ ieType = 100;
+ // TODO
+
+}
+
+PtiIe::~PtiIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool PtiIe::encodePtiIe(MsgBuffer &buffer, PtiIeData const &data)
+{
+ if (!(buffer.writeUint8(data.procedureTransactionId)))
+ {
+ errorStream.add((char *)"Encoding of procedureTransactionId failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool PtiIe::decodePtiIe(MsgBuffer &buffer, PtiIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+
+ buffer.readUint8(data.procedureTransactionId);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: procedureTransactionId\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE PtiIe\n");
+ return false;
+ }
+}
+void PtiIe::displayPtiIe_v(PtiIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"PtiIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add((char *)"procedureTransactionId: ");
+ stream.add(data.procedureTransactionId);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/ptiIe.h b/src/gtpV2Codec/ieClasses/ptiIe.h
new file mode 100644
index 0000000..b34a14a
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/ptiIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef PTIIE_H_
+#define PTIIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class PtiIe: public GtpV2Ie {
+public:
+ PtiIe();
+ virtual ~PtiIe();
+
+ bool encodePtiIe(MsgBuffer &buffer,
+ PtiIeData const &data);
+ bool decodePtiIe(MsgBuffer &buffer,
+ PtiIeData &data, Uint16 length);
+ void displayPtiIe_v(PtiIeData const &data,
+ Debug &stream);
+};
+
+#endif /* PTIIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/ranNasCauseIe.cpp b/src/gtpV2Codec/ieClasses/ranNasCauseIe.cpp
new file mode 100644
index 0000000..fb5441a
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/ranNasCauseIe.cpp
@@ -0,0 +1,119 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "ranNasCauseIe.h"
+#include "dataTypeCodecUtils.h"
+
+RanNasCauseIe::RanNasCauseIe()
+{
+ ieType = 172;
+ // TODO
+
+}
+
+RanNasCauseIe::~RanNasCauseIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool RanNasCauseIe::encodeRanNasCauseIe(MsgBuffer &buffer, RanNasCauseIeData const &data)
+{
+ if (!(data.protocolType>= 1 && data.protocolType<=5))
+ {
+ errorStream.add((char *)"Data validation failure: protocolType\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.protocolType, 4)))
+ {
+ errorStream.add((char *)"Encoding of protocolType failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.causeType, 4)))
+ {
+ errorStream.add((char *)"Encoding of causeType failed\n");
+ return false;
+ }
+ if (!(buffer.writeUint8(data.causeValue)))
+ {
+ errorStream.add((char *)"Encoding of causeValue failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool RanNasCauseIe::decodeRanNasCauseIe(MsgBuffer &buffer, RanNasCauseIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+ data.protocolType = buffer.readBits(4);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: protocolType\n");
+ return false;
+ }
+ if (!(data.protocolType>= 1 && data.protocolType<=5))
+ {
+ errorStream.add((char *)"Data validation failure : protocolType\n");
+ return false; //TODO need to add validations
+ }
+ data.causeType = buffer.readBits(4);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: causeType\n");
+ return false;
+ }
+
+ buffer.readUint8(data.causeValue);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: causeValue\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE RanNasCauseIe\n");
+ return false;
+ }
+}
+void RanNasCauseIe::displayRanNasCauseIe_v(RanNasCauseIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"RanNasCauseIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add( (char *)"protocolType: ");
+ stream.add((Uint8)data.protocolType);
+ stream.endOfLine();
+
+ stream.add( (char *)"causeType: ");
+ stream.add((Uint8)data.causeType);
+ stream.endOfLine();
+
+ stream.add((char *)"causeValue: ");
+ stream.add(data.causeValue);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/ranNasCauseIe.h b/src/gtpV2Codec/ieClasses/ranNasCauseIe.h
new file mode 100644
index 0000000..5a37fe9
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/ranNasCauseIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef RANNASCAUSEIE_H_
+#define RANNASCAUSEIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class RanNasCauseIe: public GtpV2Ie {
+public:
+ RanNasCauseIe();
+ virtual ~RanNasCauseIe();
+
+ bool encodeRanNasCauseIe(MsgBuffer &buffer,
+ RanNasCauseIeData const &data);
+ bool decodeRanNasCauseIe(MsgBuffer &buffer,
+ RanNasCauseIeData &data, Uint16 length);
+ void displayRanNasCauseIe_v(RanNasCauseIeData const &data,
+ Debug &stream);
+};
+
+#endif /* RANNASCAUSEIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/ratTypeIe.cpp b/src/gtpV2Codec/ieClasses/ratTypeIe.cpp
new file mode 100644
index 0000000..dfcbbaf
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/ratTypeIe.cpp
@@ -0,0 +1,77 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "ratTypeIe.h"
+#include "dataTypeCodecUtils.h"
+
+RatTypeIe::RatTypeIe()
+{
+ ieType = 82;
+ // TODO
+
+}
+
+RatTypeIe::~RatTypeIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool RatTypeIe::encodeRatTypeIe(MsgBuffer &buffer, RatTypeIeData const &data)
+{
+ if (!(buffer.writeUint8(data.ratType)))
+ {
+ errorStream.add((char *)"Encoding of ratType failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool RatTypeIe::decodeRatTypeIe(MsgBuffer &buffer, RatTypeIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+
+ buffer.readUint8(data.ratType);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: ratType\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE RatTypeIe\n");
+ return false;
+ }
+}
+void RatTypeIe::displayRatTypeIe_v(RatTypeIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"RatTypeIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add((char *)"ratType: ");
+ stream.add(data.ratType);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/ratTypeIe.h b/src/gtpV2Codec/ieClasses/ratTypeIe.h
new file mode 100644
index 0000000..8c3b0bd
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/ratTypeIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef RATTYPEIE_H_
+#define RATTYPEIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class RatTypeIe: public GtpV2Ie {
+public:
+ RatTypeIe();
+ virtual ~RatTypeIe();
+
+ bool encodeRatTypeIe(MsgBuffer &buffer,
+ RatTypeIeData const &data);
+ bool decodeRatTypeIe(MsgBuffer &buffer,
+ RatTypeIeData &data, Uint16 length);
+ void displayRatTypeIe_v(RatTypeIeData const &data,
+ Debug &stream);
+};
+
+#endif /* RATTYPEIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/recoveryIe.cpp b/src/gtpV2Codec/ieClasses/recoveryIe.cpp
new file mode 100644
index 0000000..709b429
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/recoveryIe.cpp
@@ -0,0 +1,77 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "recoveryIe.h"
+#include "dataTypeCodecUtils.h"
+
+RecoveryIe::RecoveryIe()
+{
+ ieType = 3;
+ // TODO
+
+}
+
+RecoveryIe::~RecoveryIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool RecoveryIe::encodeRecoveryIe(MsgBuffer &buffer, RecoveryIeData const &data)
+{
+ if (!(buffer.writeUint8(data.restartCounter)))
+ {
+ errorStream.add((char *)"Encoding of restartCounter failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool RecoveryIe::decodeRecoveryIe(MsgBuffer &buffer, RecoveryIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+
+ buffer.readUint8(data.restartCounter);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: restartCounter\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE RecoveryIe\n");
+ return false;
+ }
+}
+void RecoveryIe::displayRecoveryIe_v(RecoveryIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"RecoveryIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add((char *)"restartCounter: ");
+ stream.add(data.restartCounter);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/recoveryIe.h b/src/gtpV2Codec/ieClasses/recoveryIe.h
new file mode 100644
index 0000000..56f4f4a
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/recoveryIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef RECOVERYIE_H_
+#define RECOVERYIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class RecoveryIe: public GtpV2Ie {
+public:
+ RecoveryIe();
+ virtual ~RecoveryIe();
+
+ bool encodeRecoveryIe(MsgBuffer &buffer,
+ RecoveryIeData const &data);
+ bool decodeRecoveryIe(MsgBuffer &buffer,
+ RecoveryIeData &data, Uint16 length);
+ void displayRecoveryIe_v(RecoveryIeData const &data,
+ Debug &stream);
+};
+
+#endif /* RECOVERYIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/remoteUeContextConnectedInCreateSessionRequest.cpp b/src/gtpV2Codec/ieClasses/remoteUeContextConnectedInCreateSessionRequest.cpp
new file mode 100644
index 0000000..601fe40
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/remoteUeContextConnectedInCreateSessionRequest.cpp
@@ -0,0 +1,244 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "remoteUeContextConnectedInCreateSessionRequest.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "remoteUserIdIe.h"
+#include "remoteUeIpInformationIe.h"
+
+RemoteUeContextConnectedInCreateSessionRequest::
+RemoteUeContextConnectedInCreateSessionRequest()
+{
+ Uint16 mandIe;
+ mandIe = RemoteUserIdIeType;
+ mandIe = (mandIe << 8) | 0; // remoteUserId
+ mandatoryIeSet.insert(mandIe);
+ mandIe = RemoteUeIpInformationIeType;
+ mandIe = (mandIe << 8) | 0; // remoteUeIpInformation
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+RemoteUeContextConnectedInCreateSessionRequest::
+~RemoteUeContextConnectedInCreateSessionRequest()
+{
+
+}
+bool RemoteUeContextConnectedInCreateSessionRequest::
+encodeRemoteUeContextConnectedInCreateSessionRequest(MsgBuffer &buffer,
+ RemoteUeContextConnectedInCreateSessionRequestData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = RemoteUserIdIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ RemoteUserIdIe remoteUserId=
+ dynamic_cast<
+ RemoteUserIdIe&>(GtpV2IeFactory::getInstance().getIeObject(RemoteUserIdIeType));
+ rc = remoteUserId.encodeRemoteUserIdIe(buffer, data.remoteUserId);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: remoteUserId\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = RemoteUeIpInformationIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ RemoteUeIpInformationIe remoteUeIpInformation=
+ dynamic_cast<
+ RemoteUeIpInformationIe&>(GtpV2IeFactory::getInstance().getIeObject(RemoteUeIpInformationIeType));
+ rc = remoteUeIpInformation.encodeRemoteUeIpInformationIe(buffer, data.remoteUeIpInformation);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: remoteUeIpInformation\n");
+ return false;
+ }
+ return rc;
+}
+
+bool RemoteUeContextConnectedInCreateSessionRequest::
+decodeRemoteUeContextConnectedInCreateSessionRequest(MsgBuffer &buffer,
+ RemoteUeContextConnectedInCreateSessionRequestData
+ &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 RemoteUserIdIeType:
+ {
+ RemoteUserIdIe ieObject =
+ dynamic_cast<
+ RemoteUserIdIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(RemoteUserIdIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeRemoteUserIdIe(buffer, data.remoteUserId, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: remoteUserId\n");
+ return false;
+ }
+ Uint16 mandIe = RemoteUserIdIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case RemoteUeIpInformationIeType:
+ {
+ RemoteUeIpInformationIe ieObject =
+ dynamic_cast<
+ RemoteUeIpInformationIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(RemoteUeIpInformationIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeRemoteUeIpInformationIe(buffer, data.remoteUeIpInformation, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: remoteUeIpInformation\n");
+ return false;
+ }
+ Uint16 mandIe = RemoteUeIpInformationIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void RemoteUeContextConnectedInCreateSessionRequest::
+displayRemoteUeContextConnectedInCreateSessionRequestData_v
+(RemoteUeContextConnectedInCreateSessionRequestData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"RemoteUeContextConnectedInCreateSessionRequest:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/remoteUeContextConnectedInCreateSessionRequest.h b/src/gtpV2Codec/ieClasses/remoteUeContextConnectedInCreateSessionRequest.h
new file mode 100644
index 0000000..ee34c6e
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/remoteUeContextConnectedInCreateSessionRequest.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef REMOTEUECONTEXTCONNECTEDINCREATESESSIONREQUEST_H_
+#define REMOTEUECONTEXTCONNECTEDINCREATESESSIONREQUEST_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class RemoteUeContextConnectedInCreateSessionRequest:public GtpV2GroupedIe
+{
+public:
+ RemoteUeContextConnectedInCreateSessionRequest();
+ virtual ~RemoteUeContextConnectedInCreateSessionRequest();
+ bool encodeRemoteUeContextConnectedInCreateSessionRequest(MsgBuffer &buffer,
+ RemoteUeContextConnectedInCreateSessionRequestData
+ const &data);
+
+ bool decodeRemoteUeContextConnectedInCreateSessionRequest (MsgBuffer &buffer,
+ RemoteUeContextConnectedInCreateSessionRequestData
+ & data, Uint16 length);
+
+ void displayRemoteUeContextConnectedInCreateSessionRequestData_v
+ (RemoteUeContextConnectedInCreateSessionRequestData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/remoteUeContextIe.cpp b/src/gtpV2Codec/ieClasses/remoteUeContextIe.cpp
new file mode 100644
index 0000000..c21d8c9
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/remoteUeContextIe.cpp
@@ -0,0 +1,49 @@
+/*
+ * 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/grpietemplate.cpp.tt>
+ ******************************************************************************/
+#include "remoteUeContextIe.h"
+#include "gtpV2GrpIeDataTypes.h"
+#include "manual/gtpV2GroupedIe.h"
+
+#include "remoteUeContextConnectedInCreateSessionRequest.h"
+
+RemoteUeContextIe::RemoteUeContextIe()
+{
+ ieType = RemoteUeContextIeType;
+
+ RemoteUeContextConnectedInCreateSessionRequest* remoteUeContextConnectedInCreateSessionRequest_p = new (RemoteUeContextConnectedInCreateSessionRequest);
+ insertGroupedIeObject(CreateSessionRequestMsgType, 0, remoteUeContextConnectedInCreateSessionRequest_p);
+}
+
+RemoteUeContextIe::~RemoteUeContextIe() {
+// TODO Auto-generated destructor stub
+}
+
+GtpV2GroupedIe& RemoteUeContextIe::getGroupedIe(Uint8 msgType, Uint8 instance)
+{
+ std::map<Uint16, GtpV2GroupedIe*>::iterator it;
+ Uint16 key = msgType;
+ key = (key << 8) + instance;
+ it = groupedIeObjectContainer.find(key);
+ return *(it->second);
+}
+
+void RemoteUeContextIe::insertGroupedIeObject(Uint8 msgType, Uint8 instance, GtpV2GroupedIe* grpIe_p)
+{
+
+ Uint16 key = msgType;
+ key = (key << 8) + instance;
+
+ groupedIeObjectContainer.insert(std::pair<Uint16, GtpV2GroupedIe*>(key, grpIe_p));
+
+}
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/remoteUeContextIe.h b/src/gtpV2Codec/ieClasses/remoteUeContextIe.h
new file mode 100644
index 0000000..54c3455
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/remoteUeContextIe.h
@@ -0,0 +1,44 @@
+/*
+ * 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/grpietemplate.h.tt>
+ ******************************************************************************/
+#ifndef REMOTEUECONTEXTIE_H_
+#define REMOTEUECONTEXTIE_H_
+
+#include <map>
+#include "manual/gtpV2Ie.h"
+#include "manual/gtpV2GroupedIe.h"
+#include "gtpV2DataTypes.h"
+
+class RemoteUeContextIe:public GtpV2Ie
+{
+public:
+ RemoteUeContextIe ();
+ virtual ~ RemoteUeContextIe ();
+
+ GtpV2GroupedIe & getGroupedIe (Uint8 msgType, Uint8 instance);
+ void insertGroupedIeObject (Uint8 msgType, Uint8 instance,
+ GtpV2GroupedIe * grpIe_p);
+
+private:
+ map < Uint16, GtpV2GroupedIe * >groupedIeObjectContainer; // map[msgType || instance]
+};
+
+#endif
diff --git a/src/gtpV2Codec/ieClasses/remoteUeIpInformationIe.cpp b/src/gtpV2Codec/ieClasses/remoteUeIpInformationIe.cpp
new file mode 100644
index 0000000..e097d1b
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/remoteUeIpInformationIe.cpp
@@ -0,0 +1,77 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "remoteUeIpInformationIe.h"
+#include "dataTypeCodecUtils.h"
+
+RemoteUeIpInformationIe::RemoteUeIpInformationIe()
+{
+ ieType = 193;
+ // TODO
+
+}
+
+RemoteUeIpInformationIe::~RemoteUeIpInformationIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool RemoteUeIpInformationIe::encodeRemoteUeIpInformationIe(MsgBuffer &buffer, RemoteUeIpInformationIeData const &data)
+{
+ if (!(buffer.writeUint64(data.remoteUeIpInformation)))
+ {
+ errorStream.add((char *)"Encoding of remoteUeIpInformation failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool RemoteUeIpInformationIe::decodeRemoteUeIpInformationIe(MsgBuffer &buffer, RemoteUeIpInformationIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+
+ buffer.readUint64(data.remoteUeIpInformation);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: remoteUeIpInformation\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE RemoteUeIpInformationIe\n");
+ return false;
+ }
+}
+void RemoteUeIpInformationIe::displayRemoteUeIpInformationIe_v(RemoteUeIpInformationIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"RemoteUeIpInformationIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add((char *)"remoteUeIpInformation: ");
+ stream.add(data.remoteUeIpInformation);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/remoteUeIpInformationIe.h b/src/gtpV2Codec/ieClasses/remoteUeIpInformationIe.h
new file mode 100644
index 0000000..87dd1fc
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/remoteUeIpInformationIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef REMOTEUEIPINFORMATIONIE_H_
+#define REMOTEUEIPINFORMATIONIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class RemoteUeIpInformationIe: public GtpV2Ie {
+public:
+ RemoteUeIpInformationIe();
+ virtual ~RemoteUeIpInformationIe();
+
+ bool encodeRemoteUeIpInformationIe(MsgBuffer &buffer,
+ RemoteUeIpInformationIeData const &data);
+ bool decodeRemoteUeIpInformationIe(MsgBuffer &buffer,
+ RemoteUeIpInformationIeData &data, Uint16 length);
+ void displayRemoteUeIpInformationIe_v(RemoteUeIpInformationIeData const &data,
+ Debug &stream);
+};
+
+#endif /* REMOTEUEIPINFORMATIONIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/remoteUserIdIe.cpp b/src/gtpV2Codec/ieClasses/remoteUserIdIe.cpp
new file mode 100644
index 0000000..c325e0e
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/remoteUserIdIe.cpp
@@ -0,0 +1,197 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "remoteUserIdIe.h"
+#include "dataTypeCodecUtils.h"
+
+RemoteUserIdIe::RemoteUserIdIe()
+{
+ ieType = 192;
+ // TODO
+
+}
+
+RemoteUserIdIe::~RemoteUserIdIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool RemoteUserIdIe::encodeRemoteUserIdIe(MsgBuffer &buffer, RemoteUserIdIeData const &data)
+{
+ buffer.skipBits(6);
+
+ if(!(buffer.writeBits(data.imeifpresent, 1)))
+ {
+ errorStream.add((char *)"Encoding of imeifpresent failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.msisdnfpresent, 1)))
+ {
+ errorStream.add((char *)"Encoding of msisdnfpresent failed\n");
+ return false;
+ }
+ if (!(buffer.writeUint8(data.lengthofIMSI)))
+ {
+ errorStream.add((char *)"Encoding of lengthofIMSI failed\n");
+ return false;
+ }
+ if (!(DataTypeCodecUtils::encodeDigitRegister(buffer, data.imsi)))
+ {
+ errorStream.add((char *)"Encoding of imsi failed\n");
+ return false;
+ }
+ if (!(buffer.writeUint8(data.lengthOfMSISDN)))
+ {
+ errorStream.add((char *)"Encoding of lengthOfMSISDN failed\n");
+ return false;
+ }
+ if (!(DataTypeCodecUtils::encodeDigitRegister(buffer, data.msisdn)))
+ {
+ errorStream.add((char *)"Encoding of msisdn failed\n");
+ return false;
+ }
+ if (!(buffer.writeUint8(data.lengthOfIMEI)))
+ {
+ errorStream.add((char *)"Encoding of lengthOfIMEI failed\n");
+ return false;
+ }
+ if (!(DataTypeCodecUtils::encodeDigitRegister(buffer, data.imei)))
+ {
+ errorStream.add((char *)"Encoding of imei failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool RemoteUserIdIe::decodeRemoteUserIdIe(MsgBuffer &buffer, RemoteUserIdIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+ buffer.skipBits(6);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: \n");
+ return false;
+ }
+
+ data.imeifpresent = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: imeifpresent\n");
+ return false;
+ }
+ data.msisdnfpresent = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: msisdnfpresent\n");
+ return false;
+ }
+
+ buffer.readUint8(data.lengthofIMSI);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: lengthofIMSI\n");
+ return false;
+ }
+
+ Uint16 lengthLeft = length;
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeDigitRegister(buffer, data.imsi, lengthLeft)))
+ {
+ errorStream.add((char *)"Failed to decode: imsi\n");
+ return false;
+ }
+
+ buffer.readUint8(data.lengthOfMSISDN);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: lengthOfMSISDN\n");
+ return false;
+ }
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeDigitRegister(buffer, data.msisdn, lengthLeft)))
+ {
+ errorStream.add((char *)"Failed to decode: msisdn\n");
+ return false;
+ }
+
+ buffer.readUint8(data.lengthOfIMEI);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: lengthOfIMEI\n");
+ return false;
+ }
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeDigitRegister(buffer, data.imei, lengthLeft)))
+ {
+ errorStream.add((char *)"Failed to decode: imei\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE RemoteUserIdIe\n");
+ return false;
+ }
+}
+void RemoteUserIdIe::displayRemoteUserIdIe_v(RemoteUserIdIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"RemoteUserIdIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add( (char *)"imeifpresent: ");
+ stream.add((Uint8)data.imeifpresent);
+ stream.endOfLine();
+
+ stream.add( (char *)"msisdnfpresent: ");
+ stream.add((Uint8)data.msisdnfpresent);
+ stream.endOfLine();
+
+ stream.add((char *)"lengthofIMSI: ");
+ stream.add(data.lengthofIMSI);
+ stream.endOfLine();
+
+ stream.add((char *)"imsi:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displayDigitRegister_v(data.imsi, stream);
+
+ stream.add((char *)"lengthOfMSISDN: ");
+ stream.add(data.lengthOfMSISDN);
+ stream.endOfLine();
+
+ stream.add((char *)"msisdn:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displayDigitRegister_v(data.msisdn, stream);
+
+ stream.add((char *)"lengthOfIMEI: ");
+ stream.add(data.lengthOfIMEI);
+ stream.endOfLine();
+
+ stream.add((char *)"imei:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displayDigitRegister_v(data.imei, stream);
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/remoteUserIdIe.h b/src/gtpV2Codec/ieClasses/remoteUserIdIe.h
new file mode 100644
index 0000000..02da321
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/remoteUserIdIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef REMOTEUSERIDIE_H_
+#define REMOTEUSERIDIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class RemoteUserIdIe: public GtpV2Ie {
+public:
+ RemoteUserIdIe();
+ virtual ~RemoteUserIdIe();
+
+ bool encodeRemoteUserIdIe(MsgBuffer &buffer,
+ RemoteUserIdIeData const &data);
+ bool decodeRemoteUserIdIe(MsgBuffer &buffer,
+ RemoteUserIdIeData &data, Uint16 length);
+ void displayRemoteUserIdIe_v(RemoteUserIdIeData const &data,
+ Debug &stream);
+};
+
+#endif /* REMOTEUSERIDIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/secondaryRatUsageDataReportIe.cpp b/src/gtpV2Codec/ieClasses/secondaryRatUsageDataReportIe.cpp
new file mode 100644
index 0000000..d99bada
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/secondaryRatUsageDataReportIe.cpp
@@ -0,0 +1,217 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "secondaryRatUsageDataReportIe.h"
+#include "dataTypeCodecUtils.h"
+
+SecondaryRatUsageDataReportIe::SecondaryRatUsageDataReportIe()
+{
+ ieType = 201;
+ // TODO
+
+}
+
+SecondaryRatUsageDataReportIe::~SecondaryRatUsageDataReportIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool SecondaryRatUsageDataReportIe::encodeSecondaryRatUsageDataReportIe(MsgBuffer &buffer, SecondaryRatUsageDataReportIeData const &data)
+{
+ buffer.skipBits(4);
+
+ if(!(buffer.writeBits(data.irsgw, 2)))
+ {
+ errorStream.add((char *)"Encoding of irsgw failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.irpgw, 2)))
+ {
+ errorStream.add((char *)"Encoding of irpgw failed\n");
+ return false;
+ }
+ if (!(data.secondaryRatType== 0 || data.secondaryRatType== 1))
+ {
+ errorStream.add((char *)"Data validation failure: secondaryRatType\n");
+ return false;
+ }
+ if (!(buffer.writeUint8(data.secondaryRatType)))
+ {
+ errorStream.add((char *)"Encoding of secondaryRatType failed\n");
+ return false;
+ }
+ buffer.skipBits(4);
+
+ if(!(buffer.writeBits(data.epsBearerId, 4)))
+ {
+ errorStream.add((char *)"Encoding of epsBearerId failed\n");
+ return false;
+ }
+ if (!(buffer.writeUint32(data.starttimestamp)))
+ {
+ errorStream.add((char *)"Encoding of starttimestamp failed\n");
+ return false;
+ }
+ if (!(buffer.writeUint32(data.endtimestamp)))
+ {
+ errorStream.add((char *)"Encoding of endtimestamp failed\n");
+ return false;
+ }
+ if (!(buffer.writeUint64(data.usageDataDL)))
+ {
+ errorStream.add((char *)"Encoding of usageDataDL failed\n");
+ return false;
+ }
+ if (!(buffer.writeUint64(data.usageDataUL)))
+ {
+ errorStream.add((char *)"Encoding of usageDataUL failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool SecondaryRatUsageDataReportIe::decodeSecondaryRatUsageDataReportIe(MsgBuffer &buffer, SecondaryRatUsageDataReportIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+ buffer.skipBits(4);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: \n");
+ return false;
+ }
+
+ data.irsgw = buffer.readBits(2);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: irsgw\n");
+ return false;
+ }
+ data.irpgw = buffer.readBits(2);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: irpgw\n");
+ return false;
+ }
+
+ buffer.readUint8(data.secondaryRatType);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: secondaryRatType\n");
+ return false;
+ }
+ if (!(data.secondaryRatType== 0 || data.secondaryRatType== 1))
+ {
+ errorStream.add((char *)"Data validation failure : secondaryRatType\n");
+ return false; //TODO need to add validations
+ }
+ buffer.skipBits(4);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: \n");
+ return false;
+ }
+
+ data.epsBearerId = buffer.readBits(4);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: epsBearerId\n");
+ return false;
+ }
+
+ buffer.readUint32(data.starttimestamp);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: starttimestamp\n");
+ return false;
+ }
+
+ buffer.readUint32(data.endtimestamp);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: endtimestamp\n");
+ return false;
+ }
+
+ buffer.readUint64(data.usageDataDL);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: usageDataDL\n");
+ return false;
+ }
+
+ buffer.readUint64(data.usageDataUL);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: usageDataUL\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE SecondaryRatUsageDataReportIe\n");
+ return false;
+ }
+}
+void SecondaryRatUsageDataReportIe::displaySecondaryRatUsageDataReportIe_v(SecondaryRatUsageDataReportIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"SecondaryRatUsageDataReportIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add( (char *)"irsgw: ");
+ stream.add((Uint8)data.irsgw);
+ stream.endOfLine();
+
+ stream.add( (char *)"irpgw: ");
+ stream.add((Uint8)data.irpgw);
+ stream.endOfLine();
+
+ stream.add((char *)"secondaryRatType: ");
+ stream.add(data.secondaryRatType);
+ stream.endOfLine();
+
+ stream.add( (char *)"epsBearerId: ");
+ stream.add((Uint8)data.epsBearerId);
+ stream.endOfLine();
+
+ stream.add((char *)"starttimestamp: ");
+ stream.add(data.starttimestamp);
+ stream.endOfLine();
+
+ stream.add((char *)"endtimestamp: ");
+ stream.add(data.endtimestamp);
+ stream.endOfLine();
+
+ stream.add((char *)"usageDataDL: ");
+ stream.add(data.usageDataDL);
+ stream.endOfLine();
+
+ stream.add((char *)"usageDataUL: ");
+ stream.add(data.usageDataUL);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/secondaryRatUsageDataReportIe.h b/src/gtpV2Codec/ieClasses/secondaryRatUsageDataReportIe.h
new file mode 100644
index 0000000..e259431
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/secondaryRatUsageDataReportIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef SECONDARYRATUSAGEDATAREPORTIE_H_
+#define SECONDARYRATUSAGEDATAREPORTIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class SecondaryRatUsageDataReportIe: public GtpV2Ie {
+public:
+ SecondaryRatUsageDataReportIe();
+ virtual ~SecondaryRatUsageDataReportIe();
+
+ bool encodeSecondaryRatUsageDataReportIe(MsgBuffer &buffer,
+ SecondaryRatUsageDataReportIeData const &data);
+ bool decodeSecondaryRatUsageDataReportIe(MsgBuffer &buffer,
+ SecondaryRatUsageDataReportIeData &data, Uint16 length);
+ void displaySecondaryRatUsageDataReportIe_v(SecondaryRatUsageDataReportIeData const &data,
+ Debug &stream);
+};
+
+#endif /* SECONDARYRATUSAGEDATAREPORTIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/selectionModeIe.cpp b/src/gtpV2Codec/ieClasses/selectionModeIe.cpp
new file mode 100644
index 0000000..747730c
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/selectionModeIe.cpp
@@ -0,0 +1,86 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "selectionModeIe.h"
+#include "dataTypeCodecUtils.h"
+
+SelectionModeIe::SelectionModeIe()
+{
+ ieType = 128;
+ // TODO
+
+}
+
+SelectionModeIe::~SelectionModeIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool SelectionModeIe::encodeSelectionModeIe(MsgBuffer &buffer, SelectionModeIeData const &data)
+{
+ buffer.skipBits(6);
+
+ if(!(buffer.writeBits(data.selectionMode, 2)))
+ {
+ errorStream.add((char *)"Encoding of selectionMode failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool SelectionModeIe::decodeSelectionModeIe(MsgBuffer &buffer, SelectionModeIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+ buffer.skipBits(6);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: \n");
+ return false;
+ }
+
+ data.selectionMode = buffer.readBits(2);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: selectionMode\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE SelectionModeIe\n");
+ return false;
+ }
+}
+void SelectionModeIe::displaySelectionModeIe_v(SelectionModeIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"SelectionModeIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add( (char *)"selectionMode: ");
+ stream.add((Uint8)data.selectionMode);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/selectionModeIe.h b/src/gtpV2Codec/ieClasses/selectionModeIe.h
new file mode 100644
index 0000000..1b74ad6
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/selectionModeIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef SELECTIONMODEIE_H_
+#define SELECTIONMODEIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class SelectionModeIe: public GtpV2Ie {
+public:
+ SelectionModeIe();
+ virtual ~SelectionModeIe();
+
+ bool encodeSelectionModeIe(MsgBuffer &buffer,
+ SelectionModeIeData const &data);
+ bool decodeSelectionModeIe(MsgBuffer &buffer,
+ SelectionModeIeData &data, Uint16 length);
+ void displaySelectionModeIe_v(SelectionModeIeData const &data,
+ Debug &stream);
+};
+
+#endif /* SELECTIONMODEIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/sequenceNumberIe.cpp b/src/gtpV2Codec/ieClasses/sequenceNumberIe.cpp
new file mode 100644
index 0000000..2126dad
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/sequenceNumberIe.cpp
@@ -0,0 +1,77 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "sequenceNumberIe.h"
+#include "dataTypeCodecUtils.h"
+
+SequenceNumberIe::SequenceNumberIe()
+{
+ ieType = 183;
+ // TODO
+
+}
+
+SequenceNumberIe::~SequenceNumberIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool SequenceNumberIe::encodeSequenceNumberIe(MsgBuffer &buffer, SequenceNumberIeData const &data)
+{
+ if (!(buffer.writeUint32(data.sequenceNumber)))
+ {
+ errorStream.add((char *)"Encoding of sequenceNumber failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool SequenceNumberIe::decodeSequenceNumberIe(MsgBuffer &buffer, SequenceNumberIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+
+ buffer.readUint32(data.sequenceNumber);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: sequenceNumber\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE SequenceNumberIe\n");
+ return false;
+ }
+}
+void SequenceNumberIe::displaySequenceNumberIe_v(SequenceNumberIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"SequenceNumberIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add((char *)"sequenceNumber: ");
+ stream.add(data.sequenceNumber);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/sequenceNumberIe.h b/src/gtpV2Codec/ieClasses/sequenceNumberIe.h
new file mode 100644
index 0000000..07066ca
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/sequenceNumberIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef SEQUENCENUMBERIE_H_
+#define SEQUENCENUMBERIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class SequenceNumberIe: public GtpV2Ie {
+public:
+ SequenceNumberIe();
+ virtual ~SequenceNumberIe();
+
+ bool encodeSequenceNumberIe(MsgBuffer &buffer,
+ SequenceNumberIeData const &data);
+ bool decodeSequenceNumberIe(MsgBuffer &buffer,
+ SequenceNumberIeData &data, Uint16 length);
+ void displaySequenceNumberIe_v(SequenceNumberIeData const &data,
+ Debug &stream);
+};
+
+#endif /* SEQUENCENUMBERIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/servingNetworkIe.cpp b/src/gtpV2Codec/ieClasses/servingNetworkIe.cpp
new file mode 100644
index 0000000..fbbb73b
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/servingNetworkIe.cpp
@@ -0,0 +1,157 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "servingNetworkIe.h"
+#include "dataTypeCodecUtils.h"
+
+ServingNetworkIe::ServingNetworkIe()
+{
+ ieType = 83;
+ // TODO
+
+}
+
+ServingNetworkIe::~ServingNetworkIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool ServingNetworkIe::encodeServingNetworkIe(MsgBuffer &buffer, ServingNetworkIeData const &data)
+{
+ if(!(buffer.writeBits(data.mccDigit2, 4)))
+ {
+ errorStream.add((char *)"Encoding of mccDigit2 failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.mccDigit1, 4)))
+ {
+ errorStream.add((char *)"Encoding of mccDigit1 failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.mncDigit3, 4)))
+ {
+ errorStream.add((char *)"Encoding of mncDigit3 failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.mccDigit3, 4)))
+ {
+ errorStream.add((char *)"Encoding of mccDigit3 failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.mncDigit2, 4)))
+ {
+ errorStream.add((char *)"Encoding of mncDigit2 failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.mncDigit1, 4)))
+ {
+ errorStream.add((char *)"Encoding of mncDigit1 failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool ServingNetworkIe::decodeServingNetworkIe(MsgBuffer &buffer, ServingNetworkIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+ data.mccDigit2 = buffer.readBits(4);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: mccDigit2\n");
+ return false;
+ }
+ data.mccDigit1 = buffer.readBits(4);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: mccDigit1\n");
+ return false;
+ }
+ data.mncDigit3 = buffer.readBits(4);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: mncDigit3\n");
+ return false;
+ }
+ data.mccDigit3 = buffer.readBits(4);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: mccDigit3\n");
+ return false;
+ }
+ data.mncDigit2 = buffer.readBits(4);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: mncDigit2\n");
+ return false;
+ }
+ data.mncDigit1 = buffer.readBits(4);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: mncDigit1\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE ServingNetworkIe\n");
+ return false;
+ }
+}
+void ServingNetworkIe::displayServingNetworkIe_v(ServingNetworkIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"ServingNetworkIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add( (char *)"mccDigit2: ");
+ stream.add((Uint8)data.mccDigit2);
+ stream.endOfLine();
+
+ stream.add( (char *)"mccDigit1: ");
+ stream.add((Uint8)data.mccDigit1);
+ stream.endOfLine();
+
+ stream.add( (char *)"mncDigit3: ");
+ stream.add((Uint8)data.mncDigit3);
+ stream.endOfLine();
+
+ stream.add( (char *)"mccDigit3: ");
+ stream.add((Uint8)data.mccDigit3);
+ stream.endOfLine();
+
+ stream.add( (char *)"mncDigit2: ");
+ stream.add((Uint8)data.mncDigit2);
+ stream.endOfLine();
+
+ stream.add( (char *)"mncDigit1: ");
+ stream.add((Uint8)data.mncDigit1);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/servingNetworkIe.h b/src/gtpV2Codec/ieClasses/servingNetworkIe.h
new file mode 100644
index 0000000..5aebc89
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/servingNetworkIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef SERVINGNETWORKIE_H_
+#define SERVINGNETWORKIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class ServingNetworkIe: public GtpV2Ie {
+public:
+ ServingNetworkIe();
+ virtual ~ServingNetworkIe();
+
+ bool encodeServingNetworkIe(MsgBuffer &buffer,
+ ServingNetworkIeData const &data);
+ bool decodeServingNetworkIe(MsgBuffer &buffer,
+ ServingNetworkIeData &data, Uint16 length);
+ void displayServingNetworkIe_v(ServingNetworkIeData const &data,
+ Debug &stream);
+};
+
+#endif /* SERVINGNETWORKIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/servingPlmnRateControlIe.cpp b/src/gtpV2Codec/ieClasses/servingPlmnRateControlIe.cpp
new file mode 100644
index 0000000..c4ff183
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/servingPlmnRateControlIe.cpp
@@ -0,0 +1,93 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "servingPlmnRateControlIe.h"
+#include "dataTypeCodecUtils.h"
+
+ServingPlmnRateControlIe::ServingPlmnRateControlIe()
+{
+ ieType = 198;
+ // TODO
+
+}
+
+ServingPlmnRateControlIe::~ServingPlmnRateControlIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool ServingPlmnRateControlIe::encodeServingPlmnRateControlIe(MsgBuffer &buffer, ServingPlmnRateControlIeData const &data)
+{
+ if (!(buffer.writeUint16(data.uplinkRateLimit)))
+ {
+ errorStream.add((char *)"Encoding of uplinkRateLimit failed\n");
+ return false;
+ }
+ if (!(buffer.writeUint16(data.downlinkRateLimit)))
+ {
+ errorStream.add((char *)"Encoding of downlinkRateLimit failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool ServingPlmnRateControlIe::decodeServingPlmnRateControlIe(MsgBuffer &buffer, ServingPlmnRateControlIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+
+ buffer.readUint16(data.uplinkRateLimit);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: uplinkRateLimit\n");
+ return false;
+ }
+
+ buffer.readUint16(data.downlinkRateLimit);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: downlinkRateLimit\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE ServingPlmnRateControlIe\n");
+ return false;
+ }
+}
+void ServingPlmnRateControlIe::displayServingPlmnRateControlIe_v(ServingPlmnRateControlIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"ServingPlmnRateControlIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add((char *)"uplinkRateLimit: ");
+ stream.add(data.uplinkRateLimit);
+ stream.endOfLine();
+
+ stream.add((char *)"downlinkRateLimit: ");
+ stream.add(data.downlinkRateLimit);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/servingPlmnRateControlIe.h b/src/gtpV2Codec/ieClasses/servingPlmnRateControlIe.h
new file mode 100644
index 0000000..fb3cec2
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/servingPlmnRateControlIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef SERVINGPLMNRATECONTROLIE_H_
+#define SERVINGPLMNRATECONTROLIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class ServingPlmnRateControlIe: public GtpV2Ie {
+public:
+ ServingPlmnRateControlIe();
+ virtual ~ServingPlmnRateControlIe();
+
+ bool encodeServingPlmnRateControlIe(MsgBuffer &buffer,
+ ServingPlmnRateControlIeData const &data);
+ bool decodeServingPlmnRateControlIe(MsgBuffer &buffer,
+ ServingPlmnRateControlIeData &data, Uint16 length);
+ void displayServingPlmnRateControlIe_v(ServingPlmnRateControlIeData const &data,
+ Debug &stream);
+};
+
+#endif /* SERVINGPLMNRATECONTROLIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/sgwsNodeLevelLoadControlInformationInCreateBearerRequest.cpp b/src/gtpV2Codec/ieClasses/sgwsNodeLevelLoadControlInformationInCreateBearerRequest.cpp
new file mode 100644
index 0000000..aef23b3
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/sgwsNodeLevelLoadControlInformationInCreateBearerRequest.cpp
@@ -0,0 +1,306 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "sgwsNodeLevelLoadControlInformationInCreateBearerRequest.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+#include "apnAndRelativeCapacityIe.h"
+
+SgwsNodeLevelLoadControlInformationInCreateBearerRequest::
+SgwsNodeLevelLoadControlInformationInCreateBearerRequest()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // loadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // loadMetric
+ mandatoryIeSet.insert(mandIe);
+ mandIe = ApnAndRelativeCapacityIeType;
+ mandIe = (mandIe << 8) | 0; // listOfApnAndRelativeCapacity
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+SgwsNodeLevelLoadControlInformationInCreateBearerRequest::
+~SgwsNodeLevelLoadControlInformationInCreateBearerRequest()
+{
+
+}
+bool SgwsNodeLevelLoadControlInformationInCreateBearerRequest::
+encodeSgwsNodeLevelLoadControlInformationInCreateBearerRequest(MsgBuffer &buffer,
+ SgwsNodeLevelLoadControlInformationInCreateBearerRequestData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.loadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: loadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.loadMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: loadMetric\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = ApnAndRelativeCapacityIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ ApnAndRelativeCapacityIe apnAndRelativeCapacity=
+ dynamic_cast<
+ ApnAndRelativeCapacityIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnAndRelativeCapacityIeType));
+ rc = apnAndRelativeCapacity.encodeApnAndRelativeCapacityIe(buffer, data.listOfApnAndRelativeCapacity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: listOfApnAndRelativeCapacity\n");
+ return false;
+ }
+ return rc;
+}
+
+bool SgwsNodeLevelLoadControlInformationInCreateBearerRequest::
+decodeSgwsNodeLevelLoadControlInformationInCreateBearerRequest(MsgBuffer &buffer,
+ SgwsNodeLevelLoadControlInformationInCreateBearerRequestData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.loadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: loadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.loadMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: loadMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case ApnAndRelativeCapacityIeType:
+ {
+ ApnAndRelativeCapacityIe ieObject =
+ dynamic_cast<
+ ApnAndRelativeCapacityIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(ApnAndRelativeCapacityIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeApnAndRelativeCapacityIe(buffer, data.listOfApnAndRelativeCapacity, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: listOfApnAndRelativeCapacity\n");
+ return false;
+ }
+ Uint16 mandIe = ApnAndRelativeCapacityIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void SgwsNodeLevelLoadControlInformationInCreateBearerRequest::
+displaySgwsNodeLevelLoadControlInformationInCreateBearerRequestData_v
+(SgwsNodeLevelLoadControlInformationInCreateBearerRequestData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"SgwsNodeLevelLoadControlInformationInCreateBearerRequest:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/sgwsNodeLevelLoadControlInformationInCreateBearerRequest.h b/src/gtpV2Codec/ieClasses/sgwsNodeLevelLoadControlInformationInCreateBearerRequest.h
new file mode 100644
index 0000000..a656266
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/sgwsNodeLevelLoadControlInformationInCreateBearerRequest.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef SGWSNODELEVELLOADCONTROLINFORMATIONINCREATEBEARERREQUEST_H_
+#define SGWSNODELEVELLOADCONTROLINFORMATIONINCREATEBEARERREQUEST_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class SgwsNodeLevelLoadControlInformationInCreateBearerRequest:public GtpV2GroupedIe
+{
+public:
+ SgwsNodeLevelLoadControlInformationInCreateBearerRequest();
+ virtual ~SgwsNodeLevelLoadControlInformationInCreateBearerRequest();
+ bool encodeSgwsNodeLevelLoadControlInformationInCreateBearerRequest(MsgBuffer &buffer,
+ SgwsNodeLevelLoadControlInformationInCreateBearerRequestData
+ const &data);
+
+ bool decodeSgwsNodeLevelLoadControlInformationInCreateBearerRequest (MsgBuffer &buffer,
+ SgwsNodeLevelLoadControlInformationInCreateBearerRequestData
+ & data, Uint16 length);
+
+ void displaySgwsNodeLevelLoadControlInformationInCreateBearerRequestData_v
+ (SgwsNodeLevelLoadControlInformationInCreateBearerRequestData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/sgwsNodeLevelLoadControlInformationInCreateSessionResponse.cpp b/src/gtpV2Codec/ieClasses/sgwsNodeLevelLoadControlInformationInCreateSessionResponse.cpp
new file mode 100644
index 0000000..8a866e8
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/sgwsNodeLevelLoadControlInformationInCreateSessionResponse.cpp
@@ -0,0 +1,306 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "sgwsNodeLevelLoadControlInformationInCreateSessionResponse.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+#include "apnAndRelativeCapacityIe.h"
+
+SgwsNodeLevelLoadControlInformationInCreateSessionResponse::
+SgwsNodeLevelLoadControlInformationInCreateSessionResponse()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // loadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // loadMetric
+ mandatoryIeSet.insert(mandIe);
+ mandIe = ApnAndRelativeCapacityIeType;
+ mandIe = (mandIe << 8) | 0; // listOfApnAndRelativeCapacity
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+SgwsNodeLevelLoadControlInformationInCreateSessionResponse::
+~SgwsNodeLevelLoadControlInformationInCreateSessionResponse()
+{
+
+}
+bool SgwsNodeLevelLoadControlInformationInCreateSessionResponse::
+encodeSgwsNodeLevelLoadControlInformationInCreateSessionResponse(MsgBuffer &buffer,
+ SgwsNodeLevelLoadControlInformationInCreateSessionResponseData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.loadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: loadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.loadMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: loadMetric\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = ApnAndRelativeCapacityIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ ApnAndRelativeCapacityIe apnAndRelativeCapacity=
+ dynamic_cast<
+ ApnAndRelativeCapacityIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnAndRelativeCapacityIeType));
+ rc = apnAndRelativeCapacity.encodeApnAndRelativeCapacityIe(buffer, data.listOfApnAndRelativeCapacity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: listOfApnAndRelativeCapacity\n");
+ return false;
+ }
+ return rc;
+}
+
+bool SgwsNodeLevelLoadControlInformationInCreateSessionResponse::
+decodeSgwsNodeLevelLoadControlInformationInCreateSessionResponse(MsgBuffer &buffer,
+ SgwsNodeLevelLoadControlInformationInCreateSessionResponseData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.loadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: loadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.loadMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: loadMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case ApnAndRelativeCapacityIeType:
+ {
+ ApnAndRelativeCapacityIe ieObject =
+ dynamic_cast<
+ ApnAndRelativeCapacityIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(ApnAndRelativeCapacityIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeApnAndRelativeCapacityIe(buffer, data.listOfApnAndRelativeCapacity, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: listOfApnAndRelativeCapacity\n");
+ return false;
+ }
+ Uint16 mandIe = ApnAndRelativeCapacityIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void SgwsNodeLevelLoadControlInformationInCreateSessionResponse::
+displaySgwsNodeLevelLoadControlInformationInCreateSessionResponseData_v
+(SgwsNodeLevelLoadControlInformationInCreateSessionResponseData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"SgwsNodeLevelLoadControlInformationInCreateSessionResponse:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/sgwsNodeLevelLoadControlInformationInCreateSessionResponse.h b/src/gtpV2Codec/ieClasses/sgwsNodeLevelLoadControlInformationInCreateSessionResponse.h
new file mode 100644
index 0000000..da2db48
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/sgwsNodeLevelLoadControlInformationInCreateSessionResponse.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef SGWSNODELEVELLOADCONTROLINFORMATIONINCREATESESSIONRESPONSE_H_
+#define SGWSNODELEVELLOADCONTROLINFORMATIONINCREATESESSIONRESPONSE_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class SgwsNodeLevelLoadControlInformationInCreateSessionResponse:public GtpV2GroupedIe
+{
+public:
+ SgwsNodeLevelLoadControlInformationInCreateSessionResponse();
+ virtual ~SgwsNodeLevelLoadControlInformationInCreateSessionResponse();
+ bool encodeSgwsNodeLevelLoadControlInformationInCreateSessionResponse(MsgBuffer &buffer,
+ SgwsNodeLevelLoadControlInformationInCreateSessionResponseData
+ const &data);
+
+ bool decodeSgwsNodeLevelLoadControlInformationInCreateSessionResponse (MsgBuffer &buffer,
+ SgwsNodeLevelLoadControlInformationInCreateSessionResponseData
+ & data, Uint16 length);
+
+ void displaySgwsNodeLevelLoadControlInformationInCreateSessionResponseData_v
+ (SgwsNodeLevelLoadControlInformationInCreateSessionResponseData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/sgwsNodeLevelLoadControlInformationInDeleteBearerRequest.cpp b/src/gtpV2Codec/ieClasses/sgwsNodeLevelLoadControlInformationInDeleteBearerRequest.cpp
new file mode 100644
index 0000000..810d6fa
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/sgwsNodeLevelLoadControlInformationInDeleteBearerRequest.cpp
@@ -0,0 +1,315 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "sgwsNodeLevelLoadControlInformationInDeleteBearerRequest.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+#include "apnAndRelativeCapacityIe.h"
+
+SgwsNodeLevelLoadControlInformationInDeleteBearerRequest::
+SgwsNodeLevelLoadControlInformationInDeleteBearerRequest()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // loadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // loadMetric
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+SgwsNodeLevelLoadControlInformationInDeleteBearerRequest::
+~SgwsNodeLevelLoadControlInformationInDeleteBearerRequest()
+{
+
+}
+bool SgwsNodeLevelLoadControlInformationInDeleteBearerRequest::
+encodeSgwsNodeLevelLoadControlInformationInDeleteBearerRequest(MsgBuffer &buffer,
+ SgwsNodeLevelLoadControlInformationInDeleteBearerRequestData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.loadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: loadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.loadMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: loadMetric\n");
+ return false;
+ }
+
+ if (data.listOfApnAndRelativeCapacityIePresent)
+ {
+
+ // Encode the Ie Header
+ header.ieType = ApnAndRelativeCapacityIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ ApnAndRelativeCapacityIe apnAndRelativeCapacity=
+ dynamic_cast<
+ ApnAndRelativeCapacityIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnAndRelativeCapacityIeType));
+ rc = apnAndRelativeCapacity.encodeApnAndRelativeCapacityIe(buffer, data.listOfApnAndRelativeCapacity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: listOfApnAndRelativeCapacity\n");
+ return false;
+ }
+ }
+ return rc;
+}
+
+bool SgwsNodeLevelLoadControlInformationInDeleteBearerRequest::
+decodeSgwsNodeLevelLoadControlInformationInDeleteBearerRequest(MsgBuffer &buffer,
+ SgwsNodeLevelLoadControlInformationInDeleteBearerRequestData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.loadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: loadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.loadMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: loadMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case ApnAndRelativeCapacityIeType:
+ {
+ ApnAndRelativeCapacityIe ieObject =
+ dynamic_cast<
+ ApnAndRelativeCapacityIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(ApnAndRelativeCapacityIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeApnAndRelativeCapacityIe(buffer, data.listOfApnAndRelativeCapacity, ieHeader.length);
+
+ data.listOfApnAndRelativeCapacityIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: listOfApnAndRelativeCapacity\n");
+ return false;
+ }
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void SgwsNodeLevelLoadControlInformationInDeleteBearerRequest::
+displaySgwsNodeLevelLoadControlInformationInDeleteBearerRequestData_v
+(SgwsNodeLevelLoadControlInformationInDeleteBearerRequestData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"SgwsNodeLevelLoadControlInformationInDeleteBearerRequest:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+ if (data.listOfApnAndRelativeCapacityIePresent)
+ {
+
+ stream.add((char *)"listOfApnAndRelativeCapacity:");
+ stream.endOfLine();
+ ApnAndRelativeCapacityIe apnAndRelativeCapacity=
+ dynamic_cast<
+ ApnAndRelativeCapacityIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnAndRelativeCapacityIeType));
+ apnAndRelativeCapacity.displayApnAndRelativeCapacityIe_v(data.listOfApnAndRelativeCapacity, stream);
+
+ }
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/sgwsNodeLevelLoadControlInformationInDeleteBearerRequest.h b/src/gtpV2Codec/ieClasses/sgwsNodeLevelLoadControlInformationInDeleteBearerRequest.h
new file mode 100644
index 0000000..66062e4
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/sgwsNodeLevelLoadControlInformationInDeleteBearerRequest.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef SGWSNODELEVELLOADCONTROLINFORMATIONINDELETEBEARERREQUEST_H_
+#define SGWSNODELEVELLOADCONTROLINFORMATIONINDELETEBEARERREQUEST_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class SgwsNodeLevelLoadControlInformationInDeleteBearerRequest:public GtpV2GroupedIe
+{
+public:
+ SgwsNodeLevelLoadControlInformationInDeleteBearerRequest();
+ virtual ~SgwsNodeLevelLoadControlInformationInDeleteBearerRequest();
+ bool encodeSgwsNodeLevelLoadControlInformationInDeleteBearerRequest(MsgBuffer &buffer,
+ SgwsNodeLevelLoadControlInformationInDeleteBearerRequestData
+ const &data);
+
+ bool decodeSgwsNodeLevelLoadControlInformationInDeleteBearerRequest (MsgBuffer &buffer,
+ SgwsNodeLevelLoadControlInformationInDeleteBearerRequestData
+ & data, Uint16 length);
+
+ void displaySgwsNodeLevelLoadControlInformationInDeleteBearerRequestData_v
+ (SgwsNodeLevelLoadControlInformationInDeleteBearerRequestData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/sgwsNodeLevelLoadControlInformationInDeleteSessionResponse.cpp b/src/gtpV2Codec/ieClasses/sgwsNodeLevelLoadControlInformationInDeleteSessionResponse.cpp
new file mode 100644
index 0000000..78509a1
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/sgwsNodeLevelLoadControlInformationInDeleteSessionResponse.cpp
@@ -0,0 +1,306 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "sgwsNodeLevelLoadControlInformationInDeleteSessionResponse.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+#include "apnAndRelativeCapacityIe.h"
+
+SgwsNodeLevelLoadControlInformationInDeleteSessionResponse::
+SgwsNodeLevelLoadControlInformationInDeleteSessionResponse()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // loadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // loadMetric
+ mandatoryIeSet.insert(mandIe);
+ mandIe = ApnAndRelativeCapacityIeType;
+ mandIe = (mandIe << 8) | 0; // listOfApnAndRelativeCapacity
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+SgwsNodeLevelLoadControlInformationInDeleteSessionResponse::
+~SgwsNodeLevelLoadControlInformationInDeleteSessionResponse()
+{
+
+}
+bool SgwsNodeLevelLoadControlInformationInDeleteSessionResponse::
+encodeSgwsNodeLevelLoadControlInformationInDeleteSessionResponse(MsgBuffer &buffer,
+ SgwsNodeLevelLoadControlInformationInDeleteSessionResponseData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.loadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: loadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.loadMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: loadMetric\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = ApnAndRelativeCapacityIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ ApnAndRelativeCapacityIe apnAndRelativeCapacity=
+ dynamic_cast<
+ ApnAndRelativeCapacityIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnAndRelativeCapacityIeType));
+ rc = apnAndRelativeCapacity.encodeApnAndRelativeCapacityIe(buffer, data.listOfApnAndRelativeCapacity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: listOfApnAndRelativeCapacity\n");
+ return false;
+ }
+ return rc;
+}
+
+bool SgwsNodeLevelLoadControlInformationInDeleteSessionResponse::
+decodeSgwsNodeLevelLoadControlInformationInDeleteSessionResponse(MsgBuffer &buffer,
+ SgwsNodeLevelLoadControlInformationInDeleteSessionResponseData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.loadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: loadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.loadMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: loadMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case ApnAndRelativeCapacityIeType:
+ {
+ ApnAndRelativeCapacityIe ieObject =
+ dynamic_cast<
+ ApnAndRelativeCapacityIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(ApnAndRelativeCapacityIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeApnAndRelativeCapacityIe(buffer, data.listOfApnAndRelativeCapacity, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: listOfApnAndRelativeCapacity\n");
+ return false;
+ }
+ Uint16 mandIe = ApnAndRelativeCapacityIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void SgwsNodeLevelLoadControlInformationInDeleteSessionResponse::
+displaySgwsNodeLevelLoadControlInformationInDeleteSessionResponseData_v
+(SgwsNodeLevelLoadControlInformationInDeleteSessionResponseData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"SgwsNodeLevelLoadControlInformationInDeleteSessionResponse:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/sgwsNodeLevelLoadControlInformationInDeleteSessionResponse.h b/src/gtpV2Codec/ieClasses/sgwsNodeLevelLoadControlInformationInDeleteSessionResponse.h
new file mode 100644
index 0000000..3ffd626
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/sgwsNodeLevelLoadControlInformationInDeleteSessionResponse.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef SGWSNODELEVELLOADCONTROLINFORMATIONINDELETESESSIONRESPONSE_H_
+#define SGWSNODELEVELLOADCONTROLINFORMATIONINDELETESESSIONRESPONSE_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class SgwsNodeLevelLoadControlInformationInDeleteSessionResponse:public GtpV2GroupedIe
+{
+public:
+ SgwsNodeLevelLoadControlInformationInDeleteSessionResponse();
+ virtual ~SgwsNodeLevelLoadControlInformationInDeleteSessionResponse();
+ bool encodeSgwsNodeLevelLoadControlInformationInDeleteSessionResponse(MsgBuffer &buffer,
+ SgwsNodeLevelLoadControlInformationInDeleteSessionResponseData
+ const &data);
+
+ bool decodeSgwsNodeLevelLoadControlInformationInDeleteSessionResponse (MsgBuffer &buffer,
+ SgwsNodeLevelLoadControlInformationInDeleteSessionResponseData
+ & data, Uint16 length);
+
+ void displaySgwsNodeLevelLoadControlInformationInDeleteSessionResponseData_v
+ (SgwsNodeLevelLoadControlInformationInDeleteSessionResponseData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/sgwsNodeLevelLoadControlInformationInDownlinkDataNotification.cpp b/src/gtpV2Codec/ieClasses/sgwsNodeLevelLoadControlInformationInDownlinkDataNotification.cpp
new file mode 100644
index 0000000..f44a6d6
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/sgwsNodeLevelLoadControlInformationInDownlinkDataNotification.cpp
@@ -0,0 +1,244 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "sgwsNodeLevelLoadControlInformationInDownlinkDataNotification.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+
+SgwsNodeLevelLoadControlInformationInDownlinkDataNotification::
+SgwsNodeLevelLoadControlInformationInDownlinkDataNotification()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // loadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // loadMetric
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+SgwsNodeLevelLoadControlInformationInDownlinkDataNotification::
+~SgwsNodeLevelLoadControlInformationInDownlinkDataNotification()
+{
+
+}
+bool SgwsNodeLevelLoadControlInformationInDownlinkDataNotification::
+encodeSgwsNodeLevelLoadControlInformationInDownlinkDataNotification(MsgBuffer &buffer,
+ SgwsNodeLevelLoadControlInformationInDownlinkDataNotificationData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.loadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: loadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.loadMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: loadMetric\n");
+ return false;
+ }
+ return rc;
+}
+
+bool SgwsNodeLevelLoadControlInformationInDownlinkDataNotification::
+decodeSgwsNodeLevelLoadControlInformationInDownlinkDataNotification(MsgBuffer &buffer,
+ SgwsNodeLevelLoadControlInformationInDownlinkDataNotificationData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.loadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: loadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.loadMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: loadMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void SgwsNodeLevelLoadControlInformationInDownlinkDataNotification::
+displaySgwsNodeLevelLoadControlInformationInDownlinkDataNotificationData_v
+(SgwsNodeLevelLoadControlInformationInDownlinkDataNotificationData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"SgwsNodeLevelLoadControlInformationInDownlinkDataNotification:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/sgwsNodeLevelLoadControlInformationInDownlinkDataNotification.h b/src/gtpV2Codec/ieClasses/sgwsNodeLevelLoadControlInformationInDownlinkDataNotification.h
new file mode 100644
index 0000000..b799de8
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/sgwsNodeLevelLoadControlInformationInDownlinkDataNotification.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef SGWSNODELEVELLOADCONTROLINFORMATIONINDOWNLINKDATANOTIFICATION_H_
+#define SGWSNODELEVELLOADCONTROLINFORMATIONINDOWNLINKDATANOTIFICATION_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class SgwsNodeLevelLoadControlInformationInDownlinkDataNotification:public GtpV2GroupedIe
+{
+public:
+ SgwsNodeLevelLoadControlInformationInDownlinkDataNotification();
+ virtual ~SgwsNodeLevelLoadControlInformationInDownlinkDataNotification();
+ bool encodeSgwsNodeLevelLoadControlInformationInDownlinkDataNotification(MsgBuffer &buffer,
+ SgwsNodeLevelLoadControlInformationInDownlinkDataNotificationData
+ const &data);
+
+ bool decodeSgwsNodeLevelLoadControlInformationInDownlinkDataNotification (MsgBuffer &buffer,
+ SgwsNodeLevelLoadControlInformationInDownlinkDataNotificationData
+ & data, Uint16 length);
+
+ void displaySgwsNodeLevelLoadControlInformationInDownlinkDataNotificationData_v
+ (SgwsNodeLevelLoadControlInformationInDownlinkDataNotificationData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/sgwsNodeLevelLoadControlInformationInModifyBearerResponse.cpp b/src/gtpV2Codec/ieClasses/sgwsNodeLevelLoadControlInformationInModifyBearerResponse.cpp
new file mode 100644
index 0000000..b6f7b64
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/sgwsNodeLevelLoadControlInformationInModifyBearerResponse.cpp
@@ -0,0 +1,306 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "sgwsNodeLevelLoadControlInformationInModifyBearerResponse.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+#include "apnAndRelativeCapacityIe.h"
+
+SgwsNodeLevelLoadControlInformationInModifyBearerResponse::
+SgwsNodeLevelLoadControlInformationInModifyBearerResponse()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // loadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // loadMetric
+ mandatoryIeSet.insert(mandIe);
+ mandIe = ApnAndRelativeCapacityIeType;
+ mandIe = (mandIe << 8) | 0; // listOfApnAndRelativeCapacity
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+SgwsNodeLevelLoadControlInformationInModifyBearerResponse::
+~SgwsNodeLevelLoadControlInformationInModifyBearerResponse()
+{
+
+}
+bool SgwsNodeLevelLoadControlInformationInModifyBearerResponse::
+encodeSgwsNodeLevelLoadControlInformationInModifyBearerResponse(MsgBuffer &buffer,
+ SgwsNodeLevelLoadControlInformationInModifyBearerResponseData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.loadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: loadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.loadMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: loadMetric\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = ApnAndRelativeCapacityIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ ApnAndRelativeCapacityIe apnAndRelativeCapacity=
+ dynamic_cast<
+ ApnAndRelativeCapacityIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnAndRelativeCapacityIeType));
+ rc = apnAndRelativeCapacity.encodeApnAndRelativeCapacityIe(buffer, data.listOfApnAndRelativeCapacity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: listOfApnAndRelativeCapacity\n");
+ return false;
+ }
+ return rc;
+}
+
+bool SgwsNodeLevelLoadControlInformationInModifyBearerResponse::
+decodeSgwsNodeLevelLoadControlInformationInModifyBearerResponse(MsgBuffer &buffer,
+ SgwsNodeLevelLoadControlInformationInModifyBearerResponseData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.loadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: loadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.loadMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: loadMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case ApnAndRelativeCapacityIeType:
+ {
+ ApnAndRelativeCapacityIe ieObject =
+ dynamic_cast<
+ ApnAndRelativeCapacityIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(ApnAndRelativeCapacityIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeApnAndRelativeCapacityIe(buffer, data.listOfApnAndRelativeCapacity, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: listOfApnAndRelativeCapacity\n");
+ return false;
+ }
+ Uint16 mandIe = ApnAndRelativeCapacityIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void SgwsNodeLevelLoadControlInformationInModifyBearerResponse::
+displaySgwsNodeLevelLoadControlInformationInModifyBearerResponseData_v
+(SgwsNodeLevelLoadControlInformationInModifyBearerResponseData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"SgwsNodeLevelLoadControlInformationInModifyBearerResponse:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/sgwsNodeLevelLoadControlInformationInModifyBearerResponse.h b/src/gtpV2Codec/ieClasses/sgwsNodeLevelLoadControlInformationInModifyBearerResponse.h
new file mode 100644
index 0000000..46722a6
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/sgwsNodeLevelLoadControlInformationInModifyBearerResponse.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef SGWSNODELEVELLOADCONTROLINFORMATIONINMODIFYBEARERRESPONSE_H_
+#define SGWSNODELEVELLOADCONTROLINFORMATIONINMODIFYBEARERRESPONSE_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class SgwsNodeLevelLoadControlInformationInModifyBearerResponse:public GtpV2GroupedIe
+{
+public:
+ SgwsNodeLevelLoadControlInformationInModifyBearerResponse();
+ virtual ~SgwsNodeLevelLoadControlInformationInModifyBearerResponse();
+ bool encodeSgwsNodeLevelLoadControlInformationInModifyBearerResponse(MsgBuffer &buffer,
+ SgwsNodeLevelLoadControlInformationInModifyBearerResponseData
+ const &data);
+
+ bool decodeSgwsNodeLevelLoadControlInformationInModifyBearerResponse (MsgBuffer &buffer,
+ SgwsNodeLevelLoadControlInformationInModifyBearerResponseData
+ & data, Uint16 length);
+
+ void displaySgwsNodeLevelLoadControlInformationInModifyBearerResponseData_v
+ (SgwsNodeLevelLoadControlInformationInModifyBearerResponseData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/sgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponse.cpp b/src/gtpV2Codec/ieClasses/sgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponse.cpp
new file mode 100644
index 0000000..6d9c55f
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/sgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponse.cpp
@@ -0,0 +1,306 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "sgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponse.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+#include "apnAndRelativeCapacityIe.h"
+
+SgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponse::
+SgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponse()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // loadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // loadMetric
+ mandatoryIeSet.insert(mandIe);
+ mandIe = ApnAndRelativeCapacityIeType;
+ mandIe = (mandIe << 8) | 0; // listOfApnAndRelativeCapacity
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+SgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponse::
+~SgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponse()
+{
+
+}
+bool SgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponse::
+encodeSgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponse(MsgBuffer &buffer,
+ SgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponseData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.loadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: loadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.loadMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: loadMetric\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = ApnAndRelativeCapacityIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ ApnAndRelativeCapacityIe apnAndRelativeCapacity=
+ dynamic_cast<
+ ApnAndRelativeCapacityIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnAndRelativeCapacityIeType));
+ rc = apnAndRelativeCapacity.encodeApnAndRelativeCapacityIe(buffer, data.listOfApnAndRelativeCapacity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: listOfApnAndRelativeCapacity\n");
+ return false;
+ }
+ return rc;
+}
+
+bool SgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponse::
+decodeSgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponse(MsgBuffer &buffer,
+ SgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponseData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.loadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: loadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.loadMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: loadMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case ApnAndRelativeCapacityIeType:
+ {
+ ApnAndRelativeCapacityIe ieObject =
+ dynamic_cast<
+ ApnAndRelativeCapacityIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(ApnAndRelativeCapacityIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeApnAndRelativeCapacityIe(buffer, data.listOfApnAndRelativeCapacity, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: listOfApnAndRelativeCapacity\n");
+ return false;
+ }
+ Uint16 mandIe = ApnAndRelativeCapacityIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void SgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponse::
+displaySgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponseData_v
+(SgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponseData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"SgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponse:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/sgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponse.h b/src/gtpV2Codec/ieClasses/sgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponse.h
new file mode 100644
index 0000000..6e4c39b
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/sgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponse.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef SGWSNODELEVELLOADCONTROLINFORMATIONINRELEASEACCESSBEARERSRESPONSE_H_
+#define SGWSNODELEVELLOADCONTROLINFORMATIONINRELEASEACCESSBEARERSRESPONSE_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class SgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponse:public GtpV2GroupedIe
+{
+public:
+ SgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponse();
+ virtual ~SgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponse();
+ bool encodeSgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponse(MsgBuffer &buffer,
+ SgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponseData
+ const &data);
+
+ bool decodeSgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponse (MsgBuffer &buffer,
+ SgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponseData
+ & data, Uint16 length);
+
+ void displaySgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponseData_v
+ (SgwsNodeLevelLoadControlInformationInReleaseAccessBearersResponseData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInCreateBearerRequest.cpp b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInCreateBearerRequest.cpp
new file mode 100644
index 0000000..41992b9
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInCreateBearerRequest.cpp
@@ -0,0 +1,377 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "sgwsOverloadControlInformationInCreateBearerRequest.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+#include "epcTimerIe.h"
+#include "apnIe.h"
+
+SgwsOverloadControlInformationInCreateBearerRequest::
+SgwsOverloadControlInformationInCreateBearerRequest()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // overloadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // overloadReductionMetric
+ mandatoryIeSet.insert(mandIe);
+ mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0; // periodOfValidity
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+SgwsOverloadControlInformationInCreateBearerRequest::
+~SgwsOverloadControlInformationInCreateBearerRequest()
+{
+
+}
+bool SgwsOverloadControlInformationInCreateBearerRequest::
+encodeSgwsOverloadControlInformationInCreateBearerRequest(MsgBuffer &buffer,
+ SgwsOverloadControlInformationInCreateBearerRequestData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.overloadReductionMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadReductionMetric\n");
+ return false;
+ }
+
+
+
+ // 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.periodOfValidity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: periodOfValidity\n");
+ return false;
+ }
+
+ if (data.listOfAccessPointNameIePresent)
+ {
+
+ // 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.listOfAccessPointName);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: listOfAccessPointName\n");
+ return false;
+ }
+ }
+ return rc;
+}
+
+bool SgwsOverloadControlInformationInCreateBearerRequest::
+decodeSgwsOverloadControlInformationInCreateBearerRequest(MsgBuffer &buffer,
+ SgwsOverloadControlInformationInCreateBearerRequestData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.overloadReductionMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadReductionMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.periodOfValidity, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: periodOfValidity\n");
+ return false;
+ }
+ Uint16 mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.listOfAccessPointName, ieHeader.length);
+
+ data.listOfAccessPointNameIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: listOfAccessPointName\n");
+ return false;
+ }
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void SgwsOverloadControlInformationInCreateBearerRequest::
+displaySgwsOverloadControlInformationInCreateBearerRequestData_v
+(SgwsOverloadControlInformationInCreateBearerRequestData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"SgwsOverloadControlInformationInCreateBearerRequest:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+
+ if (data.listOfAccessPointNameIePresent)
+ {
+
+ stream.add((char *)"listOfAccessPointName:");
+ stream.endOfLine();
+ ApnIe apn=
+ dynamic_cast<
+ ApnIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnIeType));
+ apn.displayApnIe_v(data.listOfAccessPointName, stream);
+
+ }
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInCreateBearerRequest.h b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInCreateBearerRequest.h
new file mode 100644
index 0000000..d0d8e23
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInCreateBearerRequest.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef SGWSOVERLOADCONTROLINFORMATIONINCREATEBEARERREQUEST_H_
+#define SGWSOVERLOADCONTROLINFORMATIONINCREATEBEARERREQUEST_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class SgwsOverloadControlInformationInCreateBearerRequest:public GtpV2GroupedIe
+{
+public:
+ SgwsOverloadControlInformationInCreateBearerRequest();
+ virtual ~SgwsOverloadControlInformationInCreateBearerRequest();
+ bool encodeSgwsOverloadControlInformationInCreateBearerRequest(MsgBuffer &buffer,
+ SgwsOverloadControlInformationInCreateBearerRequestData
+ const &data);
+
+ bool decodeSgwsOverloadControlInformationInCreateBearerRequest (MsgBuffer &buffer,
+ SgwsOverloadControlInformationInCreateBearerRequestData
+ & data, Uint16 length);
+
+ void displaySgwsOverloadControlInformationInCreateBearerRequestData_v
+ (SgwsOverloadControlInformationInCreateBearerRequestData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInCreateBearerResponse.cpp b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInCreateBearerResponse.cpp
new file mode 100644
index 0000000..96769da
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInCreateBearerResponse.cpp
@@ -0,0 +1,306 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "sgwsOverloadControlInformationInCreateBearerResponse.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+#include "epcTimerIe.h"
+
+SgwsOverloadControlInformationInCreateBearerResponse::
+SgwsOverloadControlInformationInCreateBearerResponse()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // overloadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // overloadReductionMetric
+ mandatoryIeSet.insert(mandIe);
+ mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0; // periodOfValidity
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+SgwsOverloadControlInformationInCreateBearerResponse::
+~SgwsOverloadControlInformationInCreateBearerResponse()
+{
+
+}
+bool SgwsOverloadControlInformationInCreateBearerResponse::
+encodeSgwsOverloadControlInformationInCreateBearerResponse(MsgBuffer &buffer,
+ SgwsOverloadControlInformationInCreateBearerResponseData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.overloadReductionMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadReductionMetric\n");
+ return false;
+ }
+
+
+
+ // 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.periodOfValidity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: periodOfValidity\n");
+ return false;
+ }
+ return rc;
+}
+
+bool SgwsOverloadControlInformationInCreateBearerResponse::
+decodeSgwsOverloadControlInformationInCreateBearerResponse(MsgBuffer &buffer,
+ SgwsOverloadControlInformationInCreateBearerResponseData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.overloadReductionMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadReductionMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.periodOfValidity, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: periodOfValidity\n");
+ return false;
+ }
+ Uint16 mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void SgwsOverloadControlInformationInCreateBearerResponse::
+displaySgwsOverloadControlInformationInCreateBearerResponseData_v
+(SgwsOverloadControlInformationInCreateBearerResponseData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"SgwsOverloadControlInformationInCreateBearerResponse:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInCreateBearerResponse.h b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInCreateBearerResponse.h
new file mode 100644
index 0000000..ddb0776
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInCreateBearerResponse.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef SGWSOVERLOADCONTROLINFORMATIONINCREATEBEARERRESPONSE_H_
+#define SGWSOVERLOADCONTROLINFORMATIONINCREATEBEARERRESPONSE_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class SgwsOverloadControlInformationInCreateBearerResponse:public GtpV2GroupedIe
+{
+public:
+ SgwsOverloadControlInformationInCreateBearerResponse();
+ virtual ~SgwsOverloadControlInformationInCreateBearerResponse();
+ bool encodeSgwsOverloadControlInformationInCreateBearerResponse(MsgBuffer &buffer,
+ SgwsOverloadControlInformationInCreateBearerResponseData
+ const &data);
+
+ bool decodeSgwsOverloadControlInformationInCreateBearerResponse (MsgBuffer &buffer,
+ SgwsOverloadControlInformationInCreateBearerResponseData
+ & data, Uint16 length);
+
+ void displaySgwsOverloadControlInformationInCreateBearerResponseData_v
+ (SgwsOverloadControlInformationInCreateBearerResponseData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInCreateSessionRequest.cpp b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInCreateSessionRequest.cpp
new file mode 100644
index 0000000..2cb52ab
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInCreateSessionRequest.cpp
@@ -0,0 +1,306 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "sgwsOverloadControlInformationInCreateSessionRequest.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+#include "epcTimerIe.h"
+
+SgwsOverloadControlInformationInCreateSessionRequest::
+SgwsOverloadControlInformationInCreateSessionRequest()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // overloadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // overloadReductionMetric
+ mandatoryIeSet.insert(mandIe);
+ mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0; // periodOfValidity
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+SgwsOverloadControlInformationInCreateSessionRequest::
+~SgwsOverloadControlInformationInCreateSessionRequest()
+{
+
+}
+bool SgwsOverloadControlInformationInCreateSessionRequest::
+encodeSgwsOverloadControlInformationInCreateSessionRequest(MsgBuffer &buffer,
+ SgwsOverloadControlInformationInCreateSessionRequestData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.overloadReductionMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadReductionMetric\n");
+ return false;
+ }
+
+
+
+ // 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.periodOfValidity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: periodOfValidity\n");
+ return false;
+ }
+ return rc;
+}
+
+bool SgwsOverloadControlInformationInCreateSessionRequest::
+decodeSgwsOverloadControlInformationInCreateSessionRequest(MsgBuffer &buffer,
+ SgwsOverloadControlInformationInCreateSessionRequestData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.overloadReductionMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadReductionMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.periodOfValidity, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: periodOfValidity\n");
+ return false;
+ }
+ Uint16 mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void SgwsOverloadControlInformationInCreateSessionRequest::
+displaySgwsOverloadControlInformationInCreateSessionRequestData_v
+(SgwsOverloadControlInformationInCreateSessionRequestData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"SgwsOverloadControlInformationInCreateSessionRequest:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInCreateSessionRequest.h b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInCreateSessionRequest.h
new file mode 100644
index 0000000..761fcb9
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInCreateSessionRequest.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef SGWSOVERLOADCONTROLINFORMATIONINCREATESESSIONREQUEST_H_
+#define SGWSOVERLOADCONTROLINFORMATIONINCREATESESSIONREQUEST_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class SgwsOverloadControlInformationInCreateSessionRequest:public GtpV2GroupedIe
+{
+public:
+ SgwsOverloadControlInformationInCreateSessionRequest();
+ virtual ~SgwsOverloadControlInformationInCreateSessionRequest();
+ bool encodeSgwsOverloadControlInformationInCreateSessionRequest(MsgBuffer &buffer,
+ SgwsOverloadControlInformationInCreateSessionRequestData
+ const &data);
+
+ bool decodeSgwsOverloadControlInformationInCreateSessionRequest (MsgBuffer &buffer,
+ SgwsOverloadControlInformationInCreateSessionRequestData
+ & data, Uint16 length);
+
+ void displaySgwsOverloadControlInformationInCreateSessionRequestData_v
+ (SgwsOverloadControlInformationInCreateSessionRequestData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInCreateSessionResponse.cpp b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInCreateSessionResponse.cpp
new file mode 100644
index 0000000..83eddb8
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInCreateSessionResponse.cpp
@@ -0,0 +1,377 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "sgwsOverloadControlInformationInCreateSessionResponse.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+#include "epcTimerIe.h"
+#include "apnIe.h"
+
+SgwsOverloadControlInformationInCreateSessionResponse::
+SgwsOverloadControlInformationInCreateSessionResponse()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // overloadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // overloadReductionMetric
+ mandatoryIeSet.insert(mandIe);
+ mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0; // periodOfValidity
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+SgwsOverloadControlInformationInCreateSessionResponse::
+~SgwsOverloadControlInformationInCreateSessionResponse()
+{
+
+}
+bool SgwsOverloadControlInformationInCreateSessionResponse::
+encodeSgwsOverloadControlInformationInCreateSessionResponse(MsgBuffer &buffer,
+ SgwsOverloadControlInformationInCreateSessionResponseData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.overloadReductionMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadReductionMetric\n");
+ return false;
+ }
+
+
+
+ // 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.periodOfValidity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: periodOfValidity\n");
+ return false;
+ }
+
+ if (data.listOfAccessPointNameIePresent)
+ {
+
+ // 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.listOfAccessPointName);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: listOfAccessPointName\n");
+ return false;
+ }
+ }
+ return rc;
+}
+
+bool SgwsOverloadControlInformationInCreateSessionResponse::
+decodeSgwsOverloadControlInformationInCreateSessionResponse(MsgBuffer &buffer,
+ SgwsOverloadControlInformationInCreateSessionResponseData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.overloadReductionMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadReductionMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.periodOfValidity, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: periodOfValidity\n");
+ return false;
+ }
+ Uint16 mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.listOfAccessPointName, ieHeader.length);
+
+ data.listOfAccessPointNameIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: listOfAccessPointName\n");
+ return false;
+ }
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void SgwsOverloadControlInformationInCreateSessionResponse::
+displaySgwsOverloadControlInformationInCreateSessionResponseData_v
+(SgwsOverloadControlInformationInCreateSessionResponseData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"SgwsOverloadControlInformationInCreateSessionResponse:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+
+ if (data.listOfAccessPointNameIePresent)
+ {
+
+ stream.add((char *)"listOfAccessPointName:");
+ stream.endOfLine();
+ ApnIe apn=
+ dynamic_cast<
+ ApnIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnIeType));
+ apn.displayApnIe_v(data.listOfAccessPointName, stream);
+
+ }
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInCreateSessionResponse.h b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInCreateSessionResponse.h
new file mode 100644
index 0000000..b07b1e8
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInCreateSessionResponse.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef SGWSOVERLOADCONTROLINFORMATIONINCREATESESSIONRESPONSE_H_
+#define SGWSOVERLOADCONTROLINFORMATIONINCREATESESSIONRESPONSE_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class SgwsOverloadControlInformationInCreateSessionResponse:public GtpV2GroupedIe
+{
+public:
+ SgwsOverloadControlInformationInCreateSessionResponse();
+ virtual ~SgwsOverloadControlInformationInCreateSessionResponse();
+ bool encodeSgwsOverloadControlInformationInCreateSessionResponse(MsgBuffer &buffer,
+ SgwsOverloadControlInformationInCreateSessionResponseData
+ const &data);
+
+ bool decodeSgwsOverloadControlInformationInCreateSessionResponse (MsgBuffer &buffer,
+ SgwsOverloadControlInformationInCreateSessionResponseData
+ & data, Uint16 length);
+
+ void displaySgwsOverloadControlInformationInCreateSessionResponseData_v
+ (SgwsOverloadControlInformationInCreateSessionResponseData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInDeleteBearerRequest.cpp b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInDeleteBearerRequest.cpp
new file mode 100644
index 0000000..841836c
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInDeleteBearerRequest.cpp
@@ -0,0 +1,377 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "sgwsOverloadControlInformationInDeleteBearerRequest.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+#include "epcTimerIe.h"
+#include "apnIe.h"
+
+SgwsOverloadControlInformationInDeleteBearerRequest::
+SgwsOverloadControlInformationInDeleteBearerRequest()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // overloadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // overloadReductionMetric
+ mandatoryIeSet.insert(mandIe);
+ mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0; // periodOfValidity
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+SgwsOverloadControlInformationInDeleteBearerRequest::
+~SgwsOverloadControlInformationInDeleteBearerRequest()
+{
+
+}
+bool SgwsOverloadControlInformationInDeleteBearerRequest::
+encodeSgwsOverloadControlInformationInDeleteBearerRequest(MsgBuffer &buffer,
+ SgwsOverloadControlInformationInDeleteBearerRequestData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.overloadReductionMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadReductionMetric\n");
+ return false;
+ }
+
+
+
+ // 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.periodOfValidity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: periodOfValidity\n");
+ return false;
+ }
+
+ if (data.listOfAccessPointNameIePresent)
+ {
+
+ // 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.listOfAccessPointName);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: listOfAccessPointName\n");
+ return false;
+ }
+ }
+ return rc;
+}
+
+bool SgwsOverloadControlInformationInDeleteBearerRequest::
+decodeSgwsOverloadControlInformationInDeleteBearerRequest(MsgBuffer &buffer,
+ SgwsOverloadControlInformationInDeleteBearerRequestData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.overloadReductionMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadReductionMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.periodOfValidity, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: periodOfValidity\n");
+ return false;
+ }
+ Uint16 mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.listOfAccessPointName, ieHeader.length);
+
+ data.listOfAccessPointNameIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: listOfAccessPointName\n");
+ return false;
+ }
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void SgwsOverloadControlInformationInDeleteBearerRequest::
+displaySgwsOverloadControlInformationInDeleteBearerRequestData_v
+(SgwsOverloadControlInformationInDeleteBearerRequestData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"SgwsOverloadControlInformationInDeleteBearerRequest:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+
+ if (data.listOfAccessPointNameIePresent)
+ {
+
+ stream.add((char *)"listOfAccessPointName:");
+ stream.endOfLine();
+ ApnIe apn=
+ dynamic_cast<
+ ApnIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnIeType));
+ apn.displayApnIe_v(data.listOfAccessPointName, stream);
+
+ }
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInDeleteBearerRequest.h b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInDeleteBearerRequest.h
new file mode 100644
index 0000000..6406829
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInDeleteBearerRequest.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef SGWSOVERLOADCONTROLINFORMATIONINDELETEBEARERREQUEST_H_
+#define SGWSOVERLOADCONTROLINFORMATIONINDELETEBEARERREQUEST_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class SgwsOverloadControlInformationInDeleteBearerRequest:public GtpV2GroupedIe
+{
+public:
+ SgwsOverloadControlInformationInDeleteBearerRequest();
+ virtual ~SgwsOverloadControlInformationInDeleteBearerRequest();
+ bool encodeSgwsOverloadControlInformationInDeleteBearerRequest(MsgBuffer &buffer,
+ SgwsOverloadControlInformationInDeleteBearerRequestData
+ const &data);
+
+ bool decodeSgwsOverloadControlInformationInDeleteBearerRequest (MsgBuffer &buffer,
+ SgwsOverloadControlInformationInDeleteBearerRequestData
+ & data, Uint16 length);
+
+ void displaySgwsOverloadControlInformationInDeleteBearerRequestData_v
+ (SgwsOverloadControlInformationInDeleteBearerRequestData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInDeleteBearerResponse.cpp b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInDeleteBearerResponse.cpp
new file mode 100644
index 0000000..71b14d7
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInDeleteBearerResponse.cpp
@@ -0,0 +1,306 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "sgwsOverloadControlInformationInDeleteBearerResponse.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+#include "epcTimerIe.h"
+
+SgwsOverloadControlInformationInDeleteBearerResponse::
+SgwsOverloadControlInformationInDeleteBearerResponse()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // overloadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // overloadReductionMetric
+ mandatoryIeSet.insert(mandIe);
+ mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0; // periodOfValidity
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+SgwsOverloadControlInformationInDeleteBearerResponse::
+~SgwsOverloadControlInformationInDeleteBearerResponse()
+{
+
+}
+bool SgwsOverloadControlInformationInDeleteBearerResponse::
+encodeSgwsOverloadControlInformationInDeleteBearerResponse(MsgBuffer &buffer,
+ SgwsOverloadControlInformationInDeleteBearerResponseData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.overloadReductionMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadReductionMetric\n");
+ return false;
+ }
+
+
+
+ // 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.periodOfValidity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: periodOfValidity\n");
+ return false;
+ }
+ return rc;
+}
+
+bool SgwsOverloadControlInformationInDeleteBearerResponse::
+decodeSgwsOverloadControlInformationInDeleteBearerResponse(MsgBuffer &buffer,
+ SgwsOverloadControlInformationInDeleteBearerResponseData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.overloadReductionMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadReductionMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.periodOfValidity, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: periodOfValidity\n");
+ return false;
+ }
+ Uint16 mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void SgwsOverloadControlInformationInDeleteBearerResponse::
+displaySgwsOverloadControlInformationInDeleteBearerResponseData_v
+(SgwsOverloadControlInformationInDeleteBearerResponseData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"SgwsOverloadControlInformationInDeleteBearerResponse:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInDeleteBearerResponse.h b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInDeleteBearerResponse.h
new file mode 100644
index 0000000..7757c99
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInDeleteBearerResponse.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef SGWSOVERLOADCONTROLINFORMATIONINDELETEBEARERRESPONSE_H_
+#define SGWSOVERLOADCONTROLINFORMATIONINDELETEBEARERRESPONSE_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class SgwsOverloadControlInformationInDeleteBearerResponse:public GtpV2GroupedIe
+{
+public:
+ SgwsOverloadControlInformationInDeleteBearerResponse();
+ virtual ~SgwsOverloadControlInformationInDeleteBearerResponse();
+ bool encodeSgwsOverloadControlInformationInDeleteBearerResponse(MsgBuffer &buffer,
+ SgwsOverloadControlInformationInDeleteBearerResponseData
+ const &data);
+
+ bool decodeSgwsOverloadControlInformationInDeleteBearerResponse (MsgBuffer &buffer,
+ SgwsOverloadControlInformationInDeleteBearerResponseData
+ & data, Uint16 length);
+
+ void displaySgwsOverloadControlInformationInDeleteBearerResponseData_v
+ (SgwsOverloadControlInformationInDeleteBearerResponseData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInDeleteSessionRequest.cpp b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInDeleteSessionRequest.cpp
new file mode 100644
index 0000000..ed95246
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInDeleteSessionRequest.cpp
@@ -0,0 +1,306 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "sgwsOverloadControlInformationInDeleteSessionRequest.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+#include "epcTimerIe.h"
+
+SgwsOverloadControlInformationInDeleteSessionRequest::
+SgwsOverloadControlInformationInDeleteSessionRequest()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // overloadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // overloadReductionMetric
+ mandatoryIeSet.insert(mandIe);
+ mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0; // periodOfValidity
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+SgwsOverloadControlInformationInDeleteSessionRequest::
+~SgwsOverloadControlInformationInDeleteSessionRequest()
+{
+
+}
+bool SgwsOverloadControlInformationInDeleteSessionRequest::
+encodeSgwsOverloadControlInformationInDeleteSessionRequest(MsgBuffer &buffer,
+ SgwsOverloadControlInformationInDeleteSessionRequestData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.overloadReductionMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadReductionMetric\n");
+ return false;
+ }
+
+
+
+ // 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.periodOfValidity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: periodOfValidity\n");
+ return false;
+ }
+ return rc;
+}
+
+bool SgwsOverloadControlInformationInDeleteSessionRequest::
+decodeSgwsOverloadControlInformationInDeleteSessionRequest(MsgBuffer &buffer,
+ SgwsOverloadControlInformationInDeleteSessionRequestData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.overloadReductionMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadReductionMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.periodOfValidity, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: periodOfValidity\n");
+ return false;
+ }
+ Uint16 mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void SgwsOverloadControlInformationInDeleteSessionRequest::
+displaySgwsOverloadControlInformationInDeleteSessionRequestData_v
+(SgwsOverloadControlInformationInDeleteSessionRequestData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"SgwsOverloadControlInformationInDeleteSessionRequest:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInDeleteSessionRequest.h b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInDeleteSessionRequest.h
new file mode 100644
index 0000000..584e2b7
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInDeleteSessionRequest.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef SGWSOVERLOADCONTROLINFORMATIONINDELETESESSIONREQUEST_H_
+#define SGWSOVERLOADCONTROLINFORMATIONINDELETESESSIONREQUEST_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class SgwsOverloadControlInformationInDeleteSessionRequest:public GtpV2GroupedIe
+{
+public:
+ SgwsOverloadControlInformationInDeleteSessionRequest();
+ virtual ~SgwsOverloadControlInformationInDeleteSessionRequest();
+ bool encodeSgwsOverloadControlInformationInDeleteSessionRequest(MsgBuffer &buffer,
+ SgwsOverloadControlInformationInDeleteSessionRequestData
+ const &data);
+
+ bool decodeSgwsOverloadControlInformationInDeleteSessionRequest (MsgBuffer &buffer,
+ SgwsOverloadControlInformationInDeleteSessionRequestData
+ & data, Uint16 length);
+
+ void displaySgwsOverloadControlInformationInDeleteSessionRequestData_v
+ (SgwsOverloadControlInformationInDeleteSessionRequestData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInDeleteSessionResponse.cpp b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInDeleteSessionResponse.cpp
new file mode 100644
index 0000000..45b2a1d
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInDeleteSessionResponse.cpp
@@ -0,0 +1,377 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "sgwsOverloadControlInformationInDeleteSessionResponse.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+#include "epcTimerIe.h"
+#include "apnIe.h"
+
+SgwsOverloadControlInformationInDeleteSessionResponse::
+SgwsOverloadControlInformationInDeleteSessionResponse()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // overloadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // overloadReductionMetric
+ mandatoryIeSet.insert(mandIe);
+ mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0; // periodOfValidity
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+SgwsOverloadControlInformationInDeleteSessionResponse::
+~SgwsOverloadControlInformationInDeleteSessionResponse()
+{
+
+}
+bool SgwsOverloadControlInformationInDeleteSessionResponse::
+encodeSgwsOverloadControlInformationInDeleteSessionResponse(MsgBuffer &buffer,
+ SgwsOverloadControlInformationInDeleteSessionResponseData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.overloadReductionMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadReductionMetric\n");
+ return false;
+ }
+
+
+
+ // 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.periodOfValidity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: periodOfValidity\n");
+ return false;
+ }
+
+ if (data.listOfAccessPointNameIePresent)
+ {
+
+ // 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.listOfAccessPointName);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: listOfAccessPointName\n");
+ return false;
+ }
+ }
+ return rc;
+}
+
+bool SgwsOverloadControlInformationInDeleteSessionResponse::
+decodeSgwsOverloadControlInformationInDeleteSessionResponse(MsgBuffer &buffer,
+ SgwsOverloadControlInformationInDeleteSessionResponseData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.overloadReductionMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadReductionMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.periodOfValidity, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: periodOfValidity\n");
+ return false;
+ }
+ Uint16 mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.listOfAccessPointName, ieHeader.length);
+
+ data.listOfAccessPointNameIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: listOfAccessPointName\n");
+ return false;
+ }
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void SgwsOverloadControlInformationInDeleteSessionResponse::
+displaySgwsOverloadControlInformationInDeleteSessionResponseData_v
+(SgwsOverloadControlInformationInDeleteSessionResponseData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"SgwsOverloadControlInformationInDeleteSessionResponse:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+
+ if (data.listOfAccessPointNameIePresent)
+ {
+
+ stream.add((char *)"listOfAccessPointName:");
+ stream.endOfLine();
+ ApnIe apn=
+ dynamic_cast<
+ ApnIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnIeType));
+ apn.displayApnIe_v(data.listOfAccessPointName, stream);
+
+ }
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInDeleteSessionResponse.h b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInDeleteSessionResponse.h
new file mode 100644
index 0000000..6bf31ff
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInDeleteSessionResponse.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef SGWSOVERLOADCONTROLINFORMATIONINDELETESESSIONRESPONSE_H_
+#define SGWSOVERLOADCONTROLINFORMATIONINDELETESESSIONRESPONSE_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class SgwsOverloadControlInformationInDeleteSessionResponse:public GtpV2GroupedIe
+{
+public:
+ SgwsOverloadControlInformationInDeleteSessionResponse();
+ virtual ~SgwsOverloadControlInformationInDeleteSessionResponse();
+ bool encodeSgwsOverloadControlInformationInDeleteSessionResponse(MsgBuffer &buffer,
+ SgwsOverloadControlInformationInDeleteSessionResponseData
+ const &data);
+
+ bool decodeSgwsOverloadControlInformationInDeleteSessionResponse (MsgBuffer &buffer,
+ SgwsOverloadControlInformationInDeleteSessionResponseData
+ & data, Uint16 length);
+
+ void displaySgwsOverloadControlInformationInDeleteSessionResponseData_v
+ (SgwsOverloadControlInformationInDeleteSessionResponseData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInDownlinkDataNotification.cpp b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInDownlinkDataNotification.cpp
new file mode 100644
index 0000000..60ecb81
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInDownlinkDataNotification.cpp
@@ -0,0 +1,306 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "sgwsOverloadControlInformationInDownlinkDataNotification.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+#include "epcTimerIe.h"
+
+SgwsOverloadControlInformationInDownlinkDataNotification::
+SgwsOverloadControlInformationInDownlinkDataNotification()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // overloadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // overloadReductionMetric
+ mandatoryIeSet.insert(mandIe);
+ mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0; // periodOfValidity
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+SgwsOverloadControlInformationInDownlinkDataNotification::
+~SgwsOverloadControlInformationInDownlinkDataNotification()
+{
+
+}
+bool SgwsOverloadControlInformationInDownlinkDataNotification::
+encodeSgwsOverloadControlInformationInDownlinkDataNotification(MsgBuffer &buffer,
+ SgwsOverloadControlInformationInDownlinkDataNotificationData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.overloadReductionMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadReductionMetric\n");
+ return false;
+ }
+
+
+
+ // 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.periodOfValidity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: periodOfValidity\n");
+ return false;
+ }
+ return rc;
+}
+
+bool SgwsOverloadControlInformationInDownlinkDataNotification::
+decodeSgwsOverloadControlInformationInDownlinkDataNotification(MsgBuffer &buffer,
+ SgwsOverloadControlInformationInDownlinkDataNotificationData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.overloadReductionMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadReductionMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.periodOfValidity, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: periodOfValidity\n");
+ return false;
+ }
+ Uint16 mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void SgwsOverloadControlInformationInDownlinkDataNotification::
+displaySgwsOverloadControlInformationInDownlinkDataNotificationData_v
+(SgwsOverloadControlInformationInDownlinkDataNotificationData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"SgwsOverloadControlInformationInDownlinkDataNotification:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInDownlinkDataNotification.h b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInDownlinkDataNotification.h
new file mode 100644
index 0000000..75f1733
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInDownlinkDataNotification.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef SGWSOVERLOADCONTROLINFORMATIONINDOWNLINKDATANOTIFICATION_H_
+#define SGWSOVERLOADCONTROLINFORMATIONINDOWNLINKDATANOTIFICATION_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class SgwsOverloadControlInformationInDownlinkDataNotification:public GtpV2GroupedIe
+{
+public:
+ SgwsOverloadControlInformationInDownlinkDataNotification();
+ virtual ~SgwsOverloadControlInformationInDownlinkDataNotification();
+ bool encodeSgwsOverloadControlInformationInDownlinkDataNotification(MsgBuffer &buffer,
+ SgwsOverloadControlInformationInDownlinkDataNotificationData
+ const &data);
+
+ bool decodeSgwsOverloadControlInformationInDownlinkDataNotification (MsgBuffer &buffer,
+ SgwsOverloadControlInformationInDownlinkDataNotificationData
+ & data, Uint16 length);
+
+ void displaySgwsOverloadControlInformationInDownlinkDataNotificationData_v
+ (SgwsOverloadControlInformationInDownlinkDataNotificationData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInModifyBearerRequest.cpp b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInModifyBearerRequest.cpp
new file mode 100644
index 0000000..69e84fd
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInModifyBearerRequest.cpp
@@ -0,0 +1,306 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "sgwsOverloadControlInformationInModifyBearerRequest.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+#include "epcTimerIe.h"
+
+SgwsOverloadControlInformationInModifyBearerRequest::
+SgwsOverloadControlInformationInModifyBearerRequest()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // overloadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // overloadReductionMetric
+ mandatoryIeSet.insert(mandIe);
+ mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0; // periodOfValidity
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+SgwsOverloadControlInformationInModifyBearerRequest::
+~SgwsOverloadControlInformationInModifyBearerRequest()
+{
+
+}
+bool SgwsOverloadControlInformationInModifyBearerRequest::
+encodeSgwsOverloadControlInformationInModifyBearerRequest(MsgBuffer &buffer,
+ SgwsOverloadControlInformationInModifyBearerRequestData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.overloadReductionMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadReductionMetric\n");
+ return false;
+ }
+
+
+
+ // 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.periodOfValidity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: periodOfValidity\n");
+ return false;
+ }
+ return rc;
+}
+
+bool SgwsOverloadControlInformationInModifyBearerRequest::
+decodeSgwsOverloadControlInformationInModifyBearerRequest(MsgBuffer &buffer,
+ SgwsOverloadControlInformationInModifyBearerRequestData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.overloadReductionMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadReductionMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.periodOfValidity, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: periodOfValidity\n");
+ return false;
+ }
+ Uint16 mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void SgwsOverloadControlInformationInModifyBearerRequest::
+displaySgwsOverloadControlInformationInModifyBearerRequestData_v
+(SgwsOverloadControlInformationInModifyBearerRequestData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"SgwsOverloadControlInformationInModifyBearerRequest:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInModifyBearerRequest.h b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInModifyBearerRequest.h
new file mode 100644
index 0000000..442e2ec
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInModifyBearerRequest.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef SGWSOVERLOADCONTROLINFORMATIONINMODIFYBEARERREQUEST_H_
+#define SGWSOVERLOADCONTROLINFORMATIONINMODIFYBEARERREQUEST_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class SgwsOverloadControlInformationInModifyBearerRequest:public GtpV2GroupedIe
+{
+public:
+ SgwsOverloadControlInformationInModifyBearerRequest();
+ virtual ~SgwsOverloadControlInformationInModifyBearerRequest();
+ bool encodeSgwsOverloadControlInformationInModifyBearerRequest(MsgBuffer &buffer,
+ SgwsOverloadControlInformationInModifyBearerRequestData
+ const &data);
+
+ bool decodeSgwsOverloadControlInformationInModifyBearerRequest (MsgBuffer &buffer,
+ SgwsOverloadControlInformationInModifyBearerRequestData
+ & data, Uint16 length);
+
+ void displaySgwsOverloadControlInformationInModifyBearerRequestData_v
+ (SgwsOverloadControlInformationInModifyBearerRequestData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInModifyBearerResponse.cpp b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInModifyBearerResponse.cpp
new file mode 100644
index 0000000..8ce199c
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInModifyBearerResponse.cpp
@@ -0,0 +1,377 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "sgwsOverloadControlInformationInModifyBearerResponse.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+#include "epcTimerIe.h"
+#include "apnIe.h"
+
+SgwsOverloadControlInformationInModifyBearerResponse::
+SgwsOverloadControlInformationInModifyBearerResponse()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // overloadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // overloadReductionMetric
+ mandatoryIeSet.insert(mandIe);
+ mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0; // periodOfValidity
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+SgwsOverloadControlInformationInModifyBearerResponse::
+~SgwsOverloadControlInformationInModifyBearerResponse()
+{
+
+}
+bool SgwsOverloadControlInformationInModifyBearerResponse::
+encodeSgwsOverloadControlInformationInModifyBearerResponse(MsgBuffer &buffer,
+ SgwsOverloadControlInformationInModifyBearerResponseData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.overloadReductionMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadReductionMetric\n");
+ return false;
+ }
+
+
+
+ // 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.periodOfValidity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: periodOfValidity\n");
+ return false;
+ }
+
+ if (data.listOfAccessPointNameIePresent)
+ {
+
+ // 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.listOfAccessPointName);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: listOfAccessPointName\n");
+ return false;
+ }
+ }
+ return rc;
+}
+
+bool SgwsOverloadControlInformationInModifyBearerResponse::
+decodeSgwsOverloadControlInformationInModifyBearerResponse(MsgBuffer &buffer,
+ SgwsOverloadControlInformationInModifyBearerResponseData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.overloadReductionMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadReductionMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.periodOfValidity, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: periodOfValidity\n");
+ return false;
+ }
+ Uint16 mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.listOfAccessPointName, ieHeader.length);
+
+ data.listOfAccessPointNameIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: listOfAccessPointName\n");
+ return false;
+ }
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void SgwsOverloadControlInformationInModifyBearerResponse::
+displaySgwsOverloadControlInformationInModifyBearerResponseData_v
+(SgwsOverloadControlInformationInModifyBearerResponseData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"SgwsOverloadControlInformationInModifyBearerResponse:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+
+ if (data.listOfAccessPointNameIePresent)
+ {
+
+ stream.add((char *)"listOfAccessPointName:");
+ stream.endOfLine();
+ ApnIe apn=
+ dynamic_cast<
+ ApnIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnIeType));
+ apn.displayApnIe_v(data.listOfAccessPointName, stream);
+
+ }
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInModifyBearerResponse.h b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInModifyBearerResponse.h
new file mode 100644
index 0000000..00ea5e5
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInModifyBearerResponse.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef SGWSOVERLOADCONTROLINFORMATIONINMODIFYBEARERRESPONSE_H_
+#define SGWSOVERLOADCONTROLINFORMATIONINMODIFYBEARERRESPONSE_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class SgwsOverloadControlInformationInModifyBearerResponse:public GtpV2GroupedIe
+{
+public:
+ SgwsOverloadControlInformationInModifyBearerResponse();
+ virtual ~SgwsOverloadControlInformationInModifyBearerResponse();
+ bool encodeSgwsOverloadControlInformationInModifyBearerResponse(MsgBuffer &buffer,
+ SgwsOverloadControlInformationInModifyBearerResponseData
+ const &data);
+
+ bool decodeSgwsOverloadControlInformationInModifyBearerResponse (MsgBuffer &buffer,
+ SgwsOverloadControlInformationInModifyBearerResponseData
+ & data, Uint16 length);
+
+ void displaySgwsOverloadControlInformationInModifyBearerResponseData_v
+ (SgwsOverloadControlInformationInModifyBearerResponseData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInReleaseAccessBearersResponse.cpp b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInReleaseAccessBearersResponse.cpp
new file mode 100644
index 0000000..cd3e456
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInReleaseAccessBearersResponse.cpp
@@ -0,0 +1,377 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "sgwsOverloadControlInformationInReleaseAccessBearersResponse.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+#include "epcTimerIe.h"
+#include "apnIe.h"
+
+SgwsOverloadControlInformationInReleaseAccessBearersResponse::
+SgwsOverloadControlInformationInReleaseAccessBearersResponse()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // overloadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // overloadReductionMetric
+ mandatoryIeSet.insert(mandIe);
+ mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0; // periodOfValidity
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+SgwsOverloadControlInformationInReleaseAccessBearersResponse::
+~SgwsOverloadControlInformationInReleaseAccessBearersResponse()
+{
+
+}
+bool SgwsOverloadControlInformationInReleaseAccessBearersResponse::
+encodeSgwsOverloadControlInformationInReleaseAccessBearersResponse(MsgBuffer &buffer,
+ SgwsOverloadControlInformationInReleaseAccessBearersResponseData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.overloadReductionMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadReductionMetric\n");
+ return false;
+ }
+
+
+
+ // 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.periodOfValidity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: periodOfValidity\n");
+ return false;
+ }
+
+ if (data.listOfAccessPointNameIePresent)
+ {
+
+ // 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.listOfAccessPointName);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: listOfAccessPointName\n");
+ return false;
+ }
+ }
+ return rc;
+}
+
+bool SgwsOverloadControlInformationInReleaseAccessBearersResponse::
+decodeSgwsOverloadControlInformationInReleaseAccessBearersResponse(MsgBuffer &buffer,
+ SgwsOverloadControlInformationInReleaseAccessBearersResponseData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.overloadReductionMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadReductionMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.periodOfValidity, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: periodOfValidity\n");
+ return false;
+ }
+ Uint16 mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.listOfAccessPointName, ieHeader.length);
+
+ data.listOfAccessPointNameIePresent = true;
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: listOfAccessPointName\n");
+ return false;
+ }
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void SgwsOverloadControlInformationInReleaseAccessBearersResponse::
+displaySgwsOverloadControlInformationInReleaseAccessBearersResponseData_v
+(SgwsOverloadControlInformationInReleaseAccessBearersResponseData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"SgwsOverloadControlInformationInReleaseAccessBearersResponse:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+
+ if (data.listOfAccessPointNameIePresent)
+ {
+
+ stream.add((char *)"listOfAccessPointName:");
+ stream.endOfLine();
+ ApnIe apn=
+ dynamic_cast<
+ ApnIe&>(GtpV2IeFactory::getInstance().getIeObject(ApnIeType));
+ apn.displayApnIe_v(data.listOfAccessPointName, stream);
+
+ }
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInReleaseAccessBearersResponse.h b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInReleaseAccessBearersResponse.h
new file mode 100644
index 0000000..0ed562e
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/sgwsOverloadControlInformationInReleaseAccessBearersResponse.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef SGWSOVERLOADCONTROLINFORMATIONINRELEASEACCESSBEARERSRESPONSE_H_
+#define SGWSOVERLOADCONTROLINFORMATIONINRELEASEACCESSBEARERSRESPONSE_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class SgwsOverloadControlInformationInReleaseAccessBearersResponse:public GtpV2GroupedIe
+{
+public:
+ SgwsOverloadControlInformationInReleaseAccessBearersResponse();
+ virtual ~SgwsOverloadControlInformationInReleaseAccessBearersResponse();
+ bool encodeSgwsOverloadControlInformationInReleaseAccessBearersResponse(MsgBuffer &buffer,
+ SgwsOverloadControlInformationInReleaseAccessBearersResponseData
+ const &data);
+
+ bool decodeSgwsOverloadControlInformationInReleaseAccessBearersResponse (MsgBuffer &buffer,
+ SgwsOverloadControlInformationInReleaseAccessBearersResponseData
+ & data, Uint16 length);
+
+ void displaySgwsOverloadControlInformationInReleaseAccessBearersResponseData_v
+ (SgwsOverloadControlInformationInReleaseAccessBearersResponseData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/signallingPriorityIndicationIe.cpp b/src/gtpV2Codec/ieClasses/signallingPriorityIndicationIe.cpp
new file mode 100644
index 0000000..a6a1ef7
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/signallingPriorityIndicationIe.cpp
@@ -0,0 +1,70 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "signallingPriorityIndicationIe.h"
+#include "dataTypeCodecUtils.h"
+
+SignallingPriorityIndicationIe::SignallingPriorityIndicationIe()
+{
+ ieType = 157;
+ // TODO
+
+}
+
+SignallingPriorityIndicationIe::~SignallingPriorityIndicationIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool SignallingPriorityIndicationIe::encodeSignallingPriorityIndicationIe(MsgBuffer &buffer, SignallingPriorityIndicationIeData const &data)
+{
+ buffer.skipBytes(2);
+
+
+ return true;
+}
+
+bool SignallingPriorityIndicationIe::decodeSignallingPriorityIndicationIe(MsgBuffer &buffer, SignallingPriorityIndicationIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+ buffer.skipBytes(2);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: \n");
+ return false;
+ }
+
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE SignallingPriorityIndicationIe\n");
+ return false;
+ }
+}
+void SignallingPriorityIndicationIe::displaySignallingPriorityIndicationIe_v(SignallingPriorityIndicationIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"SignallingPriorityIndicationIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/signallingPriorityIndicationIe.h b/src/gtpV2Codec/ieClasses/signallingPriorityIndicationIe.h
new file mode 100644
index 0000000..510424d
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/signallingPriorityIndicationIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef SIGNALLINGPRIORITYINDICATIONIE_H_
+#define SIGNALLINGPRIORITYINDICATIONIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class SignallingPriorityIndicationIe: public GtpV2Ie {
+public:
+ SignallingPriorityIndicationIe();
+ virtual ~SignallingPriorityIndicationIe();
+
+ bool encodeSignallingPriorityIndicationIe(MsgBuffer &buffer,
+ SignallingPriorityIndicationIeData const &data);
+ bool decodeSignallingPriorityIndicationIe(MsgBuffer &buffer,
+ SignallingPriorityIndicationIeData &data, Uint16 length);
+ void displaySignallingPriorityIndicationIe_v(SignallingPriorityIndicationIeData const &data,
+ Debug &stream);
+};
+
+#endif /* SIGNALLINGPRIORITYINDICATIONIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/throttlingIe.cpp b/src/gtpV2Codec/ieClasses/throttlingIe.cpp
new file mode 100644
index 0000000..b8d93de
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/throttlingIe.cpp
@@ -0,0 +1,119 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "throttlingIe.h"
+#include "dataTypeCodecUtils.h"
+
+ThrottlingIe::ThrottlingIe()
+{
+ ieType = 154;
+ // TODO
+
+}
+
+ThrottlingIe::~ThrottlingIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool ThrottlingIe::encodeThrottlingIe(MsgBuffer &buffer, ThrottlingIeData const &data)
+{
+ if(!(buffer.writeBits(data.throttlingDelayUnit, 3)))
+ {
+ errorStream.add((char *)"Encoding of throttlingDelayUnit failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.throttlingDelayValue, 5)))
+ {
+ errorStream.add((char *)"Encoding of throttlingDelayValue failed\n");
+ return false;
+ }
+ if (!(data.throttlingFactor>= 0 && data.throttlingFactor<= 100))
+ {
+ errorStream.add((char *)"Data validation failure: throttlingFactor\n");
+ return false;
+ }
+ if (!(buffer.writeUint8(data.throttlingFactor)))
+ {
+ errorStream.add((char *)"Encoding of throttlingFactor failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool ThrottlingIe::decodeThrottlingIe(MsgBuffer &buffer, ThrottlingIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+ data.throttlingDelayUnit = buffer.readBits(3);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: throttlingDelayUnit\n");
+ return false;
+ }
+ data.throttlingDelayValue = buffer.readBits(5);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: throttlingDelayValue\n");
+ return false;
+ }
+
+ buffer.readUint8(data.throttlingFactor);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: throttlingFactor\n");
+ return false;
+ }
+ if (!(data.throttlingFactor>= 0 && data.throttlingFactor<= 100))
+ {
+ errorStream.add((char *)"Data validation failure : throttlingFactor\n");
+ return false; //TODO need to add validations
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE ThrottlingIe\n");
+ return false;
+ }
+}
+void ThrottlingIe::displayThrottlingIe_v(ThrottlingIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"ThrottlingIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add( (char *)"throttlingDelayUnit: ");
+ stream.add((Uint8)data.throttlingDelayUnit);
+ stream.endOfLine();
+
+ stream.add( (char *)"throttlingDelayValue: ");
+ stream.add((Uint8)data.throttlingDelayValue);
+ stream.endOfLine();
+
+ stream.add((char *)"throttlingFactor: ");
+ stream.add(data.throttlingFactor);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/throttlingIe.h b/src/gtpV2Codec/ieClasses/throttlingIe.h
new file mode 100644
index 0000000..927c314
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/throttlingIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef THROTTLINGIE_H_
+#define THROTTLINGIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class ThrottlingIe: public GtpV2Ie {
+public:
+ ThrottlingIe();
+ virtual ~ThrottlingIe();
+
+ bool encodeThrottlingIe(MsgBuffer &buffer,
+ ThrottlingIeData const &data);
+ bool decodeThrottlingIe(MsgBuffer &buffer,
+ ThrottlingIeData &data, Uint16 length);
+ void displayThrottlingIe_v(ThrottlingIeData const &data,
+ Debug &stream);
+};
+
+#endif /* THROTTLINGIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/traceInformationIe.cpp b/src/gtpV2Codec/ieClasses/traceInformationIe.cpp
new file mode 100644
index 0000000..274ca6d
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/traceInformationIe.cpp
@@ -0,0 +1,251 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "traceInformationIe.h"
+#include "dataTypeCodecUtils.h"
+
+TraceInformationIe::TraceInformationIe()
+{
+ ieType = 96;
+ // TODO
+
+}
+
+TraceInformationIe::~TraceInformationIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool TraceInformationIe::encodeTraceInformationIe(MsgBuffer &buffer, TraceInformationIeData const &data)
+{
+ if(!(buffer.writeBits(data.mccDigit2, 4)))
+ {
+ errorStream.add((char *)"Encoding of mccDigit2 failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.mccDigit1, 4)))
+ {
+ errorStream.add((char *)"Encoding of mccDigit1 failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.mncDigit3, 4)))
+ {
+ errorStream.add((char *)"Encoding of mncDigit3 failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.mccDigit3, 4)))
+ {
+ errorStream.add((char *)"Encoding of mccDigit3 failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.mncDigit2, 4)))
+ {
+ errorStream.add((char *)"Encoding of mncDigit2 failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.mncDigit1, 4)))
+ {
+ errorStream.add((char *)"Encoding of mncDigit1 failed\n");
+ return false;
+ }
+ if (!(DataTypeCodecUtils::encodeUint8Array4(buffer, data.traceId)))
+ {
+ errorStream.add((char *)"Encoding of traceId failed\n");
+ return false;
+ }
+ if (!(DataTypeCodecUtils::encodeUint8Array16(buffer, data.triggeringEvents)))
+ {
+ errorStream.add((char *)"Encoding of triggeringEvents failed\n");
+ return false;
+ }
+ if (!(buffer.writeUint16(data.listOfNeTypes)))
+ {
+ errorStream.add((char *)"Encoding of listOfNeTypes failed\n");
+ return false;
+ }
+ if (!(buffer.writeUint8(data.sessionTraceDepth)))
+ {
+ errorStream.add((char *)"Encoding of sessionTraceDepth failed\n");
+ return false;
+ }
+ if (!(DataTypeCodecUtils::encodeUint8Array16(buffer, data.listOfInterfaces)))
+ {
+ errorStream.add((char *)"Encoding of listOfInterfaces failed\n");
+ return false;
+ }
+ if (!(DataTypeCodecUtils::encodeIpAddressV4(buffer, data.ipAddressOfTce)))
+ {
+ errorStream.add((char *)"Encoding of ipAddressOfTce failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool TraceInformationIe::decodeTraceInformationIe(MsgBuffer &buffer, TraceInformationIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+ data.mccDigit2 = buffer.readBits(4);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: mccDigit2\n");
+ return false;
+ }
+ data.mccDigit1 = buffer.readBits(4);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: mccDigit1\n");
+ return false;
+ }
+ data.mncDigit3 = buffer.readBits(4);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: mncDigit3\n");
+ return false;
+ }
+ data.mccDigit3 = buffer.readBits(4);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: mccDigit3\n");
+ return false;
+ }
+ data.mncDigit2 = buffer.readBits(4);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: mncDigit2\n");
+ return false;
+ }
+ data.mncDigit1 = buffer.readBits(4);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: mncDigit1\n");
+ return false;
+ }
+
+ Uint16 lengthLeft = length;
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeUint8Array4(buffer, data.traceId, lengthLeft, 3)))
+ {
+ errorStream.add((char *)"Failed to decode: traceId\n");
+ return false;
+ }
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeUint8Array16(buffer, data.triggeringEvents, lengthLeft, 0)))
+ {
+ errorStream.add((char *)"Failed to decode: triggeringEvents\n");
+ return false;
+ }
+
+ buffer.readUint16(data.listOfNeTypes);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: listOfNeTypes\n");
+ return false;
+ }
+
+ buffer.readUint8(data.sessionTraceDepth);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: sessionTraceDepth\n");
+ return false;
+ }
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeUint8Array16(buffer, data.listOfInterfaces, lengthLeft, 0)))
+ {
+ errorStream.add((char *)"Failed to decode: listOfInterfaces\n");
+ return false;
+ }
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeIpAddressV4(buffer, data.ipAddressOfTce, lengthLeft)))
+ {
+ errorStream.add((char *)"Failed to decode: ipAddressOfTce\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE TraceInformationIe\n");
+ return false;
+ }
+}
+void TraceInformationIe::displayTraceInformationIe_v(TraceInformationIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"TraceInformationIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add( (char *)"mccDigit2: ");
+ stream.add((Uint8)data.mccDigit2);
+ stream.endOfLine();
+
+ stream.add( (char *)"mccDigit1: ");
+ stream.add((Uint8)data.mccDigit1);
+ stream.endOfLine();
+
+ stream.add( (char *)"mncDigit3: ");
+ stream.add((Uint8)data.mncDigit3);
+ stream.endOfLine();
+
+ stream.add( (char *)"mccDigit3: ");
+ stream.add((Uint8)data.mccDigit3);
+ stream.endOfLine();
+
+ stream.add( (char *)"mncDigit2: ");
+ stream.add((Uint8)data.mncDigit2);
+ stream.endOfLine();
+
+ stream.add( (char *)"mncDigit1: ");
+ stream.add((Uint8)data.mncDigit1);
+ stream.endOfLine();
+
+ stream.add((char *)"traceId:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displayUint8Array4_v(data.traceId, stream);
+
+ stream.add((char *)"triggeringEvents:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displayUint8Array16_v(data.triggeringEvents, stream);
+
+ stream.add((char *)"listOfNeTypes: ");
+ stream.add(data.listOfNeTypes);
+ stream.endOfLine();
+
+ stream.add((char *)"sessionTraceDepth: ");
+ stream.add(data.sessionTraceDepth);
+ stream.endOfLine();
+
+ stream.add((char *)"listOfInterfaces:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displayUint8Array16_v(data.listOfInterfaces, stream);
+
+ stream.add((char *)"ipAddressOfTce:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displayIpAddressV4_v(data.ipAddressOfTce, stream);
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/traceInformationIe.h b/src/gtpV2Codec/ieClasses/traceInformationIe.h
new file mode 100644
index 0000000..d72345a
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/traceInformationIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef TRACEINFORMATIONIE_H_
+#define TRACEINFORMATIONIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class TraceInformationIe: public GtpV2Ie {
+public:
+ TraceInformationIe();
+ virtual ~TraceInformationIe();
+
+ bool encodeTraceInformationIe(MsgBuffer &buffer,
+ TraceInformationIeData const &data);
+ bool decodeTraceInformationIe(MsgBuffer &buffer,
+ TraceInformationIeData &data, Uint16 length);
+ void displayTraceInformationIe_v(TraceInformationIeData const &data,
+ Debug &stream);
+};
+
+#endif /* TRACEINFORMATIONIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/twanEpdgsOverloadControlInformationInCreateBearerResponse.cpp b/src/gtpV2Codec/ieClasses/twanEpdgsOverloadControlInformationInCreateBearerResponse.cpp
new file mode 100644
index 0000000..7053c56
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/twanEpdgsOverloadControlInformationInCreateBearerResponse.cpp
@@ -0,0 +1,306 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "twanEpdgsOverloadControlInformationInCreateBearerResponse.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+#include "epcTimerIe.h"
+
+TwanEpdgsOverloadControlInformationInCreateBearerResponse::
+TwanEpdgsOverloadControlInformationInCreateBearerResponse()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // overloadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // overloadReductionMetric
+ mandatoryIeSet.insert(mandIe);
+ mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0; // periodOfValidity
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+TwanEpdgsOverloadControlInformationInCreateBearerResponse::
+~TwanEpdgsOverloadControlInformationInCreateBearerResponse()
+{
+
+}
+bool TwanEpdgsOverloadControlInformationInCreateBearerResponse::
+encodeTwanEpdgsOverloadControlInformationInCreateBearerResponse(MsgBuffer &buffer,
+ TwanEpdgsOverloadControlInformationInCreateBearerResponseData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.overloadReductionMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadReductionMetric\n");
+ return false;
+ }
+
+
+
+ // 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.periodOfValidity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: periodOfValidity\n");
+ return false;
+ }
+ return rc;
+}
+
+bool TwanEpdgsOverloadControlInformationInCreateBearerResponse::
+decodeTwanEpdgsOverloadControlInformationInCreateBearerResponse(MsgBuffer &buffer,
+ TwanEpdgsOverloadControlInformationInCreateBearerResponseData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.overloadReductionMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadReductionMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.periodOfValidity, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: periodOfValidity\n");
+ return false;
+ }
+ Uint16 mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void TwanEpdgsOverloadControlInformationInCreateBearerResponse::
+displayTwanEpdgsOverloadControlInformationInCreateBearerResponseData_v
+(TwanEpdgsOverloadControlInformationInCreateBearerResponseData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"TwanEpdgsOverloadControlInformationInCreateBearerResponse:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/twanEpdgsOverloadControlInformationInCreateBearerResponse.h b/src/gtpV2Codec/ieClasses/twanEpdgsOverloadControlInformationInCreateBearerResponse.h
new file mode 100644
index 0000000..b3a69a1
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/twanEpdgsOverloadControlInformationInCreateBearerResponse.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef TWANEPDGSOVERLOADCONTROLINFORMATIONINCREATEBEARERRESPONSE_H_
+#define TWANEPDGSOVERLOADCONTROLINFORMATIONINCREATEBEARERRESPONSE_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class TwanEpdgsOverloadControlInformationInCreateBearerResponse:public GtpV2GroupedIe
+{
+public:
+ TwanEpdgsOverloadControlInformationInCreateBearerResponse();
+ virtual ~TwanEpdgsOverloadControlInformationInCreateBearerResponse();
+ bool encodeTwanEpdgsOverloadControlInformationInCreateBearerResponse(MsgBuffer &buffer,
+ TwanEpdgsOverloadControlInformationInCreateBearerResponseData
+ const &data);
+
+ bool decodeTwanEpdgsOverloadControlInformationInCreateBearerResponse (MsgBuffer &buffer,
+ TwanEpdgsOverloadControlInformationInCreateBearerResponseData
+ & data, Uint16 length);
+
+ void displayTwanEpdgsOverloadControlInformationInCreateBearerResponseData_v
+ (TwanEpdgsOverloadControlInformationInCreateBearerResponseData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/twanEpdgsOverloadControlInformationInCreateSessionRequest.cpp b/src/gtpV2Codec/ieClasses/twanEpdgsOverloadControlInformationInCreateSessionRequest.cpp
new file mode 100644
index 0000000..25dfb72
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/twanEpdgsOverloadControlInformationInCreateSessionRequest.cpp
@@ -0,0 +1,306 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "twanEpdgsOverloadControlInformationInCreateSessionRequest.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+#include "epcTimerIe.h"
+
+TwanEpdgsOverloadControlInformationInCreateSessionRequest::
+TwanEpdgsOverloadControlInformationInCreateSessionRequest()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // overloadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // overloadReductionMetric
+ mandatoryIeSet.insert(mandIe);
+ mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0; // periodOfValidity
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+TwanEpdgsOverloadControlInformationInCreateSessionRequest::
+~TwanEpdgsOverloadControlInformationInCreateSessionRequest()
+{
+
+}
+bool TwanEpdgsOverloadControlInformationInCreateSessionRequest::
+encodeTwanEpdgsOverloadControlInformationInCreateSessionRequest(MsgBuffer &buffer,
+ TwanEpdgsOverloadControlInformationInCreateSessionRequestData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.overloadReductionMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadReductionMetric\n");
+ return false;
+ }
+
+
+
+ // 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.periodOfValidity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: periodOfValidity\n");
+ return false;
+ }
+ return rc;
+}
+
+bool TwanEpdgsOverloadControlInformationInCreateSessionRequest::
+decodeTwanEpdgsOverloadControlInformationInCreateSessionRequest(MsgBuffer &buffer,
+ TwanEpdgsOverloadControlInformationInCreateSessionRequestData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.overloadReductionMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadReductionMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.periodOfValidity, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: periodOfValidity\n");
+ return false;
+ }
+ Uint16 mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void TwanEpdgsOverloadControlInformationInCreateSessionRequest::
+displayTwanEpdgsOverloadControlInformationInCreateSessionRequestData_v
+(TwanEpdgsOverloadControlInformationInCreateSessionRequestData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"TwanEpdgsOverloadControlInformationInCreateSessionRequest:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/twanEpdgsOverloadControlInformationInCreateSessionRequest.h b/src/gtpV2Codec/ieClasses/twanEpdgsOverloadControlInformationInCreateSessionRequest.h
new file mode 100644
index 0000000..bb28bdf
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/twanEpdgsOverloadControlInformationInCreateSessionRequest.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef TWANEPDGSOVERLOADCONTROLINFORMATIONINCREATESESSIONREQUEST_H_
+#define TWANEPDGSOVERLOADCONTROLINFORMATIONINCREATESESSIONREQUEST_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class TwanEpdgsOverloadControlInformationInCreateSessionRequest:public GtpV2GroupedIe
+{
+public:
+ TwanEpdgsOverloadControlInformationInCreateSessionRequest();
+ virtual ~TwanEpdgsOverloadControlInformationInCreateSessionRequest();
+ bool encodeTwanEpdgsOverloadControlInformationInCreateSessionRequest(MsgBuffer &buffer,
+ TwanEpdgsOverloadControlInformationInCreateSessionRequestData
+ const &data);
+
+ bool decodeTwanEpdgsOverloadControlInformationInCreateSessionRequest (MsgBuffer &buffer,
+ TwanEpdgsOverloadControlInformationInCreateSessionRequestData
+ & data, Uint16 length);
+
+ void displayTwanEpdgsOverloadControlInformationInCreateSessionRequestData_v
+ (TwanEpdgsOverloadControlInformationInCreateSessionRequestData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/twanEpdgsOverloadControlInformationInDeleteBearerResponse.cpp b/src/gtpV2Codec/ieClasses/twanEpdgsOverloadControlInformationInDeleteBearerResponse.cpp
new file mode 100644
index 0000000..ef26588
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/twanEpdgsOverloadControlInformationInDeleteBearerResponse.cpp
@@ -0,0 +1,306 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "twanEpdgsOverloadControlInformationInDeleteBearerResponse.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+#include "epcTimerIe.h"
+
+TwanEpdgsOverloadControlInformationInDeleteBearerResponse::
+TwanEpdgsOverloadControlInformationInDeleteBearerResponse()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // overloadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // overloadReductionMetric
+ mandatoryIeSet.insert(mandIe);
+ mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0; // periodOfValidity
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+TwanEpdgsOverloadControlInformationInDeleteBearerResponse::
+~TwanEpdgsOverloadControlInformationInDeleteBearerResponse()
+{
+
+}
+bool TwanEpdgsOverloadControlInformationInDeleteBearerResponse::
+encodeTwanEpdgsOverloadControlInformationInDeleteBearerResponse(MsgBuffer &buffer,
+ TwanEpdgsOverloadControlInformationInDeleteBearerResponseData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.overloadReductionMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadReductionMetric\n");
+ return false;
+ }
+
+
+
+ // 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.periodOfValidity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: periodOfValidity\n");
+ return false;
+ }
+ return rc;
+}
+
+bool TwanEpdgsOverloadControlInformationInDeleteBearerResponse::
+decodeTwanEpdgsOverloadControlInformationInDeleteBearerResponse(MsgBuffer &buffer,
+ TwanEpdgsOverloadControlInformationInDeleteBearerResponseData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.overloadReductionMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadReductionMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.periodOfValidity, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: periodOfValidity\n");
+ return false;
+ }
+ Uint16 mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void TwanEpdgsOverloadControlInformationInDeleteBearerResponse::
+displayTwanEpdgsOverloadControlInformationInDeleteBearerResponseData_v
+(TwanEpdgsOverloadControlInformationInDeleteBearerResponseData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"TwanEpdgsOverloadControlInformationInDeleteBearerResponse:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/twanEpdgsOverloadControlInformationInDeleteBearerResponse.h b/src/gtpV2Codec/ieClasses/twanEpdgsOverloadControlInformationInDeleteBearerResponse.h
new file mode 100644
index 0000000..dd98e81
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/twanEpdgsOverloadControlInformationInDeleteBearerResponse.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef TWANEPDGSOVERLOADCONTROLINFORMATIONINDELETEBEARERRESPONSE_H_
+#define TWANEPDGSOVERLOADCONTROLINFORMATIONINDELETEBEARERRESPONSE_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class TwanEpdgsOverloadControlInformationInDeleteBearerResponse:public GtpV2GroupedIe
+{
+public:
+ TwanEpdgsOverloadControlInformationInDeleteBearerResponse();
+ virtual ~TwanEpdgsOverloadControlInformationInDeleteBearerResponse();
+ bool encodeTwanEpdgsOverloadControlInformationInDeleteBearerResponse(MsgBuffer &buffer,
+ TwanEpdgsOverloadControlInformationInDeleteBearerResponseData
+ const &data);
+
+ bool decodeTwanEpdgsOverloadControlInformationInDeleteBearerResponse (MsgBuffer &buffer,
+ TwanEpdgsOverloadControlInformationInDeleteBearerResponseData
+ & data, Uint16 length);
+
+ void displayTwanEpdgsOverloadControlInformationInDeleteBearerResponseData_v
+ (TwanEpdgsOverloadControlInformationInDeleteBearerResponseData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/twanEpdgsOverloadControlInformationInDeleteSessionRequest.cpp b/src/gtpV2Codec/ieClasses/twanEpdgsOverloadControlInformationInDeleteSessionRequest.cpp
new file mode 100644
index 0000000..3aca592
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/twanEpdgsOverloadControlInformationInDeleteSessionRequest.cpp
@@ -0,0 +1,306 @@
+/*
+ * 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/grpieinsttemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "twanEpdgsOverloadControlInformationInDeleteSessionRequest.h"
+#include "manual/gtpV2Ie.h"
+#include "gtpV2IeFactory.h"
+#include "sequenceNumberIe.h"
+#include "metricIe.h"
+#include "epcTimerIe.h"
+
+TwanEpdgsOverloadControlInformationInDeleteSessionRequest::
+TwanEpdgsOverloadControlInformationInDeleteSessionRequest()
+{
+ Uint16 mandIe;
+ mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0; // overloadControlSequenceNumber
+ mandatoryIeSet.insert(mandIe);
+ mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0; // overloadReductionMetric
+ mandatoryIeSet.insert(mandIe);
+ mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0; // periodOfValidity
+ mandatoryIeSet.insert(mandIe);
+
+}
+
+TwanEpdgsOverloadControlInformationInDeleteSessionRequest::
+~TwanEpdgsOverloadControlInformationInDeleteSessionRequest()
+{
+
+}
+bool TwanEpdgsOverloadControlInformationInDeleteSessionRequest::
+encodeTwanEpdgsOverloadControlInformationInDeleteSessionRequest(MsgBuffer &buffer,
+ TwanEpdgsOverloadControlInformationInDeleteSessionRequestData
+ const &data)
+{
+ bool rc = false;
+ GtpV2IeHeader header;
+ Uint16 startIndex = 0;
+ Uint16 endIndex = 0;
+ Uint16 length = 0;
+
+
+
+ // Encode the Ie Header
+ header.ieType = SequenceNumberIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ SequenceNumberIe sequenceNumber=
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().getIeObject(SequenceNumberIeType));
+ rc = sequenceNumber.encodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+
+
+
+ // Encode the Ie Header
+ header.ieType = MetricIeType;
+ header.instance = 0;
+ header.length = 0; // We will encode the IE first and then update the length
+ GtpV2Ie::encodeGtpV2IeHeader(buffer, header);
+ startIndex = buffer.getCurrentIndex();
+ MetricIe metric=
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().getIeObject(MetricIeType));
+ rc = metric.encodeMetricIe(buffer, data.overloadReductionMetric);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: overloadReductionMetric\n");
+ return false;
+ }
+
+
+
+ // 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.periodOfValidity);
+ endIndex = buffer.getCurrentIndex();
+ length = endIndex - startIndex;
+
+ // encode the length value now
+ buffer.goToIndex(startIndex - 3);
+ buffer.writeUint16(length, false);
+ buffer.goToIndex(endIndex);
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to encode IE: periodOfValidity\n");
+ return false;
+ }
+ return rc;
+}
+
+bool TwanEpdgsOverloadControlInformationInDeleteSessionRequest::
+decodeTwanEpdgsOverloadControlInformationInDeleteSessionRequest(MsgBuffer &buffer,
+ TwanEpdgsOverloadControlInformationInDeleteSessionRequestData
+ &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 SequenceNumberIeType:
+ {
+ SequenceNumberIe ieObject =
+ dynamic_cast<
+ SequenceNumberIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(SequenceNumberIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeSequenceNumberIe(buffer, data.overloadControlSequenceNumber, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadControlSequenceNumber\n");
+ return false;
+ }
+ Uint16 mandIe = SequenceNumberIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ errorStream.add((char *)"Unknown IE Type: ");
+ errorStream.add(ieHeader.ieType);
+ errorStream.endOfLine();
+ buffer.skipBytes(ieHeader.length);
+ }
+ break;
+ }
+ case MetricIeType:
+ {
+ MetricIe ieObject =
+ dynamic_cast<
+ MetricIe&>(GtpV2IeFactory::getInstance().
+ getIeObject(MetricIeType));
+
+
+ if(ieHeader.instance == 0)
+ {
+
+ rc = ieObject.decodeMetricIe(buffer, data.overloadReductionMetric, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: overloadReductionMetric\n");
+ return false;
+ }
+ Uint16 mandIe = MetricIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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.periodOfValidity, ieHeader.length);
+
+ if (!(rc))
+ {
+ errorStream.add((char *)"Failed to decode IE: periodOfValidity\n");
+ return false;
+ }
+ Uint16 mandIe = EpcTimerIeType;
+ mandIe = (mandIe << 8) | 0;
+ mandatoryIeLocalList.erase(mandIe);
+ }
+ else
+ {
+ // Unknown IE instance print error TODO
+ 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);
+ }
+ }
+ }
+ if (!mandatoryIeLocalList.empty())
+ {
+ // some mandatory IEs are missing
+ errorStream.add((char *)"Missing Mandatory IEs:");
+ errorStream.endOfLine();
+ while (!mandatoryIeLocalList.empty())
+ {
+ Uint16 missingMandIe = *mandatoryIeLocalList.begin ();
+ mandatoryIeLocalList.erase (mandatoryIeLocalList.begin ());
+ Uint16 missingInstance = missingMandIe & 0x00FF;
+ Uint16 missingIeType = (missingMandIe >> 8);
+ errorStream.add ((char *)"Missing Ie type: ");
+ errorStream.add (missingIeType);
+ errorStream.add ((char *)" Instance: ");
+ errorStream.add (missingInstance);
+ errorStream.endOfLine();
+ }
+ rc = false;
+
+ }
+ return rc;
+}
+
+void TwanEpdgsOverloadControlInformationInDeleteSessionRequest::
+displayTwanEpdgsOverloadControlInformationInDeleteSessionRequestData_v
+(TwanEpdgsOverloadControlInformationInDeleteSessionRequestData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"TwanEpdgsOverloadControlInformationInDeleteSessionRequest:");
+ stream.endOfLine();
+ stream.incrIndent();
+
+
+
+
+ stream.decrIndent();
+ stream.decrIndent();
+}
+
+
+
+
+
diff --git a/src/gtpV2Codec/ieClasses/twanEpdgsOverloadControlInformationInDeleteSessionRequest.h b/src/gtpV2Codec/ieClasses/twanEpdgsOverloadControlInformationInDeleteSessionRequest.h
new file mode 100644
index 0000000..2591550
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/twanEpdgsOverloadControlInformationInDeleteSessionRequest.h
@@ -0,0 +1,53 @@
+/*
+ * 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/grpieinsttemplate.h.tt>
+ ******************************************************************************/
+#ifndef TWANEPDGSOVERLOADCONTROLINFORMATIONINDELETESESSIONREQUEST_H_
+#define TWANEPDGSOVERLOADCONTROLINFORMATIONINDELETESESSIONREQUEST_H_
+
+#include <set>
+#include <sstream>
+#include "manual/gtpV2GroupedIe.h"
+#include <msgBuffer.h>
+#include "gtpV2GrpIeDataTypes.h"
+#include "../msgClasses/gtpV2MsgDataTypes.h"
+
+class TwanEpdgsOverloadControlInformationInDeleteSessionRequest:public GtpV2GroupedIe
+{
+public:
+ TwanEpdgsOverloadControlInformationInDeleteSessionRequest();
+ virtual ~TwanEpdgsOverloadControlInformationInDeleteSessionRequest();
+ bool encodeTwanEpdgsOverloadControlInformationInDeleteSessionRequest(MsgBuffer &buffer,
+ TwanEpdgsOverloadControlInformationInDeleteSessionRequestData
+ const &data);
+
+ bool decodeTwanEpdgsOverloadControlInformationInDeleteSessionRequest (MsgBuffer &buffer,
+ TwanEpdgsOverloadControlInformationInDeleteSessionRequestData
+ & data, Uint16 length);
+
+ void displayTwanEpdgsOverloadControlInformationInDeleteSessionRequestData_v
+ (TwanEpdgsOverloadControlInformationInDeleteSessionRequestData const &data,
+ Debug &stream);
+
+private:
+ set <Uint16> mandatoryIeSet;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/twanIdentifierIe.cpp b/src/gtpV2Codec/ieClasses/twanIdentifierIe.cpp
new file mode 100644
index 0000000..8e48ac1
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/twanIdentifierIe.cpp
@@ -0,0 +1,478 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "twanIdentifierIe.h"
+#include "dataTypeCodecUtils.h"
+
+TwanIdentifierIe::TwanIdentifierIe()
+{
+ ieType = 169;
+ // TODO
+
+}
+
+TwanIdentifierIe::~TwanIdentifierIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool TwanIdentifierIe::encodeTwanIdentifierIe(MsgBuffer &buffer, TwanIdentifierIeData const &data)
+{
+ buffer.skipBits(2);
+
+ if(!(buffer.writeBits(data.laiipresent, 1)))
+ {
+ errorStream.add((char *)"Encoding of laiipresent failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.opnaipresent, 1)))
+ {
+ errorStream.add((char *)"Encoding of opnaipresent failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.plmnipresent, 1)))
+ {
+ errorStream.add((char *)"Encoding of plmnipresent failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.civaipresent, 1)))
+ {
+ errorStream.add((char *)"Encoding of civaipresent failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.bssidipresent, 2)))
+ {
+ errorStream.add((char *)"Encoding of bssidipresent failed\n");
+ return false;
+ }
+ if (!(buffer.writeUint64(data.ssidLength)))
+ {
+ errorStream.add((char *)"Encoding of ssidLength failed\n");
+ return false;
+ }
+ if ( data.ssidLength <=32)
+ {
+ if (!(buffer.writeUint8(data.ssid)))
+ {
+ errorStream.add((char *)"Encoding of ssid failed\n");
+ return false;
+ }
+ }
+ if (data.bssidipresent)
+ {
+ if (!(buffer.writeUint8(data.bssid)))
+ {
+ errorStream.add((char *)"Encoding of bssid failed\n");
+ return false;
+ }
+ }
+ if (data.civaipresent)
+ {
+ if (!(buffer.writeUint8(data.civicAddressLength)))
+ {
+ errorStream.add((char *)"Encoding of civicAddressLength failed\n");
+ return false;
+ }
+ }
+ if (data.civaipresent)
+ {
+ if (!(buffer.writeUint8(data.civicAddressInformation)))
+ {
+ errorStream.add((char *)"Encoding of civicAddressInformation failed\n");
+ return false;
+ }
+ }
+ if (data.plmnipresent)
+ {
+ if (!(buffer.writeUint8(data.twanplmnid)))
+ {
+ errorStream.add((char *)"Encoding of twanplmnid failed\n");
+ return false;
+ }
+ }
+ if (data.opnaipresent)
+ {
+ if (!(buffer.writeUint8(data.twanOperatorNameLength)))
+ {
+ errorStream.add((char *)"Encoding of twanOperatorNameLength failed\n");
+ return false;
+ }
+ }
+ if (data.opnaipresent)
+ {
+ if (!(buffer.writeUint8(data.twanOperatorName)))
+ {
+ errorStream.add((char *)"Encoding of twanOperatorName failed\n");
+ return false;
+ }
+ }
+ if (data.laiipresent)
+ {
+ if (!(buffer.writeUint8(data.relayIdentityType)))
+ {
+ errorStream.add((char *)"Encoding of relayIdentityType failed\n");
+ return false;
+ }
+ }
+ if (data.laiipresent)
+ {
+ if (!(buffer.writeUint8(data.relayIdentityLength)))
+ {
+ errorStream.add((char *)"Encoding of relayIdentityLength failed\n");
+ return false;
+ }
+ }
+ if (data.laiipresent)
+ {
+ if (!(buffer.writeUint8(data.relayIdentity)))
+ {
+ errorStream.add((char *)"Encoding of relayIdentity failed\n");
+ return false;
+ }
+ }
+ if (data.laiipresent)
+ {
+ if (!(buffer.writeUint8(data.circuitIDLength)))
+ {
+ errorStream.add((char *)"Encoding of circuitIDLength failed\n");
+ return false;
+ }
+ }
+ if (data.laiipresent)
+ {
+ if (!(buffer.writeUint8(data.circuitID)))
+ {
+ errorStream.add((char *)"Encoding of circuitID failed\n");
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool TwanIdentifierIe::decodeTwanIdentifierIe(MsgBuffer &buffer, TwanIdentifierIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+ buffer.skipBits(2);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: \n");
+ return false;
+ }
+
+ data.laiipresent = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: laiipresent\n");
+ return false;
+ }
+ data.opnaipresent = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: opnaipresent\n");
+ return false;
+ }
+ data.plmnipresent = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: plmnipresent\n");
+ return false;
+ }
+ data.civaipresent = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: civaipresent\n");
+ return false;
+ }
+ data.bssidipresent = buffer.readBits(2);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: bssidipresent\n");
+ return false;
+ }
+
+ buffer.readUint64(data.ssidLength);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: ssidLength\n");
+ return false;
+ }
+
+ if ( data.ssidLength <=32)
+ {
+
+ buffer.readUint8(data.ssid);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: ssid\n");
+ return false;
+ }
+ }
+
+ if (data.bssidipresent)
+ {
+
+ buffer.readUint8(data.bssid);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: bssid\n");
+ return false;
+ }
+ }
+
+ if (data.civaipresent)
+ {
+
+ buffer.readUint8(data.civicAddressLength);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: civicAddressLength\n");
+ return false;
+ }
+ }
+
+ if (data.civaipresent)
+ {
+
+ buffer.readUint8(data.civicAddressInformation);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: civicAddressInformation\n");
+ return false;
+ }
+ }
+
+ if (data.plmnipresent)
+ {
+
+ buffer.readUint8(data.twanplmnid);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: twanplmnid\n");
+ return false;
+ }
+ }
+
+ if (data.opnaipresent)
+ {
+
+ buffer.readUint8(data.twanOperatorNameLength);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: twanOperatorNameLength\n");
+ return false;
+ }
+ }
+
+ if (data.opnaipresent)
+ {
+
+ buffer.readUint8(data.twanOperatorName);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: twanOperatorName\n");
+ return false;
+ }
+ }
+
+ if (data.laiipresent)
+ {
+
+ buffer.readUint8(data.relayIdentityType);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: relayIdentityType\n");
+ return false;
+ }
+ }
+
+ if (data.laiipresent)
+ {
+
+ buffer.readUint8(data.relayIdentityLength);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: relayIdentityLength\n");
+ return false;
+ }
+ }
+
+ if (data.laiipresent)
+ {
+
+ buffer.readUint8(data.relayIdentity);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: relayIdentity\n");
+ return false;
+ }
+ }
+
+ if (data.laiipresent)
+ {
+
+ buffer.readUint8(data.circuitIDLength);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: circuitIDLength\n");
+ return false;
+ }
+ }
+
+ if (data.laiipresent)
+ {
+
+ buffer.readUint8(data.circuitID);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: circuitID\n");
+ return false;
+ }
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE TwanIdentifierIe\n");
+ return false;
+ }
+}
+void TwanIdentifierIe::displayTwanIdentifierIe_v(TwanIdentifierIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"TwanIdentifierIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add( (char *)"laiipresent: ");
+ stream.add((Uint8)data.laiipresent);
+ stream.endOfLine();
+
+ stream.add( (char *)"opnaipresent: ");
+ stream.add((Uint8)data.opnaipresent);
+ stream.endOfLine();
+
+ stream.add( (char *)"plmnipresent: ");
+ stream.add((Uint8)data.plmnipresent);
+ stream.endOfLine();
+
+ stream.add( (char *)"civaipresent: ");
+ stream.add((Uint8)data.civaipresent);
+ stream.endOfLine();
+
+ stream.add( (char *)"bssidipresent: ");
+ stream.add((Uint8)data.bssidipresent);
+ stream.endOfLine();
+
+ stream.add((char *)"ssidLength: ");
+ stream.add(data.ssidLength);
+ stream.endOfLine();
+
+ if ( data.ssidLength <=32)
+ {
+ stream.add((char *)"ssid: ");
+ stream.add(data.ssid);
+ stream.endOfLine();
+ }
+
+ if (data.bssidipresent)
+ {
+ stream.add((char *)"bssid: ");
+ stream.add(data.bssid);
+ stream.endOfLine();
+ }
+
+ if (data.civaipresent)
+ {
+ stream.add((char *)"civicAddressLength: ");
+ stream.add(data.civicAddressLength);
+ stream.endOfLine();
+ }
+
+ if (data.civaipresent)
+ {
+ stream.add((char *)"civicAddressInformation: ");
+ stream.add(data.civicAddressInformation);
+ stream.endOfLine();
+ }
+
+ if (data.plmnipresent)
+ {
+ stream.add((char *)"twanplmnid: ");
+ stream.add(data.twanplmnid);
+ stream.endOfLine();
+ }
+
+ if (data.opnaipresent)
+ {
+ stream.add((char *)"twanOperatorNameLength: ");
+ stream.add(data.twanOperatorNameLength);
+ stream.endOfLine();
+ }
+
+ if (data.opnaipresent)
+ {
+ stream.add((char *)"twanOperatorName: ");
+ stream.add(data.twanOperatorName);
+ stream.endOfLine();
+ }
+
+ if (data.laiipresent)
+ {
+ stream.add((char *)"relayIdentityType: ");
+ stream.add(data.relayIdentityType);
+ stream.endOfLine();
+ }
+
+ if (data.laiipresent)
+ {
+ stream.add((char *)"relayIdentityLength: ");
+ stream.add(data.relayIdentityLength);
+ stream.endOfLine();
+ }
+
+ if (data.laiipresent)
+ {
+ stream.add((char *)"relayIdentity: ");
+ stream.add(data.relayIdentity);
+ stream.endOfLine();
+ }
+
+ if (data.laiipresent)
+ {
+ stream.add((char *)"circuitIDLength: ");
+ stream.add(data.circuitIDLength);
+ stream.endOfLine();
+ }
+
+ if (data.laiipresent)
+ {
+ stream.add((char *)"circuitID: ");
+ stream.add(data.circuitID);
+ stream.endOfLine();
+ }
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/twanIdentifierIe.h b/src/gtpV2Codec/ieClasses/twanIdentifierIe.h
new file mode 100644
index 0000000..e98ddd7
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/twanIdentifierIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef TWANIDENTIFIERIE_H_
+#define TWANIDENTIFIERIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class TwanIdentifierIe: public GtpV2Ie {
+public:
+ TwanIdentifierIe();
+ virtual ~TwanIdentifierIe();
+
+ bool encodeTwanIdentifierIe(MsgBuffer &buffer,
+ TwanIdentifierIeData const &data);
+ bool decodeTwanIdentifierIe(MsgBuffer &buffer,
+ TwanIdentifierIeData &data, Uint16 length);
+ void displayTwanIdentifierIe_v(TwanIdentifierIeData const &data,
+ Debug &stream);
+};
+
+#endif /* TWANIDENTIFIERIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/twanIdentifierTimestampIe.cpp b/src/gtpV2Codec/ieClasses/twanIdentifierTimestampIe.cpp
new file mode 100644
index 0000000..7d0a2e7
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/twanIdentifierTimestampIe.cpp
@@ -0,0 +1,77 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "twanIdentifierTimestampIe.h"
+#include "dataTypeCodecUtils.h"
+
+TwanIdentifierTimestampIe::TwanIdentifierTimestampIe()
+{
+ ieType = 179;
+ // TODO
+
+}
+
+TwanIdentifierTimestampIe::~TwanIdentifierTimestampIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool TwanIdentifierTimestampIe::encodeTwanIdentifierTimestampIe(MsgBuffer &buffer, TwanIdentifierTimestampIeData const &data)
+{
+ if (!(buffer.writeUint32(data.twanIdentifierTimestampvalue)))
+ {
+ errorStream.add((char *)"Encoding of twanIdentifierTimestampvalue failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool TwanIdentifierTimestampIe::decodeTwanIdentifierTimestampIe(MsgBuffer &buffer, TwanIdentifierTimestampIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+
+ buffer.readUint32(data.twanIdentifierTimestampvalue);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: twanIdentifierTimestampvalue\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE TwanIdentifierTimestampIe\n");
+ return false;
+ }
+}
+void TwanIdentifierTimestampIe::displayTwanIdentifierTimestampIe_v(TwanIdentifierTimestampIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"TwanIdentifierTimestampIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add((char *)"twanIdentifierTimestampvalue: ");
+ stream.add(data.twanIdentifierTimestampvalue);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/twanIdentifierTimestampIe.h b/src/gtpV2Codec/ieClasses/twanIdentifierTimestampIe.h
new file mode 100644
index 0000000..f00e580
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/twanIdentifierTimestampIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef TWANIDENTIFIERTIMESTAMPIE_H_
+#define TWANIDENTIFIERTIMESTAMPIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class TwanIdentifierTimestampIe: public GtpV2Ie {
+public:
+ TwanIdentifierTimestampIe();
+ virtual ~TwanIdentifierTimestampIe();
+
+ bool encodeTwanIdentifierTimestampIe(MsgBuffer &buffer,
+ TwanIdentifierTimestampIeData const &data);
+ bool decodeTwanIdentifierTimestampIe(MsgBuffer &buffer,
+ TwanIdentifierTimestampIeData &data, Uint16 length);
+ void displayTwanIdentifierTimestampIe_v(TwanIdentifierTimestampIeData const &data,
+ Debug &stream);
+};
+
+#endif /* TWANIDENTIFIERTIMESTAMPIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/twmiIe.cpp b/src/gtpV2Codec/ieClasses/twmiIe.cpp
new file mode 100644
index 0000000..bb538db
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/twmiIe.cpp
@@ -0,0 +1,102 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "twmiIe.h"
+#include "dataTypeCodecUtils.h"
+
+TwmiIe::TwmiIe()
+{
+ ieType = 174;
+ // TODO
+
+}
+
+TwmiIe::~TwmiIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool TwmiIe::encodeTwmiIe(MsgBuffer &buffer, TwmiIeData const &data)
+{
+ buffer.skipBits(4);
+
+ if(!(buffer.writeBits(data.mcm, 2)))
+ {
+ errorStream.add((char *)"Encoding of mcm failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.scm, 2)))
+ {
+ errorStream.add((char *)"Encoding of scm failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool TwmiIe::decodeTwmiIe(MsgBuffer &buffer, TwmiIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+ buffer.skipBits(4);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: \n");
+ return false;
+ }
+
+ data.mcm = buffer.readBits(2);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: mcm\n");
+ return false;
+ }
+ data.scm = buffer.readBits(2);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: scm\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE TwmiIe\n");
+ return false;
+ }
+}
+void TwmiIe::displayTwmiIe_v(TwmiIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"TwmiIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add( (char *)"mcm: ");
+ stream.add((Uint8)data.mcm);
+ stream.endOfLine();
+
+ stream.add( (char *)"scm: ");
+ stream.add((Uint8)data.scm);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/twmiIe.h b/src/gtpV2Codec/ieClasses/twmiIe.h
new file mode 100644
index 0000000..60a2bf4
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/twmiIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef TWMIIE_H_
+#define TWMIIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class TwmiIe: public GtpV2Ie {
+public:
+ TwmiIe();
+ virtual ~TwmiIe();
+
+ bool encodeTwmiIe(MsgBuffer &buffer,
+ TwmiIeData const &data);
+ bool decodeTwmiIe(MsgBuffer &buffer,
+ TwmiIeData &data, Uint16 length);
+ void displayTwmiIe_v(TwmiIeData const &data,
+ Debug &stream);
+};
+
+#endif /* TWMIIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/uciIe.cpp b/src/gtpV2Codec/ieClasses/uciIe.cpp
new file mode 100644
index 0000000..6d4eef6
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/uciIe.cpp
@@ -0,0 +1,250 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "uciIe.h"
+#include "dataTypeCodecUtils.h"
+
+UciIe::UciIe()
+{
+ ieType = 145;
+ // TODO
+
+}
+
+UciIe::~UciIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool UciIe::encodeUciIe(MsgBuffer &buffer, UciIeData const &data)
+{
+ if(!(buffer.writeBits(data.mccDigit2, 4)))
+ {
+ errorStream.add((char *)"Encoding of mccDigit2 failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.mccDigit1, 4)))
+ {
+ errorStream.add((char *)"Encoding of mccDigit1 failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.mncDigit3, 4)))
+ {
+ errorStream.add((char *)"Encoding of mncDigit3 failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.mccDigit3, 4)))
+ {
+ errorStream.add((char *)"Encoding of mccDigit3 failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.mncDigit2, 4)))
+ {
+ errorStream.add((char *)"Encoding of mncDigit2 failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.mncDigit1, 4)))
+ {
+ errorStream.add((char *)"Encoding of mncDigit1 failed\n");
+ return false;
+ }
+ if (!(data.csgId<= 0x07FFFFFF))
+ {
+ errorStream.add((char *)"Data validation failure: csgId\n");
+ return false;
+ }
+ if (!(buffer.writeUint32(data.csgId)))
+ {
+ errorStream.add((char *)"Encoding of csgId failed\n");
+ return false;
+ }
+ if (!(data.accessMode<= 1))
+ {
+ errorStream.add((char *)"Data validation failure: accessMode\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.accessMode, 2)))
+ {
+ errorStream.add((char *)"Encoding of accessMode failed\n");
+ return false;
+ }
+ buffer.skipBits(4);
+
+ if(!(buffer.writeBits(data.lcsg, 1)))
+ {
+ errorStream.add((char *)"Encoding of lcsg failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.cmi, 1)))
+ {
+ errorStream.add((char *)"Encoding of cmi failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool UciIe::decodeUciIe(MsgBuffer &buffer, UciIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+ data.mccDigit2 = buffer.readBits(4);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: mccDigit2\n");
+ return false;
+ }
+ data.mccDigit1 = buffer.readBits(4);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: mccDigit1\n");
+ return false;
+ }
+ data.mncDigit3 = buffer.readBits(4);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: mncDigit3\n");
+ return false;
+ }
+ data.mccDigit3 = buffer.readBits(4);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: mccDigit3\n");
+ return false;
+ }
+ data.mncDigit2 = buffer.readBits(4);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: mncDigit2\n");
+ return false;
+ }
+ data.mncDigit1 = buffer.readBits(4);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: mncDigit1\n");
+ return false;
+ }
+
+ buffer.readUint32(data.csgId);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: csgId\n");
+ return false;
+ }
+ if (!(data.csgId<= 0x07FFFFFF))
+ {
+ errorStream.add((char *)"Data validation failure : csgId\n");
+ return false; //TODO need to add validations
+ }
+ data.accessMode = buffer.readBits(2);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: accessMode\n");
+ return false;
+ }
+ if (!(data.accessMode<= 1))
+ {
+ errorStream.add((char *)"Data validation failure : accessMode\n");
+ return false; //TODO need to add validations
+ }
+ buffer.skipBits(4);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: \n");
+ return false;
+ }
+
+ data.lcsg = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: lcsg\n");
+ return false;
+ }
+ data.cmi = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: cmi\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE UciIe\n");
+ return false;
+ }
+}
+void UciIe::displayUciIe_v(UciIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"UciIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add( (char *)"mccDigit2: ");
+ stream.add((Uint8)data.mccDigit2);
+ stream.endOfLine();
+
+ stream.add( (char *)"mccDigit1: ");
+ stream.add((Uint8)data.mccDigit1);
+ stream.endOfLine();
+
+ stream.add( (char *)"mncDigit3: ");
+ stream.add((Uint8)data.mncDigit3);
+ stream.endOfLine();
+
+ stream.add( (char *)"mccDigit3: ");
+ stream.add((Uint8)data.mccDigit3);
+ stream.endOfLine();
+
+ stream.add( (char *)"mncDigit2: ");
+ stream.add((Uint8)data.mncDigit2);
+ stream.endOfLine();
+
+ stream.add( (char *)"mncDigit1: ");
+ stream.add((Uint8)data.mncDigit1);
+ stream.endOfLine();
+
+ stream.add((char *)"csgId: ");
+ stream.add(data.csgId);
+ stream.endOfLine();
+
+ stream.add( (char *)"accessMode: ");
+ stream.add((Uint8)data.accessMode);
+ stream.endOfLine();
+
+ stream.add( (char *)"lcsg: ");
+ stream.add((Uint8)data.lcsg);
+ stream.endOfLine();
+
+ stream.add( (char *)"cmi: ");
+ stream.add((Uint8)data.cmi);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/uciIe.h b/src/gtpV2Codec/ieClasses/uciIe.h
new file mode 100644
index 0000000..ab5e653
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/uciIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef UCIIE_H_
+#define UCIIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class UciIe: public GtpV2Ie {
+public:
+ UciIe();
+ virtual ~UciIe();
+
+ bool encodeUciIe(MsgBuffer &buffer,
+ UciIeData const &data);
+ bool decodeUciIe(MsgBuffer &buffer,
+ UciIeData &data, Uint16 length);
+ void displayUciIe_v(UciIeData const &data,
+ Debug &stream);
+};
+
+#endif /* UCIIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/ueTimeZoneIe.cpp b/src/gtpV2Codec/ieClasses/ueTimeZoneIe.cpp
new file mode 100644
index 0000000..86b55a4
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/ueTimeZoneIe.cpp
@@ -0,0 +1,96 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "ueTimeZoneIe.h"
+#include "dataTypeCodecUtils.h"
+
+UeTimeZoneIe::UeTimeZoneIe()
+{
+ ieType = 114;
+ // TODO
+
+}
+
+UeTimeZoneIe::~UeTimeZoneIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool UeTimeZoneIe::encodeUeTimeZoneIe(MsgBuffer &buffer, UeTimeZoneIeData const &data)
+{
+ buffer.skipBits(6);
+
+ if (!(data.daylightSavingTime!= 3))
+ {
+ errorStream.add((char *)"Data validation failure: daylightSavingTime\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.daylightSavingTime, 2)))
+ {
+ errorStream.add((char *)"Encoding of daylightSavingTime failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool UeTimeZoneIe::decodeUeTimeZoneIe(MsgBuffer &buffer, UeTimeZoneIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+ buffer.skipBits(6);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: \n");
+ return false;
+ }
+
+ data.daylightSavingTime = buffer.readBits(2);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: daylightSavingTime\n");
+ return false;
+ }
+ if (!(data.daylightSavingTime!= 3))
+ {
+ errorStream.add((char *)"Data validation failure : daylightSavingTime\n");
+ return false; //TODO need to add validations
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE UeTimeZoneIe\n");
+ return false;
+ }
+}
+void UeTimeZoneIe::displayUeTimeZoneIe_v(UeTimeZoneIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"UeTimeZoneIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add( (char *)"daylightSavingTime: ");
+ stream.add((Uint8)data.daylightSavingTime);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/ueTimeZoneIe.h b/src/gtpV2Codec/ieClasses/ueTimeZoneIe.h
new file mode 100644
index 0000000..4be6664
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/ueTimeZoneIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef UETIMEZONEIE_H_
+#define UETIMEZONEIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class UeTimeZoneIe: public GtpV2Ie {
+public:
+ UeTimeZoneIe();
+ virtual ~UeTimeZoneIe();
+
+ bool encodeUeTimeZoneIe(MsgBuffer &buffer,
+ UeTimeZoneIeData const &data);
+ bool decodeUeTimeZoneIe(MsgBuffer &buffer,
+ UeTimeZoneIeData &data, Uint16 length);
+ void displayUeTimeZoneIe_v(UeTimeZoneIeData const &data,
+ Debug &stream);
+};
+
+#endif /* UETIMEZONEIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/uliIe.cpp b/src/gtpV2Codec/ieClasses/uliIe.cpp
new file mode 100644
index 0000000..b55a2a0
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/uliIe.cpp
@@ -0,0 +1,318 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "uliIe.h"
+#include "dataTypeCodecUtils.h"
+
+UliIe::UliIe()
+{
+ ieType = 86;
+ // TODO
+
+}
+
+UliIe::~UliIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool UliIe::encodeUliIe(MsgBuffer &buffer, UliIeData const &data)
+{
+ buffer.skipBits(2);
+
+ if(!(buffer.writeBits(data.laipresent, 1)))
+ {
+ errorStream.add((char *)"Encoding of laipresent failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.ecgipresent, 1)))
+ {
+ errorStream.add((char *)"Encoding of ecgipresent failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.taipresent, 1)))
+ {
+ errorStream.add((char *)"Encoding of taipresent failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.raipresent, 1)))
+ {
+ errorStream.add((char *)"Encoding of raipresent failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.saipresent, 1)))
+ {
+ errorStream.add((char *)"Encoding of saipresent failed\n");
+ return false;
+ }
+ if(!(buffer.writeBits(data.cgipresent, 1)))
+ {
+ errorStream.add((char *)"Encoding of cgipresent failed\n");
+ return false;
+ }
+ if (data.cgipresent)
+ {
+ if (!(DataTypeCodecUtils::encodeCgiField(buffer, data.cgi)))
+ {
+ errorStream.add((char *)"Encoding of cgi failed\n");
+ return false;
+ }
+ }
+ if (data.saipresent)
+ {
+ if (!(DataTypeCodecUtils::encodeSaiField(buffer, data.sai)))
+ {
+ errorStream.add((char *)"Encoding of sai failed\n");
+ return false;
+ }
+ }
+ if (data.raipresent)
+ {
+ if (!(DataTypeCodecUtils::encodeRaiField(buffer, data.rai)))
+ {
+ errorStream.add((char *)"Encoding of rai failed\n");
+ return false;
+ }
+ }
+ if (data.taipresent)
+ {
+ if (!(DataTypeCodecUtils::encodeTaiField(buffer, data.tai)))
+ {
+ errorStream.add((char *)"Encoding of tai failed\n");
+ return false;
+ }
+ }
+ if (data.ecgipresent)
+ {
+ if (!(DataTypeCodecUtils::encodeEcgiField(buffer, data.ecgi)))
+ {
+ errorStream.add((char *)"Encoding of ecgi failed\n");
+ return false;
+ }
+ }
+ if (data.laipresent)
+ {
+ if (!(DataTypeCodecUtils::encodeLaiField(buffer, data.lai)))
+ {
+ errorStream.add((char *)"Encoding of lai failed\n");
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool UliIe::decodeUliIe(MsgBuffer &buffer, UliIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+ buffer.skipBits(2);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: \n");
+ return false;
+ }
+
+ data.laipresent = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: laipresent\n");
+ return false;
+ }
+ data.ecgipresent = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: ecgipresent\n");
+ return false;
+ }
+ data.taipresent = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: taipresent\n");
+ return false;
+ }
+ data.raipresent = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: raipresent\n");
+ return false;
+ }
+ data.saipresent = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: saipresent\n");
+ return false;
+ }
+ data.cgipresent = buffer.readBits(1);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: cgipresent\n");
+ return false;
+ }
+
+ Uint16 lengthLeft = length;
+
+ if (data.cgipresent)
+ {
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeCgiField(buffer, data.cgi, lengthLeft)))
+ {
+ errorStream.add((char *)"Failed to decode: cgi\n");
+ return false;
+ }
+ }
+
+ if (data.saipresent)
+ {
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeSaiField(buffer, data.sai, lengthLeft)))
+ {
+ errorStream.add((char *)"Failed to decode: sai\n");
+ return false;
+ }
+ }
+
+ if (data.raipresent)
+ {
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeRaiField(buffer, data.rai, lengthLeft)))
+ {
+ errorStream.add((char *)"Failed to decode: rai\n");
+ return false;
+ }
+ }
+
+ if (data.taipresent)
+ {
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeTaiField(buffer, data.tai, lengthLeft)))
+ {
+ errorStream.add((char *)"Failed to decode: tai\n");
+ return false;
+ }
+ }
+
+ if (data.ecgipresent)
+ {
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeEcgiField(buffer, data.ecgi, lengthLeft)))
+ {
+ errorStream.add((char *)"Failed to decode: ecgi\n");
+ return false;
+ }
+ }
+
+ if (data.laipresent)
+ {
+ lengthLeft = ieBoundary - buffer.getCurrentIndex();
+ if (!(DataTypeCodecUtils::decodeLaiField(buffer, data.lai, lengthLeft)))
+ {
+ errorStream.add((char *)"Failed to decode: lai\n");
+ return false;
+ }
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE UliIe\n");
+ return false;
+ }
+}
+void UliIe::displayUliIe_v(UliIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"UliIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add( (char *)"laipresent: ");
+ stream.add((Uint8)data.laipresent);
+ stream.endOfLine();
+
+ stream.add( (char *)"ecgipresent: ");
+ stream.add((Uint8)data.ecgipresent);
+ stream.endOfLine();
+
+ stream.add( (char *)"taipresent: ");
+ stream.add((Uint8)data.taipresent);
+ stream.endOfLine();
+
+ stream.add( (char *)"raipresent: ");
+ stream.add((Uint8)data.raipresent);
+ stream.endOfLine();
+
+ stream.add( (char *)"saipresent: ");
+ stream.add((Uint8)data.saipresent);
+ stream.endOfLine();
+
+ stream.add( (char *)"cgipresent: ");
+ stream.add((Uint8)data.cgipresent);
+ stream.endOfLine();
+
+ if (data.cgipresent)
+ {
+ stream.add((char *)"cgi:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displayCgiField_v(data.cgi, stream);
+ }
+
+ if (data.saipresent)
+ {
+ stream.add((char *)"sai:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displaySaiField_v(data.sai, stream);
+ }
+
+ if (data.raipresent)
+ {
+ stream.add((char *)"rai:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displayRaiField_v(data.rai, stream);
+ }
+
+ if (data.taipresent)
+ {
+ stream.add((char *)"tai:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displayTaiField_v(data.tai, stream);
+ }
+
+ if (data.ecgipresent)
+ {
+ stream.add((char *)"ecgi:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displayEcgiField_v(data.ecgi, stream);
+ }
+
+ if (data.laipresent)
+ {
+ stream.add((char *)"lai:");
+ stream.endOfLine();
+ DataTypeCodecUtils::displayLaiField_v(data.lai, stream);
+ }
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/uliIe.h b/src/gtpV2Codec/ieClasses/uliIe.h
new file mode 100644
index 0000000..b145bc5
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/uliIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef ULIIE_H_
+#define ULIIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class UliIe: public GtpV2Ie {
+public:
+ UliIe();
+ virtual ~UliIe();
+
+ bool encodeUliIe(MsgBuffer &buffer,
+ UliIeData const &data);
+ bool decodeUliIe(MsgBuffer &buffer,
+ UliIeData &data, Uint16 length);
+ void displayUliIe_v(UliIeData const &data,
+ Debug &stream);
+};
+
+#endif /* ULIIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/uliTimestampIe.cpp b/src/gtpV2Codec/ieClasses/uliTimestampIe.cpp
new file mode 100644
index 0000000..a5f9adc
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/uliTimestampIe.cpp
@@ -0,0 +1,77 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "uliTimestampIe.h"
+#include "dataTypeCodecUtils.h"
+
+UliTimestampIe::UliTimestampIe()
+{
+ ieType = 170;
+ // TODO
+
+}
+
+UliTimestampIe::~UliTimestampIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool UliTimestampIe::encodeUliTimestampIe(MsgBuffer &buffer, UliTimestampIeData const &data)
+{
+ if (!(buffer.writeUint32(data.uliTimestampvalue)))
+ {
+ errorStream.add((char *)"Encoding of uliTimestampvalue failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool UliTimestampIe::decodeUliTimestampIe(MsgBuffer &buffer, UliTimestampIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+
+ buffer.readUint32(data.uliTimestampvalue);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: uliTimestampvalue\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE UliTimestampIe\n");
+ return false;
+ }
+}
+void UliTimestampIe::displayUliTimestampIe_v(UliTimestampIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"UliTimestampIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add((char *)"uliTimestampvalue: ");
+ stream.add(data.uliTimestampvalue);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/uliTimestampIe.h b/src/gtpV2Codec/ieClasses/uliTimestampIe.h
new file mode 100644
index 0000000..4ac24b4
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/uliTimestampIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef ULITIMESTAMPIE_H_
+#define ULITIMESTAMPIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class UliTimestampIe: public GtpV2Ie {
+public:
+ UliTimestampIe();
+ virtual ~UliTimestampIe();
+
+ bool encodeUliTimestampIe(MsgBuffer &buffer,
+ UliTimestampIeData const &data);
+ bool decodeUliTimestampIe(MsgBuffer &buffer,
+ UliTimestampIeData &data, Uint16 length);
+ void displayUliTimestampIe_v(UliTimestampIeData const &data,
+ Debug &stream);
+};
+
+#endif /* ULITIMESTAMPIE_H_ */
\ No newline at end of file
diff --git a/src/gtpV2Codec/ieClasses/upFunctionSelectionIndicationFlagsIe.cpp b/src/gtpV2Codec/ieClasses/upFunctionSelectionIndicationFlagsIe.cpp
new file mode 100644
index 0000000..7246448
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/upFunctionSelectionIndicationFlagsIe.cpp
@@ -0,0 +1,86 @@
+/*
+ * 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/ietemplate.cpp.tt>
+ ******************************************************************************/
+
+#include "upFunctionSelectionIndicationFlagsIe.h"
+#include "dataTypeCodecUtils.h"
+
+UpFunctionSelectionIndicationFlagsIe::UpFunctionSelectionIndicationFlagsIe()
+{
+ ieType = 202;
+ // TODO
+
+}
+
+UpFunctionSelectionIndicationFlagsIe::~UpFunctionSelectionIndicationFlagsIe() {
+ // TODO Auto-generated destructor stub
+}
+
+bool UpFunctionSelectionIndicationFlagsIe::encodeUpFunctionSelectionIndicationFlagsIe(MsgBuffer &buffer, UpFunctionSelectionIndicationFlagsIeData const &data)
+{
+ buffer.skipBits(4);
+
+ if(!(buffer.writeBits(data.dcnr, 4)))
+ {
+ errorStream.add((char *)"Encoding of dcnr failed\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool UpFunctionSelectionIndicationFlagsIe::decodeUpFunctionSelectionIndicationFlagsIe(MsgBuffer &buffer, UpFunctionSelectionIndicationFlagsIeData &data, Uint16 length)
+{
+ // TODO optimize the length checks
+
+ Uint16 ieBoundary = buffer.getCurrentIndex() + length;
+ buffer.skipBits(4);
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: \n");
+ return false;
+ }
+
+ data.dcnr = buffer.readBits(4);
+ // confirm that we are not reading beyond the IE boundary
+ if (buffer.getCurrentIndex() > ieBoundary)
+ {
+ errorStream.add((char *)"Attempt to read beyond IE boundary: dcnr\n");
+ return false;
+ }
+
+ // The IE is decoded now. The buffer index should be pointing to the
+ // IE Boundary. If not, we have some more data left for the IE which we don't know
+ // how to decode
+ if (ieBoundary == buffer.getCurrentIndex())
+ {
+ return true;
+ }
+ else
+ {
+ errorStream.add((char *)"Unable to decode IE UpFunctionSelectionIndicationFlagsIe\n");
+ return false;
+ }
+}
+void UpFunctionSelectionIndicationFlagsIe::displayUpFunctionSelectionIndicationFlagsIe_v(UpFunctionSelectionIndicationFlagsIeData const &data, Debug &stream)
+{
+ stream.incrIndent();
+ stream.add((char *)"UpFunctionSelectionIndicationFlagsIeData:");
+ stream.incrIndent();
+ stream.endOfLine();
+
+ stream.add( (char *)"dcnr: ");
+ stream.add((Uint8)data.dcnr);
+ stream.endOfLine();
+ stream.decrIndent();
+ stream.decrIndent();
+}
diff --git a/src/gtpV2Codec/ieClasses/upFunctionSelectionIndicationFlagsIe.h b/src/gtpV2Codec/ieClasses/upFunctionSelectionIndicationFlagsIe.h
new file mode 100644
index 0000000..4d492c9
--- /dev/null
+++ b/src/gtpV2Codec/ieClasses/upFunctionSelectionIndicationFlagsIe.h
@@ -0,0 +1,42 @@
+/*
+ * 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/ietemplate.h.tt>
+ ******************************************************************************/
+#ifndef UPFUNCTIONSELECTIONINDICATIONFLAGSIE_H_
+#define UPFUNCTIONSELECTIONINDICATIONFLAGSIE_H_
+
+#include "manual/gtpV2Ie.h"
+
+
+
+class UpFunctionSelectionIndicationFlagsIe: public GtpV2Ie {
+public:
+ UpFunctionSelectionIndicationFlagsIe();
+ virtual ~UpFunctionSelectionIndicationFlagsIe();
+
+ bool encodeUpFunctionSelectionIndicationFlagsIe(MsgBuffer &buffer,
+ UpFunctionSelectionIndicationFlagsIeData const &data);
+ bool decodeUpFunctionSelectionIndicationFlagsIe(MsgBuffer &buffer,
+ UpFunctionSelectionIndicationFlagsIeData &data, Uint16 length);
+ void displayUpFunctionSelectionIndicationFlagsIe_v(UpFunctionSelectionIndicationFlagsIeData const &data,
+ Debug &stream);
+};
+
+#endif /* UPFUNCTIONSELECTIONINDICATIONFLAGSIE_H_ */
\ No newline at end of file
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