32 neighsAddr[dst] = dst_addr;
34 if(!fwd->setNeigh(dst, port)){
return; }
36 bool first = ports[dst_addr].empty();
37 ports[dst_addr].insert(port);
40 rt->insertFlow(addr, dst,
"", 1);
47 neighsAddr[dst] = dst_addr;
50 ports[dst_addr].erase(port);
51 bool last = ports[dst_addr].empty();
54 p = *ports[dst_addr].begin();
56 ports.erase(dst_addr);
59 if(!fwd->setNeigh(dst, p)){
return; }
62 rt->removeFlow(addr, dst,
"");
69 if(!updateRoutes) {
return; }
71 map<string, map<string, nhLMetric<mType> > > changes = rt->getChanges();
73 for(
const auto & qosEntries : changes){
74 for(
const auto & entry : qosEntries.second){
76 for(
string nextHop : entry.second.nh){
77 DCAddr n_addr = neighsAddr[nextHop];
79 cerr <<
"Unknown neighbour "<< nextHop << endl;
84 fwd->setDst(entry.first, links);
93 map<string, map<string, nhLMetric<mType> > > changes = rt->getAll();
95 for(
const auto & qosEntries : changes){
96 for(
const auto & entry : qosEntries.second){
99 for(
string nextHop : entry.second.nh){
100 DCAddr n_addr = neighsAddr[nextHop];
101 if(n_addr.
type < 0) {
102 cerr <<
"Unknown neighbour "<< nextHop << endl;
104 links.insert(n_addr);
107 fwd->setDst(entry.first, links);
116 (getModuleByPath(
"^.^.relayAndMux.pduForwardingPolicy"));
118 (getModuleByPath(
"^.^.routingPolicy"));
120 difA = check_and_cast<
DA *>(getModuleByPath(
"^.^.^.difAllocator.da"));
122 mType infMetric = par(
"infinite");
123 rt->setInfinite(infMetric);
125 string myAddr = getModuleByPath(
"^.^")->par(
"ipcAddress").stringValue();
127 fwd->setNodeInfo(myAddr);
129 simtime_t startUpdating = par(
"startUpdating").doubleValue();
130 if(startUpdating > simTime()) {
131 updateRoutes =
false;
132 scheduleAt(startUpdating,
new cMessage(
"start"));
virtual void removedFlow(const Address &addr, const QoSCube &qos, RMTPort *port)
Register_Class(SimpleDCGenerator)
const APN & getIpcAddress() const
Getter of IPC Process address which should be unambiguous within DIF.
virtual void onPolicyInit()
Class representing QoSCube with all its properties that is primarily used by FA, RMT and RA Specifica...
void handleMessage(cMessage *msg)
const std::string & getName() const
Gets APN string name representation.
virtual void insertedFlow(const Address &addr, const QoSCube &qos, RMTPort *port)
Address class holds IPC Process identification.
virtual void routingUpdated()