PolicyTable< A > Class Template Reference

Generic Policy filter table suitable for export filters. More...

#include <route_table_policy.hh>

Inheritance diagram for PolicyTable< A >:
BGPRouteTable< A > PolicyTableExport< A > PolicyTableImport< A > PolicyTableSourceMatch< A >

List of all members.

Public Member Functions

 PolicyTable (const string &tablename, const Safi &safi, BGPRouteTable< A > *parent, PolicyFilters &pfs, const filter::Filter &type)
int add_route (InternalMessage< A > &rtmsg, BGPRouteTable< A > *caller)
int replace_route (InternalMessage< A > &old_rtmsg, InternalMessage< A > &new_rtmsg, BGPRouteTable< A > *caller)
int delete_route (InternalMessage< A > &rtmsg, BGPRouteTable< A > *caller)
virtual int route_dump (InternalMessage< A > &rtmsg, BGPRouteTable< A > *caller, const PeerHandler *dump_peer)
int push (BGPRouteTable< A > *caller)
void route_used (const SubnetRoute< A > *route, bool in_use)
bool get_next_message (BGPRouteTable< A > *next_table)
const SubnetRoute< A > * lookup_route (const IPNet< A > &net, uint32_t &genid, FPAListRef &pa_list) const
RouteTableType type () const
string str () const
bool do_filtering (InternalMessage< A > &rtmsg, bool no_modify) const
 Performs policy filtering on a route.
void enable_filtering (bool on)

Protected Member Functions

virtual void init_varrw ()

Protected Attributes

const filter::Filter _filter_type
BGPVarRW< A > * _varrw

Private Attributes

bool _enable_filtering

Detailed Description

template<class A>
class PolicyTable< A >

Generic Policy filter table suitable for export filters.

All policy filter tables in BGP have very similar functionality. Some have more features than others, but most of the code is shared.

The export filter is the most "standard" table, so it is used as a base table for the source match and import filter tables.

Constructor & Destructor Documentation

template<class A>
PolicyTable< A >::PolicyTable ( const string &  tablename,
const Safi &  safi,
BGPRouteTable< A > *  parent,
PolicyFilters pfs,
const filter::Filter &  type 
tablenamename of the table.
safithe safi.
parentthe parent table.
pfsa reference to the global policy filters.
typethe type of policy filter used in this table.

Member Function Documentation

template<class A>
bool PolicyTable< A >::do_filtering ( InternalMessage< A > &  rtmsg,
bool  no_modify 
) const

Performs policy filtering on a route.

If false is returned, then the route is rejected, otherwise it was accepted and may have been modified.

rtmsgthe route message to filter.
no_modifyif true, the filter will not modify the route.
whether the route was accepted by the filter.

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