1*7c478bd9Sstevel@tonic-gate %/* 2*7c478bd9Sstevel@tonic-gate % * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 3*7c478bd9Sstevel@tonic-gate % * Use is subject to license terms. 4*7c478bd9Sstevel@tonic-gate % * 5*7c478bd9Sstevel@tonic-gate % * CDDL HEADER START 6*7c478bd9Sstevel@tonic-gate % * 7*7c478bd9Sstevel@tonic-gate % * The contents of this file are subject to the terms of the 8*7c478bd9Sstevel@tonic-gate % * Common Development and Distribution License, Version 1.0 only 9*7c478bd9Sstevel@tonic-gate % * (the "License"). You may not use this file except in compliance 10*7c478bd9Sstevel@tonic-gate % * with the License. 11*7c478bd9Sstevel@tonic-gate % * 12*7c478bd9Sstevel@tonic-gate % * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 13*7c478bd9Sstevel@tonic-gate % * or http://www.opensolaris.org/os/licensing. 14*7c478bd9Sstevel@tonic-gate % * See the License for the specific language governing permissions 15*7c478bd9Sstevel@tonic-gate % * and limitations under the License. 16*7c478bd9Sstevel@tonic-gate % * 17*7c478bd9Sstevel@tonic-gate % * When distributing Covered Code, include this CDDL HEADER in each 18*7c478bd9Sstevel@tonic-gate % * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 19*7c478bd9Sstevel@tonic-gate % * If applicable, add the following below this CDDL HEADER, with the 20*7c478bd9Sstevel@tonic-gate % * fields enclosed by brackets "[]" replaced with your own identifying 21*7c478bd9Sstevel@tonic-gate % * information: Portions Copyright [yyyy] [name of copyright owner] 22*7c478bd9Sstevel@tonic-gate % * 23*7c478bd9Sstevel@tonic-gate % * CDDL HEADER END 24*7c478bd9Sstevel@tonic-gate % */ 25*7c478bd9Sstevel@tonic-gate % 26*7c478bd9Sstevel@tonic-gate %#pragma ident "%Z%%M% %I% %E% SMI" 27*7c478bd9Sstevel@tonic-gate % 28*7c478bd9Sstevel@tonic-gate 29*7c478bd9Sstevel@tonic-gate #ifdef RPC_SVC 30*7c478bd9Sstevel@tonic-gate % 31*7c478bd9Sstevel@tonic-gate %int mdc_in_daemon = 1; 32*7c478bd9Sstevel@tonic-gate %#include <signal.h> 33*7c478bd9Sstevel@tonic-gate #endif /* RPC_SVC */ 34*7c478bd9Sstevel@tonic-gate 35*7c478bd9Sstevel@tonic-gate #ifdef RPC_HDR 36*7c478bd9Sstevel@tonic-gate %#ifndef STRINGARRAY 37*7c478bd9Sstevel@tonic-gate #endif 38*7c478bd9Sstevel@tonic-gate typedef string stringarray<>; 39*7c478bd9Sstevel@tonic-gate #ifdef RPC_HDR 40*7c478bd9Sstevel@tonic-gate %#define STRINGARRAY 41*7c478bd9Sstevel@tonic-gate %#endif 42*7c478bd9Sstevel@tonic-gate #endif 43*7c478bd9Sstevel@tonic-gate 44*7c478bd9Sstevel@tonic-gate struct mdc_err_t { 45*7c478bd9Sstevel@tonic-gate int mdc_errno; /* errno or negative error code */ 46*7c478bd9Sstevel@tonic-gate int mdc_exitcode; /* child exit code. */ 47*7c478bd9Sstevel@tonic-gate string mdc_node<>; /* associated node */ 48*7c478bd9Sstevel@tonic-gate string mdc_misc<>; /* misc text */ 49*7c478bd9Sstevel@tonic-gate }; 50*7c478bd9Sstevel@tonic-gate 51*7c478bd9Sstevel@tonic-gate % 52*7c478bd9Sstevel@tonic-gate %/* 53*7c478bd9Sstevel@tonic-gate % * rpc argument and response structures 54*7c478bd9Sstevel@tonic-gate % */ 55*7c478bd9Sstevel@tonic-gate struct mdc_bind_res_t { 56*7c478bd9Sstevel@tonic-gate mdc_err_t mdc_status; /* status of RPC call */ 57*7c478bd9Sstevel@tonic-gate }; 58*7c478bd9Sstevel@tonic-gate 59*7c478bd9Sstevel@tonic-gate struct mdcrpc_proxy_args_t { 60*7c478bd9Sstevel@tonic-gate stringarray argvlist<>; 61*7c478bd9Sstevel@tonic-gate stringarray environment<>; 62*7c478bd9Sstevel@tonic-gate }; 63*7c478bd9Sstevel@tonic-gate 64*7c478bd9Sstevel@tonic-gate #ifdef RPC_CLNT 65*7c478bd9Sstevel@tonic-gate %int _mdc_in_daemon = 0; 66*7c478bd9Sstevel@tonic-gate %#pragma weak mdc_in_daemon = _mdc_in_daemon 67*7c478bd9Sstevel@tonic-gate %void mdc_clrerror(mdc_err_t *mdcep); 68*7c478bd9Sstevel@tonic-gate 69*7c478bd9Sstevel@tonic-gate #endif /* RPC_CLNT */ 70*7c478bd9Sstevel@tonic-gate 71*7c478bd9Sstevel@tonic-gate #ifdef RPC_HDR 72*7c478bd9Sstevel@tonic-gate % 73*7c478bd9Sstevel@tonic-gate %extern int mdc_in_daemon; 74*7c478bd9Sstevel@tonic-gate % 75*7c478bd9Sstevel@tonic-gate %/* 76*7c478bd9Sstevel@tonic-gate % * Null error structure initializer. 77*7c478bd9Sstevel@tonic-gate % */ 78*7c478bd9Sstevel@tonic-gate %#define MDC_NULL_ERR { 0, NULL, NULL } 79*7c478bd9Sstevel@tonic-gate %#define MD_MDC_DEF_TO {5, 0} /* 5 seconds */ 80*7c478bd9Sstevel@tonic-gate %#define MD_MDC_PMAP_TO {35, 0} /* 35 seconds */ 81*7c478bd9Sstevel@tonic-gate %#define MD_MDC_PROXY_TO {60 * 60, 0 } /* 1hr */ 82*7c478bd9Sstevel@tonic-gate % 83*7c478bd9Sstevel@tonic-gate %/* 84*7c478bd9Sstevel@tonic-gate % * various cluster errors, definition of MDC_NOTINCLUSTER must be changed 85*7c478bd9Sstevel@tonic-gate % * when new errors are added, since MDC_NOERROR has to come out to 86*7c478bd9Sstevel@tonic-gate % * be zero! 87*7c478bd9Sstevel@tonic-gate % */ 88*7c478bd9Sstevel@tonic-gate enum mdc_errno_t { 89*7c478bd9Sstevel@tonic-gate MDC_PROXYKILLED = -13, /* remote was killed by signal */ 90*7c478bd9Sstevel@tonic-gate MDC_PROXYNOFORK, /* could not fork remote */ 91*7c478bd9Sstevel@tonic-gate MDC_PROXYFAILED, /* remote exited non-zero */ 92*7c478bd9Sstevel@tonic-gate MDC_NOTINCLUSTER, /* host is not a node */ 93*7c478bd9Sstevel@tonic-gate MDC_NOACCESS, 94*7c478bd9Sstevel@tonic-gate MDC_NOACCESS_CCR, 95*7c478bd9Sstevel@tonic-gate MDC_RPCFAILED, 96*7c478bd9Sstevel@tonic-gate BIND_LINKISDIR, 97*7c478bd9Sstevel@tonic-gate BIND_NOACCESS_SHARED, 98*7c478bd9Sstevel@tonic-gate BIND_LOCALSET, 99*7c478bd9Sstevel@tonic-gate BIND_NODISKSETCLASS, 100*7c478bd9Sstevel@tonic-gate BIND_NOACCESS_DEVICE, 101*7c478bd9Sstevel@tonic-gate BIND_BADDEVICE, 102*7c478bd9Sstevel@tonic-gate MDC_NOERROR 103*7c478bd9Sstevel@tonic-gate }; 104*7c478bd9Sstevel@tonic-gate 105*7c478bd9Sstevel@tonic-gate % 106*7c478bd9Sstevel@tonic-gate %/* 107*7c478bd9Sstevel@tonic-gate % * Set MDC_THISVERS to the newest version of the protocol 108*7c478bd9Sstevel@tonic-gate % * This allows the preprocessor to force an error if the 109*7c478bd9Sstevel@tonic-gate % * protocol changes, since the kernel xdr routines may need to be 110*7c478bd9Sstevel@tonic-gate % * recoded. Note that we can't explicitly set the version to a 111*7c478bd9Sstevel@tonic-gate % * symbol as rpcgen will then create erroneous routine names. 112*7c478bd9Sstevel@tonic-gate % */ 113*7c478bd9Sstevel@tonic-gate %#define MDC_V1 1 114*7c478bd9Sstevel@tonic-gate %#define MDC_ORIGVERS MDC_V1 115*7c478bd9Sstevel@tonic-gate %#define MDC_THISVERS 1 116*7c478bd9Sstevel@tonic-gate % 117*7c478bd9Sstevel@tonic-gate %/* All powerful group 14 */ 118*7c478bd9Sstevel@tonic-gate %#define MDC_GID 14 119*7c478bd9Sstevel@tonic-gate % 120*7c478bd9Sstevel@tonic-gate %/* 121*7c478bd9Sstevel@tonic-gate % * External reference to constant null error struct. (declared in med_xdr.c) 122*7c478bd9Sstevel@tonic-gate % */ 123*7c478bd9Sstevel@tonic-gate %extern const mdc_err_t mdc_null_err; 124*7c478bd9Sstevel@tonic-gate %extern const struct timeval md_mdc_def_timeout; 125*7c478bd9Sstevel@tonic-gate %extern const struct timeval md_mdc_pmap_timeout; 126*7c478bd9Sstevel@tonic-gate %extern const struct timeval md_mdc_proxy_timeout; 127*7c478bd9Sstevel@tonic-gate % 128*7c478bd9Sstevel@tonic-gate %/* 129*7c478bd9Sstevel@tonic-gate % * Some useful defines 130*7c478bd9Sstevel@tonic-gate % */ 131*7c478bd9Sstevel@tonic-gate %#define MDC_SERVNAME "rpc.metacld" 132*7c478bd9Sstevel@tonic-gate %#define MDC_SVC "metacl" 133*7c478bd9Sstevel@tonic-gate % 134*7c478bd9Sstevel@tonic-gate #endif /* RPC_HDR */ 135*7c478bd9Sstevel@tonic-gate 136*7c478bd9Sstevel@tonic-gate #ifdef RPC_XDR 137*7c478bd9Sstevel@tonic-gate % 138*7c478bd9Sstevel@tonic-gate %/* 139*7c478bd9Sstevel@tonic-gate % * Constant null error struct. 140*7c478bd9Sstevel@tonic-gate % */ 141*7c478bd9Sstevel@tonic-gate %const mdc_err_t mdc_null_err = MDC_NULL_ERR; 142*7c478bd9Sstevel@tonic-gate %const struct timeval md_mdc_def_timeout = MD_MDC_DEF_TO; 143*7c478bd9Sstevel@tonic-gate %const struct timeval md_mdc_pmap_timeout = MD_MDC_PMAP_TO; 144*7c478bd9Sstevel@tonic-gate %const struct timeval md_mdc_proxy_timeout = MD_MDC_PROXY_TO; 145*7c478bd9Sstevel@tonic-gate 146*7c478bd9Sstevel@tonic-gate #endif /* RPC_XDR */ 147*7c478bd9Sstevel@tonic-gate 148*7c478bd9Sstevel@tonic-gate 149*7c478bd9Sstevel@tonic-gate % 150*7c478bd9Sstevel@tonic-gate %/* 151*7c478bd9Sstevel@tonic-gate % * services available 152*7c478bd9Sstevel@tonic-gate % */ 153*7c478bd9Sstevel@tonic-gate program MDC_PROG { 154*7c478bd9Sstevel@tonic-gate version MDC_VERS { 155*7c478bd9Sstevel@tonic-gate mdc_bind_res_t mdc_null(void) = 0; 156*7c478bd9Sstevel@tonic-gate mdc_bind_res_t mdc_bind_devs(void) = 1; 157*7c478bd9Sstevel@tonic-gate mdc_bind_res_t mdc_proxy(mdcrpc_proxy_args_t) = 2; 158*7c478bd9Sstevel@tonic-gate } = 1; 159*7c478bd9Sstevel@tonic-gate } = 100281; 160