wut v1.8.0
Wii U Toolchain
Loading...
Searching...
No Matches
netconfig.h
Go to the documentation of this file.
1#pragma once
2
3#include <wut.h>
4#include <wut_rplwrap.h>
5#include <stdint.h>
6#include <sys/time.h>
7#include <sys/types.h>
8#include <sys/socket.h>
9#include <netinet/in.h>
10#include <arpa/inet.h>
11
17#ifdef __cplusplus
18extern "C" {
19#endif
20
21typedef uint16_t NetConfEthCfgSpeed;
22typedef uint16_t NetConfEthCfgDuplex;
23typedef uint16_t NetConfEthCfgNegotiation;
24typedef uint16_t NetConfWifiPrivacyMode;
25typedef uint16_t NetConfProxyAuthType;
26typedef uint16_t NetConfProxyStatus;
27typedef uint16_t NetConfInterfaceType;
28typedef uint16_t NetConfLinkState;
29typedef uint16_t NetConfOperState;
30typedef uint16_t NetConfAdminState;
31
37typedef struct NetConfOpt NetConfOpt;
40typedef struct NetConfCfg NetConfCfg;
46
51
56
61
66
71
80
85
90
96
101
106
115
117 WUT_UNKNOWN_BYTES(0x18);
118};
119WUT_CHECK_SIZE(NetConfAllProfileState, 0x18);
120
127WUT_CHECK_OFFSET(NetConfEthCfg, 0x00, speed);
128WUT_CHECK_OFFSET(NetConfEthCfg, 0x02, duplex);
129WUT_CHECK_OFFSET(NetConfEthCfg, 0x04, negotiation);
130WUT_CHECK_SIZE(NetConfEthCfg, 0x8);
131
134 uint32_t addr;
135 uint32_t netmask;
136 uint32_t nexthop; // gateway
137 uint32_t ns1; // dns 1
138 uint32_t ns2; // dns 2
139};
140WUT_CHECK_SIZE(NetConfIPv4Info, 0x18);
141
143 uint8_t MACAddr[0x6];
144};
145WUT_CHECK_SIZE(NetConfMACAddr, 0x6);
146
149 uint16_t port;
150 WUT_UNKNOWN_BYTES(0x02);
152 char host[0x80];
153 char username[0x80]; // only 0x20 bytes usable
154 char password[0x40]; // only 0x20 bytes usable
155 char noproxy_hosts[0x80]; // not used
156};
157WUT_CHECK_SIZE(NetConfProxyConfig, 0x1c8);
158
160 WUT_UNKNOWN_BYTES(0x18);
161};
162WUT_CHECK_SIZE(NetConfValidFlags, 0x18);
163
166 WUT_PADDING_BYTES(2);
167 uint16_t aes_key_len;
168 uint8_t aes_key[0x40];
169 WUT_PADDING_BYTES(2);
170};
171WUT_CHECK_OFFSET(NetConfWifiConfigDataPrivacy, 0x00, mode);
172WUT_CHECK_OFFSET(NetConfWifiConfigDataPrivacy, 0x04, aes_key_len);
173WUT_CHECK_OFFSET(NetConfWifiConfigDataPrivacy, 0x06, aes_key);
174WUT_CHECK_SIZE(NetConfWifiConfigDataPrivacy, 0x48);
175
176struct WUT_PACKED NetConfWifiConfigData {
177 char ssid[0x20];
178 uint16_t ssidlength;
179 WUT_PADDING_BYTES(2);
181};
182WUT_CHECK_OFFSET(NetConfWifiConfigData, 0x00, ssid);
183WUT_CHECK_OFFSET(NetConfWifiConfigData, 0x20, ssidlength);
184WUT_CHECK_OFFSET(NetConfWifiConfigData, 0x24, privacy);
185WUT_CHECK_SIZE(NetConfWifiConfigData, 0x6C);
186
189 WUT_PADDING_BYTES(2);
191};
192WUT_CHECK_SIZE(NetConfWifiConfig, 0x70);
193
195 WUT_UNKNOWN_BYTES(0x2c1);
196};
197WUT_CHECK_SIZE(NetConfOpt, 0x2c1);
198
199struct WUT_PACKED NetConfInterface {
200 uint16_t if_index;
201 uint16_t if_state;
202 uint32_t if_mtu;
204};
205WUT_CHECK_OFFSET(NetConfInterface, 0x00, if_index);
206WUT_CHECK_OFFSET(NetConfInterface, 0x02, if_state);
207WUT_CHECK_OFFSET(NetConfInterface, 0x04, if_mtu);
208WUT_CHECK_OFFSET(NetConfInterface, 0x08, ipv4Info);
209WUT_CHECK_SIZE(NetConfInterface, 0x20);
210
218WUT_CHECK_OFFSET(NetConfCfg, 0x0, wl0);
219WUT_CHECK_OFFSET(NetConfCfg, 0x20, wifi);
220WUT_CHECK_OFFSET(NetConfCfg, 0x90, eth0);
221WUT_CHECK_OFFSET(NetConfCfg, 0xB0, ethCfg);
222WUT_CHECK_OFFSET(NetConfCfg, 0xB8, proxy);
223WUT_CHECK_SIZE(NetConfCfg, 0x280);
224
225struct WUT_PACKED NetConfAOSSConfig {
227};
228WUT_CHECK_SIZE(NetConfAOSSConfig, 0x1b0);
229
231 uint16_t if_state;
234 WUT_PADDING_BYTES(2);
235};
236WUT_CHECK_SIZE(NetConfIfState, 0x8);
237
238int
240
241int
243
244int
246
247int
249
254int
256 uint32_t *assignedAddress);
257
262int
264 uint32_t *dns1,
265 uint32_t *dns2);
266
271int
273 uint32_t *gateway);
274
279int
281 uint32_t *subnet);
282
287int
289 uint32_t *dns1,
290 uint32_t *dns2);
291
292int
294
297
301int
303
307int
309
312
313int
315 NetConfMACAddr *info);
316
319
320int
322
323int
325
326int
328
329int
331 uint32_t *profileState);
332
333int
335
336int
338
342int
344
348int
350
351int
353
354int
356
360int
361netconf_getopt(uint16_t unk1,
362 NetConfOpt *buffer,
363 uint32_t *bufferSize);
364
368int
370 NetConfCfg *data);
371
375int
377 NetConfCfg *data);
378
382int
384
388int
390
391int
393 NetConfAOSSConfig *data);
394
395int
397 NetConfAOSSConfig *data);
398
399int
400netconf_read_compat_profile_id(uint32_t *outProfileId);
401
402
403int
405 uint32_t *dns1,
406 uint32_t *dns2);
407
408int
410
411int
414
415int
417
418int
420 NetConfIPv4Info *info);
421
422int
424 uint32_t mtu);
425
426int
428
429int
431
435int
437
438int
440 uint32_t unk2);
441
442int
444
448int
449netconf_setopt(uint16_t unk1,
450 NetConfOpt *buffer,
451 uint32_t *bufferSize);
452
453int
455
456#ifdef __cplusplus
457}
458#endif
459
uint32_t if_mtu
Definition netconfig.h:202
uint32_t netmask
Definition netconfig.h:135
char username[0x80]
Definition netconfig.h:153
NetConfEthCfgNegotiation negotiation
Definition netconfig.h:124
NetConfInterface wl0
Definition netconfig.h:212
NetConfWifiConfigData config
Definition netconfig.h:190
uint16_t config_method
Definition netconfig.h:188
NetConfWifiConfigDataPrivacy privacy
Definition netconfig.h:180
NetConfOperState operstate
Definition netconfig.h:233
NetConfInterface eth0
Definition netconfig.h:214
NetConfWifiPrivacyMode mode
Definition netconfig.h:165
NetConfIPv4Mode mode
Definition netconfig.h:133
NetConfEthCfg ethCfg
Definition netconfig.h:215
NetConfWifiConfig wifi
Definition netconfig.h:213
NetConfProxyConfig proxy
Definition netconfig.h:216
uint8_t MACAddr[0x6]
Definition netconfig.h:143
NetConfProxyAuthType auth_type
Definition netconfig.h:151
char password[0x40]
Definition netconfig.h:154
uint32_t addr
Definition netconfig.h:134
NetConfLinkState linkstate
Definition netconfig.h:232
char noproxy_hosts[0x80]
Definition netconfig.h:155
NetConfEthCfgDuplex duplex
Definition netconfig.h:123
uint32_t nexthop
Definition netconfig.h:136
NetConfIPv4Info ipv4Info
Definition netconfig.h:203
uint16_t if_index
Definition netconfig.h:200
NetConfProxyStatus use_proxy
Definition netconfig.h:148
char host[0x80]
Definition netconfig.h:152
uint16_t if_state
Definition netconfig.h:201
NetConfEthCfgSpeed speed
Definition netconfig.h:122
int netconf_set_interface_mtu(NetConfInterfaceType interface, uint32_t mtu)
int netconf_get_assigned_dns(NetConfInterfaceType interface, uint32_t *dns1, uint32_t *dns2)
Returns the currently used DNS of the console if the given interface matches the used interface.
uint16_t NetConfEthCfgDuplex
Definition netconfig.h:22
int SOGetProxyConfig(NetConfProxyConfig *config)
int netconf_get_running(NetConfCfg *running)
Return the current NetConfCfg.
NetConfAdminState netconf_get_if_adminstate(NetConfInterfaceType interface)
int netconf_read_compat_profile_id(uint32_t *outProfileId)
int netconf_getopt(uint16_t unk1, NetConfOpt *buffer, uint32_t *bufferSize)
Not implemented on IOSU side.
uint16_t NetConfLinkState
Definition netconfig.h:28
int netconf_set_wifi_cfg(NetConfWifiConfig *config)
NetConfProxyAuthTypeEnum
Definition netconfig.h:81
NetConfProfile
Definition netconfig.h:107
uint16_t NetConfAdminState
Definition netconfig.h:30
int netconf_get_assigned_gateway(NetConfInterfaceType unk1, uint32_t *gateway)
Returns the currently used gateway of the console if the given interface matches the used interface.
int netconf_nv_load(NetConfProfile profileId)
Load a profile into memory and use it.
int netconf_nv_read(NetConfProfile profileId, NetConfCfg *data)
Read a profile into memory without using it.
uint16_t NetConfEthCfgSpeed
Definition netconfig.h:21
int netconf_get_last_wifi_link_error(uint32_t *lastError)
int netconf_setopt(uint16_t unk1, NetConfOpt *buffer, uint32_t *bufferSize)
DEBUG mode only.
NetConfAdminStateEnum
Definition netconfig.h:102
NetConfIPv4Mode
Definition netconfig.h:67
int netconf_init()
int netconf_set_eth_cfg(NetConfEthCfg *config)
int netconf_get_ifstate(NetConfInterfaceType interface, NetConfIfState *ifState)
int netconf_nv_write(NetConfProfile profileId, NetConfCfg *data)
Write a profile from buffer.
NetConfEthCfgSpeedEnum
Definition netconfig.h:52
int netconf_read_aoss_config(NetConfProfile profileId, NetConfAOSSConfig *data)
NetConfWifiPrivacyModeEnum
Definition netconfig.h:72
int netconf_set_dns(NetConfInterfaceType interface, uint32_t *dns1, uint32_t *dns2)
NetConfOperStateEnum
Definition netconfig.h:97
uint16_t NetConfEthCfgNegotiation
Definition netconfig.h:23
int netconf_get_valid_flags(NetConfValidFlags *validFlags)
int netconf_set_valid_flag(uint32_t unk1, uint32_t unk2)
int netconf_nv_store(NetConfProfile profileId)
Save the loaded profile from memory into a profile.
int netconf_write_compat_profile_id(uint32_t unk1)
int netconf_get_interface_mtu(NetConfInterfaceType NetConfInterfaceType, uint32_t *mtu)
int netconf_write_aoss_config(NetConfProfile profileId, NetConfAOSSConfig *data)
NetConfLinkStateEnum
Definition netconfig.h:91
int netconf_get_dns(NetConfInterfaceType unk1, uint32_t *dns1, uint32_t *dns2)
Returns the manually set DNS servers of the loaded config if the given interface matches the used int...
int netconf_close()
int netconf_set_if_ipv4_info(NetConfIPv4Info *info)
uint16_t NetConfProxyAuthType
Definition netconfig.h:25
int netconf_set_startup_profile_id(uint32_t profileId)
Sets the default profileId.
NetConfProxyStatusEnum
Definition netconfig.h:86
NetConfLinkState netconf_get_if_linkstate(NetConfInterfaceType interface)
int netconf_delete_profile(NetConfProfile id)
int netconf_set_if_ipv4_info_ex(NetConfInterfaceType interface, NetConfIPv4Info *info)
int netconf_get_assigned_address(NetConfInterfaceType interface, uint32_t *assignedAddress)
Returns the currently used IP address of the console if the given interface matches the used interfac...
uint16_t NetConfProxyStatus
Definition netconfig.h:26
uint16_t NetConfWifiPrivacyMode
Definition netconfig.h:24
int netconf_get_if_macaddr(NetConfInterfaceType interface, NetConfMACAddr *info)
int netconf_get_proxy_config(NetConfProxyConfig *proxyConfig)
int netconf_set_running(NetConfCfg *config)
NetConfEthCfgNegotiationEnum
Definition netconfig.h:62
int netconf_set_if_admin_state(NetConfInterfaceType interface, NetConfAdminStateEnum unk2)
uint16_t NetConfOperState
Definition netconfig.h:29
uint16_t NetConfInterfaceType
Definition netconfig.h:27
NetConfInterfaceTypeEnum
Definition netconfig.h:47
int netconf_get_startup_profile_id()
Gets the default profileId.
int netconf_get_eth_cfg(NetConfEthCfg *outCfg)
int netconf_set_proxy_config(NetConfProxyConfig *config)
int netconf_get_wifi_cfg(NetConfWifiConfig *wifiConfig)
int netconf_get_if_ipv4_info(NetConfIPv4Info *info)
Returns the WIFI IPv4 Info of the loaded config.
int netconf_get_profile_state(NetConfInterfaceType interface, uint32_t *profileState)
int netconf_get_if_ipv4_info_ex(NetConfInterfaceType interface, NetConfIPv4Info *info)
Returns the IPv4 Info of the loaded config for the given interface.
int netconf_get_assigned_subnet(NetConfInterfaceType unk1, uint32_t *subnet)
Returns the currently used subnet of the console if the given interface matches the used interface.
NetConfEthCfgDuplexEnum
Definition netconfig.h:57
int netconf_get_all_profile_state(NetConfAllProfileState *state)
NetConfOperState netconf_get_if_operstate(NetConfInterfaceType interface)
@ NET_CONF_PROXY_AUTH_TYPE_BASIC_AUTHENTICATION
Definition netconfig.h:83
@ NET_CONF_PROXY_AUTH_TYPE_NONE
Definition netconfig.h:82
@ NET_CONF_PROFILE_0
Definition netconfig.h:108
@ NET_CONF_PROFILE_2
Definition netconfig.h:110
@ NET_CONF_PROFILE_1
Definition netconfig.h:109
@ NET_CONF_PROFILE_3
Definition netconfig.h:111
@ NET_CONF_PROFILE_4
Definition netconfig.h:112
@ NET_CONF_PROFILE_5
Definition netconfig.h:113
@ NET_CONF_ADMIN_STATE_DOWN
Definition netconfig.h:104
@ NET_CONF_ADMIN_STATE_UP
Definition netconfig.h:103
@ NET_CONF_IPV4_MODE_MANUAL
Definition netconfig.h:69
@ NET_CONF_IPV4_MODE_DHCP
Definition netconfig.h:68
@ NET_CONF_ETH_CFG_SPEED_10M
Definition netconfig.h:53
@ NET_CONF_ETH_CFG_SPEED_100M
Definition netconfig.h:54
@ NET_CONF_WIFI_PRIVACY_MODE_WPA_PSK_AES
Definition netconfig.h:78
@ NET_CONF_WIFI_PRIVACY_MODE_NONE
Definition netconfig.h:73
@ NET_CONF_WIFI_PRIVACY_MODE_WEP
Definition netconfig.h:74
@ NET_CONF_WIFI_PRIVACY_MODE_WPA_PSK_TKIP
Definition netconfig.h:76
@ NET_CONF_WIFI_PRIVACY_MODE_WPA2_PSK_AES
Definition netconfig.h:77
@ NET_CONF_WIFI_PRIVACY_MODE_WPA2_PSK_TKIP
Definition netconfig.h:75
@ NET_CONF_OPER_STATE_UP
Definition netconfig.h:98
@ NET_CONF_OPER_STATE_DOWN
Definition netconfig.h:99
@ NET_CONF_LINK_STATE_UP
Definition netconfig.h:92
@ NET_CONF_LINK_STATE_DOWN
Definition netconfig.h:93
@ NET_CONF_LINK_STATE_NEGOTIATE
Definition netconfig.h:94
@ NET_CONF_PROXY_ENABLED
Definition netconfig.h:88
@ NET_CONF_PROXY_DISABLED
Definition netconfig.h:87
@ NET_CONF_ETH_CFG_NEGOTIATION_AUTO
Definition netconfig.h:64
@ NET_CONF_ETH_CFG_NEGOTIATION_MANUAL
Definition netconfig.h:63
@ NET_CONF_INTERFACE_TYPE_ETHERNET
Definition netconfig.h:49
@ NET_CONF_INTERFACE_TYPE_WIFI
Definition netconfig.h:48
@ NET_CONF_ETH_CFG_DUPLEX_FULL
Definition netconfig.h:59
@ NET_CONF_ETH_CFG_DUPLEX_HALF
Definition netconfig.h:58