getxby_door.h revision 2830:5228d1267a01
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 (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21/*
22 * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
23 * Use is subject to license terms.
24 */
25
26#ifndef	_GETXBY_DOOR_H
27#define	_GETXBY_DOOR_H
28
29#pragma ident	"%Z%%M%	%I%	%E% SMI"
30
31/*
32 * Definitions for client side of doors-based name service caching
33 */
34
35#ifdef	__cplusplus
36extern "C" {
37#endif
38
39#include <netdb.h>
40#include <netinet/in.h>
41#include <arpa/inet.h>
42#include <sys/socket.h>
43#include <grp.h>
44#include <pwd.h>
45#include <exec_attr.h>
46#include <prof_attr.h>
47#include <user_attr.h>
48#include <nss_dbdefs.h>
49
50/*
51 * nscd version 2 doors interfaces
52 * The known, but private NAME_SERVICE_DOOR, filesystem name remains
53 * the same, even though the transfer contents is significantly different.
54 */
55
56#define	NAME_SERVICE_DOOR_V2 2
57#define	NAME_SERVICE_DOOR_VERSION 2
58#ifndef NAME_SERVICE_DOOR
59#define	NAME_SERVICE_DOOR "/var/run/name_service_door"
60#endif
61#define	NAME_SERVICE_DOOR_COOKIE ((void*)(0xdeadbeef^NAME_SERVICE_DOOR_VERSION))
62
63/*
64 * internal APIs
65 */
66
67nss_status_t	_nsc_trydoorcall(void **dptr, size_t *bsize, size_t *dsize);
68nss_status_t	_nsc_trydoorcall_ext(void **dptr, size_t *bsize, size_t *dsize);
69int		_nsc_getdoorbuf(void **dptr, size_t *bsize);
70void		_nsc_resizedoorbuf(size_t bsize);
71int		_nsc_proc_is_cache();
72
73
74struct passwd *
75_uncached_getpwuid_r(uid_t uid, struct passwd *result, char *buffer,
76	int buflen);
77
78struct passwd *
79_uncached_getpwnam_r(const char *name, struct passwd *result, char *buffer,
80	int buflen);
81
82struct group *
83_uncached_getgrnam_r(const char *name, struct group *result, char *buffer,
84    int buflen);
85
86struct group *
87_uncached_getgrgid_r(gid_t gid, struct group *result, char *buffer, int buflen);
88
89
90#ifdef	__cplusplus
91}
92#endif
93
94
95#endif	/* _GETXBY_DOOR_H */
96