Print this page
12513 SMB 3.1.1 support for server


   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 (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  23  * Copyright 2018 Nexenta Systems, Inc.  All rights reserved.

  24  */
  25 
  26 #ifndef _SMBSRV_SMBINFO_H
  27 #define _SMBSRV_SMBINFO_H
  28 
  29 #include <sys/types.h>
  30 #include <sys/uuid.h>
  31 #include <smbsrv/netbios.h>
  32 #include <netinet/in.h>
  33 #include <smbsrv/smb_inet.h>
  34 
  35 #ifdef __cplusplus
  36 extern "C" {
  37 #endif
  38 
  39 /*
  40  * Native OS types used in SmbSessionSetupX.
  41  */
  42 #ifndef NATIVE_OS_DEFINED
  43 #define NATIVE_OS_DEFINED


 140 void smb_cfg_set_require(const char *, smb_cfg_val_t *);
 141 
 142 /* See also: smb_ioc_cfg_t */
 143 typedef struct smb_kmod_cfg {
 144         uint32_t skc_maxworkers;
 145         uint32_t skc_maxconnections;
 146         uint32_t skc_keepalive;
 147         int32_t skc_restrict_anon;
 148         int32_t skc_signing_enable;
 149         int32_t skc_signing_required;
 150         int32_t skc_oplock_enable;
 151         int32_t skc_sync_enable;
 152         int32_t skc_secmode;
 153         int32_t skc_netbios_enable;
 154         int32_t skc_ipv6_enable;
 155         int32_t skc_print_enable;
 156         int32_t skc_traverse_mounts;
 157         uint32_t skc_max_protocol;      /* SMB_VERS_... */
 158         uint32_t skc_min_protocol;      /* SMB_VERS_... */
 159         smb_cfg_val_t skc_encrypt; /* EncryptData and RejectUnencryptedAccess */

 160         uint32_t skc_execflags;
 161         uint32_t skc_negtok_len;
 162         smb_version_t skc_version;
 163         uint16_t skc_initial_credits;
 164         uint16_t skc_maximum_credits;
 165         uuid_t skc_machine_uuid;
 166         uchar_t skc_negtok[SMB_PI_MAX_NEGTOK];
 167         char skc_native_os[SMB_PI_MAX_NATIVE_OS];
 168         char skc_native_lm[SMB_PI_MAX_LANMAN];
 169         char skc_nbdomain[NETBIOS_NAME_SZ];
 170         char skc_fqdn[SMB_PI_MAX_DOMAIN];
 171         char skc_hostname[SMB_PI_MAX_HOST];
 172         char skc_system_comment[SMB_PI_MAX_COMMENT];
 173 } smb_kmod_cfg_t;
 174 
 175 #define SMB_EXEC_MAP    0x01
 176 #define SMB_EXEC_UNMAP  0x02
 177 #define SMB_EXEC_TERM   0x04
 178 
 179 #define SMB_EXEC_DISP_CONTINUE  "continue"


 214 const char *smbnative_os_str(smb_version_t *);
 215 const char *smbnative_lm_str(smb_version_t *);
 216 
 217 /*
 218  * Support for passthrough authentication.
 219  */
 220 #define AUTH_USER_GRANT                 0x00000000
 221 #define AUTH_GUEST_GRANT                0x00000001
 222 #define AUTH_IPC_ONLY_GRANT             0x00000002
 223 
 224 /*
 225  * Defined SMB1, SMB2(+) protocol versions, as returned by
 226  * smb_config_get_max_protocol()
 227  */
 228 #define SMB_VERS_1              1       /* arbitrary value < 0x200 */
 229 #define SMB_VERS_2_BASE         0x200   /* for (SMB2 or higher?) tests */
 230 #define SMB_VERS_2_002          0x202   /* "2.002" */
 231 #define SMB_VERS_2_1            0x210   /* "2.1" */
 232 #define SMB_VERS_3_0            0x300   /* "3.0" */
 233 #define SMB_VERS_3_02           0x302   /* "3.02" */







 234 
 235 #ifdef __cplusplus
 236 }
 237 #endif
 238 
 239 #endif /* _SMBSRV_SMBINFO_H */


   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 (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  23  * Copyright 2018 Nexenta Systems, Inc.  All rights reserved.
  24  * Copyright 2020 RackTop Systems, Inc.
  25  */
  26 
  27 #ifndef _SMBSRV_SMBINFO_H
  28 #define _SMBSRV_SMBINFO_H
  29 
  30 #include <sys/types.h>
  31 #include <sys/uuid.h>
  32 #include <smbsrv/netbios.h>
  33 #include <netinet/in.h>
  34 #include <smbsrv/smb_inet.h>
  35 
  36 #ifdef __cplusplus
  37 extern "C" {
  38 #endif
  39 
  40 /*
  41  * Native OS types used in SmbSessionSetupX.
  42  */
  43 #ifndef NATIVE_OS_DEFINED
  44 #define NATIVE_OS_DEFINED


 141 void smb_cfg_set_require(const char *, smb_cfg_val_t *);
 142 
 143 /* See also: smb_ioc_cfg_t */
 144 typedef struct smb_kmod_cfg {
 145         uint32_t skc_maxworkers;
 146         uint32_t skc_maxconnections;
 147         uint32_t skc_keepalive;
 148         int32_t skc_restrict_anon;
 149         int32_t skc_signing_enable;
 150         int32_t skc_signing_required;
 151         int32_t skc_oplock_enable;
 152         int32_t skc_sync_enable;
 153         int32_t skc_secmode;
 154         int32_t skc_netbios_enable;
 155         int32_t skc_ipv6_enable;
 156         int32_t skc_print_enable;
 157         int32_t skc_traverse_mounts;
 158         uint32_t skc_max_protocol;      /* SMB_VERS_... */
 159         uint32_t skc_min_protocol;      /* SMB_VERS_... */
 160         smb_cfg_val_t skc_encrypt; /* EncryptData and RejectUnencryptedAccess */
 161         uint16_t skc_encrypt_cipher;    /* 3.1.1 encryption cipher */
 162         uint32_t skc_execflags;
 163         uint32_t skc_negtok_len;
 164         smb_version_t skc_version;
 165         uint16_t skc_initial_credits;
 166         uint16_t skc_maximum_credits;
 167         uuid_t skc_machine_uuid;
 168         uchar_t skc_negtok[SMB_PI_MAX_NEGTOK];
 169         char skc_native_os[SMB_PI_MAX_NATIVE_OS];
 170         char skc_native_lm[SMB_PI_MAX_LANMAN];
 171         char skc_nbdomain[NETBIOS_NAME_SZ];
 172         char skc_fqdn[SMB_PI_MAX_DOMAIN];
 173         char skc_hostname[SMB_PI_MAX_HOST];
 174         char skc_system_comment[SMB_PI_MAX_COMMENT];
 175 } smb_kmod_cfg_t;
 176 
 177 #define SMB_EXEC_MAP    0x01
 178 #define SMB_EXEC_UNMAP  0x02
 179 #define SMB_EXEC_TERM   0x04
 180 
 181 #define SMB_EXEC_DISP_CONTINUE  "continue"


 216 const char *smbnative_os_str(smb_version_t *);
 217 const char *smbnative_lm_str(smb_version_t *);
 218 
 219 /*
 220  * Support for passthrough authentication.
 221  */
 222 #define AUTH_USER_GRANT                 0x00000000
 223 #define AUTH_GUEST_GRANT                0x00000001
 224 #define AUTH_IPC_ONLY_GRANT             0x00000002
 225 
 226 /*
 227  * Defined SMB1, SMB2(+) protocol versions, as returned by
 228  * smb_config_get_max_protocol()
 229  */
 230 #define SMB_VERS_1              1       /* arbitrary value < 0x200 */
 231 #define SMB_VERS_2_BASE         0x200   /* for (SMB2 or higher?) tests */
 232 #define SMB_VERS_2_002          0x202   /* "2.002" */
 233 #define SMB_VERS_2_1            0x210   /* "2.1" */
 234 #define SMB_VERS_3_0            0x300   /* "3.0" */
 235 #define SMB_VERS_3_02           0x302   /* "3.02" */
 236 #define SMB_VERS_3_11           0x311   /* "3.11" */
 237 
 238 #define SMB3_HASH_SHA512        1
 239 
 240 #define SMB3_CIPHER_NONE        0
 241 #define SMB3_CIPHER_AES128_CCM  1
 242 #define SMB3_CIPHER_AES128_GCM  2
 243 
 244 #ifdef __cplusplus
 245 }
 246 #endif
 247 
 248 #endif /* _SMBSRV_SMBINFO_H */