32 const std::string LinkMonitor::TAG =
"LinkMonitor";
48 if (_addr_map.find(iface) != _addr_map.end())
return;
51 std::list<vaddress> addr = _lmgr.getAddressList(iface);
54 _addr_map[iface].insert(addr.begin(), addr.end());
63 for (iface_map::iterator it = _addr_map.begin(); it != _addr_map.end();) {
66 if (ifaces.find(iface) == ifaces.end()) {
68 _addr_map.erase(it++);
85 for(std::set<vinterface>::const_iterator iface_iter = ifaces.begin(); iface_iter != ifaces.end(); iface_iter++)
96 if (_addr_map.find(iface) == _addr_map.end()) {
98 _addr_map[iface] = addr_set();
102 addr_set &addr_old = _addr_map[iface];
105 std::list<vaddress> addr_diff;
108 std::set_difference(addr_old.begin(), addr_old.end(), addr_new.begin(), addr_new.end(), std::back_inserter(addr_diff));
111 for(std::list<vaddress>::const_iterator addr_iter = addr_diff.begin(); addr_iter != addr_diff.end(); addr_iter++)
116 addr_old.erase(addr);
130 std::set_difference(addr_new.begin(), addr_new.end(), addr_old.begin(), addr_old.end(), std::back_inserter(addr_diff));
133 for(std::list<vaddress>::const_iterator addr_iter = addr_diff.begin(); addr_iter != addr_diff.end(); addr_iter++)
138 addr_old.insert(addr);