anjana_sreekumar@infosys.com | 991c206 | 2020-01-08 11:42:57 +0530 | [diff] [blame^] | 1 | /* |
| 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 "twanIdentifierTimestampIe.h" |
| 15 | #include "dataTypeCodecUtils.h" |
| 16 | |
| 17 | TwanIdentifierTimestampIe::TwanIdentifierTimestampIe() |
| 18 | { |
| 19 | ieType = 179; |
| 20 | // TODO |
| 21 | |
| 22 | } |
| 23 | |
| 24 | TwanIdentifierTimestampIe::~TwanIdentifierTimestampIe() { |
| 25 | // TODO Auto-generated destructor stub |
| 26 | } |
| 27 | |
| 28 | bool TwanIdentifierTimestampIe::encodeTwanIdentifierTimestampIe(MsgBuffer &buffer, TwanIdentifierTimestampIeData const &data) |
| 29 | { |
| 30 | if (!(buffer.writeUint32(data.twanIdentifierTimestampvalue))) |
| 31 | { |
| 32 | errorStream.add((char *)"Encoding of twanIdentifierTimestampvalue failed\n"); |
| 33 | return false; |
| 34 | } |
| 35 | |
| 36 | return true; |
| 37 | } |
| 38 | |
| 39 | bool TwanIdentifierTimestampIe::decodeTwanIdentifierTimestampIe(MsgBuffer &buffer, TwanIdentifierTimestampIeData &data, Uint16 length) |
| 40 | { |
| 41 | // TODO optimize the length checks |
| 42 | |
| 43 | Uint16 ieBoundary = buffer.getCurrentIndex() + length; |
| 44 | |
| 45 | buffer.readUint32(data.twanIdentifierTimestampvalue); |
| 46 | if (buffer.getCurrentIndex() > ieBoundary) |
| 47 | { |
| 48 | errorStream.add((char *)"Attempt to read beyond IE boundary: twanIdentifierTimestampvalue\n"); |
| 49 | return false; |
| 50 | } |
| 51 | |
| 52 | // The IE is decoded now. The buffer index should be pointing to the |
| 53 | // IE Boundary. If not, we have some more data left for the IE which we don't know |
| 54 | // how to decode |
| 55 | if (ieBoundary == buffer.getCurrentIndex()) |
| 56 | { |
| 57 | return true; |
| 58 | } |
| 59 | else |
| 60 | { |
| 61 | errorStream.add((char *)"Unable to decode IE TwanIdentifierTimestampIe\n"); |
| 62 | return false; |
| 63 | } |
| 64 | } |
| 65 | void TwanIdentifierTimestampIe::displayTwanIdentifierTimestampIe_v(TwanIdentifierTimestampIeData const &data, Debug &stream) |
| 66 | { |
| 67 | stream.incrIndent(); |
| 68 | stream.add((char *)"TwanIdentifierTimestampIeData:"); |
| 69 | stream.incrIndent(); |
| 70 | stream.endOfLine(); |
| 71 | |
| 72 | stream.add((char *)"twanIdentifierTimestampvalue: "); |
| 73 | stream.add(data.twanIdentifierTimestampvalue); |
| 74 | stream.endOfLine(); |
| 75 | stream.decrIndent(); |
| 76 | stream.decrIndent(); |
| 77 | } |