26 #include "ns3/nstime.h"
27 #include "ns3/event-id.h"
29 #include "ns3/channel.h"
30 #include "ns3/packet.h"
31 #include "ns3/mac48-address.h"
32 #include "ns3/ipv4-header.h"
33 #include "ns3/ipv4-l3-protocol.h"
57 void RegisterDropTracePath (std::string
const &tracePath);
59 void RegisterCsmaLikeDevice (std::string
const &deviceTypeName);
60 void RegisterWifiLikeDevice (std::string
const &deviceTypeName);
61 void RegisterPointToPointLikeDevice (std::string
const &deviceTypeName);
64 void SimulatorRunUntil (
Time time);
66 static void Pause (std::string
const &message);
67 std::vector<std::string> GetPauseMessages ()
const;
76 typedef std::vector<TransmissionSample> TransmissionSampleList;
77 TransmissionSampleList GetTransmissionSamples ()
const;
84 typedef std::vector<PacketDropSample> PacketDropSampleList;
85 PacketDropSampleList GetPacketDropSamples ()
const;
105 std::vector<RxPacketSample> lastReceivedPackets;
106 std::vector<TxPacketSample> lastTransmittedPackets;
107 std::vector<PacketSample> lastDroppedPackets;
112 void SetNodesOfInterest (std::set<uint32_t> nodes);
117 transmittedPackets (0), receivedPackets (0) {}
118 uint64_t transmittedBytes;
119 uint64_t receivedBytes;
120 uint32_t transmittedPackets;
121 uint32_t receivedPackets;
127 std::vector<NetDeviceStatistics> statistics;
130 std::vector<NodeStatistics> GetNodesStatistics ()
const;
132 enum PacketCaptureMode {
133 PACKET_CAPTURE_DISABLED=1,
134 PACKET_CAPTURE_FILTER_HEADERS_OR,
135 PACKET_CAPTURE_FILTER_HEADERS_AND,
140 std::set<TypeId> headers;
141 uint32_t numLastPackets;
142 PacketCaptureMode mode;
151 static void LineClipping (
double boundsX1,
double boundsY1,
double boundsX2,
double boundsY2,
double &lineX1,
double &lineY1,
double &lineX2,
double &lineY2);
160 typedef std::pair<Ptr<Channel>, uint32_t> TxRecordKey;
184 std::map<uint32_t, PacketCaptureOptions> m_packetCaptureOptions;
185 std::vector<std::string> m_pauseMessages;
186 std::map<TxRecordKey, TxRecordValue> m_txRecords;
187 std::map<TransmissionSampleKey, TransmissionSampleValue> m_transmissionSamples;
188 std::map<Ptr<Node>, uint32_t> m_packetDrops;
189 std::set<uint32_t> m_nodesOfInterest;
190 std::map<uint32_t, Time> m_packetsOfInterest;
191 std::map<uint32_t, LastPacketsSample> m_lastPackets;
192 std::map<uint32_t, std::vector<NetDeviceStatistics> > m_nodesStatistics;
220 void DoPause (std::string
const &message);
224 void CallbackStopSimulation ();
helper class to be used by the visualizer
DropReason
Reason why a packet has been dropped.