nss.h revision 113595
1181074Sdas/*- 2181074Sdas * Copyright (c) 2003 Networks Associates Technology, Inc. 3181074Sdas * All rights reserved. 4181074Sdas * 5181074Sdas * This software was developed for the FreeBSD Project by 6181074Sdas * Jacques A. Vidrine, Safeport Network Services, and Network 7181074Sdas * Associates Laboratories, the Security Research Division of Network 8181074Sdas * Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035 9181074Sdas * ("CBOSS"), as part of the DARPA CHATS research program. 10181074Sdas * 11181074Sdas * Redistribution and use in source and binary forms, with or without 12181074Sdas * modification, are permitted provided that the following conditions 13181074Sdas * are met: 14181074Sdas * 1. Redistributions of source code must retain the above copyright 15181074Sdas * notice, this list of conditions and the following disclaimer. 16181074Sdas * 2. Redistributions in binary form must reproduce the above copyright 17181074Sdas * notice, this list of conditions and the following disclaimer in the 18181074Sdas * documentation and/or other materials provided with the distribution. 19181074Sdas * 20181074Sdas * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 21181074Sdas * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22181074Sdas * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23181074Sdas * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 24181074Sdas * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25181074Sdas * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26181074Sdas * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27181074Sdas * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28181074Sdas * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29181074Sdas * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30181074Sdas * SUCH DAMAGE. 31181074Sdas * 32181074Sdas * $FreeBSD: head/include/nss.h 113595 2003-04-17 14:14:22Z nectar $ 33181152Sdas * 34181074Sdas * Compatibility header for the GNU C Library-style nsswitch interface. 35181152Sdas */ 36181152Sdas#ifndef _NSS_H_ 37181152Sdas#define _NSS_H_ 38181152Sdas 39181152Sdas#include <nsswitch.h> 40181152Sdas 41181152Sdasenum nss_status { 42181152Sdas NSS_STATUS_TRYAGAIN = -2, 43181152Sdas NSS_STATUS_UNAVAIL, 44181152Sdas NSS_STATUS_NOTFOUND, 45181152Sdas NSS_STATUS_SUCCESS, 46181074Sdas NSS_STATUS_RETURN 47181074Sdas}; 48181074Sdas 49181074Sdas#define __nss_compat_result(rv) \ 50181074Sdas((rv == NSS_STATUS_TRYAGAIN) ? NS_TRYAGAIN : \ 51181074Sdas (rv == NSS_STATUS_UNAVAIL) ? NS_UNAVAIL : \ 52181074Sdas (rv == NSS_STATUS_NOTFOUND) ? NS_NOTFOUND : \ 53181074Sdas (rv == NSS_STATUS_SUCCESS) ? NS_SUCCESS : \ 54181074Sdas (rv == NSS_STATUS_RETURN) ? NS_RETURN : 0) 55181074Sdas 56181074Sdas#endif 57181074Sdas