clarified JID-naming scheme

git-svn-id: file:///home/ksmith/gitmigration/svn/xmpp/trunk@1407 4b5297f7-1745-476d-ba37-a9c6900126ab
This commit is contained in:
Peter Saint-Andre 2007-11-20 18:51:24 +00:00
parent aaed812202
commit 17dc6b4d77
1 changed files with 48 additions and 47 deletions

View File

@ -200,8 +200,8 @@
<p>Before attempting to initiate a bytestream, the Initiator may want to know if the Target supports the bytestream protocol. It may do so using &xep0030; as follows:</p>
<example caption='Initiator Sends Service Discovery Request to Target'><![CDATA[
<iq type='get'
from='initiator@host1/foo'
to='target@host2/bar'
from='initiator@example.com/foo'
to='target@example.org/bar'
id='hello'>
<query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
@ -209,8 +209,8 @@
<p>If the Target supports bytestreams, it MUST answer to that effect in the service discovery result.</p>
<example caption='Target Replies to Service Discovery Request'><![CDATA[
<iq type='result'
from='target@host2/bar'
to='initiator@host1/foo'
from='target@example.org/bar'
to='initiator@example.com/foo'
id='hello'>
<query xmlns='http://jabber.org/protocol/disco#info'>
<identity
@ -228,8 +228,8 @@
<p>Before attempting to initiate a bytestream, the Initiator needs to find a proxy. It may do so using Service Discovery as follows:</p>
<example caption='Initiator Sends Service Discovery Request to Server'><![CDATA[
<iq type='get'
from='initiator@host1/foo'
to='host1'
from='initiator@example.com/foo'
to='example.com'
id='server_items'>
<query xmlns='http://jabber.org/protocol/disco#items'/>
</iq>
@ -237,23 +237,24 @@
<p>The server will return all of the known JIDs in its disco list.</p>
<example caption='Server Replies to Service Discovery Request'><![CDATA[
<iq type='result'
from='host1'
to='initiator@host1/foo'
from='example.com'
to='initiator@example.com/foo'
id='server_items'>
<query xmlns='http://jabber.org/protocol/disco#items'>
...
<item jid='proxy.host3' name='Bytestreams Proxy'/>
<item jid='streamhostproxy.example.net' name='Bytestreams Proxy'/>
...
</query>
</iq>
]]></example>
<p>In this case, the bytestreams proxy is hosted on a third party server "example.net", where the proxy itself has an address of "streamhostproxy.example.net".</p>
</section2>
<section2 topic='Initiator Queries Proxy to Find Out if it is a Proxy' anchor='proto-proxyinfo'>
<p>For each item in the disco#items result, the Initiator must query to determine if it is a bytestreams proxy. It may do so using Service Discovery as follows:</p>
<example caption='Initiator Sends Service Discovery Request to Proxy'><![CDATA[
<iq type='get'
from='initiator@host1/foo'
to='proxy.host3'
from='initiator@example.com/foo'
to='streamhostproxy.example.net'
id='proxy_info'>
<query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
@ -261,8 +262,8 @@
<p>The proxy will return its information. The Initiator SHOULD inspect each identity to see if it contains an identity of category "proxy" and type "bytestreams".</p>
<example caption='Server Replies to Service Discovery Request'><![CDATA[
<iq type='result'
from='proxy.host3'
to='initiator@host1/foo'
from='streamhostproxy.example.net'
to='initiator@example.com/foo'
id='proxy_info'>
<query xmlns='http://jabber.org/protocol/disco#info'>
...
@ -280,8 +281,8 @@
<p>If the StreamHost is a Proxy, the Initiator must first request the full network address used for bytestreaming (obviously this is not required if the StreamHost is the Initiator). This is done by sending an IQ-get to the proxy in the bytestreams namespace, as follows:</p>
<example caption='Initiator Requests Network Address from Proxy'><![CDATA[
<iq type='get'
from='initiator@host1/foo'
to='proxy.host3'
from='initiator@example.com/foo'
to='streamhostproxy.example.net'
id='discover'>
<query xmlns='http://jabber.org/protocol/bytestreams'/>
</iq>
@ -303,12 +304,12 @@
</ul>
<example caption='Proxy Informs Initiator of Network Address'><![CDATA[
<iq type='result'
from='proxy.host3'
to='initiator@host1/foo'
from='streamhostproxy.example.net'
to='initiator@example.com/foo'
id='discover'>
<query xmlns='http://jabber.org/protocol/bytestreams'>
<streamhost
jid='proxy.host3'
jid='streamhostproxy.example.net'
host='24.24.24.1'
zeroconf='_jabber.bytestreams'/>
</query>
@ -317,8 +318,8 @@
<p>If the Initiator does not have permissions to initiate bytestreams on the Proxy for whatever reason (e.g., a proxy implementation may enable administrators to ban JIDs or domains from using the Proxy), the Proxy MUST return a &forbidden; error to the Initiator (for information about error syntax, refer to &xep0086;):</p>
<example caption='Proxy Returns Error to Initiator'><![CDATA[
<iq type='error'
from='initiator@host1/foo'
to='proxy.host3'
from='initiator@example.com/foo'
to='streamhostproxy.example.net'
id='discover'>
<query xmlns='http://jabber.org/protocol/bytestreams'/>
<error code='403' type='auth'>
@ -329,8 +330,8 @@
<p>If the Proxy is unable to act as a StreamHost, the Proxy SHOULD return a &notallowed; error to the Initiator:</p>
<example caption='Proxy Returns Error to Initiator'><![CDATA[
<iq type='error'
from='initiator@host1/foo'
to='proxy.host3'
from='initiator@example.com/foo'
to='streamhostproxy.example.net'
id='discover'>
<query xmlns='http://jabber.org/protocol/bytestreams'/>
<error code='405' type='cancel'>
@ -349,18 +350,18 @@
<p>The protocol format is shown below.</p>
<example caption='Initiation of Interaction'><![CDATA[
<iq type='set'
from='initiator@host1/foo'
to='target@host2/bar'
from='initiator@example.com/foo'
to='target@example.org/bar'
id='initiate'>
<query xmlns='http://jabber.org/protocol/bytestreams'
sid='mySID'
mode='tcp'>
<streamhost
jid='initiator@host1/foo'
jid='initiator@example.com/foo'
host='192.168.4.1'
port='5086'/>
<streamhost
jid='proxy.host3'
jid='streamhostproxy.example.net'
host='24.24.24.1'
zeroconf='_jabber.bytestreams'/>
</query>
@ -369,8 +370,8 @@
<p>If the Target is unwilling to accept the bytestream, it MUST return a &notacceptable; error to the Initiator.</p>
<example caption='Target Refuses Bytestream'><![CDATA[
<iq type='error'
from='target@host2/bar'
to='initiator@host1/foo'
from='target@example.org/bar'
to='initiator@example.com/foo'
id='initiate'>
<error code='406' type='auth'>
<not-acceptable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
@ -383,8 +384,8 @@
<p>If the Target tries but is unable to connect to any of the StreamHosts and it does not wish to attempt a connection from its side, it MUST return a &notfound; error to the Initiator.</p>
<example caption='Target Is Unable to Connect to Any StreamHost and Wishes to End Transaction'><![CDATA[
<iq type='error'
from='target@host2/bar'
to='initiator@host1/foo'
from='target@example.org/bar'
to='initiator@example.com/foo'
id='initiate'>
<error code='404' type='cancel'>
<item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
@ -414,11 +415,11 @@ STATUS = X'00'
<p>After the Target has authenticated with the StreamHost, it MUST send an IQ-result to the Initiator indicating which StreamHost was used.</p>
<example caption='Target Notifies Initiator of Connection'><![CDATA[
<iq type='result'
from='target@host2/bar'
to='initiator@host1/foo'
from='target@example.org/bar'
to='initiator@example.com/foo'
id='initiate'>
<query xmlns='http://jabber.org/protocol/bytestreams'>
<streamhost-used jid='proxy.host3'/>
<streamhost-used jid='streamhostproxy.example.net'/>
</query>
</iq>
]]></example>
@ -441,11 +442,11 @@ STATUS = X'00'
<p>In order for the bytestream to be used, it MUST first be activated by the StreamHost. If the StreamHost is the Initiator, this is straightforward and does not require any in-band protocol. However, if the StreamHost is a Proxy, the Initiator MUST send an in-band request to the StreamHost. This is done by sending an IQ-set to the Proxy, including an &lt;activate/&gt; element whose XML character data specifies the full JID of the Target.</p>
<example caption='Initiator Requests Activation of Bytestream'><![CDATA[
<iq type='set'
from='initiator@host1/foo'
to='proxy.host3'
from='initiator@example.com/foo'
to='streamhostproxy.example.net'
id='activate'>
<query xmlns='http://jabber.org/protocol/bytestreams' sid='mySID'>
<activate>target@host2/bar</activate>
<activate>target@example.org/bar</activate>
</query>
</iq>
]]></example>
@ -453,8 +454,8 @@ STATUS = X'00'
<p>If the Proxy can fulfill the request, it MUST then respond to the Initiator with an IQ-result.</p>
<example caption='Proxy Informs Initiator of Activation'><![CDATA[
<iq type='result'
from='proxy.host3'
to='initiator@host1/foo'
from='streamhostproxy.example.net'
to='initiator@example.com/foo'
id='activate'/>
]]></example>
<p>If the Proxy cannot fulfill the request, it MUST return an IQ-error to the Initiator; the following conditions are defined:</p>
@ -592,8 +593,8 @@ STATUS = X'00'
<p>If an implementation supports UDP associations, it MUST advertise that separately by returning a feature of 'http://jabber.org/protocol/bytestreams#udp' in response to <cite>Service Discovery</cite> information requests.</p>
<example caption='Initiator Sends Service Discovery Request to Target'><![CDATA[
<iq type='get'
from='initiator@host1/foo'
to='target@host2/bar'
from='initiator@example.com/foo'
to='target@example.org/bar'
id='hello2'>
<query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
@ -601,8 +602,8 @@ STATUS = X'00'
<p>If the Target supports UDP associations, it MUST answer to that effect in the service discovery result.</p>
<example caption='Target Replies to Service Discovery Request'><![CDATA[
<iq type='result'
from='target@host2/bar'
to='initiator@host1/foo'
from='target@example.org/bar'
to='initiator@example.com/foo'
id='hello2'>
<query xmlns='http://jabber.org/protocol/disco#info'>
<identity
@ -621,14 +622,14 @@ STATUS = X'00'
<p>UDP associations are requested by setting the 'mode' attribute to a value of "udp" rather than "tcp".</p>
<example caption='Initiation of Interaction (UDP)'><![CDATA[
<iq type='set'
from='initiator@host1/foo'
to='target@host2/bar'
from='initiator@example.com/foo'
to='target@example.org/bar'
id='initiate'>
<query xmlns='http://jabber.org/protocol/bytestreams'
sid='mySID'
mode='udp'>
<streamhost
jid='initiator@host1/foo'
jid='initiator@example.com/foo'
host='192.168.4.1'
port='5086'/>
</query>
@ -666,8 +667,8 @@ DATA = Target or Initiator JID
<p>Upon successful receipt by the StreamHost, the StreamHost MUST reply with a message notification indicating success:</p>
<example caption='StreamHost Notifies Target or Initiator of UDP Success'><![CDATA[
<message
from='proxy.host3'
to='target@host2/bar'
from='streamhostproxy.example.net'
to='target@example.org/bar'
id='initiate'>
<udpsuccess xmlns='http://jabber.org/protocol/bytestreams' dstaddr='Value of Hash'/>
</message>