Fix a (possible) memory leak in nice_turn_socket_new and in a test
[sipe-libnice.git] / socket / turn.h
blob1b4df7b520d2390245bcaccea0c8934140eb240e
1 /*
2 * This file is part of the Nice GLib ICE library.
4 * (C) 2008 Collabora Ltd.
5 * Contact: Youness Alaoui
6 * (C) 2008 Nokia Corporation
8 * The contents of this file are subject to the Mozilla Public License Version
9 * 1.1 (the "License"); you may not use this file except in compliance with
10 * the License. You may obtain a copy of the License at
11 * http://www.mozilla.org/MPL/
13 * Software distributed under the License is distributed on an "AS IS" basis,
14 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
15 * for the specific language governing rights and limitations under the
16 * License.
18 * The Original Code is the Nice GLib ICE library.
20 * The Initial Developers of the Original Code are Collabora Ltd and Nokia
21 * Corporation. All Rights Reserved.
23 * Contributors:
24 * Youness Alaoui, Collabora Ltd.
26 * Alternatively, the contents of this file may be used under the terms of the
27 * the GNU Lesser General Public License Version 2.1 (the "LGPL"), in which
28 * case the provisions of LGPL are applicable instead of those above. If you
29 * wish to allow use of your version of this file only under the terms of the
30 * LGPL and not to allow others to use your version of this file under the
31 * MPL, indicate your decision by deleting the provisions above and replace
32 * them with the notice and other provisions required by the LGPL. If you do
33 * not delete the provisions above, a recipient may use your version of this
34 * file under either the MPL or the LGPL.
37 #ifndef _TURN_H
38 #define _TURN_H
41 typedef enum {
42 NICE_TURN_SOCKET_COMPATIBILITY_DRAFT9,
43 NICE_TURN_SOCKET_COMPATIBILITY_GOOGLE,
44 NICE_TURN_SOCKET_COMPATIBILITY_MSN,
45 NICE_TURN_SOCKET_COMPATIBILITY_OC2007,
46 NICE_TURN_SOCKET_COMPATIBILITY_RFC5766,
47 } NiceTurnSocketCompatibility;
49 #include "socket.h"
50 #include "agent.h"
51 #include "stun/stunmessage.h"
54 G_BEGIN_DECLS
56 gint
57 nice_turn_socket_parse_recv (NiceSocket *sock, NiceSocket **from_sock,
58 NiceAddress *from, guint len, gchar *buf,
59 NiceAddress *recv_from, gchar *recv_buf, guint recv_len);
61 gboolean
62 nice_turn_socket_set_peer (NiceSocket *sock, NiceAddress *peer);
64 NiceSocket *
65 nice_turn_socket_new (NiceAgent *agent, NiceAddress *addr,
66 NiceSocket *base_socket, NiceAddress *server_addr,
67 gchar *username, gchar *password, NiceTurnSocketCompatibility compatibility);
69 void
70 nice_turn_socket_set_ms_realm(NiceSocket *sock, StunMessage *msg);
72 void
73 nice_turn_socket_set_ms_connection_id (NiceSocket *sock, StunMessage *msg);
76 G_END_DECLS
78 #endif /* _TURN_H */