This is Unofficial EPICS BASE Doxygen Site
osdSock.h
Go to the documentation of this file.
1 /*************************************************************************\
2 * Copyright (c) 2006 UChicago Argonne LLC, 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 <errno.h>
14 
15 #include <sys/types.h>
16 #include <sys/param.h> /* for MAXHOSTNAMELEN */
17 #include <sys/time.h>
18 #include <sys/socket.h>
19 #include <sys/ioctl.h>
20 #include <netinet/in.h>
21 #include <netinet/tcp.h>
22 #include <arpa/inet.h>
23 #include <net/if.h>
24 #include <netdb.h>
25 #include <unistd.h> /* close() and others */
26 
27 
28 #ifndef IPPORT_USERRESERVED
29 #define IPPORT_USERRESERVED 5000
30 #endif
31 
32 
33 typedef int SOCKET;
34 #define INVALID_SOCKET (-1)
35 #define SOCKERRNO errno
36 #define socket_ioctl(A,B,C) ioctl(A,B,C)
37 typedef int osiSockIoctl_t;
38 typedef socklen_t osiSocklen_t;
40 typedef unsigned char osiSockOptMcastTTL_t;
41 
42 #define FD_IN_FDSET(FD) ((FD)<FD_SETSIZE)
43 
44 #define SOCK_EWOULDBLOCK EWOULDBLOCK
45 #define SOCK_ENOBUFS ENOBUFS
46 #define SOCK_ECONNRESET ECONNRESET
47 #define SOCK_ETIMEDOUT ETIMEDOUT
48 #define SOCK_EACCES EACCES
49 #define SOCK_EADDRINUSE EADDRINUSE
50 #define SOCK_EADDRNOTAVAIL EADDRNOTAVAIL
51 #define SOCK_ECONNREFUSED ECONNREFUSED
52 #define SOCK_ECONNABORTED ECONNABORTED
53 #define SOCK_EINPROGRESS EINPROGRESS
54 #define SOCK_EISCONN EISCONN
55 #define SOCK_EALREADY EALREADY
56 #define SOCK_EINVAL EINVAL
57 #define SOCK_EINTR EINTR
58 #define SOCK_EPIPE EPIPE
59 #define SOCK_EMFILE EMFILE
60 #define SOCK_SHUTDOWN ESHUTDOWN
61 #define SOCK_ENOTSOCK ENOTSOCK
62 #define SOCK_EBADF EBADF
63 
64 #ifndef SHUT_RD
65 # define SHUT_RD 0
66 #endif
67 
68 #ifndef SHUT_WR
69 # define SHUT_WR 1
70 #endif
71 
72 #ifndef SHUT_RDWR
73 # define SHUT_RDWR 2
74 #endif
75 
76 #if BSD4_4
77 # define ifreq_size(pifreq) (pifreq->ifr_addr.sa_len + sizeof(pifreq->ifr_name))
78 #else
79 # define ifreq_size(pifreq) sizeof(*pifreq)
80 #endif
81 
82 #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 osiSockOptMcastTTL_t
Definition: osdSock.h:38