[Telepathy-commits] [telepathy-gabble/master] Import changes in the spec as an extension and update the code for it

Alban Crequy alban.crequy at collabora.co.uk
Mon Nov 3 11:20:56 PST 2008


---
 extensions/Channel_Interface_Tube.xml   |    7 +-
 extensions/Channel_Type_DBusTube.xml    |  179 -------------------------
 extensions/Channel_Type_DBus_Tube.xml   |  181 ++++++++++++++++++++++++++
 extensions/Channel_Type_StreamTube.xml  |  216 -------------------------------
 extensions/Channel_Type_Stream_Tube.xml |  215 ++++++++++++++++++++++++++++++
 extensions/Makefile.am                  |    4 +-
 extensions/all.xml                      |    4 +-
 src/private-tubes-factory.c             |    4 +-
 src/tube-stream.c                       |   13 +-
 9 files changed, 414 insertions(+), 409 deletions(-)
 delete mode 100644 extensions/Channel_Type_DBusTube.xml
 create mode 100644 extensions/Channel_Type_DBus_Tube.xml
 delete mode 100644 extensions/Channel_Type_StreamTube.xml
 create mode 100644 extensions/Channel_Type_Stream_Tube.xml

diff --git a/extensions/Channel_Interface_Tube.xml b/extensions/Channel_Interface_Tube.xml
index 7b260b6..c2213dc 100644
--- a/extensions/Channel_Interface_Tube.xml
+++ b/extensions/Channel_Interface_Tube.xml
@@ -48,8 +48,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
         <p>Each tube has a dictionary of arbitrary parameters. Parameters are
           commonly used for bootstrap information. The allowable keys,
           types and values are defined by the service. Connection managers
-          must support the value being any primitive (non-container)
-          D-Bus type, or a byte array 'ay'.</p>
+          must support the value being a string (D-Bus type 's'), array of bytes
+          (D-Bus type 'ay'), unsigned integer (D-Bus type 'u'), integer (D-Bus
+          type 'i') and boolean (D-Bus type 'b').</p>
+        <p>When the tube is offered, the parameters are transmitted to the
+          other end.</p>
         <p>When requesting a channel with 
           <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection.Interface.Requests.DRAFT.CreateChannel</tp:dbus-ref>,
           this property MAY be included in the request. If it is not included in
diff --git a/extensions/Channel_Type_DBusTube.xml b/extensions/Channel_Type_DBusTube.xml
deleted file mode 100644
index a4da219..0000000
--- a/extensions/Channel_Type_DBusTube.xml
+++ /dev/null
@@ -1,179 +0,0 @@
-<?xml version="1.0" ?>
-<node name="/Channel_Type_DBusTube" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
-  <tp:copyright>Copyright (C) 2008 Collabora Limited</tp:copyright>
-  <tp:copyright>Copyright (C) 2008 Nokia Corporation</tp:copyright>
-  <tp:license>
-    This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-  </tp:license>
-  <interface name="org.freedesktop.Telepathy.Channel.Type.DBusTube.DRAFT"
-      tp:causes-havoc="experimental">
-    <tp:requires interface="org.freedesktop.Telepathy.Channel"/>
-    <tp:requires interface="org.freedesktop.Telepathy.Channel.Interface.Tube.DRAFT"/>
-    <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
-      <p>A D-Bus tube is an ordered reliable transport, for transporting D-Bus
-        traffic.</p>
-
-      <p>For each D-Bus tube, the connection manager listens on a D-Bus
-        server address, as detailed in the D-Bus specification. On this
-        address, it emulates a bus upon which each tube participant appears
-        as an endpoint.</p>
-
-      <p>The objects and interfaces which are expected to exist on the
-        emulated bus depend on the well-known name; typically, either the
-        participant who initiated the tube is expected to export the same
-        objects/interfaces that would be exported by a service of that name
-        on a bus, or all participants are expected to export those
-        objects/interfaces.</p>
-
-      <p>In a multi-user context (Handle_Type_Room) the tube behaves
-        like the D-Bus bus daemon, so participants can send each other
-        private messages, or can send broadcast messages which are
-        received by everyone in the tube (including themselves).
-        Each participant has a D-Bus unique name; connection managers
-        must prevent participants from sending messages with the wrong
-        sender unique name, and should attempt to avoid participants
-        receiving messages not intended for them.</p>
-
-      <p>In a 1-1 context (Handle_Type_Contact) the tube behaves like
-        a peer-to-peer D-Bus connection - arbitrary D-Bus messages with
-        any sender and/or destination can be sent by each participant,
-        and each participant receives all messages sent by the other
-        participant.</p>
-
-    </tp:docstring>
-
-    <method name="OfferDBusTube">
-      <tp:docstring>
-        Offers a D-Bus tube providing the service specified.
-      </tp:docstring>
-      <tp:possible-errors>
-        <tp:error name="org.freedesktop.Telepathy.Error.NetworkError"/>
-        <tp:error name="org.freedesktop.Telepathy.Error.NotAvailable">
-          <tp:docstring>
-            The contact associated with this channel doesn't have tubes
-            capabilities.
-          </tp:docstring>
-        </tp:error>
-        <tp:error name="org.freedesktop.Telepathy.Error.NotImplemented">
-          <tp:docstring>
-            The connection manager doesn't support D-Bus tubes.
-          </tp:docstring>
-        </tp:error>
-      </tp:possible-errors>
-    </method>
-
-    <method name="AcceptDBusTube">
-      <tp:docstring>
-        Accept a D-Bus tube that's in the "local pending" state. The
-        connection manager will attempt to open the tube. The tube remains in
-        the "local pending" state until the TubeStateChanged signal is
-        emitted.
-      </tp:docstring>
-      <arg direction="out" name="address" type="s">
-        <tp:docstring>
-          The string describing the address of the private bus. The client
-          should not attempt to connect to the address until the tube is open.
-        </tp:docstring>
-      </arg>
-      <tp:possible-errors>
-        <tp:error name="org.freedesktop.Telepathy.Error.InvalidArgument">
-          <tp:docstring>
-            The given tube ID is invalid or does not refer to a D-Bus
-            tube.
-          </tp:docstring>
-        </tp:error>
-      </tp:possible-errors>
-    </method>
-
-    <method name="GetDBusTubeAddress">
-      <tp:docstring>
-        Return a string describing the address of the private bus.
-      </tp:docstring>
-      <arg direction="out" type="s">
-        <tp:docstring>
-          The bus address.
-        </tp:docstring>
-      </arg>
-      <tp:possible-errors>
-        <tp:error name="org.freedesktop.Telepathy.Error.InvalidArgument">
-          <tp:docstring>
-            The tube is not a D-Bus tube.
-          </tp:docstring>
-        </tp:error>
-        <tp:error name="org.freedesktop.Telepathy.Error.NotAvailable">
-          <tp:docstring>
-            This tube is not in the "open" state.
-          </tp:docstring>
-        </tp:error>
-      </tp:possible-errors>
-    </method>
-
-    <method name="GetDBusNames">
-      <tp:docstring>
-        For a multi-user (i.e. Handle_Type_Room) D-Bus tube, obtain a mapping
-        between contact handles and their unique bus names on this tube.
-      </tp:docstring>
-      <arg direction="out" type="a(us)" tp:type="DBus_Tube_Member[]">
-        <tp:docstring>
-          An array of structures, each containing a contact handle and a D-Bus
-          bus name.
-        </tp:docstring>
-      </arg>
-      <tp:possible-errors>
-        <tp:error name="org.freedesktop.Telepathy.Error.InvalidArgument">
-          <tp:docstring>
-            The tube is not a multi-user D-Bus tube.
-          </tp:docstring>
-        </tp:error>
-        <tp:error name="org.freedesktop.Telepathy.Error.NotAvailable">
-          <tp:docstring>
-            This tube is not in the "open" state.
-          </tp:docstring>
-        </tp:error>
-      </tp:possible-errors>
-    </method>
-
-    <signal name="DBusNamesChanged">
-      <tp:docstring>
-        Emitted on a multi-user (i.e. Handle_Type_Room) D-Bus tube when a
-        participant opens or closes the tube.
-      </tp:docstring>
-      <arg name="added" type="a(us)" tp:type="DBus_Tube_Member[]">
-        <tp:docstring>
-          Array of handles and D-Bus names of new participants.
-        </tp:docstring>
-      </arg>
-      <arg name="removed" type="au" tp:type="Contact_Handle[]">
-        <tp:docstring>
-          Array of handles of former participants.
-        </tp:docstring>
-      </arg>
-    </signal>
-
-    <property name="DBusService" type="s" access="read">
-      <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
-        <p>A string representing the service name that will be used over the
-          tube. It should be a well-known D-Bus service name, of the form
-          com.example.ServiceName.</p>
-        <p>When requesting a channel with 
-          <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection.Interface.Requests.DRAFT.CreateChannel</tp:dbus-ref>,
-          this property MUST be included in the request.</p>
-      </tp:docstring>
-    </property>
-
-  </interface>
-
-</node>
-<!-- vim:set sw=2 sts=2 et ft=xml: -->
diff --git a/extensions/Channel_Type_DBus_Tube.xml b/extensions/Channel_Type_DBus_Tube.xml
new file mode 100644
index 0000000..2e5fae6
--- /dev/null
+++ b/extensions/Channel_Type_DBus_Tube.xml
@@ -0,0 +1,181 @@
+<?xml version="1.0" ?>
+<node name="/Channel_Type_DBus_Tube" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
+  <tp:copyright>Copyright (C) 2008 Collabora Limited</tp:copyright>
+  <tp:copyright>Copyright (C) 2008 Nokia Corporation</tp:copyright>
+  <tp:license>
+    This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+  </tp:license>
+  <interface name="org.freedesktop.Telepathy.Channel.Type.DBusTube.DRAFT"
+      tp:causes-havoc="experimental">
+    <tp:requires interface="org.freedesktop.Telepathy.Channel"/>
+    <tp:requires interface="org.freedesktop.Telepathy.Channel.Interface.Tube.DRAFT"/>
+    <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
+      <p>A D-Bus tube is an ordered reliable transport, for transporting D-Bus
+        traffic.</p>
+
+      <p>For each D-Bus tube, the connection manager listens on a D-Bus
+        server address, as detailed in the D-Bus specification. On this
+        address, it emulates a bus upon which each tube participant appears
+        as an endpoint.</p>
+
+      <p>The objects and interfaces which are expected to exist on the
+        emulated bus depend on the well-known name; typically, either the
+        participant who initiated the tube is expected to export the same
+        objects/interfaces that would be exported by a service of that name
+        on a bus, or all participants are expected to export those
+        objects/interfaces.</p>
+
+      <p>In a multi-user context (Handle_Type_Room) the tube behaves
+        like the D-Bus bus daemon, so participants can send each other
+        private messages, or can send broadcast messages which are
+        received by everyone in the tube (including themselves).
+        Each participant has a D-Bus unique name; connection managers
+        must prevent participants from sending messages with the wrong
+        sender unique name, and should attempt to avoid participants
+        receiving messages not intended for them.</p>
+
+      <p>In a 1-1 context (Handle_Type_Contact) the tube behaves like
+        a peer-to-peer D-Bus connection - arbitrary D-Bus messages with
+        any sender and/or destination can be sent by each participant,
+        and each participant receives all messages sent by the other
+        participant.</p>
+
+    </tp:docstring>
+
+    <method name="OfferDBusTube">
+      <tp:docstring>
+        Offers a D-Bus tube providing the service specified.
+      </tp:docstring>
+      <tp:possible-errors>
+        <tp:error name="org.freedesktop.Telepathy.Error.NetworkError"/>
+        <tp:error name="org.freedesktop.Telepathy.Error.NotAvailable">
+          <tp:docstring>
+            The contact associated with this channel doesn't have tubes
+            capabilities.
+          </tp:docstring>
+        </tp:error>
+        <tp:error name="org.freedesktop.Telepathy.Error.NotImplemented">
+          <tp:docstring>
+            The connection manager doesn't support D-Bus tubes.
+          </tp:docstring>
+        </tp:error>
+      </tp:possible-errors>
+    </method>
+
+    <method name="AcceptDBusTube">
+      <tp:docstring>
+        Accept a D-Bus tube that's in the "local pending" state. The
+        connection manager will attempt to open the tube. The tube remains in
+        the "local pending" state until the TubeStateChanged signal is
+        emitted.
+      </tp:docstring>
+      <arg direction="out" name="address" type="s">
+        <tp:docstring>
+          The string describing the address of the private bus. The client
+          should not attempt to connect to the address until the tube is open.
+        </tp:docstring>
+      </arg>
+      <tp:possible-errors>
+        <tp:error name="org.freedesktop.Telepathy.Error.InvalidArgument">
+          <tp:docstring>
+            The given tube ID is invalid or does not refer to a D-Bus
+            tube.
+          </tp:docstring>
+        </tp:error>
+      </tp:possible-errors>
+    </method>
+
+    <method name="GetDBusTubeAddress">
+      <tp:docstring>
+        Return a string describing the address of the private bus.
+      </tp:docstring>
+      <arg direction="out" type="s">
+        <tp:docstring>
+          The bus address.
+        </tp:docstring>
+      </arg>
+      <tp:possible-errors>
+        <tp:error name="org.freedesktop.Telepathy.Error.InvalidArgument">
+          <tp:docstring>
+            The tube is not a D-Bus tube.
+          </tp:docstring>
+        </tp:error>
+        <tp:error name="org.freedesktop.Telepathy.Error.NotAvailable">
+          <tp:docstring>
+            This tube is not in the "open" state.
+          </tp:docstring>
+        </tp:error>
+      </tp:possible-errors>
+    </method>
+
+    <method name="GetDBusNames">
+      <tp:docstring>
+        For a multi-user (i.e. Handle_Type_Room) D-Bus tube, obtain a mapping
+        between contact handles and their unique bus names on this tube.
+      </tp:docstring>
+      <arg direction="out" type="a(us)" tp:type="DBus_Tube_Member[]">
+        <tp:docstring>
+          An array of structures, each containing a contact handle and a D-Bus
+          bus name.
+        </tp:docstring>
+      </arg>
+      <tp:possible-errors>
+        <tp:error name="org.freedesktop.Telepathy.Error.InvalidArgument">
+          <tp:docstring>
+            The tube is not a multi-user D-Bus tube.
+          </tp:docstring>
+        </tp:error>
+        <tp:error name="org.freedesktop.Telepathy.Error.NotAvailable">
+          <tp:docstring>
+            This tube is not in the "open" state.
+          </tp:docstring>
+        </tp:error>
+      </tp:possible-errors>
+    </method>
+
+    <signal name="DBusNamesChanged">
+      <tp:docstring>
+        Emitted on a multi-user (i.e. Handle_Type_Room) D-Bus tube when a
+        participant opens or closes the tube.
+      </tp:docstring>
+      <arg name="added" type="a(us)" tp:type="DBus_Tube_Member[]">
+        <tp:docstring>
+          Array of handles and D-Bus names of new participants.
+        </tp:docstring>
+      </arg>
+      <arg name="removed" type="au" tp:type="Contact_Handle[]">
+        <tp:docstring>
+          Array of handles of former participants.
+        </tp:docstring>
+      </arg>
+    </signal>
+
+    <property name="ServiceName" type="s" access="read">
+      <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
+        <p>A string representing the service name that will be used over the
+          tube. It should be a well-known D-Bus service name, of the form
+          com.example.ServiceName.</p>
+        <p>When the tube is offered, the service name is transmitted to the
+          other end.</p>
+        <p>When requesting a channel with 
+          <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection.Interface.Requests.DRAFT.CreateChannel</tp:dbus-ref>,
+          this property MUST be included in the request.</p>
+      </tp:docstring>
+    </property>
+
+  </interface>
+
+</node>
+<!-- vim:set sw=2 sts=2 et ft=xml: -->
diff --git a/extensions/Channel_Type_StreamTube.xml b/extensions/Channel_Type_StreamTube.xml
deleted file mode 100644
index 137df36..0000000
--- a/extensions/Channel_Type_StreamTube.xml
+++ /dev/null
@@ -1,216 +0,0 @@
-<?xml version="1.0" ?>
-<node name="/Channel_Type_StreamTube" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
-  <tp:copyright>Copyright (C) 2008 Collabora Limited</tp:copyright>
-  <tp:copyright>Copyright (C) 2008 Nokia Corporation</tp:copyright>
-  <tp:license>
-    This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-  </tp:license>
-  <interface name="org.freedesktop.Telepathy.Channel.Type.StreamTube.DRAFT"
-      tp:causes-havoc="experimental">
-    <tp:requires interface="org.freedesktop.Telepathy.Channel"/>
-    <tp:requires interface="org.freedesktop.Telepathy.Channel.Interface.Tube.DRAFT"/>
-    <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
-      <p>A stream tube is a transport for ordered, reliable data transfer,
-        similar to SOCK_STREAM sockets.</p>
-
-      <p>When accepting a Stream Unix tube, a new listening local socket is
-        created. Each time the client connects to this socket, the
-        connection manager of the initiator of the tube opens a new
-        connection to its local socket. Both sides can then use this pair
-        of sockets to communicate together.</p>
-
-    </tp:docstring>
-
-    <method name="OfferStreamTube">
-      <tp:docstring>
-        Offer a stream tube exporting the local socket specified.
-      </tp:docstring>
-      <arg direction="in" name="address_type" type="u" tp:type="Socket_Address_Type">
-        <tp:docstring>
-          The type of the listening address of the local service, as a member of
-          Socket_Address_Type.
-        </tp:docstring>
-      </arg>
-      <arg direction="in" name="address" type="v">
-        <tp:docstring>
-          The listening address of the local service, as indicated by the
-          address_type.
-        </tp:docstring>
-      </arg>
-      <arg direction="in" name="access_control" type="u" tp:type="Socket_Access_Control">
-        <tp:docstring>
-          The access control the local service applies to the local socket,
-          specified so the connection manager can behave appropriately
-          when it connects.
-        </tp:docstring>
-      </arg>
-      <arg direction="in" name="access_control_param" type="v">
-        <tp:docstring>
-          A parameter for the access control type, to be interpreted as
-          specified in the documentation for the Socket_Access_Control enum.
-        </tp:docstring>
-      </arg>
-      <tp:possible-errors>
-        <tp:error name="org.freedesktop.Telepathy.Error.NetworkError"/>
-        <tp:error name="org.freedesktop.Telepathy.Error.NotAvailable">
-          <tp:docstring>
-            The contact associated with this channel doesn't have tube
-            capabilities.
-          </tp:docstring>
-        </tp:error>
-        <tp:error name="org.freedesktop.Telepathy.Error.NotImplemented">
-          <tp:docstring>
-            The connection manager doesn't support stream tubes, or
-            does not support the given address type or access-control type.
-          </tp:docstring>
-        </tp:error>
-      </tp:possible-errors>
-    </method>
-
-    <method name="AcceptStreamTube">
-      <tp:docstring>
-        Accept a stream tube that's in the "local pending" state. The
-        connection manager will attempt to open the tube. The tube remains in
-        the "local pending" state until the TubeStateChanged signal is
-        emitted.
-      </tp:docstring>
-      <arg direction="in" name="address_type" type="u" tp:type="Socket_Address_Type">
-        <tp:docstring>
-          The type of address the connection manager should listen on.
-        </tp:docstring>
-      </arg>
-      <arg direction="in" name="access_control" type="u" tp:type="Socket_Access_Control">
-        <tp:docstring>
-          The type of access control the connection manager should apply to
-          the socket.
-        </tp:docstring>
-      </arg>
-      <arg direction="in" name="access_control_param" type="v">
-        <tp:docstring>
-          A parameter for the access control type, to be interpreted as
-          specified in the documentation for the Socket_Access_Control enum.
-        </tp:docstring>
-      </arg>
-      <arg direction="out" name="address" type="v">
-        <tp:docstring>
-          The address on which the connection manager will listen for
-          connections to this tube. The client should not attempt to connect
-          to the address until the tube is open.
-        </tp:docstring>
-      </arg>
-
-      <tp:possible-errors>
-        <tp:error name="org.freedesktop.Telepathy.Error.InvalidArgument">
-          <tp:docstring>
-            The given tube ID is invalid or does not refer to a stream
-            tube.
-          </tp:docstring>
-        </tp:error>
-        <tp:error name="org.freedesktop.Telepathy.Error.NotImplemented">
-          <tp:docstring>
-            The given address type or access-control mechanism is not supported.
-          </tp:docstring>
-        </tp:error>
-      </tp:possible-errors>
-    </method>
-
-    <method name="GetStreamTubeSocketAddress">
-      <tp:docstring>
-        For a stream tube, obtain the address of the socket used to
-        communicate over this tube.
-      </tp:docstring>
-      <arg direction="out" name="address_type" type="u" tp:type="Socket_Address_Type">
-        <tp:docstring>
-          The type of the listening address of the socket, as a member of
-          Socket_Address_Type.
-        </tp:docstring>
-      </arg>
-      <arg direction="out" name="address" type="v">
-        <tp:docstring>
-          The listening address of the socket, as indicated by the
-          address_type.
-        </tp:docstring>
-      </arg>
-      <tp:possible-errors>
-        <tp:error name="org.freedesktop.Telepathy.Error.NotAvailable">
-          <tp:docstring>
-            This tube is not in the "open" state.
-          </tp:docstring>
-        </tp:error>
-      </tp:possible-errors>
-    </method>
-
-    <signal name="StreamTubeNewConnection">
-      <tp:docstring>
-        Emitted on a stream tube when a participant opens a new connection
-        to its socket.
-      </tp:docstring>
-      <arg name="handle" type="u" tp:type="Contact_Handle">
-        <tp:docstring>
-          The handle of the participant who opened the new connection
-        </tp:docstring>
-      </arg>
-    </signal>
-
-    <property name="StreamService" type="s" access="read">
-      <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
-        <p> A string representing the service name that will be used over the
-          tube.  It should be a well-known TCP service name as defined by
-          <a href="http://www.iana.org/assignments/port-numbers">
-            http://www.iana.org/assignments/port-numbers</a> or
-          <a href="http://www.dns-sd.org/ServiceTypes.html">
-            http://www.dns-sd.org/ServiceTypes.html</a>, for instance
-          "rsync" or "daap".</p>
-        <p>When requesting a channel with 
-          <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection.Interface.Requests.DRAFT.CreateChannel</tp:dbus-ref>,
-          this property MUST be included in the request.</p>
-      </tp:docstring>
-    </property>
-
-    <property name="AvailableStreamTubeTypes" type="a{uau}"
-              tp:type="Supported_Socket_Map" access="read">
-      <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
-        <p>A mapping from address types (members of Socket_Address_Type) to
-        arrays of access-control type (members of Socket_Access_Control)
-        that the connection manager supports for stream tubes with that
-        address type. For simplicity, if a CM supports offering a
-        particular type of tube, it is assumed to support accepting it.</p>
-
-        <p>A typical value for a host without IPv6 support:</p>
-
-        <pre>
-          {
-            Socket_Address_Type_IPv4:
-              [Socket_Access_Control_Localhost, Socket_Access_Control_Port,
-               Socket_Access_Control_Netmask],
-            Socket_Address_Type_Unix:
-              [Socket_Access_Control_Localhost, Socket_Access_Control_Credentials]
-          }
-        </pre>
-
-        <p>If stream tubes are not supported, this will be an empty
-          dictionary.</p>
-
-        <p>When requesting a channel with 
-          <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection.Interface.Requests.DRAFT.CreateChannel</tp:dbus-ref>,
-          this property MUST NOT be included in the request.</p>
-
-      </tp:docstring>
-    </property>
-
-  </interface>
-
-</node>
-<!-- vim:set sw=2 sts=2 et ft=xml: -->
diff --git a/extensions/Channel_Type_Stream_Tube.xml b/extensions/Channel_Type_Stream_Tube.xml
new file mode 100644
index 0000000..390636b
--- /dev/null
+++ b/extensions/Channel_Type_Stream_Tube.xml
@@ -0,0 +1,215 @@
+<?xml version="1.0" ?>
+<node name="/Channel_Type_Stream_Tube" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
+  <tp:copyright>Copyright (C) 2008 Collabora Limited</tp:copyright>
+  <tp:copyright>Copyright (C) 2008 Nokia Corporation</tp:copyright>
+  <tp:license>
+    This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+  </tp:license>
+  <interface name="org.freedesktop.Telepathy.Channel.Type.StreamTube.DRAFT"
+      tp:causes-havoc="experimental">
+    <tp:requires interface="org.freedesktop.Telepathy.Channel"/>
+    <tp:requires interface="org.freedesktop.Telepathy.Channel.Interface.Tube.DRAFT"/>
+    <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
+      <p>A stream tube is a transport for ordered, reliable data transfer,
+        similar to SOCK_STREAM sockets.</p>
+
+      <p>When accepting a stream tube, a new listening local socket is
+        created. Each time the client connects to this socket, the
+        connection manager of the initiator of the tube opens a new
+        connection to its local socket. Both sides can then use this pair
+        of sockets to communicate together.</p>
+
+    </tp:docstring>
+
+    <method name="OfferStreamTube">
+      <tp:docstring>
+        Offer a stream tube exporting the local socket specified.
+      </tp:docstring>
+      <arg direction="in" name="address_type" type="u" tp:type="Socket_Address_Type">
+        <tp:docstring>
+          The type of the listening address of the local service, as a member of
+          Socket_Address_Type.
+        </tp:docstring>
+      </arg>
+      <arg direction="in" name="address" type="v">
+        <tp:docstring>
+          The listening address of the local service, as indicated by the
+          address_type.
+        </tp:docstring>
+      </arg>
+      <arg direction="in" name="access_control" type="u" tp:type="Socket_Access_Control">
+        <tp:docstring>
+          The access control the local service applies to the local socket,
+          specified so the connection manager can behave appropriately
+          when it connects.
+        </tp:docstring>
+      </arg>
+      <arg direction="in" name="access_control_param" type="v">
+        <tp:docstring>
+          A parameter for the access control type, to be interpreted as
+          specified in the documentation for the Socket_Access_Control enum.
+        </tp:docstring>
+      </arg>
+      <tp:possible-errors>
+        <tp:error name="org.freedesktop.Telepathy.Error.NetworkError"/>
+        <tp:error name="org.freedesktop.Telepathy.Error.NotAvailable">
+          <tp:docstring>
+            The contact associated with this channel doesn't have tube
+            capabilities.
+          </tp:docstring>
+        </tp:error>
+        <tp:error name="org.freedesktop.Telepathy.Error.NotImplemented">
+          <tp:docstring>
+            The connection manager doesn't support stream tubes, or
+            does not support the given address type or access-control type.
+          </tp:docstring>
+        </tp:error>
+      </tp:possible-errors>
+    </method>
+
+    <method name="AcceptStreamTube">
+      <tp:docstring>
+        Accept a stream tube that's in the "local pending" state. The
+        connection manager will attempt to open the tube. The tube remains in
+        the "local pending" state until the TubeStateChanged signal is
+        emitted.
+      </tp:docstring>
+      <arg direction="in" name="address_type" type="u" tp:type="Socket_Address_Type">
+        <tp:docstring>
+          The type of address the connection manager should listen on.
+        </tp:docstring>
+      </arg>
+      <arg direction="in" name="access_control" type="u" tp:type="Socket_Access_Control">
+        <tp:docstring>
+          The type of access control the connection manager should apply to
+          the socket.
+        </tp:docstring>
+      </arg>
+      <arg direction="in" name="access_control_param" type="v">
+        <tp:docstring>
+          A parameter for the access control type, to be interpreted as
+          specified in the documentation for the Socket_Access_Control enum.
+        </tp:docstring>
+      </arg>
+      <arg direction="out" name="address" type="v">
+        <tp:docstring>
+          The address on which the connection manager will listen for
+          connections to this tube. The client should not attempt to connect
+          to the address until the tube is open.
+        </tp:docstring>
+      </arg>
+
+      <tp:possible-errors>
+        <tp:error name="org.freedesktop.Telepathy.Error.InvalidArgument">
+          <tp:docstring>
+            The given tube ID is invalid or does not refer to a stream
+            tube.
+          </tp:docstring>
+        </tp:error>
+        <tp:error name="org.freedesktop.Telepathy.Error.NotImplemented">
+          <tp:docstring>
+            The given address type or access-control mechanism is not supported.
+          </tp:docstring>
+        </tp:error>
+      </tp:possible-errors>
+    </method>
+
+    <method name="GetStreamTubeSocketAddress">
+      <tp:docstring>
+        For a stream tube, obtain the address of the socket used to
+        communicate over this tube.
+      </tp:docstring>
+      <arg direction="out" name="address_type" type="u" tp:type="Socket_Address_Type">
+        <tp:docstring>
+          The type of the listening address of the socket, as a member of
+          Socket_Address_Type.
+        </tp:docstring>
+      </arg>
+      <arg direction="out" name="address" type="v">
+        <tp:docstring>
+          The listening address of the socket, as indicated by the
+          address_type.
+        </tp:docstring>
+      </arg>
+      <tp:possible-errors>
+        <tp:error name="org.freedesktop.Telepathy.Error.NotAvailable">
+          <tp:docstring>
+            This tube is not in the "open" state.
+          </tp:docstring>
+        </tp:error>
+      </tp:possible-errors>
+    </method>
+
+    <signal name="StreamTubeNewConnection">
+      <tp:docstring>
+        Emitted on a stream tube when a participant opens a new connection
+        to its socket.
+      </tp:docstring>
+      <arg name="handle" type="u" tp:type="Contact_Handle">
+        <tp:docstring>
+          The handle of the participant who opened the new connection
+        </tp:docstring>
+      </arg>
+    </signal>
+
+    <property name="Service" type="s" access="read">
+      <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
+        <p> A string representing the service name that will be used over the
+          tube.  It should be a well-known TCP service name as defined by
+          <a href="http://www.iana.org/assignments/port-numbers">
+            http://www.iana.org/assignments/port-numbers</a> or
+          <a href="http://www.dns-sd.org/ServiceTypes.html">
+            http://www.dns-sd.org/ServiceTypes.html</a>, for instance
+          "rsync" or "daap".</p>
+        <p>When the tube is offered, the service name is transmitted to the
+          other end.</p>
+        <p>When requesting a channel with 
+          <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection.Interface.Requests.DRAFT.CreateChannel</tp:dbus-ref>,
+          this property MUST be included in the request.</p>
+      </tp:docstring>
+    </property>
+
+    <property name="SupportedSocketTypes" type="a{uau}"
+              tp:type="Supported_Socket_Map" access="read">
+      <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
+        <p>A mapping from address types (members of Socket_Address_Type) to
+        arrays of access-control type (members of Socket_Access_Control)
+        that the connection manager supports for stream tubes with that
+        address type. For simplicity, if a CM supports offering a
+        particular type of tube, it is assumed to support accepting it.</p>
+
+        <p>A typical value for a host without IPv6 support:</p>
+
+        <pre>
+          {
+            Socket_Address_Type_IPv4:
+              [Socket_Access_Control_Localhost, Socket_Access_Control_Port,
+               Socket_Access_Control_Netmask],
+            Socket_Address_Type_Unix:
+              [Socket_Access_Control_Localhost, Socket_Access_Control_Credentials]
+          }
+        </pre>
+
+        <p>When requesting a channel with 
+          <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection.Interface.Requests.DRAFT.CreateChannel</tp:dbus-ref>,
+          this property MUST NOT be included in the request.</p>
+
+      </tp:docstring>
+    </property>
+
+  </interface>
+
+</node>
+<!-- vim:set sw=2 sts=2 et ft=xml: -->
diff --git a/extensions/Makefile.am b/extensions/Makefile.am
index a9eefeb..5b704bf 100644
--- a/extensions/Makefile.am
+++ b/extensions/Makefile.am
@@ -6,8 +6,8 @@ EXTRA_DIST = \
     OLPC_Activity_Properties.xml \
     OLPC_Buddy_Info.xml \
     Channel_Interface_Tube.xml \
