4 * Copyright (c) 1997-2009 Erez Zadok
5 * Copyright (c) 1990 Jan-Simon Pendry
6 * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
7 * Copyright (c) 1990 The Regents of the University of California.
10 * This code is derived from software contributed to Berkeley by
11 * Jan-Simon Pendry at Imperial College, London.
13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions
16 * 1. Redistributions of source code must retain the above copyright
17 * notice, this list of conditions and the following disclaimer.
18 * 2. Redistributions in binary form must reproduce the above copyright
19 * notice, this list of conditions and the following disclaimer in the
20 * documentation and/or other materials provided with the distribution.
21 * 3. All advertising materials mentioning features or use of this software
22 * must display the following acknowledgment:
23 * This product includes software developed by the University of
24 * California, Berkeley and its contributors.
25 * 4. Neither the name of the University nor the names of its contributors
26 * may be used to endorse or promote products derived from this software
27 * without specific prior written permission.
29 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
30 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
31 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
32 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
33 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
34 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
35 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
36 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
38 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
42 * File: am-utils/libamu/clnt_sperrno.c
47 * Early RPC seems to be missing these..
48 * Extracted from the RPC 3.9 sources as indicated
51 /* @(#)clnt_perror.c 1.1 87/11/04 3.9 RPCSRC */
53 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
54 * unrestricted use provided that this legend is included on all tape
55 * media and as a part of the software program in whole or part. Users
56 * may copy or modify Sun RPC without charge, but are not authorized
57 * to license or distribute it to anyone else except as part of a product or
58 * program developed by the user.
60 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
61 * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
62 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
64 * Sun RPC is provided with no support and without any obligation on the
65 * part of Sun Microsystems, Inc. to assist in its use, correction,
66 * modification or enhancement.
68 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
69 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
70 * OR ANY PART THEREOF.
72 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
73 * or profits or other special, indirect and consequential damages, even if
74 * Sun has been advised of the possibility of such damages.
76 * Sun Microsystems, Inc.
78 * Mountain View, California 94043
83 #endif /* HAVE_CONFIG_H */
89 enum clnt_stat status
;
93 static struct rpc_errtab rpc_errlist
[] =
98 "RPC: Can't encode arguments"},
100 "RPC: Can't decode result"},
102 "RPC: Unable to send"},
104 "RPC: Unable to receive"},
108 "RPC: Incompatible versions of RPC"},
110 "RPC: Authentication error"},
112 "RPC: Program unavailable"},
113 {RPC_PROGVERSMISMATCH
,
114 "RPC: Program/version mismatch"},
116 "RPC: Procedure unavailable"},
118 "RPC: Server can't decode arguments"},
120 "RPC: Remote system error"},
122 "RPC: Unknown host"},
123 /* { RPC_UNKNOWNPROTO,
124 * "RPC: Unknown protocol" }, */
126 "RPC: Port mapper failure"},
127 {RPC_PROGNOTREGISTERED
,
128 "RPC: Program not registered"},
130 "RPC: Failed (unspecified error)"}
135 * This interface for use by clntrpc
138 clnt_sperrno(enum clnt_stat stat
)
142 for (i
= 0; i
< sizeof(rpc_errlist
) / sizeof(struct rpc_errtab
); i
++) {
143 if (rpc_errlist
[i
].status
== stat
) {
144 return (rpc_errlist
[i
].message
);
147 return ("RPC: (unknown error code)");