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 /* 22c5866007SKeyur Desai * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. 23c5c4113dSnw */ 24c5c4113dSnw 25c5c4113dSnw /* 26c5c4113dSnw * Private Header for Identity Mapping 27c5c4113dSnw */ 28c5c4113dSnw 29c5c4113dSnw #ifndef _IDMAP_IMPL_H 30c5c4113dSnw #define _IDMAP_IMPL_H 31c5c4113dSnw 32c5c4113dSnw 33479ac375Sdm #include <rpc/xdr.h> 34479ac375Sdm #include <libscf.h> 35479ac375Sdm #include <resolv.h> 36479ac375Sdm 379b214d32SJordan Brown #include <rpcsvc/idmap_prot.h> 38c5c4113dSnw #include "idmap_priv.h" 397a8a68f5SJulian Pullen 40479ac375Sdm 41c5c4113dSnw 42c5c4113dSnw #ifdef __cplusplus 43c5c4113dSnw extern "C" { 44c5c4113dSnw #endif 45c5c4113dSnw 46c5c4113dSnw struct idmap_udt_handle { 47c5c4113dSnw idmap_update_batch batch; 48c5c4113dSnw uint64_t next; 498e228215Sdm int64_t error_index; 508e228215Sdm idmap_stat commit_stat; 518e228215Sdm idmap_namerule error_rule; 528e228215Sdm idmap_namerule conflict_rule; 53c5c4113dSnw }; 54c5c4113dSnw 55651c0131Sbaban #define _IDMAP_RESET_UDT_HANDLE(uh) \ 56*a17ce845SMarcel Telka xdr_free(xdr_idmap_update_batch, (caddr_t)&uh->batch);\ 578e228215Sdm uh->next = 0;\ 588e228215Sdm uh->error_index = -1;\ 59*a17ce845SMarcel Telka xdr_free(xdr_idmap_namerule, (caddr_t)&uh->error_rule);\ 60*a17ce845SMarcel Telka xdr_free(xdr_idmap_namerule, (caddr_t)&uh->conflict_rule); 61651c0131Sbaban 62c5c4113dSnw typedef struct idmap_get_res { 63c5c4113dSnw idmap_id_type idtype; 64c5c4113dSnw uid_t *uid; 65c5c4113dSnw gid_t *gid; 66c5c4113dSnw int *is_user; 67c5c4113dSnw char **sidprefix; 68c5c4113dSnw idmap_rid_t *rid; 69c5c4113dSnw idmap_stat *stat; 7048258c6bSjp idmap_info *info; 713ee87bcaSJulian Pullen int cache_res; 72c5c4113dSnw } idmap_get_res_t; 73c5c4113dSnw 74c5c4113dSnw struct idmap_get_handle { 75c5c4113dSnw idmap_mapping_batch batch; 76c5c4113dSnw idmap_get_res_t *retlist; 77c5c4113dSnw uint64_t next; 78c5c4113dSnw }; 79c5c4113dSnw 80651c0131Sbaban #define _IDMAP_RESET_GET_HANDLE(gh) \ 81*a17ce845SMarcel Telka xdr_free(xdr_idmap_mapping_batch, (caddr_t)&gh->batch);\ 82651c0131Sbaban if (gh->retlist) \ 83651c0131Sbaban free(gh->retlist);\ 84651c0131Sbaban gh->retlist = NULL;\ 85651c0131Sbaban gh->next = 0; 86651c0131Sbaban 87c5c4113dSnw struct idmap_iter { 88c5c4113dSnw int type; 89c5c4113dSnw uint64_t limit; 90c5c4113dSnw void *arg; 91c5c4113dSnw idmap_retcode retcode; 92c5c4113dSnw uint64_t lastrowid; 93c5c4113dSnw uint64_t next; 94c5c4113dSnw void *retlist; 95c5c4113dSnw }; 96c5c4113dSnw 97c5c4113dSnw typedef struct stat_table { 98c5c4113dSnw idmap_retcode retcode; 99c5c4113dSnw const char *msg; 100c5c4113dSnw int errnum; 101c5c4113dSnw } stat_table_t; 102c5c4113dSnw 103c5c4113dSnw typedef idmap_retcode _idmap_stat; 104c5c4113dSnw 1051fdeec65Sjoyce mcintosh extern idmap_stat _idmap_clnt_call(const rpcproc_t, 1061fdeec65Sjoyce mcintosh const xdrproc_t, const caddr_t, 1071fdeec65Sjoyce mcintosh const xdrproc_t, caddr_t out, 1081fdeec65Sjoyce mcintosh const struct timeval); 1091fdeec65Sjoyce mcintosh 110651c0131Sbaban extern idmap_retcode _udt_extend_batch(idmap_udt_handle_t *); 111c5c4113dSnw extern idmap_retcode _get_ids_extend_batch(idmap_get_handle_t *); 112c5c4113dSnw extern idmap_stat _iter_get_next_list(int, idmap_iter_t *, void *, 113c5c4113dSnw uchar_t **, size_t, xdrproc_t, xdrproc_t); 114c5c4113dSnw 115c5866007SKeyur Desai extern idmap_logger_t logger; 116479ac375Sdm 117c5c4113dSnw #ifdef __cplusplus 118c5c4113dSnw } 119c5c4113dSnw #endif 120c5c4113dSnw 121c5c4113dSnw #endif /* _IDMAP_IMPL_H */ 122