8 #ifdef HAVE_SYS_SOCKET_H
10 #include <sys/socket.h>
12 #include <netinet/in.h>
13 #include <arpa/inet.h>
14 #include <arpa/nameser.h>
20 #include <sys/types.h>
30 #endif /* HAVE_PCNFS */
32 #ifndef INADDR_LOOPBACK
33 #define INADDR_LOOPBACK ((unsigned long) 0x7f000001)
37 #define tcp_close( s ) tcpclose( s )
41 #define tcp_close( s ) close( s )
44 #define tcp_close( s ) netclose( s ); netshut()
47 #define tcp_close( s ) closesocket( s ); WSACleanup();
50 #define tcp_close( s ) close( s )
54 #if !defined(__alpha) || defined(VMS)
55 #define HTONL( l ) htonl( l )
56 #define NTOHL( l ) ntohl( l )
57 #else /* __alpha && !VMS */
59 * htonl and ntohl on the DEC Alpha under OSF 1 seem to only swap the
60 * lower-order 32-bits of a (64-bit) long, so we define correct versions
63 #define HTONL( l ) (((long)htonl( (l) & 0x00000000FFFFFFFF )) << 32 \
64 | htonl( ( (l) & 0xFFFFFFFF00000000 ) >> 32 ))
66 #define NTOHL( l ) (((long)ntohl( (l) & 0x00000000FFFFFFFF )) << 32 \
67 | ntohl( ( (l) & 0xFFFFFFFF00000000 ) >> 32 ))
69 #endif /* __alpha && !VMS */
72 #endif /* _AC_SOCKET_H_ */