|
xorp
|
Base class for keeping state for each protocol unit (node, vif, etc). More...
#include <proto_state.hh>
Public Member Functions | |
| ProtoState () | |
| Default Constructor. | |
| virtual | ~ProtoState () |
| Destructor. | |
| int | start () |
| Start the unit. | |
| int | stop () |
| Stop the unit. | |
| int | pending_start () |
| Pending-start the unit. | |
| int | pending_stop () |
| Pending-stop the unit. | |
| void | enable () |
| Enable the unit. | |
| void | disable () |
| Disable the unit. | |
| bool | is_up () const |
| Test if the unit state is UP. | |
| bool | is_down () const |
| Test if the unit state is DOWN. | |
| bool | is_pending_up () const |
| Test if the unit state is PENDING-UP. | |
| bool | is_pending_down () const |
| Test if the unit state is PENDING-DOWN. | |
| bool | is_enabled () const |
| Test if the unit is enabled. | |
| bool | is_disabled () const |
| Test if the unit is disabled. | |
| bool | is_debug () const |
| Test if debug mode is enabled. | |
| void | set_debug (bool v) |
| Set/reset debug mode. | |
| string | state_str () const |
| Get a string with the state of the unit. | |
Private Types | |
| enum | { XORP_ENABLED = 1 << 0 } |
Private Member Functions | |
| int | startup () |
| Startup operation. | |
| int | shutdown () |
| Shutdown operation. | |
| int | reset () |
| Reset service to SERVICE_READY from whichever state it is in. | |
Private Attributes | |
| uint32_t | _flags |
| bool | _debug_flag |
Base class for keeping state for each protocol unit (node, vif, etc).
| ProtoState::ProtoState | ( | ) |
| void ProtoState::disable | ( | ) |
Disable the unit.
If an unit is disabled, it cannot be start or pending-start. If the unit was runnning, it will be stop first.
Reimplemented in CliNode, Mld6igmpNode, Mld6igmpNodeCli, Mld6igmpVif, MfeaNode, MfeaNodeCli, MfeaVif, Mld6igmpNode, Mld6igmpNodeCli, Mld6igmpVif, PimBsr, PimNode, PimNodeCli, and PimVif.
| void ProtoState::enable | ( | ) | [inline] |
Enable the unit.
If an unit is not enabled, it cannot be start, or pending-start.
Reimplemented in CliNode, Mld6igmpNode, Mld6igmpNodeCli, Mld6igmpVif, MfeaNode, MfeaNodeCli, MfeaVif, Mld6igmpNode, Mld6igmpNodeCli, Mld6igmpVif, PimBsr, PimNode, PimNodeCli, and PimVif.
| bool ProtoState::is_debug | ( | ) | const [inline] |
Test if debug mode is enabled.
| bool ProtoState::is_disabled | ( | ) | const [inline] |
| bool ProtoState::is_down | ( | ) | const |
| bool ProtoState::is_enabled | ( | ) | const [inline] |
| bool ProtoState::is_pending_down | ( | ) | const |
| bool ProtoState::is_pending_up | ( | ) | const |
| bool ProtoState::is_up | ( | ) | const |
| int ProtoState::pending_start | ( | ) |
Pending-start the unit.
The pending-start state is an intermediate state between down and up. In this state only some operations are allowed (the allowed operations are unit-specific). This operation will fail if the unit is disabled, is up, or is pending-up already.
| int ProtoState::pending_stop | ( | ) |
| int ProtoState::reset | ( | ) | [private, virtual] |
Reset service to SERVICE_READY from whichever state it is in.
Reimplemented from ServiceBase.
| void ProtoState::set_debug | ( | bool | v | ) | [inline] |
Set/reset debug mode.
| v | if true, set debug mode, otherwise reset it. |
| int ProtoState::shutdown | ( | ) | [private, virtual] |
Shutdown operation.
Implements ServiceBase.
Reimplemented in XrlMld6igmpNode, XrlMfeaNode, XrlMld6igmpNode, and XrlPimNode.
| int ProtoState::start | ( | ) |
Start the unit.
This operation will fail if the unit is disabled, or is already up.
Reimplemented in CliNode, Mld6igmpNode, Mld6igmpNodeCli, MfeaMrouter, MfeaNode, MfeaNodeCli, Mld6igmpNode, Mld6igmpNodeCli, PimBsr, PimNode, PimNodeCli, RpTable, RibManager, and VifManager.
| int ProtoState::startup | ( | ) | [private, virtual] |
Startup operation.
Implements ServiceBase.
Reimplemented in XrlMld6igmpNode, XrlMfeaNode, XrlMld6igmpNode, and XrlPimNode.
| string ProtoState::state_str | ( | ) | const |
| int ProtoState::stop | ( | ) |
Stop the unit.
This operation will fail if the unit was down already.
Reimplemented in CliNode, Mld6igmpNode, Mld6igmpNodeCli, MfeaMrouter, MfeaNode, MfeaNodeCli, Mld6igmpNode, Mld6igmpNodeCli, PimBsr, PimNode, PimNodeCli, RpTable, RibManager, and VifManager.