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 LatencySingleMEntries::routingUpdated(){
86 map<string, map<string, nhLMetric<mType> > > changes = rt->getChanges();
88 for(
const auto & entry : changes[
""]){
89 std::vector< RMTPort * > ps;
90 for(
string nextHop : entry.second.nh){
93 auto n = neighbours.find(nextHop);
94 if(n != neighbours.end()){
95 if(!n->second.empty()) {
96 p = n->second.begin()->port;
103 fwd->addReplace(entry.first, ps);
109 void LatencySingleMEntries::onPolicyInit(){
112 rt = getRINAModule<IntTSimpleRouting<mType> *>(
this, 2, {
MOD_POL_ROUTING});
116 mType infMetric = par(
"infinite");
117 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.
const std::string VAL_UNDEF_QOSID
bool operator<(const portMetric &other) const
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.
portMetric(RMTPort *p, mType m)
Register_Class(LatencySingleMEntries)