Index: gst-libs/gst/netbuffer/gstnetbuffer.c
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-base/gst-libs/gst/netbuffer/gstnetbuffer.c,v
retrieving revision 1.4
diff -u -B -b -p -r1.4 gstnetbuffer.c
--- gst-libs/gst/netbuffer/gstnetbuffer.c	21 Aug 2006 10:32:51 -0000	1.4
+++ gst-libs/gst/netbuffer/gstnetbuffer.c	4 Oct 2006 10:58:24 -0000
@@ -27,7 +27,7 @@
  * buffer data and is used in various network elements to track the to and from
  * addresses.
  *
- * Last reviewed on 2006-08-21 (0.10.10)
+ * Last reviewed on 2006-10-04 (0.10.11)
  */
 
 #include <string.h>
@@ -80,6 +80,11 @@ gst_netbuffer_class_init (gpointer g_cla
 static void
 gst_netbuffer_init (GTypeInstance * instance, gpointer g_class)
 {
+  GstNetBuffer * nbuf = (GstNetBuffer *) instance;
+
+  /* TTL of 0 means the default */
+  nbuf->from.abidata.ABI.ttl = 0;
+  nbuf->to.abidata.ABI.ttl = 0;
 }
 
 static void
@@ -140,6 +145,22 @@ gst_netaddress_set_ip4_address (GstNetAd
 }
 
 /**
+ * gst_netaddress_set_ip4_interface:
+ * @naddr: a multicast network address
+ * @address: an IPv4 network interface for use with multicast
+ *
+ * Set @naddr with the IPv4 @interface to use for multicast
+ */
+void
+gst_netaddress_set_ip4_interface (GstNetAddress * naddr, guint32 interface)
+{
+  g_return_if_fail (naddr != NULL);
+  g_return_if_fail (naddr->type != GST_NET_TYPE_IP4);
+
+  naddr->abidata.ABI.interface.ip4 = interface;
+}
+
+/**
  * gst_netaddress_set_ip6_address:
  * @naddr: a network address
  * @address: an IPv6 network address.
@@ -159,6 +180,54 @@ gst_netaddress_set_ip6_address (GstNetAd
 }
 
 /**
+ * gst_netaddress_set_ip6_interface:
+ * @naddr: a multicast network address
+ * @address: an IPv6 network interface for use with multicast
+ *
+ * Set @naddr with the IPv6 @interface to use for multicast
+ */
+void
+gst_netaddress_set_ip6_interface (GstNetAddress * naddr, guint8 interface[16])
+{
+  g_return_if_fail (naddr != NULL);
+  g_return_if_fail (naddr->type != GST_NET_TYPE_IP6);
+
+  memcpy (&naddr->abidata.ABI.interface.ip6, interface, 16);
+}
+
+/**
+ * gst_netaddress_set_loopback;
+ * @naddr: a multicast network address
+ * @loopback: new loopback mode 
+ *
+ * Set @naddr loopback option for multicast address. This allows a socket to
+ * hear what it is sending.
+ */
+void
+gst_netaddress_set_loopback (GstNetAddress * naddr, gboolean loopback)
+{
+  g_return_if_fail (naddr != NULL);
+
+  naddr->abidata.ABI.loopback = loopback;
+}
+
+/**
+ * gst_netaddress_set_ttl;
+ * @naddr: a multicast network address
+ * @ttl: Set time-to-live for multicast packets.
+ *
+ * Set @naddr TTL for multicats packets.  A value of 0 means use the default
+ * TTL.
+ */
+void
+gst_netaddress_set_ttl (GstNetAddress * naddr, guint8 ttl)
+{
+  g_return_if_fail (naddr != NULL);
+
+  naddr->abidata.ABI.ttl = ttl;
+}
+
+/**
  * gst_netaddress_get_net_type:
  * @naddr: a network address
  *
@@ -202,6 +271,29 @@ gst_netaddress_get_ip4_address (GstNetAd
 }
 
 /**
+ * gst_netaddress_get_ip4_interface:
+ * @naddr: a multicast network address
+ * @interface: a location to store the interface address.
+ *
+ * Get the IPv4 interface stored in @naddr into @interface.
+ *
+ * Returns: TRUE if the interface could be retrieved.
+ */
+gboolean
+gst_netaddress_get_ip4_interface (GstNetAddress * naddr, guint32 * interface)
+{
+  g_return_val_if_fail (naddr != NULL, FALSE);
+
+  if (naddr->type != GST_NET_TYPE_IP4)
+    return FALSE;
+
+  if (interface)
+    *interface = naddr->abidata.ABI.interface.ip4;
+
+  return TRUE;
+}
+
+/**
  * gst_netaddress_get_ip6_address:
  * @naddr: a network address
  * @address: a location to store the result.
@@ -227,3 +319,67 @@ gst_netaddress_get_ip6_address (GstNetAd
 
   return TRUE;
 }
+
+/**
+ * gst_netaddress_get_ip6_interface:
+ * @naddr: a multicast network address
+ * @interface: a location to store the interface address.
+ *
+ * Get the IPv6 interface stored in @naddr into @interface.
+ *
+ * Returns: TRUE if the interface could be retrieved.
+ */
+gboolean
+gst_netaddress_get_ip6_interface (GstNetAddress * naddr, guint8 interface[16])
+{
+  g_return_val_if_fail (naddr != NULL, FALSE);
+
+  if (naddr->type != GST_NET_TYPE_IP6)
+    return FALSE;
+
+  if (interface)
+    memcpy (interface, naddr->abidata.ABI.interface.ip6, 16);
+
+  return TRUE;
+}
+
+/**
+ * gst_netaddress_get_loopback:
+ * @naddr: a multicast network address
+ * @loopback: a location to store the value of loopback
+ *
+ * Get whether or not multicast loopback is enabled.
+ *
+ * Returns: TRUE if the interface could be retrieved.
+ */
+gboolean
+gst_netaddress_get_loopback (GstNetAddress * naddr, gboolean * loopback)
+{
+  g_return_val_if_fail (naddr != NULL, FALSE);
+
+  if (loopback)
+    *loopback = naddr->abidata.ABI.loopback;
+
+  return TRUE;
+}
+
+/**
+ * gst_netaddress_get_ttl:
+ * @naddr: a multicast network address
+ * @ttl: a location to store the value of ttl
+ *
+ * Get the time-to-live value for multicast packets. A value of 0 means no TTL
+ * was specified and the default should be used.
+ *
+ * Returns: TRUE if the interface could be retrieved.
+ */
+gboolean
+gst_netaddress_get_ttl (GstNetAddress * naddr, guint8 * ttl)
+{
+  g_return_val_if_fail (naddr != NULL, FALSE);
+
+  if (ttl)
+    *ttl = naddr->abidata.ABI.ttl;
+
+  return TRUE;
+}
Index: gst-libs/gst/netbuffer/gstnetbuffer.h
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-base/gst-libs/gst/netbuffer/gstnetbuffer.h,v
retrieving revision 1.4
diff -u -B -b -p -r1.4 gstnetbuffer.h
--- gst-libs/gst/netbuffer/gstnetbuffer.h	21 Aug 2006 10:32:51 -0000	1.4
+++ gst-libs/gst/netbuffer/gstnetbuffer.h	4 Oct 2006 10:58:24 -0000
@@ -62,8 +62,19 @@ struct _GstNetAddress {
     guint32       ip4;
   } address;
   guint16       port;
-  /*< private >*/
+
+  union {
+    struct {
+      /* ABI addition since 0.10.11 */
+      union {
+        guint8        ip6[16];
+        guint32       ip4;
+      } interface;
+      gboolean	loopback;
+      guint8	ttl;
+    } ABI;
   gpointer _gst_reserved[GST_PADDING];
+  } abidata;
 };
 
 /**
@@ -99,11 +110,19 @@ GstNetBuffer*   gst_netbuffer_new       
 
 /* address operations */
 void            gst_netaddress_set_ip4_address  (GstNetAddress *naddr, guint32 address, guint16 port);
