|
|
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]
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_name | the interface to send the packet on. |
vif_name | the vif to send the packet on. |
src_address | the MAC source address. |
dst_address | the MAC destination address. |
ether_type | the 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. |
payload | the payload, everything after the MAC header. |
error_msg | the 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_name | the name of the receiver. |
if_name | the interface through which packets should be accepted. |
vif_name | the vif through which packets should be accepted. |
ether_type | the 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_program | the optional filter program to be applied on the received packets. The program uses tcpdump(1) style expression. |
enable_multicast_loopback | if true then enable delivering of multicast datagrams back to this host (assuming the host is a member of the same multicast group. |
error_msg | the 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_name | the name of the receiver. |
if_name | the interface through which packets should not be accepted. |
vif_name | the vif through which packets should not be accepted. |
ether_type | the 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_program | the filter program that was applied on the received packets. The program uses tcpdump(1) style expression. |
error_msg | the 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_name | the name of the receiver. |
if_name | the interface through which packets should be accepted. |
vif_name | the vif through which packets should be accepted. |
ether_type | the 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_program | the optional filter program to be applied on the received packets. The program uses tcpdump(1) style expression. |
group_address | the multicast group address to join. |
error_msg | the 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_name | the name of the receiver. |
if_name | the interface through which packets should not be accepted. |
vif_name | the vif through which packets should not be accepted. |
ether_type | the 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_program | the filter program that was applied on the received packets. The program uses tcpdump(1) style expression. |
group_address | the multicast group address to leave. |
error_msg | the 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_name | the name of the receiver to send the raw link-level packet to. |
header | the MAC header information. |
payload | the 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_name | the 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_name | the 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_manager | the data plane manager to register. |
is_exclusive | if 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_manager | the 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_name | the interface name. |
mac | the MAC address to add. |
error_msg | the 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_name | the interface name. |
mac | the MAC address to remove. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.