diff options
author | slioch <slioch@eng-140.vyatta.com> | 2009-07-07 14:33:15 -0700 |
---|---|---|
committer | slioch <slioch@eng-140.vyatta.com> | 2009-07-07 14:33:15 -0700 |
commit | 4000b742f9eb731d40d22d6e73daef466a0e34ee (patch) | |
tree | 53a57bbb91b1f2b9b5b33f0acf2b8a35a240cb9f /src/lbdata.cc | |
parent | 45760b0cc60d9f1f307fa3db5d420876f833a38d (diff) | |
download | vyatta-wanloadbalance-4000b742f9eb731d40d22d6e73daef466a0e34ee.tar.gz vyatta-wanloadbalance-4000b742f9eb731d40d22d6e73daef466a0e34ee.zip |
added configuration hook to execute script on interface state change. configurable via conf mode. environment variables identify interface and new state.
Diffstat (limited to 'src/lbdata.cc')
-rw-r--r-- | src/lbdata.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lbdata.cc b/src/lbdata.cc index 4764266..0a1f33a 100644 --- a/src/lbdata.cc +++ b/src/lbdata.cc @@ -165,10 +165,10 @@ LBData::dump() * * **/ -bool +map<string,string> LBData::state_changed() { - bool overall_state = false; + map<string,string> coll; LBData::InterfaceHealthIter h_iter = _iface_health_coll.begin(); while (h_iter != _iface_health_coll.end()) { if (h_iter->second.state_changed()) { @@ -179,11 +179,12 @@ LBData::state_changed() h_iter->second._last_time_state_changed = (unsigned long)tv.tv_sec; syslog(LOG_WARNING, "Interface %s has changed state to %s",h_iter->first.c_str(),tmp.c_str()); - overall_state = true; + + coll.insert(pair<string,string>(h_iter->first,tmp)); } ++h_iter; } - return overall_state; + return coll; } /** |