xorp

FilterManager Class Reference

Deals with sending code to policy filters. More...

#include <filter_manager.hh>

Inheritance diagram for FilterManager:
FilterManagerBase PWNotifier

List of all members.

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

Detailed Description

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.


Constructor & Destructor Documentation

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.

Parameters:
impimport filter CodeMap to use.
smsource match filter CodeMap to use.
expexport filter CodeMap to use.
setsSetMap to use.
tagmapTagMap to use.
rtrthe XRL router used by the policy process.
pwthe process watcher.
pmapthe protocol map.

Member Function Documentation

void FilterManager::birth ( const string &  protocol) [virtual]

A protocol just came back to life.

Parameters:
protocolname of protocol which is alive.

Implements PWNotifier.

void FilterManager::death ( const string &  protocol) [virtual]

A protocol just died.

Parameters:
protocolname of protocol which died.

Implements PWNotifier.

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.

Parameters:
queuequeue for which updates need to be flushed.
ffilter 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.

Parameters:
msecmilliseconds after which all queues should be flushed.

Implements FilterManagerBase.

void FilterManager::policy_backend_cb ( const XrlError e)

Xrl callback for all XRL requests.

Parameters:
epossible XRL error.
void FilterManager::update_export_filter ( const string &  protocol) [private]

Update the export filter for a specific protocol.

Parameters:
protocolprotocol of which the export filter must be updated.
void FilterManager::update_filter ( const Code::Target t) [virtual]

Update the filter for a specific target.

This will normally queue a filter configuration request.

Parameters:
ttarget which should be updated.

Implements FilterManagerBase.

void FilterManager::update_import_filter ( const string &  protocol) [private]

Update the import filter for a specific protocol.

Parameters:
protocolprotocol of which the import filter must be updated.
void FilterManager::update_sourcematch_filter ( const string &  protocol) [private]

Update the source-match filter for a specific protocol.

Parameters:
protocolprotocol of which the sourcematch filter must be updated.
void FilterManager::update_tagmap ( const string &  protocol) [private]

Update the policy-tag map in the RIB for a specific protocol.

Parameters:
protocolprotocol for which tags should be updated.

The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations