@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.
Files changed (640) hide show
  1. package/README.md +54 -3
  2. package/darwin_arm64/libsmb2.1.dylib +0 -0
  3. package/darwin_arm64/libsmb2.6.1.0.dylib +0 -0
  4. package/darwin_arm64/libsmb2.dylib +0 -0
  5. package/darwin_arm64/smb_server_cpp_darwin_arm64 +0 -0
  6. package/darwin_arm64/third-party/libsmb2/COPYING +24 -0
  7. package/darwin_arm64/third-party/libsmb2/LICENCE-LGPL-2.1.txt +502 -0
  8. package/darwin_arm64/third-party/libsmb2/NOTICE.txt +13 -0
  9. package/darwin_arm64/third-party/libsmb2/README +413 -0
  10. package/darwin_arm64/third-party/libsmb2/source/CMakeLists.txt +205 -0
  11. package/darwin_arm64/third-party/libsmb2/source/COPYING +24 -0
  12. package/darwin_arm64/third-party/libsmb2/source/LICENCE-LGPL-2.1.txt +502 -0
  13. package/darwin_arm64/third-party/libsmb2/source/Makefile.am +15 -0
  14. package/darwin_arm64/third-party/libsmb2/source/Makefile.platform +112 -0
  15. package/darwin_arm64/third-party/libsmb2/source/README +413 -0
  16. package/darwin_arm64/third-party/libsmb2/source/Xbox/libsmb2.sln +25 -0
  17. package/darwin_arm64/third-party/libsmb2/source/Xbox/libsmb2.vcxproj +248 -0
  18. package/darwin_arm64/third-party/libsmb2/source/Xbox/libsmb2.vcxproj.filters +304 -0
  19. package/darwin_arm64/third-party/libsmb2/source/Xbox 360/libsmb2.sln +32 -0
  20. package/darwin_arm64/third-party/libsmb2/source/Xbox 360/libsmb2.vcxproj +327 -0
  21. package/darwin_arm64/third-party/libsmb2/source/Xbox 360/libsmb2.vcxproj.filters +268 -0
  22. package/darwin_arm64/third-party/libsmb2/source/bootstrap +2 -0
  23. package/darwin_arm64/third-party/libsmb2/source/cmake/ConfigureChecks.cmake +63 -0
  24. package/darwin_arm64/third-party/libsmb2/source/cmake/FindSMB2.cmake +37 -0
  25. package/darwin_arm64/third-party/libsmb2/source/cmake/Modules/FindGSSAPI.cmake +30 -0
  26. package/darwin_arm64/third-party/libsmb2/source/cmake/Modules/FindLibKrb5.cmake +44 -0
  27. package/darwin_arm64/third-party/libsmb2/source/cmake/config.h.cmake +126 -0
  28. package/darwin_arm64/third-party/libsmb2/source/cmake/libsmb2.pc.cmake +14 -0
  29. package/darwin_arm64/third-party/libsmb2/source/component.mk +5 -0
  30. package/darwin_arm64/third-party/libsmb2/source/configure.ac +184 -0
  31. package/darwin_arm64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareAdd.yaml +9 -0
  32. package/darwin_arm64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareCheck.yaml +4 -0
  33. package/darwin_arm64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareDel.yaml +5 -0
  34. package/darwin_arm64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareDelSticky.yaml +5 -0
  35. package/darwin_arm64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareEnum.yaml +7 -0
  36. package/darwin_arm64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareGetInfo.yaml +6 -0
  37. package/darwin_arm64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareSetInfo.yaml +11 -0
  38. package/darwin_arm64/third-party/libsmb2/source/examples/CMakeLists.txt +28 -0
  39. package/darwin_arm64/third-party/libsmb2/source/examples/Makefile.am +54 -0
  40. package/darwin_arm64/third-party/libsmb2/source/examples/dcerpc.c +254 -0
  41. package/darwin_arm64/third-party/libsmb2/source/examples/picow/CMakeLists.txt +72 -0
  42. package/darwin_arm64/third-party/libsmb2/source/examples/picow/README.md +2 -0
  43. package/darwin_arm64/third-party/libsmb2/source/examples/picow/main.cpp +119 -0
  44. package/darwin_arm64/third-party/libsmb2/source/examples/picow/smb-ls-sync.c +0 -0
  45. package/darwin_arm64/third-party/libsmb2/source/examples/smb2-CMD-FIND.c +335 -0
  46. package/darwin_arm64/third-party/libsmb2/source/examples/smb2-cat-async.c +183 -0
  47. package/darwin_arm64/third-party/libsmb2/source/examples/smb2-cat-sync.c +105 -0
  48. package/darwin_arm64/third-party/libsmb2/source/examples/smb2-ftruncate-sync.c +87 -0
  49. package/darwin_arm64/third-party/libsmb2/source/examples/smb2-ls-async.c +185 -0
  50. package/darwin_arm64/third-party/libsmb2/source/examples/smb2-ls-epoll.c +234 -0
  51. package/darwin_arm64/third-party/libsmb2/source/examples/smb2-lsa-lookupsids.c +292 -0
  52. package/darwin_arm64/third-party/libsmb2/source/examples/smb2-lseek-sync.c +101 -0
  53. package/darwin_arm64/third-party/libsmb2/source/examples/smb2-notify.c +183 -0
  54. package/darwin_arm64/third-party/libsmb2/source/examples/smb2-put-async.c +175 -0
  55. package/darwin_arm64/third-party/libsmb2/source/examples/smb2-put-sync.c +100 -0
  56. package/darwin_arm64/third-party/libsmb2/source/examples/smb2-raw-fsstat-async.c +353 -0
  57. package/darwin_arm64/third-party/libsmb2/source/examples/smb2-raw-getsd-async.c +401 -0
  58. package/darwin_arm64/third-party/libsmb2/source/examples/smb2-raw-stat-async.c +448 -0
  59. package/darwin_arm64/third-party/libsmb2/source/examples/smb2-readlink.c +80 -0
  60. package/darwin_arm64/third-party/libsmb2/source/examples/smb2-rename-sync.c +80 -0
  61. package/darwin_arm64/third-party/libsmb2/source/examples/smb2-server-sync.c +497 -0
  62. package/darwin_arm64/third-party/libsmb2/source/examples/smb2-share-enum-sync.c +146 -0
  63. package/darwin_arm64/third-party/libsmb2/source/examples/smb2-share-enum.c +208 -0
  64. package/darwin_arm64/third-party/libsmb2/source/examples/smb2-share-info.c +255 -0
  65. package/darwin_arm64/third-party/libsmb2/source/examples/smb2-stat-sync.c +103 -0
  66. package/darwin_arm64/third-party/libsmb2/source/examples/smb2-statvfs-sync.c +85 -0
  67. package/darwin_arm64/third-party/libsmb2/source/examples/smb2-truncate-sync.c +78 -0
  68. package/darwin_arm64/third-party/libsmb2/source/idf_component.yml +5 -0
  69. package/darwin_arm64/third-party/libsmb2/source/include/Makefile.am +15 -0
  70. package/darwin_arm64/third-party/libsmb2/source/include/amiga_os/config.h +139 -0
  71. package/darwin_arm64/third-party/libsmb2/source/include/apple/config.h +139 -0
  72. package/darwin_arm64/third-party/libsmb2/source/include/asprintf.h +65 -0
  73. package/darwin_arm64/third-party/libsmb2/source/include/esp/config.h +139 -0
  74. package/darwin_arm64/third-party/libsmb2/source/include/libsmb2-private.h +670 -0
  75. package/darwin_arm64/third-party/libsmb2/source/include/module.modulemap +21 -0
  76. package/darwin_arm64/third-party/libsmb2/source/include/picow/FreeRTOSConfig.h +143 -0
  77. package/darwin_arm64/third-party/libsmb2/source/include/picow/README.md +2 -0
  78. package/darwin_arm64/third-party/libsmb2/source/include/picow/config.h +139 -0
  79. package/darwin_arm64/third-party/libsmb2/source/include/picow/lwipopts.h +27 -0
  80. package/darwin_arm64/third-party/libsmb2/source/include/picow/lwipopts_examples_common.h +90 -0
  81. package/darwin_arm64/third-party/libsmb2/source/include/portable-endian.h +377 -0
  82. package/darwin_arm64/third-party/libsmb2/source/include/ps3/config.h +139 -0
  83. package/darwin_arm64/third-party/libsmb2/source/include/slist.h +63 -0
  84. package/darwin_arm64/third-party/libsmb2/source/include/smb2/libsmb2-dcerpc-lsa.h +172 -0
  85. package/darwin_arm64/third-party/libsmb2/source/include/smb2/libsmb2-dcerpc-srvsvc.h +276 -0
  86. package/darwin_arm64/third-party/libsmb2/source/include/smb2/libsmb2-dcerpc.h +203 -0
  87. package/darwin_arm64/third-party/libsmb2/source/include/smb2/libsmb2-raw.h +497 -0
  88. package/darwin_arm64/third-party/libsmb2/source/include/smb2/libsmb2.h +1409 -0
  89. package/darwin_arm64/third-party/libsmb2/source/include/smb2/smb2-errors.h +549 -0
  90. package/darwin_arm64/third-party/libsmb2/source/include/smb2/smb2-ioctl.h +83 -0
  91. package/darwin_arm64/third-party/libsmb2/source/include/smb2/smb2.h +1251 -0
  92. package/darwin_arm64/third-party/libsmb2/source/include/xbox/config.h +139 -0
  93. package/darwin_arm64/third-party/libsmb2/source/include/xbox 360/config.h +139 -0
  94. package/darwin_arm64/third-party/libsmb2/source/lib/CMakeLists.txt +260 -0
  95. package/darwin_arm64/third-party/libsmb2/source/lib/Makefile.AMIGA +46 -0
  96. package/darwin_arm64/third-party/libsmb2/source/lib/Makefile.AMIGA_AROS +59 -0
  97. package/darwin_arm64/third-party/libsmb2/source/lib/Makefile.AMIGA_OS3 +59 -0
  98. package/darwin_arm64/third-party/libsmb2/source/lib/Makefile.PS3_PPU +100 -0
  99. package/darwin_arm64/third-party/libsmb2/source/lib/Makefile.am +85 -0
  100. package/darwin_arm64/third-party/libsmb2/source/lib/aes.c +33 -0
  101. package/darwin_arm64/third-party/libsmb2/source/lib/aes.h +29 -0
  102. package/darwin_arm64/third-party/libsmb2/source/lib/aes128ccm.c +185 -0
  103. package/darwin_arm64/third-party/libsmb2/source/lib/aes128ccm.h +28 -0
  104. package/darwin_arm64/third-party/libsmb2/source/lib/aes_apple.c +70 -0
  105. package/darwin_arm64/third-party/libsmb2/source/lib/aes_apple.h +34 -0
  106. package/darwin_arm64/third-party/libsmb2/source/lib/aes_reference.c +560 -0
  107. package/darwin_arm64/third-party/libsmb2/source/lib/aes_reference.h +49 -0
  108. package/darwin_arm64/third-party/libsmb2/source/lib/alloc.c +154 -0
  109. package/darwin_arm64/third-party/libsmb2/source/lib/asn1-ber.c +1078 -0
  110. package/darwin_arm64/third-party/libsmb2/source/lib/asn1-ber.h +161 -0
  111. package/darwin_arm64/third-party/libsmb2/source/lib/compat.c +599 -0
  112. package/darwin_arm64/third-party/libsmb2/source/lib/compat.h +829 -0
  113. package/darwin_arm64/third-party/libsmb2/source/lib/dcerpc-lsa.c +641 -0
  114. package/darwin_arm64/third-party/libsmb2/source/lib/dcerpc-srvsvc.c +885 -0
  115. package/darwin_arm64/third-party/libsmb2/source/lib/dcerpc.c +2513 -0
  116. package/darwin_arm64/third-party/libsmb2/source/lib/dreamcast/vfs.c +328 -0
  117. package/darwin_arm64/third-party/libsmb2/source/lib/dreamcast/vfs.h +15 -0
  118. package/darwin_arm64/third-party/libsmb2/source/lib/errors.c +1192 -0
  119. package/darwin_arm64/third-party/libsmb2/source/lib/hmac-md5.c +84 -0
  120. package/darwin_arm64/third-party/libsmb2/source/lib/hmac-md5.h +42 -0
  121. package/darwin_arm64/third-party/libsmb2/source/lib/hmac.c +245 -0
  122. package/darwin_arm64/third-party/libsmb2/source/lib/init.c +778 -0
  123. package/darwin_arm64/third-party/libsmb2/source/lib/krb5-wrapper.c +1072 -0
  124. package/darwin_arm64/third-party/libsmb2/source/lib/krb5-wrapper.h +134 -0
  125. package/darwin_arm64/third-party/libsmb2/source/lib/libsmb2.c +4292 -0
  126. package/darwin_arm64/third-party/libsmb2/source/lib/libsmb2.syms +168 -0
  127. package/darwin_arm64/third-party/libsmb2/source/lib/md4.h +43 -0
  128. package/darwin_arm64/third-party/libsmb2/source/lib/md4c.c +289 -0
  129. package/darwin_arm64/third-party/libsmb2/source/lib/md5.c +249 -0
  130. package/darwin_arm64/third-party/libsmb2/source/lib/md5.h +76 -0
  131. package/darwin_arm64/third-party/libsmb2/source/lib/ntlmssp.c +1380 -0
  132. package/darwin_arm64/third-party/libsmb2/source/lib/ntlmssp.h +84 -0
  133. package/darwin_arm64/third-party/libsmb2/source/lib/pdu.c +1159 -0
  134. package/darwin_arm64/third-party/libsmb2/source/lib/ps2/TODO +6 -0
  135. package/darwin_arm64/third-party/libsmb2/source/lib/ps2/imports.lst +84 -0
  136. package/darwin_arm64/third-party/libsmb2/source/lib/ps2/irx_imports.h +28 -0
  137. package/darwin_arm64/third-party/libsmb2/source/lib/ps2/ps2smb2.h +35 -0
  138. package/darwin_arm64/third-party/libsmb2/source/lib/ps2/smb2_fio.c +816 -0
  139. package/darwin_arm64/third-party/libsmb2/source/lib/ps2/smb2_fio.h +15 -0
  140. package/darwin_arm64/third-party/libsmb2/source/lib/ps2/smb2man.c +69 -0
  141. package/darwin_arm64/third-party/libsmb2/source/lib/sha-private.h +28 -0
  142. package/darwin_arm64/third-party/libsmb2/source/lib/sha.h +334 -0
  143. package/darwin_arm64/third-party/libsmb2/source/lib/sha1.c +450 -0
  144. package/darwin_arm64/third-party/libsmb2/source/lib/sha224-256.c +611 -0
  145. package/darwin_arm64/third-party/libsmb2/source/lib/sha384-512.c +1059 -0
  146. package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-close.c +240 -0
  147. package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-create.c +508 -0
  148. package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-echo.c +202 -0
  149. package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-error.c +157 -0
  150. package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-flush.c +207 -0
  151. package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-ioctl.c +445 -0
  152. package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-lock.c +312 -0
  153. package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-logoff.c +190 -0
  154. package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-negotiate.c +646 -0
  155. package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-notify-change.c +278 -0
  156. package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-oplock-break.c +543 -0
  157. package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-query-directory.c +580 -0
  158. package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-query-info.c +753 -0
  159. package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-read.c +391 -0
  160. package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-session-setup.c +331 -0
  161. package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-set-info.c +361 -0
  162. package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-tree-connect.c +278 -0
  163. package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-tree-disconnect.c +171 -0
  164. package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-write.c +319 -0
  165. package/darwin_arm64/third-party/libsmb2/source/lib/smb2-data-file-info.c +537 -0
  166. package/darwin_arm64/third-party/libsmb2/source/lib/smb2-data-filesystem-info.c +384 -0
  167. package/darwin_arm64/third-party/libsmb2/source/lib/smb2-data-reparse-point.c +117 -0
  168. package/darwin_arm64/third-party/libsmb2/source/lib/smb2-data-security-descriptor.c +361 -0
  169. package/darwin_arm64/third-party/libsmb2/source/lib/smb2-share-enum.c +181 -0
  170. package/darwin_arm64/third-party/libsmb2/source/lib/smb2-signing.c +279 -0
  171. package/darwin_arm64/third-party/libsmb2/source/lib/smb2-signing.h +51 -0
  172. package/darwin_arm64/third-party/libsmb2/source/lib/smb3-seal.c +165 -0
  173. package/darwin_arm64/third-party/libsmb2/source/lib/smb3-seal.h +43 -0
  174. package/darwin_arm64/third-party/libsmb2/source/lib/socket.c +1502 -0
  175. package/darwin_arm64/third-party/libsmb2/source/lib/spnego-wrapper.c +634 -0
  176. package/darwin_arm64/third-party/libsmb2/source/lib/spnego-wrapper.h +74 -0
  177. package/darwin_arm64/third-party/libsmb2/source/lib/sync.c +988 -0
  178. package/darwin_arm64/third-party/libsmb2/source/lib/timestamps.c +70 -0
  179. package/darwin_arm64/third-party/libsmb2/source/lib/unicode.c +307 -0
  180. package/darwin_arm64/third-party/libsmb2/source/lib/usha.c +345 -0
  181. package/darwin_arm64/third-party/libsmb2/source/libsmb2.pc.in +14 -0
  182. package/darwin_arm64/third-party/libsmb2/source/packaging/RPM/libsmb2.spec.in +135 -0
  183. package/darwin_arm64/third-party/libsmb2/source/packaging/RPM/makerpms.sh +114 -0
  184. package/darwin_arm64/third-party/libsmb2/source/tests/Makefile.am +34 -0
  185. package/darwin_arm64/third-party/libsmb2/source/tests/README +28 -0
  186. package/darwin_arm64/third-party/libsmb2/source/tests/aes128ccm-test.c +119 -0
  187. package/darwin_arm64/third-party/libsmb2/source/tests/functions.sh +11 -0
  188. package/darwin_arm64/third-party/libsmb2/source/tests/ld_sockerr.c +58 -0
  189. package/darwin_arm64/third-party/libsmb2/source/tests/metastat-0202-censored.c +136 -0
  190. package/darwin_arm64/third-party/libsmb2/source/tests/ntlmssp_generate_blob.c +123 -0
  191. package/darwin_arm64/third-party/libsmb2/source/tests/prog_cat.c +188 -0
  192. package/darwin_arm64/third-party/libsmb2/source/tests/prog_cat_cancel.c +203 -0
  193. package/darwin_arm64/third-party/libsmb2/source/tests/prog_ls.c +189 -0
  194. package/darwin_arm64/third-party/libsmb2/source/tests/prog_mkdir.c +85 -0
  195. package/darwin_arm64/third-party/libsmb2/source/tests/prog_rmdir.c +84 -0
  196. package/darwin_arm64/third-party/libsmb2/source/tests/smb2-dcerpc-coder-test.c +635 -0
  197. package/darwin_arm64/third-party/libsmb2/source/tests/test_0100_ls_basic.sh +22 -0
  198. package/darwin_arm64/third-party/libsmb2/source/tests/test_0101_ls_basic_valgrind.sh +23 -0
  199. package/darwin_arm64/third-party/libsmb2/source/tests/test_0102_ls_basic_socket_error.sh +16 -0
  200. package/darwin_arm64/third-party/libsmb2/source/tests/test_0103_ls_basic_valgrind_malloc_error.sh +25 -0
  201. package/darwin_arm64/third-party/libsmb2/source/tests/test_0200_mkdir.sh +15 -0
  202. package/darwin_arm64/third-party/libsmb2/source/tests/test_0201_mkdir_valgrind.sh +15 -0
  203. package/darwin_arm64/third-party/libsmb2/source/tests/test_0210_cp_basic.sh +25 -0
  204. package/darwin_arm64/third-party/libsmb2/source/tests/test_0211_cp_valgrind.sh +26 -0
  205. package/darwin_arm64/third-party/libsmb2/source/tests/test_0212_cp_valgrind_socket_error.sh +29 -0
  206. package/darwin_arm64/third-party/libsmb2/source/tests/test_0300_cat_basic.sh +13 -0
  207. package/darwin_arm64/third-party/libsmb2/source/tests/test_0301_cat_valgrind.sh +13 -0
  208. package/darwin_arm64/third-party/libsmb2/source/tests/test_0302_cat_valgrind_socket_error.sh +18 -0
  209. package/darwin_arm64/third-party/libsmb2/source/tests/test_0310_cancel_pdu.sh +13 -0
  210. package/darwin_arm64/third-party/libsmb2/source/tests/test_0400_overdrawn_0202.sh +25 -0
  211. package/darwin_arm64/third-party/libsmb2/source/tests/test_900_dcerpc.sh +10 -0
  212. package/darwin_arm64/third-party/libsmb2/source/utils/Makefile.am +11 -0
  213. package/darwin_arm64/third-party/libsmb2/source/utils/smb2-cp.c +265 -0
  214. package/darwin_arm64/third-party/libsmb2/source/utils/smb2-ls.c +135 -0
  215. package/linux_x64/libsmb2.so +0 -0
  216. package/linux_x64/libsmb2.so.1 +0 -0
  217. package/linux_x64/libsmb2.so.6.1.0 +0 -0
  218. package/linux_x64/smb_server_cpp_linux_x64 +0 -0
  219. package/linux_x64/third-party/libsmb2/COPYING +24 -0
  220. package/linux_x64/third-party/libsmb2/LICENCE-LGPL-2.1.txt +502 -0
  221. package/linux_x64/third-party/libsmb2/NOTICE.txt +13 -0
  222. package/linux_x64/third-party/libsmb2/README +413 -0
  223. package/linux_x64/third-party/libsmb2/source/CMakeLists.txt +205 -0
  224. package/linux_x64/third-party/libsmb2/source/COPYING +24 -0
  225. package/linux_x64/third-party/libsmb2/source/LICENCE-LGPL-2.1.txt +502 -0
  226. package/linux_x64/third-party/libsmb2/source/Makefile.am +15 -0
  227. package/linux_x64/third-party/libsmb2/source/Makefile.platform +112 -0
  228. package/linux_x64/third-party/libsmb2/source/README +413 -0
  229. package/linux_x64/third-party/libsmb2/source/Xbox/libsmb2.sln +25 -0
  230. package/linux_x64/third-party/libsmb2/source/Xbox/libsmb2.vcxproj +248 -0
  231. package/linux_x64/third-party/libsmb2/source/Xbox/libsmb2.vcxproj.filters +304 -0
  232. package/linux_x64/third-party/libsmb2/source/Xbox 360/libsmb2.sln +32 -0
  233. package/linux_x64/third-party/libsmb2/source/Xbox 360/libsmb2.vcxproj +327 -0
  234. package/linux_x64/third-party/libsmb2/source/Xbox 360/libsmb2.vcxproj.filters +268 -0
  235. package/linux_x64/third-party/libsmb2/source/bootstrap +2 -0
  236. package/linux_x64/third-party/libsmb2/source/cmake/ConfigureChecks.cmake +63 -0
  237. package/linux_x64/third-party/libsmb2/source/cmake/FindSMB2.cmake +37 -0
  238. package/linux_x64/third-party/libsmb2/source/cmake/Modules/FindGSSAPI.cmake +30 -0
  239. package/linux_x64/third-party/libsmb2/source/cmake/Modules/FindLibKrb5.cmake +44 -0
  240. package/linux_x64/third-party/libsmb2/source/cmake/config.h.cmake +126 -0
  241. package/linux_x64/third-party/libsmb2/source/cmake/libsmb2.pc.cmake +14 -0
  242. package/linux_x64/third-party/libsmb2/source/component.mk +5 -0
  243. package/linux_x64/third-party/libsmb2/source/configure.ac +184 -0
  244. package/linux_x64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareAdd.yaml +9 -0
  245. package/linux_x64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareCheck.yaml +4 -0
  246. package/linux_x64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareDel.yaml +5 -0
  247. package/linux_x64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareDelSticky.yaml +5 -0
  248. package/linux_x64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareEnum.yaml +7 -0
  249. package/linux_x64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareGetInfo.yaml +6 -0
  250. package/linux_x64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareSetInfo.yaml +11 -0
  251. package/linux_x64/third-party/libsmb2/source/examples/CMakeLists.txt +28 -0
  252. package/linux_x64/third-party/libsmb2/source/examples/Makefile.am +54 -0
  253. package/linux_x64/third-party/libsmb2/source/examples/dcerpc.c +254 -0
  254. package/linux_x64/third-party/libsmb2/source/examples/picow/CMakeLists.txt +72 -0
  255. package/linux_x64/third-party/libsmb2/source/examples/picow/README.md +2 -0
  256. package/linux_x64/third-party/libsmb2/source/examples/picow/main.cpp +119 -0
  257. package/linux_x64/third-party/libsmb2/source/examples/picow/smb-ls-sync.c +0 -0
  258. package/linux_x64/third-party/libsmb2/source/examples/smb2-CMD-FIND.c +335 -0
  259. package/linux_x64/third-party/libsmb2/source/examples/smb2-cat-async.c +183 -0
  260. package/linux_x64/third-party/libsmb2/source/examples/smb2-cat-sync.c +105 -0
  261. package/linux_x64/third-party/libsmb2/source/examples/smb2-ftruncate-sync.c +87 -0
  262. package/linux_x64/third-party/libsmb2/source/examples/smb2-ls-async.c +185 -0
  263. package/linux_x64/third-party/libsmb2/source/examples/smb2-ls-epoll.c +234 -0
  264. package/linux_x64/third-party/libsmb2/source/examples/smb2-lsa-lookupsids.c +292 -0
  265. package/linux_x64/third-party/libsmb2/source/examples/smb2-lseek-sync.c +101 -0
  266. package/linux_x64/third-party/libsmb2/source/examples/smb2-notify.c +183 -0
  267. package/linux_x64/third-party/libsmb2/source/examples/smb2-put-async.c +175 -0
  268. package/linux_x64/third-party/libsmb2/source/examples/smb2-put-sync.c +100 -0
  269. package/linux_x64/third-party/libsmb2/source/examples/smb2-raw-fsstat-async.c +353 -0
  270. package/linux_x64/third-party/libsmb2/source/examples/smb2-raw-getsd-async.c +401 -0
  271. package/linux_x64/third-party/libsmb2/source/examples/smb2-raw-stat-async.c +448 -0
  272. package/linux_x64/third-party/libsmb2/source/examples/smb2-readlink.c +80 -0
  273. package/linux_x64/third-party/libsmb2/source/examples/smb2-rename-sync.c +80 -0
  274. package/linux_x64/third-party/libsmb2/source/examples/smb2-server-sync.c +497 -0
  275. package/linux_x64/third-party/libsmb2/source/examples/smb2-share-enum-sync.c +146 -0
  276. package/linux_x64/third-party/libsmb2/source/examples/smb2-share-enum.c +208 -0
  277. package/linux_x64/third-party/libsmb2/source/examples/smb2-share-info.c +255 -0
  278. package/linux_x64/third-party/libsmb2/source/examples/smb2-stat-sync.c +103 -0
  279. package/linux_x64/third-party/libsmb2/source/examples/smb2-statvfs-sync.c +85 -0
  280. package/linux_x64/third-party/libsmb2/source/examples/smb2-truncate-sync.c +78 -0
  281. package/linux_x64/third-party/libsmb2/source/idf_component.yml +5 -0
  282. package/linux_x64/third-party/libsmb2/source/include/Makefile.am +15 -0
  283. package/linux_x64/third-party/libsmb2/source/include/amiga_os/config.h +139 -0
  284. package/linux_x64/third-party/libsmb2/source/include/apple/config.h +139 -0
  285. package/linux_x64/third-party/libsmb2/source/include/asprintf.h +65 -0
  286. package/linux_x64/third-party/libsmb2/source/include/esp/config.h +139 -0
  287. package/linux_x64/third-party/libsmb2/source/include/libsmb2-private.h +670 -0
  288. package/linux_x64/third-party/libsmb2/source/include/module.modulemap +21 -0
  289. package/linux_x64/third-party/libsmb2/source/include/picow/FreeRTOSConfig.h +143 -0
  290. package/linux_x64/third-party/libsmb2/source/include/picow/README.md +2 -0
  291. package/linux_x64/third-party/libsmb2/source/include/picow/config.h +139 -0
  292. package/linux_x64/third-party/libsmb2/source/include/picow/lwipopts.h +27 -0
  293. package/linux_x64/third-party/libsmb2/source/include/picow/lwipopts_examples_common.h +90 -0
  294. package/linux_x64/third-party/libsmb2/source/include/portable-endian.h +377 -0
  295. package/linux_x64/third-party/libsmb2/source/include/ps3/config.h +139 -0
  296. package/linux_x64/third-party/libsmb2/source/include/slist.h +63 -0
  297. package/linux_x64/third-party/libsmb2/source/include/smb2/libsmb2-dcerpc-lsa.h +172 -0
  298. package/linux_x64/third-party/libsmb2/source/include/smb2/libsmb2-dcerpc-srvsvc.h +276 -0
  299. package/linux_x64/third-party/libsmb2/source/include/smb2/libsmb2-dcerpc.h +203 -0
  300. package/linux_x64/third-party/libsmb2/source/include/smb2/libsmb2-raw.h +497 -0
  301. package/linux_x64/third-party/libsmb2/source/include/smb2/libsmb2.h +1409 -0
  302. package/linux_x64/third-party/libsmb2/source/include/smb2/smb2-errors.h +549 -0
  303. package/linux_x64/third-party/libsmb2/source/include/smb2/smb2-ioctl.h +83 -0
  304. package/linux_x64/third-party/libsmb2/source/include/smb2/smb2.h +1251 -0
  305. package/linux_x64/third-party/libsmb2/source/include/xbox/config.h +139 -0
  306. package/linux_x64/third-party/libsmb2/source/include/xbox 360/config.h +139 -0
  307. package/linux_x64/third-party/libsmb2/source/lib/CMakeLists.txt +260 -0
  308. package/linux_x64/third-party/libsmb2/source/lib/Makefile.AMIGA +46 -0
  309. package/linux_x64/third-party/libsmb2/source/lib/Makefile.AMIGA_AROS +59 -0
  310. package/linux_x64/third-party/libsmb2/source/lib/Makefile.AMIGA_OS3 +59 -0
  311. package/linux_x64/third-party/libsmb2/source/lib/Makefile.PS3_PPU +100 -0
  312. package/linux_x64/third-party/libsmb2/source/lib/Makefile.am +85 -0
  313. package/linux_x64/third-party/libsmb2/source/lib/aes.c +33 -0
  314. package/linux_x64/third-party/libsmb2/source/lib/aes.h +29 -0
  315. package/linux_x64/third-party/libsmb2/source/lib/aes128ccm.c +185 -0
  316. package/linux_x64/third-party/libsmb2/source/lib/aes128ccm.h +28 -0
  317. package/linux_x64/third-party/libsmb2/source/lib/aes_apple.c +70 -0
  318. package/linux_x64/third-party/libsmb2/source/lib/aes_apple.h +34 -0
  319. package/linux_x64/third-party/libsmb2/source/lib/aes_reference.c +560 -0
  320. package/linux_x64/third-party/libsmb2/source/lib/aes_reference.h +49 -0
  321. package/linux_x64/third-party/libsmb2/source/lib/alloc.c +154 -0
  322. package/linux_x64/third-party/libsmb2/source/lib/asn1-ber.c +1078 -0
  323. package/linux_x64/third-party/libsmb2/source/lib/asn1-ber.h +161 -0
  324. package/linux_x64/third-party/libsmb2/source/lib/compat.c +599 -0
  325. package/linux_x64/third-party/libsmb2/source/lib/compat.h +829 -0
  326. package/linux_x64/third-party/libsmb2/source/lib/dcerpc-lsa.c +641 -0
  327. package/linux_x64/third-party/libsmb2/source/lib/dcerpc-srvsvc.c +885 -0
  328. package/linux_x64/third-party/libsmb2/source/lib/dcerpc.c +2513 -0
  329. package/linux_x64/third-party/libsmb2/source/lib/dreamcast/vfs.c +328 -0
  330. package/linux_x64/third-party/libsmb2/source/lib/dreamcast/vfs.h +15 -0
  331. package/linux_x64/third-party/libsmb2/source/lib/errors.c +1192 -0
  332. package/linux_x64/third-party/libsmb2/source/lib/hmac-md5.c +84 -0
  333. package/linux_x64/third-party/libsmb2/source/lib/hmac-md5.h +42 -0
  334. package/linux_x64/third-party/libsmb2/source/lib/hmac.c +245 -0
  335. package/linux_x64/third-party/libsmb2/source/lib/init.c +778 -0
  336. package/linux_x64/third-party/libsmb2/source/lib/krb5-wrapper.c +1072 -0
  337. package/linux_x64/third-party/libsmb2/source/lib/krb5-wrapper.h +134 -0
  338. package/linux_x64/third-party/libsmb2/source/lib/libsmb2.c +4292 -0
  339. package/linux_x64/third-party/libsmb2/source/lib/libsmb2.syms +168 -0
  340. package/linux_x64/third-party/libsmb2/source/lib/md4.h +43 -0
  341. package/linux_x64/third-party/libsmb2/source/lib/md4c.c +289 -0
  342. package/linux_x64/third-party/libsmb2/source/lib/md5.c +249 -0
  343. package/linux_x64/third-party/libsmb2/source/lib/md5.h +76 -0
  344. package/linux_x64/third-party/libsmb2/source/lib/ntlmssp.c +1380 -0
  345. package/linux_x64/third-party/libsmb2/source/lib/ntlmssp.h +84 -0
  346. package/linux_x64/third-party/libsmb2/source/lib/pdu.c +1159 -0
  347. package/linux_x64/third-party/libsmb2/source/lib/ps2/TODO +6 -0
  348. package/linux_x64/third-party/libsmb2/source/lib/ps2/imports.lst +84 -0
  349. package/linux_x64/third-party/libsmb2/source/lib/ps2/irx_imports.h +28 -0
  350. package/linux_x64/third-party/libsmb2/source/lib/ps2/ps2smb2.h +35 -0
  351. package/linux_x64/third-party/libsmb2/source/lib/ps2/smb2_fio.c +816 -0
  352. package/linux_x64/third-party/libsmb2/source/lib/ps2/smb2_fio.h +15 -0
  353. package/linux_x64/third-party/libsmb2/source/lib/ps2/smb2man.c +69 -0
  354. package/linux_x64/third-party/libsmb2/source/lib/sha-private.h +28 -0
  355. package/linux_x64/third-party/libsmb2/source/lib/sha.h +334 -0
  356. package/linux_x64/third-party/libsmb2/source/lib/sha1.c +450 -0
  357. package/linux_x64/third-party/libsmb2/source/lib/sha224-256.c +611 -0
  358. package/linux_x64/third-party/libsmb2/source/lib/sha384-512.c +1059 -0
  359. package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-close.c +240 -0
  360. package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-create.c +508 -0
  361. package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-echo.c +202 -0
  362. package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-error.c +157 -0
  363. package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-flush.c +207 -0
  364. package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-ioctl.c +445 -0
  365. package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-lock.c +312 -0
  366. package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-logoff.c +190 -0
  367. package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-negotiate.c +646 -0
  368. package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-notify-change.c +278 -0
  369. package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-oplock-break.c +543 -0
  370. package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-query-directory.c +580 -0
  371. package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-query-info.c +753 -0
  372. package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-read.c +391 -0
  373. package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-session-setup.c +331 -0
  374. package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-set-info.c +361 -0
  375. package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-tree-connect.c +278 -0
  376. package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-tree-disconnect.c +171 -0
  377. package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-write.c +319 -0
  378. package/linux_x64/third-party/libsmb2/source/lib/smb2-data-file-info.c +537 -0
  379. package/linux_x64/third-party/libsmb2/source/lib/smb2-data-filesystem-info.c +384 -0
  380. package/linux_x64/third-party/libsmb2/source/lib/smb2-data-reparse-point.c +117 -0
  381. package/linux_x64/third-party/libsmb2/source/lib/smb2-data-security-descriptor.c +361 -0
  382. package/linux_x64/third-party/libsmb2/source/lib/smb2-share-enum.c +181 -0
  383. package/linux_x64/third-party/libsmb2/source/lib/smb2-signing.c +279 -0
  384. package/linux_x64/third-party/libsmb2/source/lib/smb2-signing.h +51 -0
  385. package/linux_x64/third-party/libsmb2/source/lib/smb3-seal.c +165 -0
  386. package/linux_x64/third-party/libsmb2/source/lib/smb3-seal.h +43 -0
  387. package/linux_x64/third-party/libsmb2/source/lib/socket.c +1502 -0
  388. package/linux_x64/third-party/libsmb2/source/lib/spnego-wrapper.c +634 -0
  389. package/linux_x64/third-party/libsmb2/source/lib/spnego-wrapper.h +74 -0
  390. package/linux_x64/third-party/libsmb2/source/lib/sync.c +988 -0
  391. package/linux_x64/third-party/libsmb2/source/lib/timestamps.c +70 -0
  392. package/linux_x64/third-party/libsmb2/source/lib/unicode.c +307 -0
  393. package/linux_x64/third-party/libsmb2/source/lib/usha.c +345 -0
  394. package/linux_x64/third-party/libsmb2/source/libsmb2.pc.in +14 -0
  395. package/linux_x64/third-party/libsmb2/source/packaging/RPM/libsmb2.spec.in +135 -0
  396. package/linux_x64/third-party/libsmb2/source/packaging/RPM/makerpms.sh +114 -0
  397. package/linux_x64/third-party/libsmb2/source/tests/Makefile.am +34 -0
  398. package/linux_x64/third-party/libsmb2/source/tests/README +28 -0
  399. package/linux_x64/third-party/libsmb2/source/tests/aes128ccm-test.c +119 -0
  400. package/linux_x64/third-party/libsmb2/source/tests/functions.sh +11 -0
  401. package/linux_x64/third-party/libsmb2/source/tests/ld_sockerr.c +58 -0
  402. package/linux_x64/third-party/libsmb2/source/tests/metastat-0202-censored.c +136 -0
  403. package/linux_x64/third-party/libsmb2/source/tests/ntlmssp_generate_blob.c +123 -0
  404. package/linux_x64/third-party/libsmb2/source/tests/prog_cat.c +188 -0
  405. package/linux_x64/third-party/libsmb2/source/tests/prog_cat_cancel.c +203 -0
  406. package/linux_x64/third-party/libsmb2/source/tests/prog_ls.c +189 -0
  407. package/linux_x64/third-party/libsmb2/source/tests/prog_mkdir.c +85 -0
  408. package/linux_x64/third-party/libsmb2/source/tests/prog_rmdir.c +84 -0
  409. package/linux_x64/third-party/libsmb2/source/tests/smb2-dcerpc-coder-test.c +635 -0
  410. package/linux_x64/third-party/libsmb2/source/tests/test_0100_ls_basic.sh +22 -0
  411. package/linux_x64/third-party/libsmb2/source/tests/test_0101_ls_basic_valgrind.sh +23 -0
  412. package/linux_x64/third-party/libsmb2/source/tests/test_0102_ls_basic_socket_error.sh +16 -0
  413. package/linux_x64/third-party/libsmb2/source/tests/test_0103_ls_basic_valgrind_malloc_error.sh +25 -0
  414. package/linux_x64/third-party/libsmb2/source/tests/test_0200_mkdir.sh +15 -0
  415. package/linux_x64/third-party/libsmb2/source/tests/test_0201_mkdir_valgrind.sh +15 -0
  416. package/linux_x64/third-party/libsmb2/source/tests/test_0210_cp_basic.sh +25 -0
  417. package/linux_x64/third-party/libsmb2/source/tests/test_0211_cp_valgrind.sh +26 -0
  418. package/linux_x64/third-party/libsmb2/source/tests/test_0212_cp_valgrind_socket_error.sh +29 -0
  419. package/linux_x64/third-party/libsmb2/source/tests/test_0300_cat_basic.sh +13 -0
  420. package/linux_x64/third-party/libsmb2/source/tests/test_0301_cat_valgrind.sh +13 -0
  421. package/linux_x64/third-party/libsmb2/source/tests/test_0302_cat_valgrind_socket_error.sh +18 -0
  422. package/linux_x64/third-party/libsmb2/source/tests/test_0310_cancel_pdu.sh +13 -0
  423. package/linux_x64/third-party/libsmb2/source/tests/test_0400_overdrawn_0202.sh +25 -0
  424. package/linux_x64/third-party/libsmb2/source/tests/test_900_dcerpc.sh +10 -0
  425. package/linux_x64/third-party/libsmb2/source/utils/Makefile.am +11 -0
  426. package/linux_x64/third-party/libsmb2/source/utils/smb2-cp.c +265 -0
  427. package/linux_x64/third-party/libsmb2/source/utils/smb2-ls.c +135 -0
  428. package/package.json +10 -4
  429. package/smb2.proto +164 -0
  430. package/win32_x64/smb2.dll +0 -0
  431. package/win32_x64/smb_server_cpp_win32_x64.exe +0 -0
  432. package/win32_x64/third-party/libsmb2/COPYING +24 -0
  433. package/win32_x64/third-party/libsmb2/LICENCE-LGPL-2.1.txt +502 -0
  434. package/win32_x64/third-party/libsmb2/NOTICE.txt +13 -0
  435. package/win32_x64/third-party/libsmb2/README +413 -0
  436. package/win32_x64/third-party/libsmb2/source/CMakeLists.txt +205 -0
  437. package/win32_x64/third-party/libsmb2/source/COPYING +24 -0
  438. package/win32_x64/third-party/libsmb2/source/LICENCE-LGPL-2.1.txt +502 -0
  439. package/win32_x64/third-party/libsmb2/source/Makefile.am +15 -0
  440. package/win32_x64/third-party/libsmb2/source/Makefile.platform +112 -0
  441. package/win32_x64/third-party/libsmb2/source/README +413 -0
  442. package/win32_x64/third-party/libsmb2/source/Xbox/libsmb2.sln +25 -0
  443. package/win32_x64/third-party/libsmb2/source/Xbox/libsmb2.vcxproj +248 -0
  444. package/win32_x64/third-party/libsmb2/source/Xbox/libsmb2.vcxproj.filters +304 -0
  445. package/win32_x64/third-party/libsmb2/source/Xbox 360/libsmb2.sln +32 -0
  446. package/win32_x64/third-party/libsmb2/source/Xbox 360/libsmb2.vcxproj +327 -0
  447. package/win32_x64/third-party/libsmb2/source/Xbox 360/libsmb2.vcxproj.filters +268 -0
  448. package/win32_x64/third-party/libsmb2/source/bootstrap +2 -0
  449. package/win32_x64/third-party/libsmb2/source/cmake/ConfigureChecks.cmake +63 -0
  450. package/win32_x64/third-party/libsmb2/source/cmake/FindSMB2.cmake +37 -0
  451. package/win32_x64/third-party/libsmb2/source/cmake/Modules/FindGSSAPI.cmake +30 -0
  452. package/win32_x64/third-party/libsmb2/source/cmake/Modules/FindLibKrb5.cmake +44 -0
  453. package/win32_x64/third-party/libsmb2/source/cmake/config.h.cmake +126 -0
  454. package/win32_x64/third-party/libsmb2/source/cmake/libsmb2.pc.cmake +14 -0
  455. package/win32_x64/third-party/libsmb2/source/component.mk +5 -0
  456. package/win32_x64/third-party/libsmb2/source/configure.ac +184 -0
  457. package/win32_x64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareAdd.yaml +9 -0
  458. package/win32_x64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareCheck.yaml +4 -0
  459. package/win32_x64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareDel.yaml +5 -0
  460. package/win32_x64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareDelSticky.yaml +5 -0
  461. package/win32_x64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareEnum.yaml +7 -0
  462. package/win32_x64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareGetInfo.yaml +6 -0
  463. package/win32_x64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareSetInfo.yaml +11 -0
  464. package/win32_x64/third-party/libsmb2/source/examples/CMakeLists.txt +28 -0
  465. package/win32_x64/third-party/libsmb2/source/examples/Makefile.am +54 -0
  466. package/win32_x64/third-party/libsmb2/source/examples/dcerpc.c +254 -0
  467. package/win32_x64/third-party/libsmb2/source/examples/picow/CMakeLists.txt +72 -0
  468. package/win32_x64/third-party/libsmb2/source/examples/picow/README.md +2 -0
  469. package/win32_x64/third-party/libsmb2/source/examples/picow/main.cpp +119 -0
  470. package/win32_x64/third-party/libsmb2/source/examples/picow/smb-ls-sync.c +0 -0
  471. package/win32_x64/third-party/libsmb2/source/examples/smb2-CMD-FIND.c +335 -0
  472. package/win32_x64/third-party/libsmb2/source/examples/smb2-cat-async.c +183 -0
  473. package/win32_x64/third-party/libsmb2/source/examples/smb2-cat-sync.c +105 -0
  474. package/win32_x64/third-party/libsmb2/source/examples/smb2-ftruncate-sync.c +87 -0
  475. package/win32_x64/third-party/libsmb2/source/examples/smb2-ls-async.c +185 -0
  476. package/win32_x64/third-party/libsmb2/source/examples/smb2-ls-epoll.c +234 -0
  477. package/win32_x64/third-party/libsmb2/source/examples/smb2-lsa-lookupsids.c +292 -0
  478. package/win32_x64/third-party/libsmb2/source/examples/smb2-lseek-sync.c +101 -0
  479. package/win32_x64/third-party/libsmb2/source/examples/smb2-notify.c +183 -0
  480. package/win32_x64/third-party/libsmb2/source/examples/smb2-put-async.c +175 -0
  481. package/win32_x64/third-party/libsmb2/source/examples/smb2-put-sync.c +100 -0
  482. package/win32_x64/third-party/libsmb2/source/examples/smb2-raw-fsstat-async.c +353 -0
  483. package/win32_x64/third-party/libsmb2/source/examples/smb2-raw-getsd-async.c +401 -0
  484. package/win32_x64/third-party/libsmb2/source/examples/smb2-raw-stat-async.c +448 -0
  485. package/win32_x64/third-party/libsmb2/source/examples/smb2-readlink.c +80 -0
  486. package/win32_x64/third-party/libsmb2/source/examples/smb2-rename-sync.c +80 -0
  487. package/win32_x64/third-party/libsmb2/source/examples/smb2-server-sync.c +497 -0
  488. package/win32_x64/third-party/libsmb2/source/examples/smb2-share-enum-sync.c +146 -0
  489. package/win32_x64/third-party/libsmb2/source/examples/smb2-share-enum.c +208 -0
  490. package/win32_x64/third-party/libsmb2/source/examples/smb2-share-info.c +255 -0
  491. package/win32_x64/third-party/libsmb2/source/examples/smb2-stat-sync.c +103 -0
  492. package/win32_x64/third-party/libsmb2/source/examples/smb2-statvfs-sync.c +85 -0
  493. package/win32_x64/third-party/libsmb2/source/examples/smb2-truncate-sync.c +78 -0
  494. package/win32_x64/third-party/libsmb2/source/idf_component.yml +5 -0
  495. package/win32_x64/third-party/libsmb2/source/include/Makefile.am +15 -0
  496. package/win32_x64/third-party/libsmb2/source/include/amiga_os/config.h +139 -0
  497. package/win32_x64/third-party/libsmb2/source/include/apple/config.h +139 -0
  498. package/win32_x64/third-party/libsmb2/source/include/asprintf.h +65 -0
  499. package/win32_x64/third-party/libsmb2/source/include/esp/config.h +139 -0
  500. package/win32_x64/third-party/libsmb2/source/include/libsmb2-private.h +670 -0
  501. package/win32_x64/third-party/libsmb2/source/include/module.modulemap +21 -0
  502. package/win32_x64/third-party/libsmb2/source/include/picow/FreeRTOSConfig.h +143 -0
  503. package/win32_x64/third-party/libsmb2/source/include/picow/README.md +2 -0
  504. package/win32_x64/third-party/libsmb2/source/include/picow/config.h +139 -0
  505. package/win32_x64/third-party/libsmb2/source/include/picow/lwipopts.h +27 -0
  506. package/win32_x64/third-party/libsmb2/source/include/picow/lwipopts_examples_common.h +90 -0
  507. package/win32_x64/third-party/libsmb2/source/include/portable-endian.h +377 -0
  508. package/win32_x64/third-party/libsmb2/source/include/ps3/config.h +139 -0
  509. package/win32_x64/third-party/libsmb2/source/include/slist.h +63 -0
  510. package/win32_x64/third-party/libsmb2/source/include/smb2/libsmb2-dcerpc-lsa.h +172 -0
  511. package/win32_x64/third-party/libsmb2/source/include/smb2/libsmb2-dcerpc-srvsvc.h +276 -0
  512. package/win32_x64/third-party/libsmb2/source/include/smb2/libsmb2-dcerpc.h +203 -0
  513. package/win32_x64/third-party/libsmb2/source/include/smb2/libsmb2-raw.h +497 -0
  514. package/win32_x64/third-party/libsmb2/source/include/smb2/libsmb2.h +1409 -0
  515. package/win32_x64/third-party/libsmb2/source/include/smb2/smb2-errors.h +549 -0
  516. package/win32_x64/third-party/libsmb2/source/include/smb2/smb2-ioctl.h +83 -0
  517. package/win32_x64/third-party/libsmb2/source/include/smb2/smb2.h +1251 -0
  518. package/win32_x64/third-party/libsmb2/source/include/xbox/config.h +139 -0
  519. package/win32_x64/third-party/libsmb2/source/include/xbox 360/config.h +139 -0
  520. package/win32_x64/third-party/libsmb2/source/lib/CMakeLists.txt +260 -0
  521. package/win32_x64/third-party/libsmb2/source/lib/Makefile.AMIGA +46 -0
  522. package/win32_x64/third-party/libsmb2/source/lib/Makefile.AMIGA_AROS +59 -0
  523. package/win32_x64/third-party/libsmb2/source/lib/Makefile.AMIGA_OS3 +59 -0
  524. package/win32_x64/third-party/libsmb2/source/lib/Makefile.PS3_PPU +100 -0
  525. package/win32_x64/third-party/libsmb2/source/lib/Makefile.am +85 -0
  526. package/win32_x64/third-party/libsmb2/source/lib/aes.c +33 -0
  527. package/win32_x64/third-party/libsmb2/source/lib/aes.h +29 -0
  528. package/win32_x64/third-party/libsmb2/source/lib/aes128ccm.c +185 -0
  529. package/win32_x64/third-party/libsmb2/source/lib/aes128ccm.h +28 -0
  530. package/win32_x64/third-party/libsmb2/source/lib/aes_apple.c +70 -0
  531. package/win32_x64/third-party/libsmb2/source/lib/aes_apple.h +34 -0
  532. package/win32_x64/third-party/libsmb2/source/lib/aes_reference.c +560 -0
  533. package/win32_x64/third-party/libsmb2/source/lib/aes_reference.h +49 -0
  534. package/win32_x64/third-party/libsmb2/source/lib/alloc.c +154 -0
  535. package/win32_x64/third-party/libsmb2/source/lib/asn1-ber.c +1078 -0
  536. package/win32_x64/third-party/libsmb2/source/lib/asn1-ber.h +161 -0
  537. package/win32_x64/third-party/libsmb2/source/lib/compat.c +599 -0
  538. package/win32_x64/third-party/libsmb2/source/lib/compat.h +829 -0
  539. package/win32_x64/third-party/libsmb2/source/lib/dcerpc-lsa.c +641 -0
  540. package/win32_x64/third-party/libsmb2/source/lib/dcerpc-srvsvc.c +885 -0
  541. package/win32_x64/third-party/libsmb2/source/lib/dcerpc.c +2513 -0
  542. package/win32_x64/third-party/libsmb2/source/lib/dreamcast/vfs.c +328 -0
  543. package/win32_x64/third-party/libsmb2/source/lib/dreamcast/vfs.h +15 -0
  544. package/win32_x64/third-party/libsmb2/source/lib/errors.c +1192 -0
  545. package/win32_x64/third-party/libsmb2/source/lib/hmac-md5.c +84 -0
  546. package/win32_x64/third-party/libsmb2/source/lib/hmac-md5.h +42 -0
  547. package/win32_x64/third-party/libsmb2/source/lib/hmac.c +245 -0
  548. package/win32_x64/third-party/libsmb2/source/lib/init.c +778 -0
  549. package/win32_x64/third-party/libsmb2/source/lib/krb5-wrapper.c +1072 -0
  550. package/win32_x64/third-party/libsmb2/source/lib/krb5-wrapper.h +134 -0
  551. package/win32_x64/third-party/libsmb2/source/lib/libsmb2.c +4292 -0
  552. package/win32_x64/third-party/libsmb2/source/lib/libsmb2.syms +168 -0
  553. package/win32_x64/third-party/libsmb2/source/lib/md4.h +43 -0
  554. package/win32_x64/third-party/libsmb2/source/lib/md4c.c +289 -0
  555. package/win32_x64/third-party/libsmb2/source/lib/md5.c +249 -0
  556. package/win32_x64/third-party/libsmb2/source/lib/md5.h +76 -0
  557. package/win32_x64/third-party/libsmb2/source/lib/ntlmssp.c +1380 -0
  558. package/win32_x64/third-party/libsmb2/source/lib/ntlmssp.h +84 -0
  559. package/win32_x64/third-party/libsmb2/source/lib/pdu.c +1159 -0
  560. package/win32_x64/third-party/libsmb2/source/lib/ps2/TODO +6 -0
  561. package/win32_x64/third-party/libsmb2/source/lib/ps2/imports.lst +84 -0
  562. package/win32_x64/third-party/libsmb2/source/lib/ps2/irx_imports.h +28 -0
  563. package/win32_x64/third-party/libsmb2/source/lib/ps2/ps2smb2.h +35 -0
  564. package/win32_x64/third-party/libsmb2/source/lib/ps2/smb2_fio.c +816 -0
  565. package/win32_x64/third-party/libsmb2/source/lib/ps2/smb2_fio.h +15 -0
  566. package/win32_x64/third-party/libsmb2/source/lib/ps2/smb2man.c +69 -0
  567. package/win32_x64/third-party/libsmb2/source/lib/sha-private.h +28 -0
  568. package/win32_x64/third-party/libsmb2/source/lib/sha.h +334 -0
  569. package/win32_x64/third-party/libsmb2/source/lib/sha1.c +450 -0
  570. package/win32_x64/third-party/libsmb2/source/lib/sha224-256.c +611 -0
  571. package/win32_x64/third-party/libsmb2/source/lib/sha384-512.c +1059 -0
  572. package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-close.c +240 -0
  573. package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-create.c +508 -0
  574. package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-echo.c +202 -0
  575. package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-error.c +157 -0
  576. package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-flush.c +207 -0
  577. package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-ioctl.c +445 -0
  578. package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-lock.c +312 -0
  579. package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-logoff.c +190 -0
  580. package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-negotiate.c +646 -0
  581. package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-notify-change.c +278 -0
  582. package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-oplock-break.c +543 -0
  583. package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-query-directory.c +580 -0
  584. package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-query-info.c +753 -0
  585. package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-read.c +391 -0
  586. package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-session-setup.c +331 -0
  587. package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-set-info.c +361 -0
  588. package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-tree-connect.c +278 -0
  589. package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-tree-disconnect.c +171 -0
  590. package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-write.c +319 -0
  591. package/win32_x64/third-party/libsmb2/source/lib/smb2-data-file-info.c +537 -0
  592. package/win32_x64/third-party/libsmb2/source/lib/smb2-data-filesystem-info.c +384 -0
  593. package/win32_x64/third-party/libsmb2/source/lib/smb2-data-reparse-point.c +117 -0
  594. package/win32_x64/third-party/libsmb2/source/lib/smb2-data-security-descriptor.c +361 -0
  595. package/win32_x64/third-party/libsmb2/source/lib/smb2-share-enum.c +181 -0
  596. package/win32_x64/third-party/libsmb2/source/lib/smb2-signing.c +279 -0
  597. package/win32_x64/third-party/libsmb2/source/lib/smb2-signing.h +51 -0
  598. package/win32_x64/third-party/libsmb2/source/lib/smb3-seal.c +165 -0
  599. package/win32_x64/third-party/libsmb2/source/lib/smb3-seal.h +43 -0
  600. package/win32_x64/third-party/libsmb2/source/lib/socket.c +1502 -0
  601. package/win32_x64/third-party/libsmb2/source/lib/spnego-wrapper.c +634 -0
  602. package/win32_x64/third-party/libsmb2/source/lib/spnego-wrapper.h +74 -0
  603. package/win32_x64/third-party/libsmb2/source/lib/sync.c +988 -0
  604. package/win32_x64/third-party/libsmb2/source/lib/timestamps.c +70 -0
  605. package/win32_x64/third-party/libsmb2/source/lib/unicode.c +307 -0
  606. package/win32_x64/third-party/libsmb2/source/lib/usha.c +345 -0
  607. package/win32_x64/third-party/libsmb2/source/libsmb2.pc.in +14 -0
  608. package/win32_x64/third-party/libsmb2/source/packaging/RPM/libsmb2.spec.in +135 -0
  609. package/win32_x64/third-party/libsmb2/source/packaging/RPM/makerpms.sh +114 -0
  610. package/win32_x64/third-party/libsmb2/source/tests/Makefile.am +34 -0
  611. package/win32_x64/third-party/libsmb2/source/tests/README +28 -0
  612. package/win32_x64/third-party/libsmb2/source/tests/aes128ccm-test.c +119 -0
  613. package/win32_x64/third-party/libsmb2/source/tests/functions.sh +11 -0
  614. package/win32_x64/third-party/libsmb2/source/tests/ld_sockerr.c +58 -0
  615. package/win32_x64/third-party/libsmb2/source/tests/metastat-0202-censored.c +136 -0
  616. package/win32_x64/third-party/libsmb2/source/tests/ntlmssp_generate_blob.c +123 -0
  617. package/win32_x64/third-party/libsmb2/source/tests/prog_cat.c +188 -0
  618. package/win32_x64/third-party/libsmb2/source/tests/prog_cat_cancel.c +203 -0
  619. package/win32_x64/third-party/libsmb2/source/tests/prog_ls.c +189 -0
  620. package/win32_x64/third-party/libsmb2/source/tests/prog_mkdir.c +85 -0
  621. package/win32_x64/third-party/libsmb2/source/tests/prog_rmdir.c +84 -0
  622. package/win32_x64/third-party/libsmb2/source/tests/smb2-dcerpc-coder-test.c +635 -0
  623. package/win32_x64/third-party/libsmb2/source/tests/test_0100_ls_basic.sh +22 -0
  624. package/win32_x64/third-party/libsmb2/source/tests/test_0101_ls_basic_valgrind.sh +23 -0
  625. package/win32_x64/third-party/libsmb2/source/tests/test_0102_ls_basic_socket_error.sh +16 -0
  626. package/win32_x64/third-party/libsmb2/source/tests/test_0103_ls_basic_valgrind_malloc_error.sh +25 -0
  627. package/win32_x64/third-party/libsmb2/source/tests/test_0200_mkdir.sh +15 -0
  628. package/win32_x64/third-party/libsmb2/source/tests/test_0201_mkdir_valgrind.sh +15 -0
  629. package/win32_x64/third-party/libsmb2/source/tests/test_0210_cp_basic.sh +25 -0
  630. package/win32_x64/third-party/libsmb2/source/tests/test_0211_cp_valgrind.sh +26 -0
  631. package/win32_x64/third-party/libsmb2/source/tests/test_0212_cp_valgrind_socket_error.sh +29 -0
  632. package/win32_x64/third-party/libsmb2/source/tests/test_0300_cat_basic.sh +13 -0
  633. package/win32_x64/third-party/libsmb2/source/tests/test_0301_cat_valgrind.sh +13 -0
  634. package/win32_x64/third-party/libsmb2/source/tests/test_0302_cat_valgrind_socket_error.sh +18 -0
  635. package/win32_x64/third-party/libsmb2/source/tests/test_0310_cancel_pdu.sh +13 -0
  636. package/win32_x64/third-party/libsmb2/source/tests/test_0400_overdrawn_0202.sh +25 -0
  637. package/win32_x64/third-party/libsmb2/source/tests/test_900_dcerpc.sh +10 -0
  638. package/win32_x64/third-party/libsmb2/source/utils/Makefile.am +11 -0
  639. package/win32_x64/third-party/libsmb2/source/utils/smb2-cp.c +265 -0
  640. 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_ */