xref: /titanic_52/usr/src/cmd/ldap/ns_ldap/ldapaddent.h (revision 07925104db56e5c3eacc4865b918bd16af5cec59)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
23  */
24 
25 #ifndef	_LDAPADDENT_H
26 #define	_LDAPADDENT_H
27 
28 /*
29  * ldapaddent.h
30  *	common declarations for ldapaddent utility
31  */
32 
33 #ifdef	__cplusplus
34 extern "C" {
35 #endif
36 
37 #undef	GROUP
38 #undef	GROUP_OBJ
39 #include <nss_dbdefs.h>
40 #include <ns_sldap.h>
41 #include <nis_dhext.h>
42 
43 extern unsigned	flags;
44 #define	F_VERBOSE 0x1
45 #define	F_PASSWD 0x2
46 
47 #define	BIGBUF		8192
48 #define	BUFSIZ		1024
49 #define	LDAP_MAXNAMELEN 1024
50 #define	GENENT_OK	0
51 #define	GENENT_PARSEERR 1
52 #define	GENENT_CBERR	2
53 #define	GENENT_ERR	3
54 #define	PARSE_ERR_MSG_LEN 512
55 
56 extern char	parse_err_msg[PARSE_ERR_MSG_LEN];
57 extern int	continue_onerror;  /* do not exit on error */
58 
59 struct line_buf {
60 	char *str;
61 	int len;
62 	int alloc;
63 };
64 
65 struct file_loc {
66 	off_t offset;
67 	size_t size;
68 };
69 
70 extern int genent_user_attr(char *line, int (*cback)());
71 extern int genent_prof_attr(char *line, int (*cback)());
72 extern int genent_exec_attr(char *line, int (*cback)());
73 extern int genent_auth_attr(char *line, int (*cback)());
74 extern int genent_tnrhdb(char *line, int (*cback)());
75 extern int genent_tnrhtp(char *line, int (*cback)());
76 
77 extern void dump_user_attr(ns_ldap_result_t *res);
78 extern void dump_prof_attr(ns_ldap_result_t *res);
79 extern void dump_exec_attr(ns_ldap_result_t *res);
80 extern void dump_auth_attr(ns_ldap_result_t *res);
81 extern void dump_tnrhdb(ns_ldap_result_t *res);
82 extern void dump_tnrhtp(ns_ldap_result_t *res);
83 
84 #ifdef	__cplusplus
85 }
86 #endif
87 
88 #endif	/* _LDAPADDENT_H */
89