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