67 i.WriteU8((
VERSION << 5) | (1 << 3));
87 uint8_t version = (
firstByte >> 5) & 0x07;
197 i.WriteHtonU64(imsi);
203 uint8_t type =
i.ReadU8();
204 NS_ASSERT_MSG(type == 1,
"Wrong IMSI IE type = " << (uint16_t)type);
205 uint16_t length =
i.ReadNtohU16();
209 imsi =
i.ReadNtohU64();
227 uint8_t type =
i.ReadU8();
228 NS_ASSERT_MSG(type == 2,
"Wrong Cause IE type = " << (uint16_t)type);
229 uint16_t length =
i.ReadNtohU16();
245 i.WriteU8(epsBearerId & 0x0f);
251 uint8_t type =
i.ReadU8();
252 NS_ASSERT_MSG(type == 73,
"Wrong EBI IE type = " << (uint16_t)type);
253 uint16_t length =
i.ReadNtohU16();
257 epsBearerId =
i.ReadU8() & 0x0f;
265 i.WriteU8((
data >> 32) & 0xff);
266 i.WriteU8((
data >> 24) & 0xff);
267 i.WriteU8((
data >> 16) & 0xff);
268 i.WriteU8((
data >> 8) & 0xff);
269 i.WriteU8((
data >> 0) & 0xff);
305 uint8_t type =
i.ReadU8();
306 NS_ASSERT_MSG(type == 80,
"Wrong Bearer QoS IE type = " << (uint16_t)type);
307 uint16_t length =
i.ReadNtohU16();
331 i.WriteU8((
pf.direction << 4) & 0x30);
332 i.WriteU8(
pf.precedence);
336 i.WriteHtonU32(
pf.remoteAddress.Get());
337 i.WriteHtonU32(
pf.remoteMask.Get());
339 i.WriteHtonU32(
pf.localAddress.Get());
340 i.WriteHtonU32(
pf.localMask.Get());
342 i.WriteHtonU16(
pf.localPortStart);
343 i.WriteHtonU16(
pf.localPortEnd);
345 i.WriteHtonU16(
pf.remotePortStart);
346 i.WriteHtonU16(
pf.remotePortEnd);
348 i.WriteU8(
pf.typeOfService);
349 i.WriteU8(
pf.typeOfServiceMask);
356 uint8_t type =
i.ReadU8();
357 NS_ASSERT_MSG(type == 84,
"Wrong Bearer TFT IE type = " << (uint16_t)type);
411 uint8_t type =
i.ReadU8();
412 NS_ASSERT_MSG(type == 86,
"Wrong ULI ECGI IE type = " << (uint16_t)type);
413 uint16_t length =
i.ReadNtohU16();
418 uliEcgi =
i.ReadNtohU32() & 0x0fffffff;
430 i.WriteHtonU32(fteid.
teid);
437 uint8_t type =
i.ReadU8();
438 NS_ASSERT_MSG(type == 87,
"Wrong FTEID IE type = " << (uint16_t)type);
439 uint16_t length =
i.ReadNtohU16();
443 uint8_t flags =
i.ReadU8();
445 fteid.
teid =
i.ReadNtohU32();
462 uint8_t type =
i.ReadU8();
463 NS_ASSERT_MSG(type == 93,
"Wrong Bearer Context IE type = " << (uint16_t)type);
464 length =
i.ReadNtohU16();
476 static TypeId tid =
TypeId(
"ns3::GtpcCreateSessionRequestMessage")
534 std::list<EpcTft::PacketFilter>
packetFilters =
bc.tft->GetPacketFilters();
558 while (
i.GetRemainingSize() > 0)
621std::list<GtpcCreateSessionRequestMessage::BearerContextToBeCreated>
629 std::list<GtpcCreateSessionRequestMessage::BearerContextToBeCreated>
bearerContexts)
639 static TypeId tid =
TypeId(
"ns3::GtpcCreateSessionResponseMessage")
695 std::list<EpcTft::PacketFilter>
packetFilters =
bc.tft->GetPacketFilters();
718 while (
i.GetRemainingSize() > 0)
769std::list<GtpcCreateSessionResponseMessage::BearerContextCreated>
777 std::list<GtpcCreateSessionResponseMessage::BearerContextCreated>
bearerContexts)
787 static TypeId tid =
TypeId(
"ns3::GtpcModifyBearerRequestMessage")
855 while (
i.GetRemainingSize() > 0)
901std::list<GtpcModifyBearerRequestMessage::BearerContextToBeModified>
909 std::list<GtpcModifyBearerRequestMessage::BearerContextToBeModified>
bearerContexts)
919 static TypeId tid =
TypeId(
"ns3::GtpcModifyBearerResponseMessage")
978 os <<
" cause " << (uint16_t)
m_cause;
998 static TypeId tid =
TypeId(
"ns3::GtpcDeleteBearerCommandMessage")
1000 .SetGroupName(
"Lte")
1055 while (
i.GetRemainingSize() > 0)
1071 os <<
" bearerContexts [";
1079std::list<GtpcDeleteBearerCommandMessage::BearerContext>
1087 std::list<GtpcDeleteBearerCommandMessage::BearerContext>
bearerContexts)
1097 static TypeId tid =
TypeId(
"ns3::GtpcDeleteBearerRequestMessage")
1099 .SetGroupName(
"Lte")
1151 while (
i.GetRemainingSize() > 0)
1153 uint8_t epsBearerId;
1164 os <<
" epsBearerIds [";
1167 os << (uint16_t)epsBearerId <<
" ";
1189 static TypeId tid =
TypeId(
"ns3::GtpcDeleteBearerResponseMessage")
1191 .SetGroupName(
"Lte")
1248 while (
i.GetRemainingSize() > 0)
1250 uint8_t epsBearerId;
1261 os <<
" cause " << (uint16_t)
m_cause <<
" epsBearerIds [";
1264 os << (uint16_t)epsBearerId <<
" ";
iterator in a Buffer instance
Direction
Indicates the direction of the traffic that is to be classified.
This class contains the specification of EPS Bearers.
GTP-C Create Session Request Message.
std::list< BearerContextToBeCreated > m_bearerContextsToBeCreated
Bearer Context list.
static TypeId GetTypeId()
Get the type ID.
uint64_t GetImsi() const
Get the IMSI.
uint32_t Deserialize(Buffer::Iterator start) override
void SetUliEcgi(uint32_t uliEcgi)
Set the UliEcgi.
GtpcHeader::Fteid_t GetSenderCpFteid() const
Get the Sender CpFteid.
uint32_t GetUliEcgi() const
Get the UliEcgi.
uint32_t GetMessageSize() const override
Get the message size.
uint32_t GetSerializedSize() const override
uint32_t m_uliEcgi
UliEcgi.
GtpcHeader::Fteid_t m_senderCpFteid
Sender CpFteid.
void SetBearerContextsToBeCreated(std::list< BearerContextToBeCreated > bearerContexts)
Set the Bearer Contexts.
std::list< BearerContextToBeCreated > GetBearerContextsToBeCreated() const
Get the Bearer Contexts.
~GtpcCreateSessionRequestMessage() override
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
void Serialize(Buffer::Iterator start) const override
void SetImsi(uint64_t imsi)
Set the IMSI.
void Print(std::ostream &os) const override
void SetSenderCpFteid(GtpcHeader::Fteid_t fteid)
Set the Sender CpFteid.
GtpcCreateSessionRequestMessage()
GTP-C Create Session Response Message.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
void SetCause(Cause_t cause)
Set the Cause.
static TypeId GetTypeId()
Get the type ID.
uint32_t Deserialize(Buffer::Iterator start) override
void SetBearerContextsCreated(std::list< BearerContextCreated > bearerContexts)
Set the Bearer Contexts.
Cause_t GetCause() const
Get the Cause.
void Print(std::ostream &os) const override
void SetSenderCpFteid(GtpcHeader::Fteid_t fteid)
Set the Sender CpFteid.
void Serialize(Buffer::Iterator start) const override
uint32_t GetSerializedSize() const override
std::list< BearerContextCreated > m_bearerContextsCreated
Container of Bearer Contexts.
std::list< BearerContextCreated > GetBearerContextsCreated() const
Get the Container of Bearer Contexts.
GtpcCreateSessionResponseMessage()
uint32_t GetMessageSize() const override
Get the message size.
GtpcHeader::Fteid_t m_senderCpFteid
Sender CpFteid.
~GtpcCreateSessionResponseMessage() override
GtpcHeader::Fteid_t GetSenderCpFteid() const
Get the Sender CpFteid.
GTP-C Delete Bearer Command Message.
void Print(std::ostream &os) const override
std::list< BearerContext > GetBearerContexts() const
Get the Bearer contexts.
GtpcDeleteBearerCommandMessage()
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
std::list< BearerContext > m_bearerContexts
Container of Bearer Contexts.
void SetBearerContexts(std::list< BearerContext > bearerContexts)
Set the Bearer contexts.
uint32_t GetMessageSize() const override
Get the message size.
static TypeId GetTypeId()
Get the type ID.
uint32_t GetSerializedSize() const override
uint32_t Deserialize(Buffer::Iterator start) override
~GtpcDeleteBearerCommandMessage() override
void Serialize(Buffer::Iterator start) const override
GTP-C Delete Bearer Request Message.
uint32_t GetSerializedSize() const override
uint32_t GetMessageSize() const override
Get the message size.
static TypeId GetTypeId()
Get the type ID.
void Print(std::ostream &os) const override
GtpcDeleteBearerRequestMessage()
~GtpcDeleteBearerRequestMessage() override
std::list< uint8_t > m_epsBearerIds
Container of Bearers IDs.
uint32_t Deserialize(Buffer::Iterator start) override
void Serialize(Buffer::Iterator start) const override
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
std::list< uint8_t > GetEpsBearerIds() const
Get the Bearers IDs.
void SetEpsBearerIds(std::list< uint8_t > epsBearerIds)
Set the Bearers IDs.
GTP-C Delete Bearer Response Message.
void Serialize(Buffer::Iterator start) const override
uint32_t GetSerializedSize() const override
GtpcDeleteBearerResponseMessage()
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
void SetCause(Cause_t cause)
Set the Cause.
Cause_t GetCause() const
Get the Cause.
std::list< uint8_t > m_epsBearerIds
Container of Bearers IDs.
uint32_t GetMessageSize() const override
Get the message size.
std::list< uint8_t > GetEpsBearerIds() const
Get the Bearers IDs.
void Print(std::ostream &os) const override
~GtpcDeleteBearerResponseMessage() override
uint32_t Deserialize(Buffer::Iterator start) override
static TypeId GetTypeId()
Get the type ID.
void SetEpsBearerIds(std::list< uint8_t > epsBearerIds)
Set the Bearers IDs.
uint32_t DeserializeFteid(Buffer::Iterator &i, GtpcHeader::Fteid_t &fteid) const
Deserialize the Fteid.
void SerializeEbi(Buffer::Iterator &i, uint8_t epsBearerId) const
Serialize the eps Bearer Id.
void SerializeBearerContextHeader(Buffer::Iterator &i, uint16_t length) const
Serialize the Bearer Context Header.
uint32_t DeserializeImsi(Buffer::Iterator &i, uint64_t &imsi) const
Deserialize the IMSI.
uint32_t DeserializeEbi(Buffer::Iterator &i, uint8_t &epsBearerId) const
Deserialize the eps Bearer Id.
const uint32_t serializedSizeEbi
EBI serialized size.
void WriteHtonU40(Buffer::Iterator &i, uint64_t data) const
void SerializeImsi(Buffer::Iterator &i, uint64_t imsi) const
Serialize the IMSI.
uint32_t DeserializeUliEcgi(Buffer::Iterator &i, uint32_t &uliEcgi) const
Deserialize the UliEcgi.
const uint32_t serializedSizeBearerContextHeader
Fteid serialized size.
uint32_t DeserializeCause(Buffer::Iterator &i, Cause_t &cause) const
Deserialize the Cause.
uint32_t GetSerializedSizeBearerTft(std::list< EpcTft::PacketFilter > packetFilters) const
void SerializeFteid(Buffer::Iterator &i, GtpcHeader::Fteid_t fteid) const
Serialize the Fteid_t.
uint32_t DeserializeBearerTft(Buffer::Iterator &i, Ptr< EpcTft > epcTft) const
Deserialize the Bearer TFT.
const uint32_t serializedSizePacketFilter
Packet filter serialized size.
uint64_t ReadNtohU40(Buffer::Iterator &i)
void SerializeUliEcgi(Buffer::Iterator &i, uint32_t uliEcgi) const
Serialize the UliEcgi.
const uint32_t serializedSizeImsi
IMSI serialized size.
const uint32_t serializedSizeBearerQos
Bearer QoS serialized size.
const uint32_t serializedSizeCause
Cause serialized size.
uint32_t DeserializeBearerContextHeader(Buffer::Iterator &i, uint16_t &length) const
Deserialize the Bearer Context Header.
void SerializeCause(Buffer::Iterator &i, Cause_t cause) const
Serialize the Cause.
uint32_t DeserializeBearerQos(Buffer::Iterator &i, EpsBearer &bearerQos)
Deserialize the eps Bearer QoS.
void SerializeBearerQos(Buffer::Iterator &i, EpsBearer bearerQos) const
Serialize the eps Bearer QoS.
const uint32_t serializedSizeUliEcgi
UliEcgi serialized size.
const uint32_t serializedSizeFteid
Fteid serialized size.
void SerializeBearerTft(Buffer::Iterator &i, std::list< EpcTft::PacketFilter > packetFilters) const
Serialize the Bearer TFT.
GTP-C Modify Bearer Request Message.
uint64_t GetImsi() const
Get the IMSI.
void Print(std::ostream &os) const override
void SetBearerContextsToBeModified(std::list< BearerContextToBeModified > bearerContexts)
Set the Bearer Contexts.
uint32_t GetUliEcgi() const
Get the UliEcgi.
void SetUliEcgi(uint32_t uliEcgi)
Set the UliEcgi.
GtpcModifyBearerRequestMessage()
uint32_t Deserialize(Buffer::Iterator start) override
std::list< BearerContextToBeModified > GetBearerContextsToBeModified() const
Get the Bearer Contexts.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
uint32_t GetMessageSize() const override
Get the message size.
static TypeId GetTypeId()
Get the type ID.
void SetImsi(uint64_t imsi)
Set the IMSI.
std::list< BearerContextToBeModified > m_bearerContextsToBeModified
Bearer Context list.
uint32_t m_uliEcgi
UliEcgi.
uint32_t GetSerializedSize() const override
~GtpcModifyBearerRequestMessage() override
void Serialize(Buffer::Iterator start) const override
GTP-C Modify Bearer Response Message.
uint32_t Deserialize(Buffer::Iterator start) override
~GtpcModifyBearerResponseMessage() override
uint32_t GetSerializedSize() const override
uint32_t GetMessageSize() const override
Get the message size.
void SetCause(Cause_t cause)
Set the Cause.
GtpcModifyBearerResponseMessage()
static TypeId GetTypeId()
Get the type ID.
void Print(std::ostream &os) const override
Cause_t GetCause() const
Get the Cause.
void Serialize(Buffer::Iterator start) const override
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Ipv4 addresses are stored in host order in this class.
void Set(uint32_t address)
input address is in host order.
uint32_t Get() const
Get the host-order 32-bit IP address.
a class to represent an Ipv4 address mask
Smart pointer class similar to boost::intrusive_ptr.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static const uint8_t VERSION
GTPv2-C protocol version number.
Implement the data structure representing a TrafficFlowTemplate Packet Filter.
Direction direction
Whether the filter needs to be applied to uplink / downlink only, or in both cases.
Bearer Context structure.
Bearer Context structure.
Bearer Context structure.