blob: 72464480e5e9f2023ecc909e73ad60aae8567366 [file] [log] [blame]
anjana_sreekumar@infosys.com991c2062020-01-08 11:42:57 +05301/*
2 * Copyright 2019-present Infosys Limited  
3 *   
4 * SPDX-License-Identifier: Apache-2.0    
5 */
6/******************************************************************************
7 *
8 * This is an auto generated file.
9 * Please do not edit this file.
10 * All edits to be made through template source file
11 * <TOP-DIR/scripts/GtpV2StackCodeGen/tts/ietemplate.cpp.tt>
12 ******************************************************************************/
13
14#include "upFunctionSelectionIndicationFlagsIe.h"
15#include "dataTypeCodecUtils.h"
16
17UpFunctionSelectionIndicationFlagsIe::UpFunctionSelectionIndicationFlagsIe()
18{
19 ieType = 202;
20 // TODO
21
22}
23
24UpFunctionSelectionIndicationFlagsIe::~UpFunctionSelectionIndicationFlagsIe() {
25 // TODO Auto-generated destructor stub
26}
27
28bool UpFunctionSelectionIndicationFlagsIe::encodeUpFunctionSelectionIndicationFlagsIe(MsgBuffer &buffer, UpFunctionSelectionIndicationFlagsIeData const &data)
29{
30 buffer.skipBits(4);
31
32 if(!(buffer.writeBits(data.dcnr, 4)))
33 {
34 errorStream.add((char *)"Encoding of dcnr failed\n");
35 return false;
36 }
37
38 return true;
39}
40
41bool UpFunctionSelectionIndicationFlagsIe::decodeUpFunctionSelectionIndicationFlagsIe(MsgBuffer &buffer, UpFunctionSelectionIndicationFlagsIeData &data, Uint16 length)
42{
43 // TODO optimize the length checks
44
45 Uint16 ieBoundary = buffer.getCurrentIndex() + length;
46 buffer.skipBits(4);
47 if (buffer.getCurrentIndex() > ieBoundary)
48 {
49 errorStream.add((char *)"Attempt to read beyond IE boundary: \n");
50 return false;
51 }
52
53 data.dcnr = buffer.readBits(4);
54 // confirm that we are not reading beyond the IE boundary
55 if (buffer.getCurrentIndex() > ieBoundary)
56 {
57 errorStream.add((char *)"Attempt to read beyond IE boundary: dcnr\n");
58 return false;
59 }
60
61 // The IE is decoded now. The buffer index should be pointing to the
62 // IE Boundary. If not, we have some more data left for the IE which we don't know
63 // how to decode
64 if (ieBoundary == buffer.getCurrentIndex())
65 {
66 return true;
67 }
68 else
69 {
70 errorStream.add((char *)"Unable to decode IE UpFunctionSelectionIndicationFlagsIe\n");
71 return false;
72 }
73}
74void UpFunctionSelectionIndicationFlagsIe::displayUpFunctionSelectionIndicationFlagsIe_v(UpFunctionSelectionIndicationFlagsIeData const &data, Debug &stream)
75{
76 stream.incrIndent();
77 stream.add((char *)"UpFunctionSelectionIndicationFlagsIeData:");
78 stream.incrIndent();
79 stream.endOfLine();
80
81 stream.add( (char *)"dcnr: ");
82 stream.add((Uint8)data.dcnr);
83 stream.endOfLine();
84 stream.decrIndent();
85 stream.decrIndent();
86}