xref: /illumos-gate/usr/src/head/rpcsvc/svc_dg_priv.h (revision 6e270ca825f06ec0e2d77db462b83074ec585f2f)
1f48205beScasper /*
2f48205beScasper  * CDDL HEADER START
3f48205beScasper  *
4f48205beScasper  * The contents of this file are subject to the terms of the
5f48205beScasper  * Common Development and Distribution License (the "License").
6f48205beScasper  * You may not use this file except in compliance with the License.
7f48205beScasper  *
8f48205beScasper  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9f48205beScasper  * or http://www.opensolaris.org/os/licensing.
10f48205beScasper  * See the License for the specific language governing permissions
11f48205beScasper  * and limitations under the License.
12f48205beScasper  *
13f48205beScasper  * When distributing Covered Code, include this CDDL HEADER in each
14f48205beScasper  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15f48205beScasper  * If applicable, add the following below this CDDL HEADER, with the
16f48205beScasper  * fields enclosed by brackets "[]" replaced with your own identifying
17f48205beScasper  * information: Portions Copyright [yyyy] [name of copyright owner]
18f48205beScasper  *
19f48205beScasper  * CDDL HEADER END
20f48205beScasper  */
21f48205beScasper 
22f48205beScasper /*
23*67dbe2beSCasper H.S. Dik  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24f48205beScasper  * Use is subject to license terms.
25f48205beScasper  */
26f48205beScasper 
27f48205beScasper #ifndef _SVC_DG_PRIV_H
28f48205beScasper #define	_SVC_DG_PRIV_H
29f48205beScasper 
30f48205beScasper /*
31f48205beScasper  * The svc_dg_data private datastructure shared by some services
32f48205beScasper  * for nefarious reasons.  THIS IS NOT AN INTERFACE. DO NOT USE.
33f48205beScasper  */
34f48205beScasper 
35f48205beScasper #ifdef __cplusplus
36f48205beScasper extern "C" {
37f48205beScasper #endif
38f48205beScasper 
39*67dbe2beSCasper H.S. Dik /*
40*67dbe2beSCasper H.S. Dik  * The size of the option header should include sufficient space for
41*67dbe2beSCasper H.S. Dik  * a ucred; we reserve 32 words as before we had ucreds and we allocate
42*67dbe2beSCasper H.S. Dik  * sizeof (svc_dg_data) + ucred_size().  Of course, opts must be declared
43*67dbe2beSCasper H.S. Dik  * last so it can use the additional memory.
44*67dbe2beSCasper H.S. Dik  */
45*67dbe2beSCasper H.S. Dik #define	MAX_OPT_WORDS	32
46f48205beScasper 
47f48205beScasper /*
48f48205beScasper  * kept in xprt->xp_p2
49f48205beScasper  */
50f48205beScasper struct svc_dg_data {
51f48205beScasper 	/* Note: optbuf must be the first field, used by ti_opts.c code */
52f48205beScasper 	struct	netbuf optbuf;			/* netbuf for options */
53f48205beScasper 	uint_t	 su_iosz;			/* size of send.recv buffer */
54f48205beScasper 	uint32_t	su_xid;			/* transaction id */
55f48205beScasper 	XDR	su_xdrs;			/* XDR handle */
56f48205beScasper 	char	su_verfbody[MAX_AUTH_BYTES];	/* verifier body */
57f48205beScasper 	char	*su_cache;			/* cached data, NULL if none */
58f48205beScasper 	struct t_unitdata   su_tudata;		/* tu_data for recv */
59*67dbe2beSCasper H.S. Dik 	int	opts[MAX_OPT_WORDS];		/* options: MUST BE LAST */
60f48205beScasper };
61f48205beScasper 
62f48205beScasper #define	get_svc_dg_data(xprt)	((struct svc_dg_data *)((xprt)->xp_p2))
63f48205beScasper 
64f48205beScasper #ifdef __cplusplus
65f48205beScasper }
66f48205beScasper #endif
67f48205beScasper 
68f48205beScasper #endif /* _SVC_DG_PRIV_H */
69