Home |
SMB3 Client |
SMB3 ClientSMB (Server Message Block) is a protocol designed by Microsoft to allow networked computers to share files. Microsoft uses SMB to allow Windows machines to make resources such as disk trees (SMB name for directories) available to others on the network. The SMB3 Client supports SMB protocol versions 1, 2, and 3.1.1. When a connection to an SMB server is established, the client will negociate which protocol versions are available on both sides and then use the highest possible version. The SMB3 Client allows an On Time RTOS-32 embedded system to access files located on a network share published by another computer on the network. The file I/O API is the standard Win32 API also used to access local files. Application programs can thus open files with the same functions (e.g., fopen("\\\\Server\\Share\\C\\SomeFile.txt", "rt")). The SMB3 Client defines an RTTarget-32 Installable File System, declared in header file Smb3capi.h: RTFileSystemHandlers SMB3FileSystem; By default, the following file system configuration is linked from library Smb3c.lib (if it is linked before Rtfiles.lib and Rtt32.lib): static RTFileSystem Console = { RT_FS_CONSOLE, 0, 0, &RTConsoleFileSystem }; static RTFileSystem NETFileSystem = { RT_FS_NET_FILE | RT_FS_IS_DEFAULT, 0, 0, &SMB3FileSystem }; RTFileSystem * RTFileSystemList[] = { &Console, &NETFileSystem, NULL }; The console and SMB3 Client file systems are present. If this is not what you want, you must include your own RTFileSystemList. Once the SMB3 Client has been initialized with SMB3CInit, files located on remote computer shares can be opened just like local files. The SMB3 Client does not have a documented native file I/O API. Rather, it make all file I/O available through the Win32 API. This means that all APIs which are implemented using the Win32 API can also be used (for example all C/C++ run-time system function such as fopen(), C++ iostream, etc.). The SMB3 Client supports the following Win32 API functions:
For all of the above Win32 API functions, the ASCII and Unicode versions are supported (e.g., CreateFileA and CreateFileW). The file name syntax to use is: \\Server\Share\[Path\]Filename where Server is either an IP address in decimal dotted notation (example: 123.45.67.8) or a DNS name (example: smb.domain.com) or a NetBIOS name of a server on the local LAN segment (example: MYSERVER). The server name may not exceed 16 characters in length. The length of the share name is limited to 12 characters. The combined server, share, path, and file name may not exceed 260 bytes total length. File names are case sensitive only if the server connected to treats file names case sensitive. For ASCII API functions, the code page applied to file names is determined by calls to SetFileApisToOEM, SetFileApisToANSI, or RTSetFileApisTo. The default is OEM. The Win32 file find functions FindFirstFile and FindNextFile are fully supported to find files and directories. Applications requiring the SMB3 Client must include header file Smb3capi.h and link library Smb3c.lib. The SMB3 Client API is documented in the RTIP-32 Reference Manual. Demo program SMB3Client shows how the SMB3 Client is used. The SMB3 Client is based on the NQE product from Visuality Systems Ltd., ported to On Time RTOS-32. It may not be used under operating systems other than On Time RTOS-32.
|