1
1
/* FUNCTION: inet_addr */
2
2
3
+ #ifndef _WIN32
4
+
5
+ #ifndef __CPROVER_INET_H_INCLUDED
3
6
#include <arpa/inet.h>
7
+ #define __CPROVER_INET_H_INCLUDED
8
+ #endif
4
9
5
10
in_addr_t __VERIFIER_nondet_in_addr_t ();
6
11
@@ -16,8 +21,17 @@ in_addr_t inet_addr(const char *cp)
16
21
return result ;
17
22
}
18
23
24
+ #endif
25
+
19
26
/* FUNCTION: inet_aton */
20
27
28
+ #ifndef _WIN32
29
+
30
+ #ifndef __CPROVER_INET_H_INCLUDED
31
+ #include <arpa/inet.h>
32
+ #define __CPROVER_INET_H_INCLUDED
33
+ #endif
34
+
21
35
int __VERIFIER_nondet_int ();
22
36
23
37
int inet_aton (const char * cp , struct in_addr * pin )
@@ -33,8 +47,17 @@ int inet_aton(const char *cp, struct in_addr *pin)
33
47
return result ;
34
48
}
35
49
50
+ #endif
51
+
36
52
/* FUNCTION: inet_network */
37
53
54
+ #ifndef _WIN32
55
+
56
+ #ifndef __CPROVER_INET_H_INCLUDED
57
+ #include <arpa/inet.h>
58
+ #define __CPROVER_INET_H_INCLUDED
59
+ #endif
60
+
38
61
in_addr_t __VERIFIER_nondet_in_addr_t ();
39
62
40
63
in_addr_t inet_network (const char * cp )
@@ -48,3 +71,87 @@ in_addr_t inet_network(const char *cp)
48
71
in_addr_t result = __VERIFIER_nondet_in_addr_t ();
49
72
return result ;
50
73
}
74
+
75
+ #endif
76
+
77
+ /* FUNCTION: htonl */
78
+
79
+ #ifndef __CPROVER_STDINT_H_INCLUDED
80
+ #include <stdint.h>
81
+ #define __CPROVER_STDINT_H_INCLUDED
82
+ #endif
83
+
84
+ #undef htonl
85
+
86
+ uint32_t __builtin_bswap32 (uint32_t );
87
+
88
+ uint32_t htonl (uint32_t hostlong )
89
+ {
90
+ #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
91
+ return __builtin_bswap32 (hostlong );
92
+ #else
93
+ return hostlong ;
94
+ #endif
95
+ }
96
+
97
+ /* FUNCTION: htons */
98
+
99
+ #ifndef __CPROVER_STDINT_H_INCLUDED
100
+ #include <stdint.h>
101
+ #define __CPROVER_STDINT_H_INCLUDED
102
+ #endif
103
+
104
+ #undef htons
105
+
106
+ uint16_t __builtin_bswap16 (uint16_t );
107
+
108
+ uint16_t htons (uint16_t hostshort )
109
+ {
110
+ #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
111
+ return __builtin_bswap16 (hostshort );
112
+ #else
113
+ return hostlong ;
114
+ #endif
115
+ }
116
+
117
+
118
+ /* FUNCTION: ntohl */
119
+
120
+ #ifndef __CPROVER_STDINT_H_INCLUDED
121
+ #include <stdint.h>
122
+ #define __CPROVER_STDINT_H_INCLUDED
123
+ #endif
124
+
125
+ #undef ntohl
126
+
127
+ uint32_t __builtin_bswap32 (uint32_t );
128
+
129
+ uint32_t ntohl (uint32_t netlong )
130
+ {
131
+ #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
132
+ return __builtin_bswap32 (netlong );
133
+ #else
134
+ return netlong ;
135
+ #endif
136
+ }
137
+
138
+
139
+ /* FUNCTION: ntohs */
140
+
141
+ #ifndef __CPROVER_STDINT_H_INCLUDED
142
+ #include <stdint.h>
143
+ #define __CPROVER_STDINT_H_INCLUDED
144
+ #endif
145
+
146
+ #undef ntohs
147
+
148
+ uint16_t __builtin_bswap16 (uint16_t );
149
+
150
+ uint16_t ntohs (uint16_t netshort )
151
+ {
152
+ #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
153
+ return __builtin_bswap16 (netshort );
154
+ #else
155
+ return netshort ;
156
+ #endif
157
+ }
0 commit comments