1*7c478bd9Sstevel@tonic-gate /* 2*7c478bd9Sstevel@tonic-gate * CDDL HEADER START 3*7c478bd9Sstevel@tonic-gate * 4*7c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*7c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 6*7c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 7*7c478bd9Sstevel@tonic-gate * with the License. 8*7c478bd9Sstevel@tonic-gate * 9*7c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*7c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 11*7c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 12*7c478bd9Sstevel@tonic-gate * and limitations under the License. 13*7c478bd9Sstevel@tonic-gate * 14*7c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 15*7c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*7c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 17*7c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 18*7c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 19*7c478bd9Sstevel@tonic-gate * 20*7c478bd9Sstevel@tonic-gate * CDDL HEADER END 21*7c478bd9Sstevel@tonic-gate * 22*7c478bd9Sstevel@tonic-gate * Copyright 1997 Sun Microsystems, Inc. All rights reserved. 23*7c478bd9Sstevel@tonic-gate * Use is subject to license terms. 24*7c478bd9Sstevel@tonic-gate */ 25*7c478bd9Sstevel@tonic-gate 26*7c478bd9Sstevel@tonic-gate /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */ 27*7c478bd9Sstevel@tonic-gate /* All Rights Reserved */ 28*7c478bd9Sstevel@tonic-gate 29*7c478bd9Sstevel@tonic-gate /* 30*7c478bd9Sstevel@tonic-gate * Portions of this source code were derived from Berkeley 31*7c478bd9Sstevel@tonic-gate * under license from the Regents of the University of 32*7c478bd9Sstevel@tonic-gate * California. 33*7c478bd9Sstevel@tonic-gate */ 34*7c478bd9Sstevel@tonic-gate 35*7c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 36*7c478bd9Sstevel@tonic-gate 37*7c478bd9Sstevel@tonic-gate #include <rpc/rpc.h> 38*7c478bd9Sstevel@tonic-gate #include <sys/time.h> 39*7c478bd9Sstevel@tonic-gate #include <sys/types.h> 40*7c478bd9Sstevel@tonic-gate #include <rpc/trace.h> 41*7c478bd9Sstevel@tonic-gate #include "yp_b.h" 42*7c478bd9Sstevel@tonic-gate #define bzero(a, b) (void) memset(a, 0, b) 43*7c478bd9Sstevel@tonic-gate #define YPBIND_ERR_ERR 1 /* Internal error */ 44*7c478bd9Sstevel@tonic-gate #define YPBIND_ERR_NOSERV 2 /* No bound server for passed domain */ 45*7c478bd9Sstevel@tonic-gate #define YPBIND_ERR_RESC 3 /* System resource allocation failure */ 46*7c478bd9Sstevel@tonic-gate #define YPBIND_ERR_NODOMAIN 4 /* Domain doesn't exist */ 47*7c478bd9Sstevel@tonic-gate 48*7c478bd9Sstevel@tonic-gate /* Default timeout can be changed using clnt_control() */ 49*7c478bd9Sstevel@tonic-gate static struct timeval TIMEOUT = { 25, 0 }; 50*7c478bd9Sstevel@tonic-gate 51*7c478bd9Sstevel@tonic-gate void * 52*7c478bd9Sstevel@tonic-gate ypbindproc_null_3(argp, clnt) 53*7c478bd9Sstevel@tonic-gate void *argp; 54*7c478bd9Sstevel@tonic-gate CLIENT *clnt; 55*7c478bd9Sstevel@tonic-gate { 56*7c478bd9Sstevel@tonic-gate static char res; 57*7c478bd9Sstevel@tonic-gate 58*7c478bd9Sstevel@tonic-gate trace2(TR_ypbindproc_null_3, 0, clnt); 59*7c478bd9Sstevel@tonic-gate bzero((char *)&res, sizeof (res)); 60*7c478bd9Sstevel@tonic-gate if (clnt_call(clnt, YPBINDPROC_NULL, xdr_void, 61*7c478bd9Sstevel@tonic-gate argp, xdr_void, &res, TIMEOUT) != RPC_SUCCESS) { 62*7c478bd9Sstevel@tonic-gate trace1(TR_ypbindproc_null_3, 1); 63*7c478bd9Sstevel@tonic-gate return (NULL); 64*7c478bd9Sstevel@tonic-gate } 65*7c478bd9Sstevel@tonic-gate trace1(TR_ypbindproc_null_3, 1); 66*7c478bd9Sstevel@tonic-gate return ((void *)&res); 67*7c478bd9Sstevel@tonic-gate } 68*7c478bd9Sstevel@tonic-gate 69*7c478bd9Sstevel@tonic-gate ypbind_resp * 70*7c478bd9Sstevel@tonic-gate ypbindproc_domain_3(argp, clnt) 71*7c478bd9Sstevel@tonic-gate ypbind_domain *argp; 72*7c478bd9Sstevel@tonic-gate CLIENT *clnt; 73*7c478bd9Sstevel@tonic-gate { 74*7c478bd9Sstevel@tonic-gate static ypbind_resp res; 75*7c478bd9Sstevel@tonic-gate 76*7c478bd9Sstevel@tonic-gate trace2(TR_ypbindproc_domain_3, 0, clnt); 77*7c478bd9Sstevel@tonic-gate bzero((char *)&res, sizeof (res)); 78*7c478bd9Sstevel@tonic-gate if (clnt_call(clnt, YPBINDPROC_DOMAIN, 79*7c478bd9Sstevel@tonic-gate xdr_ypbind_domain, (char *)argp, xdr_ypbind_resp, 80*7c478bd9Sstevel@tonic-gate (char *)&res, TIMEOUT) != RPC_SUCCESS) { 81*7c478bd9Sstevel@tonic-gate trace1(TR_ypbindproc_domain_3, 1); 82*7c478bd9Sstevel@tonic-gate return (NULL); 83*7c478bd9Sstevel@tonic-gate } 84*7c478bd9Sstevel@tonic-gate trace1(TR_ypbindproc_domain_3, 1); 85*7c478bd9Sstevel@tonic-gate return (&res); 86*7c478bd9Sstevel@tonic-gate } 87*7c478bd9Sstevel@tonic-gate 88*7c478bd9Sstevel@tonic-gate void * 89*7c478bd9Sstevel@tonic-gate ypbindproc_setdom_3(argp, clnt) 90*7c478bd9Sstevel@tonic-gate ypbind_setdom *argp; 91*7c478bd9Sstevel@tonic-gate CLIENT *clnt; 92*7c478bd9Sstevel@tonic-gate { 93*7c478bd9Sstevel@tonic-gate static char res; 94*7c478bd9Sstevel@tonic-gate 95*7c478bd9Sstevel@tonic-gate trace2(TR_ypbindproc_setdom_3, 0, clnt); 96*7c478bd9Sstevel@tonic-gate bzero((char *)&res, sizeof (res)); 97*7c478bd9Sstevel@tonic-gate if (clnt_call(clnt, YPBINDPROC_SETDOM, 98*7c478bd9Sstevel@tonic-gate xdr_ypbind_setdom, (char *)argp, xdr_void, &res, 99*7c478bd9Sstevel@tonic-gate TIMEOUT) != RPC_SUCCESS) { 100*7c478bd9Sstevel@tonic-gate trace1(TR_ypbindproc_setdom_3, 1); 101*7c478bd9Sstevel@tonic-gate return (NULL); 102*7c478bd9Sstevel@tonic-gate } 103*7c478bd9Sstevel@tonic-gate trace1(TR_ypbindproc_setdom_3, 1); 104*7c478bd9Sstevel@tonic-gate return ((void *)&res); 105*7c478bd9Sstevel@tonic-gate } 106