dns.mitm: parse redirections from hosts file

This commit is contained in:
Michael Scire 2021-01-30 19:50:49 -08:00
parent 1314374890
commit 906a450ac3
2 changed files with 13 additions and 4 deletions

View File

@ -22,6 +22,9 @@ namespace ams::emummc {
/* Get whether emummc is active. */ /* Get whether emummc is active. */
bool IsActive(); bool IsActive();
/* Get the active emummc id. */
u32 GetActiveId();
/* Get Nintendo redirection path. */ /* Get Nintendo redirection path. */
const char *GetNintendoDirPath(); const char *GetNintendoDirPath();

View File

@ -57,10 +57,10 @@ namespace ams::emummc {
}; };
/* Globals. */ /* Globals. */
os::Mutex g_lock(false); constinit os::SdkMutex g_lock;
ExosphereConfig g_exo_config; constinit ExosphereConfig g_exo_config;
bool g_is_emummc; constinit bool g_is_emummc;
bool g_has_cached; constinit bool g_has_cached;
/* Helpers. */ /* Helpers. */
void CacheValues() { void CacheValues() {
@ -110,6 +110,12 @@ namespace ams::emummc {
return g_is_emummc; return g_is_emummc;
} }
/* Get the active emummc id. */
u32 GetActiveId() {
CacheValues();
return g_exo_config.base_cfg.id;
}
/* Get Nintendo redirection path. */ /* Get Nintendo redirection path. */
const char *GetNintendoDirPath() { const char *GetNintendoDirPath() {
CacheValues(); CacheValues();