VirtualBox

source: vbox/trunk/src/VBox/Main/src-server/darwin/iokit.h@ 96407

Last change on this file since 96407 was 96407, checked in by vboxsync, 2 years ago

scm copyright and license note update

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
File size: 3.5 KB
Line 
1/* $Id: iokit.h 96407 2022-08-22 17:43:14Z vboxsync $ */
2/** @file
3 * Main - Darwin IOKit Routines.
4 */
5
6/*
7 * Copyright (C) 2006-2022 Oracle and/or its affiliates.
8 *
9 * This file is part of VirtualBox base platform packages, as
10 * available from https://www.virtualbox.org.
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation, in version 3 of the
15 * License.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, see <https://www.gnu.org/licenses>.
24 *
25 * SPDX-License-Identifier: GPL-3.0-only
26 */
27
28#ifndef MAIN_INCLUDED_SRC_src_server_darwin_iokit_h
29#define MAIN_INCLUDED_SRC_src_server_darwin_iokit_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34#include <iprt/cdefs.h>
35#include <iprt/types.h>
36#include <iprt/cpp/ministring.h>
37#ifdef VBOX_WITH_USB
38# include <VBox/usb.h>
39#endif
40
41/**
42 * Darwin DVD descriptor as returned by DarwinGetDVDDrives().
43 */
44typedef struct DARWINDVD
45{
46 /** Pointer to the next DVD. */
47 struct DARWINDVD *pNext;
48 /** Variable length name / identifier. */
49 char szName[1];
50} DARWINDVD;
51/** Pointer to a Darwin DVD descriptor. */
52typedef DARWINDVD *PDARWINDVD;
53
54/** Darwin fixed drive (SSD, HDD, ++) descriptor as returned by
55 * DarwinGetFixedDrives(). */
56typedef struct DARWINFIXEDDRIVE
57{
58 /** Pointer to the next DVD. */
59 struct DARWINFIXEDDRIVE *pNext;
60 /** Pointer to the model name, NULL if none.
61 * This points after szName and needs not be freed separately. */
62 const char *pszModel;
63 /** Variable length name / identifier. */
64 char szName[1];
65} DARWINFIXEDDRIVE;
66/** Pointer to a Darwin fixed drive. */
67typedef DARWINFIXEDDRIVE *PDARWINFIXEDDRIVE;
68
69
70/**
71 * Darwin ethernet controller descriptor as returned by DarwinGetEthernetControllers().
72 */
73typedef struct DARWINETHERNIC
74{
75 /** Pointer to the next NIC. */
76 struct DARWINETHERNIC *pNext;
77 /** The BSD name. (like en0)*/
78 char szBSDName[16];
79 /** The fake unique identifier. */
80 RTUUID Uuid;
81 /** The MAC address. */
82 RTMAC Mac;
83 /** Whether it's wireless (true) or wired (false). */
84 bool fWireless;
85 /** Whether it is an AirPort device. */
86 bool fAirPort;
87 /** Whether it's built in or not. */
88 bool fBuiltin;
89 /** Whether it's a USB device or not. */
90 bool fUSB;
91 /** Whether it's the primary interface. */
92 bool fPrimaryIf;
93 /** A variable length descriptive name if possible. */
94 char szName[1];
95} DARWINETHERNIC;
96/** Pointer to a Darwin ethernet controller descriptor. */
97typedef DARWINETHERNIC *PDARWINETHERNIC;
98
99
100/** The run loop mode string used by iokit.cpp when it registers
101 * notifications events. */
102#define VBOX_IOKIT_MODE_STRING "VBoxIOKitMode"
103
104RT_C_DECLS_BEGIN
105#ifdef VBOX_WITH_USB
106void * DarwinSubscribeUSBNotifications(void);
107void DarwinUnsubscribeUSBNotifications(void *pvOpaque);
108PUSBDEVICE DarwinGetUSBDevices(void);
109void DarwinFreeUSBDeviceFromIOKit(PUSBDEVICE pCur);
110int DarwinReEnumerateUSBDevice(PCUSBDEVICE pCur);
111#endif /* VBOX_WITH_USB */
112PDARWINDVD DarwinGetDVDDrives(void);
113PDARWINFIXEDDRIVE DarwinGetFixedDrives(void);
114PDARWINETHERNIC DarwinGetEthernetControllers(void);
115RT_C_DECLS_END
116
117#endif /* !MAIN_INCLUDED_SRC_src_server_darwin_iokit_h */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette