xref: /illumos-gate/usr/src/cmd/ldap/ns_ldap/ldapaddent.h (revision 7ae111d47a973fff4c6e231cc31f271dd9cef473)
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 2006 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef	_LDAPADDENT_H
27 #define	_LDAPADDENT_H
28 
29 #pragma ident	"%Z%%M%	%I%	%E% SMI"
30 
31 /*
32  * ldapaddent.h
33  *	common declarations for ldapaddent utility
34  */
35 
36 #ifdef	__cplusplus
37 extern "C" {
38 #endif
39 
40 #undef	GROUP
41 #undef	GROUP_OBJ
42 #include <nss_dbdefs.h>
43 #include <ns_sldap.h>
44 #include <nis_dhext.h>
45 
46 extern unsigned	flags;
47 #define	F_VERBOSE 0x1
48 #define	F_PASSWD 0x2
49 
50 #define	BIGBUF		8192
51 #define	BUFSIZ		1024
52 #define	LDAP_MAXNAMELEN 1024
53 #define	GENENT_OK	0
54 #define	GENENT_PARSEERR 1
55 #define	GENENT_CBERR	2
56 #define	GENENT_ERR	3
57 #define	PARSE_ERR_MSG_LEN 512
58 
59 extern char	parse_err_msg[PARSE_ERR_MSG_LEN];
60 extern int	continue_onerror;  /* do not exit on error */
61 
62 struct line_buf {
63 	char *str;
64 	int len;
65 	int alloc;
66 };
67 
68 struct file_loc {
69 	off_t offset;
70 	size_t size;
71 };
72 
73 extern int genent_user_attr(char *line, int (*cback)());
74 extern int genent_prof_attr(char *line, int (*cback)());
75 extern int genent_exec_attr(char *line, int (*cback)());
76 extern int genent_auth_attr(char *line, int (*cback)());
77 extern int genent_audit_user(char *line, int (*cback)());
78 extern int genent_tnrhdb(char *line, int (*cback)());
79 extern int genent_tnrhtp(char *line, int (*cback)());
80 
81 extern void dump_user_attr(ns_ldap_result_t *res);
82 extern void dump_prof_attr(ns_ldap_result_t *res);
83 extern void dump_exec_attr(ns_ldap_result_t *res);
84 extern void dump_auth_attr(ns_ldap_result_t *res);
85 extern void dump_audit_user(ns_ldap_result_t *res);
86 extern void dump_tnrhdb(ns_ldap_result_t *res);
87 extern void dump_tnrhtp(ns_ldap_result_t *res);
88 
89 #ifdef	__cplusplus
90 }
91 #endif
92 
93 #endif	/* _LDAPADDENT_H */
94