i have lately been writing a simple "samba" client for iOS (https://github.com/38leinaD/tango) and after that experience i must say to the developer doing the samba replacement at apple: poor bastard; you are in for a world of pain!
It is really a horrible protocol where you can see how it evolved and was extended from windows version to version...