122 lines
2.5 KiB
C++
122 lines
2.5 KiB
C++
#ifndef GPTP_PACKET_H
|
|
#define GPTP_PACKET_H
|
|
|
|
#include "ns3/object.h"
|
|
#include "ns3/packet.h"
|
|
|
|
namespace ns3
|
|
{
|
|
|
|
class PdelayPayload : public Object
|
|
{
|
|
public :
|
|
/**
|
|
* \brief Get the TypeId
|
|
*
|
|
* \return The TypeId for this class
|
|
*/
|
|
static TypeId GetTypeId();
|
|
|
|
/**
|
|
* \brief Create a PdelayPayload
|
|
*/
|
|
PdelayPayload();
|
|
PdelayPayload(uint64_t timestampSecond, uint32_t timestampNanoSecond, uint64_t clockIdentity, uint16_t portIdentity);
|
|
|
|
/**
|
|
* Destroy a PdelayPacket
|
|
*
|
|
* This is the destructor for the PdelayPayload.
|
|
*/
|
|
~PdelayPayload();
|
|
|
|
Ptr<Packet> GetPkt();
|
|
|
|
private :
|
|
Ptr<Packet> m_pkt = nullptr;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
class SyncPayload : public Object
|
|
{
|
|
public :
|
|
/**
|
|
* \brief Get the TypeId
|
|
*
|
|
* \return The TypeId for this class
|
|
*/
|
|
static TypeId GetTypeId();
|
|
|
|
/**
|
|
* \brief Create a SyncPayload
|
|
*/
|
|
SyncPayload();
|
|
SyncPayload(uint64_t timestampSecond, uint32_t timestampNanoSecond);
|
|
|
|
/**
|
|
* Destroy a SyncPayload
|
|
*
|
|
* This is the destructor for the SyncPayload.
|
|
*/
|
|
~SyncPayload();
|
|
|
|
Ptr<Packet> GetPkt();
|
|
|
|
private :
|
|
Ptr<Packet> m_pkt = nullptr;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class FollowUpPayload : public Object
|
|
{
|
|
public :
|
|
/**
|
|
* \brief Get the TypeId
|
|
*
|
|
* \return The TypeId for this class
|
|
*/
|
|
static TypeId GetTypeId();
|
|
|
|
/**
|
|
* \brief Create a FollowUpPayload
|
|
*/
|
|
FollowUpPayload();
|
|
FollowUpPayload(uint64_t timestampSecond,
|
|
uint32_t timestampNanoSecond,
|
|
uint32_t cumulativeScaledRateRatio,
|
|
uint16_t gmTimeBaseIndicator,
|
|
uint32_t lastGmPhaseChange0,
|
|
uint32_t lastGmPhaseChange1,
|
|
uint32_t lastGmPhaseChange2,
|
|
uint32_t scaledLastGmFreqChange);
|
|
|
|
/**
|
|
* Destroy a FollowUpPayload
|
|
*
|
|
* This is the destructor for the SyncPayload.
|
|
*/
|
|
~FollowUpPayload();
|
|
|
|
Ptr<Packet> GetPkt();
|
|
|
|
private :
|
|
Ptr<Packet> m_pkt = nullptr;
|
|
|
|
uint16_t m_tlvType = 0x3; //STD 802.1AS-2020 : 11.4.4.3.2
|
|
uint16_t m_lenghtField = 28; //STD 802.1AS-2020 : 11.4.4.3.3
|
|
uint32_t m_organizationId = 0x0080C2; //STD 802.1AS-2020 : 11.4.4.3.4
|
|
uint32_t m_organizationSubType = 1; //STD 802.1AS-2020 : 11.4.4.3.5
|
|
|
|
|
|
};
|
|
|
|
}
|
|
#endif /* GPTP_PACKET_H */
|