Find and document every message attribute/error code and from which RFC/Draft they...
[sipe-libnice.git] / socket / socket.h
blobbb7cfc2eb9a1413cfccd82ec56df2f272cfa1c89
1 /*
2 * This file is part of the Nice GLib ICE library.
4 * (C) 2006, 2007 Collabora Ltd.
5 * Contact: Dafydd Harries
6 * (C) 2006, 2007 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
17 * License.
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.
24 * Contributors:
25 * Dafydd Harries, Collabora Ltd.
27 * Alternatively, the contents of this file may be used under the terms of the
28 * the GNU Lesser General Public License Version 2.1 (the "LGPL"), in which
29 * case the provisions of LGPL are applicable instead of those above. If you
30 * wish to allow use of your version of this file only under the terms of the
31 * LGPL and not to allow others to use your version of this file under the
32 * MPL, indicate your decision by deleting the provisions above and replace
33 * them with the notice and other provisions required by the LGPL. If you do
34 * not delete the provisions above, a recipient may use your version of this
35 * file under either the MPL or the LGPL.
38 #ifndef _SOCKET_H
39 #define _SOCKET_H
41 #include "address.h"
43 #ifdef G_OS_WIN32
44 #include <winsock2.h>
45 #include <ws2tcpip.h>
46 #else
47 #include <sys/types.h>
48 #include <sys/socket.h>
49 #include <netinet/in.h>
50 #include <arpa/inet.h>
51 #endif
53 G_BEGIN_DECLS
55 typedef struct _NiceSocket NiceSocket;
57 struct _NiceSocket
59 NiceAddress addr;
60 guint fileno;
61 gint (*recv) (NiceSocket *sock, NiceAddress *from, guint len,
62 gchar *buf);
63 gboolean (*send) (NiceSocket *sock, const NiceAddress *to, guint len,
64 const gchar *buf);
65 gboolean (*is_reliable) (NiceSocket *sock);
66 void (*close) (NiceSocket *sock);
67 void *priv;
70 G_GNUC_WARN_UNUSED_RESULT
71 gint
72 nice_socket_recv (NiceSocket *sock, NiceAddress *from, guint len, gchar *buf);
74 gboolean
75 nice_socket_send (NiceSocket *sock, const NiceAddress *to,
76 guint len, const gchar *buf);
78 gboolean
79 nice_socket_is_reliable (NiceSocket *sock);
82 void
83 nice_socket_free (NiceSocket *sock);
85 #include "udp-bsd.h"
86 #include "tcp-bsd.h"
87 #include "pseudossl.h"
88 #include "socks5.h"
89 #include "http.h"
90 #include "turn.h"
91 #include "tcp-turn.h"
93 G_END_DECLS
95 #endif /* _SOCKET_H */