Disabling Multicast in Micro
There are three steps to take to configure Connext Micro not to use multicast.
Set disable_auto_interface_config to true.
Micro will scan the system for available interfaces and use them. Note, however, when this is set to true, Micro relies on just the manually added interfaces.Add an interface without the multicast flag UDP_INTERFACE_INTERFACE_MULTICAST_FLAG.
An interface may have the multicast flag set; however, adding it as an entry without the multicast flag set lets Micro know that it should use a different interface for multicast traffic.Set is_default_interface to false.
When Micro has no valid interface to send multicast packets, it relies on an interface with is_default_interface set to true. If an interface is configured with is_default_interface set to true, Micro sends multicast packets via this interface as a last resort.
Not all configurations are needed to configure Micro to not use multicast. For example, if two applications are communicating and neither shares a multicast locator, is_default_interface is not needed since Micro does not have a reason to send multicast packets.
Here is a snippet showing the configuration above:
RT_Registry_unregister(registry, NETIO_DEFAULT_UDP_NAME, NULL, NULL) udp_property = (structUDP_InterfaceFactoryProperty*) malloc(sizeof(structUDP_InterfaceFactoryProperty)); *udp_property = UDP_INTERFACE_FACTORY_PROPERTY_DEFAULT; udp_property->disable_auto_interface_config = DDS_BOOLEAN_TRUE; // 1 REDA_StringSeq_set_maximum(&udp_property->allow_interface, 1); REDA_StringSeq_set_length(&udp_property->allow_interface, 1); UDP_InterfaceTable_add_entry(&udp_property->if_table, 0x0a100942,0xffffff00,"enp0s8", UDP_INTERFACE_INTERFACE_UP_FLAG); // 2 udp_property->is_default_interface= DDS_BOOLEAN_FALSE; // 3 RT_Registry_register(registry, NETI O_DEFAULT_UDP_NAME, UDP_InterfaceFactory_get_interface(), (structRT_ComponentFactoryProperty*) udp_property, NULL)