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