xref: /titanic_41/usr/src/lib/nsswitch/nis/common/bootparams_getbyname.c (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  *	nis/bootparams_getbyname.c -- "nis" backend for nsswitch "bootparams"
24  *  database.
25  *
26  *	Copyright (c) 1988-1992 Sun Microsystems Inc
27  *	All Rights Reserved.
28  */
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #include <nss_dbdefs.h>
33 #include "nis_common.h"
34 
35 static nss_status_t
getbyname(be,a)36 getbyname(be, a)
37 	nis_backend_ptr_t	be;
38 	void			*a;
39 {
40 	nss_XbyY_args_t		*argp = (nss_XbyY_args_t *) a;
41 
42 	return (_nss_nis_lookup(be, argp, 0, "bootparams",
43 				argp->key.name, 0));
44 }
45 
46 static nis_backend_op_t bootparams_ops[] = {
47 	_nss_nis_destr,
48 	getbyname
49 };
50 
51 /*ARGSUSED*/
52 nss_backend_t *
_nss_nis_bootparams_constr(dummy1,dummy2,dummy3)53 _nss_nis_bootparams_constr(dummy1, dummy2, dummy3)
54 	const char	*dummy1, *dummy2, *dummy3;
55 {
56 	return (_nss_nis_constr(bootparams_ops,
57 		sizeof (bootparams_ops) / sizeof (bootparams_ops[0]),
58 		"bootparams"));
59 }
60