1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 * or http://www.opensolaris.org/os/licensing. 10 * See the License for the specific language governing permissions 11 * and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL HEADER in each 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21 /* 22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 * Use is subject to license terms. 24 */ 25 26 #ifndef _SMBSRV_SMBINFO_H 27 #define _SMBSRV_SMBINFO_H 28 29 #include <sys/types.h> 30 #include <smbsrv/netbios.h> 31 32 #ifdef __cplusplus 33 extern "C" { 34 #endif 35 36 /* 37 * Native OS types used in SmbSessionSetupX. 38 */ 39 #ifndef NATIVE_OS_DEFINED 40 #define NATIVE_OS_DEFINED 41 42 #define NATIVE_OS_UNKNOWN 0x00000000 43 #define NATIVE_OS_NT4_0 0x00000001 44 #define NATIVE_OS_WIN95 0x00000002 45 #define NATIVE_OS_OTHER 0x00000003 46 #define NATIVE_OS_NT5_0 0x00000004 47 #define NATIVE_OS_NT5_1 0x00000005 48 #define NATIVE_OS_MACOS 0x00000006 49 50 /* 51 * Backward compatibility aliases. 52 */ 53 #define NATIVE_OS_WINNT NATIVE_OS_NT4_0 54 #define NATIVE_OS_WIN2000 NATIVE_OS_NT5_0 55 #define NATIVE_OS_WINXP NATIVE_OS_NT5_1 56 57 #endif /* NATIVE_OS_DEFINED */ 58 59 60 /* 61 * Native lanman types in SmbSessionSetupX. Note that these values 62 * are not directly related to the negotiated protocol dialect. 63 */ 64 #ifndef NATIVE_LANMAN_DEFINED 65 #define NATIVE_LANMAN_DEFINED 66 67 #define NATIVE_LM_NONE 0x00000000 68 #define NATIVE_LM_NT 0x00000001 69 #define NATIVE_LM_WIN2000 0x00000002 70 71 #endif /* NATIVE_LANMAN_DEFINED */ 72 73 74 /* PDC types to be used in user authentication process */ 75 76 #define PDC_UNKNOWN 0 77 #define PDC_WINNT 1 78 #define PDC_WIN2000 2 79 #define PDC_WINXP 3 80 #define PDC_SAMBA 4 81 82 /* 83 * Please replace the use of MAX_NETWORKS with SMB_PI_MAX_NETWORKS if 84 * you find it used in conjunction with smbparm_info and maybe one day 85 * there will be just a single definition (here) throughout the code. 86 */ 87 #ifndef MAX_NETWORKS 88 #define MAX_NETWORKS 36 89 #endif /* MAX_NETWORKS */ 90 91 #define SMB_PI_MAX_NETWORKS 36 92 #define SMB_PI_MAX_WINS 2 93 94 #define SMB_SECMODE_WORKGRP 1 95 #define SMB_SECMODE_DOMAIN 2 96 97 #define SMB_PI_MAX_HOST 48 98 #define SMB_PI_MAX_DOMAIN 256 99 #define SMB_PI_MAX_SCOPE 16 100 #define SMB_PI_MAX_COMMENT 58 101 #define SMB_PI_MAX_NATIVE_OS 32 102 #define SMB_PI_MAX_LANMAN 32 103 104 105 #define SMB_PI_UNKNOWN_DOMAIN 0 106 #define SMB_PI_RESOURCE_DOMAIN 1 107 108 /* 109 * K.L. The keep alive time out use to default to 900 110 * seconds. It is not long enough for some applications 111 * i.e. MS Access. We currently use 5400 seconds. 112 */ 113 #define SMB_PI_KEEP_ALIVE_MIN (90 * 60) 114 #define SMB_LM_COMPATIBILITY_DEFAULT_LEV 3 115 116 typedef struct smb_kmod_cfg { 117 uint32_t skc_maxworkers; 118 uint32_t skc_maxconnections; 119 uint32_t skc_keepalive; 120 int32_t skc_restrict_anon; 121 int32_t skc_signing_enable; 122 int32_t skc_signing_required; 123 int32_t skc_oplock_enable; 124 int32_t skc_sync_enable; 125 int32_t skc_secmode; 126 char skc_nbdomain[NETBIOS_NAME_SZ]; 127 char skc_fqdn[SMB_PI_MAX_DOMAIN]; 128 char skc_hostname[SMB_PI_MAX_HOST]; 129 char skc_system_comment[SMB_PI_MAX_COMMENT]; 130 } smb_kmod_cfg_t; 131 132 #define SMB_VERSION_MAJOR 4 133 #define SMB_VERSION_MINOR 0 134 135 int smbnative_os_value(char *native_os); 136 int smbnative_lm_value(char *native_lm); 137 int smbnative_pdc_value(char *native_lm); 138 139 /* 140 * Support for passthrough authentication. 141 */ 142 #define AUTH_USER_GRANT 0x00000000 143 #define AUTH_GUEST_GRANT 0x00000001 144 #define AUTH_IPC_ONLY_GRANT 0x00000002 145 #define AUTH_CONEXUS_GRANT 0x00000004 146 147 #ifdef __cplusplus 148 } 149 #endif 150 151 #endif /* _SMBSRV_SMBINFO_H */ 152