-    Channel_Type_DBusTube.xml \
-    Channel_Type_StreamTube.xml
+    Channel_Type_DBus_Tube.xml \
+    Channel_Type_Stream_Tube.xml
 
 noinst_LTLIBRARIES = libgabble-extensions.la
 
diff --git a/extensions/all.xml b/extensions/all.xml
index db949a9..cf9f065 100644
--- a/extensions/all.xml
+++ b/extensions/all.xml
@@ -27,8 +27,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</p>
 <xi:include href="OLPC_Buddy_Info.xml"/>
 <xi:include href="OLPC_Activity_Properties.xml"/>
 
-<xi:include href="Channel_Type_StreamTube.xml"/>
-<xi:include href="Channel_Type_DBusTube.xml"/>
+<xi:include href="Channel_Type_Stream_Tube.xml"/>
+<xi:include href="Channel_Type_DBus_Tube.xml"/>
 <xi:include href="Channel_Interface_Tube.xml"/>
 
 <tp:generic-types>
diff --git a/src/private-tubes-factory.c b/src/private-tubes-factory.c
index 8688888..d4636ab 100644
--- a/src/private-tubes-factory.c
+++ b/src/private-tubes-factory.c
@@ -590,7 +590,7 @@ gabble_private_tubes_factory_foreach_channel_class (
       (GDestroyNotify) tp_g_value_slice_free);
 
   value = tp_g_value_slice_new (G_TYPE_STRING);
