/* $NetBSD: svc_auth.h,v 1.8 2000/06/02 22:57:57 fvdl Exp $ */12/*-3* SPDX-License-Identifier: BSD-3-Clause4*5* Copyright (c) 2009, Sun Microsystems, Inc.6* All rights reserved.7*8* Redistribution and use in source and binary forms, with or without9* modification, are permitted provided that the following conditions are met:10* - Redistributions of source code must retain the above copyright notice,11* this list of conditions and the following disclaimer.12* - Redistributions in binary form must reproduce the above copyright notice,13* this list of conditions and the following disclaimer in the documentation14* and/or other materials provided with the distribution.15* - Neither the name of Sun Microsystems, Inc. nor the names of its16* contributors may be used to endorse or promote products derived17* from this software without specific prior written permission.18*19* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"20* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE21* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE22* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE23* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR24* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF25* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS26* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN27* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)28* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE29* POSSIBILITY OF SUCH DAMAGE.30*/3132/*33* svc_auth.h, Service side of rpc authentication.34*35* Copyright (C) 1984, Sun Microsystems, Inc.36*/3738#ifndef _RPC_SVC_AUTH_H39#define _RPC_SVC_AUTH_H4041/*42* Server side authenticator43*/44__BEGIN_DECLS45extern enum auth_stat _authenticate(struct svc_req *, struct rpc_msg *);46#ifdef _KERNEL47extern int svc_auth_reg(int,48enum auth_stat (*)(struct svc_req *, struct rpc_msg *),49int (*)(struct svc_req *, struct ucred **, int *));50#else51extern int svc_auth_reg(int, enum auth_stat (*)(struct svc_req *,52struct rpc_msg *));53#endif545556extern int svc_getcred(struct svc_req *, struct ucred **, int *);57/*58* struct svc_req *req; -- RPC request59* struct ucred **crp -- Kernel cred to modify60* int *flavorp -- Return RPC auth flavor61*62* Retrieve unix creds corresponding to an RPC request, if63* possible. The auth flavor (AUTH_NONE or AUTH_UNIX) is returned in64* *flavorp. If the flavor is AUTH_UNIX the caller's ucred pointer65* will be modified to point at a ucred structure which reflects the66* values from the request. The caller should call crfree on this67* pointer.68*69* Return's non-zero if credentials were retrieved from the request,70* otherwise zero.71*/7273__END_DECLS7475#endif /* !_RPC_SVC_AUTH_H */767778