23 linksU(
const int &_sId) : sId(_sId){}
30 void addEntry(
const string & _addr,
linksU _neig) { entries[_addr] = _neig; }
66 virtual void addFlow(
const Address &_nAddr,
const string &_addr,
const T &_metric){
74 newNeigh.insert(_addr);
93 if(
LS_Update * up = dynamic_cast<LS_Update*>(update)) {
95 for(
auto & entry : up->entries){
97 if(netState[entry.first].sId < entry.second.sId){
98 netState[entry.first] = entry.second;
99 changed.insert(entry.first);
103 if(!changed.empty()) {
117 map<string, linksU> entries;
118 for(
string entry : changed){
119 entries[entry] = netState[entry];
124 if(newNeigh.find(neig.second) == newNeigh.end()){
141 for(
const auto &entry : netState){
142 for(
const auto & link : entry.second.links){
147 map<string, nhLMetric<T> > ret = t;
149 for(
const auto & entry : currentTable){
150 if(entry.second.metric == ret[entry.first].metric || entry.second.nh == ret[entry.first].nh) {
151 ret.erase(entry.first);
160 virtual map<string, nhLMetric<T> >
getAll() {
163 for(
auto entry : netState){
164 for(
auto link : entry.second.links){
175 for(
auto entry : netState){
176 for(
auto link : entry.second.links){
map< string, nhLMetric< T > > getNextHops(const string &root, const T &infMetric)
map< string, linksU > netState
virtual bool processUpdate(Routing_Update *update)
map< string, linksU > entries
LS_Module(Routing_Module *p, const Address &_nAddr, const string &_addr, T inf)
virtual map< string, nhLMetric< T > > getAll()
virtual void addSynonym(const string syn)
virtual void addSynonym(const string syn)
virtual void removeFlow(const Address &_nAddr, const string &_addr)
virtual void removeSynonym(const string syn)
void print(const string &root, const T &infMetric)
void addEntry(const string &_addr, linksU _neig)
virtual void sendUpdate()
virtual void addFlow(const Address &_nAddr, const string &_addr, const T &_metric)
void addLink(const string &n, const Link< T > &l)
map< string, nhLMetric< T > > currentTable
virtual void removeSynonym(const string syn)
virtual void removeFlow(const Address &_nAddr, const string &_addr)
Address class holds IPC Process identification.
virtual map< string, nhLMetric< T > > getChanges()
virtual void sendUpdate()
virtual void addFlow(const Address &_nAddr, const string &_addr, const T &_metric)