1 #ifndef CLIB_BSDSOCKET_PROTOS_H
2 #define CLIB_BSDSOCKET_PROTOS_H
5 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
8 #include <aros/libcall.h>
10 #include <sys/select.h>
11 /* Stub macros for 'emulation' of some functions */
12 #define select(nfds,rfds,wfds,efds,timeout) WaitSelect(nfds,rfds,wfds,efds,timeout,NULL)
13 #define inet_ntoa(addr) Inet_NtoA(((struct in_addr)addr).s_addr)
15 AROS_LPA(int, domain
, D0
),
16 AROS_LPA(int, type
, D1
),
17 AROS_LPA(int, protocol
, D2
),
18 LIBBASETYPEPTR
, SocketBase
, 5, BSDSocket
22 AROS_LPA(struct sockaddr
*, name
, A0
),
23 AROS_LPA(int, namelen
, D1
),
24 LIBBASETYPEPTR
, SocketBase
, 6, BSDSocket
28 AROS_LPA(int, backlog
, D1
),
29 LIBBASETYPEPTR
, SocketBase
, 7, BSDSocket
33 AROS_LPA(struct sockaddr
*, addr
, A0
),
34 AROS_LPA(socklen_t
*, addrlen
, A1
),
35 LIBBASETYPEPTR
, SocketBase
, 8, BSDSocket
37 AROS_LP3(int, connect
,
39 AROS_LPA(struct sockaddr
*, name
, A0
),
40 AROS_LPA(int, namelen
, D1
),
41 LIBBASETYPEPTR
, SocketBase
, 9, BSDSocket
45 AROS_LPA(const void *, msg
, A0
),
46 AROS_LPA(int, len
, D1
),
47 AROS_LPA(int, flags
, D2
),
48 AROS_LPA(const struct sockaddr
*, to
, A1
),
49 AROS_LPA(int, tolen
, D3
),
50 LIBBASETYPEPTR
, SocketBase
, 10, BSDSocket
54 AROS_LPA(const void *, msg
, A0
),
55 AROS_LPA(int, len
, D1
),
56 AROS_LPA(int, flags
, D2
),
57 LIBBASETYPEPTR
, SocketBase
, 11, BSDSocket
59 AROS_LP6(int, recvfrom
,
61 AROS_LPA(void *, buf
, A0
),
62 AROS_LPA(int, len
, D1
),
63 AROS_LPA(int, flags
, D2
),
64 AROS_LPA(struct sockaddr
*, from
, A1
),
65 AROS_LPA(int *, fromlen
, A2
),
66 LIBBASETYPEPTR
, SocketBase
, 12, BSDSocket
70 AROS_LPA(void *, buf
, A0
),
71 AROS_LPA(int, len
, D1
),
72 AROS_LPA(int, flags
, D2
),
73 LIBBASETYPEPTR
, SocketBase
, 13, BSDSocket
75 AROS_LP2(int, shutdown
,
77 AROS_LPA(int, how
, D1
),
78 LIBBASETYPEPTR
, SocketBase
, 14, BSDSocket
80 AROS_LP5(int, setsockopt
,
82 AROS_LPA(int, level
, D1
),
83 AROS_LPA(int, optname
, D2
),
84 AROS_LPA(void *, optval
, A0
),
85 AROS_LPA(int, optlen
, D3
),
86 LIBBASETYPEPTR
, SocketBase
, 15, BSDSocket
88 AROS_LP5(int, getsockopt
,
90 AROS_LPA(int, level
, D1
),
91 AROS_LPA(int, optname
, D2
),
92 AROS_LPA(void *, optval
, A0
),
93 AROS_LPA(void *, optlen
, A1
),
94 LIBBASETYPEPTR
, SocketBase
, 16, BSDSocket
96 AROS_LP3(int, getsockname
,
98 AROS_LPA(struct sockaddr
*, name
, A0
),
99 AROS_LPA(int *, namelen
, A1
),
100 LIBBASETYPEPTR
, SocketBase
, 17, BSDSocket
102 AROS_LP3(int, getpeername
,
103 AROS_LPA(int, s
, D0
),
104 AROS_LPA(struct sockaddr
*, name
, A0
),
105 AROS_LPA(int *, namelen
, A1
),
106 LIBBASETYPEPTR
, SocketBase
, 18, BSDSocket
108 AROS_LP3(int, IoctlSocket
,
109 AROS_LPA(int, s
, D0
),
110 AROS_LPA(unsigned long, request
, D1
),
111 AROS_LPA(char *, argp
, A0
),
112 LIBBASETYPEPTR
, SocketBase
, 19, BSDSocket
114 AROS_LP1(int, CloseSocket
,
115 AROS_LPA(int, s
, D0
),
116 LIBBASETYPEPTR
, SocketBase
, 20, BSDSocket
118 AROS_LP6(int, WaitSelect
,
119 AROS_LPA(int, nfds
, D0
),
120 AROS_LPA(fd_set
*, readfds
, A0
),
121 AROS_LPA(fd_set
*, writefds
, A1
),
122 AROS_LPA(fd_set
*, exceptfds
, A2
),
123 AROS_LPA(struct timeval
*, timeout
, A3
),
124 AROS_LPA(ULONG
*, sigmask
, D1
),
125 LIBBASETYPEPTR
, SocketBase
, 21, BSDSocket
127 AROS_LP3(void, SetSocketSignals
,
128 AROS_LPA(ULONG
, intrmask
, D0
),
129 AROS_LPA(ULONG
, iomask
, D1
),
130 AROS_LPA(ULONG
, urgmask
, D2
),
131 LIBBASETYPEPTR
, SocketBase
, 22, BSDSocket
133 AROS_LP0(int, getdtablesize
,
134 LIBBASETYPEPTR
, SocketBase
, 23, BSDSocket
136 AROS_LP4(LONG
, ObtainSocket
,
137 AROS_LPA(LONG
, id
, D0
),
138 AROS_LPA(LONG
, domain
, D1
),
139 AROS_LPA(LONG
, type
, D2
),
140 AROS_LPA(LONG
, protocol
, D3
),
141 LIBBASETYPEPTR
, SocketBase
, 24, BSDSocket
143 AROS_LP2(LONG
, ReleaseSocket
,
144 AROS_LPA(LONG
, sd
, D0
),
145 AROS_LPA(LONG
, id
, D1
),
146 LIBBASETYPEPTR
, SocketBase
, 25, BSDSocket
148 AROS_LP2(LONG
, ReleaseCopyOfSocket
,
149 AROS_LPA(LONG
, sd
, D0
),
150 AROS_LPA(LONG
, id
, D1
),
151 LIBBASETYPEPTR
, SocketBase
, 26, BSDSocket
153 AROS_LP0(LONG
, Errno
,
154 LIBBASETYPEPTR
, SocketBase
, 27, BSDSocket
156 AROS_LP2(void, SetErrnoPtr
,
157 AROS_LPA(void *, ptr
, A0
),
158 AROS_LPA(int, size
, D0
),
159 LIBBASETYPEPTR
, SocketBase
, 28, BSDSocket
161 AROS_LP1(char *, Inet_NtoA
,
162 AROS_LPA(unsigned long, in
, D0
),
163 LIBBASETYPEPTR
, SocketBase
, 29, BSDSocket
165 AROS_LP1(unsigned long, inet_addr
,
166 AROS_LPA(const char *, cp
, A0
),
167 LIBBASETYPEPTR
, SocketBase
, 30, BSDSocket
169 AROS_LP1(unsigned long, Inet_LnaOf
,
170 AROS_LPA(unsigned long, in
, D0
),
171 LIBBASETYPEPTR
, SocketBase
, 31, BSDSocket
173 AROS_LP1(unsigned long, Inet_NetOf
,
174 AROS_LPA(unsigned long, in
, D0
),
175 LIBBASETYPEPTR
, SocketBase
, 32, BSDSocket
177 AROS_LP2(unsigned long, Inet_MakeAddr
,
178 AROS_LPA(int, net
, D0
),
179 AROS_LPA(int, lna
, D1
),
180 LIBBASETYPEPTR
, SocketBase
, 33, BSDSocket
182 AROS_LP1(unsigned long, inet_network
,
183 AROS_LPA(const char *, cp
, A0
),
184 LIBBASETYPEPTR
, SocketBase
, 34, BSDSocket
186 AROS_LP1(struct hostent
*, gethostbyname
,
187 AROS_LPA(const char *, name
, A0
),
188 LIBBASETYPEPTR
, SocketBase
, 35, BSDSocket
190 AROS_LP3(struct hostent
*, gethostbyaddr
,
191 AROS_LPA(const void *, addr
, A0
),
192 AROS_LPA(int, len
, D0
),
193 AROS_LPA(int, type
, D1
),
194 LIBBASETYPEPTR
, SocketBase
, 36, BSDSocket
196 AROS_LP1(struct netent
*, getnetbyname
,
197 AROS_LPA(const char *, name
, A0
),
198 LIBBASETYPEPTR
, SocketBase
, 37, BSDSocket
200 AROS_LP2(struct netent
*, getnetbyaddr
,
201 AROS_LPA(long, net
, D0
),
202 AROS_LPA(int, type
, D1
),
203 LIBBASETYPEPTR
, SocketBase
, 38, BSDSocket
205 AROS_LP2(struct servent
*, getservbyname
,
206 AROS_LPA(char *, name
, A0
),
207 AROS_LPA(char *, proto
, A1
),
208 LIBBASETYPEPTR
, SocketBase
, 39, BSDSocket
210 AROS_LP2(struct servent
*, getservbyport
,
211 AROS_LPA(int, port
, D0
),
212 AROS_LPA(char *, proto
, A0
),
213 LIBBASETYPEPTR
, SocketBase
, 40, BSDSocket
215 AROS_LP1(struct protoent
*, getprotobyname
,
216 AROS_LPA(char *, name
, A0
),
217 LIBBASETYPEPTR
, SocketBase
, 41, BSDSocket
219 AROS_LP1(struct protoent
*, getprotobynumber
,
220 AROS_LPA(int, proto
, D0
),
221 LIBBASETYPEPTR
, SocketBase
, 42, BSDSocket
223 AROS_LP3(void, vsyslog
,
224 AROS_LPA(int, level
, D0
),
225 AROS_LPA(const char *, format
, A0
),
226 AROS_LPA(IPTR
*, args
, A1
),
227 LIBBASETYPEPTR
, SocketBase
, 43, BSDSocket
229 AROS_LP2(int, Dup2Socket
,
230 AROS_LPA(int, fd1
, D0
),
231 AROS_LPA(int, fd2
, D1
),
232 LIBBASETYPEPTR
, SocketBase
, 44, BSDSocket
234 AROS_LP3(int, sendmsg
,
235 AROS_LPA(int, s
, D0
),
236 AROS_LPA(const struct msghdr
*, msg
, A0
),
237 AROS_LPA(int, flags
, D1
),
238 LIBBASETYPEPTR
, SocketBase
, 45, BSDSocket
240 AROS_LP3(int, recvmsg
,
241 AROS_LPA(int, s
, D0
),
242 AROS_LPA(struct msghdr
*, msg
, A0
),
243 AROS_LPA(int, flags
, D1
),
244 LIBBASETYPEPTR
, SocketBase
, 46, BSDSocket
246 AROS_LP2(int, gethostname
,
247 AROS_LPA(char *, name
, A0
),
248 AROS_LPA(int, namelen
, D0
),
249 LIBBASETYPEPTR
, SocketBase
, 47, BSDSocket
251 AROS_LP0(long, gethostid
,
252 LIBBASETYPEPTR
, SocketBase
, 48, BSDSocket
254 AROS_LP1(ULONG
, SocketBaseTagList
,
255 AROS_LPA(struct TagItem
*, tagList
, A0
),
256 LIBBASETYPEPTR
, SocketBase
, 49, BSDSocket
258 AROS_LP1(LONG
, GetSocketEvents
,
259 AROS_LPA(ULONG
*, eventsp
, A0
),
260 LIBBASETYPEPTR
, SocketBase
, 50, BSDSocket
263 /* RoadShow Extensions .. */
264 #if defined(__CONFIG_ROADSHOW__)
265 AROS_LP1(long, bpf_open
,
266 AROS_LPA(long, channel
, D0
),
267 LIBBASETYPEPTR
, SocketBase
, 61, BSDSocket
269 AROS_LP1(long, bpf_close
,
270 AROS_LPA(long, handle
, D0
),
271 LIBBASETYPEPTR
, SocketBase
, 62, BSDSocket
273 AROS_LP3(long, bpf_read
,
274 AROS_LPA(long, handle
, D0
),
275 AROS_LPA(void *, buffer
, A0
),
276 AROS_LPA(long, len
, D1
),
277 LIBBASETYPEPTR
, SocketBase
, 63, BSDSocket
279 AROS_LP3(long, bpf_write
,
280 AROS_LPA(long, handle
, D0
),
281 AROS_LPA(void *, buffer
, A0
),
282 AROS_LPA(long, len
, D1
),
283 LIBBASETYPEPTR
, SocketBase
, 64, BSDSocket
285 AROS_LP2(long, bpf_set_notify_mask
,
286 AROS_LPA(long, handle
, D0
),
287 AROS_LPA(unsigned long, mask
, D1
),
288 LIBBASETYPEPTR
, SocketBase
, 65, BSDSocket
290 AROS_LP2(long, bpf_set_interrupt_mask
,
291 AROS_LPA(long, handle
, D0
),
292 AROS_LPA(unsigned long, mask
, D1
),
293 LIBBASETYPEPTR
, SocketBase
, 66, BSDSocket
295 AROS_LP3(long, bpf_ioctl
,
296 AROS_LPA(long, handle
, D0
),
297 AROS_LPA(unsigned long, request
, D1
),
298 AROS_LPA(char *, argp
, A0
),
299 LIBBASETYPEPTR
, SocketBase
, 67, BSDSocket
301 AROS_LP1(long, bpf_data_waiting
,
302 AROS_LPA(long, handle
, D0
),
303 LIBBASETYPEPTR
, SocketBase
, 68, BSDSocket
305 AROS_LP1(long, AddRouteTagList
,
306 AROS_LPA(struct TagItem
*, tags
, A0
),
307 LIBBASETYPEPTR
, SocketBase
, 69, BSDSocket
309 AROS_LP1(long, DeleteRouteTagList
,
310 AROS_LPA(struct TagItem
*, tags
, A0
),
311 LIBBASETYPEPTR
, SocketBase
, 70, BSDSocket
313 AROS_LP1(long, ChangeRouteTagList
,
314 AROS_LPA(struct TagItem
*, tags
, A0
),
315 LIBBASETYPEPTR
, SocketBase
, 71, BSDSocket
317 AROS_LP1(void, FreeRouteInfo
,
318 AROS_LPA(struct rt_msghdr
*, table
, A0
),
319 LIBBASETYPEPTR
, SocketBase
, 72, BSDSocket
321 AROS_LP2(struct rt_msghdr
*, GetRouteInfo
,
322 AROS_LPA(LONG
, address_family
, D0
),
323 AROS_LPA(LONG
, flags
, D1
),
324 LIBBASETYPEPTR
, SocketBase
, 73, BSDSocket
326 AROS_LP4(long, AddInterfaceTagList
,
327 AROS_LPA(STRPTR
, name
, A0
),
328 AROS_LPA(STRPTR
, device
, A1
),
329 AROS_LPA(long, unit
, D0
),
330 AROS_LPA(struct TagItem
*, tags
, A2
),
331 LIBBASETYPEPTR
, SocketBase
, 74, BSDSocket
333 AROS_LP2(long, ConfigureInterfaceTagList
,
334 AROS_LPA(STRPTR
, name
, A0
),
335 AROS_LPA(struct TagItem
*, tags
, A1
),
336 LIBBASETYPEPTR
, SocketBase
, 75, BSDSocket
338 AROS_LP1(void, ReleaseInterfaceList
,
339 AROS_LPA(struct List
*, list
, A0
),
340 LIBBASETYPEPTR
, SocketBase
, 76, BSDSocket
342 AROS_LP0(struct List
*, ObtainInterfaceList
,
343 LIBBASETYPEPTR
, SocketBase
, 77, BSDSocket
345 AROS_LP2(long, QueryInterfaceTagList
,
346 AROS_LPA(STRPTR
, name
, A0
),
347 AROS_LPA(struct TagItem
*, tags
, A1
),
348 LIBBASETYPEPTR
, SocketBase
, 78, BSDSocket
350 AROS_LP5(LONG
, CreateAddrAllocMessageA
,
351 AROS_LPA(LONG
, version
, D0
),
352 AROS_LPA(LONG
, protocol
, D1
),
353 AROS_LPA(STRPTR
, interface_name
, A0
),
354 AROS_LPA(struct AddressAllocationMessage
*, result_ptr
, A1
),
355 AROS_LPA(struct TagItem
*, tags
, A2
),
356 LIBBASETYPEPTR
, SocketBase
, 79, BSDSocket
358 AROS_LP1(void, DeleteAddrAllocMessage
,
359 AROS_LPA(struct AddressAllocationMessage
*, message
, A0
),
360 LIBBASETYPEPTR
, SocketBase
, 80, BSDSocket
362 AROS_LP1(void, BeginInterfaceConfig
,
363 AROS_LPA(struct AddressAllocationMessage
*, message
, A0
),
364 LIBBASETYPEPTR
, SocketBase
, 81, BSDSocket
366 AROS_LP1(void, AbortInterfaceConfig
,
367 AROS_LPA(struct AddressAllocationMessage
*, message
, A0
),
368 LIBBASETYPEPTR
, SocketBase
, 82, BSDSocket
370 AROS_LP3(long, AddNetMonitorHookTagList
,
371 AROS_LPA(long, type
, D0
),
372 AROS_LPA(struct Hook
*, hook
, A0
),
373 AROS_LPA(struct TagItem
*, tags
, A1
),
374 LIBBASETYPEPTR
, SocketBase
, 83, BSDSocket
376 AROS_LP1(void, RemoveNetMonitorHook
,
377 AROS_LPA(struct Hook
*, hook
, A0
),
378 LIBBASETYPEPTR
, SocketBase
, 84, BSDSocket
380 AROS_LP4(LONG
, GetNetworkStatistics
,
381 AROS_LPA(LONG
, type
, D0
),
382 AROS_LPA(LONG
, version
, D1
),
383 AROS_LPA(APTR
, destination
, A0
),
384 AROS_LPA(LONG
, size
, D2
),
385 LIBBASETYPEPTR
, SocketBase
, 85, BSDSocket
387 AROS_LP1(LONG
, AddDomainNameServer
,
388 AROS_LPA(STRPTR
, address
, A0
),
389 LIBBASETYPEPTR
, SocketBase
, 86, BSDSocket
391 AROS_LP1(LONG
, RemoveDomainNameServer
,
392 AROS_LPA(STRPTR
, address
, A0
),
393 LIBBASETYPEPTR
, SocketBase
, 87, BSDSocket
395 AROS_LP1(void, ReleaseDomainNameServerList
,
396 AROS_LPA(struct List
*, list
, A0
),
397 LIBBASETYPEPTR
, SocketBase
, 88, BSDSocket
399 AROS_LP0(struct List
*, ObtainDomainNameServerList
,
400 LIBBASETYPEPTR
, SocketBase
, 89, BSDSocket
402 AROS_LP1(void, setnetent
,
403 AROS_LPA(int, stayopen
, D0
),
404 LIBBASETYPEPTR
, SocketBase
, 90, BSDSocket
406 AROS_LP0(void, endnetent
,
407 LIBBASETYPEPTR
, SocketBase
, 91, BSDSocket
409 AROS_LP0(struct netent
*, getnetent
,
410 LIBBASETYPEPTR
, SocketBase
, 92, BSDSocket
412 AROS_LP1(void, setprotoent
,
413 AROS_LPA(int, stayopen
, D0
),
414 LIBBASETYPEPTR
, SocketBase
, 93, BSDSocket
416 AROS_LP0(void, endprotoent
,
417 LIBBASETYPEPTR
, SocketBase
, 94, BSDSocket
419 AROS_LP0(struct protoent
*, getprotoent
,
420 LIBBASETYPEPTR
, SocketBase
, 95, BSDSocket
422 AROS_LP1(void, setservent
,
423 AROS_LPA(int, stayopen
, D0
),
424 LIBBASETYPEPTR
, SocketBase
, 96, BSDSocket
426 AROS_LP0(void, endservent
,
427 LIBBASETYPEPTR
, SocketBase
, 97, BSDSocket
429 AROS_LP0(struct servent
*, getservent
,
430 LIBBASETYPEPTR
, SocketBase
, 98, BSDSocket
432 AROS_LP2(LONG
, inet_aton
,
433 AROS_LPA(STRPTR
, cp
, A0
),
434 AROS_LPA(struct in_addr
*, addr
, A1
),
435 LIBBASETYPEPTR
, SocketBase
, 99, BSDSocket
437 #endif /* __CONFIG_ROADSHOW__ */
438 #endif /* CLIB_BSDSOCKET_PROTOS_H */