2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * "Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
7 * Reserved. This file contains Original Code and/or Modifications of
8 * Original Code as defined in and that are subject to the Apple Public
9 * Source License Version 1.0 (the 'License'). You may not use this file
10 * except in compliance with the License. Please obtain a copy of the
11 * License at http://www.apple.com/publicsource and read it before using
14 * The Original Code and all software distributed under the License are
15 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
19 * License for the specific language governing rights and limitations
22 * @APPLE_LICENSE_HEADER_END@
25 #include <CoreFoundation/CoreFoundation.h>
26 #include <IOKit/IOKitLib.h>
27 #include <IOKit/storage/IOBlockStorageDriver.h>
28 #include <IOKit/storage/IOMedia.h>
29 #include <IOKit/IOBSD.h>
31 /* record types in sadc raw data output */
35 #define SAR_TIMESTAMP 2
36 #define SAR_NETSTATS 3
37 #define SAR_DRIVEPATH 4
38 #define SAR_DRIVESTATS 5
50 #define rec_data rec_size
51 #define rec_timestamp rec_size
53 #define MAXDRIVENAME 31 /* largest drive name we allow */
55 #define DPSTATE_UNINITIALIZED 0
57 #define DPSTATE_CHANGED 2
58 #define DPSTATE_ACTIVE 3
62 int drivepath_id
; /* compressed table id */
64 char BSDName
[MAXDRIVENAME
+ 1];
65 io_string_t ioreg_path
; /* unique id, hardware path */
71 io_registry_entry_t driver
;
79 u_int64_t BytesWritten
;
81 u_int64_t LatentReadTime
;
82 u_int64_t LatentWriteTime
;
85 u_int64_t WriteErrors
;
87 u_int64_t ReadRetries
;
88 u_int64_t WriteRetries
;
90 u_int64_t TotalReadTime
;
91 u_int64_t TotalWriteTime
;
96 * netstat mode drives the
97 * collection of ppp interface data
100 #define NET_DEV_MODE 0x1 /* Turn on network interface counters */
101 #define NET_EDEV_MODE 0x2 /* Turn on network interface error counters */
102 #define NET_PPP_MODE 0x4 /* Include ppp interface counters - further
103 * modifies NET_DEV_MODE and NET_EDEV_MODE */
105 #define MAX_TNAME_SIZE 15
106 #define MAX_TNAME_UNIT_SIZE 23
110 char tname_unit
[MAX_TNAME_UNIT_SIZE
+ 1];
111 unsigned long gen_counter
; /* unit generation counter */
113 unsigned long long net_ipackets
;
114 unsigned long long net_ierrors
;
115 unsigned long long net_opackets
;
116 unsigned long long net_oerrors
;
117 unsigned long long net_collisions
;
118 unsigned long long net_ibytes
;
119 unsigned long long net_obytes
;
120 unsigned long long net_imcasts
;
121 unsigned long long net_omcasts
;
122 unsigned long long net_drops
;