1c5c4113dSnw /*
2c5c4113dSnw  * CDDL HEADER START
3c5c4113dSnw  *
4c5c4113dSnw  * The contents of this file are subject to the terms of the
5c5c4113dSnw  * Common Development and Distribution License (the "License").
6c5c4113dSnw  * You may not use this file except in compliance with the License.
7c5c4113dSnw  *
8c5c4113dSnw  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9c5c4113dSnw  * or http://www.opensolaris.org/os/licensing.
10c5c4113dSnw  * See the License for the specific language governing permissions
11c5c4113dSnw  * and limitations under the License.
12c5c4113dSnw  *
13c5c4113dSnw  * When distributing Covered Code, include this CDDL HEADER in each
14c5c4113dSnw  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15c5c4113dSnw  * If applicable, add the following below this CDDL HEADER, with the
16c5c4113dSnw  * fields enclosed by brackets "[]" replaced with your own identifying
17c5c4113dSnw  * information: Portions Copyright [yyyy] [name of copyright owner]
18c5c4113dSnw  *
19c5c4113dSnw  * CDDL HEADER END
20c5c4113dSnw  */
21c5c4113dSnw /*
22148c5f43SAlan Wright  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
23*fea136a0SMatt Barden  * Copyright 2018 Nexenta Systems, Inc.  All rights reserved.
24c5c4113dSnw  */
26c5c4113dSnw #ifndef _IDMAP_CONFIG_H
27c5c4113dSnw #define	_IDMAP_CONFIG_H
30c5c4113dSnw #include "idmap.h"
31c8e26105Sjp #include "addisc.h"
32c5c4113dSnw #include <libscf.h>
33c5c4113dSnw #include <synch.h>
34b3700b07SGordon Ross #include <sys/uuid.h>
36c5c4113dSnw #ifdef __cplusplus
37c5c4113dSnw extern "C" {
38c5c4113dSnw #endif
40c5c4113dSnw #define	MAX_POLICY_SIZE 1023
42e3f2c991SKeyur Desai #define	DIRECTORY_MAPPING_NONE	0
43e3f2c991SKeyur Desai #define	DIRECTORY_MAPPING_NAME	1
44e3f2c991SKeyur Desai #define	DIRECTORY_MAPPING_IDMU	2
45e3f2c991SKeyur Desai 
46e3f2c991SKeyur Desai struct enum_lookup_map {
47e3f2c991SKeyur Desai 	int value;
48e3f2c991SKeyur Desai 	char *string;
49e3f2c991SKeyur Desai };
50e3f2c991SKeyur Desai 
51e3f2c991SKeyur Desai extern struct enum_lookup_map directory_mapping_map[];
52e3f2c991SKeyur Desai extern const char *enum_lookup(int value, struct enum_lookup_map *map);
53e3f2c991SKeyur Desai 
54c8e26105Sjp /* SMF and auto-discovery context handles */
55c8e26105Sjp typedef struct idmap_cfg_handles {
56c8e26105Sjp 	pthread_mutex_t		mutex;
57c5c4113dSnw 	scf_handle_t		*main;
58c5c4113dSnw 	scf_instance_t		*instance;
59c5c4113dSnw 	scf_service_t		*service;