The SatPacketTrace implements a packet trace functionality. More...
#include "satellite-packet-trace.h"
Public Member Functions | |
| SatPacketTrace () | |
| Constructor. | |
| virtual | ~SatPacketTrace () |
| Destructor. | |
| 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. | |
| virtual void | DoDispose () |
| Dispose of this class instance. | |
| virtual void | NotifyConstructionCompleted () override |
| Notifier called once the ObjectBase is fully constructed. | |
Static Public Member Functions | |
| static TypeId | GetTypeId (void) |
| Get the type ID. | |
Private Member Functions | |
| void | PrintHeader () |
| Print header to the packet trace log. | |
Private Attributes | |
| std::string | m_fileName |
| File name of the packet trace log. | |
| Ptr< OutputStreamWrapper > | m_packetTraceStream |
| Stream wrapper used for packet traces. | |
The SatPacketTrace implements a packet trace functionality.
The movement of packet through the satellite stack can be traced in different protocol layers and direction.
Definition at line 44 of file satellite-packet-trace.h.
| ns3::SatPacketTrace::SatPacketTrace | ( | ) |
Constructor.
Definition at line 44 of file satellite-packet-trace.cc.
|
virtual |
Destructor.
Definition at line 66 of file satellite-packet-trace.cc.
| void ns3::SatPacketTrace::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.
| now | Time time of a trace event |
| packetEvent | Packet event(SND, RCV, DRP, ENQ) |
| nodeType | Node type (UT, SAT, GW, NCC, TER) |
| nodeId | Node id |
| macAddress | MAC address |
| logLevel | Log level (ND, LLC, MAC, PHY, CH) |
| linkDir | Link direction (FWD, RTN) |
| packetInfo | Packet info (List of: Packet id, source MAC address, destination MAC address) |
TODO: Currently the packet trace logs all entries updated by the protocol layers. A filtering functionality may be implemented later, to restrict the amount of output data. The user may configure the filtering rules by attributes, e.g.
Definition at line 112 of file satellite-packet-trace.cc.
References ns3::SatEnums::GetLinkDirName(), ns3::SatEnums::GetLogLevelName(), ns3::SatEnums::GetNodeTypeName(), ns3::SatEnums::GetPacketEventName(), and m_packetTraceStream.
Referenced by ns3::SatBeamHelper::EnablePacketTrace().
|
virtual |
Dispose of this class instance.
Definition at line 85 of file satellite-packet-trace.cc.
|
static |
Get the type ID.
Definition at line 72 of file satellite-packet-trace.cc.
References m_fileName.
|
overridevirtual |
Notifier called once the ObjectBase is fully constructed.
This method is invoked once all member attributes have been initialized. Subclasses can override this method to be notified of this event but if they do this, they must chain up to their parent's NotifyConstructionCompleted method.
Definition at line 50 of file satellite-packet-trace.cc.
References ns3::SatEnvVariables::GetInstance(), m_fileName, m_packetTraceStream, and PrintHeader().
|
private |
Print header to the packet trace log.
Definition at line 92 of file satellite-packet-trace.cc.
References m_packetTraceStream.
Referenced by NotifyConstructionCompleted().
|
private |
File name of the packet trace log.
Definition at line 108 of file satellite-packet-trace.h.
Referenced by GetTypeId(), and NotifyConstructionCompleted().
|
private |
Stream wrapper used for packet traces.
Definition at line 113 of file satellite-packet-trace.h.
Referenced by AddTraceEntry(), NotifyConstructionCompleted(), and PrintHeader().