@zerodensity/smb-cpp 0.0.0-bootstrap.0 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +54 -3
- package/darwin_arm64/libsmb2.1.dylib +0 -0
- package/darwin_arm64/libsmb2.6.1.0.dylib +0 -0
- package/darwin_arm64/libsmb2.dylib +0 -0
- package/darwin_arm64/smb_server_cpp_darwin_arm64 +0 -0
- package/darwin_arm64/third-party/libsmb2/COPYING +24 -0
- package/darwin_arm64/third-party/libsmb2/LICENCE-LGPL-2.1.txt +502 -0
- package/darwin_arm64/third-party/libsmb2/NOTICE.txt +13 -0
- package/darwin_arm64/third-party/libsmb2/README +413 -0
- package/darwin_arm64/third-party/libsmb2/source/CMakeLists.txt +205 -0
- package/darwin_arm64/third-party/libsmb2/source/COPYING +24 -0
- package/darwin_arm64/third-party/libsmb2/source/LICENCE-LGPL-2.1.txt +502 -0
- package/darwin_arm64/third-party/libsmb2/source/Makefile.am +15 -0
- package/darwin_arm64/third-party/libsmb2/source/Makefile.platform +112 -0
- package/darwin_arm64/third-party/libsmb2/source/README +413 -0
- package/darwin_arm64/third-party/libsmb2/source/Xbox/libsmb2.sln +25 -0
- package/darwin_arm64/third-party/libsmb2/source/Xbox/libsmb2.vcxproj +248 -0
- package/darwin_arm64/third-party/libsmb2/source/Xbox/libsmb2.vcxproj.filters +304 -0
- package/darwin_arm64/third-party/libsmb2/source/Xbox 360/libsmb2.sln +32 -0
- package/darwin_arm64/third-party/libsmb2/source/Xbox 360/libsmb2.vcxproj +327 -0
- package/darwin_arm64/third-party/libsmb2/source/Xbox 360/libsmb2.vcxproj.filters +268 -0
- package/darwin_arm64/third-party/libsmb2/source/bootstrap +2 -0
- package/darwin_arm64/third-party/libsmb2/source/cmake/ConfigureChecks.cmake +63 -0
- package/darwin_arm64/third-party/libsmb2/source/cmake/FindSMB2.cmake +37 -0
- package/darwin_arm64/third-party/libsmb2/source/cmake/Modules/FindGSSAPI.cmake +30 -0
- package/darwin_arm64/third-party/libsmb2/source/cmake/Modules/FindLibKrb5.cmake +44 -0
- package/darwin_arm64/third-party/libsmb2/source/cmake/config.h.cmake +126 -0
- package/darwin_arm64/third-party/libsmb2/source/cmake/libsmb2.pc.cmake +14 -0
- package/darwin_arm64/third-party/libsmb2/source/component.mk +5 -0
- package/darwin_arm64/third-party/libsmb2/source/configure.ac +184 -0
- package/darwin_arm64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareAdd.yaml +9 -0
- package/darwin_arm64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareCheck.yaml +4 -0
- package/darwin_arm64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareDel.yaml +5 -0
- package/darwin_arm64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareDelSticky.yaml +5 -0
- package/darwin_arm64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareEnum.yaml +7 -0
- package/darwin_arm64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareGetInfo.yaml +6 -0
- package/darwin_arm64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareSetInfo.yaml +11 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/CMakeLists.txt +28 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/Makefile.am +54 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/dcerpc.c +254 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/picow/CMakeLists.txt +72 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/picow/README.md +2 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/picow/main.cpp +119 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/picow/smb-ls-sync.c +0 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-CMD-FIND.c +335 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-cat-async.c +183 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-cat-sync.c +105 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-ftruncate-sync.c +87 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-ls-async.c +185 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-ls-epoll.c +234 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-lsa-lookupsids.c +292 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-lseek-sync.c +101 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-notify.c +183 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-put-async.c +175 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-put-sync.c +100 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-raw-fsstat-async.c +353 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-raw-getsd-async.c +401 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-raw-stat-async.c +448 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-readlink.c +80 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-rename-sync.c +80 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-server-sync.c +497 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-share-enum-sync.c +146 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-share-enum.c +208 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-share-info.c +255 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-stat-sync.c +103 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-statvfs-sync.c +85 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-truncate-sync.c +78 -0
- package/darwin_arm64/third-party/libsmb2/source/idf_component.yml +5 -0
- package/darwin_arm64/third-party/libsmb2/source/include/Makefile.am +15 -0
- package/darwin_arm64/third-party/libsmb2/source/include/amiga_os/config.h +139 -0
- package/darwin_arm64/third-party/libsmb2/source/include/apple/config.h +139 -0
- package/darwin_arm64/third-party/libsmb2/source/include/asprintf.h +65 -0
- package/darwin_arm64/third-party/libsmb2/source/include/esp/config.h +139 -0
- package/darwin_arm64/third-party/libsmb2/source/include/libsmb2-private.h +670 -0
- package/darwin_arm64/third-party/libsmb2/source/include/module.modulemap +21 -0
- package/darwin_arm64/third-party/libsmb2/source/include/picow/FreeRTOSConfig.h +143 -0
- package/darwin_arm64/third-party/libsmb2/source/include/picow/README.md +2 -0
- package/darwin_arm64/third-party/libsmb2/source/include/picow/config.h +139 -0
- package/darwin_arm64/third-party/libsmb2/source/include/picow/lwipopts.h +27 -0
- package/darwin_arm64/third-party/libsmb2/source/include/picow/lwipopts_examples_common.h +90 -0
- package/darwin_arm64/third-party/libsmb2/source/include/portable-endian.h +377 -0
- package/darwin_arm64/third-party/libsmb2/source/include/ps3/config.h +139 -0
- package/darwin_arm64/third-party/libsmb2/source/include/slist.h +63 -0
- package/darwin_arm64/third-party/libsmb2/source/include/smb2/libsmb2-dcerpc-lsa.h +172 -0
- package/darwin_arm64/third-party/libsmb2/source/include/smb2/libsmb2-dcerpc-srvsvc.h +276 -0
- package/darwin_arm64/third-party/libsmb2/source/include/smb2/libsmb2-dcerpc.h +203 -0
- package/darwin_arm64/third-party/libsmb2/source/include/smb2/libsmb2-raw.h +497 -0
- package/darwin_arm64/third-party/libsmb2/source/include/smb2/libsmb2.h +1409 -0
- package/darwin_arm64/third-party/libsmb2/source/include/smb2/smb2-errors.h +549 -0
- package/darwin_arm64/third-party/libsmb2/source/include/smb2/smb2-ioctl.h +83 -0
- package/darwin_arm64/third-party/libsmb2/source/include/smb2/smb2.h +1251 -0
- package/darwin_arm64/third-party/libsmb2/source/include/xbox/config.h +139 -0
- package/darwin_arm64/third-party/libsmb2/source/include/xbox 360/config.h +139 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/CMakeLists.txt +260 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/Makefile.AMIGA +46 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/Makefile.AMIGA_AROS +59 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/Makefile.AMIGA_OS3 +59 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/Makefile.PS3_PPU +100 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/Makefile.am +85 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/aes.c +33 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/aes.h +29 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/aes128ccm.c +185 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/aes128ccm.h +28 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/aes_apple.c +70 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/aes_apple.h +34 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/aes_reference.c +560 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/aes_reference.h +49 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/alloc.c +154 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/asn1-ber.c +1078 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/asn1-ber.h +161 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/compat.c +599 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/compat.h +829 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/dcerpc-lsa.c +641 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/dcerpc-srvsvc.c +885 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/dcerpc.c +2513 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/dreamcast/vfs.c +328 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/dreamcast/vfs.h +15 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/errors.c +1192 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/hmac-md5.c +84 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/hmac-md5.h +42 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/hmac.c +245 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/init.c +778 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/krb5-wrapper.c +1072 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/krb5-wrapper.h +134 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/libsmb2.c +4292 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/libsmb2.syms +168 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/md4.h +43 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/md4c.c +289 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/md5.c +249 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/md5.h +76 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/ntlmssp.c +1380 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/ntlmssp.h +84 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/pdu.c +1159 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/ps2/TODO +6 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/ps2/imports.lst +84 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/ps2/irx_imports.h +28 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/ps2/ps2smb2.h +35 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/ps2/smb2_fio.c +816 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/ps2/smb2_fio.h +15 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/ps2/smb2man.c +69 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/sha-private.h +28 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/sha.h +334 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/sha1.c +450 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/sha224-256.c +611 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/sha384-512.c +1059 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-close.c +240 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-create.c +508 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-echo.c +202 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-error.c +157 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-flush.c +207 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-ioctl.c +445 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-lock.c +312 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-logoff.c +190 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-negotiate.c +646 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-notify-change.c +278 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-oplock-break.c +543 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-query-directory.c +580 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-query-info.c +753 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-read.c +391 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-session-setup.c +331 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-set-info.c +361 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-tree-connect.c +278 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-tree-disconnect.c +171 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-write.c +319 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-data-file-info.c +537 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-data-filesystem-info.c +384 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-data-reparse-point.c +117 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-data-security-descriptor.c +361 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-share-enum.c +181 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-signing.c +279 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-signing.h +51 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb3-seal.c +165 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb3-seal.h +43 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/socket.c +1502 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/spnego-wrapper.c +634 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/spnego-wrapper.h +74 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/sync.c +988 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/timestamps.c +70 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/unicode.c +307 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/usha.c +345 -0
- package/darwin_arm64/third-party/libsmb2/source/libsmb2.pc.in +14 -0
- package/darwin_arm64/third-party/libsmb2/source/packaging/RPM/libsmb2.spec.in +135 -0
- package/darwin_arm64/third-party/libsmb2/source/packaging/RPM/makerpms.sh +114 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/Makefile.am +34 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/README +28 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/aes128ccm-test.c +119 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/functions.sh +11 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/ld_sockerr.c +58 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/metastat-0202-censored.c +136 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/ntlmssp_generate_blob.c +123 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/prog_cat.c +188 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/prog_cat_cancel.c +203 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/prog_ls.c +189 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/prog_mkdir.c +85 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/prog_rmdir.c +84 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/smb2-dcerpc-coder-test.c +635 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/test_0100_ls_basic.sh +22 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/test_0101_ls_basic_valgrind.sh +23 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/test_0102_ls_basic_socket_error.sh +16 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/test_0103_ls_basic_valgrind_malloc_error.sh +25 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/test_0200_mkdir.sh +15 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/test_0201_mkdir_valgrind.sh +15 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/test_0210_cp_basic.sh +25 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/test_0211_cp_valgrind.sh +26 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/test_0212_cp_valgrind_socket_error.sh +29 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/test_0300_cat_basic.sh +13 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/test_0301_cat_valgrind.sh +13 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/test_0302_cat_valgrind_socket_error.sh +18 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/test_0310_cancel_pdu.sh +13 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/test_0400_overdrawn_0202.sh +25 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/test_900_dcerpc.sh +10 -0
- package/darwin_arm64/third-party/libsmb2/source/utils/Makefile.am +11 -0
- package/darwin_arm64/third-party/libsmb2/source/utils/smb2-cp.c +265 -0
- package/darwin_arm64/third-party/libsmb2/source/utils/smb2-ls.c +135 -0
- package/linux_x64/libsmb2.so +0 -0
- package/linux_x64/libsmb2.so.1 +0 -0
- package/linux_x64/libsmb2.so.6.1.0 +0 -0
- package/linux_x64/smb_server_cpp_linux_x64 +0 -0
- package/linux_x64/third-party/libsmb2/COPYING +24 -0
- package/linux_x64/third-party/libsmb2/LICENCE-LGPL-2.1.txt +502 -0
- package/linux_x64/third-party/libsmb2/NOTICE.txt +13 -0
- package/linux_x64/third-party/libsmb2/README +413 -0
- package/linux_x64/third-party/libsmb2/source/CMakeLists.txt +205 -0
- package/linux_x64/third-party/libsmb2/source/COPYING +24 -0
- package/linux_x64/third-party/libsmb2/source/LICENCE-LGPL-2.1.txt +502 -0
- package/linux_x64/third-party/libsmb2/source/Makefile.am +15 -0
- package/linux_x64/third-party/libsmb2/source/Makefile.platform +112 -0
- package/linux_x64/third-party/libsmb2/source/README +413 -0
- package/linux_x64/third-party/libsmb2/source/Xbox/libsmb2.sln +25 -0
- package/linux_x64/third-party/libsmb2/source/Xbox/libsmb2.vcxproj +248 -0
- package/linux_x64/third-party/libsmb2/source/Xbox/libsmb2.vcxproj.filters +304 -0
- package/linux_x64/third-party/libsmb2/source/Xbox 360/libsmb2.sln +32 -0
- package/linux_x64/third-party/libsmb2/source/Xbox 360/libsmb2.vcxproj +327 -0
- package/linux_x64/third-party/libsmb2/source/Xbox 360/libsmb2.vcxproj.filters +268 -0
- package/linux_x64/third-party/libsmb2/source/bootstrap +2 -0
- package/linux_x64/third-party/libsmb2/source/cmake/ConfigureChecks.cmake +63 -0
- package/linux_x64/third-party/libsmb2/source/cmake/FindSMB2.cmake +37 -0
- package/linux_x64/third-party/libsmb2/source/cmake/Modules/FindGSSAPI.cmake +30 -0
- package/linux_x64/third-party/libsmb2/source/cmake/Modules/FindLibKrb5.cmake +44 -0
- package/linux_x64/third-party/libsmb2/source/cmake/config.h.cmake +126 -0
- package/linux_x64/third-party/libsmb2/source/cmake/libsmb2.pc.cmake +14 -0
- package/linux_x64/third-party/libsmb2/source/component.mk +5 -0
- package/linux_x64/third-party/libsmb2/source/configure.ac +184 -0
- package/linux_x64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareAdd.yaml +9 -0
- package/linux_x64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareCheck.yaml +4 -0
- package/linux_x64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareDel.yaml +5 -0
- package/linux_x64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareDelSticky.yaml +5 -0
- package/linux_x64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareEnum.yaml +7 -0
- package/linux_x64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareGetInfo.yaml +6 -0
- package/linux_x64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareSetInfo.yaml +11 -0
- package/linux_x64/third-party/libsmb2/source/examples/CMakeLists.txt +28 -0
- package/linux_x64/third-party/libsmb2/source/examples/Makefile.am +54 -0
- package/linux_x64/third-party/libsmb2/source/examples/dcerpc.c +254 -0
- package/linux_x64/third-party/libsmb2/source/examples/picow/CMakeLists.txt +72 -0
- package/linux_x64/third-party/libsmb2/source/examples/picow/README.md +2 -0
- package/linux_x64/third-party/libsmb2/source/examples/picow/main.cpp +119 -0
- package/linux_x64/third-party/libsmb2/source/examples/picow/smb-ls-sync.c +0 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-CMD-FIND.c +335 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-cat-async.c +183 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-cat-sync.c +105 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-ftruncate-sync.c +87 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-ls-async.c +185 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-ls-epoll.c +234 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-lsa-lookupsids.c +292 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-lseek-sync.c +101 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-notify.c +183 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-put-async.c +175 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-put-sync.c +100 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-raw-fsstat-async.c +353 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-raw-getsd-async.c +401 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-raw-stat-async.c +448 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-readlink.c +80 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-rename-sync.c +80 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-server-sync.c +497 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-share-enum-sync.c +146 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-share-enum.c +208 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-share-info.c +255 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-stat-sync.c +103 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-statvfs-sync.c +85 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-truncate-sync.c +78 -0
- package/linux_x64/third-party/libsmb2/source/idf_component.yml +5 -0
- package/linux_x64/third-party/libsmb2/source/include/Makefile.am +15 -0
- package/linux_x64/third-party/libsmb2/source/include/amiga_os/config.h +139 -0
- package/linux_x64/third-party/libsmb2/source/include/apple/config.h +139 -0
- package/linux_x64/third-party/libsmb2/source/include/asprintf.h +65 -0
- package/linux_x64/third-party/libsmb2/source/include/esp/config.h +139 -0
- package/linux_x64/third-party/libsmb2/source/include/libsmb2-private.h +670 -0
- package/linux_x64/third-party/libsmb2/source/include/module.modulemap +21 -0
- package/linux_x64/third-party/libsmb2/source/include/picow/FreeRTOSConfig.h +143 -0
- package/linux_x64/third-party/libsmb2/source/include/picow/README.md +2 -0
- package/linux_x64/third-party/libsmb2/source/include/picow/config.h +139 -0
- package/linux_x64/third-party/libsmb2/source/include/picow/lwipopts.h +27 -0
- package/linux_x64/third-party/libsmb2/source/include/picow/lwipopts_examples_common.h +90 -0
- package/linux_x64/third-party/libsmb2/source/include/portable-endian.h +377 -0
- package/linux_x64/third-party/libsmb2/source/include/ps3/config.h +139 -0
- package/linux_x64/third-party/libsmb2/source/include/slist.h +63 -0
- package/linux_x64/third-party/libsmb2/source/include/smb2/libsmb2-dcerpc-lsa.h +172 -0
- package/linux_x64/third-party/libsmb2/source/include/smb2/libsmb2-dcerpc-srvsvc.h +276 -0
- package/linux_x64/third-party/libsmb2/source/include/smb2/libsmb2-dcerpc.h +203 -0
- package/linux_x64/third-party/libsmb2/source/include/smb2/libsmb2-raw.h +497 -0
- package/linux_x64/third-party/libsmb2/source/include/smb2/libsmb2.h +1409 -0
- package/linux_x64/third-party/libsmb2/source/include/smb2/smb2-errors.h +549 -0
- package/linux_x64/third-party/libsmb2/source/include/smb2/smb2-ioctl.h +83 -0
- package/linux_x64/third-party/libsmb2/source/include/smb2/smb2.h +1251 -0
- package/linux_x64/third-party/libsmb2/source/include/xbox/config.h +139 -0
- package/linux_x64/third-party/libsmb2/source/include/xbox 360/config.h +139 -0
- package/linux_x64/third-party/libsmb2/source/lib/CMakeLists.txt +260 -0
- package/linux_x64/third-party/libsmb2/source/lib/Makefile.AMIGA +46 -0
- package/linux_x64/third-party/libsmb2/source/lib/Makefile.AMIGA_AROS +59 -0
- package/linux_x64/third-party/libsmb2/source/lib/Makefile.AMIGA_OS3 +59 -0
- package/linux_x64/third-party/libsmb2/source/lib/Makefile.PS3_PPU +100 -0
- package/linux_x64/third-party/libsmb2/source/lib/Makefile.am +85 -0
- package/linux_x64/third-party/libsmb2/source/lib/aes.c +33 -0
- package/linux_x64/third-party/libsmb2/source/lib/aes.h +29 -0
- package/linux_x64/third-party/libsmb2/source/lib/aes128ccm.c +185 -0
- package/linux_x64/third-party/libsmb2/source/lib/aes128ccm.h +28 -0
- package/linux_x64/third-party/libsmb2/source/lib/aes_apple.c +70 -0
- package/linux_x64/third-party/libsmb2/source/lib/aes_apple.h +34 -0
- package/linux_x64/third-party/libsmb2/source/lib/aes_reference.c +560 -0
- package/linux_x64/third-party/libsmb2/source/lib/aes_reference.h +49 -0
- package/linux_x64/third-party/libsmb2/source/lib/alloc.c +154 -0
- package/linux_x64/third-party/libsmb2/source/lib/asn1-ber.c +1078 -0
- package/linux_x64/third-party/libsmb2/source/lib/asn1-ber.h +161 -0
- package/linux_x64/third-party/libsmb2/source/lib/compat.c +599 -0
- package/linux_x64/third-party/libsmb2/source/lib/compat.h +829 -0
- package/linux_x64/third-party/libsmb2/source/lib/dcerpc-lsa.c +641 -0
- package/linux_x64/third-party/libsmb2/source/lib/dcerpc-srvsvc.c +885 -0
- package/linux_x64/third-party/libsmb2/source/lib/dcerpc.c +2513 -0
- package/linux_x64/third-party/libsmb2/source/lib/dreamcast/vfs.c +328 -0
- package/linux_x64/third-party/libsmb2/source/lib/dreamcast/vfs.h +15 -0
- package/linux_x64/third-party/libsmb2/source/lib/errors.c +1192 -0
- package/linux_x64/third-party/libsmb2/source/lib/hmac-md5.c +84 -0
- package/linux_x64/third-party/libsmb2/source/lib/hmac-md5.h +42 -0
- package/linux_x64/third-party/libsmb2/source/lib/hmac.c +245 -0
- package/linux_x64/third-party/libsmb2/source/lib/init.c +778 -0
- package/linux_x64/third-party/libsmb2/source/lib/krb5-wrapper.c +1072 -0
- package/linux_x64/third-party/libsmb2/source/lib/krb5-wrapper.h +134 -0
- package/linux_x64/third-party/libsmb2/source/lib/libsmb2.c +4292 -0
- package/linux_x64/third-party/libsmb2/source/lib/libsmb2.syms +168 -0
- package/linux_x64/third-party/libsmb2/source/lib/md4.h +43 -0
- package/linux_x64/third-party/libsmb2/source/lib/md4c.c +289 -0
- package/linux_x64/third-party/libsmb2/source/lib/md5.c +249 -0
- package/linux_x64/third-party/libsmb2/source/lib/md5.h +76 -0
- package/linux_x64/third-party/libsmb2/source/lib/ntlmssp.c +1380 -0
- package/linux_x64/third-party/libsmb2/source/lib/ntlmssp.h +84 -0
- package/linux_x64/third-party/libsmb2/source/lib/pdu.c +1159 -0
- package/linux_x64/third-party/libsmb2/source/lib/ps2/TODO +6 -0
- package/linux_x64/third-party/libsmb2/source/lib/ps2/imports.lst +84 -0
- package/linux_x64/third-party/libsmb2/source/lib/ps2/irx_imports.h +28 -0
- package/linux_x64/third-party/libsmb2/source/lib/ps2/ps2smb2.h +35 -0
- package/linux_x64/third-party/libsmb2/source/lib/ps2/smb2_fio.c +816 -0
- package/linux_x64/third-party/libsmb2/source/lib/ps2/smb2_fio.h +15 -0
- package/linux_x64/third-party/libsmb2/source/lib/ps2/smb2man.c +69 -0
- package/linux_x64/third-party/libsmb2/source/lib/sha-private.h +28 -0
- package/linux_x64/third-party/libsmb2/source/lib/sha.h +334 -0
- package/linux_x64/third-party/libsmb2/source/lib/sha1.c +450 -0
- package/linux_x64/third-party/libsmb2/source/lib/sha224-256.c +611 -0
- package/linux_x64/third-party/libsmb2/source/lib/sha384-512.c +1059 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-close.c +240 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-create.c +508 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-echo.c +202 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-error.c +157 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-flush.c +207 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-ioctl.c +445 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-lock.c +312 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-logoff.c +190 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-negotiate.c +646 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-notify-change.c +278 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-oplock-break.c +543 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-query-directory.c +580 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-query-info.c +753 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-read.c +391 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-session-setup.c +331 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-set-info.c +361 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-tree-connect.c +278 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-tree-disconnect.c +171 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-write.c +319 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-data-file-info.c +537 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-data-filesystem-info.c +384 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-data-reparse-point.c +117 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-data-security-descriptor.c +361 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-share-enum.c +181 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-signing.c +279 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-signing.h +51 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb3-seal.c +165 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb3-seal.h +43 -0
- package/linux_x64/third-party/libsmb2/source/lib/socket.c +1502 -0
- package/linux_x64/third-party/libsmb2/source/lib/spnego-wrapper.c +634 -0
- package/linux_x64/third-party/libsmb2/source/lib/spnego-wrapper.h +74 -0
- package/linux_x64/third-party/libsmb2/source/lib/sync.c +988 -0
- package/linux_x64/third-party/libsmb2/source/lib/timestamps.c +70 -0
- package/linux_x64/third-party/libsmb2/source/lib/unicode.c +307 -0
- package/linux_x64/third-party/libsmb2/source/lib/usha.c +345 -0
- package/linux_x64/third-party/libsmb2/source/libsmb2.pc.in +14 -0
- package/linux_x64/third-party/libsmb2/source/packaging/RPM/libsmb2.spec.in +135 -0
- package/linux_x64/third-party/libsmb2/source/packaging/RPM/makerpms.sh +114 -0
- package/linux_x64/third-party/libsmb2/source/tests/Makefile.am +34 -0
- package/linux_x64/third-party/libsmb2/source/tests/README +28 -0
- package/linux_x64/third-party/libsmb2/source/tests/aes128ccm-test.c +119 -0
- package/linux_x64/third-party/libsmb2/source/tests/functions.sh +11 -0
- package/linux_x64/third-party/libsmb2/source/tests/ld_sockerr.c +58 -0
- package/linux_x64/third-party/libsmb2/source/tests/metastat-0202-censored.c +136 -0
- package/linux_x64/third-party/libsmb2/source/tests/ntlmssp_generate_blob.c +123 -0
- package/linux_x64/third-party/libsmb2/source/tests/prog_cat.c +188 -0
- package/linux_x64/third-party/libsmb2/source/tests/prog_cat_cancel.c +203 -0
- package/linux_x64/third-party/libsmb2/source/tests/prog_ls.c +189 -0
- package/linux_x64/third-party/libsmb2/source/tests/prog_mkdir.c +85 -0
- package/linux_x64/third-party/libsmb2/source/tests/prog_rmdir.c +84 -0
- package/linux_x64/third-party/libsmb2/source/tests/smb2-dcerpc-coder-test.c +635 -0
- package/linux_x64/third-party/libsmb2/source/tests/test_0100_ls_basic.sh +22 -0
- package/linux_x64/third-party/libsmb2/source/tests/test_0101_ls_basic_valgrind.sh +23 -0
- package/linux_x64/third-party/libsmb2/source/tests/test_0102_ls_basic_socket_error.sh +16 -0
- package/linux_x64/third-party/libsmb2/source/tests/test_0103_ls_basic_valgrind_malloc_error.sh +25 -0
- package/linux_x64/third-party/libsmb2/source/tests/test_0200_mkdir.sh +15 -0
- package/linux_x64/third-party/libsmb2/source/tests/test_0201_mkdir_valgrind.sh +15 -0
- package/linux_x64/third-party/libsmb2/source/tests/test_0210_cp_basic.sh +25 -0
- package/linux_x64/third-party/libsmb2/source/tests/test_0211_cp_valgrind.sh +26 -0
- package/linux_x64/third-party/libsmb2/source/tests/test_0212_cp_valgrind_socket_error.sh +29 -0
- package/linux_x64/third-party/libsmb2/source/tests/test_0300_cat_basic.sh +13 -0
- package/linux_x64/third-party/libsmb2/source/tests/test_0301_cat_valgrind.sh +13 -0
- package/linux_x64/third-party/libsmb2/source/tests/test_0302_cat_valgrind_socket_error.sh +18 -0
- package/linux_x64/third-party/libsmb2/source/tests/test_0310_cancel_pdu.sh +13 -0
- package/linux_x64/third-party/libsmb2/source/tests/test_0400_overdrawn_0202.sh +25 -0
- package/linux_x64/third-party/libsmb2/source/tests/test_900_dcerpc.sh +10 -0
- package/linux_x64/third-party/libsmb2/source/utils/Makefile.am +11 -0
- package/linux_x64/third-party/libsmb2/source/utils/smb2-cp.c +265 -0
- package/linux_x64/third-party/libsmb2/source/utils/smb2-ls.c +135 -0
- package/package.json +10 -4
- package/smb2.proto +164 -0
- package/win32_x64/smb2.dll +0 -0
- package/win32_x64/smb_server_cpp_win32_x64.exe +0 -0
- package/win32_x64/third-party/libsmb2/COPYING +24 -0
- package/win32_x64/third-party/libsmb2/LICENCE-LGPL-2.1.txt +502 -0
- package/win32_x64/third-party/libsmb2/NOTICE.txt +13 -0
- package/win32_x64/third-party/libsmb2/README +413 -0
- package/win32_x64/third-party/libsmb2/source/CMakeLists.txt +205 -0
- package/win32_x64/third-party/libsmb2/source/COPYING +24 -0
- package/win32_x64/third-party/libsmb2/source/LICENCE-LGPL-2.1.txt +502 -0
- package/win32_x64/third-party/libsmb2/source/Makefile.am +15 -0
- package/win32_x64/third-party/libsmb2/source/Makefile.platform +112 -0
- package/win32_x64/third-party/libsmb2/source/README +413 -0
- package/win32_x64/third-party/libsmb2/source/Xbox/libsmb2.sln +25 -0
- package/win32_x64/third-party/libsmb2/source/Xbox/libsmb2.vcxproj +248 -0
- package/win32_x64/third-party/libsmb2/source/Xbox/libsmb2.vcxproj.filters +304 -0
- package/win32_x64/third-party/libsmb2/source/Xbox 360/libsmb2.sln +32 -0
- package/win32_x64/third-party/libsmb2/source/Xbox 360/libsmb2.vcxproj +327 -0
- package/win32_x64/third-party/libsmb2/source/Xbox 360/libsmb2.vcxproj.filters +268 -0
- package/win32_x64/third-party/libsmb2/source/bootstrap +2 -0
- package/win32_x64/third-party/libsmb2/source/cmake/ConfigureChecks.cmake +63 -0
- package/win32_x64/third-party/libsmb2/source/cmake/FindSMB2.cmake +37 -0
- package/win32_x64/third-party/libsmb2/source/cmake/Modules/FindGSSAPI.cmake +30 -0
- package/win32_x64/third-party/libsmb2/source/cmake/Modules/FindLibKrb5.cmake +44 -0
- package/win32_x64/third-party/libsmb2/source/cmake/config.h.cmake +126 -0
- package/win32_x64/third-party/libsmb2/source/cmake/libsmb2.pc.cmake +14 -0
- package/win32_x64/third-party/libsmb2/source/component.mk +5 -0
- package/win32_x64/third-party/libsmb2/source/configure.ac +184 -0
- package/win32_x64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareAdd.yaml +9 -0
- package/win32_x64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareCheck.yaml +4 -0
- package/win32_x64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareDel.yaml +5 -0
- package/win32_x64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareDelSticky.yaml +5 -0
- package/win32_x64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareEnum.yaml +7 -0
- package/win32_x64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareGetInfo.yaml +6 -0
- package/win32_x64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareSetInfo.yaml +11 -0
- package/win32_x64/third-party/libsmb2/source/examples/CMakeLists.txt +28 -0
- package/win32_x64/third-party/libsmb2/source/examples/Makefile.am +54 -0
- package/win32_x64/third-party/libsmb2/source/examples/dcerpc.c +254 -0
- package/win32_x64/third-party/libsmb2/source/examples/picow/CMakeLists.txt +72 -0
- package/win32_x64/third-party/libsmb2/source/examples/picow/README.md +2 -0
- package/win32_x64/third-party/libsmb2/source/examples/picow/main.cpp +119 -0
- package/win32_x64/third-party/libsmb2/source/examples/picow/smb-ls-sync.c +0 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-CMD-FIND.c +335 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-cat-async.c +183 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-cat-sync.c +105 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-ftruncate-sync.c +87 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-ls-async.c +185 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-ls-epoll.c +234 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-lsa-lookupsids.c +292 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-lseek-sync.c +101 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-notify.c +183 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-put-async.c +175 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-put-sync.c +100 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-raw-fsstat-async.c +353 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-raw-getsd-async.c +401 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-raw-stat-async.c +448 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-readlink.c +80 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-rename-sync.c +80 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-server-sync.c +497 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-share-enum-sync.c +146 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-share-enum.c +208 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-share-info.c +255 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-stat-sync.c +103 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-statvfs-sync.c +85 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-truncate-sync.c +78 -0
- package/win32_x64/third-party/libsmb2/source/idf_component.yml +5 -0
- package/win32_x64/third-party/libsmb2/source/include/Makefile.am +15 -0
- package/win32_x64/third-party/libsmb2/source/include/amiga_os/config.h +139 -0
- package/win32_x64/third-party/libsmb2/source/include/apple/config.h +139 -0
- package/win32_x64/third-party/libsmb2/source/include/asprintf.h +65 -0
- package/win32_x64/third-party/libsmb2/source/include/esp/config.h +139 -0
- package/win32_x64/third-party/libsmb2/source/include/libsmb2-private.h +670 -0
- package/win32_x64/third-party/libsmb2/source/include/module.modulemap +21 -0
- package/win32_x64/third-party/libsmb2/source/include/picow/FreeRTOSConfig.h +143 -0
- package/win32_x64/third-party/libsmb2/source/include/picow/README.md +2 -0
- package/win32_x64/third-party/libsmb2/source/include/picow/config.h +139 -0
- package/win32_x64/third-party/libsmb2/source/include/picow/lwipopts.h +27 -0
- package/win32_x64/third-party/libsmb2/source/include/picow/lwipopts_examples_common.h +90 -0
- package/win32_x64/third-party/libsmb2/source/include/portable-endian.h +377 -0
- package/win32_x64/third-party/libsmb2/source/include/ps3/config.h +139 -0
- package/win32_x64/third-party/libsmb2/source/include/slist.h +63 -0
- package/win32_x64/third-party/libsmb2/source/include/smb2/libsmb2-dcerpc-lsa.h +172 -0
- package/win32_x64/third-party/libsmb2/source/include/smb2/libsmb2-dcerpc-srvsvc.h +276 -0
- package/win32_x64/third-party/libsmb2/source/include/smb2/libsmb2-dcerpc.h +203 -0
- package/win32_x64/third-party/libsmb2/source/include/smb2/libsmb2-raw.h +497 -0
- package/win32_x64/third-party/libsmb2/source/include/smb2/libsmb2.h +1409 -0
- package/win32_x64/third-party/libsmb2/source/include/smb2/smb2-errors.h +549 -0
- package/win32_x64/third-party/libsmb2/source/include/smb2/smb2-ioctl.h +83 -0
- package/win32_x64/third-party/libsmb2/source/include/smb2/smb2.h +1251 -0
- package/win32_x64/third-party/libsmb2/source/include/xbox/config.h +139 -0
- package/win32_x64/third-party/libsmb2/source/include/xbox 360/config.h +139 -0
- package/win32_x64/third-party/libsmb2/source/lib/CMakeLists.txt +260 -0
- package/win32_x64/third-party/libsmb2/source/lib/Makefile.AMIGA +46 -0
- package/win32_x64/third-party/libsmb2/source/lib/Makefile.AMIGA_AROS +59 -0
- package/win32_x64/third-party/libsmb2/source/lib/Makefile.AMIGA_OS3 +59 -0
- package/win32_x64/third-party/libsmb2/source/lib/Makefile.PS3_PPU +100 -0
- package/win32_x64/third-party/libsmb2/source/lib/Makefile.am +85 -0
- package/win32_x64/third-party/libsmb2/source/lib/aes.c +33 -0
- package/win32_x64/third-party/libsmb2/source/lib/aes.h +29 -0
- package/win32_x64/third-party/libsmb2/source/lib/aes128ccm.c +185 -0
- package/win32_x64/third-party/libsmb2/source/lib/aes128ccm.h +28 -0
- package/win32_x64/third-party/libsmb2/source/lib/aes_apple.c +70 -0
- package/win32_x64/third-party/libsmb2/source/lib/aes_apple.h +34 -0
- package/win32_x64/third-party/libsmb2/source/lib/aes_reference.c +560 -0
- package/win32_x64/third-party/libsmb2/source/lib/aes_reference.h +49 -0
- package/win32_x64/third-party/libsmb2/source/lib/alloc.c +154 -0
- package/win32_x64/third-party/libsmb2/source/lib/asn1-ber.c +1078 -0
- package/win32_x64/third-party/libsmb2/source/lib/asn1-ber.h +161 -0
- package/win32_x64/third-party/libsmb2/source/lib/compat.c +599 -0
- package/win32_x64/third-party/libsmb2/source/lib/compat.h +829 -0
- package/win32_x64/third-party/libsmb2/source/lib/dcerpc-lsa.c +641 -0
- package/win32_x64/third-party/libsmb2/source/lib/dcerpc-srvsvc.c +885 -0
- package/win32_x64/third-party/libsmb2/source/lib/dcerpc.c +2513 -0
- package/win32_x64/third-party/libsmb2/source/lib/dreamcast/vfs.c +328 -0
- package/win32_x64/third-party/libsmb2/source/lib/dreamcast/vfs.h +15 -0
- package/win32_x64/third-party/libsmb2/source/lib/errors.c +1192 -0
- package/win32_x64/third-party/libsmb2/source/lib/hmac-md5.c +84 -0
- package/win32_x64/third-party/libsmb2/source/lib/hmac-md5.h +42 -0
- package/win32_x64/third-party/libsmb2/source/lib/hmac.c +245 -0
- package/win32_x64/third-party/libsmb2/source/lib/init.c +778 -0
- package/win32_x64/third-party/libsmb2/source/lib/krb5-wrapper.c +1072 -0
- package/win32_x64/third-party/libsmb2/source/lib/krb5-wrapper.h +134 -0
- package/win32_x64/third-party/libsmb2/source/lib/libsmb2.c +4292 -0
- package/win32_x64/third-party/libsmb2/source/lib/libsmb2.syms +168 -0
- package/win32_x64/third-party/libsmb2/source/lib/md4.h +43 -0
- package/win32_x64/third-party/libsmb2/source/lib/md4c.c +289 -0
- package/win32_x64/third-party/libsmb2/source/lib/md5.c +249 -0
- package/win32_x64/third-party/libsmb2/source/lib/md5.h +76 -0
- package/win32_x64/third-party/libsmb2/source/lib/ntlmssp.c +1380 -0
- package/win32_x64/third-party/libsmb2/source/lib/ntlmssp.h +84 -0
- package/win32_x64/third-party/libsmb2/source/lib/pdu.c +1159 -0
- package/win32_x64/third-party/libsmb2/source/lib/ps2/TODO +6 -0
- package/win32_x64/third-party/libsmb2/source/lib/ps2/imports.lst +84 -0
- package/win32_x64/third-party/libsmb2/source/lib/ps2/irx_imports.h +28 -0
- package/win32_x64/third-party/libsmb2/source/lib/ps2/ps2smb2.h +35 -0
- package/win32_x64/third-party/libsmb2/source/lib/ps2/smb2_fio.c +816 -0
- package/win32_x64/third-party/libsmb2/source/lib/ps2/smb2_fio.h +15 -0
- package/win32_x64/third-party/libsmb2/source/lib/ps2/smb2man.c +69 -0
- package/win32_x64/third-party/libsmb2/source/lib/sha-private.h +28 -0
- package/win32_x64/third-party/libsmb2/source/lib/sha.h +334 -0
- package/win32_x64/third-party/libsmb2/source/lib/sha1.c +450 -0
- package/win32_x64/third-party/libsmb2/source/lib/sha224-256.c +611 -0
- package/win32_x64/third-party/libsmb2/source/lib/sha384-512.c +1059 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-close.c +240 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-create.c +508 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-echo.c +202 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-error.c +157 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-flush.c +207 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-ioctl.c +445 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-lock.c +312 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-logoff.c +190 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-negotiate.c +646 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-notify-change.c +278 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-oplock-break.c +543 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-query-directory.c +580 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-query-info.c +753 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-read.c +391 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-session-setup.c +331 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-set-info.c +361 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-tree-connect.c +278 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-tree-disconnect.c +171 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-write.c +319 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-data-file-info.c +537 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-data-filesystem-info.c +384 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-data-reparse-point.c +117 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-data-security-descriptor.c +361 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-share-enum.c +181 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-signing.c +279 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-signing.h +51 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb3-seal.c +165 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb3-seal.h +43 -0
- package/win32_x64/third-party/libsmb2/source/lib/socket.c +1502 -0
- package/win32_x64/third-party/libsmb2/source/lib/spnego-wrapper.c +634 -0
- package/win32_x64/third-party/libsmb2/source/lib/spnego-wrapper.h +74 -0
- package/win32_x64/third-party/libsmb2/source/lib/sync.c +988 -0
- package/win32_x64/third-party/libsmb2/source/lib/timestamps.c +70 -0
- package/win32_x64/third-party/libsmb2/source/lib/unicode.c +307 -0
- package/win32_x64/third-party/libsmb2/source/lib/usha.c +345 -0
- package/win32_x64/third-party/libsmb2/source/libsmb2.pc.in +14 -0
- package/win32_x64/third-party/libsmb2/source/packaging/RPM/libsmb2.spec.in +135 -0
- package/win32_x64/third-party/libsmb2/source/packaging/RPM/makerpms.sh +114 -0
- package/win32_x64/third-party/libsmb2/source/tests/Makefile.am +34 -0
- package/win32_x64/third-party/libsmb2/source/tests/README +28 -0
- package/win32_x64/third-party/libsmb2/source/tests/aes128ccm-test.c +119 -0
- package/win32_x64/third-party/libsmb2/source/tests/functions.sh +11 -0
- package/win32_x64/third-party/libsmb2/source/tests/ld_sockerr.c +58 -0
- package/win32_x64/third-party/libsmb2/source/tests/metastat-0202-censored.c +136 -0
- package/win32_x64/third-party/libsmb2/source/tests/ntlmssp_generate_blob.c +123 -0
- package/win32_x64/third-party/libsmb2/source/tests/prog_cat.c +188 -0
- package/win32_x64/third-party/libsmb2/source/tests/prog_cat_cancel.c +203 -0
- package/win32_x64/third-party/libsmb2/source/tests/prog_ls.c +189 -0
- package/win32_x64/third-party/libsmb2/source/tests/prog_mkdir.c +85 -0
- package/win32_x64/third-party/libsmb2/source/tests/prog_rmdir.c +84 -0
- package/win32_x64/third-party/libsmb2/source/tests/smb2-dcerpc-coder-test.c +635 -0
- package/win32_x64/third-party/libsmb2/source/tests/test_0100_ls_basic.sh +22 -0
- package/win32_x64/third-party/libsmb2/source/tests/test_0101_ls_basic_valgrind.sh +23 -0
- package/win32_x64/third-party/libsmb2/source/tests/test_0102_ls_basic_socket_error.sh +16 -0
- package/win32_x64/third-party/libsmb2/source/tests/test_0103_ls_basic_valgrind_malloc_error.sh +25 -0
- package/win32_x64/third-party/libsmb2/source/tests/test_0200_mkdir.sh +15 -0
- package/win32_x64/third-party/libsmb2/source/tests/test_0201_mkdir_valgrind.sh +15 -0
- package/win32_x64/third-party/libsmb2/source/tests/test_0210_cp_basic.sh +25 -0
- package/win32_x64/third-party/libsmb2/source/tests/test_0211_cp_valgrind.sh +26 -0
- package/win32_x64/third-party/libsmb2/source/tests/test_0212_cp_valgrind_socket_error.sh +29 -0
- package/win32_x64/third-party/libsmb2/source/tests/test_0300_cat_basic.sh +13 -0
- package/win32_x64/third-party/libsmb2/source/tests/test_0301_cat_valgrind.sh +13 -0
- package/win32_x64/third-party/libsmb2/source/tests/test_0302_cat_valgrind_socket_error.sh +18 -0
- package/win32_x64/third-party/libsmb2/source/tests/test_0310_cancel_pdu.sh +13 -0
- package/win32_x64/third-party/libsmb2/source/tests/test_0400_overdrawn_0202.sh +25 -0
- package/win32_x64/third-party/libsmb2/source/tests/test_900_dcerpc.sh +10 -0
- package/win32_x64/third-party/libsmb2/source/utils/Makefile.am +11 -0
- package/win32_x64/third-party/libsmb2/source/utils/smb2-cp.c +265 -0
- package/win32_x64/third-party/libsmb2/source/utils/smb2-ls.c +135 -0
|
@@ -0,0 +1,1409 @@
|
|
|
1
|
+
/* -*- mode:c; tab-width:8; c-basic-offset:8; indent-tabs-mode:nil; -*- */
|
|
2
|
+
/*
|
|
3
|
+
Copyright (C) 2016 by Ronnie Sahlberg <ronniesahlberg@gmail.com>
|
|
4
|
+
|
|
5
|
+
This program is free software; you can redistribute it and/or modify
|
|
6
|
+
it under the terms of the GNU Lesser General Public License as published by
|
|
7
|
+
the Free Software Foundation; either version 2.1 of the License, or
|
|
8
|
+
(at your option) any later version.
|
|
9
|
+
|
|
10
|
+
This program is distributed in the hope that it will be useful,
|
|
11
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
GNU Lesser General Public License for more details.
|
|
14
|
+
|
|
15
|
+
You should have received a copy of the GNU Lesser General Public License
|
|
16
|
+
along with this program; if not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
#ifndef _LIBSMB2_H_
|
|
20
|
+
#define _LIBSMB2_H_
|
|
21
|
+
|
|
22
|
+
#ifdef __cplusplus
|
|
23
|
+
extern "C" {
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
#define LIBSMB2_SHARE_ENUM_V2 1
|
|
27
|
+
|
|
28
|
+
struct smb2_iovec {
|
|
29
|
+
uint8_t *buf;
|
|
30
|
+
size_t len;
|
|
31
|
+
void (*free)(void *);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
struct smb2_context;
|
|
35
|
+
|
|
36
|
+
/*
|
|
37
|
+
* Generic callback for completion of smb2_*_async().
|
|
38
|
+
* command_data depends on status.
|
|
39
|
+
*/
|
|
40
|
+
typedef void (*smb2_command_cb)(struct smb2_context *smb2, int status,
|
|
41
|
+
void *command_data, void *cb_data);
|
|
42
|
+
|
|
43
|
+
/*
|
|
44
|
+
* callback for getting error information when errors are set
|
|
45
|
+
* command_data depends on status.
|
|
46
|
+
*/
|
|
47
|
+
typedef void (*smb2_error_cb)(struct smb2_context *smb2,
|
|
48
|
+
const char *error_string);
|
|
49
|
+
|
|
50
|
+
/*
|
|
51
|
+
* callback for server accepting a new connection
|
|
52
|
+
*/
|
|
53
|
+
typedef int (*smb2_accepted_cb)(const int fd, void *cb_data);
|
|
54
|
+
|
|
55
|
+
/*
|
|
56
|
+
* callback when a new connection is made to setup context
|
|
57
|
+
*/
|
|
58
|
+
typedef void (*smb2_client_connection)(struct smb2_context *smb2, void *cb_data);
|
|
59
|
+
|
|
60
|
+
/*
|
|
61
|
+
* callback when a server notifies of an oplock or lease break
|
|
62
|
+
* the type of break is determined from the stuct_size in the request
|
|
63
|
+
* (notification) passed in. the app can set the new oplock level
|
|
64
|
+
* or new lease state for the acknowledgement that will be sent back
|
|
65
|
+
*/
|
|
66
|
+
struct smb2_oplock_or_lease_break_reply;
|
|
67
|
+
|
|
68
|
+
typedef void (*smb2_oplock_or_lease_break_cb)(struct smb2_context *smb2,
|
|
69
|
+
int status,
|
|
70
|
+
struct smb2_oplock_or_lease_break_reply *rep,
|
|
71
|
+
uint8_t *new_oplock_level,
|
|
72
|
+
uint32_t *new_lease_state);
|
|
73
|
+
|
|
74
|
+
/* Stat structure */
|
|
75
|
+
#define SMB2_TYPE_FILE 0x00000000
|
|
76
|
+
#define SMB2_TYPE_DIRECTORY 0x00000001
|
|
77
|
+
#define SMB2_TYPE_LINK 0x00000002
|
|
78
|
+
struct smb2_stat_64 {
|
|
79
|
+
uint32_t smb2_type;
|
|
80
|
+
uint32_t smb2_nlink;
|
|
81
|
+
uint64_t smb2_ino;
|
|
82
|
+
uint64_t smb2_size;
|
|
83
|
+
uint64_t smb2_atime;
|
|
84
|
+
uint64_t smb2_atime_nsec;
|
|
85
|
+
uint64_t smb2_mtime;
|
|
86
|
+
uint64_t smb2_mtime_nsec;
|
|
87
|
+
uint64_t smb2_ctime;
|
|
88
|
+
uint64_t smb2_ctime_nsec;
|
|
89
|
+
uint64_t smb2_btime;
|
|
90
|
+
uint64_t smb2_btime_nsec;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
struct smb2_statvfs {
|
|
94
|
+
uint32_t f_bsize;
|
|
95
|
+
uint32_t f_frsize;
|
|
96
|
+
uint64_t f_blocks;
|
|
97
|
+
uint64_t f_bfree;
|
|
98
|
+
uint64_t f_bavail;
|
|
99
|
+
uint32_t f_files;
|
|
100
|
+
uint32_t f_ffree;
|
|
101
|
+
uint32_t f_favail;
|
|
102
|
+
uint32_t f_fsid;
|
|
103
|
+
uint32_t f_flag;
|
|
104
|
+
uint32_t f_namemax;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
struct smb2dirent {
|
|
108
|
+
const char *name;
|
|
109
|
+
struct smb2_stat_64 st;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
#if defined(_WINDOWS)
|
|
113
|
+
#ifdef __USE_WINSOCK__
|
|
114
|
+
#include <winsock.h>
|
|
115
|
+
#else
|
|
116
|
+
#include <ws2tcpip.h>
|
|
117
|
+
#include <winsock2.h>
|
|
118
|
+
#endif
|
|
119
|
+
#elif defined(_XBOX)
|
|
120
|
+
#include <xtl.h>
|
|
121
|
+
#include <winsockx.h>
|
|
122
|
+
#endif
|
|
123
|
+
|
|
124
|
+
#if defined(_WINDOWS) || defined(_XBOX)
|
|
125
|
+
typedef SOCKET t_socket;
|
|
126
|
+
#else
|
|
127
|
+
#ifndef T_SOCKET_DEFINED
|
|
128
|
+
#define T_SOCKET_DEFINED
|
|
129
|
+
typedef int t_socket;
|
|
130
|
+
#endif
|
|
131
|
+
#endif
|
|
132
|
+
|
|
133
|
+
/*
|
|
134
|
+
* Create an SMB2 context.
|
|
135
|
+
* Function returns
|
|
136
|
+
* NULL : Failed to create a context.
|
|
137
|
+
* *smb2 : A pointer to an smb2 context.
|
|
138
|
+
*/
|
|
139
|
+
struct smb2_context *smb2_init_context(void);
|
|
140
|
+
|
|
141
|
+
/*
|
|
142
|
+
* Close an SMB2 context
|
|
143
|
+
*
|
|
144
|
+
* closes socket if open, and clears keys but leave
|
|
145
|
+
* context allocated. the context will be destroyed
|
|
146
|
+
* at a time later when it won't be in-use
|
|
147
|
+
*/
|
|
148
|
+
void smb2_close_context(struct smb2_context *smb2);
|
|
149
|
+
|
|
150
|
+
/*
|
|
151
|
+
* Destroy an smb2 context.
|
|
152
|
+
*
|
|
153
|
+
* Any open "struct smb2fh" will automatically be freed. You can not reference
|
|
154
|
+
* any "struct smb2fh" after the context is destroyed.
|
|
155
|
+
* Any open "struct smb2dir" will automatically be freed. You can not reference
|
|
156
|
+
* any "struct smb2dir" after the context is destroyed.
|
|
157
|
+
* Any pending async commands will be aborted with -ECONNRESET.
|
|
158
|
+
*/
|
|
159
|
+
void smb2_destroy_context(struct smb2_context *smb2);
|
|
160
|
+
|
|
161
|
+
/*
|
|
162
|
+
* Get the list of currently allocated contexts
|
|
163
|
+
*/
|
|
164
|
+
struct smb2_context *smb2_active_contexts(void);
|
|
165
|
+
|
|
166
|
+
/*
|
|
167
|
+
* Determine of the context is currently active. This lets
|
|
168
|
+
* code know if the context was destroyed in a callback for example
|
|
169
|
+
*/
|
|
170
|
+
int smb2_context_active(struct smb2_context *smb2);
|
|
171
|
+
|
|
172
|
+
/*
|
|
173
|
+
* EVENT SYSTEM INTEGRATION
|
|
174
|
+
* ========================
|
|
175
|
+
* The following functions are used to integrate libsmb2 in an event
|
|
176
|
+
* system.
|
|
177
|
+
*
|
|
178
|
+
* The simplest way is by using smb2_get_fd() and smb2_which_events()
|
|
179
|
+
* in every loop of the event system to detect which fd to use (it can change)
|
|
180
|
+
* and which events should be waited for.
|
|
181
|
+
* This is very simple to use but has the drawback of the overhead having to
|
|
182
|
+
* call these two functions for every loop.
|
|
183
|
+
*
|
|
184
|
+
* This is suitable for trivial apps where you roll your event system
|
|
185
|
+
* using select() or poll().
|
|
186
|
+
*
|
|
187
|
+
* See for example smb2-cat-async.c for an example on how to use these
|
|
188
|
+
* two functions in an event loop.
|
|
189
|
+
*/
|
|
190
|
+
/*
|
|
191
|
+
* Returns the file descriptor that libsmb2 uses.
|
|
192
|
+
*/
|
|
193
|
+
t_socket smb2_get_fd(struct smb2_context *smb2);
|
|
194
|
+
/*
|
|
195
|
+
* Returns which events that we need to poll for for the smb2 file descriptor.
|
|
196
|
+
*/
|
|
197
|
+
int smb2_which_events(struct smb2_context *smb2);
|
|
198
|
+
|
|
199
|
+
/*
|
|
200
|
+
* Returns file descriptors that libsmb2 use or is trying to connect to
|
|
201
|
+
*
|
|
202
|
+
* This function should be used when trying to connect with more than one
|
|
203
|
+
* addresses in parallel, cf. rfc8305: Happy Eyeballs.
|
|
204
|
+
*
|
|
205
|
+
* The timeout, in ms, is valid during the socket connection step. The caller
|
|
206
|
+
* should call smb2_service_fd() with fd = -1 when the timeout is reached.
|
|
207
|
+
* This will trigger a new socket connection on the next resolved address. All
|
|
208
|
+
* connecting fds will be closed when the first fd is connected. The timeout
|
|
209
|
+
* will be -1 (infinite) once connected or if there is no next addresses to
|
|
210
|
+
* connect to.
|
|
211
|
+
*/
|
|
212
|
+
const t_socket *
|
|
213
|
+
smb2_get_fds(struct smb2_context *smb2, size_t *fd_count, int *timeout);
|
|
214
|
+
|
|
215
|
+
/*
|
|
216
|
+
* A much more scalable way to use smb2_fd_event_callbacks() to register
|
|
217
|
+
* callbacks for libsmb2 to call anytime a filedescriptor is changed or when
|
|
218
|
+
* the events we are waiting for changes.
|
|
219
|
+
* This way libsmb2 will do callbacks back into the application to inform
|
|
220
|
+
* when fd or events change.
|
|
221
|
+
*
|
|
222
|
+
* This is suitable when you want to plug libsmb2 into a more sophisticated
|
|
223
|
+
* eventsystem or if you use epoll() or similar.
|
|
224
|
+
*
|
|
225
|
+
* See for smb2-ls-async.c for a trivial example of using these callbacks.
|
|
226
|
+
*/
|
|
227
|
+
#define SMB2_ADD_FD 0
|
|
228
|
+
#define SMB2_DEL_FD 1
|
|
229
|
+
typedef void (*smb2_change_fd_cb)(struct smb2_context *smb2, t_socket fd, int cmd);
|
|
230
|
+
typedef void (*smb2_change_events_cb)(struct smb2_context *smb2, t_socket fd,
|
|
231
|
+
int events);
|
|
232
|
+
void smb2_fd_event_callbacks(struct smb2_context *smb2,
|
|
233
|
+
smb2_change_fd_cb change_fd,
|
|
234
|
+
smb2_change_events_cb change_events);
|
|
235
|
+
|
|
236
|
+
/*
|
|
237
|
+
* Called to process the events when events become available for the smb2
|
|
238
|
+
* file descriptor.
|
|
239
|
+
*
|
|
240
|
+
* Returns:
|
|
241
|
+
* 0 : Success
|
|
242
|
+
* <0 : Unrecoverable failure. At this point the context can no longer be
|
|
243
|
+
* used and must be freed by calling smb2_destroy_context().
|
|
244
|
+
*
|
|
245
|
+
*/
|
|
246
|
+
int smb2_service(struct smb2_context *smb2, int revents);
|
|
247
|
+
|
|
248
|
+
/*
|
|
249
|
+
* Called to process the events when events become available for the smb2
|
|
250
|
+
* file descriptor.
|
|
251
|
+
*
|
|
252
|
+
* Behave like smb2_service() with some differences:
|
|
253
|
+
* - must be called with a fd returned by smb2_get_fd() or smb2_get_fds(),
|
|
254
|
+
* - passing -1 as fd will trigger a new connection attempt on the next
|
|
255
|
+
* resolved address, cf. smb2_get_fds().
|
|
256
|
+
*
|
|
257
|
+
* Returns:
|
|
258
|
+
* 0 : Success
|
|
259
|
+
* <0 : Unrecoverable failure. At this point the context can no longer be
|
|
260
|
+
* used and must be freed by calling smb2_destroy_context().
|
|
261
|
+
*
|
|
262
|
+
*/
|
|
263
|
+
int smb2_service_fd(struct smb2_context *smb2, t_socket fd, int revents);
|
|
264
|
+
|
|
265
|
+
/*
|
|
266
|
+
* Set the timeout in seconds after which a command will be aborted with
|
|
267
|
+
* SMB2_STATUS_IO_TIMEOUT.
|
|
268
|
+
* If you use timeouts with the async API you must make sure to call
|
|
269
|
+
* smb2_service() at least once every second.
|
|
270
|
+
*
|
|
271
|
+
* Default is 0: No timeout.
|
|
272
|
+
*/
|
|
273
|
+
void smb2_set_timeout(struct smb2_context *smb2, int seconds);
|
|
274
|
+
|
|
275
|
+
/*
|
|
276
|
+
* Set passthrough-enable. Passthrough allows command packers
|
|
277
|
+
* and unpackers to keep the extra data on complex commands
|
|
278
|
+
* in its on-the-wire format without any interpretation. this
|
|
279
|
+
* is useful for proxy use cases where there might be no need
|
|
280
|
+
* to fully parse things like query-info replies or ioctl
|
|
281
|
+
* requests. If passthrough is not set, any command that
|
|
282
|
+
* that is processed that can't interpret the data will fail
|
|
283
|
+
* Most client use case will not need this
|
|
284
|
+
*
|
|
285
|
+
* Default is 0: no-passthrough
|
|
286
|
+
*/
|
|
287
|
+
void smb2_set_passthrough(struct smb2_context *smb2,
|
|
288
|
+
int passthrough);
|
|
289
|
+
|
|
290
|
+
/*
|
|
291
|
+
* Get the current passthrough setting
|
|
292
|
+
*/
|
|
293
|
+
void smb2_get_passthrough(struct smb2_context *smb2,
|
|
294
|
+
int *passthrough);
|
|
295
|
+
|
|
296
|
+
/*
|
|
297
|
+
* Set which version of SMB to negotiate.
|
|
298
|
+
* Default is to let the server pick the version.
|
|
299
|
+
*/
|
|
300
|
+
enum smb2_negotiate_version {
|
|
301
|
+
SMB2_VERSION_ANY = 0,
|
|
302
|
+
SMB2_VERSION_ANY2 = 2,
|
|
303
|
+
SMB2_VERSION_ANY3 = 3,
|
|
304
|
+
SMB2_VERSION_0202 = 0x0202,
|
|
305
|
+
SMB2_VERSION_0210 = 0x0210,
|
|
306
|
+
SMB2_VERSION_0300 = 0x0300,
|
|
307
|
+
SMB2_VERSION_0302 = 0x0302,
|
|
308
|
+
SMB2_VERSION_0311 = 0x0311,
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
#define SMB2_VERSION_WILDCARD 0x02FF
|
|
312
|
+
|
|
313
|
+
void smb2_set_version(struct smb2_context *smb2,
|
|
314
|
+
enum smb2_negotiate_version version);
|
|
315
|
+
|
|
316
|
+
/*
|
|
317
|
+
* Sets which version libsmb2 uses.
|
|
318
|
+
*/
|
|
319
|
+
#define LIBSMB2_MAJOR_VERSION 4
|
|
320
|
+
#define LIBSMB2_MINOR_VERSION 0
|
|
321
|
+
#define LIBSMB2_PATCH_VERSION 0
|
|
322
|
+
|
|
323
|
+
struct smb2_libversion
|
|
324
|
+
{
|
|
325
|
+
uint8_t major_version;
|
|
326
|
+
uint8_t minor_version;
|
|
327
|
+
uint8_t patch_version;
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
/*
|
|
331
|
+
* Gets the libsmb2 version being linked while used.
|
|
332
|
+
* This function will be available on 5.x
|
|
333
|
+
* @param struct smb2_libversion
|
|
334
|
+
*/
|
|
335
|
+
void smb2_get_libsmb2Version(struct smb2_libversion *smb2_ver);
|
|
336
|
+
|
|
337
|
+
/*
|
|
338
|
+
* gets the (currently) negotiated dialect
|
|
339
|
+
*/
|
|
340
|
+
uint16_t smb2_get_dialect(struct smb2_context *smb2);
|
|
341
|
+
|
|
342
|
+
/*
|
|
343
|
+
* Set the security mode for the connection.
|
|
344
|
+
* This is a combination of the flags SMB2_NEGOTIATE_SIGNING_ENABLED
|
|
345
|
+
* and SMB2_NEGOTIATE_SIGNING_REQUIRED
|
|
346
|
+
* Default is 0.
|
|
347
|
+
*/
|
|
348
|
+
void smb2_set_security_mode(struct smb2_context *smb2, uint16_t security_mode);
|
|
349
|
+
|
|
350
|
+
/*
|
|
351
|
+
* Set whether smb3 encryption should be used or not.
|
|
352
|
+
* 0 : disable encryption. This is the default.
|
|
353
|
+
* !0 : enable encryption.
|
|
354
|
+
*/
|
|
355
|
+
void smb2_set_seal(struct smb2_context *smb2, int val);
|
|
356
|
+
|
|
357
|
+
/*
|
|
358
|
+
* Set whether smb2 signing should be required or not
|
|
359
|
+
* 0 : do not require signing. This is the default.
|
|
360
|
+
* !0 : require signing.
|
|
361
|
+
*/
|
|
362
|
+
void smb2_set_sign(struct smb2_context *smb2, int val);
|
|
363
|
+
|
|
364
|
+
enum smb2_sec {
|
|
365
|
+
SMB2_SEC_UNDEFINED = 0,
|
|
366
|
+
SMB2_SEC_NTLMSSP,
|
|
367
|
+
SMB2_SEC_KRB5,
|
|
368
|
+
};
|
|
369
|
+
|
|
370
|
+
/*
|
|
371
|
+
* Set authentication method.
|
|
372
|
+
* SMB2_SEC_UNDEFINED (use KRB if available or NTLM if not)
|
|
373
|
+
* SMB2_SEC_NTLMSSP
|
|
374
|
+
* SMB2_SEC_KRB5
|
|
375
|
+
*/
|
|
376
|
+
void smb2_set_authentication(struct smb2_context *smb2, int val);
|
|
377
|
+
|
|
378
|
+
/*
|
|
379
|
+
* Set the username that we will try to authenticate as.
|
|
380
|
+
* Default is to try to authenticate as the current user.
|
|
381
|
+
*/
|
|
382
|
+
void smb2_set_user(struct smb2_context *smb2, const char *user);
|
|
383
|
+
|
|
384
|
+
/*
|
|
385
|
+
* Get the username associated with a context.
|
|
386
|
+
* returns NULL if none
|
|
387
|
+
*/
|
|
388
|
+
const char *smb2_get_user(struct smb2_context *smb2);
|
|
389
|
+
|
|
390
|
+
/*
|
|
391
|
+
* Set the password that we will try to authenticate as.
|
|
392
|
+
* This function is only needed when libsmb2 is built --without-libkrb5
|
|
393
|
+
*/
|
|
394
|
+
void smb2_set_password(struct smb2_context *smb2, const char *password);
|
|
395
|
+
|
|
396
|
+
/*
|
|
397
|
+
* Convert a win timestamp to a unix timeval
|
|
398
|
+
*/
|
|
399
|
+
void smb2_win_to_timeval(uint64_t smb2_time, struct smb2_timeval *tv);
|
|
400
|
+
|
|
401
|
+
/*
|
|
402
|
+
* Convert unit timeval to a win timestamp
|
|
403
|
+
*/
|
|
404
|
+
uint64_t smb2_timeval_to_win(struct smb2_timeval *tv);
|
|
405
|
+
|
|
406
|
+
/*
|
|
407
|
+
* set the context error string
|
|
408
|
+
*/
|
|
409
|
+
void smb2_set_error(struct smb2_context *smb2,
|
|
410
|
+
const char *error_string, ...);
|
|
411
|
+
|
|
412
|
+
/*
|
|
413
|
+
* Register an error callback, so any calls to smb2_set_error will call this
|
|
414
|
+
* function with the error string generated
|
|
415
|
+
*/
|
|
416
|
+
void smb2_register_error_callback(struct smb2_context *smb,
|
|
417
|
+
smb2_error_cb error_cb);
|
|
418
|
+
|
|
419
|
+
/*
|
|
420
|
+
* register for oplock or lease break callbacks
|
|
421
|
+
*/
|
|
422
|
+
void smb2_set_oplock_or_lease_break_callback(struct smb2_context *smb2,
|
|
423
|
+
smb2_oplock_or_lease_break_cb cb);
|
|
424
|
+
|
|
425
|
+
/*
|
|
426
|
+
* Set the smb2 context passworkd from a file (see NTLM_USER_FILE)
|
|
427
|
+
* depends on user/domain being already set in smb2 context
|
|
428
|
+
*/
|
|
429
|
+
void smb2_set_password_from_file(struct smb2_context *smb2);
|
|
430
|
+
|
|
431
|
+
/*
|
|
432
|
+
* Set the domain when authenticating.
|
|
433
|
+
* This function is only needed when libsmb2 is built --without-libkrb5
|
|
434
|
+
*/
|
|
435
|
+
void smb2_set_domain(struct smb2_context *smb2, const char *domain);
|
|
436
|
+
|
|
437
|
+
/*
|
|
438
|
+
* Get the domain associated with a context.
|
|
439
|
+
* returns NULL if none
|
|
440
|
+
*/
|
|
441
|
+
const char *smb2_get_domain(struct smb2_context *smb2);
|
|
442
|
+
/*
|
|
443
|
+
* Set the workstation when authenticating.
|
|
444
|
+
* This function is only needed when libsmb2 is built --without-libkrb5
|
|
445
|
+
*/
|
|
446
|
+
void smb2_set_workstation(struct smb2_context *smb2, const char *workstation);
|
|
447
|
+
|
|
448
|
+
/*
|
|
449
|
+
* Get the workstation associated with a context.
|
|
450
|
+
* returns NULL if none
|
|
451
|
+
*/
|
|
452
|
+
const char *smb2_get_workstation(struct smb2_context *smb2);
|
|
453
|
+
|
|
454
|
+
/*
|
|
455
|
+
* Sets the address to some user defined object. May be used to make
|
|
456
|
+
* additional context data available in the async callbacks.
|
|
457
|
+
*/
|
|
458
|
+
void smb2_set_opaque(struct smb2_context *smb2, void *opaque);
|
|
459
|
+
|
|
460
|
+
/*
|
|
461
|
+
* Returns the opaque pointer set with smb2_set_opaque.
|
|
462
|
+
*/
|
|
463
|
+
void *smb2_get_opaque(struct smb2_context *smb2);
|
|
464
|
+
|
|
465
|
+
/*
|
|
466
|
+
* copy credential handle from one context to another (and set
|
|
467
|
+
* it NULL in source context)
|
|
468
|
+
* returns 0 if handle transferred,
|
|
469
|
+
* or -1 if not (no handle or no context, or not applicable)
|
|
470
|
+
*/
|
|
471
|
+
int smb2_delegate_credentials(struct smb2_context *in, struct smb2_context *out);
|
|
472
|
+
|
|
473
|
+
/*
|
|
474
|
+
* Sets the client_guid for this context.
|
|
475
|
+
*/
|
|
476
|
+
void smb2_set_client_guid(struct smb2_context *smb2, const uint8_t guid[SMB2_GUID_SIZE]);
|
|
477
|
+
|
|
478
|
+
/*
|
|
479
|
+
* Returns the client_guid for this context.
|
|
480
|
+
*/
|
|
481
|
+
const char *smb2_get_client_guid(struct smb2_context *smb2);
|
|
482
|
+
|
|
483
|
+
/*
|
|
484
|
+
* Asynchronous call to connect a TCP connection to the server
|
|
485
|
+
*
|
|
486
|
+
* Returns:
|
|
487
|
+
* 0 if the call was initiated and a connection will be attempted. Result of
|
|
488
|
+
* the connection will be reported through the callback function.
|
|
489
|
+
* <0 if there was an error. The callback function will not be invoked.
|
|
490
|
+
*
|
|
491
|
+
* Callback parameters :
|
|
492
|
+
* status can be either of :
|
|
493
|
+
* 0 : Connection was successful. Command_data is NULL.
|
|
494
|
+
*
|
|
495
|
+
* -errno : Failed to establish the connection. Command_data is NULL.
|
|
496
|
+
*/
|
|
497
|
+
int smb2_connect_async(struct smb2_context *smb2, const char *server,
|
|
498
|
+
smb2_command_cb cb, void *cb_data);
|
|
499
|
+
|
|
500
|
+
/*
|
|
501
|
+
* Async call to connect to a share.
|
|
502
|
+
* On unix, if user is NULL then default to the current user.
|
|
503
|
+
*
|
|
504
|
+
* Returns:
|
|
505
|
+
* 0 if the call was initiated and a connection will be attempted. Result of
|
|
506
|
+
* the connection will be reported through the callback function.
|
|
507
|
+
* -errno if there was an error. The callback function will not be invoked.
|
|
508
|
+
*
|
|
509
|
+
* Callback parameters :
|
|
510
|
+
* status can be either of :
|
|
511
|
+
* 0 : Connection was successful. Command_data is NULL.
|
|
512
|
+
*
|
|
513
|
+
* -errno : Failed to connect to the share. Command_data is NULL.
|
|
514
|
+
*/
|
|
515
|
+
int smb2_connect_share_async(struct smb2_context *smb2,
|
|
516
|
+
const char *server,
|
|
517
|
+
const char *share,
|
|
518
|
+
const char *user,
|
|
519
|
+
smb2_command_cb cb, void *cb_data);
|
|
520
|
+
|
|
521
|
+
/*
|
|
522
|
+
* Sync call to connect to a share.
|
|
523
|
+
* On unix, if user is NULL then default to the current user.
|
|
524
|
+
*
|
|
525
|
+
* Returns:
|
|
526
|
+
* 0 : Connected to the share successfully.
|
|
527
|
+
* -errno : Failure.
|
|
528
|
+
*/
|
|
529
|
+
int smb2_connect_share(struct smb2_context *smb2,
|
|
530
|
+
const char *server,
|
|
531
|
+
const char *share,
|
|
532
|
+
const char *user);
|
|
533
|
+
|
|
534
|
+
/*
|
|
535
|
+
* Async call to disconnect from a share/
|
|
536
|
+
*
|
|
537
|
+
* Returns:
|
|
538
|
+
* 0 if the call was initiated and a connection will be attempted. Result of
|
|
539
|
+
* the disconnect will be reported through the callback function.
|
|
540
|
+
* -errno if there was an error. The callback function will not be invoked.
|
|
541
|
+
*
|
|
542
|
+
* Callback parameters :
|
|
543
|
+
* status can be either of :
|
|
544
|
+
* 0 : Connection was successful. Command_data is NULL.
|
|
545
|
+
*
|
|
546
|
+
* -errno : Failed to disconnect the share. Command_data is NULL.
|
|
547
|
+
*/
|
|
548
|
+
int smb2_disconnect_share_async(struct smb2_context *smb2,
|
|
549
|
+
smb2_command_cb cb, void *cb_data);
|
|
550
|
+
|
|
551
|
+
/*
|
|
552
|
+
* Sync call to disconnect from a share/
|
|
553
|
+
*
|
|
554
|
+
* Returns:
|
|
555
|
+
* 0 : Disconnected from the share successfully.
|
|
556
|
+
* -errno : Failure.
|
|
557
|
+
*/
|
|
558
|
+
int smb2_disconnect_share(struct smb2_context *smb2);
|
|
559
|
+
|
|
560
|
+
/*
|
|
561
|
+
* Select a tree id that was previously connected. Sets the tree_id
|
|
562
|
+
* in the context to be used for subsequent requests
|
|
563
|
+
*
|
|
564
|
+
* Returns:
|
|
565
|
+
* 0 : OK
|
|
566
|
+
* -errno : tree wasn't connected
|
|
567
|
+
*/
|
|
568
|
+
int smb2_select_tree_id(struct smb2_context *smb2, uint32_t tree_id);
|
|
569
|
+
|
|
570
|
+
struct smb2_pdu;
|
|
571
|
+
|
|
572
|
+
/*
|
|
573
|
+
* Get/Set the tree id of a pdu
|
|
574
|
+
*
|
|
575
|
+
* Returns:
|
|
576
|
+
* 0 : OK
|
|
577
|
+
* -errno : tree wasn't connected | no pdu | no context
|
|
578
|
+
*/
|
|
579
|
+
int smb2_get_tree_id_for_pdu(struct smb2_context *smb2, struct smb2_pdu *pdu, uint32_t *tree_id);
|
|
580
|
+
int smb2_set_tree_id_for_pdu(struct smb2_context *smb2, struct smb2_pdu *pdu, uint32_t tree_id);
|
|
581
|
+
|
|
582
|
+
/*
|
|
583
|
+
* Get session id
|
|
584
|
+
*
|
|
585
|
+
* Returns:
|
|
586
|
+
* 0 : OK
|
|
587
|
+
* -errno :
|
|
588
|
+
*/
|
|
589
|
+
int smb2_get_session_id(struct smb2_context *smb2, uint64_t *session_id);
|
|
590
|
+
|
|
591
|
+
/*
|
|
592
|
+
* This function returns a description of the last encountered error.
|
|
593
|
+
*/
|
|
594
|
+
const char *smb2_get_error(struct smb2_context *smb2);
|
|
595
|
+
|
|
596
|
+
int smb2_get_nterror(struct smb2_context *smb2);
|
|
597
|
+
|
|
598
|
+
struct smb2_url {
|
|
599
|
+
const char *domain;
|
|
600
|
+
const char *user;
|
|
601
|
+
const char *server;
|
|
602
|
+
const char *share;
|
|
603
|
+
const char *path;
|
|
604
|
+
};
|
|
605
|
+
|
|
606
|
+
/* Convert an smb2/nt error code into a string */
|
|
607
|
+
const char *nterror_to_str(uint32_t status);
|
|
608
|
+
|
|
609
|
+
/* Convert an smb2/nt error code into an errno value */
|
|
610
|
+
int nterror_to_errno(uint32_t status);
|
|
611
|
+
|
|
612
|
+
/*
|
|
613
|
+
* This function is used to parse an SMB2 URL into as smb2_url structure.
|
|
614
|
+
* SMB2 URL format:
|
|
615
|
+
* smb2://[<domain;][<username>@]<server>/<share>/<path>
|
|
616
|
+
* where <server> has the format:
|
|
617
|
+
* <host>[:<port>].
|
|
618
|
+
*
|
|
619
|
+
* Function will return a pointer to an iscsi smb2 structure if successful,
|
|
620
|
+
* or it will return NULL and set smb2_get_error() accordingly if there was
|
|
621
|
+
* a problem with the URL.
|
|
622
|
+
*
|
|
623
|
+
* The returned structure is freed by calling smb2_destroy_url()
|
|
624
|
+
*/
|
|
625
|
+
struct smb2_url *smb2_parse_url(struct smb2_context *smb2, const char *url);
|
|
626
|
+
void smb2_destroy_url(struct smb2_url *url);
|
|
627
|
+
|
|
628
|
+
/*
|
|
629
|
+
* These functions are used when creating compound low level commands.
|
|
630
|
+
* The general pattern for compound chains is
|
|
631
|
+
* 1, pdu = smb2_cmd_*_async(smb2, ...)
|
|
632
|
+
*
|
|
633
|
+
* 2, next = smb2_cmd_*_async(smb2, ...)
|
|
634
|
+
* 3, smb2_add_compound_pdu(smb2, pdu, next);
|
|
635
|
+
*
|
|
636
|
+
* 4, next = smb2_cmd_*_async(smb2, ...)
|
|
637
|
+
* 5, smb2_add_compound_pdu(smb2, pdu, next);
|
|
638
|
+
* ...
|
|
639
|
+
* *, smb2_queue_pdu(smb2, pdu);
|
|
640
|
+
*
|
|
641
|
+
* See libsmb2.c and smb2-raw-stat-async.c for examples on how to use
|
|
642
|
+
* this interface.
|
|
643
|
+
*/
|
|
644
|
+
void smb2_add_compound_pdu(struct smb2_context *smb2,
|
|
645
|
+
struct smb2_pdu *pdu, struct smb2_pdu *next_pdu);
|
|
646
|
+
void smb2_free_pdu(struct smb2_context *smb2, struct smb2_pdu *pdu);
|
|
647
|
+
void smb2_queue_pdu(struct smb2_context *smb2, struct smb2_pdu *pdu);
|
|
648
|
+
|
|
649
|
+
/*
|
|
650
|
+
* These are used to access/modify pdus from application level
|
|
651
|
+
* useful for proxies, etc.
|
|
652
|
+
*/
|
|
653
|
+
struct smb2_pdu *smb2_get_compound_pdu(struct smb2_context *smb2,
|
|
654
|
+
struct smb2_pdu *pdu);
|
|
655
|
+
void smb2_set_pdu_status(struct smb2_context *smb2, struct smb2_pdu *pdu, int status);
|
|
656
|
+
void smb2_set_pdu_message_id(struct smb2_context *smb2, struct smb2_pdu *pdu, uint64_t message_id);
|
|
657
|
+
uint64_t smb2_get_pdu_message_id(struct smb2_context *smb2, struct smb2_pdu *pdu);
|
|
658
|
+
uint64_t smb2_get_last_request_message_id(struct smb2_context *smb2);
|
|
659
|
+
uint64_t smb2_get_last_reply_message_id(struct smb2_context *smb2);
|
|
660
|
+
int smb2_pdu_is_compound(struct smb2_context *smb2);
|
|
661
|
+
|
|
662
|
+
/*
|
|
663
|
+
* OPENDIR
|
|
664
|
+
*/
|
|
665
|
+
struct smb2dir;
|
|
666
|
+
|
|
667
|
+
/*
|
|
668
|
+
* Async opendir()
|
|
669
|
+
*
|
|
670
|
+
* Returns
|
|
671
|
+
* pdu : The operation was initiated. Result of the operation will be reported
|
|
672
|
+
* through the callback function.
|
|
673
|
+
* The pdu must be freed by smb2_free_pdu().
|
|
674
|
+
* The pdu can be cancelled before the callback is invoked by freeing
|
|
675
|
+
* it.
|
|
676
|
+
* NULL : There was an error. The callback function will not be invoked.
|
|
677
|
+
*
|
|
678
|
+
* When the callback is invoked, status indicates the result:
|
|
679
|
+
* 0 : Success.
|
|
680
|
+
* Command_data is struct smb2dir.
|
|
681
|
+
* This structure is freed using smb2_closedir().
|
|
682
|
+
* -errno : An error occurred.
|
|
683
|
+
* Command_data is NULL.
|
|
684
|
+
*/
|
|
685
|
+
struct smb2_pdu *
|
|
686
|
+
smb2_opendir_async_pdu(struct smb2_context *smb2, const char *path,
|
|
687
|
+
smb2_command_cb cb, void *cb_data, void (*free_cb)(void *));
|
|
688
|
+
|
|
689
|
+
/*
|
|
690
|
+
* Sync opendir()
|
|
691
|
+
*
|
|
692
|
+
* Returns NULL on failure.
|
|
693
|
+
*/
|
|
694
|
+
struct smb2dir *smb2_opendir(struct smb2_context *smb2, const char *path);
|
|
695
|
+
|
|
696
|
+
int smb2_opendir_async(struct smb2_context *smb2, const char *path,
|
|
697
|
+
smb2_command_cb cb, void *cb_data);
|
|
698
|
+
|
|
699
|
+
/*
|
|
700
|
+
* closedir()
|
|
701
|
+
*/
|
|
702
|
+
/*
|
|
703
|
+
* smb2_closedir() never blocks, thus no async version is needed.
|
|
704
|
+
*/
|
|
705
|
+
void smb2_closedir(struct smb2_context *smb2, struct smb2dir *smb2dir);
|
|
706
|
+
|
|
707
|
+
/*
|
|
708
|
+
* readdir()
|
|
709
|
+
*/
|
|
710
|
+
/*
|
|
711
|
+
* smb2_readdir() never blocks, thus no async version is needed.
|
|
712
|
+
*/
|
|
713
|
+
struct smb2dirent *smb2_readdir(struct smb2_context *smb2,
|
|
714
|
+
struct smb2dir *smb2dir);
|
|
715
|
+
|
|
716
|
+
/*
|
|
717
|
+
* rewinddir()
|
|
718
|
+
*/
|
|
719
|
+
/*
|
|
720
|
+
* smb2_rewinddir() never blocks, thus no async version is needed.
|
|
721
|
+
*/
|
|
722
|
+
void smb2_rewinddir(struct smb2_context *smb2, struct smb2dir *smb2dir);
|
|
723
|
+
|
|
724
|
+
/*
|
|
725
|
+
* telldir()
|
|
726
|
+
*/
|
|
727
|
+
/*
|
|
728
|
+
* smb2_telldir() never blocks, thus no async version is needed.
|
|
729
|
+
*/
|
|
730
|
+
long smb2_telldir(struct smb2_context *smb2, struct smb2dir *smb2dir);
|
|
731
|
+
|
|
732
|
+
/*
|
|
733
|
+
* seekdir()
|
|
734
|
+
*/
|
|
735
|
+
/*
|
|
736
|
+
* smb2_seekdir() never blocks, thus no async version is needed.
|
|
737
|
+
*/
|
|
738
|
+
void smb2_seekdir(struct smb2_context *smb2, struct smb2dir *smb2dir,
|
|
739
|
+
long loc);
|
|
740
|
+
|
|
741
|
+
/*
|
|
742
|
+
* OPEN
|
|
743
|
+
*/
|
|
744
|
+
struct smb2fh;
|
|
745
|
+
/*
|
|
746
|
+
* Async open()
|
|
747
|
+
*
|
|
748
|
+
* Returns
|
|
749
|
+
* pdu : The operation was initiated. Result of the operation will be reported
|
|
750
|
+
* through the callback function.
|
|
751
|
+
* The pdu must be freed by smb2_free_pdu().
|
|
752
|
+
* The pdu can be cancelled before the callback is invoked by freeing
|
|
753
|
+
* it.
|
|
754
|
+
* NULL : There was an error. The callback function will not be invoked.
|
|
755
|
+
*
|
|
756
|
+
* Opens or creates a file.
|
|
757
|
+
* Supported flags are:
|
|
758
|
+
* O_RDONLY
|
|
759
|
+
* O_WRONLY
|
|
760
|
+
* O_RDWR
|
|
761
|
+
* O_SYNC
|
|
762
|
+
* O_CREAT
|
|
763
|
+
* O_EXCL
|
|
764
|
+
*
|
|
765
|
+
* When the callback is invoked, status indicates the result:
|
|
766
|
+
* 0 : Success.
|
|
767
|
+
* Command_data is struct smb2fh.
|
|
768
|
+
* This structure is freed using smb2_close().
|
|
769
|
+
* -errno : An error occurred.
|
|
770
|
+
* Command_data is NULL.
|
|
771
|
+
*/
|
|
772
|
+
struct smb2_pdu *
|
|
773
|
+
smb2_open_async_pdu(struct smb2_context *smb2, const char *path, int flags,
|
|
774
|
+
smb2_command_cb cb, void *cb_data, void (*free_cb)(void *));
|
|
775
|
+
|
|
776
|
+
/*
|
|
777
|
+
* Returns
|
|
778
|
+
* 0 : The operation was initiated. Result of the operation will be
|
|
779
|
+
* reported through the callback function.
|
|
780
|
+
* -errno : There was an error. The callback function will not be invoked.
|
|
781
|
+
*
|
|
782
|
+
*/
|
|
783
|
+
int smb2_open_async_with_oplock_or_lease(struct smb2_context *smb2, const char *path, int flags,
|
|
784
|
+
uint8_t oplock_level, uint32_t lease_state, smb2_lease_key lease_key,
|
|
785
|
+
smb2_command_cb cb, void *cb_data);
|
|
786
|
+
|
|
787
|
+
int smb2_open_async(struct smb2_context *smb2, const char *path, int flags,
|
|
788
|
+
smb2_command_cb cb, void *cb_data);
|
|
789
|
+
|
|
790
|
+
/*
|
|
791
|
+
* Sync open()
|
|
792
|
+
*
|
|
793
|
+
* Returns NULL on failure.
|
|
794
|
+
*/
|
|
795
|
+
struct smb2fh *smb2_open(struct smb2_context *smb2, const char *path, int flags);
|
|
796
|
+
|
|
797
|
+
/*
|
|
798
|
+
* CLOSE
|
|
799
|
+
*/
|
|
800
|
+
/*
|
|
801
|
+
* Async close()
|
|
802
|
+
*
|
|
803
|
+
* Returns
|
|
804
|
+
* 0 : The operation was initiated. Result of the operation will be
|
|
805
|
+
* reported through the callback function.
|
|
806
|
+
* -errno : There was an error. The callback function will not be invoked.
|
|
807
|
+
*
|
|
808
|
+
* When the callback is invoked, status indicates the result:
|
|
809
|
+
* 0 : Success.
|
|
810
|
+
* -errno : An error occurred.
|
|
811
|
+
*
|
|
812
|
+
* Command_data is always NULL.
|
|
813
|
+
*/
|
|
814
|
+
int smb2_close_async(struct smb2_context *smb2, struct smb2fh *fh,
|
|
815
|
+
smb2_command_cb cb, void *cb_data);
|
|
816
|
+
|
|
817
|
+
/*
|
|
818
|
+
* Sync close()
|
|
819
|
+
*/
|
|
820
|
+
int smb2_close(struct smb2_context *smb2, struct smb2fh *fh);
|
|
821
|
+
|
|
822
|
+
/*
|
|
823
|
+
* FSYNC
|
|
824
|
+
*/
|
|
825
|
+
/*
|
|
826
|
+
* Async fsync()
|
|
827
|
+
*
|
|
828
|
+
* Returns
|
|
829
|
+
* 0 : The operation was initiated. Result of the operation will be
|
|
830
|
+
* reported through the callback function.
|
|
831
|
+
* -errno : There was an error. The callback function will not be invoked.
|
|
832
|
+
*
|
|
833
|
+
* When the callback is invoked, status indicates the result:
|
|
834
|
+
* 0 : Success.
|
|
835
|
+
* -errno : An error occurred.
|
|
836
|
+
*
|
|
837
|
+
* Command_data is always NULL.
|
|
838
|
+
*/
|
|
839
|
+
int smb2_fsync_async(struct smb2_context *smb2, struct smb2fh *fh,
|
|
840
|
+
smb2_command_cb cb, void *cb_data);
|
|
841
|
+
|
|
842
|
+
/*
|
|
843
|
+
* Sync fsync()
|
|
844
|
+
*/
|
|
845
|
+
int smb2_fsync(struct smb2_context *smb2, struct smb2fh *fh);
|
|
846
|
+
|
|
847
|
+
/*
|
|
848
|
+
* GetMaxReadWriteSize
|
|
849
|
+
* SMB2 servers have a maximum size for read/write data that they support.
|
|
850
|
+
*/
|
|
851
|
+
uint32_t smb2_get_max_read_size(struct smb2_context *smb2);
|
|
852
|
+
uint32_t smb2_get_max_write_size(struct smb2_context *smb2);
|
|
853
|
+
|
|
854
|
+
struct smb2_read_cb_data {
|
|
855
|
+
struct smb2fh *fh;
|
|
856
|
+
uint8_t *buf;
|
|
857
|
+
uint32_t count;
|
|
858
|
+
uint64_t offset;
|
|
859
|
+
};
|
|
860
|
+
|
|
861
|
+
struct smb2_write_cb_data {
|
|
862
|
+
struct smb2fh *fh;
|
|
863
|
+
const uint8_t *buf;
|
|
864
|
+
uint32_t count;
|
|
865
|
+
uint64_t offset;
|
|
866
|
+
};
|
|
867
|
+
|
|
868
|
+
/*
|
|
869
|
+
* PREAD
|
|
870
|
+
*/
|
|
871
|
+
/*
|
|
872
|
+
* Async pread()
|
|
873
|
+
* Use smb2_get_max_read_size to discover the maximum data size that the
|
|
874
|
+
* server supports.
|
|
875
|
+
*
|
|
876
|
+
* Returns
|
|
877
|
+
* 0 : The operation was initiated. Result of the operation will be
|
|
878
|
+
* reported through the callback function.
|
|
879
|
+
* -errno : There was an error. The callback function will not be invoked.
|
|
880
|
+
*
|
|
881
|
+
* When the callback is invoked, status indicates the result:
|
|
882
|
+
* >=0 : Number of bytes read.
|
|
883
|
+
* -errno : An error occurred.
|
|
884
|
+
*
|
|
885
|
+
* Command_data is struct smb2_read_cb_data, which holds the arguments
|
|
886
|
+
* that were given to smb2_pread_async.
|
|
887
|
+
* This structure is automatically freed.
|
|
888
|
+
*/
|
|
889
|
+
int smb2_pread_async(struct smb2_context *smb2, struct smb2fh *fh,
|
|
890
|
+
uint8_t *buf, uint32_t count, uint64_t offset,
|
|
891
|
+
smb2_command_cb cb, void *cb_data);
|
|
892
|
+
|
|
893
|
+
/*
|
|
894
|
+
* Sync pread()
|
|
895
|
+
* Use smb2_get_max_read_size to discover the maximum data size that the
|
|
896
|
+
* server supports.
|
|
897
|
+
*/
|
|
898
|
+
int smb2_pread(struct smb2_context *smb2, struct smb2fh *fh,
|
|
899
|
+
uint8_t *buf, uint32_t count, uint64_t offset);
|
|
900
|
+
|
|
901
|
+
/*
|
|
902
|
+
* PWRITE
|
|
903
|
+
*/
|
|
904
|
+
/*
|
|
905
|
+
* Async pwrite()
|
|
906
|
+
* Use smb2_get_max_write_size to discover the maximum data size that the
|
|
907
|
+
* server supports.
|
|
908
|
+
*
|
|
909
|
+
* Returns
|
|
910
|
+
* 0 : The operation was initiated. Result of the operation will be
|
|
911
|
+
* reported through the callback function.
|
|
912
|
+
* -errno : There was an error. The callback function will not be invoked.
|
|
913
|
+
*
|
|
914
|
+
* When the callback is invoked, status indicates the result:
|
|
915
|
+
* >=0 : Number of bytes written.
|
|
916
|
+
* -errno : An error occurred.
|
|
917
|
+
*
|
|
918
|
+
* Command_data is struct smb2_write_cb_data, which holds the arguments
|
|
919
|
+
* that were given to smb2_pwrite_async.
|
|
920
|
+
* This structure is automatically freed.
|
|
921
|
+
*/
|
|
922
|
+
int smb2_pwrite_async(struct smb2_context *smb2, struct smb2fh *fh,
|
|
923
|
+
const uint8_t *buf, uint32_t count, uint64_t offset,
|
|
924
|
+
smb2_command_cb cb, void *cb_data);
|
|
925
|
+
|
|
926
|
+
/*
|
|
927
|
+
* Sync pwrite()
|
|
928
|
+
* Use smb2_get_max_write_size to discover the maximum data size that the
|
|
929
|
+
* server supports.
|
|
930
|
+
*/
|
|
931
|
+
int smb2_pwrite(struct smb2_context *smb2, struct smb2fh *fh,
|
|
932
|
+
const uint8_t *buf, uint32_t count, uint64_t offset);
|
|
933
|
+
|
|
934
|
+
/*
|
|
935
|
+
* READ
|
|
936
|
+
*/
|
|
937
|
+
/*
|
|
938
|
+
* Async read()
|
|
939
|
+
*
|
|
940
|
+
* Returns
|
|
941
|
+
* 0 : The operation was initiated. Result of the operation will be
|
|
942
|
+
* reported through the callback function.
|
|
943
|
+
* -errno : There was an error. The callback function will not be invoked.
|
|
944
|
+
*
|
|
945
|
+
* When the callback is invoked, status indicates the result:
|
|
946
|
+
* >=0 : Number of bytes read.
|
|
947
|
+
* -errno : An error occurred.
|
|
948
|
+
*
|
|
949
|
+
* Command_data is struct smb2_read_cb_data, which holds the arguments
|
|
950
|
+
* that were given to smb2_read_async. offset denotes the offset in the file
|
|
951
|
+
* at which the read took place.
|
|
952
|
+
* This structure is automatically freed.
|
|
953
|
+
*/
|
|
954
|
+
int smb2_read_async(struct smb2_context *smb2, struct smb2fh *fh,
|
|
955
|
+
uint8_t *buf, uint32_t count,
|
|
956
|
+
smb2_command_cb cb, void *cb_data);
|
|
957
|
+
|
|
958
|
+
/*
|
|
959
|
+
* Sync read()
|
|
960
|
+
*/
|
|
961
|
+
int smb2_read(struct smb2_context *smb2, struct smb2fh *fh,
|
|
962
|
+
uint8_t *buf, uint32_t count);
|
|
963
|
+
|
|
964
|
+
/*
|
|
965
|
+
* WRITE
|
|
966
|
+
*/
|
|
967
|
+
/*
|
|
968
|
+
* Async write()
|
|
969
|
+
*
|
|
970
|
+
* Returns
|
|
971
|
+
* 0 : The operation was initiated. Result of the operation will be
|
|
972
|
+
* reported through the callback function.
|
|
973
|
+
* -errno : There was an error. The callback function will not be invoked.
|
|
974
|
+
*
|
|
975
|
+
* When the callback is invoked, status indicates the result:
|
|
976
|
+
* >=0 : Number of bytes written.
|
|
977
|
+
* -errno : An error occurred.
|
|
978
|
+
*
|
|
979
|
+
* Command_data is struct smb2_write_cb_data, which holds the arguments
|
|
980
|
+
* that were given to smb2_write_async. offset denotes the offset in the file
|
|
981
|
+
* at which the write took place.
|
|
982
|
+
* This structure is automatically freed.
|
|
983
|
+
*/
|
|
984
|
+
int smb2_write_async(struct smb2_context *smb2, struct smb2fh *fh,
|
|
985
|
+
const uint8_t *buf, uint32_t count,
|
|
986
|
+
smb2_command_cb cb, void *cb_data);
|
|
987
|
+
|
|
988
|
+
/*
|
|
989
|
+
* Sync write()
|
|
990
|
+
*/
|
|
991
|
+
int smb2_write(struct smb2_context *smb2, struct smb2fh *fh,
|
|
992
|
+
const uint8_t *buf, uint32_t count);
|
|
993
|
+
|
|
994
|
+
/*
|
|
995
|
+
* Sync lseek()
|
|
996
|
+
*/
|
|
997
|
+
/*
|
|
998
|
+
* smb2_seek() SEEK_SET and SEEK_CUR are fully supported.
|
|
999
|
+
* SEEK_END only returns the end-of-file from the original open.
|
|
1000
|
+
* (it will not call fstat to discover the current file size and will not block)
|
|
1001
|
+
*/
|
|
1002
|
+
int64_t smb2_lseek(struct smb2_context *smb2, struct smb2fh *fh,
|
|
1003
|
+
int64_t offset, int whence, uint64_t *current_offset);
|
|
1004
|
+
|
|
1005
|
+
/*
|
|
1006
|
+
* UNLINK
|
|
1007
|
+
*/
|
|
1008
|
+
/*
|
|
1009
|
+
* Async unlink()
|
|
1010
|
+
*
|
|
1011
|
+
* Returns
|
|
1012
|
+
* 0 : The operation was initiated. Result of the operation will be
|
|
1013
|
+
* reported through the callback function.
|
|
1014
|
+
* -errno : There was an error. The callback function will not be invoked.
|
|
1015
|
+
*
|
|
1016
|
+
* When the callback is invoked, status indicates the result:
|
|
1017
|
+
* 0 : Success.
|
|
1018
|
+
* -errno : An error occurred.
|
|
1019
|
+
*
|
|
1020
|
+
* Command_data is always NULL.
|
|
1021
|
+
*/
|
|
1022
|
+
int smb2_unlink_async(struct smb2_context *smb2, const char *path,
|
|
1023
|
+
smb2_command_cb cb, void *cb_data);
|
|
1024
|
+
|
|
1025
|
+
/*
|
|
1026
|
+
* Sync unlink()
|
|
1027
|
+
*/
|
|
1028
|
+
int smb2_unlink(struct smb2_context *smb2, const char *path);
|
|
1029
|
+
|
|
1030
|
+
/*
|
|
1031
|
+
* RMDIR
|
|
1032
|
+
*/
|
|
1033
|
+
/*
|
|
1034
|
+
* Async rmdir()
|
|
1035
|
+
*
|
|
1036
|
+
* Returns
|
|
1037
|
+
* 0 : The operation was initiated. Result of the operation will be
|
|
1038
|
+
* reported through the callback function.
|
|
1039
|
+
* -errno : There was an error. The callback function will not be invoked.
|
|
1040
|
+
*
|
|
1041
|
+
* When the callback is invoked, status indicates the result:
|
|
1042
|
+
* 0 : Success.
|
|
1043
|
+
* -errno : An error occurred.
|
|
1044
|
+
*
|
|
1045
|
+
* Command_data is always NULL.
|
|
1046
|
+
*/
|
|
1047
|
+
int smb2_rmdir_async(struct smb2_context *smb2, const char *path,
|
|
1048
|
+
smb2_command_cb cb, void *cb_data);
|
|
1049
|
+
|
|
1050
|
+
/*
|
|
1051
|
+
* Sync rmdir()
|
|
1052
|
+
*/
|
|
1053
|
+
int smb2_rmdir(struct smb2_context *smb2, const char *path);
|
|
1054
|
+
|
|
1055
|
+
/*
|
|
1056
|
+
* MKDIR
|
|
1057
|
+
*/
|
|
1058
|
+
/*
|
|
1059
|
+
* Async mkdir()
|
|
1060
|
+
*
|
|
1061
|
+
* Returns
|
|
1062
|
+
* 0 : The operation was initiated. Result of the operation will be
|
|
1063
|
+
* reported through the callback function.
|
|
1064
|
+
* -errno : There was an error. The callback function will not be invoked.
|
|
1065
|
+
*
|
|
1066
|
+
* When the callback is invoked, status indicates the result:
|
|
1067
|
+
* 0 : Success.
|
|
1068
|
+
* -errno : An error occurred.
|
|
1069
|
+
*
|
|
1070
|
+
* Command_data is always NULL.
|
|
1071
|
+
*/
|
|
1072
|
+
int smb2_mkdir_async(struct smb2_context *smb2, const char *path,
|
|
1073
|
+
smb2_command_cb cb, void *cb_data);
|
|
1074
|
+
|
|
1075
|
+
/*
|
|
1076
|
+
* Sync mkdir()
|
|
1077
|
+
*/
|
|
1078
|
+
int smb2_mkdir(struct smb2_context *smb2, const char *path);
|
|
1079
|
+
|
|
1080
|
+
/*
|
|
1081
|
+
* STATVFS
|
|
1082
|
+
*/
|
|
1083
|
+
/*
|
|
1084
|
+
* Async statvfs()
|
|
1085
|
+
*
|
|
1086
|
+
* Returns
|
|
1087
|
+
* 0 : The operation was initiated. Result of the operation will be
|
|
1088
|
+
* reported through the callback function.
|
|
1089
|
+
* -errno : There was an error. The callback function will not be invoked.
|
|
1090
|
+
*
|
|
1091
|
+
* When the callback is invoked, status indicates the result:
|
|
1092
|
+
* 0 : Success. Command_data is struct smb2_statvfs
|
|
1093
|
+
* -errno : An error occurred.
|
|
1094
|
+
*/
|
|
1095
|
+
int smb2_statvfs_async(struct smb2_context *smb2, const char *path,
|
|
1096
|
+
struct smb2_statvfs *statvfs,
|
|
1097
|
+
smb2_command_cb cb, void *cb_data);
|
|
1098
|
+
/*
|
|
1099
|
+
* Sync statvfs()
|
|
1100
|
+
*/
|
|
1101
|
+
int smb2_statvfs(struct smb2_context *smb2, const char *path,
|
|
1102
|
+
struct smb2_statvfs *statvfs);
|
|
1103
|
+
|
|
1104
|
+
/*
|
|
1105
|
+
* FSTAT
|
|
1106
|
+
*/
|
|
1107
|
+
/*
|
|
1108
|
+
* Async fstat()
|
|
1109
|
+
*
|
|
1110
|
+
* Returns
|
|
1111
|
+
* 0 : The operation was initiated. Result of the operation will be
|
|
1112
|
+
* reported through the callback function.
|
|
1113
|
+
* -errno : There was an error. The callback function will not be invoked.
|
|
1114
|
+
*
|
|
1115
|
+
* When the callback is invoked, status indicates the result:
|
|
1116
|
+
* 0 : Success. Command_data is struct smb2_stat_64
|
|
1117
|
+
* -errno : An error occurred.
|
|
1118
|
+
*/
|
|
1119
|
+
int smb2_fstat_async(struct smb2_context *smb2, struct smb2fh *fh,
|
|
1120
|
+
struct smb2_stat_64 *st,
|
|
1121
|
+
smb2_command_cb cb, void *cb_data);
|
|
1122
|
+
/*
|
|
1123
|
+
* Sync fstat()
|
|
1124
|
+
*/
|
|
1125
|
+
int smb2_fstat(struct smb2_context *smb2, struct smb2fh *fh,
|
|
1126
|
+
struct smb2_stat_64 *st);
|
|
1127
|
+
|
|
1128
|
+
/*
|
|
1129
|
+
* Async stat()
|
|
1130
|
+
*
|
|
1131
|
+
* Returns
|
|
1132
|
+
* 0 : The operation was initiated. Result of the operation will be
|
|
1133
|
+
* reported through the callback function.
|
|
1134
|
+
* -errno : There was an error. The callback function will not be invoked.
|
|
1135
|
+
*
|
|
1136
|
+
* When the callback is invoked, status indicates the result:
|
|
1137
|
+
* 0 : Success. Command_data is struct smb2_stat_64
|
|
1138
|
+
* -errno : An error occurred.
|
|
1139
|
+
*/
|
|
1140
|
+
int smb2_stat_async(struct smb2_context *smb2, const char *path,
|
|
1141
|
+
struct smb2_stat_64 *st,
|
|
1142
|
+
smb2_command_cb cb, void *cb_data);
|
|
1143
|
+
/*
|
|
1144
|
+
* Sync stat()
|
|
1145
|
+
*/
|
|
1146
|
+
int smb2_stat(struct smb2_context *smb2, const char *path,
|
|
1147
|
+
struct smb2_stat_64 *st);
|
|
1148
|
+
|
|
1149
|
+
/*
|
|
1150
|
+
* Async rename()
|
|
1151
|
+
*
|
|
1152
|
+
* Returns
|
|
1153
|
+
* 0 : The operation was initiated. Result of the operation will be
|
|
1154
|
+
* reported through the callback function.
|
|
1155
|
+
* -errno : There was an error. The callback function will not be invoked.
|
|
1156
|
+
*
|
|
1157
|
+
* When the callback is invoked, status indicates the result:
|
|
1158
|
+
* 0 : Success.
|
|
1159
|
+
* -errno : An error occurred.
|
|
1160
|
+
*/
|
|
1161
|
+
int smb2_rename_async(struct smb2_context *smb2, const char *oldpath,
|
|
1162
|
+
const char *newpath, smb2_command_cb cb, void *cb_data);
|
|
1163
|
+
|
|
1164
|
+
/*
|
|
1165
|
+
* Sync rename()
|
|
1166
|
+
*/
|
|
1167
|
+
int smb2_rename(struct smb2_context *smb2, const char *oldpath,
|
|
1168
|
+
const char *newpath);
|
|
1169
|
+
|
|
1170
|
+
/*
|
|
1171
|
+
* Async truncate()
|
|
1172
|
+
*
|
|
1173
|
+
* Returns
|
|
1174
|
+
* 0 : The operation was initiated. Result of the operation will be
|
|
1175
|
+
* reported through the callback function.
|
|
1176
|
+
* -errno : There was an error. The callback function will not be invoked.
|
|
1177
|
+
*
|
|
1178
|
+
* When the callback is invoked, status indicates the result:
|
|
1179
|
+
* 0 : Success.
|
|
1180
|
+
* -errno : An error occurred.
|
|
1181
|
+
*/
|
|
1182
|
+
int smb2_truncate_async(struct smb2_context *smb2, const char *path,
|
|
1183
|
+
uint64_t length, smb2_command_cb cb, void *cb_data);
|
|
1184
|
+
/*
|
|
1185
|
+
* Sync truncate()
|
|
1186
|
+
* Function returns
|
|
1187
|
+
* 0 : Success
|
|
1188
|
+
* -errno : An error occurred.
|
|
1189
|
+
*/
|
|
1190
|
+
int smb2_truncate(struct smb2_context *smb2, const char *path,
|
|
1191
|
+
uint64_t length);
|
|
1192
|
+
|
|
1193
|
+
/*
|
|
1194
|
+
* Async ftruncate()
|
|
1195
|
+
*
|
|
1196
|
+
* Returns
|
|
1197
|
+
* 0 : The operation was initiated. Result of the operation will be
|
|
1198
|
+
* reported through the callback function.
|
|
1199
|
+
* -errno : There was an error. The callback function will not be invoked.
|
|
1200
|
+
*
|
|
1201
|
+
* When the callback is invoked, status indicates the result:
|
|
1202
|
+
* 0 : Success.
|
|
1203
|
+
* -errno : An error occurred.
|
|
1204
|
+
*/
|
|
1205
|
+
int smb2_ftruncate_async(struct smb2_context *smb2, struct smb2fh *fh,
|
|
1206
|
+
uint64_t length, smb2_command_cb cb, void *cb_data);
|
|
1207
|
+
/*
|
|
1208
|
+
* Sync ftruncate()
|
|
1209
|
+
* Function returns
|
|
1210
|
+
* 0 : Success
|
|
1211
|
+
* -errno : An error occurred.
|
|
1212
|
+
*/
|
|
1213
|
+
int smb2_ftruncate(struct smb2_context *smb2, struct smb2fh *fh,
|
|
1214
|
+
uint64_t length);
|
|
1215
|
+
|
|
1216
|
+
|
|
1217
|
+
/*
|
|
1218
|
+
* READLINK
|
|
1219
|
+
*/
|
|
1220
|
+
/*
|
|
1221
|
+
* Async readlink()
|
|
1222
|
+
*
|
|
1223
|
+
* Returns
|
|
1224
|
+
* 0 : The operation was initiated. The link content will be
|
|
1225
|
+
* reported through the callback function.
|
|
1226
|
+
* -errno : There was an error. The callback function will not be invoked.
|
|
1227
|
+
*
|
|
1228
|
+
* When the callback is invoked, status indicates the result:
|
|
1229
|
+
* 0 : Success. Command_data is the link content.
|
|
1230
|
+
* -errno : An error occurred.
|
|
1231
|
+
*/
|
|
1232
|
+
int smb2_readlink_async(struct smb2_context *smb2, const char *path,
|
|
1233
|
+
smb2_command_cb cb, void *cb_data);
|
|
1234
|
+
|
|
1235
|
+
/*
|
|
1236
|
+
* Sync readlink()
|
|
1237
|
+
*/
|
|
1238
|
+
int smb2_readlink(struct smb2_context *smb2, const char *path, char *buf, uint32_t bufsiz);
|
|
1239
|
+
|
|
1240
|
+
/*
|
|
1241
|
+
* Async echo()
|
|
1242
|
+
*
|
|
1243
|
+
* Returns
|
|
1244
|
+
* 0 : The operation was initiated. Result of the operation will be
|
|
1245
|
+
* reported through the callback function.
|
|
1246
|
+
* -errno : There was an error. The callback function will not be invoked.
|
|
1247
|
+
*
|
|
1248
|
+
* When the callback is invoked, status indicates the result:
|
|
1249
|
+
* 0 : Success.
|
|
1250
|
+
* -errno : An error occurred.
|
|
1251
|
+
*/
|
|
1252
|
+
int smb2_echo_async(struct smb2_context *smb2,
|
|
1253
|
+
smb2_command_cb cb, void *cb_data);
|
|
1254
|
+
|
|
1255
|
+
/*
|
|
1256
|
+
* Sync echo()
|
|
1257
|
+
*
|
|
1258
|
+
* Returns:
|
|
1259
|
+
* 0 : successfully send the message and received a reply.
|
|
1260
|
+
* -errno : Failure.
|
|
1261
|
+
*/
|
|
1262
|
+
int smb2_echo(struct smb2_context *smb2);
|
|
1263
|
+
|
|
1264
|
+
void
|
|
1265
|
+
free_smb2_file_notify_change_information(struct smb2_context *smb2, struct smb2_file_notify_change_information *fnc);
|
|
1266
|
+
|
|
1267
|
+
int smb2_notify_change_async(struct smb2_context *smb2, const char *path, uint16_t flags, uint32_t filter, int loop,
|
|
1268
|
+
smb2_command_cb cb, void *cb_data);
|
|
1269
|
+
|
|
1270
|
+
int smb2_notify_change_filehandle_async(struct smb2_context *smb2, struct smb2fh *smb2_dir_fh, uint16_t flags, uint32_t filter, int loop,
|
|
1271
|
+
smb2_command_cb cb, void *cb_data);
|
|
1272
|
+
|
|
1273
|
+
/*
|
|
1274
|
+
* Sync notify_change()
|
|
1275
|
+
*
|
|
1276
|
+
*/
|
|
1277
|
+
struct smb2_file_notify_change_information *smb2_notify_change(struct smb2_context *smb2, const char *path, uint16_t flags, uint32_t filter);
|
|
1278
|
+
|
|
1279
|
+
/* Utilities that help by being public
|
|
1280
|
+
*/
|
|
1281
|
+
|
|
1282
|
+
/* SMB's UTF-16 is always in Little Endian */
|
|
1283
|
+
struct smb2_utf16 {
|
|
1284
|
+
int len;
|
|
1285
|
+
uint16_t val[1];
|
|
1286
|
+
};
|
|
1287
|
+
|
|
1288
|
+
/* Returns a string converted to UTF-16 format. Use free() to release
|
|
1289
|
+
* the utf16 string.
|
|
1290
|
+
*/
|
|
1291
|
+
struct smb2_utf16 *smb2_utf8_to_utf16(const char *utf8);
|
|
1292
|
+
|
|
1293
|
+
/* Returns a string converted to UTF8 format. Use free() to release
|
|
1294
|
+
* the utf8 string.
|
|
1295
|
+
*/
|
|
1296
|
+
const char *smb2_utf16_to_utf8(const uint16_t *str, size_t len);
|
|
1297
|
+
|
|
1298
|
+
/************* Server-side API **********************************************/
|
|
1299
|
+
struct smb2_server;
|
|
1300
|
+
|
|
1301
|
+
/* pdu handlers in general take the request from the client, and return
|
|
1302
|
+
* < 0 on error, and the library should create an error reply
|
|
1303
|
+
* == 0 on OK, and the library should use the reply struct (if needed) to create a reply
|
|
1304
|
+
* > 0 if the handler created and queued a reply itself
|
|
1305
|
+
*/
|
|
1306
|
+
struct smb2_server_request_handlers {
|
|
1307
|
+
int (*destruction_event)(struct smb2_server *srvr, struct smb2_context *smb2);
|
|
1308
|
+
int (*authorize_user)(struct smb2_server *srvr, struct smb2_context *smb2,
|
|
1309
|
+
const char *user,
|
|
1310
|
+
const char *domain,
|
|
1311
|
+
const char *workstation);
|
|
1312
|
+
int (*session_established)(struct smb2_server *srvr, struct smb2_context *smb2);
|
|
1313
|
+
int (*logoff_cmd)(struct smb2_server *srvr, struct smb2_context *smb2);
|
|
1314
|
+
int (*tree_connect_cmd)(struct smb2_server *srvr, struct smb2_context *smb2,
|
|
1315
|
+
struct smb2_tree_connect_request *req,
|
|
1316
|
+
struct smb2_tree_connect_reply *rep);
|
|
1317
|
+
int (*tree_disconnect_cmd)(struct smb2_server *srvr, struct smb2_context *smb2,
|
|
1318
|
+
const uint32_t tree_id);
|
|
1319
|
+
int (*create_cmd)(struct smb2_server *srvr, struct smb2_context *smb2,
|
|
1320
|
+
struct smb2_create_request *req,
|
|
1321
|
+
struct smb2_create_reply *rep);
|
|
1322
|
+
int (*close_cmd)(struct smb2_server *srvr, struct smb2_context *smb2,
|
|
1323
|
+
struct smb2_close_request *req,
|
|
1324
|
+
struct smb2_close_reply *rep);
|
|
1325
|
+
int (*flush_cmd)(struct smb2_server *srvr, struct smb2_context *smb2,
|
|
1326
|
+
struct smb2_flush_request *req);
|
|
1327
|
+
int (*read_cmd)(struct smb2_server *srvr, struct smb2_context *smb2,
|
|
1328
|
+
struct smb2_read_request *req,
|
|
1329
|
+
struct smb2_read_reply *rep);
|
|
1330
|
+
int (*write_cmd)(struct smb2_server *srvr, struct smb2_context *smb2,
|
|
1331
|
+
struct smb2_write_request *req,
|
|
1332
|
+
struct smb2_write_reply *rep);
|
|
1333
|
+
int (*oplock_break_cmd)(struct smb2_server *srvr, struct smb2_context *smb2,
|
|
1334
|
+
struct smb2_oplock_break_acknowledgement *req);
|
|
1335
|
+
int (*lease_break_cmd)(struct smb2_server *srvr, struct smb2_context *smb2,
|
|
1336
|
+
struct smb2_lease_break_acknowledgement *req);
|
|
1337
|
+
int (*lock_cmd)(struct smb2_server *srvr, struct smb2_context *smb2,
|
|
1338
|
+
struct smb2_lock_request *req);
|
|
1339
|
+
int (*ioctl_cmd)(struct smb2_server *srvr, struct smb2_context *smb2,
|
|
1340
|
+
struct smb2_ioctl_request *req,
|
|
1341
|
+
struct smb2_ioctl_reply *rep);
|
|
1342
|
+
int (*cancel_cmd)(struct smb2_server *srvr, struct smb2_context *smb2);
|
|
1343
|
+
int (*echo_cmd)(struct smb2_server *srvr, struct smb2_context *smb2);
|
|
1344
|
+
int (*query_directory_cmd)(struct smb2_server *srvr, struct smb2_context *smb2,
|
|
1345
|
+
struct smb2_query_directory_request *req,
|
|
1346
|
+
struct smb2_query_directory_reply *rep);
|
|
1347
|
+
int (*change_notify_cmd)(struct smb2_server *srvr, struct smb2_context *smb2,
|
|
1348
|
+
struct smb2_change_notify_request *req,
|
|
1349
|
+
struct smb2_change_notify_reply *rep);
|
|
1350
|
+
int (*query_info_cmd)(struct smb2_server *srvr, struct smb2_context *smb2,
|
|
1351
|
+
struct smb2_query_info_request *req,
|
|
1352
|
+
struct smb2_query_info_reply *rep);
|
|
1353
|
+
int (*set_info_cmd)(struct smb2_server *srvr, struct smb2_context *smb2,
|
|
1354
|
+
struct smb2_set_info_request *req);
|
|
1355
|
+
/*
|
|
1356
|
+
int (*oplock_break cmd)(struct smb2_server *srvr, struct smb2_context *smb2,
|
|
1357
|
+
struct smb2_oplock_break_request *req);
|
|
1358
|
+
*/
|
|
1359
|
+
};
|
|
1360
|
+
|
|
1361
|
+
struct smb2_server {
|
|
1362
|
+
uint8_t guid[16];
|
|
1363
|
+
char hostname[128];
|
|
1364
|
+
char domain[128];
|
|
1365
|
+
int fd;
|
|
1366
|
+
uint16_t port;
|
|
1367
|
+
uint64_t session_counter;
|
|
1368
|
+
struct smb2_server_request_handlers *handlers;
|
|
1369
|
+
uint32_t max_transact_size;
|
|
1370
|
+
uint32_t max_read_size;
|
|
1371
|
+
uint32_t max_write_size;
|
|
1372
|
+
int signing_enabled;
|
|
1373
|
+
int allow_anonymous;
|
|
1374
|
+
/* this can be set non-0 to delegate client authentication to
|
|
1375
|
+
* another client and allow any authentication to this server */
|
|
1376
|
+
int proxy_authentication;
|
|
1377
|
+
/* saved from negotiate to be used in validate negotiate info */
|
|
1378
|
+
uint32_t capabilities;
|
|
1379
|
+
uint32_t security_mode;
|
|
1380
|
+
/* for kerberos, credential context */
|
|
1381
|
+
char keytab_path[256];
|
|
1382
|
+
char error[128];
|
|
1383
|
+
void *auth_data;
|
|
1384
|
+
};
|
|
1385
|
+
|
|
1386
|
+
int smb2_bind_and_listen(const uint16_t port, const int max_connections, int *out_fd);
|
|
1387
|
+
int smb2_accept_connection_async(const int fd, const int to_msecs, smb2_accepted_cb cb, void *cb_data);
|
|
1388
|
+
int smb2_serve_port_async(const int fd, const int to_msecs, struct smb2_context **out_smb2);
|
|
1389
|
+
|
|
1390
|
+
/*
|
|
1391
|
+
* Sync serve port()
|
|
1392
|
+
*
|
|
1393
|
+
* Returns
|
|
1394
|
+
* 0 : The server is complete by exiting its loop normally (shouldnt happen)
|
|
1395
|
+
* -errno : There was an error causing server loop to exit
|
|
1396
|
+
*/
|
|
1397
|
+
int smb2_serve_port(struct smb2_server *server, const int max_connections, smb2_client_connection cb, void *cb_data);
|
|
1398
|
+
|
|
1399
|
+
/*
|
|
1400
|
+
* Some symbols have moved over to a different header file to allow better
|
|
1401
|
+
* separation between dcerpc and smb2, so we need to include this header
|
|
1402
|
+
* here to retain compatibility for apps that depend on those symbols.
|
|
1403
|
+
*/
|
|
1404
|
+
#include <smb2/libsmb2-dcerpc-srvsvc.h>
|
|
1405
|
+
|
|
1406
|
+
#ifdef __cplusplus
|
|
1407
|
+
}
|
|
1408
|
+
#endif
|
|
1409
|
+
#endif /* !_LIBSMB2_H_ */
|