lte: Add EpcX2HandoverCancelHeader

This commit is contained in:
ZorazeAli
2019-03-25 14:18:07 +01:00
committed by Tom Henderson
parent e3ae60fceb
commit 84b4e82757
2 changed files with 201 additions and 1 deletions

View File

@@ -1489,4 +1489,130 @@ EpcX2ResourceStatusUpdateHeader::GetNumberOfIes () const
return m_numberOfIes;
}
///////////////////////////////////////////////////////////////////////////////
NS_OBJECT_ENSURE_REGISTERED (EpcX2HandoverCancelHeader);
EpcX2HandoverCancelHeader::EpcX2HandoverCancelHeader ()
: m_numberOfIes (3),
m_headerLength (6),
m_oldEnbUeX2apId (0xfffa),
m_newEnbUeX2apId (0xfffa),
m_cause (0xfffa)
{
}
EpcX2HandoverCancelHeader::~EpcX2HandoverCancelHeader ()
{
m_numberOfIes = 0;
m_headerLength = 0;
m_oldEnbUeX2apId = 0xfffb;
m_newEnbUeX2apId = 0xfffb;
m_cause = 0xfffb;
}
TypeId
EpcX2HandoverCancelHeader::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::EpcX2HandoverCancelHeader")
.SetParent<Header> ()
.SetGroupName("Lte")
.AddConstructor<EpcX2HandoverCancelHeader> ()
;
return tid;
}
TypeId
EpcX2HandoverCancelHeader::GetInstanceTypeId (void) const
{
return GetTypeId ();
}
uint32_t
EpcX2HandoverCancelHeader::GetSerializedSize (void) const
{
return m_headerLength;
}
void
EpcX2HandoverCancelHeader::Serialize (Buffer::Iterator start) const
{
Buffer::Iterator i = start;
i.WriteHtonU16 (m_oldEnbUeX2apId);
i.WriteHtonU16 (m_newEnbUeX2apId);
i.WriteHtonU16 (m_cause);
}
uint32_t
EpcX2HandoverCancelHeader::Deserialize (Buffer::Iterator start)
{
Buffer::Iterator i = start;
m_oldEnbUeX2apId = i.ReadNtohU16 ();
m_newEnbUeX2apId = i.ReadNtohU16 ();
m_cause = i.ReadNtohU16 ();
m_numberOfIes = 3;
m_headerLength = 6;
return GetSerializedSize ();
}
void
EpcX2HandoverCancelHeader::Print (std::ostream &os) const
{
os << "OldEnbUeX2apId=" << m_oldEnbUeX2apId;
os << " NewEnbUeX2apId=" << m_newEnbUeX2apId;
os << " Cause = " << m_cause;
}
uint16_t
EpcX2HandoverCancelHeader::GetOldEnbUeX2apId () const
{
return m_oldEnbUeX2apId;
}
void
EpcX2HandoverCancelHeader::SetOldEnbUeX2apId (uint16_t x2apId)
{
m_oldEnbUeX2apId = x2apId;
}
uint16_t
EpcX2HandoverCancelHeader::GetNewEnbUeX2apId () const
{
return m_newEnbUeX2apId;
}
void
EpcX2HandoverCancelHeader::SetNewEnbUeX2apId (uint16_t x2apId)
{
m_newEnbUeX2apId = x2apId;
}
uint16_t
EpcX2HandoverCancelHeader::GetCause () const
{
return m_cause;
}
void
EpcX2HandoverCancelHeader::SetCause (uint16_t cause)
{
m_cause = cause;
}
uint32_t
EpcX2HandoverCancelHeader::GetLengthOfIes () const
{
return m_headerLength;
}
uint32_t
EpcX2HandoverCancelHeader::GetNumberOfIes () const
{
return m_numberOfIes;
}
} // namespace ns3

View File

@@ -82,9 +82,10 @@ public:
void SetNumberOfIes (uint32_t numberOfIes);
/// Procedure code enumeration
/// Procedure code enumeration 9.3.7
enum ProcedureCode_t {
HandoverPreparation = 0,
HandoverCancel = 1,
LoadIndication = 2,
SnStatusTransfer = 4,
UeContextRelease = 5,
@@ -653,6 +654,79 @@ private:
std::vector <EpcX2Sap::CellMeasurementResultItem> m_cellMeasurementResultList; ///< cell measurement result list
};
/**
* EpcX2HandoverCancelHeader
*/
class EpcX2HandoverCancelHeader : public Header
{
public:
EpcX2HandoverCancelHeader ();
virtual ~EpcX2HandoverCancelHeader ();
/**
* \brief Get the type ID.
* \return the object TypeId
*/
static TypeId GetTypeId (void);
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;
/**
* \brief Get old ENB UE X2 AP ID function
* \returns the old ENB UE X2 AP ID
*/
uint16_t GetOldEnbUeX2apId () const;
/**
* \brief Set old ENB UE X2 AP ID function
* \param x2apId the old ENB UE X2 AP ID
*/
void SetOldEnbUeX2apId (uint16_t x2apId);
/**
* \brief Get new ENB UE X2 AP ID function
* \returns the new ENB UE X2 AP ID
*/
uint16_t GetNewEnbUeX2apId () const;
/**
* \brief Set new ENB UE X2 AP ID function
* \param x2apId the new ENB UE X2 AP ID
*/
void SetNewEnbUeX2apId (uint16_t x2apId);
/**
* \brief Get cause function
* \returns the cause
*/
uint16_t GetCause () const;
/**
* \brief Set cause function
* \param cause
*/
void SetCause (uint16_t cause);
/**
* \brief Get length of IEs function
* \returns the length of IEs
*/
uint32_t GetLengthOfIes () const;
/**
* \brief Get number of IEs function
* \returns the number of IEs
*/
uint32_t GetNumberOfIes () const;
private:
uint32_t m_numberOfIes; ///< number of IEs
uint32_t m_headerLength; ///< header length
uint16_t m_oldEnbUeX2apId; ///< old ENB UE X2 AP ID
uint16_t m_newEnbUeX2apId; ///< new ENB UE X2 AP ID
uint16_t m_cause; ///< cause
};
} // namespace ns3