author | Nicolas Cornu <nicolas.cornu@ensi-bourges.fr> |
Fri, 30 Jul 2010 00:03:48 +0200 | |
changeset 79 | a654afc4a74a |
parent 76 | 42b487daee7d |
child 80 | 1c2ef2c5debe |
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 { |
76 | 32 |
JINGLE_TRANSPORT_NONE, |
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
|
33 |
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
|
34 |
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
|
35 |
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
|
36 |
} JingleTransportPriority; |
17
24aa7414bafd
Start the transport/app registering code. Fix various things.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
14
diff
changeset
|
37 |
|
32
72bbe33f151a
Modify the session-initiate handler among other things.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
29
diff
changeset
|
38 |
typedef gconstpointer (*JingleAppCheck) (JingleContent *cn, GError **err); |
68
ae8b0d03887e
Start the send_session_initiate function
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
64
diff
changeset
|
39 |
typedef void (*JingleAppHandle) (JingleAction action, gconstpointer data, LmMessageNode *node); |
54
1c1153f9f945
Handle for jingle
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
49
diff
changeset
|
40 |
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
|
41 |
|
32
72bbe33f151a
Modify the session-initiate handler among other things.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
29
diff
changeset
|
42 |
typedef gconstpointer (*JingleTransportCheck) (JingleContent *cn, GError **err); |
68
ae8b0d03887e
Start the send_session_initiate function
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
64
diff
changeset
|
43 |
typedef void (*JingleTransportHandle) (JingleAction action, gconstpointer data, LmMessageNode *node); |
54
1c1153f9f945
Handle for jingle
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
49
diff
changeset
|
44 |
typedef gboolean (*JingleTransportCmp) (gconstpointer data1, gconstpointer data2); |
73
6f061c11acfb
Add atrans to a new app
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
70
diff
changeset
|
45 |
typedef const gchar* (*JingleTransportxmlns) (void); |
6f061c11acfb
Add atrans to a new app
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
70
diff
changeset
|
46 |
typedef gconstpointer (*JingleTransportNew) (void); |
19
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
47 |
|
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
48 |
typedef struct { |
20
72e53665328e
Add a function to check a file transfert request.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
19
diff
changeset
|
49 |
/* 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
|
50 |
JingleAppCheck check; |
19
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
51 |
|
25
11694a99f84b
Build a LMNode from a Jingle struct
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
23
diff
changeset
|
52 |
/* 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
|
53 |
JingleAppHandle handle; |
54
1c1153f9f945
Handle for jingle
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
49
diff
changeset
|
54 |
|
1c1153f9f945
Handle for jingle
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
49
diff
changeset
|
55 |
JingleAppHandleData handle_data; |
19
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
56 |
|
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
57 |
} JingleAppFuncs; |
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
58 |
|
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
59 |
typedef struct { |
73
6f061c11acfb
Add atrans to a new app
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
70
diff
changeset
|
60 |
JingleTransportxmlns xmlns; |
6f061c11acfb
Add atrans to a new app
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
70
diff
changeset
|
61 |
|
20
72e53665328e
Add a function to check a file transfert request.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
19
diff
changeset
|
62 |
/* 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
|
63 |
JingleTransportCheck check; |
19
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
64 |
|
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
65 |
/* */ |
64
63d4f434abbc
Add a command to JFT to send or request a file
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
63
diff
changeset
|
66 |
JingleTransportHandle handle; |
19
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
67 |
|
54
1c1153f9f945
Handle for jingle
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
49
diff
changeset
|
68 |
JingleTransportCmp cmp; |
1c1153f9f945
Handle for jingle
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
49
diff
changeset
|
69 |
|
73
6f061c11acfb
Add atrans to a new app
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
70
diff
changeset
|
70 |
JingleTransportNew new; |
19
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
71 |
} JingleTransportFuncs; |
17
24aa7414bafd
Start the transport/app registering code. Fix various things.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
14
diff
changeset
|
72 |
|
24aa7414bafd
Start the transport/app registering code. Fix various things.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
14
diff
changeset
|
73 |
|
49
8dddfbe488b6
Add ibb transport
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
37
diff
changeset
|
74 |
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
|
75 |
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
|
76 |
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
|
77 |
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
|
78 |
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
|
79 |
JingleTransportPriority prio); |
19
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
80 |
JingleAppFuncs *jingle_get_appfuncs(const gchar *xmlns); |
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
81 |
JingleTransportFuncs *jingle_get_transportfuncs(const gchar *xmlns); |
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
82 |
void jingle_unregister_app(const gchar *xmlns); |
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
83 |
void jingle_unregister_transport(const gchar *xmlns); |
70
54e86a92fe7f
create a LM from a jinglesession
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
68
diff
changeset
|
84 |
JingleTransportFuncs *jingle_transport_for_app(const gchar *appxmlns, GSList **forbid); |
14
77966ed56e14
Create two subdirectories.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
85 |
|
77966ed56e14
Create two subdirectories.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
86 |
#endif |