clnt_perror.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"
/*
*
*/
#include "mt.h"
#include "rpc_mt.h"
#ifndef KERNEL
#include <stdio.h>
#include <libintl.h>
#include <string.h>
#endif
#include <stdlib.h>
#include <syslog.h>
#include <string.h>
extern char *netdir_sperror();
const char __nsl_dom[] = "SUNW_OST_NETRPC";
#ifndef KERNEL
#define ERRBUFSZ 512
static char *
__buf()
{
char *buf;
static pthread_key_t perror_key;
"clnt_sperror: malloc failed when trying to create buffer\n");
return (buf);
}
static char *
{
trace1(TR_auth_errmsg, 0);
switch (stat) {
case AUTH_OK:
case AUTH_BADCRED:
case AUTH_REJECTEDCRED:
case AUTH_BADVERF:
case AUTH_REJECTEDVERF:
case AUTH_TOOWEAK:
case AUTH_INVALIDRESP:
case AUTH_FAILED:
/* kerberos specific */
case AUTH_DECODE:
case AUTH_TIMEEXPIRE:
case AUTH_TKT_FILE:
"Something wrong with kerberos ticket file"));
case AUTH_NET_ADDR:
"Incorrect network address in kerberos ticket"));
case AUTH_KERB_GENERIC:
}
}
/*
* Return string reply error info. For use after clnt_call()
*/
char *
clnt_sperror(cl, s)
const char *s;
{
struct rpc_err e;
char *err;
return (NULL);
}
switch (e.re_status) {
case RPC_SUCCESS:
case RPC_CANTENCODEARGS:
case RPC_CANTDECODERES:
case RPC_TIMEDOUT:
case RPC_PROGUNAVAIL:
case RPC_PROCUNAVAIL:
case RPC_CANTDECODEARGS:
case RPC_SYSTEMERROR:
case RPC_UNKNOWNHOST:
case RPC_UNKNOWNPROTO:
case RPC_UNKNOWNADDR:
case RPC_NOBROADCAST:
case RPC_RPCBFAILURE:
case RPC_PROGNOTREGISTERED:
case RPC_FAILED:
break;
case RPC_N2AXLATEFAILURE:
break;
case RPC_TLIERROR:
if (e.re_errno) {
}
break;
case RPC_CANTSTORE:
case RPC_CANTSEND:
case RPC_CANTRECV:
if (e.re_errno) {
}
if (e.re_terrno) {
}
break;
case RPC_VERSMISMATCH:
"; low version = %lu, high version = %lu",
break;
case RPC_AUTHERROR:
} else {
"(unknown authentication error - %d)",
(int)e.re_why);
}
break;
case RPC_PROGVERSMISMATCH:
"; low version = %lu, high version = %lu",
break;
default: /* unknown */
break;
}
return (strstart);
}
void
clnt_perror(cl, s)
const char *s;
{
}
void
{
trace1(TR_clnt_perrno, 0);
}
/*
* Why a client handle could not be created
*/
char *
const char *s;
{
char *errstr;
return (NULL);
}
switch (rpc_createerr.cf_stat) {
case RPC_N2AXLATEFAILURE:
break;
case RPC_RPCBFAILURE:
ERRBUFSZ);
break;
case RPC_SYSTEMERROR:
else
break;
case RPC_TLIERROR:
ERRBUFSZ);
char *err;
if (err) {
}
}
} else {
}
else
break;
case RPC_AUTHERROR:
break;
}
return (str);
}
void
const char *s;
{
}
#endif /* ! KERNEL */
/*
* This interface for use by rpc_call() and rpc_broadcast()
*/
const char *
{
trace1(TR_clnt_sperrno, 0);
switch (stat) {
case RPC_SUCCESS:
case RPC_CANTENCODEARGS:
case RPC_CANTDECODERES:
case RPC_CANTSTORE:
case RPC_CANTSEND:
case RPC_CANTRECV:
case RPC_TIMEDOUT:
case RPC_VERSMISMATCH:
"RPC: Incompatible versions of RPC"));
case RPC_AUTHERROR:
case RPC_PROGUNAVAIL:
case RPC_PROGVERSMISMATCH:
case RPC_PROCUNAVAIL:
case RPC_CANTDECODEARGS:
"RPC: Server can't decode arguments"));
case RPC_SYSTEMERROR:
case RPC_UNKNOWNHOST:
case RPC_UNKNOWNPROTO:
case RPC_RPCBFAILURE:
case RPC_N2AXLATEFAILURE:
"RPC: Name to address translation failed"));
case RPC_NOBROADCAST:
case RPC_PROGNOTREGISTERED:
case RPC_UNKNOWNADDR:
"RPC: Remote server address unknown"));
case RPC_TLIERROR:
case RPC_FAILED:
case RPC_INPROGRESS:
case RPC_STALERACHANDLE:
case RPC_CANTCONNECT:
case RPC_XPRTFAILED:
"RPC: Received disconnect from remote"));
case RPC_CANTCREATESTREAM:
}
}