SMB/CIFS Protocol resolution

Source: Internet
Author: User

One, copy files (remote-to-local)

1, Smb_com_nt_create_andx (0XA2)

Open the file, get the filename, and get the total length of the read file.
2, Smb_com_read(0x2e)
Read the file and get the contents of the read file.
3, Smb_com_close (0x04)
The client closes the TID and fid representing the file.

The specific process of reading large files

Read files are chunked, each block up to 64k byte, each block is composed of read request+tcp data package+read response, such as.
(1) Without the read request containing the file data,
(2) The first TCP data package is made up of SMB header+ file data,
(3) followed by a number of TCP data package containing only file data,
(4) Finally, a read response that contains only the file data.

Second, copy files (local-to-remote)

1, Smb_com_nt_create_andx (0XA2)

Create a file to get the filename.
2, Smb_com_write(0x2f)
Write to the file and get the content written to it.
3, Smb_com_close (0x04)
The client closes the TID and fid representing the file.

The write file is chunked, with each block having a maximum of 64k byte, each of which is composed of TCP data Package+write request+write response, such as.
(1) The first TCP data package is made up of SMB header+ file data,
(2) followed by a number of TCP data package containing only file data,
(3) Then the write request that contains only the file data,
(4) Finally, there is no write response that contains the file data.

From:http://blog.sina.com.cn/s/blog_705eb43a0100o5ah.html

SMB/CIFS Protocol resolution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.