|
|
Each protocol 'registers' for I/O per interface and vif and gets assigned one object (per interface and vif) of this class.
IoLink (FeaDataPlaneManager& fea_data_plane_manager, const IfTree& iftree,
const string& if_name, const string& vif_name,
uint16_t ether_type, const string& filter_program)
| IoLink |
Constructor for link-level access for a given interface and vif.
Parameters:
fea_data_plane_manager | the corresponding data plane manager (FeaDataPlaneManager). |
iftree | the interface tree to use. |
if_name | the interface name. |
vif_name | the vif name. |
ether_type | the EtherType protocol number. If it is 0 then it is unused. |
filter_program | the optional filter program to be applied on the received packets. |
~IoLink ()
| ~IoLink |
[virtual]
IoLinkManager& io_link_manager ()
| io_link_manager |
Get the IoLinkManager instance.
Returns: the IoLinkManager instance.
FeaDataPlaneManager& fea_data_plane_manager ()
| fea_data_plane_manager |
Get the FeaDataPlaneManager instance.
Returns: the FeaDataPlaneManager instance.
bool is_running ()
| is_running |
[const virtual]
Test whether this instance is running.
Returns: true if the instance is running, otherwise false.
EventLoop& eventloop ()
| eventloop |
Get the event loop.
Returns: the event loop.
const IfTree& iftree ()
| iftree |
[const]
Get the interface tree.
Returns: the interface tree.
const string& if_name ()
| if_name |
[const virtual]
Get the interface name.
Returns: the interface name.
const string& vif_name ()
| vif_name |
[const virtual]
Get the vif name.
Returns: the vif name.
uint16_t ether_type ()
| ether_type |
[const virtual]
Get the EtherType protocol number.
Returns: the EtherType protocol number. If it is 0 then it is unused.
const string& filter_program ()
| filter_program |
[const]
Get the optional filter program.
Returns: the optional filter program to be applied on the received packets.
IoLinkReceiver* io_link_receiver ()
| io_link_receiver |
Get the registered receiver.
Returns: the registered receiver.
void register_io_link_receiver (IoLinkReceiver* io_link_receiver)
| register_io_link_receiver |
[virtual]
Register the I/O Link raw packets receiver.
Parameters:
io_link_receiver | the receiver to register. |
void unregister_io_link_receiver ()
| unregister_io_link_receiver |
[virtual]
Unregister the I/O Link raw packets receiver.
int start (string& error_msg)
| start |
[pure virtual]
Start operation.
Parameters:
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int stop (string& error_msg)
| stop |
[pure virtual]
Stop operation.
Parameters:
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int join_multicast_group (const Mac& group, string& error_msg)
| join_multicast_group |
[pure virtual]
Join a multicast group on an interface.
Parameters:
group | the multicast group to join. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int leave_multicast_group (const Mac& group, string& error_msg)
| leave_multicast_group |
[pure virtual]
Leave a multicast group on an interface.
Parameters:
group | the multicast group to leave. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int send_packet (const Mac& src_address,
const Mac& dst_address,
uint16_t ether_type,
const vector<uint8_t>& payload,
string& error_msg)
| send_packet |
[pure virtual]
Send a link-level packet.
Parameters:
src_address | the MAC source address. |
dst_address | the MAC destination address. |
ether_type | the EtherType protocol number. |
payload | the payload, everything after the MAC header. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
bool is_log_trace ()
| is_log_trace |
[const]
Test if trace log is enabled.
This method is used to test whether to output trace log debug messges.
Returns: true if trace log is enabled, otherwise false.
void set_log_trace (bool is_enabled)
| set_log_trace |
Enable/disable trace log.
This method is used to enable/disable trace log debug messages output.
Parameters:
is_enabled | if true, trace log is enabled, otherwise is disabled. |
void recv_packet (const Mac& src_address,
const Mac& dst_address,
uint16_t ether_type,
const vector<uint8_t>& payload)
| recv_packet |
[protected virtual]
Received a link-level packet.
Parameters:
src_address | the MAC source address. |
dst_address | the MAC destination address. |
ether_type | the EtherType protocol number. |
packet | the payload, everything after the MAC header. |
void recv_ethernet_packet (const uint8_t* packet, size_t packet_size)
| recv_ethernet_packet |
[protected]
Receved an Ethernet packet.
Parameters:
packet | the packet. |
packet_size | the size of the packet. |
int prepare_ethernet_packet (const Mac& src_address,
const Mac& dst_address,
uint16_t ether_type,
const vector<uint8_t>& payload,
vector<uint8_t>& packet,
string& error_msg)
| prepare_ethernet_packet |
[protected]
Prepare an Ethernet packet for transmission.
Parameters:
src_address | the MAC source address. |
dst_address | the MAC destination address. |
ether_type | the EtherType protocol number. |
payload | the payload, everything after the MAC header. |
packet | the return-by-reference packet prepared for transmission. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
bool _is_running | _is_running |
[protected]
static const uint32_t L2_MAX_PACKET_SIZE | L2_MAX_PACKET_SIZE |
[protected]
static const uint16_t ETHERNET_HEADER_SIZE | ETHERNET_HEADER_SIZE |
[protected]
static const uint16_t ETHERNET_LENGTH_TYPE_THRESHOLD | ETHERNET_LENGTH_TYPE_THRESHOLD |
[protected]
static const uint16_t ETHERNET_MIN_FRAME_SIZE | ETHERNET_MIN_FRAME_SIZE |
[protected]