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
5*ea10ff14SBen Chang  * Common Development and Distribution License (the "License").
6*ea10ff14SBen Chang  * 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*ea10ff14SBen Chang  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
237c478bd9Sstevel@tonic-gate  */
247c478bd9Sstevel@tonic-gate 
257c478bd9Sstevel@tonic-gate #ifndef _DIT_ACCESS_UTILS_H
267c478bd9Sstevel@tonic-gate #define	_DIT_ACCESS_UTILS_H
277c478bd9Sstevel@tonic-gate 
287c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
297c478bd9Sstevel@tonic-gate extern "C" {
307c478bd9Sstevel@tonic-gate #endif
317c478bd9Sstevel@tonic-gate 
327c478bd9Sstevel@tonic-gate #ifndef ERROR
337c478bd9Sstevel@tonic-gate #define	ERROR	-1
347c478bd9Sstevel@tonic-gate #endif
357c478bd9Sstevel@tonic-gate 
367c478bd9Sstevel@tonic-gate /* Keywords */
377c478bd9Sstevel@tonic-gate #define	N2LKEY			"rf_key"
387c478bd9Sstevel@tonic-gate #define	N2LIPKEY		"rf_ipkey"
397c478bd9Sstevel@tonic-gate #define	N2LSEARCHKEY		"rf_searchkey"
407c478bd9Sstevel@tonic-gate #define	N2LSEARCHIPKEY		"rf_searchipkey"
417c478bd9Sstevel@tonic-gate #define	N2LDOMAIN		"rf_domain"
427c478bd9Sstevel@tonic-gate #define	N2LCOMMENT		"rf_comment"
437c478bd9Sstevel@tonic-gate 
447c478bd9Sstevel@tonic-gate /* libldap ignores usec. Hence using 1 sec timeout */
457c478bd9Sstevel@tonic-gate #define	SINGLE_ACCESS_TIMEOUT_SEC	1
467c478bd9Sstevel@tonic-gate #define	SINGLE_ACCESS_TIMEOUT_USEC	0
477c478bd9Sstevel@tonic-gate 
487c478bd9Sstevel@tonic-gate extern __yp_domain_context_t	ypDomains;
497c478bd9Sstevel@tonic-gate 
507c478bd9Sstevel@tonic-gate extern char			*getFullMapName(char *map, char *domain);
517c478bd9Sstevel@tonic-gate extern __nis_value_t		*stringToValue(char *dptr, int dsize);
527c478bd9Sstevel@tonic-gate extern __nis_rule_value_t	*processSplitField(__nis_table_mapping_t *sf,
537c478bd9Sstevel@tonic-gate 				__nis_value_t *inVal, int *nv, int *statP);
547c478bd9Sstevel@tonic-gate extern __nis_rule_value_t	*datumToRuleValue(datum *key, datum *value,
557c478bd9Sstevel@tonic-gate 				__nis_table_mapping_t *t, int *nv,
567c478bd9Sstevel@tonic-gate 				char *domain, bool_t readonly, int *statP);
577c478bd9Sstevel@tonic-gate extern __nis_table_mapping_t	*mappingFromMap(char *map, char *domain,
587c478bd9Sstevel@tonic-gate 				int *statP);
597c478bd9Sstevel@tonic-gate extern bool_t			singleReadFromDIT(char *map, char *domain,
607c478bd9Sstevel@tonic-gate 				datum *key,
617c478bd9Sstevel@tonic-gate 				datum *value, int *statP);
627c478bd9Sstevel@tonic-gate extern suc_code			singleWriteToDIT(char *map, char *domain,
637c478bd9Sstevel@tonic-gate 				datum *key, datum *value, bool_t replace);
647c478bd9Sstevel@tonic-gate extern suc_code			buildNISRuleValue(__nis_table_mapping_t *t,
657c478bd9Sstevel@tonic-gate 				__nis_rule_value_t *rv, char *domain);
667c478bd9Sstevel@tonic-gate extern suc_code			addSplitFieldValues(__nis_table_mapping_t *t,
677c478bd9Sstevel@tonic-gate 				__nis_rule_value_t *rv, __nis_rule_value_t *trv,
687c478bd9Sstevel@tonic-gate 				int numVals, char *domain);
697c478bd9Sstevel@tonic-gate extern datum			*ruleValueToDatum(__nis_table_mapping_t *t,
707c478bd9Sstevel@tonic-gate 				__nis_rule_value_t *rv, int *statP);
717c478bd9Sstevel@tonic-gate extern datum 			*getKeyFromRuleValue(__nis_table_mapping_t *t,
72*ea10ff14SBen Chang 				__nis_rule_value_t *rv, int *nv, int *statP,
73*ea10ff14SBen Chang 				bool_t xlate_to_lcase);
747c478bd9Sstevel@tonic-gate extern const char		*getObjectClass(char *rdn);
757c478bd9Sstevel@tonic-gate extern suc_code			makeNISObject(char *domain, char *dn);
767c478bd9Sstevel@tonic-gate extern suc_code			addNISObject(char *domain, char *dn,
777c478bd9Sstevel@tonic-gate 				int *ldap_rc);
787c478bd9Sstevel@tonic-gate extern suc_code			addParent(char *dn, char **attr);
797c478bd9Sstevel@tonic-gate extern bool_t			is_fatal_error(int res);
807c478bd9Sstevel@tonic-gate extern suc_code			alloc_temp_names(char *name,
817c478bd9Sstevel@tonic-gate 				char **temp_entries, char **temp_ttl);
827c478bd9Sstevel@tonic-gate extern suc_code			collapseRuleValue(__nis_rule_value_t *rv);
837c478bd9Sstevel@tonic-gate 
847c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
857c478bd9Sstevel@tonic-gate }
867c478bd9Sstevel@tonic-gate #endif
877c478bd9Sstevel@tonic-gate 
887c478bd9Sstevel@tonic-gate #endif	/* _DIT_ACCESS_UTILS_H */
89