10 #include "../sf/service.h"
11 #include "../kernel/event.h"
111 u8 reserved_x2C[0x2];
113 u8 reserved_x30[0x10];
135 u8 sec_param_data[0x10];
143 u8 reserved_x268[0x2];
145 u8 advertise_data[0x180];
146 u8 reserved_x3EC[0x8C];
187 u8 reserved_x16[0xA];
Service * ldnGetServiceSession_LocalCommunicationService(void)
Gets the Service object for IUserLocalCommunicationService/ISystemLocalCommunicationService.
Result ldnmGetSecurityParameterForMonitor(LdnSecurityParameter *out)
GetSecurityParameterForMonitor.
Result ldnAttachStateChangeEvent(Event *out_event)
AttachStateChangeEvent.
Result ldnDestroyNetwork(void)
DestroyNetwork.
Result ldnSetWirelessControllerRestriction(LdnWirelessControllerRestriction restriction)
SetWirelessControllerRestriction.
Result ldnCreateNetwork(const LdnSecurityConfig *sec_config, const LdnUserConfig *user_config, const LdnNetworkConfig *network_config)
CreateNetwork.
LdnServiceType
Definition: ldn.h:13
@ LdnServiceType_User
Initializes ldn:u.
Definition: ldn.h:14
@ LdnServiceType_System
Initializes ldn:s.
Definition: ldn.h:15
LdnWirelessControllerRestriction
WirelessControllerRestriction.
Definition: ldn.h:65
@ LdnWirelessControllerRestriction_Unknown0
Unknown.
Definition: ldn.h:66
@ LdnWirelessControllerRestriction_Unknown1
Unknown.
Definition: ldn.h:67
Result ldnSetStationAcceptPolicy(LdnAcceptPolicy policy)
SetStationAcceptPolicy.
Result ldnOpenAccessPoint(void)
OpenAccessPoint.
Result ldnGetSecurityParameter(LdnSecurityParameter *out)
GetSecurityParameter.
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 ldnSetAdvertiseData(const void *buffer, size_t size)
SetAdvertiseData.
LdnState
State loaded by ldnmGetStateForMonitor / ldnGetState.
Definition: ldn.h:19
@ LdnState_Error
Error.
Definition: ldn.h:26
@ LdnState_AccessPointOpened
AccessPointOpened (ldnOpenAccessPoint)
Definition: ldn.h:22
@ LdnState_StationOpened
StationOpened (ldnOpenStation)
Definition: ldn.h:24
@ LdnState_Initialized
Initialized.
Definition: ldn.h:21
@ LdnState_StationConnected
StationConnected (ldnConnect / ldnConnectPrivate)
Definition: ldn.h:25
@ LdnState_None
None.
Definition: ldn.h:20
@ LdnState_AccessPointCreated
AccessPointCreated (ldnCreateNetwork / ldnCreateNetworkPrivate)
Definition: ldn.h:23
void ldnmExit(void)
Exit ldn:m.
Result ldnConnectPrivate(const LdnSecurityConfig *sec_config, const LdnSecurityParameter *sec_param, const LdnUserConfig *user_config, s32 version, u32 option, const LdnNetworkConfig *network_config)
ConnectPrivate.
Result ldnmGetIpv4AddressForMonitor(LdnIpv4Address *addr, LdnSubnetMask *mask)
GetIpv4AddressForMonitor.
Result ldnCloseAccessPoint(void)
CloseAccessPoint.
Result ldnGetState(LdnState *out)
GetState.
Result ldnGetNetworkInfoLatestUpdate(LdnNetworkInfo *network_info, LdnNodeLatestUpdate *nodes, s32 count)
GetNetworkInfoLatestUpdate.
void ldnExit(void)
Exit ldn.
Result ldnmInitialize(void)
Initialize ldn:m.
LdnScanFilterFlags
ScanFilterFlags.
Definition: ldn.h:41
@ LdnScanFilterFlags_NetworkId
When set, enables using LdnScanFilter::network_id.
Definition: ldn.h:43
@ LdnScanFilterFlags_LocalCommunicationId
When set, enables using LdnScanFilter::local_communication_id.
Definition: ldn.h:42
@ LdnScanFilterFlags_Unknown2
When set, enables using LdnScanFilter::unk_x20.
Definition: ldn.h:44
@ LdnScanFilterFlags_Ssid
When set, enables using the LdnScanFilter::ssid.
Definition: ldn.h:46
@ LdnScanFilterFlags_MacAddr
When set, enables using LdnScanFilter::mac_addr. Only available with ldnScanPrivate.
Definition: ldn.h:45
@ LdnScanFilterFlags_UserData
When set, enables using LdnScanFilter::userdata_filter.
Definition: ldn.h:47
Result ldnmGetNetworkInfoForMonitor(LdnNetworkInfo *out)
GetNetworkInfoForMonitor.
LdnDisconnectReason
DisconnectReason loaded by ldnGetDisconnectReason.
Definition: ldn.h:30
@ LdnDisconnectReason_Admin
Admin.
Definition: ldn.h:36
@ LdnDisconnectReason_SystemRequest
SystemRequest.
Definition: ldn.h:33
@ LdnDisconnectReason_None
None.
Definition: ldn.h:31
@ LdnDisconnectReason_SignalLost
SignalLost.
Definition: ldn.h:37
@ LdnDisconnectReason_DestroyedByAdmin
DestroyedByAdmin.
Definition: ldn.h:34
@ LdnDisconnectReason_User
User.
Definition: ldn.h:32
@ LdnDisconnectReason_DestroyedBySystemRequest
DestroyedBySystemRequest.
Definition: ldn.h:35
LdnAcceptPolicy
AcceptPolicy.
Definition: ldn.h:51
@ LdnAcceptPolicy_DenyAll
Deny all.
Definition: ldn.h:53
@ LdnAcceptPolicy_AllowAll
Allow all.
Definition: ldn.h:52
@ LdnAcceptPolicy_Blacklist
Blacklist, addresses in the list (ldnAddAcceptFilterEntry) are not allowed.
Definition: ldn.h:54
@ LdnAcceptPolicy_Whitelist
Whitelist, only addresses in the list (ldnAddAcceptFilterEntry) are allowed.
Definition: ldn.h:55
Result ldnGetNetworkInfo(LdnNetworkInfo *out)
GetNetworkInfo.
Result ldnmGetStateForMonitor(LdnState *out)
GetStateForMonitor.
Result ldnClearAcceptFilter(void)
ClearAcceptFilter.
Result ldnScanPrivate(s32 channel, const LdnScanFilter *filter, LdnNetworkInfo *network_info, s32 count, s32 *total_out)
ScanPrivate.
Result ldnDisconnect(void)
Disconnect.
Result ldnGetNetworkConfig(LdnNetworkConfig *out)
GetNetworkConfig.
Result ldnInitialize(LdnServiceType service_type)
Initialize ldn.
Result ldnAddAcceptFilterEntry(LdnMacAddress addr)
AddAcceptFilterEntry.
Result ldnCloseStation(void)
CloseStation.
Result ldnReject(LdnIpv4Address addr)
Reject.
Result ldnSetOperationMode(LdnOperationMode mode)
SetOperationMode.
Result ldnOpenStation(void)
OpenStation.
Result ldnmGetNetworkConfigForMonitor(LdnNetworkConfig *out)
GetNetworkConfigForMonitor.
Result ldnGetDisconnectReason(LdnDisconnectReason *out)
GetDisconnectReason.
Result ldnConnect(const LdnSecurityConfig *sec_config, const LdnUserConfig *user_config, s32 version, u32 option, const LdnNetworkInfo *network_info)
Connect.
Result ldnGetIpv4Address(LdnIpv4Address *addr, LdnSubnetMask *mask)
GetIpv4Address.
Result ldnScan(s32 channel, const LdnScanFilter *filter, LdnNetworkInfo *network_info, s32 count, s32 *total_out)
Scan.
LdnOperationMode
OperationMode.
Definition: ldn.h:59
@ LdnOperationMode_Unknown1
Unknown.
Definition: ldn.h:61
@ LdnOperationMode_Unknown0
Unknown.
Definition: ldn.h:60
Service * ldnmGetServiceSession_MonitorService(void)
Gets the Service object for IMonitorService.
Kernel-mode event structure.
Definition: event.h:13
AddressEntry.
Definition: ldn.h:98
LdnIpv4Address ip_addr
LdnIpv4Address
Definition: ldn.h:99
LdnMacAddress mac_addr
LdnMacAddress
Definition: ldn.h:100
Ipv4Address. This is essentially the same as struct in_addr - hence this can be used with standard so...
Definition: ldn.h:71
u32 addr
Address.
Definition: ldn.h:72
MacAddress.
Definition: ldn.h:81
NetworkConfig. The input struct is copied to a tmp struct, which is then used with the cmd (ldnCreate...
Definition: ldn.h:178
u8 reserved_x13
Cleared to zero for the tmp struct.
Definition: ldn.h:185
s64 local_communication_id
LdnNetworkInfo::local_communication_id. ldnCreateNetwork, ldnCreateNetworkPrivate,...
Definition: ldn.h:179
s8 participant_max
LdnNetworkInfo::participant_max. ldnCreateNetwork / ldnCreateNetworkPrivate: Must be 0x1-0x8.
Definition: ldn.h:184
u16 userdata_filter
LdnNetworkInfo::userdata_filter.
Definition: ldn.h:181
s16 network_channel
LdnNetworkInfo::network_channel. Channel, can be zero. Overwritten internally by ldnCreateNetwork.
Definition: ldn.h:183
s16 local_communication_version
LdnNodeInfo::local_communication_version, for the first entry in LdnNetworkInfo::nodes....
Definition: ldn.h:186
NetworkInfo.
Definition: ldn.h:123
u64 local_communication_id
LocalCommunicationId.
Definition: ldn.h:124
u16 sec_type
LdnSecurityConfig::type.
Definition: ldn.h:136
u8 unk_x4B
Unknown. Set to hard-coded value 0x2 with output structs, except with ldnScan / ldnScanPrivate which ...
Definition: ldn.h:133
u64 auth_id
Random AuthenticationId.
Definition: ldn.h:147
u16 advertise_data_size
AdvertiseData size (ldnSetAdvertiseData)
Definition: ldn.h:144
s8 participant_max
Maximum participants, for nodes.
Definition: ldn.h:140
s8 link_level
LinkLevel.
Definition: ldn.h:132
u8 accept_policy
LdnAcceptPolicy
Definition: ldn.h:137
u16 userdata_filter
Arbitrary user data which can be used for filtering with LdnScanFilter.
Definition: ldn.h:126
u8 unk_x63
Only set with ldnScan / ldnScanPrivate, when unk_x4B is value 0x2.
Definition: ldn.h:138
LdnMacAddress mac_addr
LdnMacAddress
Definition: ldn.h:129
LdnSsid ssid
LdnSsid
Definition: ldn.h:130
u8 participant_num
ParticipantNum, number of set entries in nodes. If unk_x4B is not 0x2, ParticipantNum should be handl...
Definition: ldn.h:141
s16 network_channel
NetworkChannel.
Definition: ldn.h:131
NodeInfo.
Definition: ldn.h:105
LdnMacAddress mac_addr
LdnMacAddress
Definition: ldn.h:107
LdnIpv4Address ip_addr
LdnIpv4Address
Definition: ldn.h:106
s8 id
ID / index.
Definition: ldn.h:108
u8 is_connected
IsConnected flag.
Definition: ldn.h:109
s16 local_communication_version
LocalCommunicationVersion.
Definition: ldn.h:112
NodeLatestUpdate.
Definition: ldn.h:92
u8 val
The field in state is reset to zero by ldnGetNetworkInfoLatestUpdate after loading it.
Definition: ldn.h:93
ScanFilter. The input struct is copied to a tmp struct, which is then used with the cmd (ldnScan and ...
Definition: ldn.h:151
u16 userdata_filter
See LdnScanFilterFlags_UserData. During filtering if enabled, LdnNetworkInfo::unk_x4B must match 0x2,...
Definition: ldn.h:154
u32 flags
Bitmask for LdnScanFilterFlags. Masked with value 0x37 for ldnScan, with ldnScanPrivate this is maske...
Definition: ldn.h:161
u32 unk_x20
See LdnScanFilterFlags_Unknown2. When enabled, this must be <=0x3, and during filtering must match Ld...
Definition: ldn.h:157
LdnMacAddress mac_addr
LdnMacAddress (LdnScanFilterFlags_MacAddr, during filtering if enabled this must match LdnNetworkInfo...
Definition: ldn.h:158
LdnSsid ssid
LdnSsid (LdnScanFilterFlags_Ssid, during filtering if enabled this must match LdnNetworkInfo::ssid)
Definition: ldn.h:159
s64 local_communication_id
See LdnScanFilterFlags_LocalCommunicationId. When enabled, this will be overwritten if it's -1 (writt...
Definition: ldn.h:152
SecurityConfig.
Definition: ldn.h:165
u16 data_size
Data size. Must be 0x10-0x40.
Definition: ldn.h:167
u16 type
Type, a default of value 0x1 can be used here. Overwritten by ldnCreateNetwork, ldnCreateNetworkPriva...
Definition: ldn.h:166
SecurityParameter. The struct used by ldnCreateNetwork internally is randomly-generated.
Definition: ldn.h:172
Ssid.
Definition: ldn.h:86
u8 len
Length excluding NUL-terminator, must be 0x1-0x20.
Definition: ldn.h:87
SubnetMask. This is essentially the same as struct in_addr - hence this can be used with standard soc...
Definition: ldn.h:76
u32 mask
Mask.
Definition: ldn.h:77
UserConfig. The input struct is copied to a tmp struct, which is then used with the cmd.
Definition: ldn.h:117
Service object structure.
Definition: service.h:14
int64_t s64
64-bit signed integer.
Definition: types.h:28
#define BIT(n)
Creates a bitmask from a bit number.
Definition: types.h:54
uint64_t u64
64-bit unsigned integer.
Definition: types.h:22
uint8_t u8
8-bit unsigned integer.
Definition: types.h:19
int8_t s8
8-bit signed integer.
Definition: types.h:25
int16_t s16
16-bit signed integer.
Definition: types.h:26
uint16_t u16
16-bit unsigned integer.
Definition: types.h:20
u32 Result
Function error code result type.
Definition: types.h:44
int32_t s32
32-bit signed integer.
Definition: types.h:27
uint32_t u32
32-bit unsigned integer.
Definition: types.h:21