MME2 changes - Propped commits from openmme/paging branch. Added scripts
for code gen
Change-Id: Ie55032217232214ac8544ca76ea34335205329e4
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();
+}