Add tap-like fake Ethernet network interface for macOS

TunTap has recently become unmaintained, and it seems Apple wants developers to move away from kexts in general. TunTap currently takes some finagling to work on Catalina, and it may not work at all on Big Sur, necessitating a non-kext-based solution. Fortunately, fake Ethernet devices were introduced in Sierra and can be used similarly to tap adapters. This commit adds a new type of BBA interface implementation which uses fake Ethernet devices via tapserver (https://github.com/fuzziqersoftware/tapserver) to communicate with the host. This implementation was tested with PSO Episodes I & II, which can successfully connect to a private server running locally.

This implementation is only available on macOS, since that's the only place it's needed - Windows/Linux/Unix are unaffected by TunTap being deprecated.
This commit is contained in:
Martin Michelsen
2020-09-27 13:15:14 -07:00
committed by Léo Lam
parent dbf7c40886
commit a9486d087f
7 changed files with 173 additions and 7 deletions

View File

@ -100,12 +100,16 @@ void GameCubePane::CreateWidgets()
// Add SP1 devices
for (const auto& entry :
{std::make_pair(tr("<Nothing>"), ExpansionInterface::EXIDEVICE_NONE),
std::make_pair(tr("Dummy"), ExpansionInterface::EXIDEVICE_DUMMY),
std::make_pair(tr("Broadband Adapter (TAP)"), ExpansionInterface::EXIDEVICE_ETH),
std::make_pair(tr("Broadband Adapter (XLink Kai)"),
ExpansionInterface::EXIDEVICE_ETHXLINK)})
std::vector<std::pair<QString, ExpansionInterface::TEXIDevices>> sp1Entries{
std::make_pair(tr("<Nothing>"), ExpansionInterface::EXIDEVICE_NONE),
std::make_pair(tr("Dummy"), ExpansionInterface::EXIDEVICE_DUMMY),
std::make_pair(tr("Broadband Adapter (TAP)"), ExpansionInterface::EXIDEVICE_ETH),
std::make_pair(tr("Broadband Adapter (XLink Kai)"), ExpansionInterface::EXIDEVICE_ETHXLINK)};
#if defined(__APPLE__)
sp1Entries.emplace_back(std::make_pair(tr("Broadband Adapter (tapserver)"),
ExpansionInterface::EXIDEVICE_ETHTAPSERVER));
#endif
for (const auto& entry : sp1Entries)
{
m_slot_combos[2]->addItem(entry.first, entry.second);
}