idmap_priv.h revision 61b364a9162c5e321625fcd2f640da7e1dd2417e
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Additional API for Identity Mapping Service
*/
#ifndef _IDMAP_PRIV_H
#define _IDMAP_PRIV_H
#pragma ident "%Z%%M% %I% %E% SMI"
#include <libscf.h>
#include <syslog.h>
#include <resolv.h>
#include "idmap.h"
#include "idmap_prot.h"
#ifdef __cplusplus
extern "C" {
#endif
#define IDMAP_MAX_NAME_LEN 512
rc == IDMAP_ERR_DB)
/* is_user values */
#define IDMAP_YES 1
#define IDMAP_NO 0
#define IDMAP_UNKNOWN -1
typedef struct idmap_udt_handle idmap_udt_handle_t;
/* Opaque iterator */
typedef struct idmap_iter idmap_iter_t;
/*
* Directory based name map API
*/
typedef struct idmap_nm_handle idmap_nm_handle_t;
/* Set namemap */
int, int, int);
/* Unset namemap */
int, int, int);
char **, int *, char **, char **);
extern void idmap_fini_namemaps(idmap_nm_handle_t *);
char *, char *, char *, char *, int);
/*
* Update API
*/
/* Create handle for updates */
idmap_udt_handle_t **);
/* Commit */
/* Get index of the failed batch element */
/* Get the rule which caused the batch to failed */
/* Get the rule which caused a conflict */
/* Destroy the update handle */
extern void idmap_udt_destroy(idmap_udt_handle_t *);
/* Add name-based mapping rule */
/* Remove name-based mapping rule */
boolean_t, const char *, const char *, const char *, int);
/* Flush name-based mapping rules */
/*
* Iterator API
*/
int flag);
boolean_t *, int *, idmap_info *);
/* Create a iterator to get name-based mapping rules */
/* Iterate through the name-based mapping rules */
/* Set the number of entries requested per batch */
/* Destroy the iterator */
extern void idmap_iter_destroy(idmap_iter_t *);
/*
* Get mapping
*/
idmap_rid_t *, const char *, const char *, int, int *, int *,
uid_t *, char **, int *, idmap_info *);
const char *, int, int, int *, char **, idmap_rid_t *, char **,
char **, int *, idmap_info *);
/*
* Miscellaneous
*/
/* string to status */
extern idmap_stat idmap_string2stat(const char *);
/* internal status to protocol status */
/* copy idmap_namerule including strings */
/* copy idmap_info info including strings */
/* Move idmap_info info including strings */
/* free idmap_info info from user supplied struct */
extern void idmap_info_free(idmap_info *);
/*
*/
/* Given SID, get UID */
/* Given SID, get GID */
/* Given SID, get UID or GID */
/* Given UID, get SID */
/* Given GID, get SID */
/* logging */
extern void idmapdlog(int, const char *, ...);
/*
* The maximal priority to be logged to stderr: set to -1 to suppress
* stderr logging completely.
*/
extern void idmap_log_stderr(int);
/* write log messages to syslog? */
extern void idmap_log_syslog(bool_t);
/* write log messages to syslog? */
extern void idmap_log_degraded(bool_t);
#ifdef __cplusplus
}
#endif
#endif /* _IDMAP_PRIV_H */