docs: fix type for nsupdate command parameter
[Samba.git] / source3 / include / smb_perfcount.h
blob9c83147d04204e081e5e3454890c98c5be4fade7
1 /*
2 Unix SMB/CIFS implementation.
3 Portable SMB Messaging statistics interfaces
4 Copyright (C) Todd Stecher (2008)
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef _SMB_PERFCOUNT_H_
21 #define _SMB_PERFCOUNT_H_
23 #define SMB_PERFCOUNTER_INTERFACE_VERSION 1
25 struct smb_perfcount_data{
26 struct smb_perfcount_handlers *handlers;
27 void *context;
30 struct smb_perfcount_handlers {
31 void (*perfcount_start) (struct smb_perfcount_data *pcd);
32 void (*perfcount_add) (struct smb_perfcount_data *pcd);
33 void (*perfcount_set_op) (struct smb_perfcount_data *pcd, int op);
34 void (*perfcount_set_subop) (struct smb_perfcount_data *pcd, int subop);
35 void (*perfcount_set_ioctl) (struct smb_perfcount_data *pcd, int io_ctl);
36 void (*perfcount_set_msglen_in) (struct smb_perfcount_data *pcd,
37 uint64_t in_bytes);
38 void (*perfcount_set_msglen_out) (struct smb_perfcount_data *pcd,
39 uint64_t out_bytes);
40 void (*perfcount_copy_context) (struct smb_perfcount_data *pcd,
41 struct smb_perfcount_data *new_pcd);
42 void (*perfcount_defer_op) (struct smb_perfcount_data *pcd,
43 struct smb_perfcount_data *def_pcd);
44 void (*perfcount_end) (struct smb_perfcount_data *pcd);
47 bool smb_perfcount_init(void);
49 NTSTATUS smb_register_perfcounter(int interface_version, const char *name,
50 const struct smb_perfcount_handlers *handlers);
52 void smb_init_perfcount_data(struct smb_perfcount_data *pcd);
54 #define SMB_PERFCOUNT_START(_pcd_) \
55 do {if((_pcd_) && (_pcd_)->handlers) \
56 (_pcd_)->handlers->perfcount_start((_pcd_)); \
57 } while (0)
59 #define SMB_PERFCOUNT_ADD(_pcd_) \
60 do {if((_pcd_) && (_pcd_)->handlers) \
61 (_pcd_)->handlers->perfcount_add((_pcd_)); \
62 } while (0)
64 #define SMB_PERFCOUNT_SET_OP(_pcd_,_op_) \
65 do {if((_pcd_) && (_pcd_)->handlers) \
66 (_pcd_)->handlers->perfcount_set_op((_pcd_), (_op_)); \
67 } while (0)
69 #define SMB_PERFCOUNT_SET_SUBOP(_pcd_,_subop_) \
70 do {if((_pcd_) && (_pcd_)->handlers) \
71 (_pcd_)->handlers->perfcount_set_subop((_pcd_), (_subop_)); \
72 } while (0)
74 #define SMB_PERFCOUNT_SET_IOCTL(_pcd_,_subop_) \
75 do {if((_pcd_) && (_pcd_)->handlers) \
76 (_pcd_)->handlers->perfcount_set_ioctl((_pcd_), (_subop_)); \
77 } while (0)
79 #define SMB_PERFCOUNT_SET_MSGLEN_IN(_pcd_,_in_) \
80 do {if((_pcd_) && (_pcd_)->handlers) \
81 (_pcd_)->handlers->perfcount_set_msglen_in((_pcd_), (_in_));\
82 } while (0)
84 #define SMB_PERFCOUNT_SET_MSGLEN_OUT(_pcd_,_out_) \
85 do {if((_pcd_) && (_pcd_)->handlers) \
86 (_pcd_)->handlers->perfcount_set_msglen_out((_pcd_), (_out_));\
87 } while (0)
89 #define SMB_PERFCOUNT_COPY_CONTEXT(_pcd_, _new_pcd_) \
90 do {if((_pcd_) && (_pcd_)->handlers) \
91 (_pcd_)->handlers->perfcount_copy_context((_pcd_), (_new_pcd_)); \
92 } while (0)
94 #define SMB_PERFCOUNT_DEFER_OP(_pcd_, _def_pcd_) \
95 do {if((_pcd_) && (_pcd_)->handlers) \
96 (_pcd_)->handlers->perfcount_defer_op((_pcd_), (_def_pcd_)); \
97 } while (0)
99 #define SMB_PERFCOUNT_END(_pcd_) \
100 do {if((_pcd_) && (_pcd_)->handlers) \
101 (_pcd_)->handlers->perfcount_end((_pcd_));\
102 } while (0)
104 #endif /* _SMB_PERFCOUNT_H_ */