|
xorp
|
A class for multicast routing related I/O communication. More...
#include <mfea_mrouter.hh>
Public Member Functions | |
| MfeaMrouter (MfeaNode &mfea_node, const FibConfig &fibconfig) | |
| Constructor for given MFEA node. | |
| virtual | ~MfeaMrouter () |
| Destructor. | |
| int | start () |
| Start the MfeaMrouter. | |
| int | stop () |
| Stop the MfeaMrouter. | |
| bool | have_multicast_routing4 () const |
| Test if the underlying system supports IPv4 multicast routing. | |
| bool | have_multicast_routing6 () const |
| Test if the underlying system supports IPv6 multicast routing. | |
| int | multicast_forwarding_enabled4 (bool &ret_value, string &error_msg) const |
| Test whether the IPv4 multicast forwarding engine is enabled or disabled to forward packets. | |
| int | multicast_forwarding_enabled6 (bool &ret_value, string &error_msg) const |
| Test whether the IPv6 multicast forwarding engine is enabled or disabled to forward packets. | |
| int | set_multicast_forwarding_enabled4 (bool v, string &error_msg) |
| Set the IPv4 multicast forwarding engine to enable or disable forwarding of packets. | |
| int | set_multicast_forwarding_enabled6 (bool v, string &error_msg) |
| Set the IPv6 multicast forwarding engine to enable or disable forwarding of packets. | |
| int | kernel_mrouter_ip_protocol () const |
| Get the protocol that would be used in case of mrouter socket. | |
| XorpFd | mrouter_socket () const |
| Get the mrouter socket. | |
| int | start_mrt () |
| Start/enable the multicast routing in the kernel. | |
| int | stop_mrt () |
| Stop/disable the multicast routing in the kernel. | |
| int | start_pim (string &error_msg) |
| Start/enable PIM processing in the kernel. | |
| int | stop_pim (string &error_msg) |
| Stop/disable PIM processing in the kernel. | |
| int | add_multicast_vif (uint32_t vif_index) |
| Add a virtual multicast interface to the kernel. | |
| int | delete_multicast_vif (uint32_t vif_index) |
| Delete a virtual multicast interface from the kernel. | |
| int | add_mfc (const IPvX &source, const IPvX &group, uint32_t iif_vif_index, uint8_t *oifs_ttl, uint8_t *oifs_flags, const IPvX &rp_addr) |
| Install/modify a Multicast Forwarding Cache (MFC) entry in the kernel. | |
| int | delete_mfc (const IPvX &source, const IPvX &group) |
| Delete a Multicast Forwarding Cache (MFC) entry in the kernel. | |
| int | add_bw_upcall (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 a dataflow monitor entry in the kernel. | |
| int | delete_bw_upcall (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 a dataflow monitor entry from the kernel. | |
| int | delete_all_bw_upcall (const IPvX &source, const IPvX &group, string &error_msg) |
| Delete all dataflow monitor entries from the kernel for a given source and group address. | |
| int | get_sg_count (const IPvX &source, const IPvX &group, SgCount &sg_count) |
| Get various counters per (S,G) entry. | |
| int | get_vif_count (uint32_t vif_index, VifCount &vif_count) |
| Get various counters per virtual interface. | |
| bool | mrt_api_mrt_mfc_flags_disable_wrongvif () const |
| Get the flag that indicates whether the kernel supports disabling of WRONGVIF signal per (S,G) per interface. | |
| bool | mrt_api_mrt_mfc_flags_border_vif () const |
| Get the flag that indicates whether the kernel supports setting of the Border bit flag per (S,G) per interface. | |
| bool | mrt_api_mrt_mfc_rp () const |
| Get the flag that indicates whether the kernel supports adding the RP address to the kernel. | |
| bool | mrt_api_mrt_mfc_bw_upcall () const |
| Get the flag that indicates whether the kernel supports the bandwidth upcall mechanism. | |
| int | kernel_call_process (const uint8_t *databuf, size_t datalen) |
| Process a call from the kernel (e.g., "nocache", "wrongiif", "wholepkt") XXX: It is OK for im_src/im6_src to be 0 (for 'nocache' or 'wrongiif'), just in case the kernel supports (*,G) MFC. | |
Private Member Functions | |
| MfeaNode & | mfea_node () const |
Private Attributes | |
| MfeaNode & | _mfea_node |
| XorpFd | _mrouter_socket |
| bool | _mrt_api_mrt_mfc_flags_disable_wrongvif |
| bool | _mrt_api_mrt_mfc_flags_border_vif |
| bool | _mrt_api_mrt_mfc_rp |
| bool | _mrt_api_mrt_mfc_bw_upcall |
| bool | _multicast_forwarding_enabled |
| const FibConfig & | _fibconfig |
A class for multicast routing related I/O communication.
In case of UNIX kernels, we cannot have more than one MfeaMrouter per address family (i.e., one per IPv4, and one per IPv6).
Constructor for given MFEA node.
MfeaMrouter::MfeaMrouter: : The MfeaNode I belong to.
| int MfeaMrouter::add_bw_upcall | ( | 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 a dataflow monitor entry in the kernel.
MfeaMrouter::add_bw_upcall: : The source address.
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.
| 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). |
: The group address. : The dataflow threshold interval. : The threshold (in number of packets) to compare against. : The threshold (in number of bytes) to compare against. : If true, is valid. : If true, is valid. : If true, the operation for comparison is ">=". : If true, the operation for comparison is "<=". : The error message (if error).
Add a dataflow monitor entry in the kernel. Note: either or (or both) must be true. Note: either or (but not both) must be true.
Return value: XORP_OK on success, otherwise XORP_ERROR.
| int MfeaMrouter::add_mfc | ( | const IPvX & | source, |
| const IPvX & | group, | ||
| uint32_t | iif_vif_index, | ||
| uint8_t * | oifs_ttl, | ||
| uint8_t * | oifs_flags, | ||
| const IPvX & | rp_addr | ||
| ) |
Install/modify a Multicast Forwarding Cache (MFC) entry in the kernel.
MfeaMrouter::add_mfc: : The MFC source address.
If the MFC entry specified by (source, group) pair was not installed before, a new MFC entry will be created in the kernel; otherwise, the existing entry's fields will be modified.
| source | the MFC source address. |
| group | the MFC group address. |
| iif_vif_index | the MFC incoming interface index. |
| oifs_ttl | an array with the min. TTL a packet should have to be forwarded. |
| oifs_flags | an array with misc. flags for the MFC to install. Note that those flags are supported only by the advanced multicast API. |
| rp_addr | the RP address. |
: The MFC group address. : The MFC incoming interface index. : An array with the min. TTL a packet should have to be forwarded. : An array with misc. flags for the MFC to install. Note that those flags are supported only by the advanced multicast API. : The RP address.
Install/modify a Multicast Forwarding Cache (MFC) entry in the kernel. If the MFC entry specified by (source, group) pair was not installed before, a new MFC entry will be created in the kernel; otherwise, the existing entry's fields will be modified.
Return value: XORP_OK on success, otherwise XORP_ERROR.
| int MfeaMrouter::add_multicast_vif | ( | uint32_t | vif_index | ) |
Add a virtual multicast interface to the kernel.
MfeaMrouter::add_multicast_vif: : The vif index of the virtual interface to add.
Add a virtual multicast interface to the kernel.
Return value: XORP_OK on success, otherwise XORP_ERROR.
| int MfeaMrouter::delete_all_bw_upcall | ( | const IPvX & | source, |
| const IPvX & | group, | ||
| string & | error_msg | ||
| ) |
Delete all dataflow monitor entries from the kernel for a given source and group address.
MfeaMrouter::delete_all_bw_upcall: : The source address.
| source | the source address. |
| group | the group address. |
| error_msg | the error message (if error). |
: The group address. : The error message (if error).
Delete all dataflow monitor entries from the kernel for a given and address.
Return value: XORP_OK on success, otherwise XORP_ERROR.
| int MfeaMrouter::delete_bw_upcall | ( | 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 a dataflow monitor entry from the kernel.
MfeaMrouter::delete_bw_upcall: : The source address.
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.
| 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). |
: The group address. : The dataflow threshold interval. : The threshold (in number of packets) to compare against. : The threshold (in number of bytes) to compare against. : If true, is valid. : If true, is valid. : If true, the operation for comparison is ">=". : If true, the operation for comparison is "<=". : The error message (if error).
Delete a dataflow monitor entry from the kernel. Note: either or (or both) must be true. Note: either or (but not both) must be true.
Return value: XORP_OK on success, otherwise XORP_ERROR.
Delete a Multicast Forwarding Cache (MFC) entry in the kernel.
MfeaMrouter::delete_mfc: : The MFC source address.
: The MFC group address.
Delete a Multicast Forwarding Cache (MFC) entry in the kernel.
Return value: XORP_OK on success, otherwise XORP_ERROR.
| int MfeaMrouter::delete_multicast_vif | ( | uint32_t | vif_index | ) |
Delete a virtual multicast interface from the kernel.
MfeaMrouter::delete_multicast_vif: : The vif index of the interface to delete.
Delete a virtual multicast interface from the kernel.
Return value: XORP_OK on success, otherwise XORP_ERROR.
Get various counters per (S,G) entry.
MfeaMrouter::get_sg_count: : The MFC source address.
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.
| source | the MFC source address. |
| group | the MFC group address. |
| sg_count | a reference to a SgCount class to place the result. |
: The MFC group address. : A reference to a SgCount class to place the result.
Get various counters per (S,G) entry. 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.
Return value: XORP_OK on success, otherwise XORP_ERROR.
| int MfeaMrouter::get_vif_count | ( | uint32_t | vif_index, |
| VifCount & | vif_count | ||
| ) |
Get various counters per virtual interface.
MfeaMrouter::get_vif_count: : The vif index of the virtual multicast interface whose statistics we need.
Get the number of packets and bytes received on, or forwarded on a particular multicast interface.
| 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. |
: A reference to a VifCount class to store the result.
Get various counters per virtual interface. Get the number of packets and bytes received on, or forwarded on a particular multicast interface.
Return value: XORP_OK on success, otherwise XORP_ERROR.
| bool MfeaMrouter::have_multicast_routing4 | ( | ) | const |
| bool MfeaMrouter::have_multicast_routing6 | ( | ) | const |
| int MfeaMrouter::kernel_call_process | ( | const uint8_t * | databuf, |
| size_t | datalen | ||
| ) |
Process a call from the kernel (e.g., "nocache", "wrongiif", "wholepkt") XXX: It is OK for im_src/im6_src to be 0 (for 'nocache' or 'wrongiif'), just in case the kernel supports (*,G) MFC.
kernel_call_process: : The data buffer.
: The length of the data in 'databuf'.
Process a call from the kernel (e.g., "nocache", "wrongiif", "wholepkt") XXX: It is OK for im_src/im6_src to be 0 (for 'nocache' or 'wrongiif'), just in case the kernel supports (*,G) MFC.
Return value: XORP_OK on success, otherwise XORP_ERROR.
| int MfeaMrouter::kernel_mrouter_ip_protocol | ( | ) | const |
Get the protocol that would be used in case of mrouter socket.
MfeaMrouter::kernel_mrouter_ip_protocol: @:
Return value: the protocol number on success, otherwise -1.
Get the protocol that would be used in case of mrouter socket.
Return value: the protocol number on success, otherwise -1.
| XorpFd MfeaMrouter::mrouter_socket | ( | ) | const [inline] |
| bool MfeaMrouter::mrt_api_mrt_mfc_bw_upcall | ( | ) | const [inline] |
| bool MfeaMrouter::mrt_api_mrt_mfc_flags_border_vif | ( | ) | const [inline] |
| bool MfeaMrouter::mrt_api_mrt_mfc_flags_disable_wrongvif | ( | ) | const [inline] |
| bool MfeaMrouter::mrt_api_mrt_mfc_rp | ( | ) | const [inline] |
| int MfeaMrouter::multicast_forwarding_enabled4 | ( | bool & | ret_value, |
| string & | error_msg | ||
| ) | const |
| int MfeaMrouter::multicast_forwarding_enabled6 | ( | bool & | ret_value, |
| string & | error_msg | ||
| ) | const |
| int MfeaMrouter::set_multicast_forwarding_enabled4 | ( | bool | v, |
| string & | error_msg | ||
| ) |
| int MfeaMrouter::set_multicast_forwarding_enabled6 | ( | bool | v, |
| string & | error_msg | ||
| ) |
| int MfeaMrouter::start | ( | ) |
Start the MfeaMrouter.
Start the MfeaMrouter.
Return value: XORP_OK on success, otherwize XORP_ERROR.
Reimplemented from ProtoState.
| int MfeaMrouter::start_mrt | ( | ) |
| int MfeaMrouter::start_pim | ( | string & | error_msg | ) |
| int MfeaMrouter::stop | ( | ) |
Stop the MfeaMrouter.
Stop the MfeaMrouter.
Return value: XORP_OK on success, otherwise XORP_ERROR.
Reimplemented from ProtoState.
| int MfeaMrouter::stop_mrt | ( | ) |
| int MfeaMrouter::stop_pim | ( | string & | error_msg | ) |