ICE/STUN/HTML GLUE SPECIFICATION
================================

(a skeleton, to be fleshed out by professionals)



INTRODUCTION
------------

(to be filled in)

...This specification is designed to provide a glue between the
ICE/STUN/... specifications and the host specification or other
high-level APIs. ...


CONFORMANCE
-----------

(to be filled in)

(this is where the spec describes how to determine what is a
conformance requirement and what is not, e.g. in part by referencing
RFC 2119; where it defines what conformance classes exist, e.g. user
agents, relay servers, and gateways; maybe where it defines
terminology used in the specification)


INTERFACE TO THE host SPECIFICATION
===================================

When the host specification requires the user agent to *create a new
peer object* with relay server information string /s/, the user agent
must follow these steps, which either fail or return a conceptual
"peer object" referenced by other algorithms:

 1. ...parse /s/...

 2. ...if something bad happens, fail and abort these steps.

 3. Create a conceptual peer object /o/ with the following
    information:

     + The relay server details...

     + A list of currently sending streams, initially empty...

     + A 128 bit unique session ID...

 ... 

 9. Return /o/ and continue these steps asynchronously.

 ...

16. Let the /initial configuration/ string be ... with /o/'s session
    ID ... encryption key ...

17. Send the /initial configuration/ string to the peer object's
    low-bandwidth channel.

 ...


When the host specification requires the user agent to *handle a
message /s/ for a peer object /o/*, the user agent must follow these
steps, which either fail or succeed:

 1. ...parse /s/...

 2. ...if the string had a bad syntax, fail and abort these steps...

 3. ...if the object /o/ was not expecting the message /s/ (e.g. it's
    an initial handshake message after the connection is already set
    up or something), fail and abort these steps...

 4. Otherwise, this algorithm succeeds. Run the remaining steps
    asynchronously.

 ...


When the host specification required the user agent to *send a string
message /s/ using peer object /o/, with a mode /m/ set to either
/reliability/ or /low latency/*, the user agent must follow these
steps, which either fail or succeed:

 1. ...if /o/ is not connected, fail and abort these steps...

 2. Otherwise, this algorithm succeeds. Run the remaining steps
    asynchronously.

 ...


When the host specification required the user agent to *send a bitmap
/b/ using peer object /o/, the user agent must follow these steps,
which either fail or succeed:

 1. ...if /o/ is not connected, fail and abort these steps...

 2. Otherwise, this algorithm succeeds. Run the remaining steps
    asynchronously.

 ...


When the host specification required the user agent to *send a binary
file /f/ using peer object /o/, the user agent must follow these
steps, which either fail or succeed:

 1. ...if /o/ is not connected, fail and abort these steps...

 2. Otherwise, this algorithm succeeds. Run the remaining steps
    asynchronously.

 3. ...negotiate a codec, bitrate, etc...

 ...


When the host specification required the user agent to *start sending
a stream /s/ using peer object /o/, the user agent must follow these
steps, which either fail or succeed:

 1. ...if /o/ is not connected, fail and abort these steps...

 2. Otherwise, this algorithm succeeds. Run the remaining steps
    asynchronously.

 ...


TERMS USED IN THE PREVIOUS SECTIONS THAT INVOKE STEPS IN THE host SPECIFICATION
-------------------------------------------------------------------------------

When this specification requires a user agent to perform any of the
following operations, the user agent must act as described in the host
specification for this operation:

+ *Send a string /s/ to the peer object's low-bandwidth channel*

+ *Tell the API that the connection has been established*

+ *Tell the API that the connection has been lost*

+ *Tell the API that the connection cannot be established*

+ *Handle the reception of string message /s/*

+ *Handle the reception of bitmap message /b/*

+ *Handle the reception of binary file message /f/*

+ *Handle the reception of a new stream /s/*


REFERENCES
----------

(to be filled in)
