Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion libctru/include/3ds/services/ac.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,17 @@ Result ACU_GetSSIDLength(u32 *out);
*/
Result ACU_GetProxyEnable(bool *enable);

/**
* @brief Gets the connected network's proxy host.
* @param host Pointer to output the proxy host to. (The size must be at least 0x100-bytes)
*/
Result ACU_GetProxyHost(char *host);

/**
* @brief Gets the connected network's proxy port.
* @param out Pointer to output the proxy port to.
*/
Result ACU_GetProxyPort(u32 *out);
Result ACU_GetProxyPort(u16 *out);

/**
* @brief Gets the connected network's proxy username.
Expand Down
52 changes: 34 additions & 18 deletions libctru/source/services/ac.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,22 +187,6 @@ Result ACU_SetRequestEulaVersion(acuConfig* config)
return (Result)cmdbuf[1];
}

Result ACU_GetProxyPassword(char *password)
{
Result ret=0;
u32 *cmdbuf = getThreadCommandBuffer();
u32 *staticbufs = getThreadStaticBuffers();

cmdbuf[0] = IPC_MakeHeader(0x3B,0,0); // 0x3B0000

staticbufs[0] = IPC_Desc_StaticBuffer(0x20, 0);
staticbufs[1] = (u32)password;

if(R_FAILED(ret = svcSendSyncRequest(acHandle)))return ret;

return (Result)cmdbuf[1];
}

Result ACU_GetSecurityMode(acSecurityMode *mode)
{
Result ret=0;
Expand Down Expand Up @@ -261,7 +245,23 @@ Result ACU_GetProxyEnable(bool *enable)
return (Result)cmdbuf[1];
}

Result ACU_GetProxyPort(u32 *out)
Result ACU_GetProxyHost(char *host)
{
Result ret=0;
u32 *cmdbuf = getThreadCommandBuffer();
u32 *staticbufs = getThreadStaticBuffers();

cmdbuf[0] = IPC_MakeHeader(0x39,0,0); // 0x390000

staticbufs[0] = IPC_Desc_StaticBuffer(0x100, 0);
staticbufs[1] = (u32)host;

if(R_FAILED(ret = svcSendSyncRequest(acHandle))) return ret;

return (Result)cmdbuf[1];
}

Result ACU_GetProxyPort(u16 *out)
{
Result ret=0;
u32 *cmdbuf = getThreadCommandBuffer();
Expand All @@ -270,7 +270,7 @@ Result ACU_GetProxyPort(u32 *out)

if(R_FAILED(ret = svcSendSyncRequest(acHandle)))return ret;

*out = cmdbuf[2];
*out = (u16)cmdbuf[2];

return (Result)cmdbuf[1];
}
Expand All @@ -291,6 +291,22 @@ Result ACU_GetProxyUserName(char *username)
return (Result)cmdbuf[1];
}

Result ACU_GetProxyPassword(char *password)
{
Result ret=0;
u32 *cmdbuf = getThreadCommandBuffer();
u32 *staticbufs = getThreadStaticBuffers();

cmdbuf[0] = IPC_MakeHeader(0x3B,0,0); // 0x3B0000

staticbufs[0] = IPC_Desc_StaticBuffer(0x20, 0);
staticbufs[1] = (u32)password;

if(R_FAILED(ret = svcSendSyncRequest(acHandle)))return ret;

return (Result)cmdbuf[1];
}

Result ACI_LoadNetworkSetting(u32 slot)
{
u32 *cmdbuf = getThreadCommandBuffer();
Expand Down