Branch: Tag:

2013-07-04

2013-07-04 21:36:12 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Stdio.UDP: Support IPv6 multicast.

enable_multicast() and set_multicast_ttl() now support IPv6.

Also improves documentation for the multicast-related functions.

2697:   <dd><p><code><code class='datatype'>int</code> <b><span class='method'>add_membership</span>(</b><code class='datatype'>string</code> <code class='argument'>group</code>, <code class='datatype'>void</code>|<code class='datatype'>string</code> <code class='argument'>address</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Join a multicast group. <code>group</code> contains the address of the -  multicast group the application wants to join or leave. It must be -  a valid multicast address. <code>address</code> is the address of the local -  interface with wich the system should join to the multicast group. -  If not provided the system will select an appropriate interface. -  See also the Unix man page for setsocketopt IPPROTO_IP -  ADD_MEMBERSHIP.</p> + <dd class='body--doc'><p>Join a multicast group.</p>   </dd> -  + <dt class='head--doc'><span id='p-group'></span>Parameter <code class='parameter'>group</code></dt> + <dd></dd><dd class='body--doc'><p><code>group</code> contains the address of the multicast group the +  application wants to join. It must be a valid multicast address.</p> + </dd> + <dt class='head--doc'><span id='p-address'></span>Parameter <code class='parameter'>address</code></dt> + <dd></dd><dd class='body--doc'><p><code>address</code> is the address of the local interface with which +  the system should join to the multicast group. If not provided +  the system will select an appropriate interface.</p> + <p> See also the Unix man page for setsocketopt IPPROTO_IP IP_ADD_MEMBERSHIP +  and IPPROTO_IPV6 IPV6_ADD_MEMBERSHIP.</p> + </dd> + <dt class='head--doc'>Note</dt> + <dd class='body--doc'><p>The <code>address</code> parameter is currently not supported for IPv6.</p> + </dd> + <dt class='head--doc'>Note</dt> + <dd class='body--doc'><p>This function did not support IPv6 in Pike 7.8 and earlier.</p> + </dd>   <dt class='head--doc'>See also</dt> - <dd class='body--doc'><p><code>drop_membership</code></p> + <dd class='body--doc'><p><code>drop_membership()</code></p>   </dd></dl>      
2777:   <dt class='head--doc'>Description</dt>   <dd class='body--doc'><p>Leave a multicast group.</p>   </dd> + <dt class='head--doc'><span id='p-group'></span>Parameter <code class='parameter'>group</code></dt> + <dd></dd><dd class='body--doc'><p><code>group</code> contains the address of the multicast group the +  application wants to join. It must be a valid multicast address.</p> + </dd> + <dt class='head--doc'><span id='p-address'></span>Parameter <code class='parameter'>address</code></dt> + <dd></dd><dd class='body--doc'><p><code>address</code> is the address of the local interface with which +  the system should join to the multicast group. If not provided +  the system will select an appropriate interface.</p> + <p> See also the Unix man page for setsocketopt IPPROTO_IP IP_DROP_MEMBERSHIP +  and IPPROTO_IPV6 IPV6_DROP_MEMBERSHIP.</p> + </dd> + <dt class='head--doc'>Note</dt> + <dd class='body--doc'><p>The <code>address</code> parameter is currently not supported for IPv6.</p> + </dd> + <dt class='head--doc'>Note</dt> + <dd class='body--doc'><p>This function did not support IPv6 in Pike 7.8 and earlier.</p> + </dd>   <dt class='head--doc'>See also</dt> - <dd class='body--doc'><p><code>add_membership</code></p> + <dd class='body--doc'><p><code>add_membership()</code></p>   </dd></dl>      
2811:   <dd><p><code><code class='datatype'>bool</code> <b><span class='method'>enable_multicast</span>(</b><code class='datatype'>string</code> <code class='argument'>reply_address</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Set the local device for a multicast socket. See also the Unix man -  page for setsocketopt IPPROTO_IP IP_MULTICAST_IF.</p> + <dd class='body--doc'><p>Set the local device for a multicast socket.</p> + </dd> + <dt class='head--doc'><span id='p-reply_address'></span>Parameter <code class='parameter'>reply_address</code></dt> + <dd></dd><dd class='body--doc'><p>Local address that should appear in the multicast packets.</p> + <p> See also the Unix man page for setsocketopt IPPROTO_IP IP_MULTICAST_IF +  and IPPROTO_IPV6 IPV6_MULTICAST_IF.</p> + </dd> + <dt class='head--doc'>Note</dt> + <dd class='body--doc'><p>This function did not support IPv6 in Pike 7.8.</p>   </dd></dl>      
2986:   <dd><p><code><code class='datatype'>int</code> <b><span class='method'>set_multicast_ttl</span>(</b><code class='datatype'>int</code> <code class='argument'>ttl</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Set the time-to-live value of outgoing multicast packets for this -  socket. It is very important for multicast packets to set the -  smallest TTL possible. The default is 1 which means that multicast -  packets don't leacl the local network unless the user program -  explicitly request it. See also the Unix man page for setsocketopt -  IPPROTO_IP IP_MULTICAST_TTL.</p> + <dd class='body--doc'><p>Set the time-to-live value of outgoing multicast packets +  for this socket.</p> + </dd> + <dt class='head--doc'><span id='p-ttl'></span>Parameter <code class='parameter'>ttl</code></dt> + <dd></dd><dd class='body--doc'><p>The number of router hops sent multicast packets should +  survive.</p> + <p> It is very important for multicast packets to set the +  smallest TTL possible. The default before calling this +  function is 1 which means that multicast packets don't +  leak from the local network unless the user program +  explicitly requests it.</p> + <p> See also the Unix man page for setsocketopt IPPROTO_IP IP_MULTICAST_TTL +  and IPPROTO_IPV6 IPV6_MULTICAST_HOPS.</p> + </dd> + <dt class='head--doc'>Note</dt> + <dd class='body--doc'><p>This function did not support IPv6 in Pike 7.8 and earlier.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>add_membership()</code></p>   </dd></dl>