17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
545916cd2Sjpk  * Common Development and Distribution License (the "License").
645916cd2Sjpk  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
22*07925104Sgww  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
237c478bd9Sstevel@tonic-gate  */
247c478bd9Sstevel@tonic-gate 
257c478bd9Sstevel@tonic-gate #ifndef	_LDAPADDENT_H
267c478bd9Sstevel@tonic-gate #define	_LDAPADDENT_H
277c478bd9Sstevel@tonic-gate 
287c478bd9Sstevel@tonic-gate /*
297c478bd9Sstevel@tonic-gate  * ldapaddent.h
307c478bd9Sstevel@tonic-gate  *	common declarations for ldapaddent utility
317c478bd9Sstevel@tonic-gate  */
327c478bd9Sstevel@tonic-gate 
337c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
347c478bd9Sstevel@tonic-gate extern "C" {
357c478bd9Sstevel@tonic-gate #endif
367c478bd9Sstevel@tonic-gate 
377c478bd9Sstevel@tonic-gate #undef	GROUP
387c478bd9Sstevel@tonic-gate #undef	GROUP_OBJ
397c478bd9Sstevel@tonic-gate #include <nss_dbdefs.h>
407c478bd9Sstevel@tonic-gate #include <ns_sldap.h>
417c478bd9Sstevel@tonic-gate #include <nis_dhext.h>
427c478bd9Sstevel@tonic-gate 
437c478bd9Sstevel@tonic-gate extern unsigned	flags;
447c478bd9Sstevel@tonic-gate #define	F_VERBOSE 0x1
457c478bd9Sstevel@tonic-gate #define	F_PASSWD 0x2
467c478bd9Sstevel@tonic-gate 
477c478bd9Sstevel@tonic-gate #define	BIGBUF		8192
487c478bd9Sstevel@tonic-gate #define	BUFSIZ		1024
497c478bd9Sstevel@tonic-gate #define	LDAP_MAXNAMELEN 1024
507c478bd9Sstevel@tonic-gate #define	GENENT_OK	0
517c478bd9Sstevel@tonic-gate #define	GENENT_PARSEERR 1
527c478bd9Sstevel@tonic-gate #define	GENENT_CBERR	2
537c478bd9Sstevel@tonic-gate #define	GENENT_ERR	3
547c478bd9Sstevel@tonic-gate #define	PARSE_ERR_MSG_LEN 512
557c478bd9Sstevel@tonic-gate 
567c478bd9Sstevel@tonic-gate extern char	parse_err_msg[PARSE_ERR_MSG_LEN];
577c478bd9Sstevel@tonic-gate extern int	continue_onerror;  /* do not exit on error */
587c478bd9Sstevel@tonic-gate 
597c478bd9Sstevel@tonic-gate struct line_buf {
607c478bd9Sstevel@tonic-gate 	char *str;
617c478bd9Sstevel@tonic-gate 	int len;
627c478bd9Sstevel@tonic-gate 	int alloc;
637c478bd9Sstevel@tonic-gate };
647c478bd9Sstevel@tonic-gate 
657c478bd9Sstevel@tonic-gate struct file_loc {
667c478bd9Sstevel@tonic-gate 	off_t offset;
677c478bd9Sstevel@tonic-gate 	size_t size;
687c478bd9Sstevel@tonic-gate };
697c478bd9Sstevel@tonic-gate 
707c478bd9Sstevel@tonic-gate extern int genent_user_attr(char *line, int (*cback)());
717c478bd9Sstevel@tonic-gate extern int genent_prof_attr(char *line, int (*cback)());
727c478bd9Sstevel@tonic-gate extern int genent_exec_attr(char *line, int (*cback)());
737c478bd9Sstevel@tonic-gate extern int genent_auth_attr(char *line, int (*cback)());
7445916cd2Sjpk extern int genent_tnrhdb(char *line, int (*cback)());
7545916cd2Sjpk extern int genent_tnrhtp(char *line, int (*cback)());
7645916cd2Sjpk 
777c478bd9Sstevel@tonic-gate extern void dump_user_attr(ns_ldap_result_t *res);
787c478bd9Sstevel@tonic-gate extern void dump_prof_attr(ns_ldap_result_t *res);
797c478bd9Sstevel@tonic-gate extern void dump_exec_attr(ns_ldap_result_t *res);
807c478bd9Sstevel@tonic-gate extern void dump_auth_attr(ns_ldap_result_t *res);
8145916cd2Sjpk extern void dump_tnrhdb(ns_ldap_result_t *res);
8245916cd2Sjpk extern void dump_tnrhtp(ns_ldap_result_t *res);
837c478bd9Sstevel@tonic-gate 
847c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
857c478bd9Sstevel@tonic-gate }
867c478bd9Sstevel@tonic-gate #endif
877c478bd9Sstevel@tonic-gate 
887c478bd9Sstevel@tonic-gate #endif	/* _LDAPADDENT_H */
89