Bug 960397 - Part 1: Add multicast options to UDP IDL. r=mayhemer
authorJ. Ryan Stinnett <jryans@gmail.com>
Thu, 17 Apr 2014 15:58:00 +0200
changeset 181347 72ea2bcb65f3a66f6d52d86f03d5b13e9896dbeb
parent 181346 7f1eda6d68cbce5519a69b545cb1163373e863d9
child 181348 6888e03eb62724a66c8864b15a40c0d86a28f88e
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewersmayhemer
bugs960397
milestone32.0a1
Bug 960397 - Part 1: Add multicast options to UDP IDL. r=mayhemer
netwerk/base/public/nsIUDPSocket.idl
--- a/netwerk/base/public/nsIUDPSocket.idl
+++ b/netwerk/base/public/nsIUDPSocket.idl
@@ -23,17 +23,17 @@ native NetAddr(mozilla::net::NetAddr);
 [ptr] native NetAddrPtr(mozilla::net::NetAddr);
 [ref] native Uint8TArrayRef(FallibleTArray<uint8_t>);
 
 /**
  * nsIUDPSocket
  *
  * An interface to a UDP socket that can accept incoming connections.
  */
-[scriptable, uuid(6EFE692D-F0B0-4A9E-9E63-837C7452446D)]
+[scriptable, uuid(3240F793-80FA-4088-987A-9C7378F0AC88)]
 interface nsIUDPSocket : nsISupports
 {
     /**
      * init
      *
      * This method initializes a UDP socket.
      *
      * @param aPort
@@ -139,16 +139,76 @@ interface nsIUDPSocket : nsISupports
      * @param addr The remote host address.
      * @param data The buffer containing the data to be written.
      * @param dataLength The maximum number of bytes to be written.
      * @return number of bytes written. (0 or dataLength)
      */
     [noscript] unsigned long sendWithAddress([const] in NetAddrPtr addr,
                                              [const, array, size_is(dataLength)]in uint8_t data,
                                              in unsigned long dataLength);
+
+    /**
+     * joinMulticast
+     *
+     * Join the multicast group specified by |addr|.  You are then able to
+     * receive future datagrams addressed to the group.
+     *
+     * @param addr
+     *        The multicast group address.
+     * @param iface
+     *        The local address of the interface on which to join the group.  If
+     *        this is not specified, the OS may join the group on all interfaces
+     *        or only the primary interface.
+     */
+    void joinMulticast(in AUTF8String addr, [optional] in AUTF8String iface);
+    [noscript] void joinMulticastAddr([const] in NetAddr addr,
+                                      [const, optional] in NetAddrPtr iface);
+
+    /**
+     * leaveMulticast
+     *
+     * Leave the multicast group specified by |addr|.  You will no longer
+     * receive future datagrams addressed to the group.
+     *
+     * @param addr
+     *        The multicast group address.
+     * @param iface
+     *        The local address of the interface on which to leave the group.
+     *        If this is not specified, the OS may leave the group on all
+     *        interfaces or only the primary interface.
+     */
+    void leaveMulticast(in AUTF8String addr, [optional] in AUTF8String iface);
+    [noscript] void leaveMulticastAddr([const] in NetAddr addr,
+                                       [const, optional] in NetAddrPtr iface);
+
+    /**
+     * multicastLoopback
+     *
+     * Whether multicast datagrams sent via this socket should be looped back to
+     * this host (assuming this host has joined the relevant group).  Defaults
+     * to true.
+     * Note: This is currently write-only.
+     */
+    attribute boolean multicastLoopback;
+
+    /**
+     * multicastInterface
+     *
+     * The interface that should be used for sending future multicast datagrams.
+     * Note: This is currently write-only.
+     */
+    attribute AUTF8String multicastInterface;
+
+    /**
+     * multicastInterfaceAddr
+     *
+     * The interface that should be used for sending future multicast datagrams.
+     * Note: This is currently write-only.
+     */
+    [noscript] attribute NetAddr multicastInterfaceAddr;
 };
 
 /**
  * nsIUDPSocketListener
  *
  * This interface is notified whenever a UDP socket accepts a new connection.
  * The transport is in the connected state, and read/write streams can be opened
  * using the normal nsITransport API.  The address of the client can be found by