Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
496 views
in Technique[技术] by (71.8m points)

iphone - SMB/samba support on iOS?

I check iOS document and also google it for a while and get the impression that iOS does not support samba (although there is a samba app for jailbreak iPhone).

But then how do the app FileBrowser achieves that? Does that mean they implemented samba support by their own ?

I also find there is an open source library called tango that provides limited support for samba. So my question is that the best samba support I can get ?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I spent quite some time in implementing my own SMB client so I would like to share some experience here.

First do not use tango in your production code because once you become familiar with SMB you will realize that its implementation is problematic, e.g. it does not support unicode and in some several cases it is not correctly padding so you can't access the folder. And I also heard people said they can't connect window 7 with it.

Second, to summarize my experience I find jcifs guys had said the best: "anyone who wants to implement the CIFS needs to know one very important thing - the "official" CIFS documentation is not accurate and does not reflect reality. There is NO specification. Do not believe anything you read in the IETF draft or the SNIA document (same document different formatting). Use it only as a hint. The definitive reference is whatever you see on the wire.

WireShark Rules!

... look at JCIFS for design inspiration such as how it puts the request and response into a map by MID and encodes and decodes frames.

Then implement the following commands:

  • SMB_COM_NEGOTIATE
    SMB_COM_SESSION_SETUP_ANDX
    SMB_COM_TREE_CONNECT_ANDX
    SMB_COM_NT_CREATE_ANDX
    SMB_COM_READ_ANDX
    SMB_COM_WRITE_ANDX
    SMB_COM_CLOSE
  • all responses for above "

The only thing I can add is that , you also need to implement TRANS2_FIND_FIRST2 request/response to query the files inside a folder and if you want to find out how many shared folders the server exposes you need to implement NetShareEnum Request/Response.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...