New test.
[mono.git] / mono / io-layer / sockets.h
1 /*
2  * sockets.h:  Socket handles
3  *
4  * Author:
5  *      Dick Porter (dick@ximian.com)
6  *
7  * (C) 2002 Ximian, Inc.
8  */
9
10 #ifndef _WAPI_SOCKETS_H_
11 #define _WAPI_SOCKETS_H_
12
13 #include <sys/types.h>
14 #include <sys/socket.h>
15 #include <sys/ioctl.h>
16 #include <netinet/in.h>
17 #include <netinet/tcp.h>
18 #include <netdb.h>
19 #include <arpa/inet.h>
20
21 #include "mono/io-layer/wapi.h"
22
23 G_BEGIN_DECLS
24
25 #define WSADESCRIPTION_LEN 256
26 #define WSASYS_STATUS_LEN 128
27
28 typedef struct 
29 {
30         guint16 wVersion;
31         guint16 wHighVersion;
32         char szDescription[WSADESCRIPTION_LEN+1];
33         char szSystemStatus[WSASYS_STATUS_LEN+1];
34         guint16 iMaxSockets;
35         guint16 iMaxUdpDg;
36         guchar *lpVendorInfo;
37 } WapiWSAData;
38
39 #define INVALID_SOCKET (guint32)(~0)
40 #define SOCKET_ERROR -1
41
42 extern int WSAStartup(guint32 requested, WapiWSAData *data);
43 extern int WSACleanup(void);
44 extern void WSASetLastError(int error);
45 extern int WSAGetLastError(void);
46 extern int closesocket(guint32 handle);
47
48 extern int ioctlsocket(guint32 handle, gint32 command, gpointer arg);
49 extern int WSAIoctl (guint32 handle, gint32 command,
50                      gchar *input, gint i_len,
51                      gchar *output, gint o_len, glong *written,
52                      void *unused1, void *unused2);
53
54 G_END_DECLS
55 #endif /* _WAPI_SOCKETS_H_ */