8 #ifdef HAVE_SYS_TYPES_H
12 #ifdef HAVE_SYS_SOCKET_H
13 #include <sys/socket.h>
15 #ifdef HAVE_SYS_SELECT_H
16 #include <sys/select.h>
19 #include <netinet/in.h>
20 #include <arpa/inet.h>
21 #include <arpa/nameser.h>
28 #define EMSGSIZE WSAEMSGSIZE
29 #define EHOSTUNREACH WSAEHOSTUNREACH
36 #endif /* HAVE_PCNFS */
38 #ifndef INADDR_LOOPBACK
39 #define INADDR_LOOPBACK ((unsigned long) 0x7f000001)
43 #define tcp_close( s ) tcpclose( s )
47 #define tcp_close( s ) close( s )
50 #define tcp_close( s ) netclose( s ); netshut()
53 #define tcp_close( s ) closesocket( s ); WSACleanup();
56 #define tcp_close( s ) close( s )
60 #if !defined(__alpha) || defined(VMS)
61 #define AC_HTONL( l ) htonl( l )
62 #define AC_NTOHL( l ) ntohl( l )
63 #else /* __alpha && !VMS */
65 * htonl and ntohl on the DEC Alpha under OSF 1 seem to only swap the
66 * lower-order 32-bits of a (64-bit) long, so we define correct versions
69 #define AC_HTONL( l ) (((long)htonl( (l) & 0x00000000FFFFFFFF )) << 32 \
70 | htonl( ( (l) & 0xFFFFFFFF00000000 ) >> 32 ))
72 #define AC_NTOHL( l ) (((long)ntohl( (l) & 0x00000000FFFFFFFF )) << 32 \
73 | ntohl( ( (l) & 0xFFFFFFFF00000000 ) >> 32 ))
75 #endif /* __alpha && !VMS */
79 * Definitions for byte order, according to byte significance from low
82 #define LITTLE_ENDIAN 1234 /* LSB first: i386, vax */
83 #define BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */
84 #define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */
86 /* assume autoconf's AC_C_BIGENDIAN has been run */
87 #ifdef WORDS_BIGENDIAN
88 #define BYTE_ORDER BIG_ENDIAN
90 #define BYTE_ORDER LITTLE_ENDIAN
93 #endif /* BYTE_ORDER */
95 #endif /* _AC_SOCKET_H_ */