1 #!/usr/sbin/dtrace -s 2 /* 3 * CDDL HEADER START 4 * 5 * The contents of this file are subject to the terms of the 6 * Common Development and Distribution License (the "License"). 7 * You may not use this file except in compliance with the License. 8 * 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10 * or http://www.opensolaris.org/os/licensing. 11 * See the License for the specific language governing permissions 12 * and limitations under the License. 13 * 14 * When distributing Covered Code, include this CDDL HEADER in each 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 * If applicable, add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your own identifying 18 * information: Portions Copyright [yyyy] [name of copyright owner] 19 * 20 * CDDL HEADER END 21 */ 22 /* 23 * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 24 * Use is subject to license terms. 25 */ 26 27 #pragma ident "%Z%%M% %I% %E% SMI" 28 29 /* 30 * Usage: ./msrpc.d -p `pgrep smbd` 31 * 32 * On multi-processor systems, it may be easier to follow the output 33 * if run on a single processor: see psradm. For example, to disable 34 * the second processor on a dual-processor system: psradm -f 1 35 */ 36 37 /* 38 * SmbSessionSetupX, SmbLogoffX 39 * SmbTreeConnect, SmbTreeDisconnect 40 */ 41 smb_session*:entry, 42 smb_tree*:entry, 43 smb_com_*:entry, 44 smb_com_*:return, 45 smb_com_session_setup_andx:entry, 46 smb_com_logoff_andx:entry, 47 smb_tree_connect:return, 48 smb_tree_disconnect:entry, 49 smb_tree_disconnect:return 50 { 51 } 52 53 smb_com_session_setup_andx:return, 54 smb_session*:return, 55 smb_user*:return, 56 smb_tree*:return 57 { 58 printf("rc=%d", arg1); 59 } 60 61 sdt:smbsrv::smb-sessionsetup-clntinfo 62 { 63 clnt = (netr_client_t *)arg0; 64 65 printf("domain=%s\n\n", stringof(clnt->domain)); 66 printf("username=%s\n\n", stringof(clnt->username)); 67 } 68 69 smb_tree_connect:entry 70 { 71 printf("share=%s service=%s", 72 stringof(arg3), stringof(arg4)); 73 } 74 75 smb_com_logoff_andx:return 76 { 77 exit(0); 78 } 79 80 /* 81 * Raise error functions (no return). 82 */ 83 smbsr_raise_error:entry 84 { 85 printf("class=%d code=%d", arg1, arg2); 86 } 87 88 smbsr_raise_cifs_error:entry 89 { 90 printf("status=0x%08x class=%d, code=%d", arg1, arg2, arg3); 91 } 92 93 smbsr_raise_nt_error:entry 94 { 95 printf("error=0x%08x", arg1); 96 } 97 98 smbsr_raise_errno:entry 99 { 100 printf("errno=%d", arg1); 101 } 102 103 /* 104 * MSRPC activity. 105 */ 106 pid$target::mlrpc_s_bind:entry, 107 pid$target::mlrpc_s_bind:return, 108 pid$target::mlrpc_s_request:entry, 109 pid$target::mlrpc_s_request:return 110 { 111 } 112 113 pid$target::smb_trace:entry, 114 pid$target::mlndo_trace:entry 115 { 116 printf("%s", copyinstr(arg0)); 117 } 118 119 /* 120 * LSARPC 121 */ 122 pid$target::lsarpc_s_CloseHandle:entry, 123 pid$target::lsarpc_s_QuerySecurityObject:entry, 124 pid$target::lsarpc_s_EnumAccounts:entry, 125 pid$target::lsarpc_s_EnumTrustedDomain:entry, 126 pid$target::lsarpc_s_OpenAccount:entry, 127 pid$target::lsarpc_s_EnumPrivsAccount:entry, 128 pid$target::lsarpc_s_LookupPrivValue:entry, 129 pid$target::lsarpc_s_LookupPrivName:entry, 130 pid$target::lsarpc_s_LookupPrivDisplayName:entry, 131 pid$target::lsarpc_s_Discovery:entry, 132 pid$target::lsarpc_s_QueryInfoPolicy:entry, 133 pid$target::lsarpc_s_OpenDomainHandle:entry, 134 pid$target::lsarpc_s_OpenDomainHandle:entry, 135 pid$target::lsarpc_s_LookupSids:entry, 136 pid$target::lsarpc_s_LookupNames:entry, 137 pid$target::lsarpc_s_GetConnectedUser:entry, 138 pid$target::lsarpc_s_LookupSids2:entry, 139 pid$target::lsarpc_s_LookupNames2:entry 140 { 141 } 142 143 pid$target::lsarpc_s_CloseHandle:return, 144 pid$target::lsarpc_s_QuerySecurityObject:return, 145 pid$target::lsarpc_s_EnumAccounts:return, 146 pid$target::lsarpc_s_EnumTrustedDomain:return, 147 pid$target::lsarpc_s_OpenAccount:return, 148 pid$target::lsarpc_s_EnumPrivsAccount:return, 149 pid$target::lsarpc_s_LookupPrivValue:return, 150 pid$target::lsarpc_s_LookupPrivName:return, 151 pid$target::lsarpc_s_LookupPrivDisplayName:return, 152 pid$target::lsarpc_s_Discovery:return, 153 pid$target::lsarpc_s_QueryInfoPolicy:return, 154 pid$target::lsarpc_s_OpenDomainHandle:return, 155 pid$target::lsarpc_s_OpenDomainHandle:return, 156 pid$target::lsarpc_s_LookupSids:return, 157 pid$target::lsarpc_s_LookupNames:return, 158 pid$target::lsarpc_s_GetConnectedUser:return, 159 pid$target::lsarpc_s_LookupSids2:return, 160 pid$target::lsarpc_s_LookupNames2:return 161 { 162 } 163 164 /* 165 * NetLogon 166 */ 167 pid$target::netr_s_*:entry, 168 pid$target::netr_s_*:return 169 { 170 } 171 172 /* 173 * SAMR 174 */ 175 pid$target::samr_s_ConnectAnon:entry, 176 pid$target::samr_s_CloseHandle:entry, 177 pid$target::samr_s_LookupDomain:entry, 178 pid$target::samr_s_EnumLocalDomains:entry, 179 pid$target::samr_s_OpenDomain:entry, 180 pid$target::samr_s_QueryDomainInfo:entry, 181 pid$target::samr_s_LookupNames:entry, 182 pid$target::samr_s_OpenUser:entry, 183 pid$target::samr_s_DeleteUser:entry, 184 pid$target::samr_s_QueryUserInfo:entry, 185 pid$target::samr_s_QueryUserGroups:entry, 186 pid$target::samr_s_OpenGroup:entry, 187 pid$target::samr_s_Connect:entry, 188 pid$target::samr_s_GetUserPwInfo:entry, 189 pid$target::samr_s_CreateUser:entry, 190 pid$target::samr_s_ChangeUserPasswd:entry, 191 pid$target::samr_s_GetDomainPwInfo:entry, 192 pid$target::samr_s_SetUserInfo:entry, 193 pid$target::samr_s_Connect3:entry, 194 pid$target::samr_s_Connect4:entry, 195 pid$target::samr_s_QueryDispInfo:entry, 196 pid$target::samr_s_OpenAlias:entry, 197 pid$target::samr_s_CreateDomainAlias:entry, 198 pid$target::samr_s_SetAliasInfo:entry, 199 pid$target::samr_s_QueryAliasInfo:entry, 200 pid$target::samr_s_DeleteDomainAlias:entry, 201 pid$target::samr_s_EnumDomainAliases:entry, 202 pid$target::samr_s_EnumDomainGroups:entry 203 { 204 } 205 206 pid$target::samr_s_ConnectAnon:return, 207 pid$target::samr_s_CloseHandle:return, 208 pid$target::samr_s_LookupDomain:return, 209 pid$target::samr_s_EnumLocalDomains:return, 210 pid$target::samr_s_OpenDomain:return, 211 pid$target::samr_s_QueryDomainInfo:return, 212 pid$target::samr_s_LookupNames:return, 213 pid$target::samr_s_OpenUser:return, 214 pid$target::samr_s_DeleteUser:return, 215 pid$target::samr_s_QueryUserInfo:return, 216 pid$target::samr_s_QueryUserGroups:return, 217 pid$target::samr_s_OpenGroup:return, 218 pid$target::samr_s_Connect:return, 219 pid$target::samr_s_GetUserPwInfo:return, 220 pid$target::samr_s_CreateUser:return, 221 pid$target::samr_s_ChangeUserPasswd:return, 222 pid$target::samr_s_GetDomainPwInfo:return, 223 pid$target::samr_s_SetUserInfo:return, 224 pid$target::samr_s_Connect3:return, 225 pid$target::samr_s_Connect4:return, 226 pid$target::samr_s_QueryDispInfo:return, 227 pid$target::samr_s_OpenAlias:return, 228 pid$target::samr_s_CreateDomainAlias:return, 229 pid$target::samr_s_SetAliasInfo:return, 230 pid$target::samr_s_QueryAliasInfo:return, 231 pid$target::samr_s_DeleteDomainAlias:return, 232 pid$target::samr_s_EnumDomainAliases:return, 233 pid$target::samr_s_EnumDomainGroups:return 234 { 235 } 236 237 /* 238 * SVCCTL 239 */ 240 pid$target::svcctl_s_*:entry, 241 pid$target::svcctl_s_*:return 242 { 243 } 244 245 /* 246 * SRVSVC 247 */ 248 pid$target::srvsvc_s_NetConnectEnum:entry, 249 pid$target::srvsvc_s_NetFileEnum:entry, 250 pid$target::srvsvc_s_NetFileClose:entry, 251 pid$target::srvsvc_s_NetShareGetInfo:entry, 252 pid$target::srvsvc_s_NetShareSetInfo:entry, 253 pid$target::srvsvc_s_NetSessionEnum:entry, 254 pid$target::srvsvc_s_NetSessionDel:entry, 255 pid$target::srvsvc_s_NetServerGetInfo:entry, 256 pid$target::srvsvc_s_NetRemoteTOD:entry, 257 pid$target::srvsvc_s_NetNameValidate:entry, 258 pid$target::srvsvc_s_NetShareAdd:entry, 259 pid$target::srvsvc_s_NetShareDel:entry, 260 pid$target::srvsvc_s_NetShareEnum:entry, 261 pid$target::srvsvc_s_NetShareEnumSticky:entry, 262 pid$target::srvsvc_s_NetGetFileSecurity:entry, 263 pid$target::srvsvc_s_NetSetFileSecurity:entry 264 { 265 } 266 267 pid$target::srvsvc_s_NetConnectEnum:return, 268 pid$target::srvsvc_s_NetFileEnum:return, 269 pid$target::srvsvc_s_NetFileClose:return, 270 pid$target::srvsvc_s_NetShareGetInfo:return, 271 pid$target::srvsvc_s_NetShareSetInfo:return, 272 pid$target::srvsvc_s_NetSessionEnum:return, 273 pid$target::srvsvc_s_NetSessionDel:return, 274 pid$target::srvsvc_s_NetServerGetInfo:return, 275 pid$target::srvsvc_s_NetRemoteTOD:return, 276 pid$target::srvsvc_s_NetNameValidate:return, 277 pid$target::srvsvc_s_NetShareAdd:return, 278 pid$target::srvsvc_s_NetShareDel:return, 279 pid$target::srvsvc_s_NetShareEnum:return, 280 pid$target::srvsvc_s_NetShareEnumSticky:return, 281 pid$target::srvsvc_s_NetGetFileSecurity:return, 282 pid$target::srvsvc_s_NetSetFileSecurity:return 283 { 284 } 285 286 /* 287 * WinReg 288 */ 289 pid$target::winreg_s_*:entry, 290 pid$target::winreg_s_*:return 291 { 292 } 293 294 /* 295 * Workstation 296 */ 297 pid$target::wkssvc_s_*:entry, 298 pid$target::wkssvc_s_*:return 299 { 300 } 301