5 * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA
8 * Redistribution and use in source and binary forms are permitted only
9 * as authorized by the OpenLDAP Public License. A copy of this
10 * license is available at http://www.OpenLDAP.org/license.html or
11 * in file LICENSE in the top-level directory of the distribution.
17 #ifdef HAVE_SYS_TYPES_H
18 #include <sys/types.h>
21 #ifdef HAVE_SYS_SOCKET_H
22 #include <sys/socket.h>
24 #ifdef HAVE_SYS_SELECT_H
25 #include <sys/select.h>
28 #include <netinet/in.h>
30 #ifdef HAVE_ARPA_INET_H
31 #include <arpa/inet.h>
34 #ifdef HAVE_ARPA_NAMESER_H
35 #include <arpa/nameser.h>
44 #endif /* HAVE_SYS_SOCKET_H */
56 #endif /* HAVE_PCNFS */
58 #ifndef INADDR_LOOPBACK
59 #define INADDR_LOOPBACK ((unsigned long) 0x7f000001)
62 #ifndef MAXHOSTNAMELEN
63 #define MAXHOSTNAMELEN 64
67 # define tcp_close( s ) closesocket( s );
68 # define ioctl( s, c, a ) ioctlsocket( (s), (c), (a) )
69 # define ioctl_t u_long
71 #define EWOULDBLOCK WSAEWOULDBLOCK
74 # define tcp_close( s ) tcpclose( s )
77 # define tcp_close( s ) close( s )
80 # define tcp_close( s ) do { netclose( s ); netshut() } while(0)
83 # define tcp_close( s ) close( s )
90 #if !defined(__alpha) || defined(VMS)
91 #define AC_HTONL( l ) htonl( l )
92 #define AC_NTOHL( l ) ntohl( l )
93 #else /* __alpha && !VMS */
95 * htonl and ntohl on the DEC Alpha under OSF 1 seem to only swap the
96 * lower-order 32-bits of a (64-bit) long, so we define correct versions
99 #define AC_HTONL( l ) (((long)htonl( (l) & 0x00000000FFFFFFFF )) << 32 \
100 | htonl( ( (l) & 0xFFFFFFFF00000000 ) >> 32 ))
102 #define AC_NTOHL( l ) (((long)ntohl( (l) & 0x00000000FFFFFFFF )) << 32 \
103 | ntohl( ( (l) & 0xFFFFFFFF00000000 ) >> 32 ))
105 #endif /* __alpha && !VMS */
108 #if defined( WSAEWOULDBLOCK )
109 #define EWOULDBLOCK WSAEWOULDBLOCK
112 #endif /* _AC_SOCKET_H_ */