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>
36 #endif /* HAVE_PCNFS */
38 #ifndef INADDR_LOOPBACK
39 #define INADDR_LOOPBACK ((unsigned long) 0x7f000001)
42 #ifndef MAXHOSTNAMELEN
43 #define MAXHOSTNAMELEN 64
47 #define tcp_close( s ) tcpclose( s )
51 #define tcp_close( s ) close( s )
54 #define tcp_close( s ) netclose( s ); netshut()
57 #define tcp_close( s ) closesocket( s );
60 #define tcp_close( s ) close( s )
64 #if !defined(__alpha) || defined(VMS)
65 #define AC_HTONL( l ) htonl( l )
66 #define AC_NTOHL( l ) ntohl( l )
67 #else /* __alpha && !VMS */
69 * htonl and ntohl on the DEC Alpha under OSF 1 seem to only swap the
70 * lower-order 32-bits of a (64-bit) long, so we define correct versions
73 #define AC_HTONL( l ) (((long)htonl( (l) & 0x00000000FFFFFFFF )) << 32 \
74 | htonl( ( (l) & 0xFFFFFFFF00000000 ) >> 32 ))
76 #define AC_NTOHL( l ) (((long)ntohl( (l) & 0x00000000FFFFFFFF )) << 32 \
77 | ntohl( ( (l) & 0xFFFFFFFF00000000 ) >> 32 ))
79 #endif /* __alpha && !VMS */
83 * Definitions for byte order, according to byte significance from low
86 #define LITTLE_ENDIAN 1234 /* LSB first: i386, vax */
87 #define BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */
88 #define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */
90 /* assume autoconf's AC_C_BIGENDIAN has been run */
91 /* if it hasn't, we assume (maybe falsely) the order is LITTLE ENDIAN */
92 #ifdef WORDS_BIGENDIAN
93 #define BYTE_ORDER BIG_ENDIAN
95 #define BYTE_ORDER LITTLE_ENDIAN
98 #endif /* BYTE_ORDER */
100 #endif /* _AC_SOCKET_H_ */