11/* FUNCTION: inet_addr */
22
3+ #ifndef _WIN32
4+
5+ #ifndef __CPROVER_INET_H_INCLUDED
36#include <arpa/inet.h>
7+ #define __CPROVER_INET_H_INCLUDED
8+ #endif
49
510in_addr_t __VERIFIER_nondet_in_addr_t ();
611
@@ -16,8 +21,17 @@ in_addr_t inet_addr(const char *cp)
1621 return result ;
1722}
1823
24+ #endif
25+
1926/* FUNCTION: inet_aton */
2027
28+ #ifndef _WIN32
29+
30+ #ifndef __CPROVER_INET_H_INCLUDED
31+ #include <arpa/inet.h>
32+ #define __CPROVER_INET_H_INCLUDED
33+ #endif
34+
2135int __VERIFIER_nondet_int ();
2236
2337int inet_aton (const char * cp , struct in_addr * pin )
@@ -33,8 +47,17 @@ int inet_aton(const char *cp, struct in_addr *pin)
3347 return result ;
3448}
3549
50+ #endif
51+
3652/* FUNCTION: inet_network */
3753
54+ #ifndef _WIN32
55+
56+ #ifndef __CPROVER_INET_H_INCLUDED
57+ #include <arpa/inet.h>
58+ #define __CPROVER_INET_H_INCLUDED
59+ #endif
60+
3861in_addr_t __VERIFIER_nondet_in_addr_t ();
3962
4063in_addr_t inet_network (const char * cp )
@@ -48,3 +71,87 @@ in_addr_t inet_network(const char *cp)
4871 in_addr_t result = __VERIFIER_nondet_in_addr_t ();
4972 return result ;
5073}
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