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 /*
23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 *
26 * Copyright 2017 Nexenta Systems, Inc. All rights reserved.
27 */
28
29 #pragma D depends_on library ip.d
30 #pragma D depends_on library net.d
31 #pragma D depends_on module genunix
32 #pragma D depends_on module smbsrv
33
34 #pragma D binding "1.5" translator
35 translator conninfo_t < struct smb_request *P > {
36 ci_protocol =
37 P->session->ipaddr.a_family == AF_INET6 ? "tcp6" :
38 P->session->ipaddr.a_family == AF_INET ? "tcp" :
39 "<unknown>";
40 ci_local = "<any>"; /* not interesting */
41 ci_remote = P->session->ip_addr_str;
42 };
43
44 /*
45 * The smbopinfo_t structure describes the internal form of a
46 * single SMB request (SMB v1).
47 */
48 typedef struct smbopinfo {
49 cred_t *soi_cred; /* credentials for operation */
50 string soi_share; /* share name */
51 string soi_curpath; /* file handle path (if any) */
52 uint64_t soi_sid; /* session id */
53 uint32_t soi_pid; /* process id */
54 uint32_t soi_status; /* status */
55 uint16_t soi_tid; /* tree id */
56 uint16_t soi_uid; /* user id */
57 uint16_t soi_mid; /* request id */
58 uint16_t soi_fid; /* file id */
59 uint16_t soi_flags2; /* flags2 */
60 uint8_t soi_flags; /* flags */
61 } smbopinfo_t;
62
63 #pragma D binding "1.5" translator
64 translator smbopinfo_t < struct smb_request *P > {
65 soi_cred = (cred_t *)P->user_cr;
66 soi_sid = P->session->s_kid;
67 soi_pid = P->smb_pid;
68 soi_status = P->smb_error.status;
69 soi_tid = P->smb_tid;
70 soi_uid = P->smb_uid;
71 soi_mid = P->smb_mid;
72 soi_fid = P->smb_fid;
73 soi_flags2 = P->smb_flg2;
74 soi_flags = P->smb_flg;
75
76 soi_share = (P->tid_tree == NULL) ? "<NULL>" :
77 P->tid_tree->t_sharename;
78
79 soi_curpath = (P->fid_ofile == NULL ||
80 P->fid_ofile->f_node == NULL ||
81 P->fid_ofile->f_node->vp == NULL ||
82 P->fid_ofile->f_node->vp->v_path == NULL) ? "<NULL>" :
83 P->fid_ofile->f_node->vp->v_path;
84 };
85
86 typedef struct smb_rw_args {
87 off_t soa_offset;
88 uint_t soa_count;
89 } smb_rw_args_t;
90
91 #pragma D binding "1.5" translator
92 translator smb_rw_args_t < smb_request_t *P > {
93 soa_offset = P->arg.rw->rw_offset;
94 soa_count = P->arg.rw->rw_count;
120 soa_share_access = P->arg.open.share_access;
121 soa_create_options = P->arg.open.create_options;
122 soa_create_disposition = P->arg.open.create_disposition;
123 };
124
125 /*
126 * The smb2opinfo_t structure describes the internal form of a
127 * single SMB2 request (SMB v2 and later).
128 */
129 typedef struct smb2opinfo {
130 cred_t *soi_cred; /* credentials for operation */
131 string soi_share; /* share name */
132 string soi_curpath; /* file handle path (if any) */
133 uint64_t soi_sid; /* (internal) session ID */
134 uint64_t soi_mid; /* Message ID */
135 uint64_t soi_asyncid; /* Message ID (when async) */
136 uint64_t soi_uid; /* user ID (SMB2 Session ID) */
137 uint32_t soi_tid; /* tree ID */
138 uint32_t soi_status;
139 uint32_t soi_flags;
140 } smb2opinfo_t;
141
142 #pragma D binding "1.5" translator
143 translator smb2opinfo_t < struct smb_request *P > {
144 soi_cred = (cred_t *)P->user_cr;
145 soi_sid = P->session->s_kid;
146 soi_mid = P->smb2_messageid;
147 soi_asyncid = P->smb2_async_id;
148 soi_uid = P->smb2_ssnid;
149 soi_tid = P->smb_tid;
150 soi_status = P->smb2_status;
151 soi_flags = P->smb2_hdr_flags;
152
153 soi_share = (P->tid_tree == NULL) ? "<NULL>" :
154 P->tid_tree->t_sharename;
155
156 soi_curpath = (P->fid_ofile == NULL ||
157 P->fid_ofile->f_node == NULL ||
158 P->fid_ofile->f_node->vp == NULL ||
159 P->fid_ofile->f_node->vp->v_path == NULL) ? "<NULL>" :
160 P->fid_ofile->f_node->vp->v_path;
161 };
|
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 /*
23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 *
26 * Copyright 2018 Nexenta Systems, Inc. All rights reserved.
27 */
28
29 #pragma D depends_on library ip.d
30 #pragma D depends_on library net.d
31 #pragma D depends_on module genunix
32 #pragma D depends_on module smbsrv
33
34 #pragma D binding "1.5" translator
35 translator conninfo_t < struct smb_request *P > {
36 ci_protocol =
37 P->session->ipaddr.a_family == AF_INET6 ? "tcp6" :
38 P->session->ipaddr.a_family == AF_INET ? "tcp" :
39 "<unknown>";
40 ci_local = "<any>"; /* not interesting */
41 ci_remote = P->session->ip_addr_str;
42 };
43
44 /*
45 * The smbopinfo_t structure describes the internal form of a
46 * single SMB request (SMB v1).
47 */
48 typedef struct smbopinfo {
49 cred_t *soi_cred; /* credentials for operation */
50 string soi_share; /* share name */
51 string soi_curpath; /* file handle path (if any) */
52 uint64_t soi_sid; /* session id */
53 uint32_t soi_pid; /* process id */
54 uint32_t soi_status; /* status */
55 uint16_t soi_tid; /* tree id */
56 uint16_t soi_uid; /* user id */
57 uint16_t soi_mid; /* request id */
58 uint16_t soi_fid; /* file id */
59 uint16_t soi_flags2; /* flags2 */
60 uint8_t soi_flags; /* flags */
61 zoneid_t soi_zoneid; /* zone identifier */
62 } smbopinfo_t;
63
64 #pragma D binding "1.5" translator
65 translator smbopinfo_t < struct smb_request *P > {
66 soi_cred = (cred_t *)P->user_cr;
67 soi_sid = P->session->s_kid;
68 soi_pid = P->smb_pid;
69 soi_status = P->smb_error.status;
70 soi_tid = P->smb_tid;
71 soi_uid = P->smb_uid;
72 soi_mid = P->smb_mid;
73 soi_fid = P->smb_fid;
74 soi_flags2 = P->smb_flg2;
75 soi_flags = P->smb_flg;
76 soi_zoneid = P->sr_server->sv_zid;
77
78 soi_share = (P->tid_tree == NULL) ? "<NULL>" :
79 P->tid_tree->t_sharename;
80
81 soi_curpath = (P->fid_ofile == NULL ||
82 P->fid_ofile->f_node == NULL ||
83 P->fid_ofile->f_node->vp == NULL ||
84 P->fid_ofile->f_node->vp->v_path == NULL) ? "<NULL>" :
85 P->fid_ofile->f_node->vp->v_path;
86 };
87
88 typedef struct smb_rw_args {
89 off_t soa_offset;
90 uint_t soa_count;
91 } smb_rw_args_t;
92
93 #pragma D binding "1.5" translator
94 translator smb_rw_args_t < smb_request_t *P > {
95 soa_offset = P->arg.rw->rw_offset;
96 soa_count = P->arg.rw->rw_count;
122 soa_share_access = P->arg.open.share_access;
123 soa_create_options = P->arg.open.create_options;
124 soa_create_disposition = P->arg.open.create_disposition;
125 };
126
127 /*
128 * The smb2opinfo_t structure describes the internal form of a
129 * single SMB2 request (SMB v2 and later).
130 */
131 typedef struct smb2opinfo {
132 cred_t *soi_cred; /* credentials for operation */
133 string soi_share; /* share name */
134 string soi_curpath; /* file handle path (if any) */
135 uint64_t soi_sid; /* (internal) session ID */
136 uint64_t soi_mid; /* Message ID */
137 uint64_t soi_asyncid; /* Message ID (when async) */
138 uint64_t soi_uid; /* user ID (SMB2 Session ID) */
139 uint32_t soi_tid; /* tree ID */
140 uint32_t soi_status;
141 uint32_t soi_flags;
142 zoneid_t soi_zoneid; /* zone identifier */
143 } smb2opinfo_t;
144
145 #pragma D binding "1.5" translator
146 translator smb2opinfo_t < struct smb_request *P > {
147 soi_cred = (cred_t *)P->user_cr;
148 soi_sid = P->session->s_kid;
149 soi_mid = P->smb2_messageid;
150 soi_asyncid = P->smb2_async_id;
151 soi_uid = P->smb2_ssnid;
152 soi_tid = P->smb_tid;
153 soi_status = P->smb2_status;
154 soi_flags = P->smb2_hdr_flags;
155 soi_zoneid = P->sr_server->sv_zid;
156
157 soi_share = (P->tid_tree == NULL) ? "<NULL>" :
158 P->tid_tree->t_sharename;
159
160 soi_curpath = (P->fid_ofile == NULL ||
161 P->fid_ofile->f_node == NULL ||
162 P->fid_ofile->f_node->vp == NULL ||
163 P->fid_ofile->f_node->vp->v_path == NULL) ? "<NULL>" :
164 P->fid_ofile->f_node->vp->v_path;
165 };
|