Update.
[glibc.git] / nis / nss-nisplus.h
blobf2247c7eb4f9df2cb502589705386b1cc1d8cb96
1 /* Copyright (C) 1997 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3 Contributed by Thorsten Kukuk <kukuk@uni-paderborn.de>, 1997.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public License as
7 published by the Free Software Foundation; either version 2 of the
8 License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public
16 License along with the GNU C Library; see the file COPYING.LIB. If not,
17 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. */
20 #ifndef _NIS_NSS_NISPLUS_H
21 #define _NIS_NSS_NISPLUS_H 1
23 #include <rpcsvc/nis.h>
25 #include "nsswitch.h"
28 /* Convert NIS+ error number to NSS error number. */
29 static enum nss_status niserr2nss_tab[] =
31 [NIS_SUCCESS] = NSS_STATUS_SUCCESS,
32 [NIS_S_SUCCESS] = NSS_STATUS_SUCCESS,
33 [NIS_NOTFOUND] = NSS_STATUS_NOTFOUND,
34 [NIS_S_NOTFOUND] = NSS_STATUS_NOTFOUND,
35 [NIS_CACHEEXPIRED] = NSS_STATUS_UNAVAIL,
36 [NIS_NAMEUNREACHABLE] = NSS_STATUS_UNAVAIL,
37 [NIS_UNKNOWNOBJ] = NSS_STATUS_NOTFOUND,
38 [NIS_TRYAGAIN] = NSS_STATUS_TRYAGAIN,
39 [NIS_SYSTEMERROR] = NSS_STATUS_UNAVAIL,
40 [NIS_CHAINBROKEN] = NSS_STATUS_UNAVAIL,
41 [NIS_PERMISSION] = NSS_STATUS_UNAVAIL,
42 [NIS_NOTOWNER] = NSS_STATUS_UNAVAIL,
43 [NIS_NOT_ME] = NSS_STATUS_UNAVAIL,
44 [NIS_NOMEMORY] = NSS_STATUS_TRYAGAIN,
45 [NIS_NAMEEXISTS] = NSS_STATUS_UNAVAIL,
46 [NIS_NOTMASTER] = NSS_STATUS_UNAVAIL,
47 [NIS_INVALIDOBJ] = NSS_STATUS_UNAVAIL,
48 [NIS_BADNAME] = NSS_STATUS_UNAVAIL,
49 [NIS_NOCALLBACK] = NSS_STATUS_UNAVAIL,
50 [NIS_CBRESULTS] = NSS_STATUS_UNAVAIL,
51 [NIS_NOSUCHNAME] = NSS_STATUS_NOTFOUND,
52 [NIS_NOTUNIQUE] = NSS_STATUS_UNAVAIL,
53 [NIS_IBMODERROR] = NSS_STATUS_UNAVAIL,
54 [NIS_NOSUCHTABLE] = NSS_STATUS_UNAVAIL,
55 [NIS_TYPEMISMATCH] = NSS_STATUS_UNAVAIL,
56 [NIS_LINKNAMEERROR] = NSS_STATUS_UNAVAIL,
57 [NIS_PARTIAL] = NSS_STATUS_NOTFOUND,
58 [NIS_TOOMANYATTRS] = NSS_STATUS_UNAVAIL,
59 [NIS_RPCERROR] = NSS_STATUS_UNAVAIL,
60 [NIS_BADATTRIBUTE] = NSS_STATUS_UNAVAIL,
61 [NIS_NOTSEARCHABLE] = NSS_STATUS_UNAVAIL,
62 [NIS_CBERROR] = NSS_STATUS_UNAVAIL,
63 [NIS_FOREIGNNS] = NSS_STATUS_UNAVAIL,
64 [NIS_BADOBJECT] = NSS_STATUS_UNAVAIL,
65 [NIS_NOTSAMEOBJ] = NSS_STATUS_UNAVAIL,
66 [NIS_MODFAIL] = NSS_STATUS_UNAVAIL,
67 [NIS_BADREQUEST] = NSS_STATUS_UNAVAIL,
68 [NIS_NOTEMPTY] = NSS_STATUS_UNAVAIL,
69 [NIS_COLDSTART_ERR] = NSS_STATUS_UNAVAIL,
70 [NIS_RESYNC] = NSS_STATUS_UNAVAIL,
71 [NIS_FAIL] = NSS_STATUS_UNAVAIL,
72 [NIS_UNAVAIL] = NSS_STATUS_UNAVAIL,
73 [NIS_RES2BIG] = NSS_STATUS_UNAVAIL,
74 [NIS_SRVAUTH] = NSS_STATUS_UNAVAIL,
75 [NIS_CLNTAUTH] = NSS_STATUS_UNAVAIL,
76 [NIS_NOFILESPACE] = NSS_STATUS_UNAVAIL,
77 [NIS_NOPROC] = NSS_STATUS_UNAVAIL,
78 [NIS_DUMPLATER] = NSS_STATUS_UNAVAIL
80 #define NISERR_COUNT (sizeof (niserr2nss_tab) / sizeof (niserr2nss_tab[0]))
82 static inline enum nss_status
83 niserr2nss (int errval)
85 if ((unsigned int) errval > NISERR_COUNT)
86 return NSS_STATUS_UNAVAIL;
87 return niserr2nss_tab[errval];
90 #endif /* nis/nss-nisplus.h */