author | Nicolas Cornu <nicolas.cornu@ensi-bourges.fr> |
Wed, 21 Jul 2010 01:51:10 +0200 | |
changeset 64 | 63d4f434abbc |
parent 63 | b56853071a09 |
child 68 | ae8b0d03887e |
permissions | -rw-r--r-- |
14
77966ed56e14
Create two subdirectories.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
1 |
#ifndef __JINGLE_REGISTER_H__ |
77966ed56e14
Create two subdirectories.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
2 |
#define __JINGLE_REGISTER_H__ |
77966ed56e14
Create two subdirectories.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
3 |
|
18
d0ddcfd31eb8
Change the way the header files are included.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
17
diff
changeset
|
4 |
#include <jingle/jingle.h> |
17
24aa7414bafd
Start the transport/app registering code. Fix various things.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
14
diff
changeset
|
5 |
|
24aa7414bafd
Start the transport/app registering code. Fix various things.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
14
diff
changeset
|
6 |
|
59
69985ccda25a
We send a session-accept \o/... Endly
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
54
diff
changeset
|
7 |
#define NS_JINGLE_APP_PREFIX "urn:xmpp:jingle:apps:" |
69985ccda25a
We send a session-accept \o/... Endly
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
54
diff
changeset
|
8 |
#define NS_JINGLE_TRANSPORT_PREFIX "urn:xmpp:jingle:transports:" |
17
24aa7414bafd
Start the transport/app registering code. Fix various things.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
14
diff
changeset
|
9 |
|
49
8dddfbe488b6
Add ibb transport
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
37
diff
changeset
|
10 |
|
8dddfbe488b6
Add ibb transport
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
37
diff
changeset
|
11 |
typedef enum { |
63
b56853071a09
Add a new function that find the best transport method for an app.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
61
diff
changeset
|
12 |
/* A datagram transport has one or more components with which to exchange |
b56853071a09
Add a new function that find the best transport method for an app.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
61
diff
changeset
|
13 |
* packets with UDP-like behavior. Packets might be of arbitrary length, |
b56853071a09
Add a new function that find the best transport method for an app.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
61
diff
changeset
|
14 |
* might be received out of order, and might not be received at all |
b56853071a09
Add a new function that find the best transport method for an app.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
61
diff
changeset
|
15 |
* (i.e., the transport is lossy). */ |
b56853071a09
Add a new function that find the best transport method for an app.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
61
diff
changeset
|
16 |
JINGLE_TRANSPORT_STREAMING, |
b56853071a09
Add a new function that find the best transport method for an app.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
61
diff
changeset
|
17 |
|
b56853071a09
Add a new function that find the best transport method for an app.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
61
diff
changeset
|
18 |
/* A streaming transport has one or more components with which to exchange |
b56853071a09
Add a new function that find the best transport method for an app.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
61
diff
changeset
|
19 |
* bidirectional bytestreams with TCP-like behavior. Bytes are received |
b56853071a09
Add a new function that find the best transport method for an app.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
61
diff
changeset
|
20 |
* reliably and in order, and applications MUST NOT rely on a stream being |
b56853071a09
Add a new function that find the best transport method for an app.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
61
diff
changeset
|
21 |
* chunked in any specific way. */ |
b56853071a09
Add a new function that find the best transport method for an app.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
61
diff
changeset
|
22 |
JINGLE_TRANSPORT_DATAGRAM |
b56853071a09
Add a new function that find the best transport method for an app.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
61
diff
changeset
|
23 |
} JingleTransportType; |
b56853071a09
Add a new function that find the best transport method for an app.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
61
diff
changeset
|
24 |
|
b56853071a09
Add a new function that find the best transport method for an app.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
61
diff
changeset
|
25 |
/** |
b56853071a09
Add a new function that find the best transport method for an app.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
61
diff
changeset
|
26 |
* We need to rank transports to determine which one to choose. |
b56853071a09
Add a new function that find the best transport method for an app.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
61
diff
changeset
|
27 |
* With this system, In-Band Bytestreams could have a low priority, SOCKS5 |
b56853071a09
Add a new function that find the best transport method for an app.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
61
diff
changeset
|
28 |
* Bytestream a normal priority, and some stream transport method that allow |
b56853071a09
Add a new function that find the best transport method for an app.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
61
diff
changeset
|
29 |
* direct connection would have a high priority, since it would be the fastest. |
b56853071a09
Add a new function that find the best transport method for an app.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
61
diff
changeset
|
30 |
*/ |
b56853071a09
Add a new function that find the best transport method for an app.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
61
diff
changeset
|
31 |
typedef enum { |
b56853071a09
Add a new function that find the best transport method for an app.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
61
diff
changeset
|
32 |
JINGLE_TRANSPORT_LOW, |
b56853071a09
Add a new function that find the best transport method for an app.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
61
diff
changeset
|
33 |
JINGLE_TRANSPORT_NORMAL, |
b56853071a09
Add a new function that find the best transport method for an app.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
61
diff
changeset
|
34 |
JINGLE_TRANSPORT_HIGH |
b56853071a09
Add a new function that find the best transport method for an app.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
61
diff
changeset
|
35 |
} JingleTransportPriority; |
17
24aa7414bafd
Start the transport/app registering code. Fix various things.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
14
diff
changeset
|
36 |
|
32
72bbe33f151a
Modify the session-initiate handler among other things.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
29
diff
changeset
|
37 |
typedef gconstpointer (*JingleAppCheck) (JingleContent *cn, GError **err); |
61
c7879aae9e1d
build a content
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
60
diff
changeset
|
38 |
typedef void (*JingleAppHandle) (gconstpointer data, LmMessageNode *node); |
54
1c1153f9f945
Handle for jingle
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
49
diff
changeset
|
39 |
typedef gboolean (*JingleAppHandleData) (gconstpointer data, const gchar *data2, guint len); |
25
11694a99f84b
Build a LMNode from a Jingle struct
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
23
diff
changeset
|
40 |
|
32
72bbe33f151a
Modify the session-initiate handler among other things.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
29
diff
changeset
|
41 |
typedef gconstpointer (*JingleTransportCheck) (JingleContent *cn, GError **err); |
61
c7879aae9e1d
build a content
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
60
diff
changeset
|
42 |
typedef void (*JingleTransportHandle) (gconstpointer data, LmMessageNode *node); |
54
1c1153f9f945
Handle for jingle
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
49
diff
changeset
|
43 |
typedef gboolean (*JingleTransportCmp) (gconstpointer data1, gconstpointer data2); |
19
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
44 |
|
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
45 |
typedef struct { |
20
72e53665328e
Add a function to check a file transfert request.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
19
diff
changeset
|
46 |
/* check if the description of a JingleContent is correct */ |
25
11694a99f84b
Build a LMNode from a Jingle struct
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
23
diff
changeset
|
47 |
JingleAppCheck check; |
19
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
48 |
|
25
11694a99f84b
Build a LMNode from a Jingle struct
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
23
diff
changeset
|
49 |
/* If we got a LM with the good xmlns */ |
19
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
50 |
JingleAppHandle handle; |
54
1c1153f9f945
Handle for jingle
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
49
diff
changeset
|
51 |
|
1c1153f9f945
Handle for jingle
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
49
diff
changeset
|
52 |
JingleAppHandleData handle_data; |
19
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
53 |
|
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
54 |
} JingleAppFuncs; |
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
55 |
|
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
56 |
typedef struct { |
20
72e53665328e
Add a function to check a file transfert request.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
19
diff
changeset
|
57 |
/* check if the transport of a JingleContent is correct */ |
64
63d4f434abbc
Add a command to JFT to send or request a file
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
63
diff
changeset
|
58 |
JingleTransportCheck check; |
19
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
59 |
|
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
60 |
/* */ |
64
63d4f434abbc
Add a command to JFT to send or request a file
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
63
diff
changeset
|
61 |
JingleTransportHandle handle; |
19
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
62 |
|
54
1c1153f9f945
Handle for jingle
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
49
diff
changeset
|
63 |
JingleTransportCmp cmp; |
1c1153f9f945
Handle for jingle
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
49
diff
changeset
|
64 |
|
19
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
65 |
} JingleTransportFuncs; |
17
24aa7414bafd
Start the transport/app registering code. Fix various things.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
14
diff
changeset
|
66 |
|
24aa7414bafd
Start the transport/app registering code. Fix various things.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
14
diff
changeset
|
67 |
|
49
8dddfbe488b6
Add ibb transport
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
37
diff
changeset
|
68 |
void jingle_register_app(const gchar *xmlns, JingleAppFuncs *funcs, |
63
b56853071a09
Add a new function that find the best transport method for an app.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
61
diff
changeset
|
69 |
JingleTransportType type); |
b56853071a09
Add a new function that find the best transport method for an app.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
61
diff
changeset
|
70 |
void jingle_register_transport(const gchar *xmlns, |
b56853071a09
Add a new function that find the best transport method for an app.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
61
diff
changeset
|
71 |
JingleTransportFuncs *funcs, |
b56853071a09
Add a new function that find the best transport method for an app.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
61
diff
changeset
|
72 |
JingleTransportType type, |
b56853071a09
Add a new function that find the best transport method for an app.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
61
diff
changeset
|
73 |
JingleTransportPriority prio); |
19
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
74 |
JingleAppFuncs *jingle_get_appfuncs(const gchar *xmlns); |
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
75 |
JingleTransportFuncs *jingle_get_transportfuncs(const gchar *xmlns); |
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
76 |
void jingle_unregister_app(const gchar *xmlns); |
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
77 |
void jingle_unregister_transport(const gchar *xmlns); |
14
77966ed56e14
Create two subdirectories.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
78 |
|
77966ed56e14
Create two subdirectories.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
79 |
#endif |