nss.h revision 113595
12175Sjp161948/*-
22175Sjp161948 * Copyright (c) 2003 Networks Associates Technology, Inc.
32175Sjp161948 * All rights reserved.
42175Sjp161948 *
52175Sjp161948 * This software was developed for the FreeBSD Project by
62175Sjp161948 * Jacques A. Vidrine, Safeport Network Services, and Network
72175Sjp161948 * Associates Laboratories, the Security Research Division of Network
82175Sjp161948 * Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035
92175Sjp161948 * ("CBOSS"), as part of the DARPA CHATS research program.
102175Sjp161948 *
112175Sjp161948 * Redistribution and use in source and binary forms, with or without
122175Sjp161948 * modification, are permitted provided that the following conditions
132175Sjp161948 * are met:
142175Sjp161948 * 1. Redistributions of source code must retain the above copyright
152175Sjp161948 *    notice, this list of conditions and the following disclaimer.
162175Sjp161948 * 2. Redistributions in binary form must reproduce the above copyright
172175Sjp161948 *    notice, this list of conditions and the following disclaimer in the
182175Sjp161948 *    documentation and/or other materials provided with the distribution.
192175Sjp161948 *
202175Sjp161948 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
212175Sjp161948 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
222175Sjp161948 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
232175Sjp161948 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
242175Sjp161948 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
252175Sjp161948 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
262175Sjp161948 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
272175Sjp161948 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
282175Sjp161948 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
292175Sjp161948 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
302175Sjp161948 * SUCH DAMAGE.
312175Sjp161948 *
322175Sjp161948 * $FreeBSD: head/include/nss.h 113595 2003-04-17 14:14:22Z nectar $
332175Sjp161948 *
342175Sjp161948 * Compatibility header for the GNU C Library-style nsswitch interface.
352175Sjp161948 */
362175Sjp161948#ifndef _NSS_H_
372175Sjp161948#define _NSS_H_
382175Sjp161948
392175Sjp161948#include <nsswitch.h>
402175Sjp161948
412175Sjp161948enum nss_status {
422175Sjp161948	NSS_STATUS_TRYAGAIN = -2,
432175Sjp161948	NSS_STATUS_UNAVAIL,
442175Sjp161948	NSS_STATUS_NOTFOUND,
452175Sjp161948	NSS_STATUS_SUCCESS,
462175Sjp161948	NSS_STATUS_RETURN
472175Sjp161948};
482175Sjp161948
49#define __nss_compat_result(rv)			\
50((rv == NSS_STATUS_TRYAGAIN) ? NS_TRYAGAIN :	\
51 (rv == NSS_STATUS_UNAVAIL)  ? NS_UNAVAIL  :	\
52 (rv == NSS_STATUS_NOTFOUND) ? NS_NOTFOUND :	\
53 (rv == NSS_STATUS_SUCCESS)  ? NS_SUCCESS  :	\
54 (rv == NSS_STATUS_RETURN)   ? NS_RETURN   : 0)
55
56#endif
57