update from main archive 961217
[glibc.git] / nis / nss-nis.h
blob13ba62ed9f0d1ea715a8a5ae616371389b004958
1 /* Copyright (C) 1996 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public
15 License along with the GNU C Library; see the file COPYING.LIB. If not,
16 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. */
19 #ifndef _NIS_NSS_NIS_H
20 #define _NIS_NSS_NIS_H 1
22 #include <rpcsvc/ypclnt.h>
24 #include "nsswitch.h"
27 /* Convert YP error number to NSS error number. */
28 static enum nss_status yperr2nss_tab[] =
30 [YPERR_SUCCESS] = NSS_STATUS_SUCCESS,
31 [YPERR_BADARGS] = NSS_STATUS_UNAVAIL,
32 [YPERR_RPC] = NSS_STATUS_UNAVAIL,
33 [YPERR_DOMAIN] = NSS_STATUS_UNAVAIL,
34 [YPERR_MAP] = NSS_STATUS_UNAVAIL,
35 [YPERR_KEY] = NSS_STATUS_NOTFOUND,
36 [YPERR_YPERR] = NSS_STATUS_UNAVAIL,
37 [YPERR_RESRC] = NSS_STATUS_TRYAGAIN,
38 [YPERR_NOMORE] = NSS_STATUS_NOTFOUND,
39 [YPERR_PMAP] = NSS_STATUS_UNAVAIL,
40 [YPERR_YPBIND] = NSS_STATUS_UNAVAIL,
41 [YPERR_YPSERV] = NSS_STATUS_UNAVAIL,
42 [YPERR_NODOM] = NSS_STATUS_UNAVAIL,
43 [YPERR_BADDB] = NSS_STATUS_UNAVAIL,
44 [YPERR_VERS] = NSS_STATUS_UNAVAIL,
45 [YPERR_ACCESS] = NSS_STATUS_UNAVAIL,
46 [YPERR_BUSY] = NSS_STATUS_TRYAGAIN
48 #define YPERR_COUNT (sizeof (yperr2nss_tab) / sizeof (yperr2nss_tab[0]))
50 static inline enum nss_status
51 yperr2nss (int errval)
53 if ((unsigned int) errval > YPERR_COUNT)
54 return NSS_STATUS_UNAVAIL;
55 return yperr2nss_tab[errval];
58 #endif /* nis/nss-nis.h */