#endif /* LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS */
#endif /* notyet */
- /* buffers for ldap_int_gethostbyname_a */
+ /* buffers for ldap_pvt_gethostbyname_a */
struct hostent he_buf;
int local_h_errno;
char *ha_buf=NULL;
/* This was just a test for -1 until OSF1 let inet_addr return
unsigned int, which is narrower than 'unsigned long address' */
if ( address == 0xffffffff || address == (unsigned long) -1 ) {
- if ( ( ldap_int_gethostbyname_a( host, &he_buf, &ha_buf,
+ if ( ( ldap_pvt_gethostbyname_a( host, &he_buf, &ha_buf,
&hp, &local_h_errno) < 0) || (hp==NULL))
{
#ifdef HAVE_WINSOCK
}
}
- sb->sb_sd = s;
+ lber_pvt_sb_set_desc( sb, s );
if ( connected ) {
+
#ifdef notyet
#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS
status = 0;
}
DO_RETURN( rc );
-
-
}
#undef DO_RETURN
void
ldap_close_connection( Sockbuf *sb )
{
- tcp_close( sb->sb_sd );
+ lber_pvt_sb_close( sb );
}
-#ifdef HAVE_KERBEROS
+#if defined( HAVE_KERBEROS ) || defined( HAVE_TLS )
char *
ldap_host_connected_to( Sockbuf *sb )
{
(void)memset( (char *)&sin, 0, sizeof( struct sockaddr_in ));
len = sizeof( sin );
- if ( getpeername( sb->sb_sd, (struct sockaddr *)&sin, &len ) == -1 ) {
+
+ if ( getpeername( lber_pvt_sb_get_desc(sb), (struct sockaddr *)&sin, &len ) == -1 ) {
return( NULL );
}
* this is necessary for kerberos to work right, since the official
* hostname is used as the kerberos instance.
*/
- if ((ldap_int_gethostbyaddr_a( (char *) &sin.sin_addr,
+ if ((ldap_pvt_gethostbyaddr_a( (char *) &sin.sin_addr,
sizeof( sin.sin_addr ),
AF_INET, &he_buf, &ha_buf,
&hp,&local_h_errno ) ==0 ) && (hp != NULL) )
{
if ( hp->h_name != NULL ) {
- DO_RETURN( ldap_strdup( hp->h_name ));
+ char *host = strdup( hp->h_name );
+ DO_RETURN( host );
}
}
}
#undef DO_RETURN
-#endif /* HAVE_KERBEROS */
+#endif /* HAVE_KERBEROS || HAVE_TLS */
#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS
struct selectinfo *sip;
sip = (struct selectinfo *)ld->ld_selectinfo;
-
- if ( !FD_ISSET( sb->sb_sd, &sip->si_writefds )) {
+
+ if ( !FD_ISSET( lber_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( sb->sb_sd, &sip->si_readfds )) {
+ if ( !FD_ISSET( lber_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) sb->sb_sd, &sip->si_writefds );
- FD_CLR( (u_int) sb->sb_sd, &sip->si_readfds );
+ 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 );
}
sip = (struct selectinfo *)ld->ld_selectinfo;
- return( FD_ISSET( sb->sb_sd, &sip->si_use_writefds ));
+ return( FD_ISSET( lber_pvt_sb_get_desc(sb), &sip->si_use_writefds ));
}
sip = (struct selectinfo *)ld->ld_selectinfo;
- return( FD_ISSET( sb->sb_sd, &sip->si_use_readfds ));
+ return( FD_ISSET( lber_pvt_sb_get_desc(sb), &sip->si_use_readfds ));
}