1/*
2 * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights
3 *  Reserved.
4 *
5 *  This file contains Original Code and/or Modifications of Original Code
6 *  as defined in and that are subject to the Apple Public Source License
7 *  Version 2.0 (the 'License'). You may not use this file except in
8 *  compliance with the License. Please obtain a copy of the License at
9 *  http://www.opensource.apple.com/apsl/ and read it before using this
10 *  file.
11 *
12 * The Original Code and all software distributed under the License are
13 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
17 * Please see the License for the specific language governing rights and
18 * limitations under the License.
19*/
20
21#include <CoreFoundation/CoreFoundation.h>
22#include <IOKit/IOKitLib.h>
23#include <IOKit/storage/IOBlockStorageDriver.h>
24#include <IOKit/storage/IOMedia.h>
25#include <IOKit/IOBSD.h>
26
27#define MAXDRIVENAME 31  /* largest drive name we allow */
28
29
30struct drivestats_report
31{
32	char		*next;
33	int32_t		present;
34	int32_t		avg_count;
35	int32_t		drivepath_id;
36	char		name[MAXDRIVENAME+1];
37	uint64_t	blocksize;
38
39	uint64_t	cur_Reads;
40	uint64_t	prev_Reads;
41	uint64_t	avg_Reads;
42
43	uint64_t	cur_BytesRead;
44	uint64_t	prev_BytesRead;
45	uint64_t	avg_BytesRead;
46
47	uint64_t	cur_Writes;
48	uint64_t	prev_Writes;
49	uint64_t	avg_Writes;
50
51	uint64_t	cur_BytesWritten;
52	uint64_t	prev_BytesWritten;
53	uint64_t	avg_BytesWritten;
54
55	uint64_t	cur_LatentReadTime;
56	uint64_t	prev_LatentReadTime;
57	uint64_t	avg_LatentReadTime;
58
59	uint64_t	cur_LatentWriteTime;
60	uint64_t	prev_LatentWriteTime;
61	uint64_t	avg_LatentWriteTime;
62
63	uint64_t	cur_ReadErrors;
64	uint64_t	prev_ReadErrors;
65	uint64_t	avg_ReadErrors;
66
67	uint64_t	cur_WriteErrors;
68	uint64_t	prev_WriteErrors;
69	uint64_t	avg_WriteErrors;
70
71	uint64_t	cur_ReadRetries;
72	uint64_t	prev_ReadRetries;
73	uint64_t	avg_ReadRetries;
74
75	uint64_t	cur_WriteRetries;
76	uint64_t	prev_WriteRetries;
77	uint64_t	avg_WriteRetries;
78
79	uint64_t	cur_TotalReadTime;
80	uint64_t	prev_TotalReadTime;
81	uint64_t	avg_TotalReadTime;
82
83	uint64_t	cur_TotalWriteTime;
84	uint64_t	prev_TotalWriteTime;
85	uint64_t	avg_TotalWriteTime;
86};
87
88struct netstats_report
89{
90	int32_t		valid;
91	int32_t		present;
92	int32_t		avg_count;
93	uint32_t	gen_counter;
94	char		tname_unit[MAX_TNAME_UNIT_SIZE +1 ];
95
96	uint64_t	cur_ipackets;
97	uint64_t	prev_ipackets;
98	uint64_t	avg_ipackets;
99
100	uint64_t	cur_ierrors;
101	uint64_t	prev_ierrors;
102	uint64_t	avg_ierrors;
103
104	uint64_t	cur_opackets;
105	uint64_t	prev_opackets;
106	uint64_t	avg_opackets;
107
108	uint64_t	cur_oerrors;
109	uint64_t	prev_oerrors;
110	uint64_t	avg_oerrors;
111
112	uint64_t	cur_collisions;
113	uint64_t	prev_collisions;
114	uint64_t	avg_collisions;
115
116	uint64_t	cur_ibytes;
117	uint64_t	prev_ibytes;
118	uint64_t	avg_ibytes;
119
120	uint64_t	cur_obytes;
121	uint64_t	prev_obytes;
122	uint64_t	avg_obytes;
123
124	uint64_t	cur_imcasts;
125	uint64_t	prev_imcasts;
126	uint64_t	avg_imcasts;
127
128	uint64_t	cur_omcasts;
129	uint64_t	prev_omcasts;
130	uint64_t	avg_omcasts;
131
132	uint64_t	cur_drops;
133	uint64_t	prev_drops;
134	uint64_t	avg_drops;
135};
136