Skip to content

IPC Commands

This page documents the IPC commands used by ryu_ldn_nx.

These are the standard Nintendo LDN IPC commands that ryu_ldn_nx intercepts:

CmdNameDescription
0CreateUserLocalCommunicationServiceCreates a communication session
CmdNameDescription
0GetStateGet current LDN state
100AttachStateChangeEventGet event handle for state changes
200GetNetworkInfoGet current network information
201GetIpv4AddressGet local IPv4 address
202GetDisconnectReasonGet reason for last disconnect
203GetSecurityParameterGet security configuration
204GetNetworkConfigGet network configuration
300OpenAccessPointOpen as network host
301CloseAccessPointClose host mode
302CreateNetworkCreate a new network
303CreateNetworkPrivateCreate private network
304DestroyNetworkDestroy current network
400OpenStationOpen as client
401CloseStationClose client mode
402ConnectConnect to a network
403ConnectPrivateConnect to private network
404DisconnectDisconnect from network
500SetAdvertiseDataSet advertisement data
600ScanScan for networks
601ScanPrivateScan for private networks

ryu_ldn_nx adds custom IPC commands for overlay communication. These are obtained via command 65000 on the MITM service.

CmdNameParametersReturnsDescription
65001GetVersion-char[32]Sysmodule version string
65002GetConnectionStatus-u32Server connection state
65003GetLdnState-u32Current LDN state
65004GetSessionInfo-SessionInfoCurrent session information
65005GetServerAddress-ServerAddressConfigured server address
65006SetServerAddressServerAddress-Change server address
65007GetDebugEnabled-u32Debug logging state
65008SetDebugEnabledu32-Enable/disable debug
65009ForceReconnect--Force server reconnection
65010GetLastRtt-u32Last RTT in milliseconds
ValueNameDescription
0DisconnectedNot connected to server
1ConnectingConnection in progress
2ConnectedTCP connected, handshake pending
3ReadyFully connected and operational
4ErrorConnection error occurred
ValueNameDescription
0NoneNot initialized
1InitializedService initialized
2AccessPointHost mode opened
3AccessPointCreatedNetwork created
4StationClient mode opened
5StationConnectedConnected to network
6ErrorError state
OffsetTypeNameDescription
0x00u8node_countPlayers in session
0x01u8node_count_maxMaximum players
0x02u8local_node_idOur node ID
0x03u8is_host1 if hosting
0x04u32session_duration_msSession duration
0x08char[64]game_nameGame name
OffsetTypeNameDescription
0x00char[64]hostServer hostname
0x40u16portServer port
0x42u16paddingReserved
// Get config service from ldn:u MITM
Service ldnService;
smGetService(&ldnService, "ldn:u");
RyuLdnConfigService configService;
serviceDispatch(&ldnService, 65000,
.out_num_objects = 1,
.out_objects = &configService.s,
);
// Get version
char version[32];
serviceDispatchOut(&configService.s, 65001, version);
printf("Version: %s\n", version);
// Get connection status
u32 status;
serviceDispatchOut(&configService.s, 65002, &status);
printf("Status: %u\n", status);
// Force reconnect
serviceDispatch(&configService.s, 65009);