This is the class that will be called to perform operation from the xrl target.
static string policy_target_name | policy_target_name |
PolicyTarget (XrlStdRouter& rtr)
| PolicyTarget |
Parameters:
rtr | Xrl router used by this XORP process. |
bool running ()
| running |
Returns: true if process is running.
void shutdown ()
| shutdown |
void create_term (const string& policy, const ConfigNodeId& order,
const string& term)
| create_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:
policy | policy in which term should be created. |
order | node ID with position of term. |
term | name of term to create. |
void delete_term (const string& policy, const string& term)
| delete_term |
Attempts to delete a term.
Exception is thrown on error.
Parameters:
policy | policy in which term should be deleted. |
term | name of the term. |
void update_term_block (const string& policy,
const string& term,
const uint32_t& block,
const ConfigNodeId& order,
const string& statement)
| update_term_block |
Update the source/dest/action block of a term in a policy.
Exception is thrown on error
Parameters:
policy | the name of the policy. |
term | the name of the term. |
block | the block to update (0:source, 1:dest, 2:action). |
order | node ID with position of term. |
statement | the statement to insert. |
void create_policy (const string& policy)
| create_policy |
Attempts to create a policy.
Exception is thrown on error.
Parameters:
policy | name of policy to create. |
void delete_policy (const string& policy)
| delete_policy |
Attempts to delete a policy.
Exception is thrown on error.
Parameters:
policy | name of policy to delete. |
void create_set (const string& name)
| create_set |
Attempts to create a policy.
Exception is thrown on error.
Parameters:
name | name of set to create. |
void update_set (const string& type, const string& name,
const string& elements)
| update_set |
Attempts to update set elements.
Exception is thrown on error.
Parameters:
type | the type of the set. |
name | name of set to update. |
elements | the elements of a set comma separated. |
void delete_set (const string& name)
| delete_set |
Attempts to delete a set.
Exception is thrown on error.
Parameters:
name | name of set to create. |
void add_to_set (const string& type, const string& name,
const string& element)
| add_to_set |
Add an element to a set.
Exception is thrown on error.
Parameters:
type | the type of the set. |
name | name of the set. |
element | the element to add. |
void delete_from_set (const string& type, const string& name,
const string& element)
| delete_from_set |
Delete an element from a set.
Exception is thrown on error.
Parameters:
type | the type of the set. |
name | name of the set. |
element | the element to delete. |
void update_import (const string& protocol, const string& policies)
| update_import |
Updates the import policy list for a protocol and triggers a delayed commit.
Parameters:
protocol | protocol for which to update imports. |
policies | comma separated policy list. |
void update_export (const string& protocol, const string& policies)
| update_export |
Updates the export policy list for a protocol and triggers a delayed commit.
Parameters:
protocol | protocol for which to update imports. |
policies | comma separated policy list. |
void add_varmap (const string& protocol, const string& variable,
const string& type, const string& access,
const VarRW::Id& id)
| add_varmap |
void commit (uint32_t msec)
| commit |
Commit all configuration changes, but trigger a delayed update to the actual policy filters.
Parameters:
msec | milliseconds after which policy filters should be updated. |
string dump_state (uint32_t id)
| dump_state |
Dump internal state. Use only for debugging.
Parameters:
id | which part of the state to dump. |
Returns: string representation of internal state.
void birth (const string& tclass, const string& tinstance)
| birth |
Announce birth of a XORP process.
Parameters:
tclass | target class. |
tinstance | target instance of class. |
void death (const string& tclass, const string& tinstance)
| death |
Announce death of a XORP process.
Parameters:
tclass | target class. |
tinstance | target instance of class. |
void set_proto_target (const string& protocol, const string& target)
| set_proto_target |
Update the protocol -> XRL target map.
Parameters:
protocol | the protocol. |
target | the XRL target. |