blob: a82512ee404f7f98efbc6d6ad5279576c0a2ca53 [file] [log] [blame]
anjana_sreekumar@infosys.com991c2062020-01-08 11:42:57 +05301 /*
2Copyright 2019-present Infosys Limited  
3   
4SPDX-License-Identifier: Apache-2.0  
5  
6*/
7
8
9
10#include "../../../gtpV2Codec/ieClasses/manual/gtpV2Ie.h"
11
12#include "msgBuffer.h"
13
14#define GTP_V2_IE_HEADER_LENGTH 4
15GtpV2Ie::GtpV2Ie() {
16 // TODO Auto-generated constructor stub
17
18}
19
20GtpV2Ie::~GtpV2Ie() {
21 // TODO Auto-generated destructor stub
22}
23
24void GtpV2Ie::decodeGtpV2IeHeader(MsgBuffer &buffer, GtpV2IeHeader &data)
25{
26 // Assume that the pointer in the MsgBuffer is pointing to the start of the IE
27 buffer.readUint8(data.ieType);
28 buffer.readUint16(data.length);
29 buffer.skipBits(4);
30 data.instance = buffer.readBits(4);
31}
32
33void GtpV2Ie::encodeGtpV2IeHeader(MsgBuffer &buffer, GtpV2IeHeader const &data)
34{
35 // Assume that the pointer in the MsgBuffer is pointing to the start of the IE
36 buffer.writeUint8(data.ieType, false);
37 buffer.writeUint16(data.length, false);
38 buffer.skipBits(4);
39 buffer.writeBits(data.instance, 4, false);
40}
41
42void GtpV2Ie::reserveHeaderSpace(MsgBuffer &buffer)
43{
44 buffer.skipBytes(GTP_V2_IE_HEADER_LENGTH);
45}