python-samba-tool domain classicupgrade: Make failure to connect directly to the...
[Samba/id10ts.git] / nsswitch / nsstest.h
blob53adce55005b07aace2a19bf1a2f5a648da1a61c
1 /*
2 Unix SMB/CIFS implementation.
3 nss includes for the nss tester
4 Copyright (C) Kai Blin 2007
6 ** NOTE! The following LGPL license applies to the nsstest
7 ** header. This does NOT imply that all of Samba is released
8 ** under the LGPL
10 This library is free software; you can redistribute it and/or
11 modify it under the terms of the GNU Lesser General Public
12 License as published by the Free Software Foundation; either
13 version 3 of the License, or (at your option) any later version.
15 This library is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Library General Public License for more details.
20 You should have received a copy of the GNU Lesser General Public License
21 along with this program. If not, see <http://www.gnu.org/licenses/>.
24 #ifndef _NSSTEST_H
25 #define _NSSTEST_H
27 #include <pwd.h>
28 #include <grp.h>
30 #ifdef HAVE_NSS_COMMON_H
33 * Sun Solaris
36 #include <nss_common.h>
37 #include <nss_dbdefs.h>
38 #include <nsswitch.h>
40 typedef nss_status_t NSS_STATUS;
42 #define NSS_STATUS_SUCCESS NSS_SUCCESS
43 #define NSS_STATUS_NOTFOUND NSS_NOTFOUND
44 #define NSS_STATUS_UNAVAIL NSS_UNAVAIL
45 #define NSS_STATUS_TRYAGAIN NSS_TRYAGAIN
47 #elif HAVE_NSS_H
50 * Linux (glibc)
53 #include <nss.h>
54 typedef enum nss_status NSS_STATUS;
56 #elif HAVE_NS_API_H
59 * SGI IRIX
62 #ifdef DATUM
63 #define _DATUM_DEFINED
64 #endif
66 #include <ns_api.h>
68 typedef enum
70 NSS_STATUS_SUCCESS=NS_SUCCESS,
71 NSS_STATUS_NOTFOUND=NS_NOTFOUND,
72 NSS_STATUS_UNAVAIL=NS_UNAVAIL,
73 NSS_STATUS_TRYAGAIN=NS_TRYAGAIN
74 } NSS_STATUS;
76 #define NSD_MEM_STATIC 0
77 #define NSD_MEM_VOLATILE 1
78 #define NSD_MEM_DYNAMIC 2
80 #elif defined(HPUX) && defined(HAVE_NSSWITCH_H)
82 /* HP-UX 11 */
84 #include <nsswitch.h>
86 #define NSS_STATUS_SUCCESS NSS_SUCCESS
87 #define NSS_STATUS_NOTFOUND NSS_NOTFOUND
88 #define NSS_STATUS_UNAVAIL NSS_UNAVAIL
89 #define NSS_STATUS_TRYAGAIN NSS_TRYAGAIN
91 #ifdef HAVE_SYNCH_H
92 #include <synch.h>
93 #endif
94 #ifdef HAVE_PTHREAD_H
95 #include <pthread.h>
96 #endif
98 typedef enum {
99 NSS_SUCCESS,
100 NSS_NOTFOUND,
101 NSS_UNAVAIL,
102 NSS_TRYAGAIN
103 } nss_status_t;
105 typedef nss_status_t NSS_STATUS;
107 #else /* Nothing's defined. Neither solaris nor gnu nor sun nor hp */
109 typedef enum
111 NSS_STATUS_SUCCESS=0,
112 NSS_STATUS_NOTFOUND=1,
113 NSS_STATUS_UNAVAIL=2,
114 NSS_STATUS_TRYAGAIN=3
115 } NSS_STATUS;
117 #endif
119 #endif /* _NSSTEST_H */