-  g_value_set_static_string (value, GABBLE_IFACE_CHANNEL_TYPE_STREAMTUBE);
+  g_value_set_static_string (value, GABBLE_IFACE_CHANNEL_TYPE_STREAM_TUBE);
   g_hash_table_insert (table, TP_IFACE_CHANNEL ".ChannelType",
       value);
 
@@ -607,7 +607,7 @@ gabble_private_tubes_factory_foreach_channel_class (
       (GDestroyNotify) tp_g_value_slice_free);
 
   value = tp_g_value_slice_new (G_TYPE_STRING);
-  g_value_set_static_string (value, GABBLE_IFACE_CHANNEL_TYPE_DBUSTUBE);
+  g_value_set_static_string (value, GABBLE_IFACE_CHANNEL_TYPE_DBUS_TUBE);
   g_hash_table_insert (table, TP_IFACE_CHANNEL ".ChannelType",
       value);
 
diff --git a/src/tube-stream.c b/src/tube-stream.c
index 9a62a07..17d2be3 100644
--- a/src/tube-stream.c
+++ b/src/tube-stream.c
@@ -67,7 +67,7 @@ G_DEFINE_TYPE_WITH_CODE (GabbleTubeStream, gabble_tube_stream, G_TYPE_OBJECT,
     G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL, channel_iface_init);
     G_IMPLEMENT_INTERFACE (GABBLE_TYPE_SVC_CHANNEL_FUTURE, NULL);
     G_IMPLEMENT_INTERFACE (GABBLE_TYPE_TUBE_IFACE, tube_iface_init);
