2 * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights
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
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.
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>
27 /* record types in sadc raw data output */
31 #define SAR_TIMESTAMP 2
32 #define SAR_NETSTATS 3
33 #define SAR_DRIVEPATH 4
34 #define SAR_DRIVESTATS 5
46 #define rec_data rec_size
47 #define rec_timestamp rec_size
49 #define MAXDRIVENAME 31 /* largest drive name we allow */
51 #define DPSTATE_UNINITIALIZED 0
53 #define DPSTATE_CHANGED 2
54 #define DPSTATE_ACTIVE 3
58 int32_t drivepath_id
; /* compressed table id */
60 char BSDName
[MAXDRIVENAME
+ 1];
61 io_string_t ioreg_path
; /* unique id, hardware path */
67 io_registry_entry_t driver
;
76 uint64_t BytesWritten
;
78 uint64_t LatentReadTime
;
79 uint64_t LatentWriteTime
;
85 uint64_t WriteRetries
;
87 uint64_t TotalReadTime
;
88 uint64_t TotalWriteTime
;
93 * netstat mode drives the
94 * collection of ppp interface data
97 #define NET_DEV_MODE 0x1 /* Turn on network interface counters */
98 #define NET_EDEV_MODE 0x2 /* Turn on network interface error counters */
99 #define NET_PPP_MODE 0x4 /* Include ppp interface counters - further
100 * modifies NET_DEV_MODE and NET_EDEV_MODE */
102 #define MAX_TNAME_SIZE 15
103 #define MAX_TNAME_UNIT_SIZE 23
107 char tname_unit
[MAX_TNAME_UNIT_SIZE
+ 1];
108 uint32_t gen_counter
; /* unit generation counter */
110 uint64_t net_ipackets
;
111 uint64_t net_ierrors
;
112 uint64_t net_opackets
;
113 uint64_t net_oerrors
;
114 uint64_t net_collisions
;
117 uint64_t net_imcasts
;
118 uint64_t net_omcasts
;