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.
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.
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]
22 * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
23 * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
27 * Kstat definitions for the SMB server module.
29 #ifndef _SMBSRV_SMB_KSTAT_H
30 #define _SMBSRV_SMB_KSTAT_H
32 #include <sys/kstat.h>
38 #define SMBSRV_KSTAT_PROCESS "smbd"
39 #define SMBSRV_KSTAT_MODULE "smbsrv"
40 #define SMBSRV_KSTAT_CLASS "net"
41 #define SMBSRV_KSTAT_NAME "smbsrv"
42 #define SMBSRV_KSTAT_NAME_CMDS "smbsrv_commands"
43 #define SMBSRV_KSTAT_TXRCACHE "smb_txreq"
44 #define SMBSRV_KSTAT_REQUEST_CACHE "smb_request_cache"
45 #define SMBSRV_KSTAT_SESSION_CACHE "smb_session_cache"
46 #define SMBSRV_KSTAT_USER_CACHE "smb_user_cache"
47 #define SMBSRV_KSTAT_TREE_CACHE "smb_tree_cache"
48 #define SMBSRV_KSTAT_OFILE_CACHE "smb_ofile_cache"
49 #define SMBSRV_KSTAT_ODIR_CACHE "smb_odir_cache"
50 #define SMBSRV_KSTAT_NODE_CACHE "smb_node_cache"
51 #define SMBSRV_KSTAT_MBC_CACHE "smb_mbc_cache"
52 #define SMBSRV_KSTAT_STATISTICS "smbsrv_statistics"
53 #define SMBSRV_KSTAT_UNSUPPORTED "Unsupported"
54 #define SMBSRV_KSTAT_WORKERS "smb_workers"
57 * We don't want to pull in smb.h or smb2.h here, so we're using
58 * local defines corresponding to SMB_COM_NUM, SMB2__NCMDS for
59 * the ks_reqs1 and ks_reqs2 arrays, respectively. These are
60 * sanity-checked when smb_server.c is compiled.
62 #define SMBSRV_KS_NREQS1 256 /* See: SMB_COM_NUM */
63 #define SMBSRV_KS_NREQS2 20 /* See: SMB2__NCMDS */
67 typedef struct smb_kstat_utilization
{
72 } smb_kstat_utilization_t
;
74 typedef struct smb_kstat_req
{
75 char kr_name
[KSTAT_STRLEN
];
76 char kr_pad
[(~(KSTAT_STRLEN
& 0x07) + 1) & 0x07];
87 typedef struct smbsrv_kstats
{
88 hrtime_t ks_start_time
;
89 uint64_t ks_txb
; /* Bytes transmitted */
90 uint64_t ks_rxb
; /* Bytes received */
91 uint64_t ks_nreq
; /* Requests treated */
92 smb_kstat_utilization_t ks_utilization
;
93 smb_kstat_req_t ks_reqs1
[SMBSRV_KS_NREQS1
];
94 smb_kstat_req_t ks_reqs2
[SMBSRV_KS_NREQS2
];
95 uint32_t ks_nbt_sess
; /* NBT sessions */
96 uint32_t ks_tcp_sess
; /* TCP sessions */
97 uint32_t ks_users
; /* Users logged in */
98 uint32_t ks_trees
; /* Trees connected */
99 uint32_t ks_files
; /* Open files */
100 uint32_t ks_pipes
; /* Open pipes */
101 uint32_t ks_maxreqs
; /* Max number of reqs */
111 #endif /* _SMBSRV_SMB_KSTAT_H */