155682Smarkm/*-
2233294Sstas * Copyright (c) 2003 Networks Associates Technology, Inc.
3233294Sstas * All rights reserved.
4233294Sstas *
555682Smarkm * This software was developed for the FreeBSD Project by
6233294Sstas * Jacques A. Vidrine, Safeport Network Services, and Network
7233294Sstas * Associates Laboratories, the Security Research Division of Network
8233294Sstas * Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035
955682Smarkm * ("CBOSS"), as part of the DARPA CHATS research program.
10233294Sstas *
11233294Sstas * Redistribution and use in source and binary forms, with or without
1255682Smarkm * modification, are permitted provided that the following conditions
13233294Sstas * are met:
14233294Sstas * 1. Redistributions of source code must retain the above copyright
15233294Sstas *    notice, this list of conditions and the following disclaimer.
1655682Smarkm * 2. Redistributions in binary form must reproduce the above copyright
17233294Sstas *    notice, this list of conditions and the following disclaimer in the
18233294Sstas *    documentation and/or other materials provided with the distribution.
19233294Sstas *
2055682Smarkm * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
21233294Sstas * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22233294Sstas * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23233294Sstas * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
24233294Sstas * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25233294Sstas * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26233294Sstas * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27233294Sstas * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28233294Sstas * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29233294Sstas * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30233294Sstas * SUCH DAMAGE.
31233294Sstas *
3255682Smarkm * $FreeBSD: releng/10.2/include/nss.h 124289 2004-01-09 13:43:49Z nectar $
3355682Smarkm *
3455682Smarkm * Compatibility header for the GNU C Library-style nsswitch interface.
3555682Smarkm */
36233294Sstas#ifndef _NSS_H_
3755682Smarkm#define _NSS_H_
3855682Smarkm
3955682Smarkm#include <nsswitch.h>
4055682Smarkm
4155682Smarkmenum nss_status {
4255682Smarkm	NSS_STATUS_TRYAGAIN = -2,
4372445Sassar	NSS_STATUS_UNAVAIL,
4455682Smarkm	NSS_STATUS_NOTFOUND,
4555682Smarkm	NSS_STATUS_SUCCESS,
4655682Smarkm	NSS_STATUS_RETURN
4755682Smarkm};
4855682Smarkm
4955682Smarkm#define __nss_compat_result(rv, err)		\
5055682Smarkm((rv == NSS_STATUS_TRYAGAIN && err == ERANGE) ? NS_RETURN : \
5155682Smarkm (rv == NSS_STATUS_TRYAGAIN) ? NS_TRYAGAIN :	\
5255682Smarkm (rv == NSS_STATUS_UNAVAIL)  ? NS_UNAVAIL  :	\
5355682Smarkm (rv == NSS_STATUS_NOTFOUND) ? NS_NOTFOUND :	\
5455682Smarkm (rv == NSS_STATUS_SUCCESS)  ? NS_SUCCESS  :	\
5555682Smarkm (rv == NSS_STATUS_RETURN)   ? NS_RETURN   : 0)
56233294Sstas
57233294Sstas#endif
5855682Smarkm