18 lines
650 B
C++
18 lines
650 B
C++
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
#pragma once
|
|
|
|
#include "DriveWireShell.h"
|
|
#include "../../../src/devices/DriveWireTransport.h"
|
|
#include <strings.h>
|
|
|
|
namespace VCC::Mac {
|
|
inline std::unique_ptr<Devices::DriveWireTransport> openDriveWireEndpoint(
|
|
DriveWireShell& shell, const std::string& host, uint16_t port) {
|
|
// This name exists only inside the emulator. Never send it to DNS or
|
|
// redirect normal localhost connections to a privileged command prompt.
|
|
if (strcasecmp(host.c_str(), "macshell") == 0)
|
|
return port == 2323 ? shell.connect() : nullptr;
|
|
return Devices::makeDriveWireTCPConnection(host, port);
|
|
}
|
|
}
|