/* * Please do not edit this file. * It was generated using rpcgen. */ #include "smed.h" #include #include /* getenv, exit */ #include #include #include #include #include /* rlimit */ #include #ifdef DEBUG #define RPC_SVC_FG #endif #define _RPCSVC_CLOSEDOWN 120 /* * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. * * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License, Version 1.0 only * (the "License"). You may not use this file except in compliance * with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* from smed.x */ extern int _rpcpmstart; /* Started by a port monitor ? */ /* States a server can be in wrt request */ #define _IDLE 0 #define _SERVED 1 /* LINTED static unused if no main */ static int _rpcsvcstate = _IDLE; /* Set when a request is serviced */ static int _rpcsvccount = 0; /* Number of requests being serviced */ #if defined(RPC_MSGOUT) extern void RPC_MSGOUT(); #else /* defined(RPC_MSGOUT) */ static void RPC_MSGOUT(fmt, msg) char *fmt; char *msg; { #ifdef RPC_SVC_FG if (_rpcpmstart) syslog(LOG_ERR, fmt, msg); else { (void) fprintf(stderr, fmt, msg); (void) putc('\n', stderr); } #else syslog(LOG_ERR, fmt, msg); #endif } #endif /* defined(RPC_MSGOUT) */ void smserverprog_1(rqstp, transp) struct svc_req *rqstp; register SVCXPRT *transp; { union { int fill; } argument; char *result; bool_t (*_xdr_argument)(), (*_xdr_result)(); char *(*local)(); _rpcsvccount++; switch (rqstp->rq_proc) { case NULLPROC: (void) svc_sendreply(transp, xdr_void, NULL); _rpcsvccount--; _rpcsvcstate = _SERVED; return; /* CSTYLED */ case SMSERVERPROC_GET_SERVERINFO: _xdr_argument = xdr_void; _xdr_result = xdr_smserver_info; local = (char *(*)()) smserverproc_get_serverinfo_1; break; default: svcerr_noproc(transp); _rpcsvccount--; _rpcsvcstate = _SERVED; return; /* CSTYLED */ } (void) memset((char *)&argument, 0, sizeof (argument)); if (!svc_getargs(transp, _xdr_argument, (caddr_t)&argument)) { svcerr_decode(transp); _rpcsvccount--; _rpcsvcstate = _SERVED; return; /* CSTYLED */ } result = (*local)(&argument, rqstp); if (_xdr_result && result != NULL && !svc_sendreply(transp, _xdr_result, result)) { svcerr_systemerr(transp); } if (!svc_freeargs(transp, _xdr_argument, (caddr_t)&argument)) { RPC_MSGOUT("%s", "unable to free arguments"); exit(1); } _rpcsvccount--; _rpcsvcstate = _SERVED; return; /* CSTYLED */ }