cb5caa98562cf06753163f558cbcfe30b8f4673adjl/*
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * CDDL HEADER START
cb5caa98562cf06753163f558cbcfe30b8f4673adjl *
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * The contents of this file are subject to the terms of the
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * Common Development and Distribution License (the "License").
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * You may not use this file except in compliance with the License.
cb5caa98562cf06753163f558cbcfe30b8f4673adjl *
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * or http://www.opensolaris.org/os/licensing.
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * See the License for the specific language governing permissions
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * and limitations under the License.
cb5caa98562cf06753163f558cbcfe30b8f4673adjl *
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * When distributing Covered Code, include this CDDL HEADER in each
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * If applicable, add the following below this CDDL HEADER, with the
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * fields enclosed by brackets "[]" replaced with your own identifying
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * information: Portions Copyright [yyyy] [name of copyright owner]
cb5caa98562cf06753163f558cbcfe30b8f4673adjl *
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * CDDL HEADER END
cb5caa98562cf06753163f558cbcfe30b8f4673adjl */
cb5caa98562cf06753163f558cbcfe30b8f4673adjl/*
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * Use is subject to license terms.
cb5caa98562cf06753163f558cbcfe30b8f4673adjl */
cb5caa98562cf06753163f558cbcfe30b8f4673adjl
cb5caa98562cf06753163f558cbcfe30b8f4673adjl#pragma ident "%Z%%M% %I% %E% SMI"
cb5caa98562cf06753163f558cbcfe30b8f4673adjl
cb5caa98562cf06753163f558cbcfe30b8f4673adjl/*
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * Routines to handle getrpcby* calls in nscd
cb5caa98562cf06753163f558cbcfe30b8f4673adjl */
cb5caa98562cf06753163f558cbcfe30b8f4673adjl
cb5caa98562cf06753163f558cbcfe30b8f4673adjl#include "cache.h"
cb5caa98562cf06753163f558cbcfe30b8f4673adjl
cb5caa98562cf06753163f558cbcfe30b8f4673adjl#define nam_db ctx->nsc_db[0]
cb5caa98562cf06753163f558cbcfe30b8f4673adjl#define num_db ctx->nsc_db[1]
cb5caa98562cf06753163f558cbcfe30b8f4673adjl
cb5caa98562cf06753163f558cbcfe30b8f4673adjl#define NSC_NAME_RPC_BYNAME "getrpcbyname"
cb5caa98562cf06753163f558cbcfe30b8f4673adjl#define NSC_NAME_RPC_BYNUMBER "getrpcbynumber"
cb5caa98562cf06753163f558cbcfe30b8f4673adjl
cb5caa98562cf06753163f558cbcfe30b8f4673adjlvoid
cb5caa98562cf06753163f558cbcfe30b8f4673adjlrpc_init_ctx(nsc_ctx_t *ctx) {
cb5caa98562cf06753163f558cbcfe30b8f4673adjl ctx->dbname = NSS_DBNAM_RPC;
cb5caa98562cf06753163f558cbcfe30b8f4673adjl ctx->file_name = "/etc/rpc";
cb5caa98562cf06753163f558cbcfe30b8f4673adjl ctx->db_count = 2;
cb5caa98562cf06753163f558cbcfe30b8f4673adjl nam_db = make_cache(nsc_key_ces,
cb5caa98562cf06753163f558cbcfe30b8f4673adjl NSS_DBOP_RPC_BYNAME,
cb5caa98562cf06753163f558cbcfe30b8f4673adjl NSC_NAME_RPC_BYNAME,
cb5caa98562cf06753163f558cbcfe30b8f4673adjl NULL, NULL, NULL, nsc_ht_default, -1);
cb5caa98562cf06753163f558cbcfe30b8f4673adjl
cb5caa98562cf06753163f558cbcfe30b8f4673adjl num_db = make_cache(nsc_key_int,
cb5caa98562cf06753163f558cbcfe30b8f4673adjl NSS_DBOP_RPC_BYNUMBER,
cb5caa98562cf06753163f558cbcfe30b8f4673adjl NSC_NAME_RPC_BYNUMBER,
cb5caa98562cf06753163f558cbcfe30b8f4673adjl NULL, NULL, NULL, nsc_ht_default, -1);
cb5caa98562cf06753163f558cbcfe30b8f4673adjl}