2 * This file is part of the Nice GLib ICE library.
4 * (C) 2008-2009 Collabora Ltd.
5 * Contact: Youness Alaoui
6 * (C) 2007-2009 Nokia Corporation. All rights reserved.
7 * Contact: Kai Vehmanen
9 * The contents of this file are subject to the Mozilla Public License Version
10 * 1.1 (the "License"); you may not use this file except in compliance with
11 * the License. You may obtain a copy of the License at
12 * http://www.mozilla.org/MPL/
14 * Software distributed under the License is distributed on an "AS IS" basis,
15 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
16 * for the specific language governing rights and limitations under the
19 * The Original Code is the Nice GLib ICE library.
21 * The Initial Developers of the Original Code are Collabora Ltd and Nokia
22 * Corporation. All Rights Reserved.
25 * Youness Alaoui, Collabora Ltd.
28 * Alternatively, the contents of this file may be used under the terms of the
29 * the GNU Lesser General Public License Version 2.1 (the "LGPL"), in which
30 * case the provisions of LGPL are applicable instead of those above. If you
31 * wish to allow use of your version of this file only under the terms of the
32 * LGPL and not to allow others to use your version of this file under the
33 * MPL, indicate your decision by deleting the provisions above and replace
34 * them with the notice and other provisions required by the LGPL. If you do
35 * not delete the provisions above, a recipient may use your version of this
36 * file under either the MPL or the LGPL.
39 #ifndef _NICE_DISCOVERY_H
40 #define _NICE_DISCOVERY_H
42 /* note: this is a private header to libnice */
49 NiceAgent
*agent
; /**< back pointer to owner */
50 NiceCandidateType type
; /**< candidate type STUN or TURN */
51 NiceSocket
*nicesock
; /**< XXX: should be taken from local cand: existing socket to use */
52 NiceAddress server
; /**< STUN/TURN server address */
53 GTimeVal next_tick
; /**< next tick timestamp */
54 gboolean pending
; /**< is discovery in progress? */
55 gboolean done
; /**< is discovery complete? */
60 uint8_t *msn_turn_username
;
61 uint8_t *msn_turn_password
;
63 uint8_t stun_buffer
[STUN_MAX_MESSAGE_SIZE
];
64 StunMessage stun_message
;
65 uint8_t stun_resp_buffer
[STUN_MAX_MESSAGE_SIZE
];
66 StunMessage stun_resp_msg
;
71 NiceAgent
*agent
; /**< back pointer to owner */
72 NiceSocket
*nicesock
; /**< existing socket to use */
73 NiceSocket
*relay_socket
; /**< relay socket from which we receive */
74 NiceAddress server
; /**< STUN/TURN server address */
79 GSource
*timer_source
;
81 uint8_t *msn_turn_username
;
82 uint8_t *msn_turn_password
;
84 uint8_t stun_buffer
[STUN_MAX_MESSAGE_SIZE
];
85 StunMessage stun_message
;
86 uint8_t stun_resp_buffer
[STUN_MAX_MESSAGE_SIZE
];
87 StunMessage stun_resp_msg
;
90 void refresh_free_item (gpointer data
, gpointer user_data
);
91 void refresh_free (NiceAgent
*agent
);
92 void refresh_prune_stream (NiceAgent
*agent
, guint stream_id
);
93 void refresh_cancel (CandidateRefresh
*refresh
);
96 void discovery_free_item (gpointer data
, gpointer user_data
);
97 void discovery_free (NiceAgent
*agent
);
98 void discovery_prune_stream (NiceAgent
*agent
, guint stream_id
);
99 void discovery_schedule (NiceAgent
*agent
);
102 discovery_add_local_host_candidate (
106 NiceAddress
*address
);
109 discovery_add_relay_candidate (
113 NiceAddress
*address
,
114 NiceSocket
*base_socket
,
118 discovery_add_server_reflexive_candidate (
122 NiceAddress
*address
,
123 NiceSocket
*base_socket
);
126 discovery_add_peer_reflexive_candidate (
130 NiceAddress
*address
,
131 NiceSocket
*base_socket
,
132 NiceCandidate
*local
,
133 NiceCandidate
*remote
);
136 discovery_learn_remote_peer_reflexive_candidate (
139 Component
*component
,
141 const NiceAddress
*remote_address
,
142 NiceSocket
*udp_socket
,
143 NiceCandidate
*local
,
144 NiceCandidate
*remote
);
146 #endif /*_NICE_CONNCHECK_H */