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 (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
23 * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
24 * Copyright 2017 Joyent, Inc.
25 */
26
27 #include <sys/types.h>
28 #include <sys/stat.h>
29 #include <sys/ioccom.h>
30 #include <sys/param.h>
31 #include <stddef.h>
32 #include <stdio.h>
33 #include <string.h>
34 #include <strings.h>
35 #include <stdlib.h>
36 #include <unistd.h>
37 #include <fcntl.h>
38 #include <errno.h>
39
40 #include <smbsrv/smb_xdr.h>
41 #include <smbsrv/smbinfo.h>
42 #include <smbsrv/smb_ioctl.h>
43 #include <smbsrv/libsmb.h>
72 /* See also: smbsrv smb_server_store_cfg */
73 int
74 smb_kmod_setcfg(smb_kmod_cfg_t *cfg)
75 {
76 smb_ioc_cfg_t ioc;
77
78 ioc.maxworkers = cfg->skc_maxworkers;
79 ioc.maxconnections = cfg->skc_maxconnections;
80 ioc.keepalive = cfg->skc_keepalive;
81 ioc.restrict_anon = cfg->skc_restrict_anon;
82 ioc.signing_enable = cfg->skc_signing_enable;
83 ioc.signing_required = cfg->skc_signing_required;
84 ioc.oplock_enable = cfg->skc_oplock_enable;
85 ioc.sync_enable = cfg->skc_sync_enable;
86 ioc.secmode = cfg->skc_secmode;
87 ioc.netbios_enable = cfg->skc_netbios_enable;
88 ioc.ipv6_enable = cfg->skc_ipv6_enable;
89 ioc.print_enable = cfg->skc_print_enable;
90 ioc.traverse_mounts = cfg->skc_traverse_mounts;
91 ioc.max_protocol = cfg->skc_max_protocol;
92 ioc.exec_flags = cfg->skc_execflags;
93 ioc.negtok_len = cfg->skc_negtok_len;
94 ioc.version = cfg->skc_version;
95 ioc.initial_credits = cfg->skc_initial_credits;
96 ioc.maximum_credits = cfg->skc_maximum_credits;
97
98 (void) memcpy(ioc.machine_uuid, cfg->skc_machine_uuid, sizeof (uuid_t));
99 (void) memcpy(ioc.negtok, cfg->skc_negtok, sizeof (ioc.negtok));
100 (void) memcpy(ioc.native_os, cfg->skc_native_os,
101 sizeof (ioc.native_os));
102 (void) memcpy(ioc.native_lm, cfg->skc_native_lm,
103 sizeof (ioc.native_lm));
104
105 (void) strlcpy(ioc.nbdomain, cfg->skc_nbdomain, sizeof (ioc.nbdomain));
106 (void) strlcpy(ioc.fqdn, cfg->skc_fqdn, sizeof (ioc.fqdn));
107 (void) strlcpy(ioc.hostname, cfg->skc_hostname, sizeof (ioc.hostname));
108 (void) strlcpy(ioc.system_comment, cfg->skc_system_comment,
109 sizeof (ioc.system_comment));
110
111 return (smb_kmod_ioctl(SMB_IOC_CONFIG, &ioc.hdr, sizeof (ioc)));
112 }
113
114 int
115 smb_kmod_setgmtoff(int32_t gmtoff)
116 {
|
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 (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
23 * Copyright 2017 Nexenta Systems, Inc. All rights reserved.
24 * Copyright 2017 Joyent, Inc.
25 */
26
27 #include <sys/types.h>
28 #include <sys/stat.h>
29 #include <sys/ioccom.h>
30 #include <sys/param.h>
31 #include <stddef.h>
32 #include <stdio.h>
33 #include <string.h>
34 #include <strings.h>
35 #include <stdlib.h>
36 #include <unistd.h>
37 #include <fcntl.h>
38 #include <errno.h>
39
40 #include <smbsrv/smb_xdr.h>
41 #include <smbsrv/smbinfo.h>
42 #include <smbsrv/smb_ioctl.h>
43 #include <smbsrv/libsmb.h>
72 /* See also: smbsrv smb_server_store_cfg */
73 int
74 smb_kmod_setcfg(smb_kmod_cfg_t *cfg)
75 {
76 smb_ioc_cfg_t ioc;
77
78 ioc.maxworkers = cfg->skc_maxworkers;
79 ioc.maxconnections = cfg->skc_maxconnections;
80 ioc.keepalive = cfg->skc_keepalive;
81 ioc.restrict_anon = cfg->skc_restrict_anon;
82 ioc.signing_enable = cfg->skc_signing_enable;
83 ioc.signing_required = cfg->skc_signing_required;
84 ioc.oplock_enable = cfg->skc_oplock_enable;
85 ioc.sync_enable = cfg->skc_sync_enable;
86 ioc.secmode = cfg->skc_secmode;
87 ioc.netbios_enable = cfg->skc_netbios_enable;
88 ioc.ipv6_enable = cfg->skc_ipv6_enable;
89 ioc.print_enable = cfg->skc_print_enable;
90 ioc.traverse_mounts = cfg->skc_traverse_mounts;
91 ioc.max_protocol = cfg->skc_max_protocol;
92 ioc.min_protocol = cfg->skc_min_protocol;
93 ioc.exec_flags = cfg->skc_execflags;
94 ioc.negtok_len = cfg->skc_negtok_len;
95 ioc.version = cfg->skc_version;
96 ioc.initial_credits = cfg->skc_initial_credits;
97 ioc.maximum_credits = cfg->skc_maximum_credits;
98 ioc.encrypt = cfg->skc_encrypt;
99
100 (void) memcpy(ioc.machine_uuid, cfg->skc_machine_uuid, sizeof (uuid_t));
101 (void) memcpy(ioc.negtok, cfg->skc_negtok, sizeof (ioc.negtok));
102 (void) memcpy(ioc.native_os, cfg->skc_native_os,
103 sizeof (ioc.native_os));
104 (void) memcpy(ioc.native_lm, cfg->skc_native_lm,
105 sizeof (ioc.native_lm));
106
107 (void) strlcpy(ioc.nbdomain, cfg->skc_nbdomain, sizeof (ioc.nbdomain));
108 (void) strlcpy(ioc.fqdn, cfg->skc_fqdn, sizeof (ioc.fqdn));
109 (void) strlcpy(ioc.hostname, cfg->skc_hostname, sizeof (ioc.hostname));
110 (void) strlcpy(ioc.system_comment, cfg->skc_system_comment,
111 sizeof (ioc.system_comment));
112
113 return (smb_kmod_ioctl(SMB_IOC_CONFIG, &ioc.hdr, sizeof (ioc)));
114 }
115
116 int
117 smb_kmod_setgmtoff(int32_t gmtoff)
118 {
|