Debian Codegraph @

modules/libcom/src/osi/os/RTEMS-score/osdSock.h

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