在iOS上支持SMB / samba? [英] SMB/samba support on iOS?

查看:1153
本文介绍了在iOS上支持SMB / samba?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我检查iOS文档,并在Google上搜索了一段时间,并得到了iOS不支持samba的印象(尽管有一个针对越狱iPhone的samba应用程序)



但是,应用程序 FileBrowser 如何实现?这是否意味着他们自己实现了samba支持?



我还发现有一个名为探戈的开源库,有限的支持桑巴。所以我的问题是,我可以得到最好的samba支持吗?
解决方案

我花了相当一段时间来实现我自己的SMB客户端我想在这里分享一些经验。

首先不要在你的产品代码中使用探戈,因为一旦你熟悉SMB,你会意识到它的实现是有问题的。它不支持unicode,在某些情况下,它不是正确的填充,所以你不能访问该文件夹。我也听到有人说他们不能连接窗口7。

其次,总结我的经验,我发现 jcifs家伙们说过最好的:任何想实施CIFS的人都需要知道一件非常重要的事情 - 官员CIFS文档不是准确的
,并不反映现实,没有任何规范,不要相信你在IETF草案或SNIA文档(相同的文档不同的格式)中阅读的内容,只能作为提示。您可以在线上看到任何明确的参考资料。

WireShark规则!

...看看JCIFS的设计灵感,例如它如何将请求和响应放入地图,然后对帧进行编码和解码。然后执行以下命令:




  • SMB_COM_NEGOTIATE

    SMB_COM_SESSION_SETUP_ANDX

    SMB_COM_TREE_CO NNECT_ANDX

    SMB_COM_NT_CREATE_ANDX

    SMB_COM_READ_ANDX

    SMB_COM_WRITE_ANDX

    SMB_COM_CLOSE
  • $ b以上的所有回应


    我只能补充说,你还需要实现 TRANS2_FIND_FIRST2 请求/响应查询文件夹内的文件,如果您想查明服务器暴露多少个共享文件夹,您需要实施 NetShareEnum 请求/响应。


    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 ?

    解决方案

    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.

    这篇关于在iOS上支持SMB / samba?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