2 * Copyright 2006, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
5 #ifndef NET_R5_COMPATIBILITY_H
6 #define NET_R5_COMPATIBILITY_H
9 #include <SupportDefs.h>
12 #define R5_SOCK_DGRAM 1
13 #define R5_SOCK_STREAM 2
17 #define R5_IPPROTO_UDP 1
18 #define R5_IPPROTO_TCP 2
19 #define R5_IPPROTO_ICMP 3
21 // setsockopt() defines
23 #define R5_SOL_SOCKET 1
26 #define R5_SO_REUSEADDR 2
27 #define R5_SO_NONBLOCK 3
28 #define R5_SO_REUSEPORT 4
29 #define R5_SO_FIONREAD 5
31 #define R5_MSG_OOB 0x01
34 struct r5_sockaddr_in
{
41 extern bool __gR5Compatibility
;
42 extern addr_t __gNetworkStart
;
43 extern addr_t __gNetworkEnd
;
44 extern addr_t __gNetAPIStart
;
45 extern addr_t __gNetAPIEnd
;
49 check_r5_compatibility()
51 if (!__gR5Compatibility
)
59 struct stack_frame
* previous
;
60 addr_t return_address
;
63 stack_frame
* frame
= (stack_frame
*)get_stack_frame();
64 if (frame
->return_address
>= __gNetworkStart
65 && frame
->return_address
< __gNetworkEnd
) {
74 #endif // NET_R5_COMPATIBILITY_H