|
libnx v4.9.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 | LdnNetworkInfo |
| NetworkInfo. More... | |
| struct | LdnScanFilter |
| ScanFilter. The input struct is copied to a tmp struct, which is then used with the cmd (ldnScan and ldnScanPrivate). 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... | |
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 | ldnmGetStateForMonitor (LdnState *out) |
| GetStateForMonitor. | |
| Result | ldnmGetNetworkInfoForMonitor (LdnNetworkInfo *out) |
| GetNetworkInfoForMonitor. | |
| Result | ldnmGetIpv4AddressForMonitor (LdnIpv4Address *addr, LdnSubnetMask *mask) |
| GetIpv4AddressForMonitor. | |
| Result | ldnmGetSecurityParameterForMonitor (LdnSecurityParameter *out) |
| GetSecurityParameterForMonitor. | |
| Result | ldnmGetNetworkConfigForMonitor (LdnNetworkConfig *out) |
| GetNetworkConfigForMonitor. | |
ldn | |
| Result | ldnInitialize (LdnServiceType service_type) |
| Initialize ldn. | |
| void | ldnExit (void) |
| Exit ldn. | |
| Service * | ldnGetServiceSession_LocalCommunicationService (void) |
| Gets the Service object for IUserLocalCommunicationService/ISystemLocalCommunicationService. | |
| 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 | ldnAttachStateChangeEvent (Event *out_event) |
| AttachStateChangeEvent. | |
| Result | ldnGetNetworkInfoLatestUpdate (LdnNetworkInfo *network_info, LdnNodeLatestUpdate *nodes, s32 count) |
| GetNetworkInfoLatestUpdate. | |
| 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 | 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. | |
LDN (local network communications) IPC wrapper.
See also: https://switchbrew.org/wiki/LDN_services
| enum LdnAcceptPolicy |
AcceptPolicy.
| Enumerator | |
|---|---|
| LdnAcceptPolicy_AllowAll | Allow all. |
| LdnAcceptPolicy_DenyAll | Deny all. |
| 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 LdnScanFilterFlags |
ScanFilterFlags.
| Enumerator | |
|---|---|
| LdnScanFilterFlags_LocalCommunicationId | When set, enables using LdnScanFilter::local_communication_id. |
| LdnScanFilterFlags_NetworkId | When set, enables using LdnScanFilter::network_id. |
| LdnScanFilterFlags_Unknown2 | When set, enables using LdnScanFilter::unk_x20. |
| LdnScanFilterFlags_MacAddr | When set, enables using LdnScanFilter::mac_addr. Only available with ldnScanPrivate. |
| LdnScanFilterFlags_Ssid | When set, enables using the LdnScanFilter::ssid. |
| LdnScanFilterFlags_UserData | When set, enables using LdnScanFilter::userdata_filter. |
| enum LdnServiceType |
| enum LdnState |
State loaded by ldnmGetStateForMonitor / ldnGetState.
| Enumerator | |
|---|---|
| LdnState_None | None. |
| LdnState_Initialized | Initialized. |
| LdnState_AccessPointOpened | AccessPointOpened (ldnOpenAccessPoint) |
| LdnState_AccessPointCreated | AccessPointCreated (ldnCreateNetwork / ldnCreateNetworkPrivate) |
| LdnState_StationOpened | StationOpened (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. |
AttachStateChangeEvent.
| [out] | out_event | Output Event with autoclear=true. |
| 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 ldnDisconnect | ( | void | ) |
Disconnect.
| 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 ldnGetNetworkInfoLatestUpdate | ( | LdnNetworkInfo * | network_info, |
| LdnNodeLatestUpdate * | nodes, | ||
| s32 | count | ||
| ) |
GetNetworkInfoLatestUpdate.
| [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 |
| Result ldnmGetIpv4AddressForMonitor | ( | LdnIpv4Address * | addr, |
| LdnSubnetMask * | mask | ||
| ) |
GetIpv4AddressForMonitor.
| [out] | addr | LdnIpv4Address |
| [out] | mask | LdnSubnetMask |
| Result ldnmGetNetworkConfigForMonitor | ( | LdnNetworkConfig * | out | ) |
| Result ldnmGetNetworkInfoForMonitor | ( | LdnNetworkInfo * | out | ) |
GetNetworkInfoForMonitor.
| [out] | out | LdnNetworkInfo |
| Result ldnmGetSecurityParameterForMonitor | ( | LdnSecurityParameter * | out | ) |
GetSecurityParameterForMonitor.
| [out] | out | LdnSecurityParameter |
| Result ldnOpenAccessPoint | ( | void | ) |
OpenAccessPoint.
| Result ldnOpenStation | ( | void | ) |
OpenStation.
| Result ldnReject | ( | LdnIpv4Address | addr | ) |
| 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 ldnSetAdvertiseData | ( | const void * | buffer, |
| size_t | size | ||
| ) |
SetAdvertiseData.
| [in] | buffer | Input buffer containing arbitrary user data. |
| [in] | size | Input buffer size, must be <=0x180. If this isn't enough space, you can for example also periodically use this cmd with different regions of your data with some sequence_number field (or use sockets while connected to the network). |
| Result ldnSetOperationMode | ( | LdnOperationMode | mode | ) |
SetOperationMode.
| [in] | mode | LdnOperationMode |
| Result ldnSetStationAcceptPolicy | ( | LdnAcceptPolicy | policy | ) |
SetStationAcceptPolicy.
| [in] | policy | LdnAcceptPolicy |
| Result ldnSetWirelessControllerRestriction | ( | LdnWirelessControllerRestriction | restriction | ) |
SetWirelessControllerRestriction.
| [in] | restriction | LdnWirelessControllerRestriction |