xorp

PolicyTarget Class Reference

The XORP Policy target. More...

#include <policy_target.hh>

List of all members.

Public Member Functions

 PolicyTarget (XrlStdRouter &rtr)
bool running ()
void shutdown ()
 Shutdown the process.
void create_term (const string &policy, const ConfigNodeId &order, const string &term)
 Attempts to create a term.
void delete_term (const string &policy, const string &term)
 Attempts to delete a term.
void update_term_block (const string &policy, const string &term, const uint32_t &block, const ConfigNodeId &order, const string &statement)
 Update the source/dest/action block of a term in a policy.
void create_policy (const string &policy)
 Attempts to create a policy.
void delete_policy (const string &policy)
 Attempts to delete a policy.
void create_set (const string &name)
 Attempts to create a policy.
void update_set (const string &type, const string &name, const string &elements)
 Attempts to update set elements.
void delete_set (const string &name)
 Attempts to delete a set.
void add_to_set (const string &type, const string &name, const string &element)
 Add an element to a set.
void delete_from_set (const string &type, const string &name, const string &element)
 Delete an element from a set.
void update_import (const string &protocol, const string &policies, const string &modifier)
 Updates the import policy list for a protocol and triggers a delayed commit.
void update_export (const string &protocol, const string &policies, const string &modifier)
 Updates the export policy list for a protocol and triggers a delayed commit.
void add_varmap (const string &protocol, const string &variable, const string &type, const string &access, const VarRW::Id &id)
void commit (uint32_t msec)
 Commit all configuration changes, but trigger a delayed update to the actual policy filters.
string dump_state (uint32_t id)
 Dump internal state.
void birth (const string &tclass, const string &tinstance)
 Announce birth of a XORP process.
void death (const string &tclass, const string &tinstance)
 Announce death of a XORP process.
void set_proto_target (const string &protocol, const string &target)
 Update the protocol -> XRL target map.
string cli_command (const string &command)
string test_policy (const string &arg)
string show (const string &arg)
void show (const string &type, const string &name, RESOURCES &res)
bool test_policy (const string &policy, const string &prefix, const string &attributes, string &mods)
bool test_policy (const string &policy, const RATTR &attrs, RATTR &mods)

Static Public Attributes

static string policy_target_name = "policy"

Private Member Functions

void parse_attributes (const string &attr, RATTR &out)

Private Attributes

bool _running
uint32_t _commit_delay
ProtocolMap _pmap
ProcessWatch _process_watch
Configuration _conf
FilterManager _filter_manager

Detailed Description

The XORP Policy target.

This is the class that will be called to perform operation from the xrl target.


Constructor & Destructor Documentation

PolicyTarget::PolicyTarget ( XrlStdRouter rtr)
Parameters:
rtrXrl router used by this XORP process.

Member Function Documentation

void PolicyTarget::add_to_set ( const string &  type,
const string &  name,
const string &  element 
)

Add an element to a set.

Exception is thrown on error.

Parameters:
typethe type of the set.
namename of the set.
elementthe element to add.
void PolicyTarget::birth ( const string &  tclass,
const string &  tinstance 
)

Announce birth of a XORP process.

Parameters:
tclasstarget class.
tinstancetarget instance of class.
void PolicyTarget::commit ( uint32_t  msec)

Commit all configuration changes, but trigger a delayed update to the actual policy filters.

Parameters:
msecmilliseconds after which policy filters should be updated.
void PolicyTarget::create_policy ( const string &  policy)

Attempts to create a policy.

Exception is thrown on error.

Parameters:
policyname of policy to create.
void PolicyTarget::create_set ( const string &  name)

Attempts to create a policy.

Exception is thrown on error.

Parameters:
namename of set to create.
void PolicyTarget::create_term ( const string &  policy,
const ConfigNodeId order,
const string &  term 
)

Attempts to create a term.

Terms are appended in existing policies [currently no way of inserting a term in a specific position].

Exception is thrown on error.

Parameters:
policypolicy in which term should be created.
ordernode ID with position of term.
termname of term to create.
void PolicyTarget::death ( const string &  tclass,
const string &  tinstance 
)

Announce death of a XORP process.

Parameters:
tclasstarget class.
tinstancetarget instance of class.
void PolicyTarget::delete_from_set ( const string &  type,
const string &  name,
const string &  element 
)

Delete an element from a set.

Exception is thrown on error.

Parameters:
typethe type of the set.
namename of the set.
elementthe element to delete.
void PolicyTarget::delete_policy ( const string &  policy)

Attempts to delete a policy.

Exception is thrown on error.

Parameters:
policyname of policy to delete.
void PolicyTarget::delete_set ( const string &  name)

Attempts to delete a set.

Exception is thrown on error.

Parameters:
namename of set to create.
void PolicyTarget::delete_term ( const string &  policy,
const string &  term 
)

Attempts to delete a term.

Exception is thrown on error.

Parameters:
policypolicy in which term should be deleted.
termname of the term.
string PolicyTarget::dump_state ( uint32_t  id)

Dump internal state.

Use only for debugging.

Parameters:
idwhich part of the state to dump.
Returns:
string representation of internal state.
bool PolicyTarget::running ( )
Returns:
true if process is running.
void PolicyTarget::set_proto_target ( const string &  protocol,
const string &  target 
)

Update the protocol -> XRL target map.

Parameters:
protocolthe protocol.
targetthe XRL target.
void PolicyTarget::update_export ( const string &  protocol,
const string &  policies,
const string &  modifier 
)

Updates the export policy list for a protocol and triggers a delayed commit.

Parameters:
protocolprotocol for which to update imports.
policiescomma separated policy list.
void PolicyTarget::update_import ( const string &  protocol,
const string &  policies,
const string &  modifier 
)

Updates the import policy list for a protocol and triggers a delayed commit.

Parameters:
protocolprotocol for which to update imports.
policiescomma separated policy list.
void PolicyTarget::update_set ( const string &  type,
const string &  name,
const string &  elements 
)

Attempts to update set elements.

Exception is thrown on error.

Parameters:
typethe type of the set.
namename of set to update.
elementsthe elements of a set comma separated.
void PolicyTarget::update_term_block ( const string &  policy,
const string &  term,
const uint32_t &  block,
const ConfigNodeId order,
const string &  statement 
)

Update the source/dest/action block of a term in a policy.

Exception is thrown on error

Parameters:
policythe name of the policy.
termthe name of the term.
blockthe block to update (0:source, 1:dest, 2:action).
ordernode ID with position of term.
statementthe statement to insert.

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