+void            gst_netaddress_set_ip4_interface (GstNetAddress * naddr, guint32 interface);
 void            gst_netaddress_set_ip6_address  (GstNetAddress *naddr, guint8 address[16], guint16 port);
+void            gst_netaddress_set_ip6_interface (GstNetAddress * naddr, guint8 interface[16]);
+void            gst_netaddress_set_loopback      (GstNetAddress * naddr, gboolean loopback);
+void            gst_netaddress_set_ttl           (GstNetAddress * naddr, guint8 ttl);
 
 GstNetType      gst_netaddress_get_net_type     (GstNetAddress *naddr);
 gboolean        gst_netaddress_get_ip4_address  (GstNetAddress *naddr, guint32 *address, guint16 *port);
+gboolean        gst_netaddress_get_ip4_interface (GstNetAddress * naddr, guint32 * interface);
 gboolean        gst_netaddress_get_ip6_address  (GstNetAddress *naddr, guint8 address[16], guint16 *port);
+gboolean        gst_netaddress_get_ip6_interface (GstNetAddress * naddr, guint8 interface[16]);
+gboolean        gst_netaddress_get_loopback      (GstNetAddress * naddr, gboolean * loopback);
+gboolean        gst_netaddress_get_ttl           (GstNetAddress * naddr, guint8 * ttl);
 
 G_END_DECLS
 
