/usr/include/ns3.26/ns3/epc-gtpu-header.h is in libns3-dev 3.26+dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Jaume Nin <jnin@cttc.cat>
*/
#ifndef EPS_GTPU_V1_H
#define EPS_GTPU_V1_H
#include <ns3/ptr.h>
#include <ns3/header.h>
#include <ns3/ipv4-header.h>
namespace ns3 {
class Packet;
/**
* \ingroup lte
*
* Implementation of the GTPv1-U Release 10 as per 3Gpp TS 29.281 document
*/
class GtpuHeader : public Header
{
public:
static TypeId GetTypeId (void);
GtpuHeader ();
virtual ~GtpuHeader ();
virtual TypeId GetInstanceTypeId (void) const;
virtual uint32_t GetSerializedSize (void) const;
virtual void Serialize (Buffer::Iterator start) const;
virtual uint32_t Deserialize (Buffer::Iterator start);
virtual void Print (std::ostream &os) const;
bool GetExtensionHeaderFlag () const;
uint16_t GetLength () const;
uint8_t GetMessageType () const;
uint8_t GetNPduNumber () const;
bool GetNPduNumberFlag () const;
uint8_t GetNextExtensionType () const;
bool GetProtocolType () const;
uint16_t GetSequenceNumber () const;
bool GetSequenceNumberFlag () const;
uint32_t GetTeid () const;
uint8_t GetVersion () const;
void SetExtensionHeaderFlag (bool m_extensionHeaderFlag);
void SetLength (uint16_t m_length);
void SetMessageType (uint8_t m_messageType);
void SetNPduNumber (uint8_t m_nPduNumber);
void SetNPduNumberFlag (bool m_nPduNumberFlag);
void SetNextExtensionType (uint8_t m_nextExtensionType);
void SetProtocolType (bool m_protocolType);
void SetSequenceNumber (uint16_t m_sequenceNumber);
void SetSequenceNumberFlag (bool m_sequenceNumberFlag);
void SetTeid (uint32_t m_teid);
void SetVersion (uint8_t m_version);
bool operator == (const GtpuHeader& b) const;
private:
/**
* This field is used to determine the version of the GTPU-U protocol. The version number shall be set to 1.
*/
uint8_t m_version; // really a 3 uint3_t
/**
* This bit is used as a protocol discriminator between GTP (when PT is '1') and GTP' (when
* PT is '0').
*/
bool m_protocolType;
/**
* This flag indicates the presence of a meaningful value of the Next Extension Header
* field. When it is set to '0', the Next Extension Header field either is not present
* or, if present, shall not be interpreted. When it is set to '1', the Next Extension
* Header field is present, and shall be interpreted
*/
bool m_extensionHeaderFlag;
/**
* This flag indicates the presence of a meaningful value of the Sequence Number field.
* When it is set to '0', the Sequence Number field either is not present or, if present,
* shall not be interpreted. When it is set to '1', the Sequence Number field is present,
* and shall be interpreted
*/
bool m_sequenceNumberFlag;
/**
* This flag indicates the presence of a meaningful value of the N-PDU Number field.
* When it is set to '0', the N-PDU Number field either is not present, or, if present,
* shall not be interpreted. When it is set to '1', the N-PDU Number field is present,
* and shall be interpreted
*/
bool m_nPduNumberFlag;
/**
* This field indicates the type of GTP-U message
*/
uint8_t m_messageType;
/**
* This field indicates the length in octets of the payload, i.e. the rest of the packet
* following the mandatory part of the GTP header (that is the first 8 octets).
* The Sequence Number, the N-PDU Number or any Extension headers shall be considered
* to be part of the payload, i.e. included in the length count
*/
uint16_t m_length;
/**
* This field unambiguously identifies a tunnel endpoint in the receiving GTP-U
* protocol entity. The receiving end side of a GTP tunnel locally assigns the
* TEID value the transmitting side has to use.
*/
uint32_t m_teid;
/**
* If Sequence Number field is used for G-PDUs (T-PDUs+headers), an increasing
* sequence number for T-PDUs is transmitted via GTP-U tunnels, when transmission
* order must be preserved
*/
uint16_t m_sequenceNumber;
/**
* This field is used at the Inter SGSN Routeing Area Update procedure and some
* inter-system handover procedures (e.g. between 2G and 3G radio access networks).
* This field is used to co-ordinate the data transmission for acknowledged mode
* of communication between the MS and the SGSN
*/
uint8_t m_nPduNumber;
/**
* This field defines the type of Extension Header that follows this field in
* the GTP-PDU
*/
uint8_t m_nextExtensionType;
};
} // namespace ns3
#endif /* EPS_GTPU_V1_H */
|