#ifndef ETHERNET_GENERATOR_H #define ETHERNET_GENERATOR_H #include "ns3/application.h" #include "ns3/event-id.h" #include "ns3/ptr.h" #include #include "ns3/ethernet-net-device.h" namespace ns3 { class Socket; class Packet; class EthernetGenerator : public Application { public: /** * \brief Get the type ID. * \return the object TypeId */ static TypeId GetTypeId(); EthernetGenerator(); ~EthernetGenerator() override; /** * \return the total bytes sent by this app */ void Setup(Ptr net); typedef TracedCallback, uint16_t> PacketVlanTraceCallback; protected: void DoDispose() override; private: void StartApplication() override; void StopApplication() override; /** * \brief Send a packet */ void SendBurst(); void Send(); Address m_destAddress; int m_payload_size; int m_burst_size; Time m_period; Time m_interframe; Time m_offset; uint16_t m_vid; uint8_t m_pcp; uint8_t m_dei; EventId m_sendEvent; //!< Event to send the next packet Ptr m_net; PacketVlanTraceCallback m_pktSentTrace; static const uint16_t MIN_PAYLOAD_SIZE = 42; //Min payload size with VLAN }; } // namespace ns3 #endif