author | Nicolas Cornu <nicolas.cornu@ensi-bourges.fr> |
Sun, 15 Aug 2010 22:12:04 +0200 | |
changeset 128 | cded9f40039e |
parent 127 | 02dde03e219b |
child 133 | 361d8577ebd1 |
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 |
|
59
69985ccda25a
We send a session-accept \o/... Endly
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
54
diff
changeset
|
6 |
#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
|
7 |
#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
|
8 |
|
49
8dddfbe488b6
Add ibb transport
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
37
diff
changeset
|
9 |
|
8dddfbe488b6
Add ibb transport
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
37
diff
changeset
|
10 |
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
|
11 |
/* 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
|
12 |
* 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
|
13 |
* 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
|
14 |
* (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
|
15 |
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
|
16 |
|
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 |
/* 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
|
18 |
* 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
|
19 |
* 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
|
20 |
* 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
|
21 |
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
|
22 |
} 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
|
23 |
|
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 |
* 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
|
26 |
* 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
|
27 |
* 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
|
28 |
* 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
|
29 |
*/ |
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 |
typedef enum { |
76 | 31 |
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
|
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); |
111
76ce876f7935
Handle incoming session-info
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
109
diff
changeset
|
38 |
typedef gboolean (*JingleAppHandle) (JingleAction action, gconstpointer data, LmMessageNode *node); |
81
8b6320ad470b
Add comments, change some function names...
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
80
diff
changeset
|
39 |
typedef void (*JingleAppToMessage) (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); |
123
58bd57666ef9
Add a end function to transport
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
122
diff
changeset
|
41 |
typedef void (*JingleAppStart) (session_content *sc); |
58bd57666ef9
Add a end function to transport
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
122
diff
changeset
|
42 |
typedef void (*JingleAppSend) (session_content *sc); |
109 | 43 |
typedef void (*JingleAppStop) (gconstpointer data); |
128
cded9f40039e
Give info when asking for events
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
127
diff
changeset
|
44 |
typedef gchar* (*JingleAppInfo) (gconstpointer data); |
25
11694a99f84b
Build a LMNode from a Jingle struct
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
23
diff
changeset
|
45 |
|
32
72bbe33f151a
Modify the session-initiate handler among other things.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
29
diff
changeset
|
46 |
typedef gconstpointer (*JingleTransportCheck) (JingleContent *cn, GError **err); |
81
8b6320ad470b
Add comments, change some function names...
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
80
diff
changeset
|
47 |
typedef void (*JingleTransportToMessage) (gconstpointer data, LmMessageNode *node); |
54
1c1153f9f945
Handle for jingle
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
49
diff
changeset
|
48 |
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
|
49 |
typedef gconstpointer (*JingleTransportNew) (void); |
122
8969dc3e2f14
JIBB: buffering
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
111
diff
changeset
|
50 |
typedef void (*JingleTransportSend) (session_content *sc, gconstpointer data, gchar *buf, gsize size); |
126
059a6737f6a4
Error are better handle
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
123
diff
changeset
|
51 |
typedef void (*JingleTransportInit) (session_content *sc, gconstpointer data); |
123
58bd57666ef9
Add a end function to transport
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
122
diff
changeset
|
52 |
typedef void (*JingleTransportEnd) (session_content *sc, gconstpointer data); |
128
cded9f40039e
Give info when asking for events
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
127
diff
changeset
|
53 |
typedef gchar* (*JingleTransportInfo) (gconstpointer data); |
19
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
54 |
|
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
55 |
typedef struct { |
20
72e53665328e
Add a function to check a file transfert request.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
19
diff
changeset
|
56 |
/* 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
|
57 |
JingleAppCheck check; |
19
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
58 |
|
111
76ce876f7935
Handle incoming session-info
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
109
diff
changeset
|
59 |
/* handle an incoming jingle message (session-info, description-info...). |
76ce876f7935
Handle incoming session-info
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
109
diff
changeset
|
60 |
* If the function could not handle the incoming data, the caller should |
76ce876f7935
Handle incoming session-info
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
109
diff
changeset
|
61 |
* reply to the incoming message with an error iq */ |
76ce876f7935
Handle incoming session-info
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
109
diff
changeset
|
62 |
JingleAppHandle handle; |
76ce876f7935
Handle incoming session-info
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
109
diff
changeset
|
63 |
|
80
1c2ef2c5debe
Modifications to the JingleSession struct.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
76
diff
changeset
|
64 |
/* Insert data from the gconstpointer to the node given as an argument */ |
1c2ef2c5debe
Modifications to the JingleSession struct.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
76
diff
changeset
|
65 |
JingleAppToMessage tomessage; |
111
76ce876f7935
Handle incoming session-info
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
109
diff
changeset
|
66 |
|
54
1c1153f9f945
Handle for jingle
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
49
diff
changeset
|
67 |
JingleAppHandleData handle_data; |
111
76ce876f7935
Handle incoming session-info
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
109
diff
changeset
|
68 |
|
101
4235aa1a7664
JFT: add a func to send data
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
81
diff
changeset
|
69 |
JingleAppStart start; |
111
76ce876f7935
Handle incoming session-info
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
109
diff
changeset
|
70 |
|
103
c34b513be8d9
JFT: handle data app
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
102
diff
changeset
|
71 |
JingleAppSend send; |
111
76ce876f7935
Handle incoming session-info
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
109
diff
changeset
|
72 |
|
109 | 73 |
JingleAppStop stop; |
128
cded9f40039e
Give info when asking for events
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
127
diff
changeset
|
74 |
|
cded9f40039e
Give info when asking for events
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
127
diff
changeset
|
75 |
JingleAppInfo info; |
19
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
76 |
|
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
77 |
} JingleAppFuncs; |
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
78 |
|
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
79 |
typedef struct { |
80
1c2ef2c5debe
Modifications to the JingleSession struct.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
76
diff
changeset
|
80 |
JingleTransportCheck check; |
19
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
81 |
|
80
1c2ef2c5debe
Modifications to the JingleSession struct.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
76
diff
changeset
|
82 |
JingleTransportToMessage tomessage; |
111
76ce876f7935
Handle incoming session-info
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
109
diff
changeset
|
83 |
|
54
1c1153f9f945
Handle for jingle
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
49
diff
changeset
|
84 |
JingleTransportCmp cmp; |
111
76ce876f7935
Handle incoming session-info
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
109
diff
changeset
|
85 |
|
73
6f061c11acfb
Add atrans to a new app
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
70
diff
changeset
|
86 |
JingleTransportNew new; |
111
76ce876f7935
Handle incoming session-info
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
109
diff
changeset
|
87 |
|
102 | 88 |
JingleTransportSend send; |
123
58bd57666ef9
Add a end function to transport
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
122
diff
changeset
|
89 |
|
126
059a6737f6a4
Error are better handle
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
123
diff
changeset
|
90 |
JingleTransportInit init; |
059a6737f6a4
Error are better handle
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
123
diff
changeset
|
91 |
|
123
58bd57666ef9
Add a end function to transport
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
122
diff
changeset
|
92 |
JingleTransportEnd end; |
128
cded9f40039e
Give info when asking for events
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
127
diff
changeset
|
93 |
|
cded9f40039e
Give info when asking for events
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
127
diff
changeset
|
94 |
JingleTransportInfo info; |
cded9f40039e
Give info when asking for events
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
127
diff
changeset
|
95 |
|
19
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
96 |
} JingleTransportFuncs; |
17
24aa7414bafd
Start the transport/app registering code. Fix various things.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
14
diff
changeset
|
97 |
|
24aa7414bafd
Start the transport/app registering code. Fix various things.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
14
diff
changeset
|
98 |
|
49
8dddfbe488b6
Add ibb transport
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
37
diff
changeset
|
99 |
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
|
100 |
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
|
101 |
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
|
102 |
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
|
103 |
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
|
104 |
JingleTransportPriority prio); |
19
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
105 |
JingleAppFuncs *jingle_get_appfuncs(const gchar *xmlns); |
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
106 |
JingleTransportFuncs *jingle_get_transportfuncs(const gchar *xmlns); |
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
107 |
void jingle_unregister_app(const gchar *xmlns); |
60a10ab26723
Modify the "registering" code.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
18
diff
changeset
|
108 |
void jingle_unregister_transport(const gchar *xmlns); |
127
02dde03e219b
remove xmlns() in transports
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
126
diff
changeset
|
109 |
const gchar *jingle_transport_for_app(const gchar *appxmlns, GSList **forbid); |
14
77966ed56e14
Create two subdirectories.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
110 |
|
77966ed56e14
Create two subdirectories.
Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
parents:
diff
changeset
|
111 |
#endif |