I struggle quite a bit about this and found out the following:
APPEUI is provided by the EUI field of the ttnctl applications
DEVEUI is provided by the DevEUI field of the ttnctl devices info
NwkSkey is provided by the AppKey field of the ttnctl devices info
Then APPEUI and DEVEUI need to be reversed in the LMIC retrieve functions. Either, you store them in the reverse order or you do it in the os_getArtEui and os_getDevEui functions.
For example, if the DEVEUI returned by ttnctl devices info is 01 02 03 04 05 06 07 08, the the function need to return a buffer holding 08 07 06 05 04 03 02 01. Same for APPEUI. NwkSkey remain the same as ttnctl output.