new error tests
[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 #define WSADESCRIPTION_LEN 256
24 #define WSASYS_STATUS_LEN 128
25
26 typedef struct 
27 {
28         guint16 wVersion;
29         guint16 wHighVersion;
30         char szDescription[WSADESCRIPTION_LEN+1];
31         char szSystemStatus[WSASYS_STATUS_LEN+1];
32         guint16 iMaxSockets;
33         guint16 iMaxUdpDg;
34         guchar *lpVendorInfo;
35 } WapiWSAData;
36
37 #define INVALID_SOCKET (guint32)(~0)
38 #define SOCKET_ERROR -1
39
40 extern int WSAStartup(guint32 requested, WapiWSAData *data);
41 extern int WSACleanup(void);
42 extern void WSASetLastError(int error);
43 extern int WSAGetLastError(void);
44 extern int closesocket(guint32 handle);
45
46 extern int ioctlsocket(guint32 handle, gint32 command, gpointer arg);
47 extern int WSAIoctl (guint32 handle, gint32 command,
48                      gchar *input, gint i_len,
49                      gchar *output, gint o_len, glong *written,
50                      void *unused1, void *unused2);
51
52 #endif /* _WAPI_SOCKETS_H_ */