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 int 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
;
75 u_int64_t BytesWritten
;
77 u_int64_t LatentReadTime
;
78 u_int64_t LatentWriteTime
;
81 u_int64_t WriteErrors
;
83 u_int64_t ReadRetries
;
84 u_int64_t WriteRetries
;
86 u_int64_t TotalReadTime
;
87 u_int64_t TotalWriteTime
;
92 * netstat mode drives the
93 * collection of ppp interface data
96 #define NET_DEV_MODE 0x1 /* Turn on network interface counters */
97 #define NET_EDEV_MODE 0x2 /* Turn on network interface error counters */
98 #define NET_PPP_MODE 0x4 /* Include ppp interface counters - further
99 * modifies NET_DEV_MODE and NET_EDEV_MODE */
101 #define MAX_TNAME_SIZE 15
102 #define MAX_TNAME_UNIT_SIZE 23
106 char tname_unit
[MAX_TNAME_UNIT_SIZE
+ 1];
107 unsigned long gen_counter
; /* unit generation counter */
109 unsigned long long net_ipackets
;
110 unsigned long long net_ierrors
;
111 unsigned long long net_opackets
;
112 unsigned long long net_oerrors
;
113 unsigned long long net_collisions
;
114 unsigned long long net_ibytes
;
115 unsigned long long net_obytes
;
116 unsigned long long net_imcasts
;
117 unsigned long long net_omcasts
;
118 unsigned long long net_drops
;