| 1 | /* nss.h,v 1.2 2004/09/14 22:27:34 bird Exp */
|
|---|
| 2 | /** @file
|
|---|
| 3 | * FreeBSD 5.2
|
|---|
| 4 | */
|
|---|
| 5 |
|
|---|
| 6 | /*-
|
|---|
| 7 | * Copyright (c) 2003 Networks Associates Technology, Inc.
|
|---|
| 8 | * All rights reserved.
|
|---|
| 9 | *
|
|---|
| 10 | * This software was developed for the FreeBSD Project by
|
|---|
| 11 | * Jacques A. Vidrine, Safeport Network Services, and Network
|
|---|
| 12 | * Associates Laboratories, the Security Research Division of Network
|
|---|
| 13 | * Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035
|
|---|
| 14 | * ("CBOSS"), as part of the DARPA CHATS research program.
|
|---|
| 15 | *
|
|---|
| 16 | * Redistribution and use in source and binary forms, with or without
|
|---|
| 17 | * modification, are permitted provided that the following conditions
|
|---|
| 18 | * are met:
|
|---|
| 19 | * 1. Redistributions of source code must retain the above copyright
|
|---|
| 20 | * notice, this list of conditions and the following disclaimer.
|
|---|
| 21 | * 2. Redistributions in binary form must reproduce the above copyright
|
|---|
| 22 | * notice, this list of conditions and the following disclaimer in the
|
|---|
| 23 | * documentation and/or other materials provided with the distribution.
|
|---|
| 24 | *
|
|---|
| 25 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|---|
| 26 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|---|
| 27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|---|
| 28 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|---|
| 29 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|---|
| 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|---|
| 31 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|---|
| 32 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|---|
| 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|---|
| 34 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|---|
| 35 | * SUCH DAMAGE.
|
|---|
| 36 | *
|
|---|
| 37 | * $FreeBSD: src/include/nss.h,v 1.1 2003/04/17 14:14:22 nectar Exp $
|
|---|
| 38 | *
|
|---|
| 39 | * Compatibility header for the GNU C Library-style nsswitch interface.
|
|---|
| 40 | */
|
|---|
| 41 | #ifndef _NSS_H_
|
|---|
| 42 | #define _NSS_H_
|
|---|
| 43 |
|
|---|
| 44 | #include <nsswitch.h>
|
|---|
| 45 |
|
|---|
| 46 | enum nss_status {
|
|---|
| 47 | NSS_STATUS_TRYAGAIN = -2,
|
|---|
| 48 | NSS_STATUS_UNAVAIL,
|
|---|
| 49 | NSS_STATUS_NOTFOUND,
|
|---|
| 50 | NSS_STATUS_SUCCESS,
|
|---|
| 51 | NSS_STATUS_RETURN
|
|---|
| 52 | };
|
|---|
| 53 |
|
|---|
| 54 | #define __nss_compat_result(rv) \
|
|---|
| 55 | ((rv == NSS_STATUS_TRYAGAIN) ? NS_TRYAGAIN : \
|
|---|
| 56 | (rv == NSS_STATUS_UNAVAIL) ? NS_UNAVAIL : \
|
|---|
| 57 | (rv == NSS_STATUS_NOTFOUND) ? NS_NOTFOUND : \
|
|---|
| 58 | (rv == NSS_STATUS_SUCCESS) ? NS_SUCCESS : \
|
|---|
| 59 | (rv == NSS_STATUS_RETURN) ? NS_RETURN : 0)
|
|---|
| 60 |
|
|---|
| 61 | #endif
|
|---|