-    G_IMPLEMENT_INTERFACE (GABBLE_TYPE_SVC_CHANNEL_TYPE_STREAMTUBE,
+    G_IMPLEMENT_INTERFACE (GABBLE_TYPE_SVC_CHANNEL_TYPE_STREAM_TUBE,
       streamtube_iface_init);
     G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_GROUP,
         tp_external_group_mixin_iface_init);
@@ -980,7 +980,8 @@ gabble_tube_stream_get_property (GObject *object,
         g_value_set_string (value, priv->object_path);
         break;
       case PROP_CHANNEL_TYPE:
-        g_value_set_static_string (value, GABBLE_IFACE_CHANNEL_TYPE_STREAMTUBE);
+        g_value_set_static_string (value,
+            GABBLE_IFACE_CHANNEL_TYPE_STREAM_TUBE);
         break;
       case PROP_CONNECTION:
         g_value_set_object (value, priv->conn);
@@ -1853,7 +1854,7 @@ gabble_tube_stream_accept_stream_tube (GabbleSvcChannelTypeStreamTube *iface,
     gabble_muc_channel_send_presence (self->muc, NULL);
 #endif
 
-  gabble_svc_channel_type_streamtube_return_from_accept_stream_tube (context,
+  gabble_svc_channel_type_stream_tube_return_from_accept_stream_tube (context,
       priv->address);
 }
 
@@ -1871,7 +1872,7 @@ gabble_tube_stream_get_stream_tube_socket_address (
   GabbleTubeStream *self = GABBLE_TUBE_STREAM (iface);
   GabbleTubeStreamPrivate *priv = GABBLE_TUBE_STREAM_GET_PRIVATE (self);
 
-  gabble_svc_channel_type_streamtube_return_from_get_stream_tube_socket_address
+  gabble_svc_channel_type_stream_tube_return_from_get_stream_tube_socket_address
       (context, priv->address_type, priv->address);
 }
 
@@ -1902,7 +1903,7 @@ gabble_tube_stream_get_channel_type (TpSvcChannel *iface,
                                        DBusGMethodInvocation *context)
 {
   tp_svc_channel_return_from_get_channel_type (context,
-      GABBLE_IFACE_CHANNEL_TYPE_STREAMTUBE);
+      GABBLE_IFACE_CHANNEL_TYPE_STREAM_TUBE);
 }
 
 /**
@@ -1981,7 +1982,7 @@ streamtube_iface_init (gpointer g_iface,
   GabbleSvcChannelTypeStreamTubeClass *klass =
       (GabbleSvcChannelTypeStreamTubeClass *) g_iface;
 
-#define IMPLEMENT(x) gabble_svc_channel_type_streamtube_implement_##x (\
+#define IMPLEMENT(x) gabble_svc_channel_type_stream_tube_implement_##x (\
     klass, gabble_tube_stream_##x)
   IMPLEMENT(offer_stream_tube);
   IMPLEMENT(accept_stream_tube);
-- 
1.5.6.5




More information about the Telepathy-commits mailing list