#include <CoreFoundation/CoreFoundation.h>
#include <IOKit/IOKitLib.h>
#include <IOKit/storage/IOBlockStorageDriver.h>
#include <IOKit/storage/IOMedia.h>
#include <IOKit/IOBSD.h>
#define SAR_NOTSET 0
#define SAR_RESTART 1
#define SAR_TIMESTAMP 2
#define SAR_NETSTATS 3
#define SAR_DRIVEPATH 4
#define SAR_DRIVESTATS 5
#define SAR_VMSTAT 6
#define SAR_CPU 7
struct record_hdr
{
int32_t rec_type;
int32_t rec_version;
int32_t rec_count;
int32_t rec_size;
};
#define rec_data rec_size
#define rec_timestamp rec_size
#define MAXDRIVENAME 31
#define DPSTATE_UNINITIALIZED 0
#define DPSTATE_NEW 1
#define DPSTATE_CHANGED 2
#define DPSTATE_ACTIVE 3
struct drivepath
{
int32_t drivepath_id;
int32_t state;
char BSDName[MAXDRIVENAME + 1];
io_string_t ioreg_path;
};
struct drivestats
{
io_registry_entry_t driver;
int32_t drivepath_id;
uint64_t blocksize;
uint64_t Reads;
uint64_t BytesRead;
uint64_t Writes;
uint64_t BytesWritten;
uint64_t LatentReadTime;
uint64_t LatentWriteTime;
uint64_t ReadErrors;
uint64_t WriteErrors;
uint64_t ReadRetries;
uint64_t WriteRetries;
uint64_t TotalReadTime;
uint64_t TotalWriteTime;
};
#define NET_DEV_MODE 0x1
#define NET_EDEV_MODE 0x2
#define NET_PPP_MODE 0x4
#define MAX_TNAME_SIZE 15
#define MAX_TNAME_UNIT_SIZE 23
struct netstats
{
char tname_unit[MAX_TNAME_UNIT_SIZE + 1];
uint32_t gen_counter;
uint64_t net_ipackets;
uint64_t net_ierrors;
uint64_t net_opackets;
uint64_t net_oerrors;
uint64_t net_collisions;
uint64_t net_ibytes;
uint64_t net_obytes;
uint64_t net_imcasts;
uint64_t net_omcasts;
uint64_t net_drops;
};