svc_raw.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* 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
* 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
*
* Copyright 2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Portions of this source code were derived from Berkeley
* 4.3 BSD under license from the Regents of the University of
* California.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* svc_raw.c, This a toy for simple testing and timing.
* Interface to create an rpc client and server in the same UNIX process.
* This lets us similate rpc and get rpc (round trip) overhead, without
* any interference from the kernal.
*
*/
#include "mt.h"
#include "rpc_mt.h"
#include <syslog.h>
#ifndef UDPMSGSIZE
#define UDPMSGSIZE 8800
#endif
/*
* This is the "network" that we will be moving data over
*/
static struct svc_raw_private {
char *raw_buf; /* should be shared with the cl handle */
char verf_body[MAX_AUTH_BYTES];
} *svc_raw_private;
static struct xp_ops *svc_raw_ops();
extern char *calloc();
extern void free();
extern mutex_t svcraw_lock;
SVCXPRT *
{
struct svc_raw_private *srp;
/* VARIABLES PROTECTED BY svcraw_lock: svc_raw_private, srp */
trace1(TR_svc_raw_create, 0);
/* LINTED pointer alignment */
}
if (_rawcombuf == NULL) {
if (_rawcombuf == NULL) {
"out of memory");
}
}
}
if (flag2)
if (flag1)
}
/*
* By convention, using FD_SETSIZE as the psuedo file descriptor
*/
}
/*ARGSUSED*/
static enum xprt_stat
{
trace1(TR_svc_raw_stat, 0);
return (XPRT_IDLE);
}
/*ARGSUSED*/
static bool_t
{
struct svc_raw_private *srp;
trace1(TR_svc_raw_recv, 0);
return (FALSE);
}
(void) XDR_SETPOS(xdrs, 0);
return (FALSE);
}
return (TRUE);
}
/*ARGSUSED*/
static bool_t
{
struct svc_raw_private *srp;
trace1(TR_svc_raw_reply, 0);
return (FALSE);
}
(void) XDR_SETPOS(xdrs, 0);
return (FALSE);
}
return (TRUE);
}
/*ARGSUSED*/
static bool_t
{
struct svc_raw_private *srp;
trace1(TR_svc_raw_getargs, 0);
return (FALSE);
}
return (dummy1);
}
/*ARGSUSED*/
static bool_t
{
struct svc_raw_private *srp;
return (FALSE);
}
return (dummy2);
}
/*ARGSUSED*/
static void
{
trace1(TR_svc_raw_destroy, 0);
}
/*ARGSUSED*/
static bool_t
void *in;
{
switch (rq) {
case SVCGET_XID: /* fall through for now */
default:
return (FALSE);
}
}
static struct xp_ops *
{
/* VARIABLES PROTECTED BY ops_lock: ops */
trace1(TR_svc_raw_ops, 0);
}
return (&ops);
}