There should be one node per MFEA instance. There should be one instance per address family.
MfeaNode (FeaNode& fea_node, int family, xorp_module_id module_id,
EventLoop& eventloop)
| MfeaNode |
Constructor for a given address family, module ID, and event loop.
Parameters:
fea_node | the corresponding FeaNode (FeaNode). |
family | the address family (AF_INET or AF_INET6 for IPv4 and IPv6 respectively). |
module_id | the module ID (xorp_module_id). Should be equal to XORP_MODULE_MFEA. |
eventloop | the event loop to use. |
~MfeaNode ()
| ~MfeaNode |
[virtual]
FeaNode& fea_node ()
| fea_node |
Get the FEA node instance.
Returns: reference to the FEA node instance.
bool is_dummy ()
| is_dummy |
[const]
Test if running in dummy mode.
Returns: true if running in dummy mode, otherwise false.
int start ()
| start |
Start the node operation.
After the startup operations are completed, MfeaNode::final_start() is called internally to complete the job.
Returns: XORP_OK on success, otherwise XORP_ERROR.
int stop ()
| stop |
Stop the node operation.
After the shutdown operations are completed, MfeaNode::final_stop() is called internally to complete the job.
Returns: XORP_OK on success, otherwise XORP_ERROR.
int final_start ()
| final_start |
Completely start the node operation.
This method should be called internally after MfeaNode::start() to complete the job.
Returns: XORP_OK on success, otherwise XORP_ERROR.
int final_stop ()
| final_stop |
Completely stop the node operation.
This method should be called internally after MfeaNode::stop() to complete the job.
Returns: XORP_OK on success, otherwise XORP_ERROR.
void enable ()
| enable |
Enable node operation.
If an unit is not enabled, it cannot be start, or pending-start.
void disable ()
| disable |
Disable node operation.
If an unit is disabled, it cannot be start or pending-start. If the unit was runnning, it will be stop first.
bool have_multicast_routing4 ()
| have_multicast_routing4 |
[const]
Test if the underlying system supports IPv4 multicast routing.
Returns: true if the underlying system supports IPv4 multicast routing, otherwise false.
bool have_multicast_routing6 ()
| have_multicast_routing6 |
[const]
Test if the underlying system supports IPv6 multicast routing.
Returns: true if the underlying system supports IPv6 multicast routing, otherwise false.
int add_vif (const Vif& vif, string& error_msg)
| add_vif |
Install a new MFEA vif.
Parameters:
vif | vif information about the new MfeaVif to install. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
Reimplemented from ProtoNode.
int delete_vif (const string& vif_name, string& error_msg)
| delete_vif |
Delete an existing MFEA vif.
Parameters:
vif_name | the name of the vif to delete. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
Reimplemented from ProtoNode.
int add_config_vif (const Vif& vif, string& error_msg)
| add_config_vif |
Add a configured vif.
Parameters:
vif | the vif with the information to add. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
Reimplemented from ProtoNode.
int set_config_vif_flags (const string& vif_name,
bool is_pim_register,
bool is_p2p,
bool is_loopback,
bool is_multicast,
bool is_broadcast,
bool is_up,
uint32_t mtu,
string& error_msg)
| set_config_vif_flags |
Set the vif flags of a configured vif.
Parameters:
vif_name | the name of the vif. |
is_pim_register | true if the vif is a PIM Register interface. |
is_p2p | true if the vif is point-to-point interface. |
is_loopback | true if the vif is a loopback interface. |
is_multicast | true if the vif is multicast capable. |
is_broadcast | true if the vif is broadcast capable. |
is_up | true if the underlying vif is UP. |
mtu | the MTU of the vif. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
Reimplemented from ProtoNode.
int set_config_all_vifs_done (string& error_msg)
| set_config_all_vifs_done |
Complete the set of vif configuration changes.
Parameters:
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int enable_vif (const string& vif_name, string& error_msg)
| enable_vif |
Enable an existing MFEA vif.
Parameters:
vif_name | the name of the vif to enable. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int disable_vif (const string& vif_name, string& error_msg)
| disable_vif |
Disable an existing MFEA vif.
Parameters:
vif_name | the name of the vif to disable. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int start_vif (const string& vif_name, string& error_msg)
| start_vif |
Start an existing MFEA vif.
Parameters:
vif_name | the name of the vif to start. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int stop_vif (const string& vif_name, string& error_msg)
| stop_vif |
Stop an existing MFEA vif.
Parameters:
vif_name | the name of the vif to start. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int start_all_vifs ()
| start_all_vifs |
Start MFEA on all enabled interfaces.
Returns: XORP_OK on success, otherwise XORP_ERROR.
int stop_all_vifs ()
| stop_all_vifs |
Stop MFEA on all interfaces it was running on.
Returns: XORP_OK on success, otherwise XORP_ERROR.
int enable_all_vifs ()
| enable_all_vifs |
Enable MFEA on all interfaces.
Returns: XORP_OK on success, otherwise XORP_ERROR.
int disable_all_vifs ()
| disable_all_vifs |
Disable MFEA on all interfaces.
All running interfaces are stopped first.
Returns: XORP_OK on success, otherwise XORP_ERROR.
void delete_all_vifs ()
| delete_all_vifs |
void vif_shutdown_completed (const string& vif_name)
| vif_shutdown_completed |
A method called when a vif has completed its shutdown.
Parameters:
vif_name | the name of the vif that has completed its shutdown. |
int register_protocol (const string& module_instance_name,
const string& if_name,
const string& vif_name,
uint8_t ip_protocol,
string& error_msg)
| register_protocol |
Register a protocol on an interface in the Multicast FEA.
There could be only one registered protocol per interface/vif.
Parameters:
module_instance_name | the module instance name of the protocol to register. |
if_name | the name of the interface to register for the particular protocol. |
vif_name | the name of the vif to register for the particular protocol. |
ip_protocol | the IP protocol number. It must be between 1 and 255. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int unregister_protocol (const string& module_instance_name,
const string& if_name,
const string& vif_name,
string& error_msg)
| unregister_protocol |
Unregister a protocol on an interface in the Multicast FEA.
There could be only one registered protocol per interface/vif.
Parameters:
module_instance_name | the module instance name of the protocol to unregister. |
if_name | the name of the interface to unregister for the particular protocol. |
vif_name | the name of the vif to unregister for the particular protocol. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int proto_recv (const string& ,
const string& ,
const IPvX& ,
const IPvX& ,
uint8_t ,
int32_t ,
int32_t ,
bool ,
bool ,
const vector<uint8_t>& ,
string&
)
| proto_recv |
UNUSED
Reimplemented from ProtoNode.
int proto_send (const string& ,
const string& ,
const IPvX& ,
const IPvX& ,
uint8_t ,
int32_t ,
int32_t ,
bool ,
bool ,
const uint8_t* ,
size_t ,
string&
)
| proto_send |
UNUSED
Reimplemented from ProtoNode.
int signal_message_recv (const string& src_module_instance_name,
int message_type,
uint32_t vif_index,
const IPvX& src,
const IPvX& dst,
const uint8_t *rcvbuf,
size_t rcvlen)
| signal_message_recv |
Process NOCACHE, WRONGVIF/WRONGMIF, WHOLEPKT signals from the kernel.
The signal is sent to all user-level protocols that expect it.
#define IGMPMSG_NOCACHE 1 #define IGMPMSG_WRONGVIF 2 #define IGMPMSG_WHOLEPKT 3 #define MRT6MSG_NOCACHE 1 #define MRT6MSG_WRONGMIF 2 #define MRT6MSG_WHOLEPKT 3
Parameters:
src_module_instance_name | unused. |
message_type | the message type of the kernel signal (for IPv4 and IPv6 respectively): |
vif_index | the vif index of the related interface (message-specific). |
src | the source address in the message. |
dst | the destination address in the message. |
rcvbuf | the data buffer with the additional information in the message. |
rcvlen | the data length in rcvbuf. |
Returns: XORP_OK on success, otherwise XORP_ERROR.
Reimplemented from ProtoNode.
int signal_dataflow_message_recv (const IPvX& source,
const IPvX& group,
const TimeVal& threshold_interval,
const TimeVal& measured_interval,
uint32_t threshold_packets,
uint32_t threshold_bytes,
uint32_t measured_packets,
uint32_t measured_bytes,
bool is_threshold_in_packets,
bool is_threshold_in_bytes,
bool is_geq_upcall,
bool is_leq_upcall)
| signal_dataflow_message_recv |
Process a dataflow upcall from the kernel or from the MFEA internal mechanism.
The MFEA internal bandwidth-estimation mechanism is based on periodic reading of the kernel multicast forwarding statistics. The signal is sent to all user-level protocols that expect it.
Note: either is_threshold_in_packets or is_threshold_in_bytes (or both) must be true. Note: either is_geq_upcall or is_leq_upcall (but not both) must be true.
Parameters:
source | the source address. |
group | the group address. |
threshold_interval | the dataflow threshold interval. |
measured_interval | the dataflow measured interval. |
threshold_packets | the threshold (in number of packets) to compare against. |
threshold_bytes | the threshold (in number of bytes) to compare against. |
measured_packets | the number of packets measured within the measured_interval. |
measured_bytes | the number of bytes measured within the measured_interval. |
is_threshold_in_packets | if true, threshold_packets is valid. |
is_threshold_in_bytes | if true, threshold_bytes is valid. |
is_geq_upcall | if true, the operation for comparison is ">=". |
is_leq_upcall | if true, the operation for comparison is "<=". |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int dataflow_signal_send (const string& dst_module_instance_name,
const IPvX& source_addr,
const IPvX& group_addr,
uint32_t threshold_interval_sec,
uint32_t threshold_interval_usec,
uint32_t measured_interval_sec,
uint32_t measured_interval_usec,
uint32_t threshold_packets,
uint32_t threshold_bytes,
uint32_t measured_packets,
uint32_t measured_bytes,
bool is_threshold_in_packets,
bool is_threshold_in_bytes,
bool is_geq_upcall,
bool is_leq_upcall)
| dataflow_signal_send |
[pure virtual]
Send a signal that a dataflow-related pre-condition is true.
This is a pure virtual function, and it must be implemented by the communication-wrapper class that inherits this base class.
Note: either is_threshold_in_packets or is_threshold_in_bytes (or both) must be true. Note: either is_geq_upcall or is_leq_upcall (but not both) must be true.
Parameters:
dst_module_instance_name | the module instance name of the module-recepient of the message. |
source_addr | the source address of the dataflow. |
group_addr | the group address of the dataflow. |
threshold_interval_sec | the number of seconds in the interval requested for measurement. |
threshold_interval_usec | the number of microseconds in the interval requested for measurement. |
measured_interval_sec | the number of seconds in the last measured interval that has triggered the signal. |
measured_interval_usec | the number of microseconds in the last measured interval that has triggered the signal. |
threshold_packets | the threshold value to trigger a signal (in number of packets). |
threshold_bytes | the threshold value to trigger a signal (in bytes). |
measured_packets | the number of packets measured within the measured_interval. |
measured_bytes | the number of bytes measured within the measured_interval. |
is_threshold_in_packets | if true, threshold_packets is valid. |
is_threshold_in_bytes | if true, threshold_bytes is valid. |
is_geq_upcall | if true, the operation for comparison is ">=". |
is_leq_upcall | if true, the operation for comparison is "<=". |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int add_mfc (const string& module_instance_name,
const IPvX& source, const IPvX& group,
uint32_t iif_vif_index, const Mifset& oiflist,
const Mifset& oiflist_disable_wrongvif,
uint32_t max_vifs_oiflist,
const IPvX& rp_addr)
| add_mfc |
Add Multicast Forwarding Cache (MFC) to the kernel.
Parameters:
module_instance_name | the module instance name of the protocol that adds the MFC. |
source | the source address. |
group | the group address. |
iif_vif_index | the vif index of the incoming interface. |
oiflist | the bitset with the outgoing interfaces. |
oiflist_disable_wrongvif | the bitset with the outgoing interfaces to disable the WRONGVIF signal. |
max_vifs_oiflist | the number of vifs covered by oiflist or oiflist_disable_wrongvif. |
rp_addr | the RP address. |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int delete_mfc (const string& module_instance_name,
const IPvX& source, const IPvX& group)
| delete_mfc |
Delete Multicast Forwarding Cache (MFC) from the kernel.
Note: all corresponding dataflow entries are also removed.
Parameters:
module_instance_name | the module instance name of the protocol that deletes the MFC. |
source | the source address. |
group | the group address. |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int add_dataflow_monitor (const string& module_instance_name,
const IPvX& source, const IPvX& group,
const TimeVal& threshold_interval,
uint32_t threshold_packets,
uint32_t threshold_bytes,
bool is_threshold_in_packets,
bool is_threshold_in_bytes,
bool is_geq_upcall,
bool is_leq_upcall,
string& error_msg)
| add_dataflow_monitor |
Add a dataflow monitor entry.
Note: either is_threshold_in_packets or is_threshold_in_bytes (or both) must be true. Note: either is_geq_upcall or is_leq_upcall (but not both) must be true.
Parameters:
module_instance_name | the module instance name of the protocol that adds the dataflow monitor entry. |
source | the source address. |
group | the group address. |
threshold_interval | the dataflow threshold interval. |
threshold_packets | the threshold (in number of packets) to compare against. |
threshold_bytes | the threshold (in number of bytes) to compare against. |
is_threshold_in_packets | if true, threshold_packets is valid. |
is_threshold_in_bytes | if true, threshold_bytes is valid. |
is_geq_upcall | if true, the operation for comparison is ">=". |
is_leq_upcall | if true, the operation for comparison is "<=". |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int delete_dataflow_monitor (const string& module_instance_name,
const IPvX& source, const IPvX& group,
const TimeVal& threshold_interval,
uint32_t threshold_packets,
uint32_t threshold_bytes,
bool is_threshold_in_packets,
bool is_threshold_in_bytes,
bool is_geq_upcall,
bool is_leq_upcall,
string& error_msg)
| delete_dataflow_monitor |
Delete a dataflow monitor entry.
Note: either is_threshold_in_packets or is_threshold_in_bytes (or both) must be true. Note: either is_geq_upcall or is_leq_upcall (but not both) must be true.
Parameters:
module_instance_name | the module instance name of the protocol that deletes the dataflow monitor entry. |
source | the source address. |
group | the group address. |
threshold_interval | the dataflow threshold interval. |
threshold_packets | the threshold (in number of packets) to compare against. |
threshold_bytes | the threshold (in number of bytes) to compare against. |
is_threshold_in_packets | if true, threshold_packets is valid. |
is_threshold_in_bytes | if true, threshold_bytes is valid. |
is_geq_upcall | if true, the operation for comparison is ">=". |
is_leq_upcall | if true, the operation for comparison is "<=". |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int delete_all_dataflow_monitor (const string& module_instance_name,
const IPvX& source,
const IPvX& group,
string& error_msg)
| delete_all_dataflow_monitor |
Delete all dataflow monitor entries for a given source and group address.
Parameters:
module_instance_name | the module instance name of the protocol that deletes the dataflow monitor entry. |
source | the source address. |
group | the group address. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int add_multicast_vif (uint32_t vif_index)
| add_multicast_vif |
Add a multicast vif to the kernel.
Parameters:
vif_index | the vif index of the interface to add. |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int delete_multicast_vif (uint32_t vif_index)
| delete_multicast_vif |
Delete a multicast vif from the kernel.
Parameters:
vif_index | the vif index of the interface to delete. |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int get_sg_count (const IPvX& source, const IPvX& group,
SgCount& sg_count)
| get_sg_count |
Get MFC multicast forwarding statistics from the kernel.
Get the number of packets and bytes forwarded by a particular Multicast Forwarding Cache (MFC) entry in the kernel, and the number of packets arrived on wrong interface for that entry.
Parameters:
source | the MFC source address. |
group | the MFC group address. |
sg_count | a reference to a SgCount class to place the result: the number of packets and bytes forwarded by the particular MFC entry, and the number of packets arrived on a wrong interface. |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int get_vif_count (uint32_t vif_index, VifCount& vif_count)
| get_vif_count |
Get interface multicast forwarding statistics from the kernel.
Get the number of packets and bytes received on, or forwarded on a particular multicast interface.
Parameters:
vif_index | the vif index of the virtual multicast interface whose statistics we need. |
vif_count | a reference to a VifCount class to store the result. |
Returns: XORP_OK on success, otherwise XORP_ERROR.
MfeaMrouter& mfea_mrouter ()
| mfea_mrouter |
Get a reference to the mrouter (MfeaMrouter).
Returns: a reference to the mrouter (MfeaMrouter).
MfeaDft& mfea_dft ()
| mfea_dft |
Get a reference to the dataflow table (MfeaDft).
Returns: a reference to the dataflow table (MfeaDft).
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. |
IfConfigUpdateReplicator& mfea_iftree_update_replicator ()
| mfea_iftree_update_replicator |
[protected]