nisplus_common.h revision cb5caa98562cf06753163f558cbcfe30b8f4673a
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Common code used by name-service-switch "nisplus" backends
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#ifndef _NISPLUS_COMMON_H
#define _NISPLUS_COMMON_H
#include <nss_dbdefs.h>
/*
* We want these flags turned on in all nis_list() requests that we perform;
* other flags (USE_DGRAM, EXPAND_NAME) are only wanted for some requests.
*/
typedef struct nisplus_backend *nisplus_backend_ptr_t;
struct nisplus_backend {
const char *directory; /* fully qualified directory */
/*
* table_name is fully qualified (includes org_dir and
* directory name) and cached here using one time malloc.
*/
char *table_name;
struct {
} cursor;
/*
* Fields for handling table paths during enumeration.
* The path_list field is allocated dynamically because
* it is kind of big and most applications don't do
* enumeration.
*/
char *table_path;
int path_index;
int path_count;
/*
* Internal fields to support NSS2 format
*/
char *buffer;
int buflen;
};
typedef struct nisplus_backend nisplus_backend_t;
#if defined(__STDC__)
int n_ops,
const char *rdn,
void *dummy);
void *dummy);
void *dummy);
void *arg);
const char *key,
const char *val);
const char *key,
const char *val,
const char *table);
int nobj,
const char *cname,
const char *proto,
char *linep,
char *limit);
extern int nis_hosts_object2str(int nobj,
int af);
#else /* __STDC__ */
extern nss_backend_t *_nss_nisplus_constr();
extern nss_status_t _nss_nisplus_destr();
extern nss_status_t _nss_nisplus_setent();
extern nss_status_t _nss_nisplus_endent();
extern nss_status_t _nss_nisplus_getent();
extern nss_status_t _nss_nisplus_lookup();
extern nss_status_t _nss_nisplus__expand_lookup();
extern int build_aliases_from_nisobj();
#endif /* __STDC__ */
/* Lower-level interface */
int extra_flags,
nis_result **r);
extern int __nis_parse_path();
extern int _thr_main(void);
extern int __nss2herrno();
extern char *inet_ntoa_r();
#endif /* _NISPLUS_COMMON_H */