|
root / base / usr / src / uts / common / nfs / nfs_sec.h
nfs_sec.h C 101 lines 2.6 KB
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License, Version 1.0 only
 * (the "License").  You may not use this file except in compliance
 * with the License.
 *
 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
 * or http://www.opensolaris.org/os/licensing.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
 * If applicable, add the following below this CDDL HEADER, with the
 * fields enclosed by brackets "[]" replaced with your own identifying
 * information: Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 */
/*
 * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
 * Use is subject to license terms.
 */

/*
 * nfs_sec.h, NFS specific security service information.
 */

#ifndef	_NFS_SEC_H
#define	_NFS_SEC_H

#ifdef	__cplusplus
extern "C" {
#endif

#include <rpc/rpcsec_gss.h>

#ifndef _KERNEL
#define	NFSSEC_CONF	"/etc/nfssec.conf"
#define	SC_FAILURE	-1
/*
 * An error string produced by nfs_syslog_scerr can be no longer than
 * MAXMSGLEN
 */
#define	MAXMSGLEN	80

/*
 *  Errors for the nfssec_*
 */
#define	SC_NOERROR	0
#define	SC_NOMEM	1
#define	SC_OPENFAIL	2
#define	SC_NOTFOUND	3
#define	SC_BADENTRIES	4	/* Bad entries in nfssec.conf file */
#endif /* _KERNEL */

typedef struct seconfig {
	char		sc_name[MAX_NAME_LEN];
	int		sc_nfsnum;
	int		sc_rpcnum;
	char		sc_gss_mech[MAX_NAME_LEN];
	struct rpc_gss_OID_s	*sc_gss_mech_type;
	uint_t		sc_qop;
	rpc_gss_service_t	sc_service;
	uid_t		sc_uid;
} seconfig_t;

#ifdef _SYSCALL32
typedef struct seconfig32 {
	char		sc_name[MAX_NAME_LEN];
	int32_t		sc_nfsnum;
	int32_t		sc_rpcnum;
	char		sc_gss_mech[MAX_NAME_LEN];
	caddr32_t	sc_gss_mech_type;
	uint32_t	sc_qop;
	int32_t		sc_service;
	uid_t		sc_uid;
} seconfig32_t;
#endif /* _SYSCALL32 */

#ifndef _KERNEL
extern int nfs_getseconfig_default(seconfig_t *);
extern int nfs_getseconfig_byname(char *, seconfig_t *);
extern int nfs_getseconfig_bynumber(int, seconfig_t *);
extern int nfs_getseconfig_bydesc(char *, char *, rpc_gss_service_t,
    seconfig_t *);
extern sec_data_t *nfs_clnt_secdata(seconfig_t *, char *, struct knetconfig *,
    struct netbuf *, int);
extern void nfs_free_secdata(sec_data_t *);
extern int nfs_syslog_scerr(int, char[]);
extern bool_t nfs_get_root_principal(seconfig_t *, char *, caddr_t *);
#endif /* _KERNEL */

#ifdef	__cplusplus
}
#endif

#endif	/* !_NFS_SEC_H */