Skip to content

Commit a1346da

Browse files
authored
acu: Added GetProxyHost (#559)
1 parent 933a3f1 commit a1346da

File tree

2 files changed

+41
-19
lines changed
  • libctru
    • include/3ds/services
    • source/services

2 files changed

+41
-19
lines changed

libctru/include/3ds/services/ac.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,17 @@ Result ACU_GetSSIDLength(u32 *out);
8181
*/
8282
Result ACU_GetProxyEnable(bool *enable);
8383

84+
/**
85+
* @brief Gets the connected network's proxy host.
86+
* @param host Pointer to output the proxy host to. (The size must be at least 0x100-bytes)
87+
*/
88+
Result ACU_GetProxyHost(char *host);
89+
8490
/**
8591
* @brief Gets the connected network's proxy port.
8692
* @param out Pointer to output the proxy port to.
8793
*/
88-
Result ACU_GetProxyPort(u32 *out);
94+
Result ACU_GetProxyPort(u16 *out);
8995

9096
/**
9197
* @brief Gets the connected network's proxy username.

libctru/source/services/ac.c

Lines changed: 34 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -187,22 +187,6 @@ Result ACU_SetRequestEulaVersion(acuConfig* config)
187187
return (Result)cmdbuf[1];
188188
}
189189

190-
Result ACU_GetProxyPassword(char *password)
191-
{
192-
Result ret=0;
193-
u32 *cmdbuf = getThreadCommandBuffer();
194-
u32 *staticbufs = getThreadStaticBuffers();
195-
196-
cmdbuf[0] = IPC_MakeHeader(0x3B,0,0); // 0x3B0000
197-
198-
staticbufs[0] = IPC_Desc_StaticBuffer(0x20, 0);
199-
staticbufs[1] = (u32)password;
200-
201-
if(R_FAILED(ret = svcSendSyncRequest(acHandle)))return ret;
202-
203-
return (Result)cmdbuf[1];
204-
}
205-
206190
Result ACU_GetSecurityMode(acSecurityMode *mode)
207191
{
208192
Result ret=0;
@@ -261,7 +245,23 @@ Result ACU_GetProxyEnable(bool *enable)
261245
return (Result)cmdbuf[1];
262246
}
263247

264-
Result ACU_GetProxyPort(u32 *out)
248+
Result ACU_GetProxyHost(char *host)
249+
{
250+
Result ret=0;
251+
u32 *cmdbuf = getThreadCommandBuffer();
252+
u32 *staticbufs = getThreadStaticBuffers();
253+
254+
cmdbuf[0] = IPC_MakeHeader(0x39,0,0); // 0x390000
255+
256+
staticbufs[0] = IPC_Desc_StaticBuffer(0x100, 0);
257+
staticbufs[1] = (u32)host;
258+
259+
if(R_FAILED(ret = svcSendSyncRequest(acHandle))) return ret;
260+
261+
return (Result)cmdbuf[1];
262+
}
263+
264+
Result ACU_GetProxyPort(u16 *out)
265265
{
266266
Result ret=0;
267267
u32 *cmdbuf = getThreadCommandBuffer();
@@ -270,7 +270,7 @@ Result ACU_GetProxyPort(u32 *out)
270270

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

273-
*out = cmdbuf[2];
273+
*out = (u16)cmdbuf[2];
274274

275275
return (Result)cmdbuf[1];
276276
}
@@ -291,6 +291,22 @@ Result ACU_GetProxyUserName(char *username)
291291
return (Result)cmdbuf[1];
292292
}
293293

294+
Result ACU_GetProxyPassword(char *password)
295+
{
296+
Result ret=0;
297+
u32 *cmdbuf = getThreadCommandBuffer();
298+
u32 *staticbufs = getThreadStaticBuffers();
299+
300+
cmdbuf[0] = IPC_MakeHeader(0x3B,0,0); // 0x3B0000
301+
302+
staticbufs[0] = IPC_Desc_StaticBuffer(0x20, 0);
303+
staticbufs[1] = (u32)password;
304+
305+
if(R_FAILED(ret = svcSendSyncRequest(acHandle)))return ret;
306+
307+
return (Result)cmdbuf[1];
308+
}
309+
294310
Result ACI_LoadNetworkSetting(u32 slot)
295311
{
296312
u32 *cmdbuf = getThreadCommandBuffer();

0 commit comments

Comments
 (0)