This is Unofficial EPICS BASE Doxygen Site
osdSock.h
Go to the documentation of this file.
1 /*************************************************************************\
2 * Copyright (c) 2002 The University of Saskatchewan
3 * EPICS BASE is distributed subject to a Software License Agreement found
4 * in file LICENSE that is included with this distribution.
5 \*************************************************************************/
6 /*
7  * RTEMS osdSock.h
8  * Author: W. Eric Norum
9  * eric@cls.usask.ca
10  * (306) 966-6055
11  */
12 #ifndef osdSockH
13 #define osdSockH
14 
15 #include <errno.h>
16 
17 #include <sys/types.h>
18 #include <sys/param.h>
19 #include <sys/time.h>
20 #include <sys/socket.h>
21 #include <sys/ioctl.h>
22 #include <netinet/in.h>
23 #include <netinet/tcp.h>
24 #include <arpa/inet.h>
25 #include <net/if.h>
26 #include <netdb.h>
27 #include <unistd.h>
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 int select(int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);
34 
35 #ifdef __cplusplus
36 }
37 #endif
38 
39 typedef int SOCKET;
40 #define INVALID_SOCKET (-1)
41 #define SOCKERRNO errno
42 #define socket_ioctl(A,B,C) ioctl(A,B,C)
43 typedef int osiSockIoctl_t;
44 typedef socklen_t osiSocklen_t;
45 typedef char osiSockOptMcastLoop_t;
46 typedef unsigned char osiSockOptMcastTTL_t;
47 
48 #define FD_IN_FDSET(FD) ((FD)<FD_SETSIZE)
49 
50 #define SOCK_EWOULDBLOCK EWOULDBLOCK
51 #define SOCK_ENOBUFS ENOBUFS
52 #define SOCK_ECONNRESET ECONNRESET
53 #define SOCK_ETIMEDOUT ETIMEDOUT
54 #define SOCK_EACCES EACCES
55 #define SOCK_EADDRINUSE EADDRINUSE
56 #define SOCK_EADDRNOTAVAIL EADDRNOTAVAIL
57 #define SOCK_ECONNREFUSED ECONNREFUSED
58 #define SOCK_ECONNABORTED ECONNABORTED
59 #define SOCK_EINPROGRESS EINPROGRESS
60 #define SOCK_EISCONN EISCONN
61 #define SOCK_EALREADY EALREADY
62 #define SOCK_EINVAL EINVAL
63 #define SOCK_EINTR EINTR
64 #define SOCK_EPIPE EPIPE
65 #define SOCK_EMFILE EMFILE
66 #define SOCK_SHUTDOWN EPIPE
67 #define SOCK_ENOTSOCK ENOTSOCK
68 #define SOCK_EBADF EBADF
69 
70 #define bzero(p,n) memset(p,0,n)
71 #include <sys/time.h>
72 #include <sys/types.h>
73 #include <unistd.h>
74 
75 #ifndef INADDR_LOOPBACK
76 #define INADDR_LOOPBACK (u_long)0x7F000001
77 #endif
78 
79 #ifndef INADDR_NONE
80 # define INADDR_NONE (0xffffffff)
81 #endif
82 
83 /*
84  * For shutdown()
85  */
86 #ifndef SHUT_RD
87 # define SHUT_RD 0
88 #endif
89 
90 #ifndef SHUT_WR
91 # define SHUT_WR 1
92 #endif
93 
94 #ifndef SHUT_RDWR
95 # define SHUT_RDWR 2
96 #endif
97 
98 /*
99  * Ensure that we get the right network code in default/osdNetIntf.c.
100  */
101 #define ifreq_size(pifreq) (pifreq->ifr_addr.sa_len + sizeof(pifreq->ifr_name))
102 
103 #endif /*osdSockH*/
double timeout
Definition: pvutils.cpp:25
int osiSocklen_t
Definition: osdSock.h:36
int osiSockOptMcastLoop_t
Definition: osdSock.h:37
int osiSockIoctl_t
Definition: osdSock.h:35
BSD and SRV5 Unix timestamp.
Definition: epicsTime.h:52
int SOCKET
Definition: osdSock.h:31
int select(int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout)
int osiSockOptMcastTTL_t
Definition: osdSock.h:38