20 #define PORTSLOAD_GENERATOR_TIMEOUT "PDUFG_RateGenerator"
21 #define PORTSLOAD_GENERATOR_UPDATE 0
22 #define PORTSLOAD_GENERATOR_LOCAL 1
29 if(msg->isSelfMessage())
32 #ifdef PORTSLOADGENERATOR_ENHANCED_DEBUG
33 std::ostringstream str;
38 for(
NentriesIt e = t->second.begin(); e != t->second.end(); ++e)
49 Address((*p)->getFlow()->getDstApni().getApn().
52 #ifdef PORTSLOADGENERATOR_ENHANCED_DEBUG
53 str << t->first <<
", " <<
67 EV <<
"Rate to " << t->first <<
", " << e->first
68 <<
" updated to " << rate <<
"." << endl;
72 EV <<
"Rate to " << t->first <<
", " << e->first
73 <<
" is the same(at " << rate <<
")." << endl;
83 EV <<
"Rate to " << t->first <<
", " << e->first
84 <<
" updated to " << rate <<
"." << endl;
93 #ifdef PORTSLOADGENERATOR_ENHANCED_DEBUG
94 cModule * ipcm = check_and_cast<cModule *>(getModuleByPath(
"^.^.^"));
95 cDisplayString & cs = ipcm->getDisplayString();
96 cs.setTagArg(
"t", 1,
"l");
97 cs.setTagArg(
"t", 0, str.str().c_str());
144 rtInt = par(
"rateInterval");
145 upInt = par(
"updateInterval");
149 getModuleByPath(
"^.^.relayAndMux.pduForwardingPolicy"));
153 getModuleByPath(
"^.^.routingPolicy"));
157 getModuleByPath(
"^.^.relayAndMux.queueMonitorPolicy"));
160 difA = check_and_cast<
DA *>(getModuleByPath(
"^.^.^.difAllocator.da"));
191 QTRIter qi = ri->second.find(qos);
194 if(qi != ri->second.end())
236 for(
entries2NextIt it = changes.begin(); it!= changes.end(); it++)
239 std::string nextHop = it->second;
250 if(pit != n->second.end())
252 if(pit->second.size()>0)
254 p = *(pit->second.begin());
virtual void onPolicyInit()
Nentries::iterator NentriesIt
#define PORTSLOAD_GENERATOR_TIMEOUT
void remove(const std::string &addr, const std::string &qos)
SimpleTable::SimpleTable * fwd
NTable::iterator NTableIt
#define PORTSLOAD_GENERATOR_UPDATE
RateMap::iterator RateIter
PortsSet::iterator PortsSetIt
const APN & getIpcAddress() const
Getter of IPC Process address which should be unambiguous within DIF.
virtual void removedFlow(const Address &addr, const QoSCube &qos, RMTPort *port)
QosToRateMap::iterator QTRIter
virtual void insertFlow(const Address &addr, const std::string &dst, const std::string &qos, const unsigned short &metric, bool sendUpdate)=0
virtual entries2Next getChanges()=0
virtual void removeFlow(const Address &addr, const std::string &dst, const std::string &qos, bool sendUpdate)=0
std::map< qosPaddr, std::string > entries2Next
virtual void scheduleUpdate()=0
#define PORTSLOAD_GENERATOR_LOCAL
virtual void handleMessage(cMessage *msg)
Class representing QoSCube with all its properties that is primarily used by FA, RMT and RA Specifica...
Define_Module(PortsLoadGenerator)
void insert(const std::string &addr, const std::string &qos, RMTPort *port)
std::string getQosId() const
Gets QoSCube identifier.
entries2Next::iterator entries2NextIt
int64_t getByteRate(RMTPort *port)
std::pair< std::string, std::string > qosPaddr
const std::string & getName() const
Gets APN string name representation.
virtual void routingUpdated()
Address class holds IPC Process identification.
bool rateCacheEntryExists(std::string dest, std::string qos)
virtual void insertedFlow(const Address &addr, const QoSCube &qos, RMTPort *port)