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  * vxWorks specific socket include
11  */
12 
13 #ifndef osdSockH
14 #define osdSockH
15 
16 /* This is needed for vxWorks 6.8 to prevent an obnoxious compiler warning */
17 #ifndef _VSB_CONFIG_FILE
18 # define _VSB_CONFIG_FILE <../lib/h/config/vsbConfig.h>
19 #endif
20 
21 #include <errno.h>
22 
23 #include <sys/types.h>
24 #include <sys/times.h>
25 #include <sys/socket.h>
26 #include <sockLib.h>
27 #include <ioLib.h>
28 #include <sys/ioctl.h>
29 #include <netinet/in.h>
30 #include <netinet/tcp.h>
31 #include <arpa/inet.h>
32 #include <net/if.h>
33 #include <ioLib.h>
34 #include <hostLib.h>
35 #include <selectLib.h>
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
41 /*This following is not defined in any vxWorks header files*/
42 int sysClkRateGet(void);
43 
44 #ifdef __cplusplus
45 }
46 #endif
47 
48 typedef int SOCKET;
49 #define INVALID_SOCKET (-1)
50 #define SOCKERRNO errno
51 #ifndef SHUT_RD
52 # define SHUT_RD 0
53 #endif
54 #ifndef SHUT_WR
55 # define SHUT_WR 1
56 #endif
57 #ifndef SHUT_RDWR
58 # define SHUT_RDWR 2
59 #endif
60 
61 /*
62  * it is quite lame on WRS's part to assume that
63  * a ptr is always the same as an int
64  */
65 #define socket_ioctl(A,B,C) ioctl(A,B,(int)C)
66 typedef int osiSockIoctl_t;
67 typedef int osiSocklen_t;
68 typedef char osiSockOptMcastLoop_t;
69 typedef char osiSockOptMcastTTL_t;
70 
71 #define FD_IN_FDSET(FD) ((FD)<FD_SETSIZE&&(FD)>=0)
72 
73 #define SOCK_EWOULDBLOCK EWOULDBLOCK
74 #define SOCK_ENOBUFS ENOBUFS
75 #define SOCK_ECONNRESET ECONNRESET
76 #define SOCK_ETIMEDOUT ETIMEDOUT
77 #define SOCK_EACCES EACCES
78 #define SOCK_EADDRINUSE EADDRINUSE
79 #define SOCK_EADDRNOTAVAIL EADDRNOTAVAIL
80 #define SOCK_ECONNREFUSED ECONNREFUSED
81 #define SOCK_ECONNABORTED ECONNABORTED
82 #define SOCK_EINPROGRESS EINPROGRESS
83 #define SOCK_EISCONN EISCONN
84 #define SOCK_EALREADY EALREADY
85 #define SOCK_EINVAL EINVAL
86 #define SOCK_EINTR EINTR
87 #define SOCK_EPIPE EPIPE
88 #define SOCK_EMFILE EMFILE
89 #define SOCK_SHUTDOWN ESHUTDOWN
90 #define SOCK_ENOTSOCK ENOTSOCK
91 #define SOCK_EBADF EBADF
92 
93 #ifndef INADDR_LOOPBACK
94 #define INADDR_LOOPBACK 0x7F000001
95 #endif
96 
97 #ifndef INADDR_NONE
98 # define INADDR_NONE (0xffffffff)
99 #endif
100 
101 #if defined(_SIZEOF_ADDR_IFREQ)
102 # define ifreq_size(pifreq) _SIZEOF_ADDR_IFREQ(*pifreq)
103 #elif ( defined (BSD) && ( BSD >= 44 ) )
104 # define ifreq_size(pifreq) (pifreq->ifr_addr.sa_len + sizeof(pifreq->ifr_name))
105 #else
106 # define ifreq_size(pifreq) sizeof(*pifreq)
107 #endif
108 
109 #endif /*osdSockH*/
int osiSocklen_t
Definition: osdSock.h:36
int osiSockOptMcastLoop_t
Definition: osdSock.h:37
int osiSockIoctl_t
Definition: osdSock.h:35
int SOCKET
Definition: osdSock.h:31
int sysClkRateGet(void)
int osiSockOptMcastTTL_t
Definition: osdSock.h:38