summaryrefslogtreecommitdiff
path: root/PACE/pace/sys/socket.h
blob: 4c06359460e246dd1f7423839fa0174abfddb85f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
/* $Id$

 * ============================================================================
 *
 * = LIBRARY
 *    pace
 *
 * = FILENAME
 *    pace/sys/socket.h
 *
 * = AUTHOR
 *    Luther Baker
 *
 * ============================================================================ */

#ifndef PACE_SOCKET_H
#define PACE_SOCKET_H

#include "pace/config/defines.h"

#if (PACE_HAS_POSIX)
# include "pace/posix/socket.h"
#elif (PACE_VXWORKS)
# include "pace/vxworks/socket.h"
#elif (PACE_WIN32)
# include "pace/win32/socket.h"
#endif

#if defined (PACE_HAS_CPLUSPLUS)
extern "C" {
#endif /* PACE_HAS_CPLUSPLUS */

/**
   PACE's implementation of the POSIX function accept.
   See IEEE Standards Project Approved 30 January 2000.
   (IEEE Std P1003.1g, D6.6, March 1997 Edition)
*/
#if (PACE_HAS_POSIX_SOCK_UOF)
    PACE_INLINE int pace_accept (int s,
                                 pace_sockaddr * socketaddress,
                                 pace_socklen_t * addresslen);
#endif /* PACE_HAS_POSIX_SOCK_UOF */

/**
   PACE's implementation of the POSIX function bind.
   See IEEE Standards Project Approved 30 January 2000.
   (IEEE Std P1003.1g, D6.6, March 1997 Edition)
*/
#if (PACE_HAS_POSIX_SOCK_UOF)
    PACE_INLINE int pace_bind (int s,
                               const pace_sockaddr * socketaddress,
                               pace_socklen_t addresslen);
#endif /* PACE_HAS_POSIX_SOCK_UOF */

/**
   PACE's implementation of the POSIX function connect.
   See IEEE Standards Project Approved 30 January 2000.
   (IEEE Std P1003.1g, D6.6, March 1997 Edition)
*/
#if (PACE_HAS_POSIX_SOCK_UOF)
    PACE_INLINE int pace_connect (int s,
                                  const pace_sockaddr * socketaddress,
                                  pace_socklen_t addresslen);
#endif /* PACE_HAS_POSIX_SOCK_UOF */

/**
   PACE's implementation of the POSIX function getpeername.
   See IEEE Standards Project Approved 30 January 2000.
   (IEEE Std P1003.1g, D6.6, March 1997 Edition)
*/
#if (PACE_HAS_POSIX_SOCK_UOF)
    PACE_INLINE int pace_getpeername (int s,
                                      pace_sockaddr * socketaddress,
                                      pace_socklen_t * addresslen);
#endif /* PACE_HAS_POSIX_SOCK_UOF */

/**
   PACE's implementation of the POSIX function getsockname.
   See IEEE Standards Project Approved 30 January 2000.
   (IEEE Std P1003.1g, D6.6, March 1997 Edition)
*/
#if (PACE_HAS_POSIX_SOCK_UOF)
    PACE_INLINE int pace_getsockname (int s,
                                      pace_sockaddr * socketaddress,
                                      pace_socklen_t * addresslen);
#endif /* PACE_HAS_POSIX_SOCK_UOF */

/**
   PACE's implementation of the POSIX function getsockopt.
   See IEEE Standards Project Approved 30 January 2000.
   (IEEE Std P1003.1g, D6.6, March 1997 Edition)
*/
#if (PACE_HAS_POSIX_SOCK_UOF)
    PACE_INLINE int pace_getsockopt (int s,
                                     int level,
                                     int optname,
                                     void * optval,
                                     pace_socklen_t optlen);
#endif /* PACE_HAS_POSIX_SOCK_UOF */

/**
   PACE's implementation of the POSIX function setsockopt.
   See IEEE Standards Project Approved 30 January 2000.
   (IEEE Std P1003.1g, D6.6, March 1997 Edition)
*/
#if (PACE_HAS_POSIX_SOCK_UOF)
    PACE_INLINE int pace_setsockopt (int s,
                                     int level,
                                     int optname,
                                     const * optval);
#endif /* PACE_HAS_POSIX_SOCK_UOF */

/**
   PACE's implementation of the POSIX function isfdtype.
   See IEEE Standards Project Approved 30 January 2000.
   (IEEE Std P1003.1g, D6.6, March 1997 Edition)
*/
#if (PACE_HAS_POSIX_SOCK_UOF)
    PACE_INLINE int pace_isfdtype (int fildes, int fdtype);
#endif /* PACE_HAS_POSIX_SOCK_UOF */

/**
   PACE's implementation of the POSIX function listen.
   See IEEE Standards Project Approved 30 January 2000.
   (IEEE Std P1003.1g, D6.6, March 1997 Edition)
*/
#if (PACE_HAS_POSIX_SOCK_UOF)
    PACE_INLINE int pace_listen (int s, int backlog);
#endif /* PACE_HAS_POSIX_SOCK_UOF */

/**
   PACE's implementation of the POSIX function recv.
   See IEEE Standards Project Approved 30 January 2000.
   (IEEE Std P1003.1g, D6.6, March 1997 Edition)
*/
#if (PACE_HAS_POSIX_SOCK_UOF)
    PACE_INLINE pace_ssize_t pace_recv (int s,
                                        void * buf,
                                        pace_size_t len,
                                        int flags);
#endif /* PACE_HAS_POSIX_SOCK_UOF */

/**
   PACE's implementation of the POSIX function recvfrom.
   See IEEE Standards Project Approved 30 January 2000.
   (IEEE Std P1003.1g, D6.6, March 1997 Edition)
*/
#if (PACE_HAS_POSIX_SOCK_UOF)
    PACE_INLINE pace_ssize_t pace_recvfrom (int s,
                                            void * buf,
                                            pace_size_t len,
                                            int flags,
                                            pace_sockaddr * from,
                                            pace_socklen_t * fromlen);
#endif /* PACE_HAS_POSIX_SOCK_UOF */

/**
   PACE's implementation of the POSIX function recvmsg.
   See IEEE Standards Project Approved 30 January 2000.
   (IEEE Std P1003.1g, D6.6, March 1997 Edition)
*/
#if (PACE_HAS_POSIX_SOCK_UOF)
    PACE_INLINE pace_ssize_t pace_rcvmsg (int s,
                                          pace_msghdr * msg,
                                          int flags);
#endif /* PACE_HAS_POSIX_SOCK_UOF */

/**
   PACE's implementation of the POSIX function send.
   See IEEE Standards Project Approved 30 January 2000.
   (IEEE Std P1003.1g, D6.6, March 1997 Edition)
*/
#if (PACE_HAS_POSIX_SOCK_UOF)
    PACE_INLINE pace_ssize_t pace_send (int s,
                                        const void * buf,
                                        pace_size_t len,
                                        int flags);
#endif /* PACE_HAS_POSIX_SOCK_UOF */

/**
   PACE's implementation of the POSIX function sendto.
   See IEEE Standards Project Approved 30 January 2000.
   (IEEE Std P1003.1g, D6.6, March 1997 Edition)
*/
#if (PACE_HAS_POSIX_SOCK_UOF)
    PACE_INLINE pace_ssize_t pace_sendto (int s,
                                          const void * buf,
                                          pace_size_t len,
                                          int flags,
                                          const pace_sockaddr * to,
                                          pace_socklen_t * tolen);
#endif /* PACE_HAS_POSIX_SOCK_UOF */

/**
   PACE's implementation of the POSIX function sendmsg.
   See IEEE Standards Project Approved 30 January 2000.
   (IEEE Std P1003.1g, D6.6, March 1997 Edition)
*/
#if (PACE_HAS_POSIX_SOCK_UOF)
    PACE_INLINE pace_ssize_t pace_sendmsg (int s,
                                           const pace_msghdr * msg,
                                           int flags);
#endif /* PACE_HAS_POSIX_SOCK_UOF */

/**
   PACE's implementation of the POSIX function shutdown.
   See IEEE Standards Project Approved 30 January 2000.
   (IEEE Std P1003.1g, D6.6, March 1997 Edition)
*/
#if (PACE_HAS_POSIX_SOCK_UOF)
    PACE_INLINE int pace_shutdown (int s, int how);
#endif /* PACE_HAS_POSIX_SOCK_UOF */

/**
   PACE's implementation of the POSIX function socket.
   See IEEE Standards Project Approved 30 January 2000.
   (IEEE Std P1003.1g, D6.6, March 1997 Edition)
*/
#if (PACE_HAS_POSIX_SOCK_UOF)
    PACE_INLINE int pace_socket (int protofamily, int type, int protocol);
#endif /* PACE_HAS_POSIX_SOCK_UOF */
    
/**
   PACE's implementation of the POSIX function socketpair.
   See IEEE Standards Project Approved 30 January 2000.
   (IEEE Std P1003.1g, D6.6, March 1997 Edition)
*/
#if (PACE_HAS_POSIX_SOCK_UOF)
    PACE_INLINE int pace_socketpair (int protofamily,
                                     int type,
                                     int protocol,
                                     int sv[2]);
#endif /* PACE_HAS_POSIX_SOCK_UOF */
    
#if defined (PACE_HAS_INLINE)
#  if (PACE_HAS_POSIX)
#    include "pace/posix/socket.inl"
#  elif (PACE_VXWORKS)
#    include "pace/vxworks/socket.inl"
#  elif (PACE_WIN32)
#    include "pace/win32/socket.inl"
#  endif
#endif /* PACE_HAS_INLINE */

#if defined (PACE_HAS_CPLUSPLUS)
}
#endif /* PACE_HAS_CPLUSPLUS */

#endif /* PACE_SOCKET_H */