1167465Smp/*-
259243Sobrien * Copyright (c) 2003 Networks Associates Technology, Inc.
359243Sobrien * All rights reserved.
459243Sobrien *
559243Sobrien * This software was developed for the FreeBSD Project by
659243Sobrien * Jacques A. Vidrine, Safeport Network Services, and Network
759243Sobrien * Associates Laboratories, the Security Research Division of Network
859243Sobrien * Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035
959243Sobrien * ("CBOSS"), as part of the DARPA CHATS research program.
1059243Sobrien *
1159243Sobrien * Redistribution and use in source and binary forms, with or without
1259243Sobrien * modification, are permitted provided that the following conditions
1359243Sobrien * are met:
1459243Sobrien * 1. Redistributions of source code must retain the above copyright
1559243Sobrien *    notice, this list of conditions and the following disclaimer.
1659243Sobrien * 2. Redistributions in binary form must reproduce the above copyright
17100616Smp *    notice, this list of conditions and the following disclaimer in the
1859243Sobrien *    documentation and/or other materials provided with the distribution.
1959243Sobrien *
2059243Sobrien * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
2159243Sobrien * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2259243Sobrien * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2359243Sobrien * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
2459243Sobrien * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2559243Sobrien * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2659243Sobrien * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2759243Sobrien * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2859243Sobrien * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2959243Sobrien * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3059243Sobrien * SUCH DAMAGE.
3159243Sobrien *
3259243Sobrien * $FreeBSD: releng/11.0/include/nss.h 124289 2004-01-09 13:43:49Z nectar $
3359243Sobrien *
3459243Sobrien * Compatibility header for the GNU C Library-style nsswitch interface.
35167465Smp */
3659243Sobrien#ifndef _NSS_H_
3759243Sobrien#define _NSS_H_
3859243Sobrien
3959243Sobrien#include <nsswitch.h>
4059243Sobrien
4169408Sacheenum nss_status {
4259243Sobrien	NSS_STATUS_TRYAGAIN = -2,
43167465Smp	NSS_STATUS_UNAVAIL,
44167465Smp	NSS_STATUS_NOTFOUND,
4569408Sache	NSS_STATUS_SUCCESS,
4659243Sobrien	NSS_STATUS_RETURN
4759243Sobrien};
4859243Sobrien
4959243Sobrien#define __nss_compat_result(rv, err)		\
5059243Sobrien((rv == NSS_STATUS_TRYAGAIN && err == ERANGE) ? NS_RETURN : \
5159243Sobrien (rv == NSS_STATUS_TRYAGAIN) ? NS_TRYAGAIN :	\
5259243Sobrien (rv == NSS_STATUS_UNAVAIL)  ? NS_UNAVAIL  :	\
5359243Sobrien (rv == NSS_STATUS_NOTFOUND) ? NS_NOTFOUND :	\
5459243Sobrien (rv == NSS_STATUS_SUCCESS)  ? NS_SUCCESS  :	\
5559243Sobrien (rv == NSS_STATUS_RETURN)   ? NS_RETURN   : 0)
5659243Sobrien
5759243Sobrien#endif
58145479Smp