DSWifi
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Enumerations | Functions
dswifi_common.h File Reference

ARM9 and ARM7 common definitions. More...

#include <assert.h>
#include <nds/ndstypes.h>

Data Structures

struct  WIFI_ACCESSPOINT
 Structure that defines information about an Access Point. More...
 
struct  Wifi_ConnectedClient
 Structure that represents a DS connected to a host DS. More...
 
struct  Wifi_NintendoVendorInfo
 Information send by Nintendo DS hosts in beacon frames. More...
 

Macros

#define DSWIFI_BEACON_NAME_SIZE   20
 Size in bytes reserved in beacon frames for the multiplayer host player name.
 
#define WFLAG_APDATA_ACTIVE   0x8000
 This AP is active.
 
#define WFLAG_APDATA_ADHOC   0x0001
 This AP is an ad hoc AP. Not used.
 
#define WFLAG_APDATA_COMPATIBLE   0x0008
 This AP is compatible with DSWiFI.
 
#define WFLAG_APDATA_EXTCOMPATIBLE   0x0010
 This AP is compatible with DSWiFI, with tricks. Not unused.
 
#define WFLAG_APDATA_NINTENDO_TAG   0x0040
 This AP contains Nintendo AP information, it's likely a multiplayer host.
 
#define WFLAG_APDATA_WEP   0x0002
 This AP uses WEP encryption.
 
#define WFLAG_APDATA_WPA   0x0004
 This AP uses WPA or WPA2 encryption.
 
#define WIFI_MAX_MULTIPLAYER_CLIENTS   15
 Maxmimum number of multiplayer clients that can connect to a host.
 
#define WIFI_TRANSFER_RATE_1MBPS   0x0A
 1 Mbit/s transfer rate define in NDS mode.
 
#define WIFI_TRANSFER_RATE_2MBPS   0x14
 2 Mbit/s transfer rate define in NDS mode.
 

Typedefs

typedef struct WIFI_ACCESSPOINT Wifi_AccessPoint
 Structure that defines information about an Access Point.
 

Enumerations

enum  WEPMODES {
  WEPMODE_NONE = 0 ,
  WEPMODE_64BIT = 1 ,
  WEPMODE_128BIT = 2 ,
  WEPMODE_152BIT = 3 ,
  WEPMODE_64BIT_ASCII = 5 ,
  WEPMODE_128BIT_ASCII = 6 ,
  WEPMODE_152BIT_ASCII = 7 ,
  WEPMODE_40BIT = WEPMODE_64BIT
}
 Supported WEP modes. More...
 
enum  Wifi_ApAuthType {
  AP_AUTH_NONE = 0 ,
  AP_AUTH_8021X = 1 ,
  AP_AUTH_PSK = 2
}
 Authentication type for WPA networks. More...
 
enum  Wifi_ApCryptType {
  AP_CRYPT_NONE = 1 ,
  AP_CRYPT_WEP = 2 ,
  AP_CRYPT_TKIP = 3 ,
  AP_CRYPT_AES = 4
}
 Encryption algorithm. More...
 
enum  Wifi_APScanFlags {
  WSCAN_LIST_AP_COMPATIBLE = 0x1 ,
  WSCAN_LIST_AP_INCOMPATIBLE = 0x2 ,
  WSCAN_LIST_AP_ALL = 0x3 ,
  WSCAN_LIST_NDS_HOSTS = 0x4 ,
  WSCAN_LIST_ALL = 0x7
}
 List of which devices to add to the AP list while scanning for APs. More...
 
enum  Wifi_ApSecurityType {
  AP_SECURITY_OPEN ,
  AP_SECURITY_WEP ,
  AP_SECURITY_WPA ,
  AP_SECURITY_WPA2
}
 Types of encryption used in an Access Point. More...
 
enum  Wifi_ConnectedClientState {
  WIFI_CLIENT_DISCONNECTED = 0 ,
  WIFI_CLIENT_AUTHENTICATED ,
  WIFI_CLIENT_ASSOCIATED
}
 Possible states of a client. More...
 
enum  WIFI_STATS {
  WSTAT_RXQUEUEDPACKETS ,
  WSTAT_TXQUEUEDPACKETS ,
  WSTAT_RXQUEUEDBYTES ,
  WSTAT_TXQUEUEDBYTES ,
  WSTAT_RXQUEUEDLOST ,
  WSTAT_TXQUEUEDREJECTED ,
  WSTAT_RXPACKETS ,
  WSTAT_RXBYTES ,
  WSTAT_RXDATABYTES ,
  WSTAT_TXPACKETS ,
  WSTAT_TXBYTES ,
  WSTAT_TXDATABYTES ,
  WSTAT_ARM7_UPDATES ,
  WSTAT_DEBUG ,
  WSTAT_HW_1B0 ,
  WSTAT_HW_1B1 ,
  WSTAT_HW_1B2 ,
  WSTAT_HW_1B3 ,
  WSTAT_HW_1B4 ,
  WSTAT_HW_1B5 ,
  WSTAT_HW_1B6 ,
  WSTAT_HW_1B7 ,
  WSTAT_HW_1B8 ,
  WSTAT_HW_1B9 ,
  WSTAT_HW_1BA ,
  WSTAT_HW_1BB ,
  WSTAT_HW_1BC ,
  WSTAT_HW_1BD ,
  WSTAT_HW_1BE ,
  WSTAT_HW_1BF ,
  WSTAT_HW_1C0 ,
  WSTAT_HW_1C1 ,
  WSTAT_HW_1C4 ,
  WSTAT_HW_1C5 ,
  WSTAT_HW_1D0 ,
  WSTAT_HW_1D1 ,
  WSTAT_HW_1D2 ,
  WSTAT_HW_1D3 ,
  WSTAT_HW_1D4 ,
  WSTAT_HW_1D5 ,
  WSTAT_HW_1D6 ,
  WSTAT_HW_1D7 ,
  WSTAT_HW_1D8 ,
  WSTAT_HW_1D9 ,
  WSTAT_HW_1DA ,
  WSTAT_HW_1DB ,
  WSTAT_HW_1DC ,
  WSTAT_HW_1DD ,
  WSTAT_HW_1DE ,
  WSTAT_HW_1DF ,
  NUM_WIFI_STATS
}
 List of available WiFi statistics. More...
 

Functions

const char * Wifi_ApAuthTypeString (Wifi_ApAuthType type)
 Returns a short string that describes the authentication type.
 
const char * Wifi_ApCryptString (Wifi_ApCryptType type)
 Returns a short string that describes the crypt type.
 
const char * Wifi_ApSecurityTypeString (Wifi_ApSecurityType type)
 Returns a short string that describes the AP security type.
 

Detailed Description

ARM9 and ARM7 common definitions.

Macro Definition Documentation

◆ WIFI_MAX_MULTIPLAYER_CLIENTS

#define WIFI_MAX_MULTIPLAYER_CLIENTS   15

Maxmimum number of multiplayer clients that can connect to a host.

This is limited by W_AID_LOW, which can only go from 0 to 15 (with 0 being reserved by the host).

Enumeration Type Documentation

◆ WEPMODES

enum WEPMODES

Supported WEP modes.

  • 64 bit (40 bit) WEP mode: 5 ASCII characters (or 10 hex numbers).
  • 128 bit (104 bit) WEP mode: 13 ASCII characters (or 26 hex numbers).
  • 152 bit (128 bit) WEP mode: 16 ASCII characters (or 32 hex numbers).
Warning
152 bit mode is untested/unsupported.
Enumerator
WEPMODE_NONE 

No WEP security is used.

WEPMODE_64BIT 

10 hexadecimal digits.

WEPMODE_128BIT 

26 hexadecimal digits.

WEPMODE_152BIT 

32 hexadecimal digits (Unsupported?)

WEPMODE_64BIT_ASCII 

5 ASCII characters.

WEPMODE_128BIT_ASCII 

13 ASCII characters.

WEPMODE_152BIT_ASCII 

16 ASCII characters (Unsupported?).

WEPMODE_40BIT 

Compatibility define.

◆ Wifi_ApAuthType

Authentication type for WPA networks.

Enumerator
AP_AUTH_NONE 

None. Used for open and WEP networks.

AP_AUTH_8021X 

802.1X

AP_AUTH_PSK 

PSK (Pre-Shared Key/Personal)

◆ Wifi_ApCryptType

Encryption algorithm.

Enumerator
AP_CRYPT_NONE 

None. Used for open networks.

AP_CRYPT_WEP 

Used for WEP networks.

AP_CRYPT_TKIP 

TKIP. Used for WPA, and WPA/WPA2 hotspots.

AP_CRYPT_AES 

AES. Used for WPA2 netowrks.

◆ Wifi_APScanFlags

List of which devices to add to the AP list while scanning for APs.

Enumerator
WSCAN_LIST_AP_COMPATIBLE 

List unprotected and WEP APs to the list (excluding NDS hosts).

WSCAN_LIST_AP_INCOMPATIBLE 

List incompatible APs, such as the ones using WPA encryption.

WSCAN_LIST_AP_ALL 

List all APs that aren't NDS hosts.

WSCAN_LIST_NDS_HOSTS 

List NDS devices acting as multiplayer hosts. They are the ones that include the Nintendo tag in their beacon frames.

WSCAN_LIST_ALL 

Add all APs that are found to the list.

◆ Wifi_ApSecurityType

Types of encryption used in an Access Point.

Enumerator
AP_SECURITY_OPEN 

Open AP (no security).

AP_SECURITY_WEP 

This AP uses WEP encryption.

AP_SECURITY_WPA 

This AP uses WPA encryption. Currently unsupported.

AP_SECURITY_WPA2 

This AP uses WPA2 encryption.

◆ Wifi_ConnectedClientState

Possible states of a client.

Enumerator
WIFI_CLIENT_DISCONNECTED 

This client is disconnected.

WIFI_CLIENT_AUTHENTICATED 

The client is authenticated but not associated.

WIFI_CLIENT_ASSOCIATED 

The client is associated and ready to communicate data.

◆ WIFI_STATS

enum WIFI_STATS

List of available WiFi statistics.

Enumerator
WSTAT_RXQUEUEDPACKETS 

Number of packets queued into the RX FIFO.

WSTAT_TXQUEUEDPACKETS 

Number of packets queued into the TX FIFO.

WSTAT_RXQUEUEDBYTES 

Number of bytes queued into the RX FIFO.

WSTAT_TXQUEUEDBYTES 

Number of bytes queued into the TX FIFO.

WSTAT_RXQUEUEDLOST 

Number of packets lost due to space limitations in queuing.

WSTAT_TXQUEUEDREJECTED 

Number of packets rejected due to space limitations in queuing.

Function Documentation

◆ Wifi_ApAuthTypeString()

const char * Wifi_ApAuthTypeString ( Wifi_ApAuthType  type)

Returns a short string that describes the authentication type.

Parameters
typeAuthentication type.
Returns
A string that describes the authentication type or "Unk" if it's unknown.

◆ Wifi_ApCryptString()

const char * Wifi_ApCryptString ( Wifi_ApCryptType  type)

Returns a short string that describes the crypt type.

Parameters
typeCrypt type.
Returns
A string that describes the crypt type or "Unk" if it's unknown.

◆ Wifi_ApSecurityTypeString()

const char * Wifi_ApSecurityTypeString ( Wifi_ApSecurityType  type)

Returns a short string that describes the AP security type.

Parameters
typeSecurity type.
Returns
A string that describes the security type or "Unk" if it's unknown.