From: <ul...@us...> - 2015-02-21 16:56:31
|
Revision: 126 http://sourceforge.net/p/adc/code/126 Author: ullner Date: 2015-02-21 16:56:23 +0000 (Sat, 21 Feb 2015) Log Message: ----------- Clarified UTF-8 encoding note. Modified Paths: -------------- trunk/ADC-Recommendation.html trunk/ADC-Recommendation.txt trunk/ADC.txt Modified: trunk/ADC-Recommendation.html =================================================================== --- trunk/ADC-Recommendation.html 2015-02-19 20:21:48 UTC (rev 125) +++ trunk/ADC-Recommendation.html 2015-02-21 16:56:23 UTC (rev 126) @@ -1339,50 +1339,232 @@ </ol></div> </div> </div> +<div class="sect2"> +<h3 id="_chat">7.2. Chat</h3> +<div class="paragraph"><p>.</p></div> </div> +<div class="sect2"> +<h3 id="_downloading">7.3. Downloading</h3> +<div class="paragraph"><p>.</p></div> </div> +<div class="sect2"> +<h3 id="_sharing">7.4. Sharing</h3> +<div class="paragraph"><p>.</p></div> +</div> +<div class="sect2"> +<h3 id="_search">7.5. Search</h3> +<div class="paragraph"><p>.</p></div> +</div> +<div class="sect2"> +<h3 id="_other">7.6. Other</h3> +<div class="paragraph"><p>.</p></div> +</div> +</div> +</div> <div class="sect1"> <h2 id="_hub_implementation">8. Hub implementation</h2> <div class="sectionbody"> -<div class="paragraph"><p>1) Hub accepts network connection. -- [client state = new]</p></div> -<div class="paragraph"><p>2) Hub waits for handshake from client. -Client: HSUP ADBASE …</p></div> -<div class="paragraph"><p>3) Hub checks support line responds -Server: ISUP ADBASE …</p></div> -<div class="paragraph"><p>4) Hub allocates a SID, and sends it to the client. -Server: ISID …</p></div> -<div class="paragraph"><p>5) Hub sends the hub information to the client. -Server: IINF …</p></div> -<div class="paragraph"><p>6) Hub waits for client to send info: -- [client state = identify] -Client: BINF …</p></div> -<div class="paragraph"><p>7) Hub validates info from client - If password verification is needed, then go to 7.1, otherwise 8.</p></div> -<div class="paragraph"><p>7.1) If user needs to log in, request password -- [client state = verify] -Server: IGPA …</p></div> -<div class="paragraph"><p>7.2) Wait for and verify password from -Client: HPAS …</p></div> -<div class="paragraph"><p>8) Hub transmits the userlist of all existing users to the client. -Server: BINF … -Server: BINF … -… -Server: BINF …</p></div> -<div class="paragraph"><p>9) Hub broadcasts the client’s info (BINF) to all users, including the client. -- [client state = NORMAL] -Server: BINF …</p></div> -<div class="paragraph"><p>10) At this point the client is considered logged in, and will receive all +<div class="paragraph"><p>A client can be implemented by following this rough outline. The outline may not specify everything to full detail and will not cover the actual application that shall employ the mechanisms.</p></div> +<div class="sect2"> +<h3 id="_steps_2">8.1. Steps</h3> +<div class="olist arabic"><ol class="arabic"> +<li> +<p> +Hub accepts network connection. +</p> +<div class="ulist"><ul> +<li> +<p> +Set client state to NEW. +</p> +</li> +</ul></div> +</li> +<li> +<p> +Hub waits for handshake from client. +</p> +<div class="ulist"><ul> +<li> +<p> +Client will send: +</p> +<div class="ulist"><ul> +<li> +<p> +HSUP ADBASE … +</p> +</li> +</ul></div> +</li> +</ul></div> +</li> +<li> +<p> +Hub checks support line responds. +</p> +</li> +<li> +<p> +Server sends: +</p> +<div class="ulist"><ul> +<li> +<p> +ISUP ADBASE … +</p> +</li> +</ul></div> +</li> +<li> +<p> +Hub allocates a SID, and sends it to the client: +</p> +<div class="ulist"><ul> +<li> +<p> +ISID … +</p> +</li> +</ul></div> +</li> +<li> +<p> +Hub sends the hub information to the client: +</p> +<div class="ulist"><ul> +<li> +<p> +IINF … +</p> +</li> +</ul></div> +</li> +<li> +<p> +Hub waits for client to send info: +</p> +<div class="ulist"><ul> +<li> +<p> +Client will send: +</p> +<div class="ulist"><ul> +<li> +<p> +BINF … +</p> +</li> +</ul></div> +</li> +<li> +<p> +Set client state to IDENTIFY. +</p> +</li> +</ul></div> +</li> +<li> +<p> +Hub validates info from client +</p> +<div class="ulist"><ul> +<li> +<p> +If password verification is needed, then go to 9, otherwise 11. +</p> +</li> +</ul></div> +</li> +<li> +<p> +If user needs to log in, request password +</p> +<div class="ulist"><ul> +<li> +<p> +Set client state to VERIFY +</p> +</li> +<li> +<p> +Hub sends: +</p> +<div class="ulist"><ul> +<li> +<p> +IGPA … +</p> +</li> +</ul></div> +</li> +</ul></div> +</li> +<li> +<p> +Wait for and verify password from client: +</p> +<div class="ulist"><ul> +<li> +<p> +HPAS … +</p> +</li> +</ul></div> +</li> +<li> +<p> +Hub transmits the userlist of all existing users to the client. +</p> +<div class="literalblock"> +<div class="content"> +<pre><code>BINF ... +BINF ... +... +BINF ...</code></pre> +</div></div> +</li> +<li> +<p> +Hub broadcasts the client’s info (BINF) to all users, including the client. +</p> +<div class="ulist"><ul> +<li> +<p> +Set client state to NORMAL. +</p> +</li> +<li> +<p> +Server sends: +</p> +<div class="ulist"><ul> +<li> +<p> +BINF … +</p> +</li> +</ul></div> +</li> +</ul></div> +</li> +<li> +<p> +At this point the client is considered logged in, and will receive all broadcast messages and all direct messages from other clients. It will also forward messages originating from this client to others, if the -messages are correct (syntax, formatting, source SID, etc).</p></div> +messages are correct (syntax, formatting, source SID, etc). +</p> +</li> +</ol></div> </div> </div> </div> +</div> <div id="footnotes"><hr /></div> <div id="footer"> <div id="footer-text"> -Last updated 2014-08-05 14:38:44 W. Europe Daylight Time +Last updated 2014-08-05 15:14:11 W. Europe Daylight Time </div> </div> </body> Modified: trunk/ADC-Recommendation.txt =================================================================== --- trunk/ADC-Recommendation.txt 2015-02-19 20:21:48 UTC (rev 125) +++ trunk/ADC-Recommendation.txt 2015-02-21 16:56:23 UTC (rev 126) @@ -179,73 +179,106 @@ ==== Steps 1. Create a network connection to a hub on the appropriate port. + 2. The client shall send the following message: * HSUP ADBASE ADTIGR ** This indicates that the client is notifying the hub about supporting the base protocol (BASE) and the extension hash method Tiger (TIGR). If the protocol base version is changed, send that instead of BASE. Similarly, if another hash method is preferred, send that instead. + 3. The hub will send: * ISUP ADBASE ADTIGR ** The hub may include other things it "AD"s, but none of these are interesting. + 4. The hub will send: * ISID ABCD ** ABCD is the SID that shall be used in any further communication from the client (where applicable). Store this value. + 5. Optionally, a hub may send the following but is not required: * IINF CT32 NIhub_name ** None of these parameters are needed for continuing the connectivity, although may come in handy in the future. The value in the NI parameter can be used for e.g. the application or tab name. + 6. The client shall send the following message * BINF ABCD ID<CID> PD<PID> NImy_name ** ABCD here is the SID as previously mentioned. The CID and PID are complementary information and are specified in the "Client identification section". The client should generate an internal CID (and associated PID). The CID and PID that the client sends to the hub have been run through a Base32 conversion. + 7. If the hub did not send its "IINF" before, it may do so now. Again, the information shouldn't be deemed as required. + 8. The hub may send a password request, see section "Other". + 9. The hub will send all other users that are logged in: * BINF sid ID<CID> NI<nick> ** Where SID and CID is the client information. The SID is used to create a mapping between client -> user. Note that the PID is never broadcast. + 10. The last BINF to arrive will be the information you connected with: * BINF ABCD ID<your-CID> NImy_name + 11. The client will now be fully logged in. +=== Chat +. + +=== Downloading +. + +=== Sharing +. + +=== Search +. + +=== Other +. + == Hub implementation +A client can be implemented by following this rough outline. The outline may not specify everything to full detail and will not cover the actual application that shall employ the mechanisms. -1) Hub accepts network connection. -- [client state = new] +=== Steps +1. Hub accepts network connection. +* Set client state to NEW. -2) Hub waits for handshake from client. -Client: HSUP ADBASE ... +2. Hub waits for handshake from client. +* Client will send: +** HSUP ADBASE ... -3) Hub checks support line responds -Server: ISUP ADBASE ... +3. Hub checks support line responds. -4) Hub allocates a SID, and sends it to the client. -Server: ISID ... +4. Server sends: +* ISUP ADBASE ... -5) Hub sends the hub information to the client. -Server: IINF ... +5. Hub allocates a SID, and sends it to the client: +* ISID ... -6) Hub waits for client to send info: -- [client state = identify] -Client: BINF ... +6. Hub sends the hub information to the client: +* IINF ... -7) Hub validates info from client - If password verification is needed, then go to 7.1, otherwise 8. +7. Hub waits for client to send info: +* Client will send: +** BINF ... +* Set client state to IDENTIFY. -7.1) If user needs to log in, request password -- [client state = verify] -Server: IGPA ... +8. Hub validates info from client +* If password verification is needed, then go to 9, otherwise 11. -7.2) Wait for and verify password from -Client: HPAS ... +9. If user needs to log in, request password +* Set client state to VERIFY +* Hub sends: +** IGPA ... -8) Hub transmits the userlist of all existing users to the client. -Server: BINF ... -Server: BINF ... -... -Server: BINF ... +10. Wait for and verify password from client: +* HPAS ... +11. Hub transmits the userlist of all existing users to the client. -9) Hub broadcasts the client's info (BINF) to all users, including the client. -- [client state = NORMAL] -Server: BINF ... + BINF ... + BINF ... + ... + BINF ... -10) At this point the client is considered logged in, and will receive all +12. Hub broadcasts the client's info (BINF) to all users, including the client. +* Set client state to NORMAL. +* Server sends: +** BINF ... + +13. At this point the client is considered logged in, and will receive all broadcast messages and all direct messages from other clients. It will also forward messages originating from this client to others, if the messages are correct (syntax, formatting, source SID, etc). Modified: trunk/ADC.txt =================================================================== --- trunk/ADC.txt 2015-02-19 20:21:48 UTC (rev 125) +++ trunk/ADC.txt 2015-02-21 16:56:23 UTC (rev 126) @@ -27,6 +27,7 @@ === Version 1.0.4, UNRELEASED * Separators in the command description for GET, GFI and SND are now explicit. +* Clarified UTF-8 encoding note. === Version 1.0.3, 2013-06-30 Fredrik Ullner <ul...@gm...> @@ -64,7 +65,8 @@ message. The string "\s" escapes space, "\n" newline and "\\" backslash. This version of the protocol reserves all other escapes for future use; any message containing unknown escapes must be discarded. -* All text must be sent as UTF-8 encoded Unicode in normalization form C. +* All text must be sent as 1-to-4 byte, RFC 3629-compliant UTF-8 encoded Unicode + in normalization form C. * Clients must ignore unknown/badly formatted messages. Hubs must ignore invalid messages and should dispatch unknown messages according to their type. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |