Uthernet II: add virtual DNS feature (PR #1097)

Uthernet II: add extended feature to virtualise DNS requests.
. This allows pure TCP/UDP sockets to run *without* MACRAW requests (and so without libpcap).
. Raw sockets will not work.
. Add configuration for Virtual DNS.
libpcap: ensure all functions check if the library is loaded before using it.
Uthernet 1: do NOT overwrite tfe_cannot_use as it should only reflect the availability of npcap on *this* system.
Add Copyright notice, and mention Virtual DNS in html.
This commit is contained in:
Andrea
2022-05-08 17:26:01 +02:00
committed by GitHub
parent ccb4582bf9
commit 6a5ea92a4e
32 changed files with 539 additions and 226 deletions
+8 -61
View File
@@ -1,86 +1,33 @@
#pragma once
#include "../Core.h"
#include "../CardManager.h"
#include "../CPU.h"
#include "../DiskImage.h" // Disk_Status_e
#include "../Harddisk.h"
#include "../Interface.h" // VideoRefreshRate_e, GetVideoRefreshRate()
#include "../Tfe/PCapBackend.h"
#include "../Video.h"
class CConfigNeedingRestart
{
public:
// zero initialise
CConfigNeedingRestart()
{
m_Apple2Type = A2TYPE_APPLE2;
m_CpuType = CPU_UNKNOWN;
memset(m_Slot, 0, sizeof(m_Slot));
m_SlotAux = CT_Empty;
m_bEnableTheFreezesF8Rom = 0;
m_uSaveLoadStateMsg = 0;
m_videoRefreshRate = VR_NONE;
}
CConfigNeedingRestart();
// create from current global configuration
static CConfigNeedingRestart Create()
{
CConfigNeedingRestart config;
config.Reload();
return config;
}
static CConfigNeedingRestart Create();
// update from current global configuration
void Reload()
{
m_Apple2Type = GetApple2Type();
m_CpuType = GetMainCpu();
CardManager& cardManager = GetCardMgr();
for (UINT slot = SLOT0; slot < NUM_SLOTS; slot++)
m_Slot[slot] = cardManager.QuerySlot(slot);
m_SlotAux = cardManager.QueryAux();
m_tfeInterface = PCapBackend::tfe_interface;
m_bEnableTheFreezesF8Rom = GetPropertySheet().GetTheFreezesF8Rom();
m_uSaveLoadStateMsg = 0;
m_videoRefreshRate = GetVideo().GetVideoRefreshRate();
}
void Reload();
const CConfigNeedingRestart& operator= (const CConfigNeedingRestart& other)
{
m_Apple2Type = other.m_Apple2Type;
m_CpuType = other.m_CpuType;
memcpy(m_Slot, other.m_Slot, sizeof(m_Slot));
m_SlotAux = other.m_SlotAux;
m_tfeInterface = other.m_tfeInterface;
m_bEnableTheFreezesF8Rom = other.m_bEnableTheFreezesF8Rom;
m_uSaveLoadStateMsg = other.m_uSaveLoadStateMsg;
m_videoRefreshRate = other.m_videoRefreshRate;
return *this;
}
const CConfigNeedingRestart& operator= (const CConfigNeedingRestart& other);
bool operator== (const CConfigNeedingRestart& other) const
{
return m_Apple2Type == other.m_Apple2Type &&
m_CpuType == other.m_CpuType &&
memcmp(m_Slot, other.m_Slot, sizeof(m_Slot)) == 0 &&
m_SlotAux == other.m_SlotAux &&
m_tfeInterface == other.m_tfeInterface &&
m_bEnableTheFreezesF8Rom == other.m_bEnableTheFreezesF8Rom &&
m_uSaveLoadStateMsg == other.m_uSaveLoadStateMsg &&
m_videoRefreshRate == other.m_videoRefreshRate;
}
bool operator== (const CConfigNeedingRestart& other) const;
bool operator!= (const CConfigNeedingRestart& other) const
{
return !operator==(other);
}
bool operator!= (const CConfigNeedingRestart& other) const;
eApple2Type m_Apple2Type;
eCpuType m_CpuType;
SS_CARDTYPE m_Slot[NUM_SLOTS];
SS_CARDTYPE m_SlotAux;
std::string m_tfeInterface;
bool m_tfeVirtualDNS;
UINT m_bEnableTheFreezesF8Rom;
UINT m_uSaveLoadStateMsg;
VideoRefreshRate_e m_videoRefreshRate;