2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License (the "License").
2N/A * You may not use this file except in compliance with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A/*
2N/A * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
2N/A * Use is subject to license terms.
2N/A */
2N/A
2N/A/*
2N/A * nsswitch_priv.h
2N/A *
2N/A * The original switch low level interface to switch was defined in
2N/A * /usr/include/nsswitch.h. Although it was marked "Project Private",
2N/A * it was none-the-less "exposed" and used by several apps. This
2N/A * file, nsswitch_priv.h will *not* go in /usr/include to limit "exposure"
2N/A * and contains new versions of the switch low level interface.
2N/A *
2N/A * This is a Project Private interface. It may change in future releases.
2N/A */
2N/A
2N/A#ifndef _NSSWITCH_PRIV_H
2N/A#define _NSSWITCH_PRIV_H
2N/A
2N/A#pragma ident "%Z%%M% %I% %E% SMI"
2N/A
2N/A#include <nsswitch.h>
2N/A
2N/A#ifdef __cplusplus
2N/Aextern "C" {
2N/A#endif
2N/A
2N/A
2N/A#define __NSW_STD_ERRS_V1 5 /* V1 number of reserved errors */
2N/A
2N/A/*
2N/A * Results: the first of which are from /usr/include/nsswitch.h
2N/A *
2N/A * #define __NSW_SUCCESS 0 found the required data
2N/A * #define __NSW_NOTFOUND 1 the naming service returned lookup failure
2N/A * #define __NSW_UNAVAIL 2 could not call the naming service
2N/A * #define __NSW_TRYAGAIN 3 bind error to suggest a retry
2N/A */
2N/A
2N/A/* nis server in dns forwarding mode and dns server non-response */
2N/A#define __NSW_NISSERVDNS_TRYAGAIN 4
2N/A
2N/A/*
2N/A * Actions: the first of which are from /usr/include/nsswitch.h
2N/A *
2N/A * #define __NSW_CONTINUE 0 the action is to continue to next service
2N/A * #define __NSW_RETURN 1 the action is to return to the user
2N/A */
2N/A
2N/A/* the action is to retry the request until we get an answer */
2N/A#define __NSW_TRYAGAIN_FOREVER 2
2N/A/* the action is to retry the request N times maximum */
2N/A#define __NSW_TRYAGAIN_NTIMES 3
2N/A/* retried N times so disable try-again until service is restored */
2N/A#define __NSW_TRYAGAIN_PAUSED 4
2N/A
2N/A/* is this action available to all switch errs? */
2N/A#define __NSW_COMMON_ACTION(act)\
2N/A (((act) == __NSW_CONTINUE) || ((act) == __NSW_RETURN))
2N/A
2N/A#define __NSW_SUCCESS_ACTION(act) __NSW_COMMON_ACTION(act)
2N/A#define __NSW_NOTFOUND_ACTION(act) __NSW_COMMON_ACTION(act)
2N/A#define __NSW_UNAVAIL_ACTION(act) __NSW_COMMON_ACTION(act)
2N/A#define __NSW_TRYAGAIN_ACTION(act) \
2N/A (__NSW_COMMON_ACTION(act) || \
2N/A ((act) == __NSW_TRYAGAIN_FOREVER) || \
2N/A ((act) == __NSW_TRYAGAIN_NTIMES))
2N/A#define __NSW_UNPAUSE_ACTION(act)\
2N/A (((act) == __NSW_TRYAGAIN_PAUSED) && ((act) = __NSW_TRYAGAIN_NTIMES))
2N/A
2N/A#define __NSW_STR_FOREVER "forever"
2N/A
2N/A#ifdef __NSS_PRIVATE_INTERFACE
2N/A
2N/Astruct __nsw_lookup_v1 {
2N/A char *service_name;
2N/A action_t actions[__NSW_STD_ERRS_V1];
2N/A int max_retries; /* for TRYAGAIN=N */
2N/A struct __nsw_long_err *long_errs;
2N/A struct __nsw_lookup_v1 *next;
2N/A};
2N/A
2N/Astruct __nsw_switchconfig_v1 {
2N/A int vers;
2N/A char *dbase;
2N/A int num_lookups;
2N/A struct __nsw_lookup_v1 *lookups;
2N/A};
2N/A
2N/A#define __NSW_ACTION_V1(lkp, err) \
2N/A ((lkp)->next == NULL ? \
2N/A __NSW_RETURN \
2N/A : \
2N/A ((err) >= 0 && (err) < __NSW_STD_ERRS_V1 ? \
2N/A (lkp)->actions[err] \
2N/A : \
2N/A __nsw_extended_action_v1(lkp, err)))
2N/A
2N/A
2N/Astruct __nsw_switchconfig_v1 *__nsw_getconfig_v1
2N/A (const char *, enum __nsw_parse_err *);
2N/Aint __nsw_freeconfig_v1(struct __nsw_switchconfig_v1 *);
2N/Aaction_t __nsw_extended_action_v1(struct __nsw_lookup_v1 *, int);
2N/A
2N/A#endif /* __NSS_PRIVATE_INTERFACE */
2N/A
2N/A#ifdef __cplusplus
2N/A}
2N/A#endif
2N/A
2N/A#endif /* _NSSWITCH_PRIV_H */