|
xorp
|
Deals with sending code to policy filters. More...
#include <filter_manager.hh>
Classes | |
| class | FMException |
| Exception thrown on error. More... | |
Public Types | |
| typedef map< string, Code * > | CodeMap |
| typedef map< string, string > | ConfQueue |
| typedef set< uint32_t > | TagSet |
| typedef map< string, TagSet * > | TagMap |
Public Member Functions | |
| FilterManager (const CodeMap &imp, const CodeMap &sm, const CodeMap &exp, const SetMap &sets, const TagMap &tagmap, XrlStdRouter &rtr, ProcessWatch &pw, ProtocolMap &pmap) | |
| The FilterManager closely works with the Configuration class. | |
| void | update_filter (const Code::Target &t) |
| Update the filter for a specific target. | |
| void | policy_backend_cb (const XrlError &e) |
| Xrl callback for all XRL requests. | |
| void | push_routes_now () |
| Flushes the route pushing queue. | |
| void | flush_updates_now () |
| Flush all queues now. | |
| void | flush_updates (uint32_t msec) |
| Flush all updates after msec milliseconds. | |
| void | birth (const string &protocol) |
| A protocol just came back to life. | |
| void | death (const string &protocol) |
| A protocol just died. | |
Private Member Functions | |
| void | update_import_filter (const string &protocol) |
| Update the import filter for a specific protocol. | |
| void | update_sourcematch_filter (const string &protocol) |
| Update the source-match filter for a specific protocol. | |
| void | update_export_filter (const string &protocol) |
| Update the export filter for a specific protocol. | |
| void | update_tagmap (const string &protocol) |
| Update the policy-tag map in the RIB for a specific protocol. | |
| void | flush_export_queue () |
| Flush all updates for export filters. | |
| void | flush_queue (ConfQueue &queue, filter::Filter f) |
| Flush all updates for a specific filter-type queue. | |
| void | delete_queue_protocol (ConfQueue &queue, const string &protocol) |
| void | update_queue (const string &protocol, const CodeMap &cm, ConfQueue &queue) |
Private Attributes | |
| const CodeMap & | _import |
| const CodeMap & | _sourcematch |
| const CodeMap & | _export |
| const SetMap & | _sets |
| const TagMap & | _tagmap |
| ConfQueue | _import_queue |
| ConfQueue | _sourcematch_queue |
| ConfQueue | _export_queue |
| set< string > | _push_queue |
| EventLoop & | _eventloop |
| XorpTimer | _flush_timer |
| XorpTimer | _push_timer |
| unsigned | _push_timeout |
| ProcessWatch & | _process_watch |
| XrlPolicyBackendV0p1Client | _policy_backend |
| XrlRibV0p1Client | _rib |
| string | _rib_name |
| ProtocolMap & | _pmap |
Deals with sending code to policy filters.
It manages sending the code and sets to the filters in the protocols. It also updates the policy-tag-map in the RIB.
It also keeps track if protocols die / come back to life, throw the process watch in order to re-send code to filters which were dead and are now back.
| FilterManager::FilterManager | ( | const CodeMap & | imp, |
| const CodeMap & | sm, | ||
| const CodeMap & | exp, | ||
| const SetMap & | sets, | ||
| const TagMap & | tagmap, | ||
| XrlStdRouter & | rtr, | ||
| ProcessWatch & | pw, | ||
| ProtocolMap & | pmap | ||
| ) |
The FilterManager closely works with the Configuration class.
Maybe in the future holding a reference the Configuration class, instead of the internal components may be a better solution.
| void FilterManager::birth | ( | const string & | protocol | ) | [virtual] |
A protocol just came back to life.
| protocol | name of protocol which is alive. |
Implements PWNotifier.
| void FilterManager::death | ( | const string & | protocol | ) | [virtual] |
| void FilterManager::flush_export_queue | ( | ) | [private] |
Flush all updates for export filters.
Also keep track which protocols must have their routes pushed.
| void FilterManager::flush_queue | ( | ConfQueue & | queue, |
| filter::Filter | f | ||
| ) | [private] |
Flush all updates for a specific filter-type queue.
Record which protocols need to be pushed.
| queue | queue for which updates need to be flushed. |
| f | filter for which updates should be flushed. |
| void FilterManager::flush_updates | ( | uint32_t | msec | ) | [virtual] |
Flush all updates after msec milliseconds.
If a new update comes in before msec expires, only the new update will be performed.
| msec | milliseconds after which all queues should be flushed. |
Implements FilterManagerBase.
| void FilterManager::policy_backend_cb | ( | const XrlError & | e | ) |
Xrl callback for all XRL requests.
| e | possible XRL error. |
| void FilterManager::update_export_filter | ( | const string & | protocol | ) | [private] |
| void FilterManager::update_filter | ( | const Code::Target & | t | ) | [virtual] |
Update the filter for a specific target.
This will normally queue a filter configuration request.
| t | target which should be updated. |
Implements FilterManagerBase.
| void FilterManager::update_import_filter | ( | const string & | protocol | ) | [private] |
| void FilterManager::update_sourcematch_filter | ( | const string & | protocol | ) | [private] |
| void FilterManager::update_tagmap | ( | const string & | protocol | ) | [private] |