class ProtoUnit

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

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

Public Methods


Detailed Description

 ProtoUnit (int init_family, x_module_id init_module_id)

ProtoUnit

Constructor for a given address family and module ID.

Parameters:
init_familythe address family.
init_module_idthe module ID (x_module_id).

 ~ProtoUnit ()

~ProtoUnit

[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.

int  family ()

family

[const]

Get the address family.

Returns: the address family (e.g., AF_INET or AF_INET6 for IPv4 and IPv6 respectively).

x_module_id  module_id ()

module_id

[const]

Get the module ID.

Returns: the module ID (x_module_id).

int  proto_version ()

proto_version

[const]

Get the current protocol version.

Returns: the current protocol version.

void  set_proto_version (int v)

set_proto_version

Set the current protocol version.

Parameters:
vthe protocol version.

int  proto_version_default ()

proto_version_default

[const]

Get the default protocol version.

Returns: the default protocol version.

void  set_proto_version_default (int v)

set_proto_version_default

Set the default protocol version.

Parameters:
vthe default protocol version.

bool  is_ipv4 ()

is_ipv4

[const]

Test if the address family of the unit is IPv4.

Returns: true if the address family of the unit is IPv4.

bool  is_ipv6 ()

is_ipv6

[const]

Test if the address family of the unit is IPv6.

Returns: true if the address family of the unit is IPv6.

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 * module_name ()

module_name

[const]

Get the module name.

TODO: temporary, all names are listed in "_x_module_name[][]" in proto_unit.cc.

Returns: C-style string with the module name.

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.

int  comm_handler ()

comm_handler

[const]

Get the communication handler for this unit.

Note: currently, the purpose of the communication handler is not clear.

Returns: the communication handler for this unit.

void  set_comm_handler (int v)

set_comm_handler

Set the communication handler for this unit.

Parameters:
vthe communication handler to set for this unit.

bool  proto_is_mld6igmp ()

proto_is_mld6igmp

[const]

Test if the protocol is MLD6 or IGMP.

Returns: true if the protocol is MLD6 or IGMP.

bool  proto_is_igmp ()

proto_is_igmp

[const]

Test if the protocol is IGMP.

Returns: true if the protocol is IGMP.

bool  proto_is_mld6 ()

proto_is_mld6

[const]

Test if the protocol is MLD6.

Returns: true if the protocol is MLD6.

bool  proto_is_pimsm ()

proto_is_pimsm

[const]

Test if the protocol is PIM-SM.

Returns: true if the protocol is PIM-SM.

bool  proto_is_pimdm ()

proto_is_pimdm

[const]

Test if the protocol is PIM-DM.

Returns: true if the protocol is PIM-DM.

bool  proto_is_bgmp ()

proto_is_bgmp

[const]

Test if the protocol is BGMP.

Returns: true if the protocol is BGMP.

bool  proto_is_bgp ()

proto_is_bgp

[const]

Test if the protocol is BGP.

Returns: true if the protocol is BGP.

bool  proto_is_ospf ()

proto_is_ospf

[const]

Test if the protocol is OSPF.

Returns: true if the protocol is OSPF.

bool  proto_is_rip ()

proto_is_rip

[const]

Test if the protocol is RIP.

Returns: true if the protocol is RIP.


Generated by: pavlin on possum.icir.org on Mon Mar 10 19:34:51 2003, using kdoc 2.0a54+XORP.