15331Samw /* 25331Samw * CDDL HEADER START 35331Samw * 45331Samw * The contents of this file are subject to the terms of the 55331Samw * Common Development and Distribution License (the "License"). 65331Samw * You may not use this file except in compliance with the License. 75331Samw * 85331Samw * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 95331Samw * or http://www.opensolaris.org/os/licensing. 105331Samw * See the License for the specific language governing permissions 115331Samw * and limitations under the License. 125331Samw * 135331Samw * When distributing Covered Code, include this CDDL HEADER in each 145331Samw * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 155331Samw * If applicable, add the following below this CDDL HEADER, with the 165331Samw * fields enclosed by brackets "[]" replaced with your own identifying 175331Samw * information: Portions Copyright [yyyy] [name of copyright owner] 185331Samw * 195331Samw * CDDL HEADER END 205331Samw */ 215331Samw /* 22*11963SAfshin.Ardakani@Sun.COM * Copyright 2010 Sun Microsystems, Inc. All rights reserved. 235331Samw * Use is subject to license terms. 245331Samw */ 255331Samw 265331Samw #ifndef _SMBSRV_SMBINFO_H 275331Samw #define _SMBSRV_SMBINFO_H 285331Samw 295331Samw #include <sys/types.h> 307961SNatalie.Li@Sun.COM #include <smbsrv/netbios.h> 318670SJose.Borrego@Sun.COM #include <netinet/in.h> 328670SJose.Borrego@Sun.COM #include <smbsrv/smb_inet.h> 335331Samw 345331Samw #ifdef __cplusplus 355331Samw extern "C" { 365331Samw #endif 375331Samw 385331Samw /* 395331Samw * Native OS types used in SmbSessionSetupX. 405331Samw */ 415331Samw #ifndef NATIVE_OS_DEFINED 425331Samw #define NATIVE_OS_DEFINED 435331Samw 445331Samw #define NATIVE_OS_UNKNOWN 0x00000000 4510717Samw@Sun.COM #define NATIVE_OS_WINNT 0x00000001 465331Samw #define NATIVE_OS_WIN95 0x00000002 4710717Samw@Sun.COM #define NATIVE_OS_MACOS 0x00000003 4810717Samw@Sun.COM #define NATIVE_OS_WIN2000 0x00000004 495331Samw 505331Samw #endif /* NATIVE_OS_DEFINED */ 515331Samw 525331Samw 535331Samw /* 545331Samw * Native lanman types in SmbSessionSetupX. Note that these values 555331Samw * are not directly related to the negotiated protocol dialect. 565331Samw */ 575331Samw #ifndef NATIVE_LANMAN_DEFINED 585331Samw #define NATIVE_LANMAN_DEFINED 595331Samw 605331Samw #define NATIVE_LM_NONE 0x00000000 615331Samw #define NATIVE_LM_NT 0x00000001 625331Samw #define NATIVE_LM_WIN2000 0x00000002 635331Samw 645331Samw #endif /* NATIVE_LANMAN_DEFINED */ 655331Samw 665331Samw 675331Samw /* PDC types to be used in user authentication process */ 685331Samw 695331Samw #define PDC_UNKNOWN 0 705331Samw #define PDC_WINNT 1 715331Samw #define PDC_WIN2000 2 725331Samw #define PDC_WINXP 3 735331Samw #define PDC_SAMBA 4 745331Samw 755331Samw /* 765331Samw * Please replace the use of MAX_NETWORKS with SMB_PI_MAX_NETWORKS if 775331Samw * you find it used in conjunction with smbparm_info and maybe one day 785331Samw * there will be just a single definition (here) throughout the code. 795331Samw */ 805331Samw #ifndef MAX_NETWORKS 815331Samw #define MAX_NETWORKS 36 825331Samw #endif /* MAX_NETWORKS */ 835331Samw 845331Samw #define SMB_PI_MAX_NETWORKS 36 855331Samw #define SMB_PI_MAX_WINS 2 865331Samw 875331Samw #define SMB_SECMODE_WORKGRP 1 885331Samw #define SMB_SECMODE_DOMAIN 2 895331Samw 905331Samw #define SMB_PI_MAX_HOST 48 917961SNatalie.Li@Sun.COM #define SMB_PI_MAX_DOMAIN 256 925331Samw #define SMB_PI_MAX_SCOPE 16 935331Samw #define SMB_PI_MAX_COMMENT 58 945331Samw #define SMB_PI_MAX_NATIVE_OS 32 955331Samw #define SMB_PI_MAX_LANMAN 32 965331Samw 975331Samw #define SMB_PI_KEEP_ALIVE_MIN (90 * 60) 989343SAfshin.Ardakani@Sun.COM /* 999343SAfshin.Ardakani@Sun.COM * Some older clients (Windows 98) only handle the low byte 1009343SAfshin.Ardakani@Sun.COM * of the max workers value. If the low byte is less than 1019343SAfshin.Ardakani@Sun.COM * SMB_PI_MAX_WORKERS_MIN we set it to SMB_PI_MAX_WORKERS_MIN. 1029343SAfshin.Ardakani@Sun.COM * SMB_PI_MAX_WORKERS_MIN must therefore be < 256 1039343SAfshin.Ardakani@Sun.COM */ 1049343SAfshin.Ardakani@Sun.COM #define SMB_PI_MAX_WORKERS_MIN 64 105*11963SAfshin.Ardakani@Sun.COM 106*11963SAfshin.Ardakani@Sun.COM typedef struct smb_version { 107*11963SAfshin.Ardakani@Sun.COM uint8_t sv_major; 108*11963SAfshin.Ardakani@Sun.COM uint8_t sv_minor; 109*11963SAfshin.Ardakani@Sun.COM } smb_version_t; 1105331Samw 1115331Samw typedef struct smb_kmod_cfg { 1125331Samw uint32_t skc_maxworkers; 1135331Samw uint32_t skc_maxconnections; 1145331Samw uint32_t skc_keepalive; 1155772Sas200622 int32_t skc_restrict_anon; 1165772Sas200622 int32_t skc_signing_enable; 1175772Sas200622 int32_t skc_signing_required; 1185772Sas200622 int32_t skc_oplock_enable; 1195772Sas200622 int32_t skc_sync_enable; 1205772Sas200622 int32_t skc_secmode; 1218670SJose.Borrego@Sun.COM int32_t skc_ipv6_enable; 122*11963SAfshin.Ardakani@Sun.COM smb_version_t skc_version; 1237961SNatalie.Li@Sun.COM char skc_nbdomain[NETBIOS_NAME_SZ]; 1247961SNatalie.Li@Sun.COM char skc_fqdn[SMB_PI_MAX_DOMAIN]; 1255331Samw char skc_hostname[SMB_PI_MAX_HOST]; 1265331Samw char skc_system_comment[SMB_PI_MAX_COMMENT]; 1275331Samw } smb_kmod_cfg_t; 1285331Samw 129*11963SAfshin.Ardakani@Sun.COM /* 130*11963SAfshin.Ardakani@Sun.COM * Major version numbers 131*11963SAfshin.Ardakani@Sun.COM */ 132*11963SAfshin.Ardakani@Sun.COM #define SMB_MAJOR_NT 4 133*11963SAfshin.Ardakani@Sun.COM #define SMB_MAJOR_2000 5 134*11963SAfshin.Ardakani@Sun.COM #define SMB_MAJOR_XP 5 135*11963SAfshin.Ardakani@Sun.COM #define SMB_MAJOR_2003 5 136*11963SAfshin.Ardakani@Sun.COM #define SMB_MAJOR_VISTA 6 137*11963SAfshin.Ardakani@Sun.COM #define SMB_MAJOR_2008 6 138*11963SAfshin.Ardakani@Sun.COM #define SMB_MAJOR_2008R2 6 139*11963SAfshin.Ardakani@Sun.COM 140*11963SAfshin.Ardakani@Sun.COM /* 141*11963SAfshin.Ardakani@Sun.COM * Minor version numbers 142*11963SAfshin.Ardakani@Sun.COM */ 143*11963SAfshin.Ardakani@Sun.COM #define SMB_MINOR_NT 0 144*11963SAfshin.Ardakani@Sun.COM #define SMB_MINOR_2000 0 145*11963SAfshin.Ardakani@Sun.COM #define SMB_MINOR_XP 1 146*11963SAfshin.Ardakani@Sun.COM #define SMB_MINOR_2003 2 147*11963SAfshin.Ardakani@Sun.COM #define SMB_MINOR_VISTA 0 148*11963SAfshin.Ardakani@Sun.COM #define SMB_MINOR_2008 0 149*11963SAfshin.Ardakani@Sun.COM #define SMB_MINOR_2008R2 1 150*11963SAfshin.Ardakani@Sun.COM 151*11963SAfshin.Ardakani@Sun.COM /* 152*11963SAfshin.Ardakani@Sun.COM * Max version length in string format 153*11963SAfshin.Ardakani@Sun.COM */ 154*11963SAfshin.Ardakani@Sun.COM #define SMB_VERSTR_LEN 8 1555331Samw 1569021Samw@Sun.COM int smbnative_os_value(const char *); 1579021Samw@Sun.COM int smbnative_lm_value(const char *); 1589021Samw@Sun.COM int smbnative_pdc_value(const char *); 159*11963SAfshin.Ardakani@Sun.COM const char *smbnative_os_str(smb_version_t *); 160*11963SAfshin.Ardakani@Sun.COM const char *smbnative_lm_str(smb_version_t *); 1615331Samw 1625331Samw /* 1635331Samw * Support for passthrough authentication. 1645331Samw */ 1655331Samw #define AUTH_USER_GRANT 0x00000000 1665331Samw #define AUTH_GUEST_GRANT 0x00000001 1675331Samw #define AUTH_IPC_ONLY_GRANT 0x00000002 1685331Samw 1695331Samw #ifdef __cplusplus 1705331Samw } 1715331Samw #endif 1725331Samw 1735331Samw #endif /* _SMBSRV_SMBINFO_H */ 174