17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*cb620785Sraf * Common Development and Distribution License (the "License"). 6*cb620785Sraf * You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate * 87c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate * and limitations under the License. 127c478bd9Sstevel@tonic-gate * 137c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate * 197c478bd9Sstevel@tonic-gate * CDDL HEADER END 2061961e0fSrobinson */ 2161961e0fSrobinson 2261961e0fSrobinson /* 23*cb620785Sraf * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 247c478bd9Sstevel@tonic-gate * Use is subject to license terms. 257c478bd9Sstevel@tonic-gate */ 26*cb620785Sraf 277c478bd9Sstevel@tonic-gate /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */ 287c478bd9Sstevel@tonic-gate /* All Rights Reserved */ 297c478bd9Sstevel@tonic-gate /* 307c478bd9Sstevel@tonic-gate * Portions of this source code were derived from Berkeley 317c478bd9Sstevel@tonic-gate * 4.3 BSD under license from the Regents of the University of 327c478bd9Sstevel@tonic-gate * California. 337c478bd9Sstevel@tonic-gate */ 347c478bd9Sstevel@tonic-gate 357c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 367c478bd9Sstevel@tonic-gate 377c478bd9Sstevel@tonic-gate /* 387c478bd9Sstevel@tonic-gate * clnt_perror.c 397c478bd9Sstevel@tonic-gate * 407c478bd9Sstevel@tonic-gate */ 417c478bd9Sstevel@tonic-gate 427c478bd9Sstevel@tonic-gate #include "mt.h" 437c478bd9Sstevel@tonic-gate #include "rpc_mt.h" 447c478bd9Sstevel@tonic-gate #include <stdio.h> 457c478bd9Sstevel@tonic-gate #include <libintl.h> 467c478bd9Sstevel@tonic-gate #include <string.h> 477c478bd9Sstevel@tonic-gate #include <rpc/types.h> 487c478bd9Sstevel@tonic-gate #include <rpc/auth.h> 497c478bd9Sstevel@tonic-gate #include <sys/tiuser.h> 507c478bd9Sstevel@tonic-gate #include <rpc/clnt.h> 517c478bd9Sstevel@tonic-gate #include <stdlib.h> 527c478bd9Sstevel@tonic-gate #include <syslog.h> 537c478bd9Sstevel@tonic-gate #include <string.h> 547c478bd9Sstevel@tonic-gate 557c478bd9Sstevel@tonic-gate extern char *netdir_sperror(); 567c478bd9Sstevel@tonic-gate 577c478bd9Sstevel@tonic-gate const char __nsl_dom[] = "SUNW_OST_NETRPC"; 587c478bd9Sstevel@tonic-gate 597c478bd9Sstevel@tonic-gate #define ERRBUFSZ 512 607c478bd9Sstevel@tonic-gate 617c478bd9Sstevel@tonic-gate static char * 6261961e0fSrobinson __buf(void) 637c478bd9Sstevel@tonic-gate { 647c478bd9Sstevel@tonic-gate char *buf; 657c478bd9Sstevel@tonic-gate static char buf_main[ERRBUFSZ]; 66*cb620785Sraf static pthread_key_t perror_key = PTHREAD_ONCE_KEY_NP; 677c478bd9Sstevel@tonic-gate 687c478bd9Sstevel@tonic-gate buf = thr_main()? buf_main : 697c478bd9Sstevel@tonic-gate thr_get_storage(&perror_key, ERRBUFSZ, free); 707c478bd9Sstevel@tonic-gate if (buf == NULL) 717c478bd9Sstevel@tonic-gate syslog(LOG_WARNING, 727c478bd9Sstevel@tonic-gate "clnt_sperror: malloc failed when trying to create buffer\n"); 737c478bd9Sstevel@tonic-gate return (buf); 747c478bd9Sstevel@tonic-gate } 757c478bd9Sstevel@tonic-gate 767c478bd9Sstevel@tonic-gate static char * 7761961e0fSrobinson auth_errmsg(enum auth_stat stat) 787c478bd9Sstevel@tonic-gate { 797c478bd9Sstevel@tonic-gate switch (stat) { 807c478bd9Sstevel@tonic-gate case AUTH_OK: 817c478bd9Sstevel@tonic-gate return (dgettext(__nsl_dom, "Authentication OK")); 827c478bd9Sstevel@tonic-gate case AUTH_BADCRED: 837c478bd9Sstevel@tonic-gate return (dgettext(__nsl_dom, "Invalid client credential")); 847c478bd9Sstevel@tonic-gate case AUTH_REJECTEDCRED: 857c478bd9Sstevel@tonic-gate return (dgettext(__nsl_dom, "Server rejected credential")); 867c478bd9Sstevel@tonic-gate case AUTH_BADVERF: 877c478bd9Sstevel@tonic-gate return (dgettext(__nsl_dom, "Invalid client verifier")); 887c478bd9Sstevel@tonic-gate case AUTH_REJECTEDVERF: 897c478bd9Sstevel@tonic-gate return (dgettext(__nsl_dom, "Server rejected verifier")); 907c478bd9Sstevel@tonic-gate case AUTH_TOOWEAK: 917c478bd9Sstevel@tonic-gate return (dgettext(__nsl_dom, "Client credential too weak")); 927c478bd9Sstevel@tonic-gate case AUTH_INVALIDRESP: 937c478bd9Sstevel@tonic-gate return (dgettext(__nsl_dom, "Invalid server verifier")); 947c478bd9Sstevel@tonic-gate case AUTH_FAILED: 957c478bd9Sstevel@tonic-gate return (dgettext(__nsl_dom, "Failed (unspecified error)")); 967c478bd9Sstevel@tonic-gate 977c478bd9Sstevel@tonic-gate /* kerberos specific */ 987c478bd9Sstevel@tonic-gate case AUTH_DECODE: 997c478bd9Sstevel@tonic-gate return (dgettext(__nsl_dom, "Could not decode authenticator")); 1007c478bd9Sstevel@tonic-gate case AUTH_TIMEEXPIRE: 1017c478bd9Sstevel@tonic-gate return (dgettext(__nsl_dom, "Time of credential expired")); 1027c478bd9Sstevel@tonic-gate case AUTH_TKT_FILE: 1037c478bd9Sstevel@tonic-gate return (dgettext(__nsl_dom, 1047c478bd9Sstevel@tonic-gate "Something wrong with kerberos ticket file")); 1057c478bd9Sstevel@tonic-gate case AUTH_NET_ADDR: 1067c478bd9Sstevel@tonic-gate return (dgettext(__nsl_dom, 1077c478bd9Sstevel@tonic-gate "Incorrect network address in kerberos ticket")); 1087c478bd9Sstevel@tonic-gate case AUTH_KERB_GENERIC: 1097c478bd9Sstevel@tonic-gate return (dgettext(__nsl_dom, "Kerberos generic error")); 1107c478bd9Sstevel@tonic-gate } 1117c478bd9Sstevel@tonic-gate return (dgettext(__nsl_dom, "Unknown authentication error")); 1127c478bd9Sstevel@tonic-gate } 1137c478bd9Sstevel@tonic-gate 1147c478bd9Sstevel@tonic-gate /* 1157c478bd9Sstevel@tonic-gate * Return string reply error info. For use after clnt_call() 1167c478bd9Sstevel@tonic-gate */ 1177c478bd9Sstevel@tonic-gate 1187c478bd9Sstevel@tonic-gate #define REMAINDER (ERRBUFSZ - (str - strstart)) 1197c478bd9Sstevel@tonic-gate 1207c478bd9Sstevel@tonic-gate char * 12161961e0fSrobinson clnt_sperror(const CLIENT *cl, const char *s) 1227c478bd9Sstevel@tonic-gate { 1237c478bd9Sstevel@tonic-gate struct rpc_err e; 1247c478bd9Sstevel@tonic-gate char *err; 1257c478bd9Sstevel@tonic-gate char *str = __buf(); 1267c478bd9Sstevel@tonic-gate char *strstart = str; 1277c478bd9Sstevel@tonic-gate 12861961e0fSrobinson if (str == NULL) 1297c478bd9Sstevel@tonic-gate return (NULL); 1307c478bd9Sstevel@tonic-gate CLNT_GETERR((CLIENT *) cl, &e); 1317c478bd9Sstevel@tonic-gate 1327c478bd9Sstevel@tonic-gate (void) snprintf(str, ERRBUFSZ, "%s: ", s); 1337c478bd9Sstevel@tonic-gate str += strlcat(str, clnt_sperrno(e.re_status), ERRBUFSZ); 1347c478bd9Sstevel@tonic-gate 1357c478bd9Sstevel@tonic-gate switch (e.re_status) { 1367c478bd9Sstevel@tonic-gate case RPC_SUCCESS: 1377c478bd9Sstevel@tonic-gate case RPC_CANTENCODEARGS: 1387c478bd9Sstevel@tonic-gate case RPC_CANTDECODERES: 1397c478bd9Sstevel@tonic-gate case RPC_TIMEDOUT: 1407c478bd9Sstevel@tonic-gate case RPC_PROGUNAVAIL: 1417c478bd9Sstevel@tonic-gate case RPC_PROCUNAVAIL: 1427c478bd9Sstevel@tonic-gate case RPC_CANTDECODEARGS: 1437c478bd9Sstevel@tonic-gate case RPC_SYSTEMERROR: 1447c478bd9Sstevel@tonic-gate case RPC_UNKNOWNHOST: 1457c478bd9Sstevel@tonic-gate case RPC_UNKNOWNPROTO: 1467c478bd9Sstevel@tonic-gate case RPC_UNKNOWNADDR: 1477c478bd9Sstevel@tonic-gate case RPC_NOBROADCAST: 1487c478bd9Sstevel@tonic-gate case RPC_RPCBFAILURE: 1497c478bd9Sstevel@tonic-gate case RPC_PROGNOTREGISTERED: 1507c478bd9Sstevel@tonic-gate case RPC_FAILED: 1517c478bd9Sstevel@tonic-gate break; 1527c478bd9Sstevel@tonic-gate 1537c478bd9Sstevel@tonic-gate case RPC_N2AXLATEFAILURE: 1547c478bd9Sstevel@tonic-gate (void) snprintf(str, REMAINDER, "; %s", netdir_sperror()); 1557c478bd9Sstevel@tonic-gate str += strlen(str); 1567c478bd9Sstevel@tonic-gate break; 1577c478bd9Sstevel@tonic-gate 1587c478bd9Sstevel@tonic-gate case RPC_TLIERROR: 1597c478bd9Sstevel@tonic-gate (void) snprintf(str, REMAINDER, "; %s", t_errlist[e.re_terrno]); 1607c478bd9Sstevel@tonic-gate str += strlen(str); 1617c478bd9Sstevel@tonic-gate if (e.re_errno) { 1627c478bd9Sstevel@tonic-gate (void) snprintf(str, REMAINDER, 1637c478bd9Sstevel@tonic-gate "; %s", strerror(e.re_errno)); 1647c478bd9Sstevel@tonic-gate str += strlen(str); 1657c478bd9Sstevel@tonic-gate } 1667c478bd9Sstevel@tonic-gate break; 1677c478bd9Sstevel@tonic-gate 1687c478bd9Sstevel@tonic-gate case RPC_CANTSTORE: 1697c478bd9Sstevel@tonic-gate case RPC_CANTSEND: 1707c478bd9Sstevel@tonic-gate case RPC_CANTRECV: 1717c478bd9Sstevel@tonic-gate if (e.re_errno) { 1727c478bd9Sstevel@tonic-gate (void) snprintf(str, REMAINDER, "; errno = %s", 1737c478bd9Sstevel@tonic-gate strerror(e.re_errno)); 1747c478bd9Sstevel@tonic-gate str += strlen(str); 1757c478bd9Sstevel@tonic-gate } 1767c478bd9Sstevel@tonic-gate if (e.re_terrno) { 1777c478bd9Sstevel@tonic-gate (void) snprintf(str, REMAINDER, 1787c478bd9Sstevel@tonic-gate "; %s", t_errlist[e.re_terrno]); 1797c478bd9Sstevel@tonic-gate str += strlen(str); 1807c478bd9Sstevel@tonic-gate } 1817c478bd9Sstevel@tonic-gate break; 1827c478bd9Sstevel@tonic-gate 1837c478bd9Sstevel@tonic-gate case RPC_VERSMISMATCH: 1847c478bd9Sstevel@tonic-gate (void) snprintf(str, REMAINDER, 1857c478bd9Sstevel@tonic-gate "; low version = %lu, high version = %lu", 1867c478bd9Sstevel@tonic-gate e.re_vers.low, e.re_vers.high); 1877c478bd9Sstevel@tonic-gate str += strlen(str); 1887c478bd9Sstevel@tonic-gate break; 1897c478bd9Sstevel@tonic-gate 1907c478bd9Sstevel@tonic-gate case RPC_AUTHERROR: 1917c478bd9Sstevel@tonic-gate err = auth_errmsg(e.re_why); 1927c478bd9Sstevel@tonic-gate (void) snprintf(str, REMAINDER, "; why = "); 1937c478bd9Sstevel@tonic-gate str += strlen(str); 1947c478bd9Sstevel@tonic-gate if (err != NULL) { 1957c478bd9Sstevel@tonic-gate (void) snprintf(str, REMAINDER, "%s", err); 1967c478bd9Sstevel@tonic-gate } else { 1977c478bd9Sstevel@tonic-gate (void) snprintf(str, REMAINDER, 1987c478bd9Sstevel@tonic-gate "(unknown authentication error - %d)", 1997c478bd9Sstevel@tonic-gate (int)e.re_why); 2007c478bd9Sstevel@tonic-gate } 2017c478bd9Sstevel@tonic-gate str += strlen(str); 2027c478bd9Sstevel@tonic-gate break; 2037c478bd9Sstevel@tonic-gate 2047c478bd9Sstevel@tonic-gate case RPC_PROGVERSMISMATCH: 2057c478bd9Sstevel@tonic-gate (void) snprintf(str, REMAINDER, 2067c478bd9Sstevel@tonic-gate "; low version = %lu, high version = %lu", 2077c478bd9Sstevel@tonic-gate e.re_vers.low, e.re_vers.high); 2087c478bd9Sstevel@tonic-gate str += strlen(str); 2097c478bd9Sstevel@tonic-gate break; 2107c478bd9Sstevel@tonic-gate 2117c478bd9Sstevel@tonic-gate default: /* unknown */ 2127c478bd9Sstevel@tonic-gate (void) snprintf(str, REMAINDER, "; s1 = %lu, s2 = %lu", 2137c478bd9Sstevel@tonic-gate e.re_lb.s1, e.re_lb.s2); 2147c478bd9Sstevel@tonic-gate str += strlen(str); 2157c478bd9Sstevel@tonic-gate break; 2167c478bd9Sstevel@tonic-gate } 2177c478bd9Sstevel@tonic-gate return (strstart); 2187c478bd9Sstevel@tonic-gate } 2197c478bd9Sstevel@tonic-gate #undef REMAINDER 2207c478bd9Sstevel@tonic-gate 2217c478bd9Sstevel@tonic-gate void 22261961e0fSrobinson clnt_perror(const CLIENT *cl, const char *s) 2237c478bd9Sstevel@tonic-gate { 2247c478bd9Sstevel@tonic-gate (void) fprintf(stderr, "%s\n", clnt_sperror(cl, s)); 2257c478bd9Sstevel@tonic-gate } 2267c478bd9Sstevel@tonic-gate 2277c478bd9Sstevel@tonic-gate void 22861961e0fSrobinson clnt_perrno(const enum clnt_stat num) 2297c478bd9Sstevel@tonic-gate { 2307c478bd9Sstevel@tonic-gate (void) fprintf(stderr, "%s\n", clnt_sperrno(num)); 2317c478bd9Sstevel@tonic-gate } 2327c478bd9Sstevel@tonic-gate 2337c478bd9Sstevel@tonic-gate /* 2347c478bd9Sstevel@tonic-gate * Why a client handle could not be created 2357c478bd9Sstevel@tonic-gate */ 2367c478bd9Sstevel@tonic-gate char * 23761961e0fSrobinson clnt_spcreateerror(const char *s) 2387c478bd9Sstevel@tonic-gate { 2397c478bd9Sstevel@tonic-gate char *errstr; 2407c478bd9Sstevel@tonic-gate char *str = __buf(); 2417c478bd9Sstevel@tonic-gate 24261961e0fSrobinson if (str == NULL) 2437c478bd9Sstevel@tonic-gate return (NULL); 2447c478bd9Sstevel@tonic-gate (void) snprintf(str, ERRBUFSZ, "%s: ", s); 2457c478bd9Sstevel@tonic-gate (void) strlcat(str, clnt_sperrno(rpc_createerr.cf_stat), ERRBUFSZ); 2467c478bd9Sstevel@tonic-gate 2477c478bd9Sstevel@tonic-gate switch (rpc_createerr.cf_stat) { 2487c478bd9Sstevel@tonic-gate case RPC_N2AXLATEFAILURE: 2497c478bd9Sstevel@tonic-gate (void) strlcat(str, " - ", ERRBUFSZ); 2507c478bd9Sstevel@tonic-gate (void) strlcat(str, netdir_sperror(), ERRBUFSZ); 2517c478bd9Sstevel@tonic-gate break; 2527c478bd9Sstevel@tonic-gate 2537c478bd9Sstevel@tonic-gate case RPC_RPCBFAILURE: 2547c478bd9Sstevel@tonic-gate (void) strlcat(str, " - ", ERRBUFSZ); 2557c478bd9Sstevel@tonic-gate (void) strlcat(str, 2567c478bd9Sstevel@tonic-gate clnt_sperrno(rpc_createerr.cf_error.re_status), 2577c478bd9Sstevel@tonic-gate ERRBUFSZ); 2587c478bd9Sstevel@tonic-gate break; 2597c478bd9Sstevel@tonic-gate 2607c478bd9Sstevel@tonic-gate case RPC_SYSTEMERROR: 2617c478bd9Sstevel@tonic-gate (void) strlcat(str, " - ", ERRBUFSZ); 2627c478bd9Sstevel@tonic-gate errstr = strerror(rpc_createerr.cf_error.re_errno); 2637c478bd9Sstevel@tonic-gate if (errstr != NULL) 2647c478bd9Sstevel@tonic-gate (void) strlcat(str, errstr, ERRBUFSZ); 2657c478bd9Sstevel@tonic-gate else 2667c478bd9Sstevel@tonic-gate (void) snprintf(&str[strlen(str)], 2677c478bd9Sstevel@tonic-gate ERRBUFSZ - strlen(str), "Error %d", 2687c478bd9Sstevel@tonic-gate rpc_createerr.cf_error.re_errno); 2697c478bd9Sstevel@tonic-gate break; 2707c478bd9Sstevel@tonic-gate 2717c478bd9Sstevel@tonic-gate case RPC_TLIERROR: 2727c478bd9Sstevel@tonic-gate (void) strlcat(str, " - ", ERRBUFSZ); 2737c478bd9Sstevel@tonic-gate if ((rpc_createerr.cf_error.re_terrno > 0) && 2747c478bd9Sstevel@tonic-gate (rpc_createerr.cf_error.re_terrno < t_nerr)) { 2757c478bd9Sstevel@tonic-gate (void) strlcat(str, 2767c478bd9Sstevel@tonic-gate t_errlist[rpc_createerr.cf_error.re_terrno], 2777c478bd9Sstevel@tonic-gate ERRBUFSZ); 2787c478bd9Sstevel@tonic-gate if (rpc_createerr.cf_error.re_terrno == TSYSERR) { 2797c478bd9Sstevel@tonic-gate char *err; 2807c478bd9Sstevel@tonic-gate err = strerror(rpc_createerr.cf_error.re_errno); 2817c478bd9Sstevel@tonic-gate if (err) { 28261961e0fSrobinson (void) strlcat(str, " (", ERRBUFSZ); 28361961e0fSrobinson (void) strlcat(str, err, ERRBUFSZ); 28461961e0fSrobinson (void) strlcat(str, ")", ERRBUFSZ); 2857c478bd9Sstevel@tonic-gate } 2867c478bd9Sstevel@tonic-gate } 2877c478bd9Sstevel@tonic-gate } else { 2887c478bd9Sstevel@tonic-gate (void) snprintf(&str[strlen(str)], 2897c478bd9Sstevel@tonic-gate ERRBUFSZ - strlen(str), 2907c478bd9Sstevel@tonic-gate dgettext(__nsl_dom, "TLI Error %d"), 2917c478bd9Sstevel@tonic-gate rpc_createerr.cf_error.re_terrno); 2927c478bd9Sstevel@tonic-gate } 2937c478bd9Sstevel@tonic-gate errstr = strerror(rpc_createerr.cf_error.re_errno); 2947c478bd9Sstevel@tonic-gate if (errstr != NULL) 2957c478bd9Sstevel@tonic-gate (void) strlcat(str, errstr, ERRBUFSZ); 2967c478bd9Sstevel@tonic-gate else 2977c478bd9Sstevel@tonic-gate (void) snprintf(&str[strlen(str)], 2987c478bd9Sstevel@tonic-gate ERRBUFSZ - strlen(str), "Error %d", 2997c478bd9Sstevel@tonic-gate rpc_createerr.cf_error.re_errno); 3007c478bd9Sstevel@tonic-gate break; 3017c478bd9Sstevel@tonic-gate 3027c478bd9Sstevel@tonic-gate case RPC_AUTHERROR: 3037c478bd9Sstevel@tonic-gate (void) strlcat(str, " - ", ERRBUFSZ); 3047c478bd9Sstevel@tonic-gate (void) strlcat(str, 3057c478bd9Sstevel@tonic-gate auth_errmsg(rpc_createerr.cf_error.re_why), ERRBUFSZ); 3067c478bd9Sstevel@tonic-gate break; 3077c478bd9Sstevel@tonic-gate } 3087c478bd9Sstevel@tonic-gate return (str); 3097c478bd9Sstevel@tonic-gate } 3107c478bd9Sstevel@tonic-gate 3117c478bd9Sstevel@tonic-gate void 31261961e0fSrobinson clnt_pcreateerror(const char *s) 3137c478bd9Sstevel@tonic-gate { 3147c478bd9Sstevel@tonic-gate (void) fprintf(stderr, "%s\n", clnt_spcreateerror(s)); 3157c478bd9Sstevel@tonic-gate } 3167c478bd9Sstevel@tonic-gate 3177c478bd9Sstevel@tonic-gate /* 3187c478bd9Sstevel@tonic-gate * This interface for use by rpc_call() and rpc_broadcast() 3197c478bd9Sstevel@tonic-gate */ 3207c478bd9Sstevel@tonic-gate const char * 32161961e0fSrobinson clnt_sperrno(const enum clnt_stat stat) 3227c478bd9Sstevel@tonic-gate { 3237c478bd9Sstevel@tonic-gate switch (stat) { 3247c478bd9Sstevel@tonic-gate case RPC_SUCCESS: 3257c478bd9Sstevel@tonic-gate return (dgettext(__nsl_dom, "RPC: Success")); 3267c478bd9Sstevel@tonic-gate case RPC_CANTENCODEARGS: 3277c478bd9Sstevel@tonic-gate return (dgettext(__nsl_dom, "RPC: Can't encode arguments")); 3287c478bd9Sstevel@tonic-gate case RPC_CANTDECODERES: 3297c478bd9Sstevel@tonic-gate return (dgettext(__nsl_dom, "RPC: Can't decode result")); 3307c478bd9Sstevel@tonic-gate case RPC_CANTSTORE: 3317c478bd9Sstevel@tonic-gate return (dgettext(__nsl_dom, "RPC: Can't store request")); 3327c478bd9Sstevel@tonic-gate case RPC_CANTSEND: 3337c478bd9Sstevel@tonic-gate return (dgettext(__nsl_dom, "RPC: Unable to send")); 3347c478bd9Sstevel@tonic-gate case RPC_CANTRECV: 3357c478bd9Sstevel@tonic-gate return (dgettext(__nsl_dom, "RPC: Unable to receive")); 3367c478bd9Sstevel@tonic-gate case RPC_TIMEDOUT: 3377c478bd9Sstevel@tonic-gate return (dgettext(__nsl_dom, "RPC: Timed out")); 3387c478bd9Sstevel@tonic-gate case RPC_VERSMISMATCH: 3397c478bd9Sstevel@tonic-gate return (dgettext(__nsl_dom, 3407c478bd9Sstevel@tonic-gate "RPC: Incompatible versions of RPC")); 3417c478bd9Sstevel@tonic-gate case RPC_AUTHERROR: 3427c478bd9Sstevel@tonic-gate return (dgettext(__nsl_dom, "RPC: Authentication error")); 3437c478bd9Sstevel@tonic-gate case RPC_PROGUNAVAIL: 3447c478bd9Sstevel@tonic-gate return (dgettext(__nsl_dom, "RPC: Program unavailable")); 3457c478bd9Sstevel@tonic-gate case RPC_PROGVERSMISMATCH: 3467c478bd9Sstevel@tonic-gate return (dgettext(__nsl_dom, "RPC: Program/version mismatch")); 3477c478bd9Sstevel@tonic-gate case RPC_PROCUNAVAIL: 3487c478bd9Sstevel@tonic-gate return (dgettext(__nsl_dom, "RPC: Procedure unavailable")); 3497c478bd9Sstevel@tonic-gate case RPC_CANTDECODEARGS: 3507c478bd9Sstevel@tonic-gate return (dgettext(__nsl_dom, 3517c478bd9Sstevel@tonic-gate "RPC: Server can't decode arguments")); 3527c478bd9Sstevel@tonic-gate 3537c478bd9Sstevel@tonic-gate case RPC_SYSTEMERROR: 3547c478bd9Sstevel@tonic-gate return (dgettext(__nsl_dom, "RPC: Remote system error")); 3557c478bd9Sstevel@tonic-gate case RPC_UNKNOWNHOST: 3567c478bd9Sstevel@tonic-gate return (dgettext(__nsl_dom, "RPC: Unknown host")); 3577c478bd9Sstevel@tonic-gate case RPC_UNKNOWNPROTO: 3587c478bd9Sstevel@tonic-gate return (dgettext(__nsl_dom, "RPC: Unknown protocol")); 3597c478bd9Sstevel@tonic-gate case RPC_RPCBFAILURE: 3607c478bd9Sstevel@tonic-gate return (dgettext(__nsl_dom, "RPC: Rpcbind failure")); 3617c478bd9Sstevel@tonic-gate case RPC_N2AXLATEFAILURE: 3627c478bd9Sstevel@tonic-gate return (dgettext(__nsl_dom, 3637c478bd9Sstevel@tonic-gate "RPC: Name to address translation failed")); 3647c478bd9Sstevel@tonic-gate case RPC_NOBROADCAST: 3657c478bd9Sstevel@tonic-gate return (dgettext(__nsl_dom, "RPC: Broadcast not supported")); 3667c478bd9Sstevel@tonic-gate case RPC_PROGNOTREGISTERED: 3677c478bd9Sstevel@tonic-gate return (dgettext(__nsl_dom, "RPC: Program not registered")); 3687c478bd9Sstevel@tonic-gate case RPC_UNKNOWNADDR: 3697c478bd9Sstevel@tonic-gate return (dgettext(__nsl_dom, 3707c478bd9Sstevel@tonic-gate "RPC: Remote server address unknown")); 3717c478bd9Sstevel@tonic-gate case RPC_TLIERROR: 3727c478bd9Sstevel@tonic-gate return (dgettext(__nsl_dom, "RPC: Miscellaneous tli error")); 3737c478bd9Sstevel@tonic-gate case RPC_FAILED: 3747c478bd9Sstevel@tonic-gate return (dgettext(__nsl_dom, "RPC: Failed (unspecified error)")); 3757c478bd9Sstevel@tonic-gate case RPC_INPROGRESS: 3767c478bd9Sstevel@tonic-gate return (dgettext(__nsl_dom, "RPC: RAC call in progress")); 3777c478bd9Sstevel@tonic-gate case RPC_STALERACHANDLE: 3787c478bd9Sstevel@tonic-gate return (dgettext(__nsl_dom, "RPC: Stale RAC handle")); 3797c478bd9Sstevel@tonic-gate case RPC_CANTCONNECT: 3807c478bd9Sstevel@tonic-gate return (dgettext(__nsl_dom, "RPC: Couldn't make connection")); 3817c478bd9Sstevel@tonic-gate case RPC_XPRTFAILED: 3827c478bd9Sstevel@tonic-gate return (dgettext(__nsl_dom, 3837c478bd9Sstevel@tonic-gate "RPC: Received disconnect from remote")); 3847c478bd9Sstevel@tonic-gate case RPC_CANTCREATESTREAM: 3857c478bd9Sstevel@tonic-gate return (dgettext(__nsl_dom, "RPC: Can't push RPC module")); 3867c478bd9Sstevel@tonic-gate } 3877c478bd9Sstevel@tonic-gate return (dgettext(__nsl_dom, "RPC: (unknown error code)")); 3887c478bd9Sstevel@tonic-gate } 389