1 | /* $Id: iokit.h 93115 2022-01-01 11:31:46Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * Main - Darwin IOKit Routines.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2022 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 | #ifndef MAIN_INCLUDED_SRC_src_server_darwin_iokit_h
|
---|
19 | #define MAIN_INCLUDED_SRC_src_server_darwin_iokit_h
|
---|
20 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
21 | # pragma once
|
---|
22 | #endif
|
---|
23 |
|
---|
24 | #include <iprt/cdefs.h>
|
---|
25 | #include <iprt/types.h>
|
---|
26 | #include <iprt/cpp/ministring.h>
|
---|
27 | #ifdef VBOX_WITH_USB
|
---|
28 | # include <VBox/usb.h>
|
---|
29 | #endif
|
---|
30 |
|
---|
31 | /**
|
---|
32 | * Darwin DVD descriptor as returned by DarwinGetDVDDrives().
|
---|
33 | */
|
---|
34 | typedef struct DARWINDVD
|
---|
35 | {
|
---|
36 | /** Pointer to the next DVD. */
|
---|
37 | struct DARWINDVD *pNext;
|
---|
38 | /** Variable length name / identifier. */
|
---|
39 | char szName[1];
|
---|
40 | } DARWINDVD;
|
---|
41 | /** Pointer to a Darwin DVD descriptor. */
|
---|
42 | typedef DARWINDVD *PDARWINDVD;
|
---|
43 |
|
---|
44 | /** Darwin fixed drive (SSD, HDD, ++) descriptor as returned by
|
---|
45 | * DarwinGetFixedDrives(). */
|
---|
46 | typedef struct DARWINFIXEDDRIVE
|
---|
47 | {
|
---|
48 | /** Pointer to the next DVD. */
|
---|
49 | struct DARWINFIXEDDRIVE *pNext;
|
---|
50 | /** Pointer to the model name, NULL if none.
|
---|
51 | * This points after szName and needs not be freed separately. */
|
---|
52 | const char *pszModel;
|
---|
53 | /** Variable length name / identifier. */
|
---|
54 | char szName[1];
|
---|
55 | } DARWINFIXEDDRIVE;
|
---|
56 | /** Pointer to a Darwin fixed drive. */
|
---|
57 | typedef DARWINFIXEDDRIVE *PDARWINFIXEDDRIVE;
|
---|
58 |
|
---|
59 |
|
---|
60 | /**
|
---|
61 | * Darwin ethernet controller descriptor as returned by DarwinGetEthernetControllers().
|
---|
62 | */
|
---|
63 | typedef struct DARWINETHERNIC
|
---|
64 | {
|
---|
65 | /** Pointer to the next NIC. */
|
---|
66 | struct DARWINETHERNIC *pNext;
|
---|
67 | /** The BSD name. (like en0)*/
|
---|
68 | char szBSDName[16];
|
---|
69 | /** The fake unique identifier. */
|
---|
70 | RTUUID Uuid;
|
---|
71 | /** The MAC address. */
|
---|
72 | RTMAC Mac;
|
---|
73 | /** Whether it's wireless (true) or wired (false). */
|
---|
74 | bool fWireless;
|
---|
75 | /** Whether it is an AirPort device. */
|
---|
76 | bool fAirPort;
|
---|
77 | /** Whether it's built in or not. */
|
---|
78 | bool fBuiltin;
|
---|
79 | /** Whether it's a USB device or not. */
|
---|
80 | bool fUSB;
|
---|
81 | /** Whether it's the primary interface. */
|
---|
82 | bool fPrimaryIf;
|
---|
83 | /** A variable length descriptive name if possible. */
|
---|
84 | char szName[1];
|
---|
85 | } DARWINETHERNIC;
|
---|
86 | /** Pointer to a Darwin ethernet controller descriptor. */
|
---|
87 | typedef DARWINETHERNIC *PDARWINETHERNIC;
|
---|
88 |
|
---|
89 |
|
---|
90 | /** The run loop mode string used by iokit.cpp when it registers
|
---|
91 | * notifications events. */
|
---|
92 | #define VBOX_IOKIT_MODE_STRING "VBoxIOKitMode"
|
---|
93 |
|
---|
94 | RT_C_DECLS_BEGIN
|
---|
95 | #ifdef VBOX_WITH_USB
|
---|
96 | void * DarwinSubscribeUSBNotifications(void);
|
---|
97 | void DarwinUnsubscribeUSBNotifications(void *pvOpaque);
|
---|
98 | PUSBDEVICE DarwinGetUSBDevices(void);
|
---|
99 | void DarwinFreeUSBDeviceFromIOKit(PUSBDEVICE pCur);
|
---|
100 | int DarwinReEnumerateUSBDevice(PCUSBDEVICE pCur);
|
---|
101 | #endif /* VBOX_WITH_USB */
|
---|
102 | PDARWINDVD DarwinGetDVDDrives(void);
|
---|
103 | PDARWINFIXEDDRIVE DarwinGetFixedDrives(void);
|
---|
104 | PDARWINETHERNIC DarwinGetEthernetControllers(void);
|
---|
105 | RT_C_DECLS_END
|
---|
106 |
|
---|
107 | #endif /* !MAIN_INCLUDED_SRC_src_server_darwin_iokit_h */
|
---|