xorp

PolicyFilters Class Reference

A container for all policy filters a protocol should support. More...

#include <policy_filters.hh>

Inheritance diagram for PolicyFilters:
NONCOPYABLE VersionFilters

List of all members.

Classes

class  PolicyFiltersErr

Public Member Functions

 PolicyFilters (FilterBase *im, FilterBase *sm, FilterBase *ex)
bool run_filter (const uint32_t &type, VarRW &varrw)
 Run a filter and decide whether route should be accepted.
void configure (const uint32_t &type, const string &conf)
 Configure a filter.
void reset (const uint32_t &type)
 Reset a filter.

Private Member Functions

FilterBasewhichFilter (const uint32_t &ftype)
 Decide which filter to run based on its type.

Private Attributes

FilterBase_import_filter
FilterBase_export_sm_filter
FilterBase_export_filter

Detailed Description

A container for all policy filters a protocol should support.

Filters which are not used should just not be configured / executed. In the future an option to disable a filter should be added. Although, not running a filter is harmless for now [if configured however, state consumes memory].


Member Function Documentation

void PolicyFilters::configure ( const uint32_t &  type,
const string &  conf 
)

Configure a filter.

Throws an exception on error.

Parameters:
typethe filter to configure.
confthe configuration of the filter.
void PolicyFilters::reset ( const uint32_t &  type)

Reset a filter.

Parameters:
typethe filter to reset.
bool PolicyFilters::run_filter ( const uint32_t &  type,
VarRW varrw 
)

Run a filter and decide whether route should be accepted.

May throw an exception on run-time errors.

Returns:
true if route is accepted, false otherwise.
Parameters:
typewhich filter should be executed.
varrwthe VarRW associated with the route to be filtered.
FilterBase & PolicyFilters::whichFilter ( const uint32_t &  ftype) [private]

Decide which filter to run based on its type.

Throws exception if ftype is invalid.

Returns:
filter to execute.
Parameters:
ftypeintegral filter identifier.

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