libnx
v4.8.0
|
lp2p service IPC wrapper, for local-WLAN communications with accessories. More...
Go to the source code of this file.
Data Structures | |
struct | Lp2pMacAddress |
MacAddress. More... | |
struct | Lp2pGroupId |
GroupId. More... | |
struct | Lp2pGroupInfo |
GroupInfo lp2pScan only uses the following fields for the cmd input struct: supported_platform/priority, frequency/channel, and preshared_key_binary_size/preshared_key. More... | |
struct | Lp2pScanResult |
ScanResult. More... | |
struct | Lp2pNodeInfo |
NodeInfo. More... | |
struct | Lp2pIpConfig |
IpConfig. Only contains IPv4 addresses. More... | |
Enumerations | |
enum | Lp2pServiceType { Lp2pServiceType_App = 0 , Lp2pServiceType_System = 1 } |
Functions | |
Result | lp2pInitialize (Lp2pServiceType service_type) |
Initialize lp2p. | |
void | lp2pExit (void) |
Exit lp2p. | |
Service * | lp2pGetServiceSession_INetworkService (void) |
Gets the Service object for INetworkService. | |
Service * | lp2pGetServiceSession_INetworkServiceMonitor (void) |
Gets the Service object for INetworkServiceMonitor. | |
void | lp2pCreateGroupInfo (Lp2pGroupInfo *info) |
Creates a default Lp2pGroupInfo for use with lp2pCreateGroup / lp2pJoin. More... | |
void | lp2pCreateGroupInfoScan (Lp2pGroupInfo *info) |
Creates a default Lp2pGroupInfo for use with lp2pScan. More... | |
void | lp2pGroupInfoSetServiceName (Lp2pGroupInfo *info, const char *name) |
Sets Lp2pGroupInfo::service_name. More... | |
void | lp2pGroupInfoSetFlags (Lp2pGroupInfo *info, s8 *flags, size_t count) |
Sets Lp2pGroupInfo::flags_count and Lp2pGroupInfo::flags. More... | |
static void | lp2pGroupInfoSetMemberCountMax (Lp2pGroupInfo *info, size_t count) |
Sets Lp2pGroupInfo::member_count_max. More... | |
static void | lp2pGroupInfoSetFrequencyChannel (Lp2pGroupInfo *info, u16 frequency, s16 channel) |
Sets Lp2pGroupInfo::frequency and Lp2pGroupInfo::channel. More... | |
static void | lp2pGroupInfoSetStealthEnabled (Lp2pGroupInfo *info, bool flag) |
Sets Lp2pGroupInfo::stealth_enabled. More... | |
void | lp2pGroupInfoSetPresharedKey (Lp2pGroupInfo *info, const void *key, size_t size) |
Sets the PresharedKey for the specified Lp2pGroupInfo. More... | |
Result | lp2pGroupInfoSetPassphrase (Lp2pGroupInfo *info, const char *passphrase) |
Sets the passphrase, for when standard WPA2-PSK is being used. More... | |
INetworkService | |
Result | lp2pScan (const Lp2pGroupInfo *info, Lp2pScanResult *results, s32 count, s32 *total_out) |
Scan. More... | |
Result | lp2pCreateGroup (const Lp2pGroupInfo *info) |
CreateGroup. More... | |
Result | lp2pDestroyGroup (void) |
This destroys the previously created group from lp2pCreateGroup. More... | |
Result | lp2pSetAdvertiseData (const void *buffer, size_t size) |
SetAdvertiseData. More... | |
Result | lp2pSendToOtherGroup (const void *buffer, size_t size, Lp2pMacAddress addr, Lp2pGroupId group_id, s16 frequency, s16 channel, u32 flags) |
This sends an Action frame to the specified Lp2pGroupId, with the specified destination Lp2pMacAddress. More... | |
Result | lp2pRecvFromOtherGroup (void *buffer, size_t size, u32 flags, Lp2pMacAddress *addr, u16 *unk0, s32 *unk1, u64 *out_size, s32 *unk2) |
This receives an Action frame. More... | |
Result | lp2pAddAcceptableGroupId (Lp2pGroupId group_id) |
AddAcceptableGroupId. More... | |
Result | lp2pRemoveAcceptableGroupId (void) |
RemoveAcceptableGroupId. | |
INetworkServiceMonitor | |
Result | lp2pAttachNetworkInterfaceStateChangeEvent (Event *out_event) |
AttachNetworkInterfaceStateChangeEvent. More... | |
Result | lp2pGetNetworkInterfaceLastError (void) |
GetNetworkInterfaceLastError. | |
Result | lp2pGetRole (u8 *out) |
GetRole. More... | |
Result | lp2pGetAdvertiseData (void *buffer, size_t size, u16 *transfer_size, u16 *original_size) |
GetAdvertiseData. More... | |
Result | lp2pGetAdvertiseData2 (void *buffer, size_t size, u16 *transfer_size, u16 *original_size) |
GetAdvertiseData2. More... | |
Result | lp2pGetGroupInfo (Lp2pGroupInfo *out) |
GetGroupInfo. More... | |
Result | lp2pJoin (Lp2pGroupInfo *out, const Lp2pGroupInfo *info) |
This runs the same code as lp2pCreateGroup to generate the Lp2pGroupInfo for the input struct. More... | |
Result | lp2pGetGroupOwner (Lp2pNodeInfo *out) |
GetGroupOwner. More... | |
Result | lp2pGetIpConfig (Lp2pIpConfig *out) |
GetIpConfig. More... | |
Result | lp2pLeave (u32 *out) |
Leave. More... | |
Result | lp2pAttachJoinEvent (Event *out_event) |
AttachJoinEvent. More... | |
Result | lp2pGetMembers (Lp2pNodeInfo *members, s32 count, s32 *total_out) |
GetMembers. More... | |
lp2p service IPC wrapper, for local-WLAN communications with accessories.
See also: https://switchbrew.org/wiki/LDN_services
enum Lp2pServiceType |
Result lp2pAddAcceptableGroupId | ( | Lp2pGroupId | group_id | ) |
AddAcceptableGroupId.
[in] | group_id | Lp2pGroupId |
Result lp2pCreateGroup | ( | const Lp2pGroupInfo * | info | ) |
CreateGroup.
[in] | info | Lp2pGroupInfo |
void lp2pCreateGroupInfo | ( | Lp2pGroupInfo * | info | ) |
Creates a default Lp2pGroupInfo for use with lp2pCreateGroup / lp2pJoin.
info | Lp2pGroupInfo |
void lp2pCreateGroupInfoScan | ( | Lp2pGroupInfo * | info | ) |
Creates a default Lp2pGroupInfo for use with lp2pScan.
info | Lp2pGroupInfo |
Result lp2pDestroyGroup | ( | void | ) |
This destroys the previously created group from lp2pCreateGroup.
Result lp2pGetAdvertiseData | ( | void * | buffer, |
size_t | size, | ||
u16 * | transfer_size, | ||
u16 * | original_size | ||
) |
GetAdvertiseData.
[out] | buffer | Output buffer data. |
[in] | size | Output buffer size. |
[out] | transfer_size | Size of the data copied into the buffer. |
[out] | original_size | Original size from state. |
Result lp2pGetAdvertiseData2 | ( | void * | buffer, |
size_t | size, | ||
u16 * | transfer_size, | ||
u16 * | original_size | ||
) |
GetAdvertiseData2.
[out] | buffer | Output buffer data. |
[in] | size | Output buffer size. |
[out] | transfer_size | Size of the data copied into the buffer. |
[out] | original_size | Original size from state. |
Result lp2pGetGroupInfo | ( | Lp2pGroupInfo * | out | ) |
Result lp2pGetGroupOwner | ( | Lp2pNodeInfo * | out | ) |
Result lp2pGetIpConfig | ( | Lp2pIpConfig * | out | ) |
Result lp2pGetMembers | ( | Lp2pNodeInfo * | members, |
s32 | count, | ||
s32 * | total_out | ||
) |
GetMembers.
[out] | members | Output array of Lp2pNodeInfo. |
[in] | count | Size of the members array in entries. A maximum of 8 entries can be returned. |
[out] | total_out | Total output entries. |
void lp2pGroupInfoSetFlags | ( | Lp2pGroupInfo * | info, |
s8 * | flags, | ||
size_t | count | ||
) |
Sets Lp2pGroupInfo::flags_count and Lp2pGroupInfo::flags.
info | Lp2pGroupInfo | |
[in] | flags | Lp2pGroupInfo::flags |
[in] | count | Lp2pGroupInfo::flags_count |
|
inlinestatic |
Sets Lp2pGroupInfo::frequency and Lp2pGroupInfo::channel.
info | Lp2pGroupInfo | |
[in] | frequency | Lp2pGroupInfo::frequency |
[in] | channel | Lp2pGroupInfo::channel |
|
inlinestatic |
Sets Lp2pGroupInfo::member_count_max.
info | Lp2pGroupInfo | |
[in] | count | MemberCountMax |
Result lp2pGroupInfoSetPassphrase | ( | Lp2pGroupInfo * | info, |
const char * | passphrase | ||
) |
Sets the passphrase, for when standard WPA2-PSK is being used.
info | Lp2pGroupInfo | |
[in] | passphrase | Passphrase string, the required length is 0x8-0x3F. |
void lp2pGroupInfoSetPresharedKey | ( | Lp2pGroupInfo * | info, |
const void * | key, | ||
size_t | size | ||
) |
Sets the PresharedKey for the specified Lp2pGroupInfo.
info | Lp2pGroupInfo | |
[in] | key | Data for the PresharedKey. |
[in] | size | Size to copy into the PresharedKey, max is 0x20. |
void lp2pGroupInfoSetServiceName | ( | Lp2pGroupInfo * | info, |
const char * | name | ||
) |
Sets Lp2pGroupInfo::service_name.
info | Lp2pGroupInfo | |
[in] | name | ServiceName / SSID. |
|
inlinestatic |
Sets Lp2pGroupInfo::stealth_enabled.
info | Lp2pGroupInfo | |
[in] | flag | Lp2pGroupInfo::stealth_enabled |
Result lp2pJoin | ( | Lp2pGroupInfo * | out, |
const Lp2pGroupInfo * | info | ||
) |
This runs the same code as lp2pCreateGroup to generate the Lp2pGroupInfo for the input struct.
[out] | out | Lp2pGroupInfo |
[in] | info | Lp2pGroupInfo |
Result lp2pRecvFromOtherGroup | ( | void * | buffer, |
size_t | size, | ||
u32 | flags, | ||
Lp2pMacAddress * | addr, | ||
u16 * | unk0, | ||
s32 * | unk1, | ||
u64 * | out_size, | ||
s32 * | unk2 | ||
) |
This receives an Action frame.
[out] | buffer | Output buffer containing arbitrary user data. |
[in] | size | Output buffer size. |
[in] | flags | Only bit0 is used: clear = block until data is available, set = return error when data is not available. |
[in] | addr | Lp2pMacAddress |
[in] | unk0 | Unknown |
[in] | unk1 | Unknown |
[out] | out_size | This is the original size used for copying to the output buffer, before it's clamped to the output-buffer size. |
[out] | unk2 | Unknown |
Result lp2pScan | ( | const Lp2pGroupInfo * | info, |
Lp2pScanResult * | results, | ||
s32 | count, | ||
s32 * | total_out | ||
) |
Scan.
[in] | info | Lp2pGroupInfo |
[out] | results | Output array of Lp2pScanResult. |
[in] | count | Size of the results array in entries. |
[out] | total_out | Total output entries. |
Result lp2pSendToOtherGroup | ( | const void * | buffer, |
size_t | size, | ||
Lp2pMacAddress | addr, | ||
Lp2pGroupId | group_id, | ||
s16 | frequency, | ||
s16 | channel, | ||
u32 | flags | ||
) |
This sends an Action frame to the specified Lp2pGroupId, with the specified destination Lp2pMacAddress.
[in] | buffer | Input buffer containing arbitrary user data. |
[in] | size | Input buffer size, must be <=0x400. |
[in] | addr | Lp2pMacAddress, this can be a broadcast address. This must be non-zero. |
[in] | group_id | Lp2pGroupId |
[in] | frequency | Must be >=1. See Lp2pGroupInfo::frequency. |
[in] | channel | Must be >=1. See Lp2pGroupInfo::channel. |
[in] | flags | Only bit0 is used: clear = block until the data can be sent, set = return error when the data can't be sent. |
Result lp2pSetAdvertiseData | ( | const void * | buffer, |
size_t | size | ||
) |
SetAdvertiseData.
[out] | buffer | Input buffer containing arbitrary user data. |
[in] | size | Input buffer size, must be <=0x80. |