Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __INET_IPTRAFGEN_H
00021 #define __INET_IPTRAFGEN_H
00022
00023 #include <vector>
00024 #include <omnetpp.h>
00025
00026 #include "IPvXAddress.h"
00027
00028
00032 class INET_API IPTrafSink : public cSimpleModule
00033 {
00034 protected:
00035 int numReceived;
00036
00037 virtual void printPacket(cPacket *msg);
00038 virtual void processPacket(cPacket *msg);
00039
00040 protected:
00041 virtual void initialize();
00042 virtual void handleMessage(cMessage *msg);
00043 };
00044
00045
00049 class INET_API IPTrafGen : public IPTrafSink
00050 {
00051 protected:
00052 std::string nodeName;
00053 int protocol;
00054 int msgByteLength;
00055 int numPackets;
00056 std::vector<IPvXAddress> destAddresses;
00057
00058 static int counter;
00059
00060 int numSent;
00061
00062
00063 virtual IPvXAddress chooseDestAddr();
00064 virtual void sendPacket();
00065
00066 protected:
00067 virtual int numInitStages() const {return 4;}
00068 virtual void initialize(int stage);
00069 virtual void handleMessage(cMessage *msg);
00070 };
00071
00072 #endif
00073
00074