|
1 /* |
|
2 Copyright (c) 2007, Adobe Systems, Incorporated |
|
3 All rights reserved. |
|
4 |
|
5 Redistribution and use in source and binary forms, with or without |
|
6 modification, are permitted provided that the following conditions are |
|
7 met: |
|
8 |
|
9 * Redistributions of source code must retain the above copyright |
|
10 notice, this list of conditions and the following disclaimer. |
|
11 |
|
12 * Redistributions in binary form must reproduce the above copyright |
|
13 notice, this list of conditions and the following disclaimer in the |
|
14 documentation and/or other materials provided with the distribution. |
|
15 |
|
16 * Neither the name of Adobe Systems, Network Resonance nor the names of its |
|
17 contributors may be used to endorse or promote products derived from |
|
18 this software without specific prior written permission. |
|
19 |
|
20 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
|
21 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
|
22 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
|
23 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
|
24 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
|
25 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
|
26 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
|
27 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
|
28 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
|
29 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
|
30 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
31 */ |
|
32 |
|
33 |
|
34 |
|
35 #ifndef _ice_h |
|
36 #define _ice_h |
|
37 #ifdef __cplusplus |
|
38 using namespace std; |
|
39 extern "C" { |
|
40 #endif /* __cplusplus */ |
|
41 |
|
42 typedef struct nr_ice_handler_vtbl_ { |
|
43 /* The checks on this media stream are done. The handler needs to |
|
44 select a single pair to proceed with (regular nomination). |
|
45 Once this returns the check starts and the pair can be |
|
46 written on. Use nr_ice_candidate_pair_select() to perform the |
|
47 selection. |
|
48 TODO: !ekr! is this right? |
|
49 */ |
|
50 int (*select_pair)(void *obj,nr_ice_media_stream *stream, |
|
51 int component_id, nr_ice_cand_pair **potentials,int potential_ct); |
|
52 |
|
53 /* This media stream is ready to read/write (aggressive nomination). |
|
54 May be called again if the nominated pair changes due to |
|
55 ICE instability. TODO: !ekr! think about this |
|
56 */ |
|
57 int (*stream_ready)(void *obj, nr_ice_media_stream *stream); |
|
58 |
|
59 /* This media stream has failed */ |
|
60 int (*stream_failed)(void *obj, nr_ice_media_stream *stream); |
|
61 |
|
62 /* ICE is completed for this peer ctx |
|
63 if need_update is nonzero, a SIP update is required |
|
64 */ |
|
65 int (*ice_completed)(void *obj, nr_ice_peer_ctx *pctx); |
|
66 |
|
67 /* A message was delivered to us */ |
|
68 int (*msg_recvd)(void *obj, nr_ice_peer_ctx *pctx, nr_ice_media_stream *stream, int component_id, UCHAR *msg, int len); |
|
69 } nr_ice_handler_vtbl; |
|
70 |
|
71 typedef struct nr_ice_handler_ { |
|
72 void *obj; |
|
73 nr_ice_handler_vtbl *vtbl; |
|
74 } nr_ice_handler; |
|
75 |
|
76 #ifdef __cplusplus |
|
77 } |
|
78 #endif /* __cplusplus */ |
|
79 #endif |
|
80 |