]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/os-ip.c
rename ldap_pvt_init_utils() to ldap_int_utils_init() and provide
[openldap] / libraries / libldap / os-ip.c
index 41f3dd1787bff5a759b66935c92c1f549ecb247c..e46ff5eb84c4af21e10dc569bb6161ea05e7c102 100644 (file)
@@ -33,7 +33,7 @@
 #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
@@ -48,9 +48,7 @@ ldap_connect_to_host( Sockbuf *sb, char *host, unsigned long address,
        struct sockaddr_in      sin;
        struct hostent          *hp = NULL;
 #ifdef notyet
-#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS
-       int                     status; /* for ioctl call */
-#endif /* LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS */
+       ioctl_t                 status; /* for ioctl call */
 #endif /* notyet */
    
        /* buffers for ldap_pvt_gethostbyname_a */
@@ -89,13 +87,11 @@ ldap_connect_to_host( Sockbuf *sb, char *host, unsigned long address,
                        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;
@@ -114,7 +110,6 @@ ldap_connect_to_host( Sockbuf *sb, char *host, unsigned long address,
                        errno = WSAGetLastError();
 #endif
 #ifdef notyet
-#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS
 #ifdef EAGAIN
                        if ( errno == EINPROGRESS || errno == EAGAIN ) {
 #else /* EAGAIN */
@@ -125,7 +120,6 @@ ldap_connect_to_host( Sockbuf *sb, char *host, unsigned long address,
                                rc = -2;
                                break;
                        }
-#endif /* LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS */
 #endif /* notyet */
 
 #ifdef LDAP_DEBUG              
@@ -140,18 +134,16 @@ ldap_connect_to_host( Sockbuf *sb, char *host, unsigned long address,
                }
        }
 
-       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",
@@ -167,7 +159,7 @@ ldap_connect_to_host( Sockbuf *sb, char *host, unsigned long address,
 void
 ldap_close_connection( Sockbuf *sb )
 {
-       lber_pvt_sb_close( sb );
+       ber_pvt_sb_close( sb );
 }
 
 
@@ -189,7 +181,7 @@ ldap_host_connected_to( Sockbuf *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 );
        }
 
@@ -216,7 +208,6 @@ ldap_host_connected_to( Sockbuf *sb )
 #endif /* HAVE_KERBEROS || HAVE_TLS */
 
 
-#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS
 /* for UNIX */
 struct selectinfo {
        fd_set  si_readfds;
@@ -233,7 +224,7 @@ ldap_mark_select_write( LDAP *ld, Sockbuf *sb )
 
        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 );
        }
 }
@@ -246,7 +237,7 @@ ldap_mark_select_read( LDAP *ld, Sockbuf *sb )
 
        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 );
        }
 }
@@ -259,8 +250,8 @@ ldap_mark_select_clear( LDAP *ld, Sockbuf *sb )
 
        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 );
 }
 
 
@@ -271,7 +262,7 @@ ldap_is_write_ready( LDAP *ld, Sockbuf *sb )
 
        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 ));
 }
 
 
@@ -282,7 +273,7 @@ ldap_is_read_ready( LDAP *ld, Sockbuf *sb )
 
        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 ));
 }
 
 
@@ -339,4 +330,3 @@ do_ldap_select( LDAP *ld, struct timeval *timeout )
        return( select( tblsize, &sip->si_use_readfds, &sip->si_use_writefds,
            NULL, timeout ));
 }
-#endif /* LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS */