This is Unofficial EPICS BASE Doxygen Site
osdSock.h
Go to the documentation of this file.
1 /*************************************************************************\
2 * Copyright (c) 2002 The University of Chicago, as Operator of Argonne
3 * National Laboratory.
4 * Copyright (c) 2002 The Regents of the University of California, as
5 * Operator of Los Alamos National Laboratory.
6 * EPICS BASE is distributed subject to a Software License Agreement found
7 * in file LICENSE that is included with this distribution.
8 \*************************************************************************/
9 
10 #ifndef osdSockH
11 #define osdSockH
12 
13 #include <time.h>
14 #include <errno.h>
15 
16 /*
17  * winsock2.h changes the structure alignment to 4 if
18  * WIN32 isnt set which can be a source of confusion
19  */
20 #ifndef WIN32
21 # define WIN32
22 #endif
23 #include <winsock2.h>
24 #include <ws2tcpip.h>
25 
26 #define SOCKERRNO WSAGetLastError()
27 
28 #define socket_ioctl(A,B,C) ioctlsocket(A,B,C)
29 typedef u_long FAR osiSockIoctl_t;
30 typedef int osiSocklen_t;
31 typedef BOOL osiSockOptMcastLoop_t;
32 typedef DWORD osiSockOptMcastTTL_t;
33 
34 #ifndef SHUT_RD
35 # define SHUT_RD SD_RECEIVE
36 #endif
37 
38 #ifndef SHUT_WR
39 # define SHUT_WR SD_SEND
40 #endif
41 
42 #ifndef SHUT_RDWR
43 # define SHUT_RDWR SD_BOTH
44 #endif
45 
46 #define MAXHOSTNAMELEN 75
47 #define IPPORT_USERRESERVED 5000U
48 
49 #define SOCK_EWOULDBLOCK WSAEWOULDBLOCK
50 #define SOCK_ENOBUFS WSAENOBUFS
51 #define SOCK_ECONNRESET WSAECONNRESET
52 #define SOCK_ETIMEDOUT WSAETIMEDOUT
53 #define SOCK_EACCES WSAEACCES
54 #define SOCK_EADDRINUSE WSAEADDRINUSE
55 #define SOCK_EADDRNOTAVAIL WSAEADDRNOTAVAIL
56 #define SOCK_ECONNREFUSED WSAECONNREFUSED
57 #define SOCK_ECONNABORTED WSAECONNABORTED
58 #define SOCK_EINPROGRESS WSAEINPROGRESS
59 #define SOCK_EISCONN WSAEISCONN
60 #define SOCK_EALREADY WSAEALREADY
61 #define SOCK_EINVAL WSAEINVAL
62 #define SOCK_EINTR WSAEINTR
63 #define SOCK_EPIPE EPIPE
64 #define SOCK_EMFILE WSAEMFILE
65 #define SOCK_SHUTDOWN WSAESHUTDOWN
66 #define SOCK_ENOTSOCK WSAENOTSOCK
67 #define SOCK_EBADF WSAENOTSOCK
68 
69 /*
70  * Under WIN32, FD_SETSIZE is the max. number of sockets,
71  * not the max. fd value that you use in select().
72  *
73  * Therefore, it is difficult to detemine if any given
74  * fd can be used with FD_SET(), FD_CLR(), and FD_ISSET().
75  */
76 #define FD_IN_FDSET(FD) (1)
77 
78 #ifdef __cplusplus
79 extern "C" {
80 #endif
81 
82 LIBCOM_API unsigned epicsStdCall wsaMajorVersion ();
83 
84 #ifdef __cplusplus
85 }
86 #endif /*__cplusplus*/
87 
88 #endif /*osdSockH*/
int osiSocklen_t
Definition: osdSock.h:36
LIBCOM_API unsigned epicsStdCall wsaMajorVersion()
Definition: osdSock.c:41
int osiSockOptMcastLoop_t
Definition: osdSock.h:37
int osiSockIoctl_t
Definition: osdSock.h:35
int osiSockOptMcastTTL_t
Definition: osdSock.h:38