2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License (the "License").
2N/A * You may not use this file except in compliance with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A/*
2N/A * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
2N/A */
2N/A
2N/A/*
2N/A * Private Header for Identity Mapping
2N/A */
2N/A
2N/A#ifndef _IDMAP_IMPL_H
2N/A#define _IDMAP_IMPL_H
2N/A
2N/A
2N/A#include <rpc/xdr.h>
2N/A#include <libscf.h>
2N/A#include <resolv.h>
2N/A
2N/A#include <rpcsvc/idmap_prot.h>
2N/A#include "idmap_priv.h"
2N/A
2N/A
2N/A
2N/A#ifdef __cplusplus
2N/Aextern "C" {
2N/A#endif
2N/A
2N/Astruct idmap_udt_handle {
2N/A idmap_update_batch batch;
2N/A uint64_t next;
2N/A int64_t error_index;
2N/A idmap_stat commit_stat;
2N/A idmap_namerule error_rule;
2N/A idmap_namerule conflict_rule;
2N/A};
2N/A
2N/A#define _IDMAP_RESET_UDT_HANDLE(uh) \
2N/A (void) xdr_free(xdr_idmap_update_batch, (caddr_t)&uh->batch);\
2N/A uh->next = 0;\
2N/A uh->error_index = -1;\
2N/A (void) xdr_free(xdr_idmap_namerule, (caddr_t)&uh->error_rule);\
2N/A (void) xdr_free(xdr_idmap_namerule, (caddr_t)&uh->conflict_rule);
2N/A
2N/Atypedef struct idmap_get_res {
2N/A idmap_id_type idtype;
2N/A uid_t *uid;
2N/A gid_t *gid;
2N/A int *is_user;
2N/A char **sidprefix;
2N/A idmap_rid_t *rid;
2N/A idmap_stat *stat;
2N/A idmap_info *info;
2N/A int cache_res;
2N/A} idmap_get_res_t;
2N/A
2N/Astruct idmap_get_handle {
2N/A idmap_mapping_batch batch;
2N/A idmap_get_res_t *retlist;
2N/A uint64_t next;
2N/A};
2N/A
2N/A#define _IDMAP_RESET_GET_HANDLE(gh) \
2N/A (void) xdr_free(xdr_idmap_mapping_batch, (caddr_t)&gh->batch);\
2N/A if (gh->retlist) \
2N/A free(gh->retlist);\
2N/A gh->retlist = NULL;\
2N/A gh->next = 0;
2N/A
2N/Astruct idmap_iter {
2N/A int type;
2N/A uint64_t limit;
2N/A void *arg;
2N/A idmap_retcode retcode;
2N/A uint64_t lastrowid;
2N/A uint64_t next;
2N/A void *retlist;
2N/A};
2N/A
2N/Atypedef struct stat_table {
2N/A idmap_retcode retcode;
2N/A const char *msg;
2N/A int errnum;
2N/A} stat_table_t;
2N/A
2N/Atypedef idmap_retcode _idmap_stat;
2N/A
2N/Aextern idmap_stat _idmap_clnt_call(const rpcproc_t,
2N/A const xdrproc_t, const caddr_t,
2N/A const xdrproc_t, caddr_t out,
2N/A const struct timeval);
2N/A
2N/Aextern idmap_retcode _udt_extend_batch(idmap_udt_handle_t *);
2N/Aextern idmap_retcode _get_ids_extend_batch(idmap_get_handle_t *);
2N/Aextern idmap_stat _iter_get_next_list(int, idmap_iter_t *, void *,
2N/A uchar_t **, size_t, xdrproc_t, xdrproc_t);
2N/A
2N/Aextern idmap_logger_t logger;
2N/A
2N/A#ifdef __cplusplus
2N/A}
2N/A#endif
2N/A
2N/A#endif /* _IDMAP_IMPL_H */