Specifying an outgoing interface for IPv6 multicast

4 May
2011
4 May
'11
11:56 p.m.
Folks, Has anyone figured out how to specify the outgoing interface for IPv6 multicast using the boost asio library socket options on Linux ? See snippets below... What value does one specify for "unsigned int ipv6_interface" in the network_interface constructor ? Tried specifying the interface index (1..3 on my host) but that did not work. Thanks, Jay .. >From multicast.hpp * Implements the IPPROTO_IP/IP_MULTICAST_IF socket option. * * @par Examples * Setting the option: * @code * boost::asio::ip::udp::socket socket(io_service); * ... * boost::asio::ip::address_v4 local_interface = * boost::asio::ip::address_v4::from_string("1.2.3.4"); * boost::asio::ip::multicast::outbound_interface option(local_interface); * socket.set_option(option); * @endcode * * @par Concepts: * SettableSocketOption. */ #if defined(GENERATING_DOCUMENTATION) typedef implementation_defined outbound_interface; #else typedef boost::asio::ip::detail::socket_option::network_interface< IPPROTO_IP, IP_MULTICAST_IF, IPPROTO_IPV6, IPV6_MULTICAST_IF> outbound_interface; #endif ========================================================== From: socket_options.hpp ... // Construct with IPv6 interface. explicit network_interface(unsigned int ipv6_interface) { ipv4_value_.s_addr = boost::asio::detail::socket_ops::host_to_network_long( boost::asio::ip::address_v4::any().to_ulong()); ipv6_value_ = ipv6_interface; }
5044
Age (days ago)
5044
Last active (days ago)
0 comments
1 participants
participants (1)
-
Jay Katti