TrafficGenerator is an abstract C++ class defined as follows:
class TrafficGenerator : public Application {
public:
TrafficGenerator();
virtual double next_interval(int &) = 0;
virtual void init() {}
virtual double interval() { return 0; }
virtual int on() { return 0; }
virtual void timeout();
virtual void recv() {}
virtual void resume() {}
protected:
virtual void start();
virtual void stop();
double nextPkttime_;
int size_;
int running_;
TrafficTimer timer_;
};
The pure virtual function []next_interval returns the time until the
next packet is created and also sets the size in bytes of the next
packet. The function []start calls init and starts the
timer. The function []timeout sends a packet and reschedules the
next timeout. The function []stop cancels any pending transmissions.
Callbacks are typically not used for traffic generators, so these
functions (recv, resume) are null.
Currently, there are four C++ classes derived from the class TrafficGenerator: