1 /*---------------------------------------------------------------------------* 2 Project: NCD library 3 File: NCDTypes.h 4 5 Copyright 2006 Nintendo. All rights reserved. 6 7 These coded instructions, statements, and computer programs contain 8 proprietary information of Nintendo of America Inc. and/or Nintendo 9 Company Ltd., and are protected by Federal copyright law. They may 10 not be disclosed to third parties or copied or duplicated in any form, 11 in whole or in part, without the prior written consent of Nintendo. 12 *---------------------------------------------------------------------------*/ 13 14 #ifndef REVOLUTION_NCD_NCDTYPES_H_ 15 #define REVOLUTION_NCD_NCDTYPES_H_ 16 #ifdef __cplusplus 17 extern "C" { 18 #endif 19 /*===========================================================================*/ 20 21 #define ATTRIBUTE_PACKED __attribute__((packed)) 22 23 #include <revolution/ncd/NCDConst.h> 24 25 /* Privacy (wireless encryption) structure */ 26 typedef struct NCDPrivacy 27 { 28 u16 mode; /* NCDPrivacyMode */ 29 u8 reserved[ 2 ]; 30 union 31 { 32 struct 33 { 34 u16 keyId; 35 #ifdef RVL_OS 36 union 37 { 38 u16 option; 39 u8 reserved[ 2 ]; 40 }; 41 #else 42 u8 reserved[ 2 ]; 43 #endif 44 u8 key[ 4 ][ 5 ]; 45 46 } wep40; 47 struct 48 { 49 u16 keyId; 50 #ifdef RVL_OS 51 union 52 { 53 u16 option; 54 u8 reserved[ 2 ]; 55 }; 56 #else 57 u8 reserved[ 2 ]; 58 #endif 59 u8 key[ 4 ][ 13 ]; 60 61 } wep104; 62 struct 63 { 64 u16 keyLen; 65 u8 reserved[ 2 ]; 66 u8 key[ 64 ]; 67 68 } tkip; 69 struct 70 { 71 u16 keyLen; 72 u8 reserved[ 2 ]; 73 u8 key[ 64 ]; 74 75 } aes; 76 77 }; 78 79 } ATTRIBUTE_PACKED NCDPrivacy; 80 81 /* AOSS-based connection settings with AP */ 82 typedef struct NCDAossConfig 83 { 84 struct 85 { 86 u8 ssid[ NCD_SIZE_SSID ]; 87 u16 ssidLength; 88 u16 keyId; 89 u8 key[ 4 ][ 5 ]; 90 91 } wep40; 92 struct 93 { 94 u8 ssid[ NCD_SIZE_SSID ]; 95 u16 ssidLength; 96 u16 keyId; 97 u8 key[ 4 ][ 13 ]; 98 99 } wep104; 100 struct 101 { 102 u8 ssid[ NCD_SIZE_SSID ]; 103 u16 ssidLength; 104 u16 keyLen; 105 u8 key[ 64 ]; 106 107 } tkip; 108 struct 109 { 110 u8 ssid[ NCD_SIZE_SSID ]; 111 u16 ssidLength; 112 u16 keyLen; 113 u8 key[ 64 ]; 114 115 } aes; 116 117 } ATTRIBUTE_PACKED NCDAossConfig; 118 119 /* Connection settings with standard AP */ 120 typedef struct NCDApConfig 121 { 122 u8 ssid[ NCD_SIZE_SSID ]; 123 u16 ssidLength; 124 u8 reserved[ 2 ]; 125 NCDPrivacy privacy; 126 127 } ATTRIBUTE_PACKED NCDApConfig; 128 129 /* Connection settings with USB-AP */ 130 typedef struct NCDUsbapConfig 131 { 132 u16 nickname[ NCD_USBAP_NICKNAME_LENGTH ]; 133 u8 reserved[ 2 ]; 134 135 } ATTRIBUTE_PACKED NCDUsbapConfig; 136 137 /* Wired profile structure */ 138 typedef struct NCDWiredProfile 139 { 140 #ifdef NCD_WIRED_LINKTYPE_SUPPORT 141 u8 linkType; /* NCD_WIRED_LINKTYPE_* */ 142 u8 reserved[ 3 ]; 143 #else 144 u8 reserved[ 4 ]; 145 #endif 146 147 } ATTRIBUTE_PACKED NCDWiredProfile; 148 149 /* Wireless profile structure */ 150 typedef struct NCDWirelessProfile 151 { 152 u16 rateset; /* Communications rate bit field (0x0001: 1M, 0x0800: 54M, 0x0000: Automatic) */ 153 u8 configMethod; /* NCD_CONFIG_METHOD_* */ 154 u8 retryLimit; /* Send retry limit (0: Automatic) */ 155 union 156 { 157 NCDApConfig manual; 158 NCDUsbapConfig usbap; 159 NCDAossConfig aoss; 160 NCDApConfig rakuraku; 161 } config; 162 163 } ATTRIBUTE_PACKED NCDWirelessProfile; 164 165 /* Socket library adjustment parameter structure */ 166 typedef struct NCDIpAdjustProfile 167 { 168 s32 maxTransferUnit; /* default (1500) */ 169 s32 tcpRetransTimeout; /* default (100) TCP timeout (unit: seconds) */ 170 s32 dhcpRetransCount; /* default (4) DHCP Retry count */ 171 172 } ATTRIBUTE_PACKED NCDIpAdjustProfile; 173 174 /* Internet protocol settings structure */ 175 typedef struct NCDIpProfile 176 { 177 u8 addr[ NCD_SIZE_IP ]; /* IP address */ 178 u8 netmask[ NCD_SIZE_IP ]; /* Sub-net mask */ 179 u8 gateway[ NCD_SIZE_IP ]; /* IP address of the gateway */ 180 u8 dns1[ NCD_SIZE_IP ]; /* IP address of the primary DNS server */ 181 u8 dns2[ NCD_SIZE_IP ]; /* IP address of the secondary DNS server */ 182 183 } ATTRIBUTE_PACKED NCDIpProfile; 184 185 /* Proxy server settings structure */ 186 typedef struct NCDProxyServerProfile 187 { 188 u8 mode; /* Proxy type NCD_PROXY_MODE_* */ 189 u8 authType; /* Proxy authentication type NCD_PROXY_AUTHTYPE_* */ 190 u8 reserved[ 2 ]; 191 s8 server[ NCD_PROXYNAME_LENGTH ]; /* Proxy server name */ 192 u16 port; /* Proxy port number */ 193 s8 username[ NCD_PROXY_USERNAME_LENGTH ]; /* Proxy authentication user name */ 194 s8 password[ NCD_PROXY_PASSWORD_LENGTH ]; /* Proxy authentication password */ 195 196 } ATTRIBUTE_PACKED NCDProxyServerProfile; 197 198 /* Proxy profile structure */ 199 typedef struct NCDProxyProfile 200 { 201 NCDProxyServerProfile http; /* Set HTTP proxy server */ 202 NCDProxyServerProfile ssl; /* Set SSL (HTTPS) proxy server */ 203 204 /* Below, unused area */ 205 struct 206 { 207 u32 isEnabled; /* Whether this setting value is valid */ 208 s8 servers[ NCD_NO_PROXY_LENGTH ]; /* List of server names, separated by spaces, without proxy connections */ 209 210 } noProxy; 211 212 struct 213 { 214 u32 isEnabled1_1; 215 u32 isAutomaticEnabled; 216 s8 automatic[ NCD_AUTOMATIC_PROXY_LENGTH ]; 217 218 } browser; 219 220 } ATTRIBUTE_PACKED NCDProxyProfile; 221 222 /* PPPoE settings structure */ 223 #ifdef NCD_PPPOE_SUPPORT 224 typedef struct NCDPppoeProfile 225 { 226 u8 servicename[ NCD_PPPOE_SERVICENAME_LENGTH ]; 227 u8 username[ NCD_PPPOE_USERNAME_LENGTH ]; 228 u8 password[ NCD_PPPOE_PASSWORD_LENGTH ]; 229 230 } ATTRIBUTE_PACKED NCDPppoeProfile; 231 #endif 232 233 /* Overall profile structure for network */ 234 typedef struct NCDProfile 235 { 236 u8 flags; /* NCD_FLAG_* result of OR operation */ 237 u8 reserved[ 3 ]; 238 239 NCDIpProfile ip; 240 NCDIpAdjustProfile adjust; 241 NCDProxyProfile proxy; 242 243 #ifdef NCD_PPPOE_SUPPORT 244 NCDPppoeProfile pppoe; 245 #endif 246 247 union 248 { 249 NCDWiredProfile wired; 250 NCDWirelessProfile wireless; 251 252 } netif; 253 254 } ATTRIBUTE_PACKED NCDProfile; 255 256 /* Overall network configuration structure */ 257 typedef struct NCDConfig 258 { 259 u32 version; /* Set NCD_CONFIG_VERSION */ 260 u8 selectedMedia; /* NCD_IF_SELECT_* */ 261 u8 nwc24Permission; /* NCD_NWC24_PERMISSION_* result of OR operation */ 262 u8 linkTimeout; /* Units of seconds */ 263 u8 reserved[ 1 ]; 264 NCDProfile profiles[ NCD_PROFILE_COUNT ]; 265 266 } ATTRIBUTE_PACKED NCDConfig; 267 268 /*---------------------------------------------------------------------------*/ 269 270 #ifdef RVL_OS 271 272 /* Network interface configuration structure */ 273 typedef struct NCDIfConfig 274 { 275 u8 selectedMedia; /* NCD_IF_SELECT_* */ 276 u8 linkTimeout; 277 union 278 { 279 NCDWiredProfile wired; 280 NCDWirelessProfile wireless; 281 282 } netif; 283 284 } NCDIfConfig; 285 286 /* TCP/IP-related configuration structure */ 287 typedef struct NCDIpConfig 288 { 289 BOOL useDhcp; 290 BOOL useProxy; 291 #ifdef NCD_PPPOE_SUPPORT 292 BOOL usePppoe; 293 #endif 294 295 NCDIpProfile ip; 296 NCDIpAdjustProfile adjust; 297 NCDProxyProfile proxy; 298 299 #ifdef NCD_PPPOE_SUPPORT 300 NCDPppoeProfile pppoe; 301 #endif 302 303 } NCDIpConfig; 304 305 #endif 306 307 308 /*===========================================================================*/ 309 #ifdef __cplusplus 310 } /* extern "C" */ 311 #endif 312 #endif /* REVOLUTION_NCD_NCDTYPES_H_ */ 313 314 /*---------------------------------------------------------------------------* 315 $Log: NCDTypes.h,v $ 316 Revision 1.15 2006/10/16 06:05:17 terui 317 Revisions to match the difference in padding from the compiler. 318 319 Revision 1.14 2006/10/12 04:29:55 terui 320 Simplified the definition of the field storing the WEP key input state. 321 322 Revision 1.13 2006/10/12 00:19:34 terui 323 Added definition for the field storing the WEP key input state. 324 325 Revision 1.12 2006/09/02 09:07:41 seiki_masashi 326 Corrected comment 327 328 Revision 1.11 2006/09/02 05:14:18 seiki_masashi 329 Changed the NCDProxyServerProfile structure 330 331 Revision 1.10 2006/08/21 11:16:46 seiki_masashi 332 Added NCDProxyServerProfile structure. 333 334 Revision 1.9 2006/08/16 04:01:08 seiki_masashi 335 Changed the size of the user name and password for proxy authentication from 32 to 33 336 337 Revision 1.8 2006/08/16 03:38:06 seiki_masashi 338 Added a user name and password to the Proxy settings 339 Added version information to NCDConfig 340 341 Revision 1.7 2006/08/15 05:58:46 seiki_masashi 342 Changed Proxy settings 343 344 Revision 1.6 2006/08/15 05:19:06 terui 345 Cleaned up by deleting items that could not be set from the NCDIpAdjustProfile structure 346 347 Revision 1.5 2006/08/14 23:38:24 terui 348 Moved the timeWaitBufSize and reassemblyBufSize members to reserved 349 350 Revision 1.4 2006/08/11 01:47:11 terui 351 Handled wired LAN fixed link type non-support 352 353 Revision 1.3 2006/08/05 11:54:21 terui 354 Support for the specifications added for link UP request timeout 355 s64 members changed to s32 356 357 Revision 1.2 2006/07/29 04:18:44 terui 358 Added members for enabling NWC24. 359 360 Revision 1.1 2006/07/26 07:24:17 terui 361 Moved from posrts/shared 362 363 Revision 1.3 2006/07/24 10:39:50 terui 364 Changed adjustment parameter definitions of the socket library. 365 366 Revision 1.2 2006/07/22 11:57:49 terui 367 Moved constant definitions to NCDConst.h. 368 Removed some internal structures and switched to using typedef. 369 Added item for setting the send retry for wireless communications. 370 Defined new structures forming the API interface. 371 372 Revision 1.1 2006/06/16 07:33:21 terui 373 Moved sc/sctypes.h and changed prefix to NCD. 374 375 *---------------------------------------------------------------------------*/ 376