16432Sas200622 /* 26432Sas200622 * CDDL HEADER START 36432Sas200622 * 46432Sas200622 * The contents of this file are subject to the terms of the 56432Sas200622 * Common Development and Distribution License (the "License"). 66432Sas200622 * You may not use this file except in compliance with the License. 76432Sas200622 * 86432Sas200622 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 96432Sas200622 * or http://www.opensolaris.org/os/licensing. 106432Sas200622 * See the License for the specific language governing permissions 116432Sas200622 * and limitations under the License. 126432Sas200622 * 136432Sas200622 * When distributing Covered Code, include this CDDL HEADER in each 146432Sas200622 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 156432Sas200622 * If applicable, add the following below this CDDL HEADER, with the 166432Sas200622 * fields enclosed by brackets "[]" replaced with your own identifying 176432Sas200622 * information: Portions Copyright [yyyy] [name of copyright owner] 186432Sas200622 * 196432Sas200622 * CDDL HEADER END 206432Sas200622 */ 216432Sas200622 /* 2212508Samw@Sun.COM * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. 236432Sas200622 */ 246432Sas200622 256432Sas200622 /* 266432Sas200622 * Kstat definitions for the SMB server module. 276432Sas200622 */ 286432Sas200622 #ifndef _SMBSRV_SMB_KSTAT_H 296432Sas200622 #define _SMBSRV_SMB_KSTAT_H 306432Sas200622 3112508Samw@Sun.COM #include <smbsrv/smb.h> 3212508Samw@Sun.COM 336432Sas200622 #ifdef __cplusplus 346432Sas200622 extern "C" { 356432Sas200622 #endif 366432Sas200622 3712508Samw@Sun.COM #define SMBSRV_KSTAT_PROCESS "smbd" 388934SJose.Borrego@Sun.COM #define SMBSRV_KSTAT_MODULE "smbsrv" 398934SJose.Borrego@Sun.COM #define SMBSRV_KSTAT_CLASS "net" 408934SJose.Borrego@Sun.COM #define SMBSRV_KSTAT_NAME "smbsrv" 418934SJose.Borrego@Sun.COM #define SMBSRV_KSTAT_NAME_CMDS "smbsrv_commands" 428934SJose.Borrego@Sun.COM #define SMBSRV_KSTAT_TXRCACHE "smb_txreq" 438934SJose.Borrego@Sun.COM #define SMBSRV_KSTAT_REQUEST_CACHE "smb_request_cache" 448934SJose.Borrego@Sun.COM #define SMBSRV_KSTAT_SESSION_CACHE "smb_session_cache" 458934SJose.Borrego@Sun.COM #define SMBSRV_KSTAT_USER_CACHE "smb_user_cache" 468934SJose.Borrego@Sun.COM #define SMBSRV_KSTAT_TREE_CACHE "smb_tree_cache" 478934SJose.Borrego@Sun.COM #define SMBSRV_KSTAT_OFILE_CACHE "smb_ofile_cache" 488934SJose.Borrego@Sun.COM #define SMBSRV_KSTAT_ODIR_CACHE "smb_odir_cache" 498934SJose.Borrego@Sun.COM #define SMBSRV_KSTAT_NODE_CACHE "smb_node_cache" 508934SJose.Borrego@Sun.COM #define SMBSRV_KSTAT_MBC_CACHE "smb_mbc_cache" 5112508Samw@Sun.COM #define SMBSRV_KSTAT_STATISTICS "smbsrv_statistics" 5212508Samw@Sun.COM #define SMBSRV_KSTAT_UNSUPPORTED "Unsupported" 5312508Samw@Sun.COM #define SMBSRV_KSTAT_WORKERS "smb_workers" 5412508Samw@Sun.COM 5512508Samw@Sun.COM #pragma pack(1) 5612508Samw@Sun.COM 5712508Samw@Sun.COM typedef struct smb_kstat_utilization { 5812508Samw@Sun.COM hrtime_t ku_wtime; 5912508Samw@Sun.COM hrtime_t ku_wlentime; 6012508Samw@Sun.COM hrtime_t ku_rtime; 6112508Samw@Sun.COM hrtime_t ku_rlentime; 6212508Samw@Sun.COM } smb_kstat_utilization_t; 6312508Samw@Sun.COM 6412508Samw@Sun.COM typedef struct smb_kstat_req { 6512508Samw@Sun.COM char kr_name[KSTAT_STRLEN]; 66*12890SJoyce.McIntosh@Sun.COM char kr_pad[(~(KSTAT_STRLEN & 0x07) + 1) & 0x07]; 6712508Samw@Sun.COM uint64_t kr_sum; 6812508Samw@Sun.COM uint64_t kr_txb; 6912508Samw@Sun.COM uint64_t kr_rxb; 7012508Samw@Sun.COM uint64_t kr_nreq; 7112508Samw@Sun.COM uint64_t kr_a_mean; 7212508Samw@Sun.COM uint64_t kr_a_stddev; 7312508Samw@Sun.COM uint64_t kr_d_mean; 7412508Samw@Sun.COM uint64_t kr_d_stddev; 7512508Samw@Sun.COM } smb_kstat_req_t; 7612508Samw@Sun.COM 7712508Samw@Sun.COM typedef struct smbsrv_kstats { 7812508Samw@Sun.COM hrtime_t ks_start_time; 7912508Samw@Sun.COM uint64_t ks_txb; /* Bytes transmitted */ 8012508Samw@Sun.COM uint64_t ks_rxb; /* Bytes received */ 8112508Samw@Sun.COM uint64_t ks_nreq; /* Requests treated */ 8212508Samw@Sun.COM smb_kstat_utilization_t ks_utilization; 8312508Samw@Sun.COM smb_kstat_req_t ks_reqs[SMB_COM_NUM]; 8412508Samw@Sun.COM uint32_t ks_nbt_sess; /* NBT sessions */ 8512508Samw@Sun.COM uint32_t ks_tcp_sess; /* TCP sessions */ 8612508Samw@Sun.COM uint32_t ks_users; /* Users logged in */ 8712508Samw@Sun.COM uint32_t ks_trees; /* Trees connected */ 8812508Samw@Sun.COM uint32_t ks_files; /* Open files */ 8912508Samw@Sun.COM uint32_t ks_pipes; /* Open pipes */ 9012508Samw@Sun.COM uint32_t ks_maxreqs; /* Max number of reqs */ 9112508Samw@Sun.COM uint32_t ks_padding; 9212508Samw@Sun.COM } smbsrv_kstats_t; 9312508Samw@Sun.COM 9412508Samw@Sun.COM #pragma pack() 956432Sas200622 966432Sas200622 #ifdef __cplusplus 976432Sas200622 } 986432Sas200622 #endif 996432Sas200622 1006432Sas200622 #endif /* _SMBSRV_SMB_KSTAT_H */ 101