doc.txt
author Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
Mon, 16 Aug 2010 18:32:55 +0200
changeset 132 4fef4ced1e97
parent 113 cb5adb25ad87
child 136 405f99d8f3c5
permissions -rw-r--r--
Fix the doc

DOCUMENTATION:

I: Jingle
Jingle is a module whose purpose is to allow other modules to work together.
There are two sorts of modules jingle can work with: application modules
handle or produce data (e.g. File Transfer, Voice) and transport modules
transport the data using some method/protocol (e.g In-Band Bytestreams, SOCKS5
Bytestreams).
The "sub-modules" must implement a set of functions and register to the jingle
module.
The jingle module will catch and dispatch incoming jingle iqs and also offer an
interface between apps and trans modules. The module also keep track of all
initialized sessions in a linked list of JingleSession structures. This
structure contains all the relevant informations about a session together with a
linked list of SessionContent, a structure containing information about a
specific content.
SessionContent contains pointer to fonctions in the application and transport
modules and opaque pointers to the internal representation of the app and
transport by the corresponding app and transport modules.

An application module must provide:
- check: check if the description of a JingleContent is correct;
- handle: each application have some options not conventional, so handle is the
          less option. We give him all the jingle iqs than other function doesn't
          handle;
- tomessage: add the gconstpointer to a given node;
- handle_data: when the peer send data to us, the trans module catch it and
               give it to jingle. After jingle give it to the apps via this
               function;
- start: the session have been accepted we can init our transfer;
- send: it's call until there is datas to send;
- stop: we've got a session-terminate, we need to close transfer, files, ...

An transport module must provide:
- check: the same as application;
- tomessage: idem;
- cmp: to know if 2 transports are the same. Use by IBB, when we got
       a new data jingle must look the gconstpointer to got the ibb-id to know
       which apps is concerned;
- xmlns: util when we got only funcs, to know who are we;
- new: to create a new transport node, with default options;
-send: to send data given by apps via jingle.