Migration services: Difference between revisions

No edit summary
No edit summary
Line 366: Line 366:
* Calls a vfunc. When the ret is true:
* Calls a vfunc. When the ret is true:
** Calls a func, which receives [[#SendClientProfile|SendClientProfile]] and sends the response. Also calls a func to process the received data.
** Calls a func, which receives [[#SendClientProfile|SendClientProfile]] and sends the response. Also calls a func to process the received data.
** Receives [[#Data|Data]] message 0x10 and sends the response.
** Receives [[#RequestServerProfile|RequestServerProfile]] and sends the response.
* Otherwise when the vfunc ret is false:
* Otherwise when the vfunc ret is false:
** Calls a func identical to the first network-message func called in the above block, except a different func is called at the end.
** Calls a func identical to the first network-message func called in the above block, except a different func is called at the end.
** Runs the same [[#Data|Data]] message 0x10 handling as above.
** Runs the same [[#RequestServerProfile|RequestServerProfile]] handling as above.
** Calls a func. This calls a func, then receives [[#Data|Data]] message 0x12 and sends the response.
** Calls a func. This calls a func, then receives [[#Data|Data]] message 0x12 and sends the response.
** Calls a func. This runs functionality similar to the eariler message-loop, except this waits for the state field to change to !=0x3. The socket is closed, then a func is called which handles [[LDN_services|ldn]] + [[Sockets_services|sockets]] cleanup.
** Calls a func. This runs functionality similar to the eariler message-loop, except this waits for the state field to change to !=0x3. The socket is closed, then a func is called which handles [[LDN_services|ldn]] + [[Sockets_services|sockets]] cleanup.
** Calls a func. This essentially calls the network-creation func from eariler, with the input AdvertiseData being 0x10-bytes.
** Calls a func. This essentially calls the network-creation func from earlier, with the input AdvertiseData being 0x10-bytes.
** Calls a func. This receives [[#Suspend|Suspend]] or [[#SynchronizeState|SynchronizeState]] and sends the response.
** Calls a func. This receives [[#Suspend|Suspend]] or [[#SynchronizeState|SynchronizeState]] and sends the response.
* Updates a state flag and returns 0.
* Updates a state flag and returns 0.
Line 510: Line 510:
*** Calls a func.
*** Calls a func.
** Calls a func. (fs related?)
** Calls a func. (fs related?)
** Calls a func. This sends a network message with [[#Messages|MessageId]] 0x10, then receives network data. Then the socket is closed. Lastly, a func is called which handles closing [[LDN_services|ldn]] (CloseStation, Finalize) and [[Sockets_services|sockets]].
** Calls a func. This sends [[#RequestServerProfile|RequestServerProfile]], then receives network data. Then the socket is closed. Lastly, a func is called which handles closing [[LDN_services|ldn]] (CloseStation, Finalize) and [[Sockets_services|sockets]].
** Calls a func.
** Calls a func.
** Clears stack. Enters a block which uses nifm.
** Clears stack. Enters a block which uses nifm.
Line 1,212: Line 1,212:
! DataMessageId (client/server) || Description
! DataMessageId (client/server) || Description
|-
|-
| 0x10 ||  
| 0x10 || [[#RequestServerProfile|RequestServerProfile]]
|-
|-
| 0x11 || [[#SendClientProfile|SendClientProfile]]
| 0x11 || [[#SendClientProfile|SendClientProfile]]
Line 1,231: Line 1,231:
|}
|}


==== 0x10 ====
==== RequestServerProfile ====
This is sent by the client following the last vfunc call in [[#ConnectByServerIdAsync|ConnectByServerIdAsync]] where the bool ret is checked, with both true/false blocks. This follows [[#SendClientProfile|SendClientProfile]].
This is sent by the client following the last vfunc call in [[#ConnectByServerIdAsync|ConnectByServerIdAsync]] where the bool ret is checked, with both true/false blocks. This follows [[#SendClientProfile|SendClientProfile]].


The request only contains the header.
The request only contains the header.


Response payload:
Response payload (0x148-byte struct, which has the following layout):


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 1,242: Line 1,242:
! Offset || Size || Description
! Offset || Size || Description
|-
|-
| 0x0 || 0x148 ||  
| 0x0 || 0x1 ||  
|-
| 0x1 || 0x7 || Zeros
|-
| 0x8 || 0x4 ||
|-
| 0xC || 0x10 ||
|-
| 0x1C || 0x100 || [[#ServerProfile|ServerProfile]]
|-
| 0x11C || 0x4 ||
|-
| 0x120 || 0x24 ||
|-
| 0x144 || 0x4 || Padding
|}
|}


Line 1,264: Line 1,278:


==== 0x12 ====
==== 0x12 ====
This is sent by the client following DataMessageId 0x10, where the vfunc mentioned there returned false.
This is sent by the client following [[#RequestServerProfile|RequestServerProfile]], where the vfunc mentioned there returned false.


The request only contains the header.
The request only contains the header.