class ProtoState

Base class for keeping state for each protocol unit (node, vif, etc). More...

Definition#include <proto_state.hh>
Inherited byProtoNode, ProtoNodeCli, ProtoUnit
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods


Detailed Description

 ProtoState ()

ProtoState

Default Constructor.

 ~ProtoState ()

~ProtoState

[virtual]

Destructor

int  start ()

start

Start the unit.

This operation will fail if the unit is disabled, or is already up.

Returns: XORP_OK on success, otherwise XORP_ERROR.

int  stop ()

stop

Stop the unit.

This operation will fail if the unit was down already.

Returns: XORP_OK on success, otherwise XORP_ERROR.

int  pending_start ()

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.

Returns: XORP_OK on success, otherwise XORP_ERROR.

int  pending_stop ()

pending_stop

Pending-stop the unit.

The pending-stop state is an intermediate state between up and down. In this state only some operations are allowed (the allowed operations are unit-specific). This operation will fail if the unit is not up.

Returns: XORP_OK on success, otherwise XORP_ERROR.

void  enable ()

enable

Enable the unit.

If an unit is not enabled, it cannot be start, or pending-start.

void  disable ()

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.

bool  is_up ()

is_up

[const]

Test if the unit state is UP.

Returns: true if the unit state is UP.

bool  is_down ()

is_down

[const]

Test if the unit state is DOWN.

Returns: true if the unit state is DOWN.

bool  is_pending_up ()

is_pending_up

[const]

Test if the unit state is PENDING-UP.

Returns: true if the unit state is PENDING-UP.

bool  is_pending_down ()

is_pending_down

[const]

Test if the unit state is PENDING-DOWN.

Returns: true if the unit state is PENDING-DOWN.

bool  is_enabled ()

is_enabled

[const]

Test if the unit is enabled.

Returns: true if the unit is enabled.

bool  is_disabled ()

is_disabled

[const]

Test if the unit is disabled.

Returns: true if the unit is disabled.

bool  is_debug ()

is_debug

[const]

Test if debug mode is enabled.

Returns: true if debug mode is enabled.

void  set_debug (bool v)

set_debug

Set/reset debug mode.

Parameters:
vif true, set debug mode, otherwise reset it.

const char * state_string ()

state_string

[const]

Get a string with the state of the unit.

The state string is one of the following: "DISABLED", "DOWN", "UP", "PENDING_UP", "PENDING_DOWN", "UNKNOWN"

Returns: C-style string with the state of the unit.


Generated by: pavlin on possum.icir.org on Thu Aug 28 12:52:07 2003, using kdoc 2.0a54+XORP.