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
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.
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]
23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
26 /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
27 /* All Rights Reserved */
29 * Portions of this source code were derived from Berkeley
30 * 4.3 BSD under license from the Regents of the University of
34 #ifndef _RPC_SVC_AUTH_H
35 #define _RPC_SVC_AUTH_H
37 #pragma ident "%Z%%M% %I% %E% SMI"
40 * svc_auth.h, Service side of rpc authentication.
42 #include <rpc/rpcsec_gss.h>
43 #include <rpc/rpc_msg.h>
50 * Server side authenticator
54 * Copy of GSS parameters, needed for MT operation
58 rpc_gss_service_t service
;
62 } svc_rpc_gss_parms_t
;
65 * sec_svc_control() commands
67 #define RPC_SVC_SET_GSS_CALLBACK 1 /* set rpcsec_gss callback routine */
68 extern bool_t
sec_svc_control();
71 * Interface to server-side authentication flavors, may change on
77 int (*svc_ah_unwrap
)();
79 caddr_t svc_ah_private
;
80 svc_rpc_gss_parms_t svc_gss_parms
;
81 rpc_gss_rawcred_t raw_cred
;
84 #define SVCAUTH_GSSPARMS(auth) ((svc_rpc_gss_parms_t *)&(auth)->svc_gss_parms)
87 * Auth flavors can now apply a transformation in addition to simple XDR
88 * on the body of a call/response in ways that depend on the flavor being
89 * used. These interfaces provide a generic interface between the
90 * internal RPC frame and the auth flavor specific code to allow the
91 * auth flavor to encode (WRAP) or decode (UNWRAP) the body.
93 #define SVCAUTH_WRAP(auth, xdrs, xfunc, xwhere) \
94 ((*((auth)->svc_ah_ops.svc_ah_wrap))(auth, xdrs, xfunc, xwhere))
95 #define SVCAUTH_UNWRAP(auth, xdrs, xfunc, xwhere) \
96 ((*((auth)->svc_ah_ops.svc_ah_unwrap))(auth, xdrs, xfunc, xwhere))
99 * Server side authenticator
102 extern enum auth_stat
sec_svc_msg(struct svc_req
*, struct rpc_msg
*,
105 extern enum auth_stat
sec_svc_msg();
106 #endif /* __STDC__ */
111 extern enum auth_stat
__gss_authenticate(struct svc_req
*, struct rpc_msg
*,
113 extern enum auth_stat
__authenticate(struct svc_req
*, struct rpc_msg
*);
115 extern enum auth_stat
__gss_authenticate();
116 extern enum auth_stat
__authenticate();
117 #endif /* __STDC__ */
125 #endif /* _RPC_SVC_AUTH_H */