|
|
There should be one node per MLD or IGMP instance. There should be one instance per address family.
Mld6igmpNode (int family, xorp_module_id module_id, EventLoop& eventloop)
| Mld6igmpNode |
Constructor for a given address family, module ID, and event loop.
Parameters:
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_MLD6IGMP. |
eventloop | the event loop to use. |
~Mld6igmpNode ()
| ~Mld6igmpNode |
[virtual]
int start ()
| start |
Start the node operation.
Start the MLD or IGMP protocol. After the startup operations are completed, Mld6igmpNode::final_start() is called internally to complete the job.
Returns: XORP_OK on success, otherwise XORP_ERROR.
int stop ()
| stop |
Stop the node operation.
Gracefully stop the MLD or IGMP protocol. After the shutdown operations are completed, Mld6igmpNode::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 Mld6igmpNode::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 Mld6igmpNode::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.
uint8_t ip_protocol_number ()
| ip_protocol_number |
[const]
Get the IP protocol number.
Returns: the IP protocol number.
int add_vif (const Vif& vif, string& error_msg)
| add_vif |
Install a new MLD/IGMP vif.
Parameters:
vif | vif information about the new Mld6igmpVif to install. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
Reimplemented from ProtoNode.
int add_vif (const string& vif_name, uint32_t vif_index,
string& error_msg)
| add_vif |
Install a new MLD/IGMP vif.
Parameters:
vif_name | the name of the new vif. |
vif_index | the vif index of the new vif. |
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 MLD/IGMP 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 set_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_vif_flags |
Set flags to a vif.
Parameters:
vif_name | the name of the vif. |
is_pim_register | true if this is a PIM Register vif. |
is_p2p | true if this is a point-to-point vif. |
is_loopback | true if this 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 vif is UP and running. |
mtu | the MTU of the vif. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int add_vif_addr (const string& vif_name,
const IPvX& addr,
const IPvXNet& subnet_addr,
const IPvX& broadcast_addr,
const IPvX& peer_addr,
string& error_msg)
| add_vif_addr |
Add an address to a vif.
Parameters:
vif_name | the name of the vif. |
addr | the unicast address to add. |
subnet_addr | the subnet address to add. |
broadcast_addr | the broadcast address (when applicable). |
peer_addr | the peer address (when applicable). |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int delete_vif_addr (const string& vif_name,
const IPvX& addr,
string& error_msg)
| delete_vif_addr |
Delete an address from a vif.
Parameters:
vif_name | the name of the vif. |
addr | the unicast address to delete. |
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 MLD6IGMP 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 MLD6IGMP 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 MLD6IGMP 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 MLD6IGMP 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 MLD/IGMP on all enabled interfaces.
Returns: XORP_OK on success, otherwise XORP_ERROR.
int stop_all_vifs ()
| stop_all_vifs |
Stop MLD/IGMP on all interfaces it was running on.
Returns: XORP_OK on success, otherwise XORP_ERROR.
int enable_all_vifs ()
| enable_all_vifs |
Enable MLD/IGMP on all interfaces.
Returns: XORP_OK on success, otherwise XORP_ERROR.
int disable_all_vifs ()
| disable_all_vifs |
Disable MLD/IGMP on all interfaces.
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 proto_recv (const string& if_name,
const string& vif_name,
const IPvX& src_address,
const IPvX& dst_address,
uint8_t ip_protocol,
int32_t ip_ttl,
int32_t ip_tos,
bool ip_router_alert,
bool ip_internet_control,
const vector<uint8_t>& payload,
string& error_msg)
| proto_recv |
Receive a protocol packet.
Parameters:
if_name | the interface name the packet arrived on. |
vif_name | the vif name the packet arrived on. |
src_address | the IP source address. |
dst_address | the IP destination address. |
ip_protocol | the IP protocol number. |
ip_ttl | the IP TTL (hop-limit). If it has a negative value, then the received value is unknown. |
ip_tos | the Type of Service (Diffserv/ECN bits for IPv4). If it has a negative value, then the received value is unknown. |
ip_router_alert | if true, the IP Router Alert option was included in the IP packet. |
ip_internet_control | if true, then this is IP control traffic. |
payload | the payload, everything after the IP header and options. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
Reimplemented from ProtoNode.
int mld6igmp_send (const string& if_name,
const string& vif_name,
const IPvX& src_address,
const IPvX& dst_address,
uint8_t ip_protocol,
int32_t ip_ttl,
int32_t ip_tos,
bool ip_router_alert,
bool ip_internet_control,
buffer_t *buffer,
string& error_msg)
| mld6igmp_send |
Send a protocol packet.
Parameters:
if_name | the interface to send the packet on. It is essential for multicast. In the unicast case this field may be empty. |
vif_name | the vif to send the packet on. It is essential for multicast. In the unicast case this field may be empty. |
src_address | the IP source address. |
dst_address | the IP destination address. |
ip_protocol | the IP protocol number. It must be between 1 and 255. |
ip_ttl | the IP TTL (hop-limit). If it has a negative value, the TTL will be set internally before transmission. |
ip_tos | the Type Of Service (Diffserv/ECN bits for IPv4). If it has a negative value, the TOS will be set internally before transmission. |
ip_router_alert | if true, then add the IP Router Alert option to the IP packet. |
ip_internet_control | if true, then this is IP control traffic. |
buffer | the data buffer with the packet to send. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int signal_message_recv (const string& ,
int ,
uint32_t ,
const IPvX& ,
const IPvX& ,
const uint8_t * ,
size_t
)
| signal_message_recv |
Receive signal message: not used by MLD/IGMP.
Reimplemented from ProtoNode.
int signal_message_send (const string& ,
int ,
uint32_t ,
const IPvX& ,
const IPvX& ,
const uint8_t * ,
size_t
)
| signal_message_send |
Send signal message: not used by MLD/IGMP.
Reimplemented from ProtoNode.
int register_receiver (const string& if_name,
const string& vif_name,
uint8_t ip_protocol,
bool enable_multicast_loopback)
| register_receiver |
[pure virtual]
Register as a receiver to receive packets.
This is a pure virtual function, and it must be implemented by the communication-wrapper class that inherits this base class.
Parameters:
if_name | the interface through which packets should be accepted. |
vif_name | the vif through which packets should be accepted. |
ip_protocol | the IP protocol number that the receiver is interested in. It must be between 0 and 255. A protocol number of 0 is used to specify all protocols. |
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). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int unregister_receiver (const string& if_name,
const string& vif_name,
uint8_t ip_protocol)
| unregister_receiver |
[pure virtual]
Unregister as a receiver to receive packets.
This is a pure virtual function, and it must be implemented by the communication-wrapper class that inherits this base class.
Parameters:
if_name | the interface through which packets should not be accepted. |
vif_name | the vif through which packets should not be accepted. |
ip_protocol | the IP Protocol number that the receiver is not interested in anymore. It must be between 0 and 255. A protocol number of 0 is used to specify all protocols. |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int join_multicast_group (const string& if_name,
const string& vif_name,
uint8_t ip_protocol,
const IPvX& group_address)
| join_multicast_group |
[pure virtual]
Join a multicast group on an interface.
This is a pure virtual function, and it must be implemented by the communication-wrapper class that inherits this base class.
TODO: add a source address as well!!
Parameters:
if_name | the interface name to join. |
vif_name | the vif name to join. |
ip_protocol | the IP protocol number that the receiver is interested in. |
group_address | the multicast group address to join. |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int leave_multicast_group (const string& if_name,
const string& vif_name,
uint8_t ip_protocol,
const IPvX& group_address)
| leave_multicast_group |
[pure virtual]
Leave a multicast group on an interface.
This is a pure virtual function, and it must be implemented by the communication-wrapper class that inherits this base class.
TODO: add a source address as well!!
Parameters:
if_name | the interface name to leave. |
vif_name | the vif name to leave. |
ip_protocol | the IP protocol number that the receiver is not interested in anymore. |
group_address | the multicast group address to leave. |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int add_protocol (const string& module_instance_name,
xorp_module_id module_id,
uint32_t vif_index)
| add_protocol |
Add a protocol that needs to be notified about multicast membership changes.
Add a protocol to the list of entries that would be notified if there is membership change on a particular interface.
Parameters:
module_instance_name | the module instance name of the protocol to add. |
module_id | the module ID (xorp_module_id) of the protocol to add. |
vif_index | the vif index of the interface to add the protocol to. |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int delete_protocol (const string& module_instance_name,
xorp_module_id module_id,
uint32_t vif_index)
| delete_protocol |
Delete a protocol that needs to be notified about multicast membership changes.
Delete a protocol from the list of entries that would be notified if there is membership change on a particular interface.
Parameters:
module_instance_name | the module instance name of the protocol to delete. |
module_id | the module ID (xorp_module_id) of the protocol to delete. |
vif_index | the vif index of the interface to delete the protocol from. |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int send_add_membership (const string& dst_module_instance_name,
xorp_module_id dst_module_id,
uint32_t vif_index,
const IPvX& source,
const IPvX& group)
| send_add_membership |
[pure virtual]
Send "add membership" to a protocol that needs to be notified about multicast membership changes.
This is a pure virtual function, and it must be implemented by the communication-wrapper class that inherits this base class.
Parameters:
dst_module_instance_name | the module instance name of the protocol to notify. |
dst_module_id | the module ID (xorp_module_id) of the protocol to notify. |
vif_index | the vif index of the interface with membership change. |
source | the source address of the (S,G) or (*,G) entry that has changed membership. In case of Any-Source Multicast, it is IPvX::ZERO(). |
group | the group address. |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int send_delete_membership (const string& dst_module_instance_name,
xorp_module_id dst_module_id,
uint32_t vif_index,
const IPvX& source,
const IPvX& group)
| send_delete_membership |
[pure virtual]
Send "delete membership" to a protocol that needs to be notified about multicast membership changes.
This is a pure virtual function, and it must be implemented by the communication-wrapper class that inherits this base class.
Parameters:
dst_module_instance_name | the module instance name of the protocol to notify. |
dst_module_id | the module ID (xorp_module_id) of the protocol to notify. |
vif_index | the vif index of the interface with membership change. |
source | the source address of the (S,G) or (*,G) entry that has changed membership. In case of Any-Source Multicast, it is IPvX::ZERO(). |
group | the group address of the (S,G) or (*,G) entry that has changed. |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int join_prune_notify_routing (const string& module_instance_name,
xorp_module_id module_id,
uint32_t vif_index,
const IPvX& source,
const IPvX& group,
action_jp_t action_jp)
| join_prune_notify_routing |
Notify a protocol about multicast membership change.
Parameters:
module_instance_name | the module instance name of the protocol to notify. |
module_id | the module ID (xorp_module_id) of the protocol to notify. |
vif_index | the vif index of the interface with membership change. |
source | the source address of the (S,G) or (*,G) entry that has changed. In case of group-specific multicast, it is IPvX::ZERO(). |
group | the group address of the (S,G) or (*,G) entry that has changed. |
action_jp | the membership change type (action_jp_t): either ACTION_JOIN or ACTION_PRUNE. |
Returns: XORP_OK on success, otherwise XORP_ERROR.
bool is_directly_connected (const Mld6igmpVif& mld6igmp_vif,
const IPvX& ipaddr_test)
| is_directly_connected |
[const]
Test if an address is directly connected to a specified virtual interface.
Note that the virtual interface the address is directly connected to must be UP.
Parameters:
mld6igmp_vif | the virtual interface to test against. |
ipaddr_test | the address to test. |
Returns: true if ipaddr_test is directly connected to vif, otherwise false.
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 get_vif_proto_version (const string& vif_name,
int& proto_version,
string& error_msg)
| get_vif_proto_version |
Get the protocol version on an interface.
Parameters:
vif_name | the name of the vif to get the protocol version of. |
proto_version | the return-by-reference protocol version. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int set_vif_proto_version (const string& vif_name,
int proto_version,
string& error_msg)
| set_vif_proto_version |
Set the protocol version on an interface.
Parameters:
vif_name | the name of the vif to set the protocol version of. |
proto_version | the new protocol version. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int reset_vif_proto_version (const string& vif_name,
string& error_msg)
| reset_vif_proto_version |
Reset the protocol version on an interface to its default value.
Parameters:
vif_name | the name of the vif to reset the protocol version of to its default value. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int get_vif_ip_router_alert_option_check (const string& vif_name,
bool& enabled,
string& error_msg)
| get_vif_ip_router_alert_option_check |
Get the value of the flag that enables/disables the IP Router Alert option check per interface for received packets.
Parameters:
vif_name | the name of the vif to apply to. |
enabled | the return-by-reference flag value. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int set_vif_ip_router_alert_option_check (const string& vif_name,
bool enable,
string& error_msg)
| set_vif_ip_router_alert_option_check |
Enable/disable the IP Router Alert option check per interface for received packets.
Parameters:
vif_name | the name of the vif to apply to. |
enable | if true, then enable the IP Router Alert option check, otherwise disable it. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int reset_vif_ip_router_alert_option_check (const string& vif_name,
string& error_msg)
| reset_vif_ip_router_alert_option_check |
Reset the value of the flag that enables/disables the IP Router Alert option check per interface for received packets to its default value.
Parameters:
vif_name | the name of the vif to apply to. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int get_vif_query_interval (const string& vif_name,
TimeVal& interval,
string& error_msg)
| get_vif_query_interval |
Get the Query Interval per interface.
Parameters:
vif_name | the name of the vif to apply to. |
interval | the return-by-reference interval. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int set_vif_query_interval (const string& vif_name,
const TimeVal& interval,
string& error_msg)
| set_vif_query_interval |
Set the Query Interval per interface.
Parameters:
vif_name | the name of the vif to apply to. |
interval | the interval. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int reset_vif_query_interval (const string& vif_name,
string& error_msg)
| reset_vif_query_interval |
Reset the Query Interval per interface.
Parameters:
vif_name | the name of the vif to apply to. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int get_vif_query_last_member_interval (const string& vif_name,
TimeVal& interval,
string& error_msg)
| get_vif_query_last_member_interval |
Get the Last Member Query Interval per interface.
Parameters:
vif_name | the name of the vif to apply to. |
interval | the return-by-reference interval. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int set_vif_query_last_member_interval (const string& vif_name,
const TimeVal& interval,
string& error_msg)
| set_vif_query_last_member_interval |
Set the Last Member Query Interval per interface.
Parameters:
vif_name | the name of the vif to apply to. |
interval | the interval. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int reset_vif_query_last_member_interval (const string& vif_name,
string& error_msg)
| reset_vif_query_last_member_interval |
Reset the Last Member Query Interval per interface.
Parameters:
vif_name | the name of the vif to apply to. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int get_vif_query_response_interval (const string& vif_name,
TimeVal& interval,
string& error_msg)
| get_vif_query_response_interval |
Get the Query Response Interval per interface.
Parameters:
vif_name | the name of the vif to apply to. |
interval | the return-by-reference interval. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int set_vif_query_response_interval (const string& vif_name,
const TimeVal& interval,
string& error_msg)
| set_vif_query_response_interval |
Set the Query Response Interval per interface.
Parameters:
vif_name | the name of the vif to apply to. |
interval | the interval. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int reset_vif_query_response_interval (const string& vif_name,
string& error_msg)
| reset_vif_query_response_interval |
Reset the Query Response Interval per interface.
Parameters:
vif_name | the name of the vif to apply to. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int get_vif_robust_count (const string& vif_name,
uint32_t& robust_count,
string& error_msg)
| get_vif_robust_count |
Get the Robustness Variable count per interface.
Parameters:
vif_name | the name of the vif to apply to. |
robust_count | the return-by-reference count value. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int set_vif_robust_count (const string& vif_name,
uint32_t robust_count,
string& error_msg)
| set_vif_robust_count |
Set the Robustness Variable count per interface.
Parameters:
vif_name | the name of the vif to apply to. |
robust_count | the count value. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int reset_vif_robust_count (const string& vif_name,
string& error_msg)
| reset_vif_robust_count |
Reset the Robustness Variable count per interface.
Parameters:
vif_name | the name of the vif to apply to. |
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 tree_complete ()
| tree_complete |
[protected]
Reimplemented from IfMgrHintObserver.
void updates_made ()
| updates_made |
[protected]
Reimplemented from IfMgrHintObserver.