#include "ldap-int.h"
int
-ldap_connect_to_host( Sockbuf *sb, char *host, unsigned long address,
+ldap_connect_to_host( Sockbuf *sb, const char *host, unsigned long address,
int port, int async )
/*
* if host == NULL, connect using address
struct sockaddr_in sin;
struct hostent *hp = NULL;
#ifdef notyet
-#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS
ioctl_t status; /* for ioctl call */
-#endif /* LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS */
#endif /* notyet */
/* buffers for ldap_pvt_gethostbyname_a */
DO_RETURN( -1 );
}
#ifdef notyet
-#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS
status = 1;
if ( async && ioctl( s, FIONBIO, (caddr_t)&status ) == -1 ) {
Debug( LDAP_DEBUG_ANY, "FIONBIO ioctl failed on %d\n",
s, 0, 0 );
}
-#endif /* LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS */
#endif /* notyet */
(void)memset( (char *)&sin, 0, sizeof( struct sockaddr_in ));
sin.sin_family = AF_INET;
errno = WSAGetLastError();
#endif
#ifdef notyet
-#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS
#ifdef EAGAIN
if ( errno == EINPROGRESS || errno == EAGAIN ) {
#else /* EAGAIN */
rc = -2;
break;
}
-#endif /* LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS */
#endif /* notyet */
#ifdef LDAP_DEBUG
}
}
- lber_pvt_sb_set_desc( sb, s );
+ ber_pvt_sb_set_desc( sb, s );
if ( connected ) {
#ifdef notyet
-#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS
status = 0;
if ( !async && ioctl( s, FIONBIO, (caddr_t)&on ) == -1 ) {
Debug( LDAP_DEBUG_ANY, "FIONBIO ioctl failed on %d\n",
s, 0, 0 );
}
-#endif /* LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS */
#endif /* notyet */
Debug( LDAP_DEBUG_TRACE, "sd %d connected to: %s\n",
void
ldap_close_connection( Sockbuf *sb )
{
- lber_pvt_sb_close( sb );
+ ber_pvt_sb_close( sb );
}
(void)memset( (char *)&sin, 0, sizeof( struct sockaddr_in ));
len = sizeof( sin );
- if ( getpeername( lber_pvt_sb_get_desc(sb), (struct sockaddr *)&sin, &len ) == -1 ) {
+ if ( getpeername( ber_pvt_sb_get_desc(sb), (struct sockaddr *)&sin, &len ) == -1 ) {
return( NULL );
}
#endif /* HAVE_KERBEROS || HAVE_TLS */
-#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS
/* for UNIX */
struct selectinfo {
fd_set si_readfds;
sip = (struct selectinfo *)ld->ld_selectinfo;
- if ( !FD_ISSET( lber_pvt_sb_get_desc(sb), &sip->si_writefds )) {
+ if ( !FD_ISSET( ber_pvt_sb_get_desc(sb), &sip->si_writefds )) {
FD_SET( (u_int) sb->sb_sd, &sip->si_writefds );
}
}
sip = (struct selectinfo *)ld->ld_selectinfo;
- if ( !FD_ISSET( lber_pvt_sb_get_desc(sb), &sip->si_readfds )) {
+ if ( !FD_ISSET( ber_pvt_sb_get_desc(sb), &sip->si_readfds )) {
FD_SET( (u_int) sb->sb_sd, &sip->si_readfds );
}
}
sip = (struct selectinfo *)ld->ld_selectinfo;
- FD_CLR( (u_int) lber_pvt_sb_get_desc(sb), &sip->si_writefds );
- FD_CLR( (u_int) lber_pvt_sb_get_desc(sb), &sip->si_readfds );
+ FD_CLR( (u_int) ber_pvt_sb_get_desc(sb), &sip->si_writefds );
+ FD_CLR( (u_int) ber_pvt_sb_get_desc(sb), &sip->si_readfds );
}
sip = (struct selectinfo *)ld->ld_selectinfo;
- return( FD_ISSET( lber_pvt_sb_get_desc(sb), &sip->si_use_writefds ));
+ return( FD_ISSET( ber_pvt_sb_get_desc(sb), &sip->si_use_writefds ));
}
sip = (struct selectinfo *)ld->ld_selectinfo;
- return( FD_ISSET( lber_pvt_sb_get_desc(sb), &sip->si_use_readfds ));
+ return( FD_ISSET( ber_pvt_sb_get_desc(sb), &sip->si_use_readfds ));
}
return( select( tblsize, &sip->si_use_readfds, &sip->si_use_writefds,
NULL, timeout ));
}
-#endif /* LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS */