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 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. |
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_source (const string& policy,
const string& term,
const string& source)
| update_term_source |
Updates the source block of a term.
Exception is thrown on error.
Parameters:
policy | policy in which term should be updated. |
term | term which should be updated. |
source | un-parsed source configuration block of term. |
void update_term_dest (const string& policy,
const string& term,
const string& dest)
| update_term_dest |
Updates the source block of a term.
Exception is thrown on error.
Parameters:
policy | policy in which term should be updated. |
term | term which should be updated. |
dest | un-parsed dest configuration block of term. |
void update_term_action (const string& policy,
const string& term,
const string& action)
| update_term_action |
Updates the source block of a term.
Exception is thrown on error.
Parameters:
policy | policy in which term should be updated. |
term | term which should be updated. |
action | un-parsed action configuration block of term. |
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& name, const string& elements)
| update_set |
Attempts to update set elements.
Exception is thrown on error.
Parameters:
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 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 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 get_conf ()
| get_conf |
Returns: string representation of configuration.
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 configure_varmap (const string& conf)
| configure_varmap |
Configure the variable map used for semantic checking. This should be initialized only once at startup.
Dynamic configuration may easily be implemented by invalidiating policies in the configuration class.
Dynamic addition of variables should be safe. It is the removal and update which needs to trigger a policy to be flagged as modified.
Parameters:
conf | un-parsed configuration of variable map. |