clnt_generic.c revision ac9418faa9bc5d2e2b8fdb33f434b05183528026
/*
* 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 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <errno.h>
#include <tiuser.h>
#include <netdir.h>
#include <string.h>
#include "rac_private.h"
/*
* Generic client creation with version checking the value of
* vers_out is set to the highest server supported value
* vers_low <= vers_out <= vers_high AND an error results
* if this can not be done.
*/
CLIENT *
const char *nettype)
{
return (NULL);
if (rpc_stat == RPC_SUCCESS) {
return (clnt);
}
if (rpc_stat == RPC_PROGVERSMISMATCH) {
goto error;
}
if (rpc_stat == RPC_SUCCESS) {
return (clnt);
}
}
return (NULL);
}
/*
* Top level client creation routine.
* Generic client creation: takes (servers name, program-number, nettype) and
* returns client handle. Default options are set, which the user can
* change using the rpc equivalent of ioctl()'s.
*
* It tries for all the netids in that particular class of netid until
* it succeeds.
* XXX The error message in the case of failure will be the one
* pertaining to the last create error.
*
* It calls clnt_tp_create();
*/
CLIENT *
const char *nettype)
{
void *handle;
struct rpc_err save_cf_error;
return (NULL);
}
break;
}
if (clnt)
break;
else
/*
* Since we didn't get a name-to-address
* translation failure here, we remember
* this particular error. The object of
* this is to enable us to return to the
* caller a more-specific error than the
* unhelpful ``Name to address translation
* failed'' which might well occur if we
* merely returned the last error (because
* the local loopbacks are typically the
* likely to be unable to translate a host
* name).
*/
}
}
/*
* Attempt to return an error more specific than ``Name to address
* translation failed''
*/
(save_cf_stat != RPC_SUCCESS)) {
}
return (clnt);
}
/*
* Generic client creation: takes (servers name, program-number, netconf) and
* returns client handle. Default options are set, which the user can
* change using the rpc equivalent of ioctl()'s : clnt_control()
* It finds out the server address from rpcbind and calls clnt_tli_create()
*/
CLIENT *
{
return (NULL);
}
/*
* Get the address of the server
*/
/* appropriate error number is set by rpcbind libraries */
return (NULL);
}
} else {
/* Reuse the CLIENT handle and change the appropriate fields */
} else {
}
}
return (cl);
}
/*
* Generic client creation: returns client handle.
* Default options are set, which the user can
* change using the rpc equivalent of ioctl()'s : clnt_control().
* If fd is RPC_ANYFD, it will be opened using nconf.
* It will be bound if not so.
* If sizes are 0; appropriate defaults will be chosen.
*/
CLIENT *
{
int servtype;
return (NULL);
}
if (nfd == -1)
goto err;
goto err;
switch (nconf->nc_semantics) {
case NC_TPI_CLTS:
break;
case NC_TPI_COTS:
break;
case NC_TPI_COTS_ORD:
break;
default:
goto err;
break;
}
} else {
int state; /* Current state of provider */
/*
* Sync the opened fd.
* Check whether bound or not, else bind it
*/
goto err;
}
switch (servtype) {
case T_COTS:
case T_COTS_ORD:
break;
case T_CLTS:
break;
default:
goto err;
}
if (nconf) {
} else {
}
if (madefd)
return (cl);
err:
return (NULL);
}