i've recently bought a DN-7023 but it didn't work properly with OPL 0.7. I found a thread http://psx-scene.com/forums/f150/dig...-issues-64175/ (DIGITUS NAS Server | OPL - Network Issues) about this topic, but there was no solution. I've also compiled last Rev. 493, but without success.
After some nights of debugging i've finally figured out how to get the NAS working with OPL and would like to share these fixes.
The main problem is, the NAS expects Unicode strings, but OPL doesn't support Unicode strings in all SMB-requests.
Functions smb_OpenAndX() and smb_NTCreateAndX() need Unicode-support
Now the games in ul.cfg are listed. But you can't still run them.
Function smb_OpenAndX() need Unicode support and maybe smb_NTCreateAndX() for NT LM SMB should be added.
But that's not enough.
Function smb_SessionSetupTreeConnect doesn't return a valid TID (Tree ID) to be used in function smb_OpenAndX(), so you get an error on reading.
There is a single SMB-request SMB_COM_SESSION_SETUP_ANDX with SubCmd SMB_COM_TREE_CONNECT_ANDX. If this request is splitted into two requests SMB_COM_SESSION_SETUP_ANDX and SMB_COM_TREE_CONNECT_ANDX like in \modules\network\smbman\smb.c, functions smb_SessionSetupAndX() and smb_TreeConnectAndX() the NAS returns a valid TID.
Now you can load ul.cfg games.
But you still don't see ISO-games.
This is caused by an invalid pathname construction because of a trailing backslash.
sprintf(path, "%s\\THM\\", ethPrefix); -> "smb:\THM\" is invalid
but should be
sprintf(path, "%s\\THM", ethPrefix); -> "smb:\THM" is valid
snprintf(path, 64, "%sCD\\", ethPrefix); -> "smb:CD\" is invalid
snprintf(path, 64, "%s\\CD", ethPrefix); -> "smb:\CD" is valid
snprintf(path, 64, "%sDVD\\", ethPrefix);
snprintf(path, 64, "%s\\DVD", ethPrefix);
BTW: my Ubuntu 10.04 and WinXP are tolerating this invalid pathnames.
But the NAS has a real bug, it returns invalid data on a SMB-request SMB_QUERY_FILE_STANDARD_INFO, so OPL can't get the info if it's a directory or a file.
To correct this, function smb_QueryPathInformation() in \modules\network\smbman\smb.c should be changed.
The SMB_QUERY_FILE_STANDARD_INFO is used to get Info->IsDirectory = SFI->IsDirectory;
But this info you can also get from the SMB_QUERY_FILE_BASIC_INFO request, BFI->FileAttributes:
Info->IsDirectory = (BFI->FileAttributes >> 4) & 1;
I don't know if the other data (see below) in SMB_QUERY_FILE_STANDARD_INFO response is really used by OPL, maybe the SMB_QUERY_FILE_STANDARD_INFO request/response is now obsolete. There are comments about files > 4GB but i didn't find any references to AllocationSize.
Info->AllocationSize = SFI->AllocationSize;
Info->EndOfFile = SFI->EndOfFile;
Info->LinkCount = SFI->LinkCount;
Info->DeletePending = SFI->DeletePending;
I've also tried a single SMB_QUERY_FILE_ALL_INFO request but the data returned is not the same as in the SMB/CIFS Specs, so i used the BASIC and STANDARD requests.
Now the ISO-games are listed too and you can also start them.
The SMB-request in function smb_FindFirstNext2 (\modules\iopcore\cdvdman\smb.c) is using an invalid path "\CD*" after stripping the trailing slashes above. It does work with the NAS but not on my Ubuntu. AFAIK It should be "\CD\*". This can be corrected in \modules\network\smbman\smb_fio.c, function smb_dopen().
If line strcat(fh->name, "*");
is changed to strcat(fh->name, "\\*");
the requests goes to the valid path "\CD\*"
But now i can't load any game (ul.cfg and ISO). I couldn't figure this out. Maybe i have missed something.
Please be so kind and have a look, maybe you can change these things, because they are not really specific to this NAS. But the DN-7023 seems to be a little bit intolerant. If OPL and NAS negotiates to Unicode-string support the NAS expects Unicode-strings. Same for the "invalid" paths, most SMB-implementations will tolerate this, including my Ubuntu 10.04 and WinXPSP3, but not the DN-7023.
The NAS supports FAT32 only so i can't tell if support for files > 4GB is broken with by these fixes.
I used Rev. 488 for my tests, because it loads the games from my Ubuntu and WinXP more stable than Rev. 493.
The DN-7023 is using Port 139 and not OPL standard port 445.
BTW: Most of the times a didn't get any debug output. I have to reboot my PS2 several times.