|
xorp
|
Base class for pushing and pulling interface configurations down to the particular system. More...
#include <ifconfig.hh>
Public Member Functions | |
| IfConfig (FeaNode &fea_node) | |
| Constructor. | |
| virtual | ~IfConfig () |
| Virtual destructor (in case this class is used as a base class). | |
| EventLoop & | eventloop () |
| Get a reference to the EventLoop instance. | |
| ProcessStatus | status (string &reason) const |
| Get the status code. | |
| int | start_transaction (uint32_t &tid, string &error_msg) |
| Start interface-related transaction. | |
| int | commit_transaction (uint32_t tid, string &error_msg) |
| Commit interface-related transaction. | |
| int | abort_transaction (uint32_t tid, string &error_msg) |
| Abort interface-related transaction. | |
| int | add_transaction_operation (uint32_t tid, const TransactionManager::Operation &op, string &error_msg) |
| Add operation to interface-related transaction. | |
| int | add_interface (const char *ifname) |
| These are used by the Transaction Operation callbacks to actually do work. | |
| int | add_interface (const string &ifname) |
| int | remove_interface (const char *ifname) |
| int | remove_interface (const string &ifname) |
| int | update_interface (const IfTreeInterface &iface) |
| NexthopPortMapper & | nexthop_port_mapper () |
| Get a reference to the NexthopPortMapper instance. | |
| IfConfigUpdateReplicator & | ifconfig_update_replicator () |
| Get the IfConfigUpdateReplicator instance. | |
| IfConfigErrorReporterBase & | ifconfig_error_reporter () |
| Get the error reporter associated with IfConfig. | |
| IfTree & | system_config () |
| Get a reference to the system interface configuration. | |
| void | set_system_config (const IfTree &iftree) |
| Set the system interface configuration. | |
| IfTree & | user_config () |
| Get a reference to the user interface configuration. | |
| void | set_user_config (const IfTree &iftree) |
| Set the user interface configuration. | |
| IfTree & | merged_config () |
| Get a reference to the merged system-user configuration. | |
| void | set_merged_config (const IfTree &iftree) |
| Set the merged system-user configuration. | |
| const IfTree & | original_config () |
| Get a reference to the original interface configuration on startup. | |
| bool | restore_original_config_on_shutdown () const |
| Test whether the original configuration should be restored on shutdown. | |
| void | set_restore_original_config_on_shutdown (bool v) |
| Set the flag whether the original configuration should be restored on shutdown. | |
| int | register_ifconfig_property (IfConfigProperty *ifconfig_property, bool is_exclusive) |
| Register IfConfigProperty plugin. | |
| int | unregister_ifconfig_property (IfConfigProperty *ifconfig_property) |
| Unregister IfConfigProperty plugin. | |
| int | register_ifconfig_get (IfConfigGet *ifconfig_get, bool is_exclusive) |
| Register IfConfigGet plugin. | |
| int | unregister_ifconfig_get (IfConfigGet *ifconfig_get) |
| Unregister IfConfigGet plugin. | |
| int | register_ifconfig_set (IfConfigSet *ifconfig_set, bool is_exclusive) |
| Register IfConfigSet plugin. | |
| int | unregister_ifconfig_set (IfConfigSet *ifconfig_set) |
| Unregister IfConfigSet plugin. | |
| int | register_ifconfig_observer (IfConfigObserver *ifconfig_observer, bool is_exclusive) |
| Register IfConfigObserver plugin. | |
| int | unregister_ifconfig_observer (IfConfigObserver *ifconfig_observer) |
| Unregister IfConfigObserver plugin. | |
| int | register_ifconfig_vlan_get (IfConfigVlanGet *ifconfig_vlan_get, bool is_exclusive) |
| Register IfConfigVlanGet plugin. | |
| int | unregister_ifconfig_vlan_get (IfConfigVlanGet *ifconfig_vlan_get) |
| Unregister IfConfigVlanGet plugin. | |
| int | register_ifconfig_vlan_set (IfConfigVlanSet *ifconfig_vlan_set, bool is_exclusive) |
| Register IfConfigVlanSet plugin. | |
| int | unregister_ifconfig_vlan_set (IfConfigVlanSet *ifconfig_vlan_set) |
| Unregister IfConfigVlanSet plugin. | |
| int | start (string &error_msg) |
| Start operation. | |
| int | stop (string &error_msg) |
| Stop operation. | |
| int | push_config (const IfTree &iftree) |
| Push interface configuration down to the system. | |
| const string & | push_error () const |
| Get the error message associated with a push operation. | |
| const IfTree & | pull_config (const char *ifname, int if_index) |
| Pull up current interface configuration from the system, but only for interfaces currently configured by the user. | |
| const IfTree & | full_pulled_config () |
| NOTE: This will cause the system to read *all* interface information into the _pulled_config list. | |
| bool | report_update (const IfTreeInterface &fi) |
| Check IfTreeInterface and report updates to IfConfigUpdateReporter. | |
| bool | report_update (const IfTreeInterface &fi, const IfTreeVif &fv) |
| Check IfTreeVif and report updates to IfConfigUpdateReporter. | |
| bool | report_update (const IfTreeInterface &fi, const IfTreeVif &fv, const IfTreeAddr4 &fa) |
| Check IfTreeAddr4 and report updates to IfConfigUpdateReporter. | |
| void | report_updates_completed () |
| Report that updates were completed to IfConfigUpdateReporter. | |
| void | report_updates (IfTree &iftree) |
| Check every item within IfTree and report updates to IfConfigUpdateReporter. | |
Private Member Functions | |
| int | restore_config (const IfTree &old_user_config, const IfTree &old_system_config, string &error_msg) |
| Restore the interface configuration. | |
Private Attributes | |
| FeaNode & | _fea_node |
| EventLoop & | _eventloop |
| NexthopPortMapper & | _nexthop_port_mapper |
| IfConfigTransactionManager * | _itm |
| IfTree | _user_config |
| IfTree | _system_config |
| IfTree | _merged_config |
| IfTree | _original_config |
| bool | _restore_original_config_on_shutdown |
| IfConfigUpdateReplicator | _ifconfig_update_replicator |
| IfConfigErrorReporter | _ifconfig_error_reporter |
| list< IfConfigProperty * > | _ifconfig_property_plugins |
| list< IfConfigGet * > | _ifconfig_gets |
| list< IfConfigSet * > | _ifconfig_sets |
| list< IfConfigObserver * > | _ifconfig_observers |
| list< IfConfigVlanGet * > | _ifconfig_vlan_gets |
| list< IfConfigVlanSet * > | _ifconfig_vlan_sets |
| bool | _is_running |
Base class for pushing and pulling interface configurations down to the particular system.
| int IfConfig::abort_transaction | ( | uint32_t | tid, |
| string & | error_msg | ||
| ) |
| int IfConfig::add_interface | ( | const char * | ifname | ) |
| int IfConfig::add_transaction_operation | ( | uint32_t | tid, |
| const TransactionManager::Operation & | op, | ||
| string & | error_msg | ||
| ) |
| int IfConfig::commit_transaction | ( | uint32_t | tid, |
| string & | error_msg | ||
| ) |
| EventLoop& IfConfig::eventloop | ( | ) | [inline] |
| const IfTree & IfConfig::full_pulled_config | ( | ) |
| IfConfigErrorReporterBase& IfConfig::ifconfig_error_reporter | ( | ) | [inline] |
| IfConfigUpdateReplicator& IfConfig::ifconfig_update_replicator | ( | ) | [inline] |
Get the IfConfigUpdateReplicator instance.
| IfTree& IfConfig::merged_config | ( | ) | [inline] |
| NexthopPortMapper& IfConfig::nexthop_port_mapper | ( | ) | [inline] |
Get a reference to the NexthopPortMapper instance.
| const IfTree& IfConfig::original_config | ( | ) | [inline] |
| const IfTree & IfConfig::pull_config | ( | const char * | ifname, |
| int | if_index | ||
| ) |
| int IfConfig::push_config | ( | const IfTree & | iftree | ) |
Push interface configuration down to the system.
Errors are reported via the ifconfig_error_reporter() instance. Note that on return some of the interface configuration state may be modified.
| iftree | the interface configuration to be pushed down. |
| const string & IfConfig::push_error | ( | ) | const |
| int IfConfig::register_ifconfig_get | ( | IfConfigGet * | ifconfig_get, |
| bool | is_exclusive | ||
| ) |
Register IfConfigGet plugin.
| ifconfig_get | the plugin to register. |
| is_exclusive | if true, the plugin is registered as the exclusive plugin, otherwise is added to the list of plugins. |
| int IfConfig::register_ifconfig_observer | ( | IfConfigObserver * | ifconfig_observer, |
| bool | is_exclusive | ||
| ) |
Register IfConfigObserver plugin.
| ifconfig_observer | the plugin to register. |
| is_exclusive | if true, the plugin is registered as the exclusive plugin, otherwise is added to the list of plugins. |
| int IfConfig::register_ifconfig_property | ( | IfConfigProperty * | ifconfig_property, |
| bool | is_exclusive | ||
| ) |
Register IfConfigProperty plugin.
| ifconfig_property | the plugin to register. |
| is_exclusive | if true, the plugin is registered as the exclusive plugin, otherwise is added to the list of plugins. |
| int IfConfig::register_ifconfig_set | ( | IfConfigSet * | ifconfig_set, |
| bool | is_exclusive | ||
| ) |
Register IfConfigSet plugin.
| ifconfig_set | the plugin to register. |
| is_exclusive | if true, the plugin is registered as the exclusive plugin, otherwise is added to the list of plugins. |
| int IfConfig::register_ifconfig_vlan_get | ( | IfConfigVlanGet * | ifconfig_vlan_get, |
| bool | is_exclusive | ||
| ) |
Register IfConfigVlanGet plugin.
| ifconfig_vlan_get | the plugin to register. |
| is_exclusive | if true, the plugin is registered as the exclusive plugin, otherwise is added to the list of plugins. |
| int IfConfig::register_ifconfig_vlan_set | ( | IfConfigVlanSet * | ifconfig_vlan_set, |
| bool | is_exclusive | ||
| ) |
Register IfConfigVlanSet plugin.
| ifconfig_vlan_set | the plugin to register. |
| is_exclusive | if true, the plugin is registered as the exclusive plugin, otherwise is added to the list of plugins. |
| bool IfConfig::report_update | ( | const IfTreeInterface & | fi, |
| const IfTreeVif & | fv | ||
| ) |
Check IfTreeVif and report updates to IfConfigUpdateReporter.
| fi | the IfTreeInterface interface instance to check. |
| fv | the IfTreeVif vif instance to check. |
| bool IfConfig::report_update | ( | const IfTreeInterface & | fi, |
| const IfTreeVif & | fv, | ||
| const IfTreeAddr4 & | fa | ||
| ) |
Check IfTreeAddr4 and report updates to IfConfigUpdateReporter.
| fi | the IfTreeInterface interface instance to check. |
| fv | the IfTreeVif vif instance to check. |
| fa | the IfTreeAddr4 address instance to check. |
| bool IfConfig::report_update | ( | const IfTreeInterface & | fi | ) |
Check IfTreeInterface and report updates to IfConfigUpdateReporter.
| fi | the IfTreeInterface interface instance to check. |
| void IfConfig::report_updates | ( | IfTree & | iftree | ) |
| bool IfConfig::restore_original_config_on_shutdown | ( | ) | const [inline] |
| void IfConfig::set_merged_config | ( | const IfTree & | iftree | ) | [inline] |
| void IfConfig::set_restore_original_config_on_shutdown | ( | bool | v | ) | [inline] |
| void IfConfig::set_system_config | ( | const IfTree & | iftree | ) | [inline] |
| void IfConfig::set_user_config | ( | const IfTree & | iftree | ) | [inline] |
| int IfConfig::start | ( | string & | error_msg | ) |
Start operation.
| error_msg | the error message (if error). |
| int IfConfig::start_transaction | ( | uint32_t & | tid, |
| string & | error_msg | ||
| ) |
| ProcessStatus IfConfig::status | ( | string & | reason | ) | const |
| int IfConfig::stop | ( | string & | error_msg | ) |
Stop operation.
| error_msg | the error message (if error). |
| IfTree& IfConfig::system_config | ( | ) | [inline] |
| int IfConfig::unregister_ifconfig_get | ( | IfConfigGet * | ifconfig_get | ) |
Unregister IfConfigGet plugin.
| ifconfig_get | the plugin to unregister. |
| int IfConfig::unregister_ifconfig_observer | ( | IfConfigObserver * | ifconfig_observer | ) |
Unregister IfConfigObserver plugin.
| ifconfig_observer | the plugin to unregister. |
| int IfConfig::unregister_ifconfig_property | ( | IfConfigProperty * | ifconfig_property | ) |
Unregister IfConfigProperty plugin.
| ifconfig_property | the plugin to unregister. |
| int IfConfig::unregister_ifconfig_set | ( | IfConfigSet * | ifconfig_set | ) |
Unregister IfConfigSet plugin.
| ifconfig_set | the plugin to unregister. |
| int IfConfig::unregister_ifconfig_vlan_get | ( | IfConfigVlanGet * | ifconfig_vlan_get | ) |
Unregister IfConfigVlanGet plugin.
| ifconfig_vlan_get | the plugin to unregister. |
| int IfConfig::unregister_ifconfig_vlan_set | ( | IfConfigVlanSet * | ifconfig_vlan_set | ) |
Unregister IfConfigVlanSet plugin.
| ifconfig_vlan_set | the plugin to unregister. |
| IfTree& IfConfig::user_config | ( | ) | [inline] |