http://downloads.netgear.com/files/GPL/GPL_Source_V361j_DM111PSP_series_consumer_rele...
[bcm963xx.git] / userapps / opensource / libosip2 / src / osip2 / xixt.h
1 /*
2   The oSIP library implements the Session Initiation Protocol (SIP -rfc2543-)
3   Copyright (C) 2001  Aymeric MOIZARD jack@atosc.org
4   
5   This library is free software; you can redistribute it and/or
6   modify it under the terms of the GNU Lesser General Public
7   License as published by the Free Software Foundation; either
8   version 2.1 of the License, or (at your option) any later version.
9   
10   This library is distributed in the hope that it will be useful,
11   but WITHOUT ANY WARRANTY; without even the implied warranty of
12   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13   Lesser General Public License for more details.
14   
15   You should have received a copy of the GNU Lesser General Public
16   License along with this library; if not, write to the Free Software
17   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18 */
19
20
21 #ifndef _XIXT_H_
22 #define _XIXT_H_
23
24 #include <osipparser2/osip_const.h>
25 #include <osipparser2/osip_port.h>
26
27 #ifdef __cplusplus
28 extern "C"
29 {
30 #endif
31
32
33   void __osip_message_callback (int type, osip_transaction_t *,
34                                 osip_message_t *);
35   void __osip_kill_transaction_callback (int type, osip_transaction_t *);
36   void __osip_transport_error_callback (int type, osip_transaction_t *,
37                                         int error);
38
39 /**
40  * Allocate an osip_ict_t element. (for outgoing INVITE transaction)
41  * NOTE: THIS IS AN INTERNAL METHOD ONLY
42  * @param ict The element to allocate.
43  * @param osip The global instance of oSIP.
44  * @param invite The SIP request that initiate the transaction.
45  */
46   int __osip_ict_init (osip_ict_t ** ict, osip_t * osip,
47                        osip_message_t * invite);
48 /**
49  * Free all resource in a osip_ict_t element.
50  * NOTE: THIS IS AN INTERNAL METHOD ONLY
51  * @param ict The element to free.
52  */
53   int __osip_ict_free (osip_ict_t * ict);
54
55
56 /**
57  * Check if this transaction needs a TIMEOUT_A event 
58  * NOTE: THIS IS AN INTERNAL METHOD ONLY
59  * @param ict The element to work on.
60  * @param state The actual state of the transaction.
61  * @param transactionid The transaction id.
62  */
63   osip_event_t *__osip_ict_need_timer_a_event (osip_ict_t * ict,
64                                                state_t state,
65                                                int transactionid);
66 /**
67  * Check if this transaction needs a TIMEOUT_B event 
68  * NOTE: THIS IS AN INTERNAL METHOD ONLY
69  * @param ict The element to work on.
70  * @param state The actual state of the transaction.
71  * @param transactionid The transaction id.
72  */
73   osip_event_t *__osip_ict_need_timer_b_event (osip_ict_t * ict,
74                                                state_t state,
75                                                int transactionid);
76 /**
77  * Check if this transaction needs a TIMEOUT_D event 
78  * NOTE: THIS IS AN INTERNAL METHOD ONLY
79  * @param ict The element to work on.
80  * @param state The actual state of the transaction.
81  * @param transactionid The transaction id.
82  */
83   osip_event_t *__osip_ict_need_timer_d_event (osip_ict_t * ict,
84                                                state_t state,
85                                                int transactionid);
86
87 /**
88  * Allocate an osip_nict_t element. (for outgoing NON-INVITE transaction)
89  * NOTE: THIS IS AN INTERNAL METHOD ONLY
90  * @param nict The element to allocate.
91  * @param osip The global instance of oSIP.
92  * @param request The SIP request that initiate the transaction.
93  */
94   int __osip_nict_init (osip_nict_t ** nict, osip_t * osip,
95                         osip_message_t * request);
96 /**
97  * Free all resource in an osip_nict_t element.
98  * NOTE: THIS IS AN INTERNAL METHOD ONLY
99  * @param nict The element to free.
100  */
101   int __osip_nict_free (osip_nict_t * nict);
102
103
104 /**
105  * Check if this transaction needs a TIMEOUT_E event 
106  * NOTE: THIS IS AN INTERNAL METHOD ONLY
107  * @param nict The element to work on.
108  * @param state The actual state of the transaction.
109  * @param transactionid The transaction id.
110  */
111   osip_event_t *__osip_nict_need_timer_e_event (osip_nict_t * nict,
112                                                 state_t state,
113                                                 int transactionid);
114 /**
115  * Check if this transaction needs a TIMEOUT_F event 
116  * NOTE: THIS IS AN INTERNAL METHOD ONLY
117  * @param nict The element to work on.
118  * @param state The actual state of the transaction.
119  * @param transactionid The transaction id.
120  */
121   osip_event_t *__osip_nict_need_timer_f_event (osip_nict_t * nict,
122                                                 state_t state,
123                                                 int transactionid);
124 /**
125  * Check if this transaction needs a TIMEOUT_K event 
126  * NOTE: THIS IS AN INTERNAL METHOD ONLY
127  * @param nict The element to work on.
128  * @param state The actual state of the transaction.
129  * @param transactionid The transaction id.
130  */
131   osip_event_t *__osip_nict_need_timer_k_event (osip_nict_t * nict,
132                                                 state_t state,
133                                                 int transactionid);
134
135 /**
136  * Allocate an osip_ist_t element. (for incoming INVITE transaction)
137  * NOTE: THIS IS AN INTERNAL METHOD ONLY
138  * @param ist The element to allocate.
139  * @param osip The global instance of oSIP.
140  * @param invite The SIP invite that initiate the transaction.
141  */
142   int __osip_ist_init (osip_ist_t ** ist, osip_t * osip,
143                        osip_message_t * invite);
144 /**
145  * Free all resource in a osip_ist_t element.
146  * NOTE: THIS IS AN INTERNAL METHOD ONLY
147  * @param ist The element to free.
148  */
149   int __osip_ist_free (osip_ist_t * ist);
150
151 /**
152  * Check if this transaction needs a TIMEOUT_G event 
153  * NOTE: THIS IS AN INTERNAL METHOD ONLY
154  * @param ist The element to work on.
155  * @param state The actual state of the transaction.
156  * @param transactionid The transaction id.
157  */
158   osip_event_t *__osip_ist_need_timer_g_event (osip_ist_t * ist,
159                                                state_t state,
160                                                int transactionid);
161 /**
162  * Check if this transaction needs a TIMEOUT_H event 
163  * NOTE: THIS IS AN INTERNAL METHOD ONLY
164  * @param ist The element to work on.
165  * @param state The actual state of the transaction.
166  * @param transactionid The transaction id.
167  */
168   osip_event_t *__osip_ist_need_timer_h_event (osip_ist_t * ist,
169                                                state_t state,
170                                                int transactionid);
171 /**
172  * Check if this transaction needs a TIMEOUT_I event 
173  * NOTE: THIS IS AN INTERNAL METHOD ONLY
174  * @param ist The element to work on.
175  * @param state The actual state of the transaction.
176  * @param transactionid The transaction id.
177  */
178   osip_event_t *__osip_ist_need_timer_i_event (osip_ist_t * ist,
179                                                state_t state,
180                                                int transactionid);
181
182 /**
183  * Allocate an osip_nist_t element. (for incoming NON-INVITE transaction)
184  * NOTE: THIS IS AN INTERNAL METHOD ONLY
185  * @param nist The element to allocate.
186  * @param osip The global instance of oSIP.
187  * @param request The SIP request that initiate the transaction.
188  */
189   int __osip_nist_init (osip_nist_t ** nist, osip_t * osip,
190                         osip_message_t * request);
191
192 /**
193  * Free all resource in a osip_nist_t element.
194  * NOTE: THIS IS AN INTERNAL METHOD ONLY
195  * @param nist The element to free.
196  */
197   int __osip_nist_free (osip_nist_t * nist);
198
199
200 /**
201  * Check if this transaction needs a TIMEOUT_J event 
202  * @param nist The element to work on.
203  * @param state The actual state of the transaction.
204  * @param transactionid The transaction id.
205  */
206   osip_event_t *__osip_nist_need_timer_j_event (osip_nist_t * nist,
207                                                 state_t state,
208                                                 int transactionid);
209
210 /**
211  * Check if the response match a server transaction.
212  * NOTE: THIS IS AN INTERNAL METHOD ONLY
213  * @param tr The transaction.
214  * @param resp The SIP response received.
215  */
216   int
217     __osip_transaction_matching_response_osip_to_xict_17_1_3
218     (osip_transaction_t * tr, osip_message_t * resp);
219
220 /**
221  * Check if the request match a client transaction.
222  * NOTE: THIS IS AN INTERNAL METHOD ONLY
223  * @param tr The transaction.
224  * @param request The SIP request received.
225  */
226   int
227     __osip_transaction_matching_request_osip_to_xist_17_2_3
228     (osip_transaction_t * tr, osip_message_t * request);
229
230
231
232 /**
233  * Lock access to the list of ict transactions.
234  * NOTE: THIS IS AN INTERNAL METHOD ONLY
235  * @param osip The element to work on.
236  */
237   int osip_ict_lock (osip_t * osip);
238 /**
239  * Unlock access to the list of ict transactions.
240  * NOTE: THIS IS AN INTERNAL METHOD ONLY
241  * @param osip The element to work on.
242  */
243   int osip_ict_unlock (osip_t * osip);
244 /**
245  * Lock access to the list of ist transactions.
246  * NOTE: THIS IS AN INTERNAL METHOD ONLY
247  * @param osip The element to work on.
248  */
249   int osip_ist_lock (osip_t * osip);
250 /**
251  * Unlock access to the list of ist transactions.
252  * NOTE: THIS IS AN INTERNAL METHOD ONLY
253  * @param osip The element to work on.
254  */
255   int osip_ist_unlock (osip_t * osip);
256 /**
257  * Lock access to the list of nict transactions.
258  * NOTE: THIS IS AN INTERNAL METHOD ONLY
259  * @param osip The element to work on.
260  */
261   int osip_nict_lock (osip_t * osip);
262 /**
263  * Unlock access to the list of nict transactions.
264  * NOTE: THIS IS AN INTERNAL METHOD ONLY
265  * @param osip The element to work on.
266  */
267   int osip_nict_unlock (osip_t * osip);
268 /**
269  * Lock access to the list of nist transactions.
270  * NOTE: THIS IS AN INTERNAL METHOD ONLY
271  * @param osip The element to work on.
272  */
273   int osip_nist_lock (osip_t * osip);
274 /**
275  * Unlock access to the list of nist transactions.
276  * NOTE: THIS IS AN INTERNAL METHOD ONLY
277  * @param osip The element to work on.
278  */
279   int osip_nist_unlock (osip_t * osip);
280
281 /**
282  * Add a ict transaction in the ict list of transaction.
283  * NOTE: THIS IS AN INTERNAL METHOD ONLY
284  * @param osip The element to work on.
285  * @param ict The transaction to add.
286  */
287   int __osip_add_ict (osip_t * osip, osip_transaction_t * ict);
288 /**
289  * Add a ist transaction in the ist list of transaction.
290  * NOTE: THIS IS AN INTERNAL METHOD ONLY
291  * @param osip The element to work on.
292  * @param ist The transaction to add.
293  */
294   int __osip_add_ist (osip_t * osip, osip_transaction_t * ist);
295 /**
296  * Add a nict transaction in the nict list of transaction.
297  * NOTE: THIS IS AN INTERNAL METHOD ONLY
298  * @param osip The element to work on.
299  * @param nict The transaction to add.
300  */
301   int __osip_add_nict (osip_t * osip, osip_transaction_t * nict);
302 /**
303  * Add a nist transaction in the nist list of transaction.
304  * NOTE: THIS IS AN INTERNAL METHOD ONLY
305  * @param osip The element to work on.
306  * @param nist The transaction to add.
307  */
308   int __osip_add_nist (osip_t * osip, osip_transaction_t * nist);
309
310 /**
311  * Remove a ict transaction from the ict list of transaction.
312  * @param osip The element to work on.
313  * @param ict The transaction to add.
314  */
315   int __osip_remove_ict_transaction (osip_t * osip, osip_transaction_t * ict);
316 /**
317  * Remove a ist transaction from the ist list of transaction.
318  * @param osip The element to work on.
319  * @param ist The transaction to add.
320  */
321   int __osip_remove_ist_transaction (osip_t * osip, osip_transaction_t * ist);
322 /**
323  * Remove a nict transaction from the nict list of transaction.
324  * @param osip The element to work on.
325  * @param nict The transaction to add.
326  */
327   int __osip_remove_nict_transaction (osip_t * osip,
328                                       osip_transaction_t * nict);
329 /**
330  * Remove a nist transaction from the nist list of transaction.
331  * @param osip The element to work on.
332  * @param nist The transaction to add.
333  */
334   int __osip_remove_nist_transaction (osip_t * osip,
335                                       osip_transaction_t * nist);
336
337 /**
338  * Allocate a sipevent.
339  * NOTE: THIS IS AN INTERNAL METHOD ONLY
340  * @param type The type of the event.
341  * @param transactionid The transaction id for this event.
342  */
343   osip_event_t *__osip_event_new (type_t type, int transactionid);
344
345
346 /**
347  * Allocate a sipevent (we know this message is an OUTGOING SIP message).
348  * @param sip The SIP message we want to send.
349  */
350   osip_event_t *osip_new_outgoing_sipmessage (osip_message_t * sip);
351
352 #ifdef __cplusplus
353 }
354 #endif
355
356 #endif