46 JINGLE_TRANSPORT_PRIO_LOW = 1, |
46 JINGLE_TRANSPORT_PRIO_LOW = 1, |
47 JINGLE_TRANSPORT_PRIO_NORMAL, |
47 JINGLE_TRANSPORT_PRIO_NORMAL, |
48 JINGLE_TRANSPORT_PRIO_HIGH |
48 JINGLE_TRANSPORT_PRIO_HIGH |
49 } JingleTransportPriority; |
49 } JingleTransportPriority; |
50 |
50 |
51 typedef gconstpointer (*JingleAppCheck) (JingleContent *cn, GError **err); |
51 /** |
52 typedef gboolean (*JingleAppHandle) (JingleAction action, gconstpointer data, LmMessageNode *node); |
52 * @brief Type returned by JingleAppFuncs and JingleTransportFuncs ->handle |
|
53 */ |
|
54 typedef enum { |
|
55 JINGLE_STATUS_HANDLED, |
|
56 JINGLE_STATUS_NOT_HANDLED, |
|
57 JINGLE_STATUS_HANDLE_ERROR |
|
58 } JingleHandleStatus; |
|
59 |
|
60 typedef gconstpointer (*JingleAppNewFromMsg) (JingleContent *cn, GError **err); |
|
61 typedef JingleHandleStatus (*JingleAppHandle) (JingleAction action, gconstpointer data, LmMessageNode *node, GError **err); |
53 typedef void (*JingleAppToMessage) (gconstpointer data, LmMessageNode *node); |
62 typedef void (*JingleAppToMessage) (gconstpointer data, LmMessageNode *node); |
54 typedef gboolean (*JingleAppHandleData) (gconstpointer data, const gchar *data2, guint len); |
63 typedef gboolean (*JingleAppHandleData) (gconstpointer data, const gchar *data2, guint len); |
55 typedef void (*JingleAppStart) (session_content *sc); |
64 typedef void (*JingleAppStart) (session_content *sc); |
56 typedef void (*JingleAppSend) (session_content *sc); |
65 typedef void (*JingleAppSend) (session_content *sc); |
57 typedef void (*JingleAppStop) (gconstpointer data); |
66 typedef void (*JingleAppStop) (gconstpointer data); |
58 typedef gchar* (*JingleAppInfo) (gconstpointer data); |
67 typedef gchar* (*JingleAppInfo) (gconstpointer data); |
59 |
68 |
60 typedef gconstpointer (*JingleTransportCheck) (JingleContent *cn, GError **err); |
69 typedef gconstpointer (*JingleTransportNewFromMsg) (JingleContent *cn, GError **err); |
|
70 typedef JingleHandleStatus (*JingleTransportHandle) (JingleAction action, gconstpointer data, LmMessageNode *node, GError **err); |
61 typedef void (*JingleTransportToMessage) (gconstpointer data, LmMessageNode *node); |
71 typedef void (*JingleTransportToMessage) (gconstpointer data, LmMessageNode *node); |
62 typedef gconstpointer (*JingleTransportNew) (void); |
72 typedef gconstpointer (*JingleTransportNew) (void); |
63 typedef void (*JingleTransportSend) (session_content *sc, gconstpointer data, gchar *buf, gsize size); |
73 typedef void (*JingleTransportSend) (session_content *sc, gconstpointer data, gchar *buf, gsize size); |
64 typedef void (*JingleTransportInit) (session_content *sc, gconstpointer data); |
74 typedef void (*JingleTransportInit) (session_content *sc); |
65 typedef void (*JingleTransportEnd) (session_content *sc, gconstpointer data); |
75 typedef void (*JingleTransportEnd) (session_content *sc, gconstpointer data); |
66 typedef gchar* (*JingleTransportInfo) (gconstpointer data); |
76 typedef gchar* (*JingleTransportInfo) (gconstpointer data); |
67 |
77 |
68 /** |
78 /** |
69 * @brief Struct containing functions provided by an app module. |
79 * @brief Struct containing functions provided by an app module. |
70 */ |
80 */ |
71 typedef struct { |
81 typedef struct { |
72 /** |
82 /** |
73 * @brief Check if the description node of a JingleContent is correct |
83 * @brief Check a description node, store its content in an internal |
|
84 * struct, then return it as a gconstpointer |
|
85 * |
|
86 * This function will only called when receiving a session-initiate. |
|
87 * It should store the content of the <description> node into an |
|
88 * internal struct and return this struct as a gconstpointer. |
74 */ |
89 */ |
75 JingleAppCheck check; |
90 JingleAppNewFromMsg newfrommessage; |
76 |
91 |
77 /** |
92 /** |
78 * @brief Handle an incoming jingle message (session-info, description-info...) |
93 * @brief Handle an incoming jingle message (session-info, description-info...) |
79 * |
94 * |
80 * If the function could not handle the incoming data, the caller should |
95 * If the function could not handle the incoming data, the caller should |
86 * @brief Insert data from the gconstpointer to the node given as an argument |
101 * @brief Insert data from the gconstpointer to the node given as an argument |
87 */ |
102 */ |
88 JingleAppToMessage tomessage; |
103 JingleAppToMessage tomessage; |
89 |
104 |
90 /** |
105 /** |
91 * @brief Handle incoming data |
106 * @brief Handle incoming Jingle IQs. |
|
107 * |
|
108 * e.g.: decription-info, content-info... etc |
|
109 * The first argument is the IQ type (a JingleAction). If the function |
|
110 * doesn't want to handle the IQ, it simply returns JINGLE_NOT_HANDLED, |
|
111 * if it has handled the IQ, it returns JINGLE_HANDLED, if it has handled |
|
112 * the IQ and an error happened, it returns JINGLE_HANDLE_ERROR. |
92 */ |
113 */ |
93 JingleAppHandleData handle_data; |
114 JingleAppHandleData handle_data; |
94 |
115 |
95 JingleAppStart start; |
116 JingleAppStart start; |
96 |
117 |