1
>
/*---------------------------------------------------------------------------------------------
id.ts
2
>
* Copyright (c) Microsoft Corporation. All rights reserved.
3
>
* Licensed under the MIT License. See License.txt in the project root for license information.
4
>
*--------------------------------------------------------------------------------------------*/
5
>
6
>
import { networkInterfaces } from 'os';
7
>
import { TernarySearchTree } from '../common/ternarySearchTree.js';
8
>
import * as uuid from '../common/uuid.js';
9
>
import { getMac } from './macAddress.js';
10
>
import { isWindows } from '../common/platform.js';
11
>
import { stripUTF8BOM } from '../common/strings.js';
12
>
13
>
// http://www.techrepublic.com/blog/data-center/mac-address-scorecard-for-common-virtual-machine-platforms/
14
>
// VMware ESX 3, Server, Workstation, Player 00-50-56, 00-0C-29, 00-05-69
15
>
// Microsoft Hyper-V, Virtual Server, Virtual PC 00-03-FF
16
>
// Parallels Desktop, Workstation, Server, Virtuozzo 00-1C-42
17
>
// Virtual Iron 4 00-0F-4B
18
>
// Red Hat Xen 00-16-3E
19
>
// Oracle VM 00-16-3E
20
>
// XenSource 00-16-3E
21
>
// Novell Xen 00-16-3E
22
>
// Sun xVM VirtualBox 08-00-27
23
>
export const virtualMachineHint: { value(): number } = new class {
24
>
25
>
private _virtualMachineOUIs?: TernarySearchTree<string, boolean>;
26
>
private _value?: number;
27
>
28
>
private _isVirtualMachineMacAddress(mac: string): boolean {
29
if (!this._virtualMachineOUIs) {
30
this._virtualMachineOUIs = TernarySearchTree.forStrings<boolean>();