class IoLinkManager

A class that manages raw link-level I/O. More...

 
LOGO
 Annotated List  Files  Globals  Hierarchy  Index  Top

Public Types

Public Methods


Detailed Description

The IoLinkManager has two containers: a container for link-level handlers (IoLinkComm) indexed by the protocol associated with the handler, and a container for the filters associated with each receiver_name. When a receiver registers for interest in a particular type of raw packet a handler (IoLinkComm) is created if necessary, then the relevent filter is created and associated with the IoLinkComm.

typedef XorpCallback2<int, const uint8_t*, size_t>::RefPtr UpcallReceiverCb

UpcallReceiverCb

 IoLinkManager (FeaNode& fea_node, const IfTree& iftree)

IoLinkManager

Constructor for IoLinkManager.

 ~IoLinkManager ()

~IoLinkManager

[virtual]

Virtual destructor.

int  send (const string& if_name, const string& vif_name, const Mac& src_address, const Mac& dst_address, uint16_t ether_type, const vector<uint8_t>& payload, string& error_msg)

send

Send a raw link-level packet on an interface.

Parameters:

if_namethe interface to send the packet on.
vif_namethe vif to send the packet on.
src_addressthe MAC source address.
dst_addressthe MAC destination address.
ether_typethe EtherType protocol type or the Destination SAP. It must be between 1536 and 65535 to specify the EtherType, or between 1 and 255 to specify the Destination SAP IEEE 802.2 LLC frames.
payloadthe payload, everything after the MAC header.
error_msgthe error message (if error).

Returns: XORP_OK on success, otherwise XORP_ERROR.

int  register_receiver (const string& receiver_name, const string& if_name, const string& vif_name, uint16_t ether_type, const string& filter_program, bool enable_multicast_loopback, string& error_msg)

register_receiver

Register to receive raw link-level packets.

Parameters:

receiver_namethe name of the receiver.
if_namethe interface through which packets should be accepted.
vif_namethe vif through which packets should be accepted.
ether_typethe EtherType protocol number or the Destination SAP that the receiver is interested in. It must be between 1536 and 65535 to specify the EtherType, or between 1 and 255 to specify the Destination SAP for IEEE 802.2 LLC frames. A protocol number of 0 is used to specify all protocols.
filter_programthe optional filter program to be applied on the received packets. The program uses tcpdump(1) style expression.
enable_multicast_loopbackif true then enable delivering of multicast datagrams back to this host (assuming the host is a member of the same multicast group.
error_msgthe error message (if error).

Returns: XORP_OK on success, otherwise XORP_ERROR.

int  unregister_receiver (const string& receiver_name, const string& if_name, const string& vif_name, uint16_t ether_type, const string& filter_program, string& error_msg)

unregister_receiver

Unregister to receive raw link-level packets.

Parameters:

receiver_namethe name of the receiver.
if_namethe interface through which packets should not be accepted.
vif_namethe vif through which packets should not be accepted.
ether_typethe EtherType protocol number or the Destination SAP that the receiver is not interested in anymore. It must be between 1536 and 65535 to specify the EtherType, or between 1 and 255 to specify the Destination SAP for IEEE 802.2 LLC frames. A protocol number of 0 is used to specify all protocols.
filter_programthe filter program that was applied on the received packets. The program uses tcpdump(1) style expression.
error_msgthe error message (if error).

Returns: XORP_OK on success, otherwise XORP_ERROR.

int  join_multicast_group (const string& receiver_name, const string& if_name, const string& vif_name, uint16_t ether_type, const string& filter_program, const Mac& group_address, string& error_msg)

join_multicast_group

Join a MAC multicast group.

Parameters:

receiver_namethe name of the receiver.
if_namethe interface through which packets should be accepted.
vif_namethe vif through which packets should be accepted.
ether_typethe EtherType protocol number or the Destination SAP that the receiver is interested in. It must be between 1536 and 65535 to specify the EtherType, or between 1 and 255 to specify the Destination SAP for IEEE 802.2 LLC frames. A protocol number of 0 is used to specify all protocols.
filter_programthe optional filter program to be applied on the received packets. The program uses tcpdump(1) style expression.
group_addressthe multicast group address to join.
error_msgthe error message (if error).

Returns: XORP_OK on success, otherwise XORP_ERROR.

int  leave_multicast_group (const string& receiver_name, const string& if_name, const string& vif_name, uint16_t ether_type, const string& filter_program, const Mac& group_address, string& error_msg)

leave_multicast_group

Leave a MAC multicast group.

Parameters:

receiver_namethe name of the receiver.
if_namethe interface through which packets should not be accepted.
vif_namethe vif through which packets should not be accepted.
ether_typethe EtherType protocol number or the Destination SAP that the receiver is not interested in anymore. It must be between 1536 and 65535 to specify the EtherType, or between 1 and 255 to specify the Destination SAP for IEEE 802.2 LLC frames. A protocol number of 0 is used to specify all protocols.
filter_programthe filter program that was applied on the received packets. The program uses tcpdump(1) style expression.
group_addressthe multicast group address to leave.
error_msgthe error message (if error).

Returns: XORP_OK on success, otherwise XORP_ERROR.

void  recv_event (const string& receiver_name, const struct MacHeaderInfo& header, const vector<uint8_t>& payload)

recv_event

Data received event.

Parameters:

receiver_namethe name of the receiver to send the raw link-level packet to.
headerthe MAC header information.
payloadthe payload, everything after the MAC header.

Reimplemented from IoLinkManagerReceiver.

void  instance_birth (const string& instance_name)

instance_birth

Inform the watcher that a component instance is alive.

Parameters:

instance_namethe name of the instance that is alive.

Reimplemented from InstanceWatcher.

void  instance_death (const string& instance_name)

instance_death

Inform the watcher that a component instance is dead.

Parameters:

instance_namethe name of the instance that is dead.

Reimplemented from InstanceWatcher.

void  set_io_link_manager_receiver (IoLinkManagerReceiver* v)

set_io_link_manager_receiver

Set the instance that is responsible for sending raw link-level packets to a receiver.

const IfTree&  iftree ()

iftree

[const]

Get a reference to the interface tree.

Returns: a reference to the interface tree (IfTree).

int  register_data_plane_manager (FeaDataPlaneManager* fea_data_plane_manager, bool is_exclusive)

register_data_plane_manager

Register FeaDataPlaneManager data plane manager.

Parameters:

fea_data_plane_managerthe data plane manager to register.
is_exclusiveif true, the manager is registered as the exclusive manager, otherwise is added to the list of managers.

Returns: XORP_OK on success, otherwise XORP_ERROR.

int  unregister_data_plane_manager (FeaDataPlaneManager* fea_data_plane_manager)

unregister_data_plane_manager

Unregister FeaDataPlaneManager data plane manager.

Parameters:

fea_data_plane_managerthe data plane manager to unregister.

Returns: XORP_OK on success, otherwise XORP_ERROR.

list<FeaDataPlaneManager*>&  fea_data_plane_managers ()

fea_data_plane_managers

Get the list of registered data plane managers.

Returns: the list of registered data plane managers.

int  add_multicast_mac (const string& if_name, const Mac& mac, string& error_msg)

add_multicast_mac

Add a multicast MAC address to an interface.

Parameters:

if_namethe interface name.
macthe MAC address to add.
error_msgthe error message (if error).

Returns: XORP_OK on success, otherwise XORP_ERROR.

int  remove_multicast_mac (const string& if_name, const Mac& mac, string& error_msg)

remove_multicast_mac

Remove a multicast MAC address from an interface.

Parameters:

if_namethe interface name.
macthe MAC address to remove.
error_msgthe error message (if error).

Returns: XORP_OK on success, otherwise XORP_ERROR.


Generated by: pavlin on kobe.xorp.net on Wed Jan 7 19:10:56 2009, using kdoc 2.0a54+XORP.