1*0Sstevel@tonic-gate /* 2*0Sstevel@tonic-gate * Copyright 2001-2002 Sun Microsystems, Inc. All rights reserved. 3*0Sstevel@tonic-gate * Use is subject to license terms. 4*0Sstevel@tonic-gate */ 5*0Sstevel@tonic-gate 6*0Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 7*0Sstevel@tonic-gate 8*0Sstevel@tonic-gate 9*0Sstevel@tonic-gate /* 10*0Sstevel@tonic-gate * The contents of this file are subject to the Netscape Public 11*0Sstevel@tonic-gate * License Version 1.1 (the "License"); you may not use this file 12*0Sstevel@tonic-gate * except in compliance with the License. You may obtain a copy of 13*0Sstevel@tonic-gate * the License at http://www.mozilla.org/NPL/ 14*0Sstevel@tonic-gate * 15*0Sstevel@tonic-gate * Software distributed under the License is distributed on an "AS 16*0Sstevel@tonic-gate * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 17*0Sstevel@tonic-gate * implied. See the License for the specific language governing 18*0Sstevel@tonic-gate * rights and limitations under the License. 19*0Sstevel@tonic-gate * 20*0Sstevel@tonic-gate * The Original Code is Mozilla Communicator client code, released 21*0Sstevel@tonic-gate * March 31, 1998. 22*0Sstevel@tonic-gate * 23*0Sstevel@tonic-gate * The Initial Developer of the Original Code is Netscape 24*0Sstevel@tonic-gate * Communications Corporation. Portions created by Netscape are 25*0Sstevel@tonic-gate * Copyright (C) 1998-1999 Netscape Communications Corporation. All 26*0Sstevel@tonic-gate * Rights Reserved. 27*0Sstevel@tonic-gate * 28*0Sstevel@tonic-gate * Contributor(s): 29*0Sstevel@tonic-gate */ 30*0Sstevel@tonic-gate 31*0Sstevel@tonic-gate /* 32*0Sstevel@tonic-gate * Internal header for libprldap -- glue NSPR (Netscape Portable Runtime) 33*0Sstevel@tonic-gate * to libldap. 34*0Sstevel@tonic-gate * 35*0Sstevel@tonic-gate */ 36*0Sstevel@tonic-gate 37*0Sstevel@tonic-gate #include <ldap.h> 38*0Sstevel@tonic-gate #include <nspr.h> 39*0Sstevel@tonic-gate #include <ldappr.h> 40*0Sstevel@tonic-gate 41*0Sstevel@tonic-gate #include <errno.h> 42*0Sstevel@tonic-gate #include <string.h> 43*0Sstevel@tonic-gate 44*0Sstevel@tonic-gate #ifdef _SOLARIS_SDK 45*0Sstevel@tonic-gate #include "solaris-int.h" 46*0Sstevel@tonic-gate #endif 47*0Sstevel@tonic-gate 48*0Sstevel@tonic-gate /* 49*0Sstevel@tonic-gate * All of the sockets we use are IPv6 capable. 50*0Sstevel@tonic-gate * Change the following #define to PR_AF_INET to support IPv4 only. 51*0Sstevel@tonic-gate */ 52*0Sstevel@tonic-gate #define PRLDAP_DEFAULT_ADDRESS_FAMILY PR_AF_INET6 53*0Sstevel@tonic-gate 54*0Sstevel@tonic-gate /* 55*0Sstevel@tonic-gate * Data structures: 56*0Sstevel@tonic-gate */ 57*0Sstevel@tonic-gate 58*0Sstevel@tonic-gate /* data structure that populates the I/O callback session arg. */ 59*0Sstevel@tonic-gate typedef struct lextiof_session_private { 60*0Sstevel@tonic-gate PRPollDesc *prsess_pollds; /* for poll callback */ 61*0Sstevel@tonic-gate int prsess_pollds_count; /* # of elements in pollds */ 62*0Sstevel@tonic-gate int prsess_io_max_timeout; /* in milliseconds */ 63*0Sstevel@tonic-gate void *prsess_appdata; /* application specific data */ 64*0Sstevel@tonic-gate } PRLDAPIOSessionArg; 65*0Sstevel@tonic-gate 66*0Sstevel@tonic-gate /* data structure that populates the I/O callback socket-specific arg. */ 67*0Sstevel@tonic-gate typedef struct lextiof_socket_private { 68*0Sstevel@tonic-gate PRFileDesc *prsock_prfd; /* associated NSPR file desc. */ 69*0Sstevel@tonic-gate int prsock_io_max_timeout; /* in milliseconds */ 70*0Sstevel@tonic-gate void *prsock_appdata; /* application specific data */ 71*0Sstevel@tonic-gate } PRLDAPIOSocketArg; 72*0Sstevel@tonic-gate 73*0Sstevel@tonic-gate 74*0Sstevel@tonic-gate /* 75*0Sstevel@tonic-gate * Function prototypes: 76*0Sstevel@tonic-gate */ 77*0Sstevel@tonic-gate 78*0Sstevel@tonic-gate /* 79*0Sstevel@tonic-gate * From ldapprio.c: 80*0Sstevel@tonic-gate */ 81*0Sstevel@tonic-gate int prldap_install_io_functions( LDAP *ld, int shared ); 82*0Sstevel@tonic-gate int prldap_session_arg_from_ld( LDAP *ld, PRLDAPIOSessionArg **sessargpp ); 83*0Sstevel@tonic-gate int prldap_set_io_max_timeout( PRLDAPIOSessionArg *prsessp, 84*0Sstevel@tonic-gate int io_max_timeout ); 85*0Sstevel@tonic-gate int prldap_get_io_max_timeout( PRLDAPIOSessionArg *prsessp, 86*0Sstevel@tonic-gate int *io_max_timeoutp ); 87*0Sstevel@tonic-gate int prldap_socket_arg_from_ld( LDAP *ld, PRLDAPIOSocketArg **sockargpp ); 88*0Sstevel@tonic-gate 89*0Sstevel@tonic-gate 90*0Sstevel@tonic-gate /* 91*0Sstevel@tonic-gate * From ldapprthreads.c: 92*0Sstevel@tonic-gate */ 93*0Sstevel@tonic-gate int prldap_install_thread_functions( LDAP *ld, int shared ); 94*0Sstevel@tonic-gate int prldap_thread_new_handle( LDAP *ld, void *sessionarg ); 95*0Sstevel@tonic-gate void prldap_thread_dispose_handle( LDAP *ld, void *sessionarg ); 96*0Sstevel@tonic-gate 97*0Sstevel@tonic-gate 98*0Sstevel@tonic-gate /* 99*0Sstevel@tonic-gate * From ldapprdns.c: 100*0Sstevel@tonic-gate */ 101*0Sstevel@tonic-gate int prldap_install_dns_functions( LDAP *ld ); 102*0Sstevel@tonic-gate #ifdef _SOLARIS_SDK 103*0Sstevel@tonic-gate int prldap_x_install_dns_skipdb( LDAP *ld, const char *skip ); 104*0Sstevel@tonic-gate #endif 105*0Sstevel@tonic-gate 106*0Sstevel@tonic-gate 107*0Sstevel@tonic-gate 108*0Sstevel@tonic-gate /* 109*0Sstevel@tonic-gate * From ldapprerror.c: 110*0Sstevel@tonic-gate */ 111*0Sstevel@tonic-gate void prldap_set_system_errno( int e ); 112*0Sstevel@tonic-gate int prldap_get_system_errno( void ); 113*0Sstevel@tonic-gate int prldap_prerr2errno( void ); 114