xref: /onnv-gate/usr/src/lib/libnisdb/yptol/dit_access_utils.h (revision 13143:317a09ef2c51)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*13143SBenjamin.Chang@Oracle.COM  * Common Development and Distribution License (the "License").
6*13143SBenjamin.Chang@Oracle.COM  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
210Sstevel@tonic-gate /*
22*13143SBenjamin.Chang@Oracle.COM  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
230Sstevel@tonic-gate  */
240Sstevel@tonic-gate 
250Sstevel@tonic-gate #ifndef _DIT_ACCESS_UTILS_H
260Sstevel@tonic-gate #define	_DIT_ACCESS_UTILS_H
270Sstevel@tonic-gate 
280Sstevel@tonic-gate #ifdef	__cplusplus
290Sstevel@tonic-gate extern "C" {
300Sstevel@tonic-gate #endif
310Sstevel@tonic-gate 
320Sstevel@tonic-gate #ifndef ERROR
330Sstevel@tonic-gate #define	ERROR	-1
340Sstevel@tonic-gate #endif
350Sstevel@tonic-gate 
360Sstevel@tonic-gate /* Keywords */
370Sstevel@tonic-gate #define	N2LKEY			"rf_key"
380Sstevel@tonic-gate #define	N2LIPKEY		"rf_ipkey"
390Sstevel@tonic-gate #define	N2LSEARCHKEY		"rf_searchkey"
400Sstevel@tonic-gate #define	N2LSEARCHIPKEY		"rf_searchipkey"
410Sstevel@tonic-gate #define	N2LDOMAIN		"rf_domain"
420Sstevel@tonic-gate #define	N2LCOMMENT		"rf_comment"
430Sstevel@tonic-gate 
440Sstevel@tonic-gate /* libldap ignores usec. Hence using 1 sec timeout */
450Sstevel@tonic-gate #define	SINGLE_ACCESS_TIMEOUT_SEC	1
460Sstevel@tonic-gate #define	SINGLE_ACCESS_TIMEOUT_USEC	0
470Sstevel@tonic-gate 
480Sstevel@tonic-gate extern __yp_domain_context_t	ypDomains;
490Sstevel@tonic-gate 
500Sstevel@tonic-gate extern char			*getFullMapName(char *map, char *domain);
510Sstevel@tonic-gate extern __nis_value_t		*stringToValue(char *dptr, int dsize);
520Sstevel@tonic-gate extern __nis_rule_value_t	*processSplitField(__nis_table_mapping_t *sf,
530Sstevel@tonic-gate 				__nis_value_t *inVal, int *nv, int *statP);
540Sstevel@tonic-gate extern __nis_rule_value_t	*datumToRuleValue(datum *key, datum *value,
550Sstevel@tonic-gate 				__nis_table_mapping_t *t, int *nv,
560Sstevel@tonic-gate 				char *domain, bool_t readonly, int *statP);
570Sstevel@tonic-gate extern __nis_table_mapping_t	*mappingFromMap(char *map, char *domain,
580Sstevel@tonic-gate 				int *statP);
590Sstevel@tonic-gate extern bool_t			singleReadFromDIT(char *map, char *domain,
600Sstevel@tonic-gate 				datum *key,
610Sstevel@tonic-gate 				datum *value, int *statP);
620Sstevel@tonic-gate extern suc_code			singleWriteToDIT(char *map, char *domain,
630Sstevel@tonic-gate 				datum *key, datum *value, bool_t replace);
640Sstevel@tonic-gate extern suc_code			buildNISRuleValue(__nis_table_mapping_t *t,
650Sstevel@tonic-gate 				__nis_rule_value_t *rv, char *domain);
660Sstevel@tonic-gate extern suc_code			addSplitFieldValues(__nis_table_mapping_t *t,
670Sstevel@tonic-gate 				__nis_rule_value_t *rv, __nis_rule_value_t *trv,
680Sstevel@tonic-gate 				int numVals, char *domain);
690Sstevel@tonic-gate extern datum			*ruleValueToDatum(__nis_table_mapping_t *t,
700Sstevel@tonic-gate 				__nis_rule_value_t *rv, int *statP);
710Sstevel@tonic-gate extern datum 			*getKeyFromRuleValue(__nis_table_mapping_t *t,
72*13143SBenjamin.Chang@Oracle.COM 				__nis_rule_value_t *rv, int *nv, int *statP,
73*13143SBenjamin.Chang@Oracle.COM 				bool_t xlate_to_lcase);
740Sstevel@tonic-gate extern const char		*getObjectClass(char *rdn);
750Sstevel@tonic-gate extern suc_code			makeNISObject(char *domain, char *dn);
760Sstevel@tonic-gate extern suc_code			addNISObject(char *domain, char *dn,
770Sstevel@tonic-gate 				int *ldap_rc);
780Sstevel@tonic-gate extern suc_code			addParent(char *dn, char **attr);
790Sstevel@tonic-gate extern bool_t			is_fatal_error(int res);
800Sstevel@tonic-gate extern suc_code			alloc_temp_names(char *name,
810Sstevel@tonic-gate 				char **temp_entries, char **temp_ttl);
820Sstevel@tonic-gate extern suc_code			collapseRuleValue(__nis_rule_value_t *rv);
830Sstevel@tonic-gate 
840Sstevel@tonic-gate #ifdef	__cplusplus
850Sstevel@tonic-gate }
860Sstevel@tonic-gate #endif
870Sstevel@tonic-gate 
880Sstevel@tonic-gate #endif	/* _DIT_ACCESS_UTILS_H */
89