26#include "ns3/mac48-address.h"
27#include "ns3/object.h"
28#include "ns3/output-stream-wrapper.h"
29#include "ns3/singleton.h"
30#include "ns3/string.h"
31#include "ns3/trace-helper.h"
37NS_LOG_COMPONENT_DEFINE(
"SatPacketTrace");
46 NS_LOG_FUNCTION(
this);
52 NS_LOG_FUNCTION(
this);
54 Object::NotifyConstructionCompleted();
56 AsciiTraceHelper asciiTraceHelper;
58 std::stringstream outputPath;
68 NS_LOG_FUNCTION(
this);
74 static TypeId tid = TypeId(
"ns3::SatPacketTrace")
76 .AddAttribute(
"FileName",
77 "File name for the packet trace output",
78 StringValue(
"PacketTrace"),
87 NS_LOG_FUNCTION(
this);
94 NS_LOG_FUNCTION(
this);
106 <<
"Packet info (List of: Packet id, source MAC address, destination MAC address)"
116 Mac48Address macAddress,
119 std::string packetInfo)
121 NS_LOG_FUNCTION(
this << now.GetSeconds());
134 std::ostringstream oss;
SatLinkDir_t
Link direction used for packet tracing.
static std::string GetNodeTypeName(SatNodeType_t nodeType)
SatNodeType_t
Node type used for packet tracing.
static std::string GetLinkDirName(SatLinkDir_t linkDir)
SatPacketEvent_t
Packet event used for packet tracing.
static std::string GetPacketEventName(SatPacketEvent_t packetEvent)
static std::string GetLogLevelName(SatLogLevel_t logLevel)
SatLogLevel_t
Log level used for packet tracing.
static Ptr< SatEnvVariables > GetInstance()
The SatPacketTrace implements a packet trace functionality.
virtual ~SatPacketTrace()
Destructor.
Ptr< OutputStreamWrapper > m_packetTraceStream
Stream wrapper used for packet traces.
virtual void NotifyConstructionCompleted() override
Notifier called once the ObjectBase is fully constructed.
virtual void DoDispose()
Dispose of this class instance.
SatPacketTrace()
Constructor.
std::string m_fileName
File name of the packet trace log.
void PrintHeader()
Print header to the packet trace log.
void AddTraceEntry(Time now, SatEnums::SatPacketEvent_t packetEvent, SatEnums::SatNodeType_t nodeType, uint32_t nodeId, Mac48Address macAddress, SatEnums::SatLogLevel_t logLevel, SatEnums::SatLinkDir_t linkDir, std::string packetInfo)
Add a packet trace entry to the log.
static TypeId GetTypeId(void)
Get the type ID.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.