|
libnx v4.10.0
|
LDN (local network communications) IPC wrapper. More...
Go to the source code of this file.
Data Structures | |
| struct | LdnIpv4Address |
| Ipv4Address. This is essentially the same as struct in_addr - hence this can be used with standard sockets (byteswap required). More... | |
| struct | LdnSubnetMask |
| SubnetMask. This is essentially the same as struct in_addr - hence this can be used with standard sockets (byteswap required). More... | |
| struct | LdnMacAddress |
| MacAddress. More... | |
| struct | LdnSsid |
| Ssid. More... | |
| struct | LdnNodeLatestUpdate |
| NodeLatestUpdate. More... | |
| struct | LdnAddressEntry |
| AddressEntry. More... | |
| struct | LdnNodeInfo |
| NodeInfo. More... | |
| struct | LdnUserConfig |
| UserConfig. The input struct is copied to a tmp struct, which is then used with the cmd. More... | |
| struct | LdnIntentId |
| IntentId. More... | |
| struct | LdnSessionId |
| SessionId. More... | |
| struct | LdnNetworkId |
| NetworkId. More... | |
| struct | LdnCommonNetworkInfo |
| CommonNetworkInfo. More... | |
| struct | LdnNetworkInfo |
| NetworkInfo. More... | |
| struct | LdnScanFilter |
| ScanFilter. ldnScan / ldnScanPrivate will only return the LdnNetworkInfo when validating the LdnNetworkInfo with LdnScanFilter was sucessful, with the fields enabled by LdnScanFilterFlag. More... | |
| struct | LdnSecurityConfig |
| SecurityConfig. More... | |
| struct | LdnSecurityParameter |
| SecurityParameter. The struct used by ldnCreateNetwork internally is randomly-generated. More... | |
| struct | LdnNetworkConfig |
| NetworkConfig. The input struct is copied to a tmp struct, which is then used with the cmd (ldnCreateNetwork, ldnCreateNetworkPrivate, ldnConnectPrivate). More... | |
| struct | LdnActionFrameSettings |
| ActionFrameSettings. More... | |
Macros | |
| #define | LDN_PRIORITY_SYSTEM 0x38 |
| System priority for __nx_ldn_priority. | |
| #define | LDN_PRIORITY_USER 0x5A |
| User priority for __nx_ldn_priority. | |
Functions | |
ldn:m | |
| Result | ldnmInitialize (void) |
| Initialize ldn:m. | |
| void | ldnmExit (void) |
| Exit ldn:m. | |
| Service * | ldnmGetServiceSession_MonitorService (void) |
| Gets the Service object for IMonitorService. | |
| Result | ldnmGetState (LdnState *out) |
| GetState. | |
| Result | ldnmGetNetworkInfo (LdnNetworkInfo *out) |
| GetNetworkInfo. | |
| Result | ldnmGetIpv4Address (LdnIpv4Address *addr, LdnSubnetMask *mask) |
| GetIpv4Address. | |
| Result | ldnmGetSecurityParameter (LdnSecurityParameter *out) |
| GetSecurityParameter. | |
| Result | ldnmGetNetworkConfig (LdnNetworkConfig *out) |
| GetNetworkConfig. | |
ldn | |
| Result | ldnInitialize (LdnServiceType service_type) |
| Initialize ldn. | |
| void | ldnExit (void) |
| Exit ldn. | |
| Service * | ldnGetServiceSession_LocalCommunicationService (void) |
| Gets the Service object for IUserLocalCommunicationService/ISystemLocalCommunicationService. | |
| Service * | ldnGetServiceSession_IClientProcessMonitor (void) |
| Gets the Service object for IClientProcessMonitor, only valid with [18.0.0+]. | |
| Result | ldnGetState (LdnState *out) |
| GetState. | |
| Result | ldnGetNetworkInfo (LdnNetworkInfo *out) |
| GetNetworkInfo. | |
| Result | ldnGetIpv4Address (LdnIpv4Address *addr, LdnSubnetMask *mask) |
| GetIpv4Address. | |
| Result | ldnGetDisconnectReason (LdnDisconnectReason *out) |
| GetDisconnectReason. | |
| Result | ldnGetSecurityParameter (LdnSecurityParameter *out) |
| GetSecurityParameter. | |
| Result | ldnGetNetworkConfig (LdnNetworkConfig *out) |
| GetNetworkConfig. | |
| Result | ldnGetStateChangeEvent (Event *out_event) |
| GetStateChangeEvent. | |
| Result | ldnGetNetworkInfoAndHistory (LdnNetworkInfo *network_info, LdnNodeLatestUpdate *nodes, s32 count) |
| GetNetworkInfoAndHistory. | |
| Result | ldnScan (s32 channel, const LdnScanFilter *filter, LdnNetworkInfo *network_info, s32 count, s32 *total_out) |
| Scan. | |
| Result | ldnScanPrivate (s32 channel, const LdnScanFilter *filter, LdnNetworkInfo *network_info, s32 count, s32 *total_out) |
| ScanPrivate. | |
| Result | ldnSetWirelessControllerRestriction (LdnWirelessControllerRestriction restriction) |
| SetWirelessControllerRestriction. | |
| Result | ldnSetProtocol (LdnProtocol protocol) |
| SetProtocol. | |
| Result | ldnOpenAccessPoint (void) |
| OpenAccessPoint. | |
| Result | ldnCloseAccessPoint (void) |
| CloseAccessPoint. | |
| Result | ldnCreateNetwork (const LdnSecurityConfig *sec_config, const LdnUserConfig *user_config, const LdnNetworkConfig *network_config) |
| CreateNetwork. | |
| Result | ldnCreateNetworkPrivate (const LdnSecurityConfig *sec_config, const LdnSecurityParameter *sec_param, const LdnUserConfig *user_config, const LdnNetworkConfig *network_config, const LdnAddressEntry *addrs, s32 count) |
| CreateNetworkPrivate. | |
| Result | ldnDestroyNetwork (void) |
| DestroyNetwork. | |
| Result | ldnReject (LdnIpv4Address addr) |
| Reject. | |
| Result | ldnSetAdvertiseData (const void *buffer, size_t size) |
| SetAdvertiseData. | |
| Result | ldnSetStationAcceptPolicy (LdnAcceptPolicy policy) |
| SetStationAcceptPolicy. | |
| Result | ldnAddAcceptFilterEntry (LdnMacAddress addr) |
| AddAcceptFilterEntry. | |
| Result | ldnClearAcceptFilter (void) |
| ClearAcceptFilter. | |
| Result | ldnOpenStation (void) |
| OpenStation. | |
| Result | ldnCloseStation (void) |
| CloseStation. | |
| Result | ldnConnect (const LdnSecurityConfig *sec_config, const LdnUserConfig *user_config, s32 version, u32 option, const LdnNetworkInfo *network_info) |
| Connect. | |
| Result | ldnConnectPrivate (const LdnSecurityConfig *sec_config, const LdnSecurityParameter *sec_param, const LdnUserConfig *user_config, s32 version, u32 option, const LdnNetworkConfig *network_config) |
| ConnectPrivate. | |
| Result | ldnDisconnect (void) |
| Disconnect. | |
| Result | ldnSetOperationMode (LdnOperationMode mode) |
| SetOperationMode. | |
| Result | ldnEnableActionFrame (const LdnActionFrameSettings *settings) |
| EnableActionFrame. | |
| Result | ldnDisableActionFrame (void) |
| DisableActionFrame. | |
| Result | ldnSendActionFrame (const void *data, size_t size, LdnMacAddress destination, LdnMacAddress bssid, s16 channel, u32 flags) |
| SendActionFrame. | |
| Result | ldnRecvActionFrame (void *data, size_t size, LdnMacAddress *addr0, LdnMacAddress *addr1, s16 *channel, u32 *out_size, s32 *link_level, u32 flags) |
| RecvActionFrame. | |
| Result | ldnSetHomeChannel (s16 channel) |
| SetHomeChannel. | |
| Result | ldnSetTxPower (s16 power) |
| SetTxPower. | |
| Result | ldnResetTxPower (void) |
| ResetTxPower. | |
LDN (local network communications) IPC wrapper.
See also: https://switchbrew.org/wiki/LDN_services
| enum LdnAcceptPolicy |
AcceptPolicy.
| Enumerator | |
|---|---|
| LdnAcceptPolicy_AlwaysAccept | AlwaysAccept. |
| LdnAcceptPolicy_AlwaysReject | AlwaysReject. |
| LdnAcceptPolicy_BlackList | BlackList, addresses in the list (ldnAddAcceptFilterEntry) are not allowed. |
| LdnAcceptPolicy_WhiteList | WhiteList, only addresses in the list (ldnAddAcceptFilterEntry) are allowed. |
| enum LdnDisconnectReason |
DisconnectReason loaded by ldnGetDisconnectReason.
| enum LdnOperationMode |
| enum LdnProtocol |
| enum LdnScanFilterFlag |
ScanFilterFlag.
| Enumerator | |
|---|---|
| LdnScanFilterFlag_LocalCommunicationId | Enables using LdnScanFilter::network_id LdnIntentId::local_communication_id. |
| LdnScanFilterFlag_SessionId | Enables using LdnScanFilter::network_id session_id. |
| LdnScanFilterFlag_NetworkType | Enables using LdnScanFilter::network_type. |
| LdnScanFilterFlag_Bssid | Enables using LdnScanFilter::bssid. Only available with ldnScanPrivate. |
| LdnScanFilterFlag_Ssid | Enables using LdnScanFilter::ssid. |
| LdnScanFilterFlag_SceneId | Enables using LdnScanFilter::network_id LdnIntentId::scene_id. |
| LdnScanFilterFlag_IntentId | Enables using LdnScanFilter::network_id intent_id. |
| LdnScanFilterFlag_NetworkId | Enables using LdnScanFilter::network_id. |
| enum LdnSecurityMode |
| enum LdnServiceType |
| enum LdnState |
State loaded by ldnmGetStateForMonitor / ldnGetState.
| Enumerator | |
|---|---|
| LdnState_None | None. |
| LdnState_Initialized | Initialized. |
| LdnState_AccessPoint | AccessPoint (ldnOpenAccessPoint) |
| LdnState_AccessPointCreated | AccessPointCreated (ldnCreateNetwork / ldnCreateNetworkPrivate) |
| LdnState_Station | Station (ldnOpenStation) |
| LdnState_StationConnected | StationConnected (ldnConnect / ldnConnectPrivate) |
| LdnState_Error | Error. |
| Result ldnAddAcceptFilterEntry | ( | LdnMacAddress | addr | ) |
AddAcceptFilterEntry.
| [in] | addr | LdnMacAddress. If you want, you can also pass LdnNodeInfo::mac_addr for this. |
| Result ldnClearAcceptFilter | ( | void | ) |
ClearAcceptFilter.
| Result ldnCloseAccessPoint | ( | void | ) |
CloseAccessPoint.
| Result ldnCloseStation | ( | void | ) |
CloseStation.
| Result ldnConnect | ( | const LdnSecurityConfig * | sec_config, |
| const LdnUserConfig * | user_config, | ||
| s32 | version, | ||
| u32 | option, | ||
| const LdnNetworkInfo * | network_info | ||
| ) |
Connect.
| [in] | sec_config | LdnSecurityConfig |
| [in] | user_config | LdnUserConfig |
| [in] | version | LocalCommunicationVersion, this must be 0x0-0x7FFF. |
| [in] | option | ConnectOption bitmask, must be <=0x1. You can use value 0 for example here. |
| [in] | network_info | LdnNetworkInfo |
| Result ldnConnectPrivate | ( | const LdnSecurityConfig * | sec_config, |
| const LdnSecurityParameter * | sec_param, | ||
| const LdnUserConfig * | user_config, | ||
| s32 | version, | ||
| u32 | option, | ||
| const LdnNetworkConfig * | network_config | ||
| ) |
ConnectPrivate.
| [in] | sec_config | LdnSecurityConfig |
| [in] | sec_param | LdnSecurityParameter |
| [in] | user_config | LdnUserConfig |
| [in] | version | LocalCommunicationVersion, this must be 0x0-0x7FFF. |
| [in] | option | ConnectOption bitmask, must be <=0x1. You can use value 0 for example here. |
| [in] | network_config | LdnNetworkConfig |
| Result ldnCreateNetwork | ( | const LdnSecurityConfig * | sec_config, |
| const LdnUserConfig * | user_config, | ||
| const LdnNetworkConfig * | network_config | ||
| ) |
CreateNetwork.
| [in] | sec_config | LdnSecurityConfig |
| [in] | user_config | LdnUserConfig |
| [in] | network_config | LdnNetworkConfig |
| Result ldnCreateNetworkPrivate | ( | const LdnSecurityConfig * | sec_config, |
| const LdnSecurityParameter * | sec_param, | ||
| const LdnUserConfig * | user_config, | ||
| const LdnNetworkConfig * | network_config, | ||
| const LdnAddressEntry * | addrs, | ||
| s32 | count | ||
| ) |
CreateNetworkPrivate.
| [in] | sec_config | LdnSecurityConfig |
| [in] | sec_param | LdnSecurityParameter |
| [in] | user_config | LdnUserConfig |
| [in] | network_config | LdnNetworkConfig |
| [in] | addrs | Input array of LdnAddressEntry. This can be NULL. |
| [in] | count | Size of the addrs array in entries. This must be <=8. This can be 0, in which case the network will be non-Private like ldnCreateNetwork. |
| Result ldnDestroyNetwork | ( | void | ) |
DestroyNetwork.
| Result ldnDisableActionFrame | ( | void | ) |
DisableActionFrame.
| Result ldnDisconnect | ( | void | ) |
Disconnect.
| Result ldnEnableActionFrame | ( | const LdnActionFrameSettings * | settings | ) |
EnableActionFrame.
| [in] | settings | LdnActionFrameSettings |
| Result ldnGetDisconnectReason | ( | LdnDisconnectReason * | out | ) |
GetDisconnectReason.
| [out] | out | LdnDisconnectReason |
| Result ldnGetIpv4Address | ( | LdnIpv4Address * | addr, |
| LdnSubnetMask * | mask | ||
| ) |
GetIpv4Address.
| [out] | addr | LdnIpv4Address |
| [out] | mask | LdnSubnetMask |
| Result ldnGetNetworkConfig | ( | LdnNetworkConfig * | out | ) |
GetNetworkConfig.
| [out] | out | LdnNetworkConfig |
| Result ldnGetNetworkInfo | ( | LdnNetworkInfo * | out | ) |
GetNetworkInfo.
| [out] | out | LdnNetworkInfo |
| Result ldnGetNetworkInfoAndHistory | ( | LdnNetworkInfo * | network_info, |
| LdnNodeLatestUpdate * | nodes, | ||
| s32 | count | ||
| ) |
GetNetworkInfoAndHistory.
| [out] | network_info | LdnNetworkInfo |
| [out] | nodes | Output array of LdnNodeLatestUpdate. |
| [in] | count | Size of the nodes array in entries, must be 8. |
| Result ldnGetSecurityParameter | ( | LdnSecurityParameter * | out | ) |
GetSecurityParameter.
| [out] | out | LdnSecurityParameter |
GetStateChangeEvent.
| [out] | out_event | Output Event with autoclear=true. |
| Result ldnInitialize | ( | LdnServiceType | service_type | ) |
Initialize ldn.
The priority is only used with LdnServiceType_System on [19.0.0+]. To optionally set this, define "s32 __nx_ldn_priority". The priority must be LDN_PRIORITY_SYSTEM (default) or LDN_PRIORITY_USER.
| Result ldnmGetIpv4Address | ( | LdnIpv4Address * | addr, |
| LdnSubnetMask * | mask | ||
| ) |
GetIpv4Address.
| [out] | addr | LdnIpv4Address |
| [out] | mask | LdnSubnetMask |
| Result ldnmGetNetworkConfig | ( | LdnNetworkConfig * | out | ) |
| Result ldnmGetNetworkInfo | ( | LdnNetworkInfo * | out | ) |
GetNetworkInfo.
| [out] | out | LdnNetworkInfo |
| Result ldnmGetSecurityParameter | ( | LdnSecurityParameter * | out | ) |
| Result ldnOpenAccessPoint | ( | void | ) |
OpenAccessPoint.
| Result ldnOpenStation | ( | void | ) |
OpenStation.
| Result ldnRecvActionFrame | ( | void * | data, |
| size_t | size, | ||
| LdnMacAddress * | addr0, | ||
| LdnMacAddress * | addr1, | ||
| s16 * | channel, | ||
| u32 * | out_size, | ||
| s32 * | link_level, | ||
| u32 | flags | ||
| ) |
RecvActionFrame.
| [out] | data | Output data buffer. |
| [in] | size | Max size of the data buffer. |
| [out] | addr0 | First LdnMacAddress. |
| [out] | addr1 | Second LdnMacAddress. |
| [out] | channel | Channel |
| [out] | out_size | Output size. |
| [out] | link_level | LinkLevel |
| [in] | flags | MessageFlag bit0 clear = block until data is available, set = return error when data is not available. |
| Result ldnReject | ( | LdnIpv4Address | addr | ) |
| Result ldnResetTxPower | ( | void | ) |
ResetTxPower.
| Result ldnScan | ( | s32 | channel, |
| const LdnScanFilter * | filter, | ||
| LdnNetworkInfo * | network_info, | ||
| s32 | count, | ||
| s32 * | total_out | ||
| ) |
Scan.
| [in] | channel | Channel, value 0 can be used for this. |
| [in] | filter | LdnScanFilter |
| [out] | network_info | Output array of LdnNetworkInfo. |
| [in] | count | Size of the network_info array in entries. Must be at least 1, this is clamped to a maximum of 0x18 internally. |
| [out] | total_out | Total output entries. |
| Result ldnScanPrivate | ( | s32 | channel, |
| const LdnScanFilter * | filter, | ||
| LdnNetworkInfo * | network_info, | ||
| s32 | count, | ||
| s32 * | total_out | ||
| ) |
ScanPrivate.
| [in] | channel | Channel, value 0 can be used for this. |
| [in] | filter | LdnScanFilter |
| [out] | network_info | Output array of LdnNetworkInfo. |
| [in] | count | Size of the network_info array in entries. Must be at least 1, this is clamped to a maximum of 0x18 internally. |
| [out] | total_out | Total output entries. |
| Result ldnSendActionFrame | ( | const void * | data, |
| size_t | size, | ||
| LdnMacAddress | destination, | ||
| LdnMacAddress | bssid, | ||
| s16 | channel, | ||
| u32 | flags | ||
| ) |
SendActionFrame.
| [in] | data | Data buffer. |
| [in] | size | Data buffer size. |
| [in] | destination | Destination LdnMacAddress. |
| [in] | bssid | Bssid LdnMacAddress. |
| [in] | channel | Channel, must be non-zero. |
| [in] | flags | MessageFlag bit0 clear = block until the data can be sent, set = return error when the data can't be sent. |
| Result ldnSetAdvertiseData | ( | const void * | buffer, |
| size_t | size | ||
| ) |
SetAdvertiseData.
| [in] | buffer | Input buffer containing arbitrary user data. |
| [in] | size | Input buffer size, must be <=0x180. |
SetHomeChannel.
| [in] | channel | Channel, must be non-zero. |
| Result ldnSetOperationMode | ( | LdnOperationMode | mode | ) |
SetOperationMode.
| [in] | mode | LdnOperationMode |
| Result ldnSetProtocol | ( | LdnProtocol | protocol | ) |
SetProtocol.
| [in] | protocol | LdnProtocol |
| Result ldnSetStationAcceptPolicy | ( | LdnAcceptPolicy | policy | ) |
SetStationAcceptPolicy.
| [in] | policy | LdnAcceptPolicy |
SetTxPower.
| [in] | power | Power, must be 0x0..0xFF. |
| Result ldnSetWirelessControllerRestriction | ( | LdnWirelessControllerRestriction | restriction | ) |
SetWirelessControllerRestriction.
| [in] | restriction | LdnWirelessControllerRestriction |