42 if(metric < par(
"minLinkCost").longValue()) {
43 metric = par(
"minLinkCost").longValue();
44 }
else if(metric > par(
"maxLinkCost").longValue()) {
45 metric = par(
"maxLinkCost").longValue();
49 metric = par(
"maxLinkCost").longValue();
52 neighbours[dst].insert(
portMetric(port, metric));
53 if(neighbours[dst].size() == 1){
54 rt->insertFlow(addr, dst,
"", metric);
59 if(metric >= mt.metric && port != mt.port) { lower =
false; }
62 rt->insertFlow(addr, dst,
"", metric);
70 if(neighbours[dst].size() <= 0){
71 rt->removeFlow(addr, dst,
"");
72 neighbours.erase(dst);
75 unsigned short min = par(
"maxLinkCost").longValue();
77 if(min >= mt.metric) { min = mt.metric; }
79 rt->insertFlow(addr, dst,
"", min);
85 void LatencySingle1Entry::routingUpdated(){
86 map<string, map<string, nhLMetric<mType> > > changes = rt->getChanges();
88 for(
const auto & entry : changes[
""]){
89 std::string nextHop =
"";
90 if(!entry.second.nh.empty()){
91 nextHop = *(entry.second.nh.begin());
95 auto n = neighbours.find(nextHop);
96 if(n != neighbours.end()){
97 if(!n->second.empty()) {
98 p = n->second.begin()->port;
103 fwd->remove(entry.first);
105 fwd->insert(entry.first, p);
111 void LatencySingle1Entry::onPolicyInit(){
118 mType infMetric = par(
"infinite");
119 rt->setInfinite(infMetric);
static const QoSCube MANAGEMENT
const char * MOD_POL_ROUTING
const char * MOD_DIFALLOC
const APN & getIpcAddress() const
Getter of IPC Process address which should be unambiguous within DIF.
Register_Class(LatencySingle1Entry)
const std::string VAL_UNDEF_QOSID
bool operator<(const portMetric &other) const
portMetric(RMTPort *p, mType m)
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.
int getDelay() const
Gets Delay parameter.
const std::string & getName() const
Gets APN string name representation.
const char * MOD_POL_RMT_PDUFWD
Address class holds IPC Process identification.