47 unsigned short metric = qos.
getDelay()/par(
"redLinkCost").longValue();
49 if(metric < par(
"minLinkCost").longValue()) {
50 metric = par(
"minLinkCost").longValue();
51 }
else if(metric > par(
"maxLinkCost").longValue()) {
52 metric = par(
"maxLinkCost").longValue();
56 metric = par(
"maxLinkCost").longValue();
59 neighbours[dst].insert(
portMetric(port, metric));
60 if(neighbours[dst].size() == 1){
61 rt->insertFlow(addr, dst,
"", metric);
66 if(metric >= mt.metric && port != mt.port) { lower =
false; }
69 rt->insertFlow(addr, dst,
"", metric);
77 if(neighbours[dst].size() <= 0){
78 rt->removeFlow(addr, dst,
"");
79 neighbours.erase(dst);
82 unsigned short min = par(
"maxLinkCost").longValue();
84 if(min >= mt.metric) { min = mt.metric; }
86 rt->insertFlow(addr, dst,
"", min);
92 void LatGenerator::routingUpdated(){
95 for(
entries2NextIt it = changes.begin(); it!= changes.end(); it++){
97 std::string nextHop =
"";
98 if(!it->second.nh.empty()){
99 nextHop = *(it->second.nh.begin());
103 NTableIt n = neighbours.find(nextHop);
104 if(n != neighbours.end()){
105 if(!n->second.empty()) {
106 p = n->second.begin()->port;
111 fwd->remove(dst.second);
113 fwd->insert(dst.second, p);
119 void LatGenerator::onPolicyInit(){
static const QoSCube MANAGEMENT
NTable::iterator NTableIt
const char * MOD_POL_ROUTING
const APN & getIpcAddress() const
Getter of IPC Process address which should be unambiguous within DIF.
bool operator<(const portMetric &other) const
portMetric(RMTPort *p, unsigned short m)
const std::string VAL_UNDEF_QOSID
std::map< qosPaddr, std::string > entries2Next
const char * MOD_RELAYANDMUX
Class representing QoSCube with all its properties that is primarily used by FA, RMT and RA Specifica...
std::string getQosId() const
Gets QoSCube identifier.
entries2Next::iterator entries2NextIt
std::pair< std::string, std::string > qosPaddr
int getDelay() const
Gets Delay parameter.
const std::string & getName() const
Gets APN string name representation.
Register_Class(LatGenerator)
const char * MOD_POL_RMT_PDUFWD
Address class holds IPC Process identification.