smbns_krb.h revision 12b65585e720714b31036daaa2b30eb76014048e
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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
* 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 2014 Nexenta Systems, Inc. All rights reserved.
*/
#ifndef _SMBSRV_SMB_KRB_H
#define _SMBSRV_SMB_KRB_H
#include <kerberosv5/krb5.h>
#ifdef __cplusplus
extern "C" {
#endif
#define SMBNS_KRB5_KEYTAB "/etc/krb5/krb5.keytab"
#define SMBNS_KRB5_KEYTAB_TMP "/etc/krb5/krb5.keytab.tmp.XXXXXX"
#define SMB_PN_SVC_HOST "host"
#define SMB_PN_SVC_CIFS "cifs"
#define SMB_PN_SVC_NFS "nfs"
#define SMB_PN_SVC_HTTP "HTTP"
#define SMB_PN_SVC_ROOT "root"
/* Assign an identifier for each principal name format */
typedef enum smb_krb5_pn_id {
SMB_KRB5_PN_ID_HOST_FQHN, /* fully qualified name */
SMB_KRB5_PN_ID_HOST_SHORT, /* short name */
SMB_KRB5_PN_ID_MACHINE, /* the machine account */
/*
* A principal name can be constructed based on the following:
*
* p_id - identifier for a principal name.
* p_svc - service with which the principal is associated.
* p_flags - usage of the principal is identified - whether it can be used as a
*/
typedef struct smb_krb5_pn {
char *p_svc;
/*
* A set of principal names
*
* ps_cnt - the number of principal names in the array.
* ps_set - An array of principal names terminated with a NULL pointer.
*/
typedef struct smb_krb5_pn_set {
char **s_pns;
int smb_kinit(char *, char *);
int smb_krb5_ctx_init(krb5_context *);
void smb_krb5_ctx_fini(krb5_context);
int smb_krb5_setpwd(krb5_context, const char *, char *);
int, char *, krb5_kvno, char *, krb5_enctype *, int);
void smb_krb5_free_pn_set(smb_krb5_pn_set_t *);
#ifdef __cplusplus
}
#endif
#endif /* _SMBSRV_SMB_KRB_H */