Full Code of miketeo/pysmb for AI

dev-1.2.x 44c2ac9a3bbd cached
254 files
3.3 MB
880.8k tokens
2129 symbols
1 requests
Download .txt
Showing preview only (3,524K chars total). Download the full file or copy to clipboard to get everything.
Repository: miketeo/pysmb
Branch: dev-1.2.x
Commit: 44c2ac9a3bbd
Files: 254
Total size: 3.3 MB

Directory structure:
gitextract_0ims3cyo/

├── .gitignore
├── .readthedocs.yaml
├── CHANGELOG
├── LICENSE
├── MANIFEST.in
├── README.md
├── README.txt
├── docs/
│   ├── doctrees/
│   │   ├── api/
│   │   │   ├── nmb_NBNSProtocol.doctree
│   │   │   ├── nmb_NetBIOS.doctree
│   │   │   ├── smb_SMBConnection.doctree
│   │   │   ├── smb_SMBHandler.doctree
│   │   │   ├── smb_SMBProtocolFactory.doctree
│   │   │   ├── smb_SharedDevice.doctree
│   │   │   ├── smb_SharedFile.doctree
│   │   │   ├── smb_exceptions.doctree
│   │   │   └── smb_security_descriptors.doctree
│   │   ├── environment.pickle
│   │   ├── extending.doctree
│   │   ├── index.doctree
│   │   └── upgrading.doctree
│   └── html/
│       ├── .buildinfo
│       ├── _modules/
│       │   ├── index.html
│       │   ├── nmb/
│       │   │   ├── NetBIOS.html
│       │   │   └── NetBIOSProtocol.html
│       │   └── smb/
│       │       ├── SMBConnection.html
│       │       ├── SMBProtocol.html
│       │       ├── base.html
│       │       ├── security_descriptors.html
│       │       └── smb_structs.html
│       ├── _sources/
│       │   ├── api/
│       │   │   ├── nmb_NBNSProtocol.rst.txt
│       │   │   ├── nmb_NBNSProtocol.txt
│       │   │   ├── nmb_NetBIOS.rst.txt
│       │   │   ├── nmb_NetBIOS.txt
│       │   │   ├── smb_SMBConnection.rst.txt
│       │   │   ├── smb_SMBConnection.txt
│       │   │   ├── smb_SMBHandler.rst.txt
│       │   │   ├── smb_SMBHandler.txt
│       │   │   ├── smb_SMBProtocolFactory.rst.txt
│       │   │   ├── smb_SMBProtocolFactory.txt
│       │   │   ├── smb_SharedDevice.rst.txt
│       │   │   ├── smb_SharedDevice.txt
│       │   │   ├── smb_SharedFile.rst.txt
│       │   │   ├── smb_SharedFile.txt
│       │   │   ├── smb_exceptions.rst.txt
│       │   │   ├── smb_exceptions.txt
│       │   │   ├── smb_security_descriptors.rst.txt
│       │   │   └── smb_security_descriptors.txt
│       │   ├── extending.rst.txt
│       │   ├── extending.txt
│       │   ├── index.rst.txt
│       │   ├── index.txt
│       │   ├── upgrading.rst.txt
│       │   └── upgrading.txt
│       ├── _static/
│       │   ├── _sphinx_javascript_frameworks_compat.js
│       │   ├── basic.css
│       │   ├── doctools.js
│       │   ├── documentation_options.js
│       │   ├── jquery-3.5.1.js
│       │   ├── jquery-3.6.0.js
│       │   ├── jquery.js
│       │   ├── language_data.js
│       │   ├── pygments.css
│       │   ├── searchtools.js
│       │   ├── sphinx_highlight.js
│       │   ├── sphinxdoc.css
│       │   ├── underscore-1.13.1.js
│       │   ├── underscore-1.3.1.js
│       │   ├── underscore.js
│       │   └── websupport.js
│       ├── api/
│       │   ├── nmb_NBNSProtocol.html
│       │   ├── nmb_NetBIOS.html
│       │   ├── smb_SMBConnection.html
│       │   ├── smb_SMBHandler.html
│       │   ├── smb_SMBProtocolFactory.html
│       │   ├── smb_SharedDevice.html
│       │   ├── smb_SharedFile.html
│       │   ├── smb_exceptions.html
│       │   └── smb_security_descriptors.html
│       ├── extending.html
│       ├── genindex.html
│       ├── index.html
│       ├── objects.inv
│       ├── py-modindex.html
│       ├── search.html
│       ├── searchindex.js
│       └── upgrading.html
├── python2/
│   ├── nmb/
│   │   ├── NetBIOS.py
│   │   ├── NetBIOSProtocol.py
│   │   ├── __init__.py
│   │   ├── base.py
│   │   ├── nmb_constants.py
│   │   ├── nmb_structs.py
│   │   └── utils.py
│   ├── smb/
│   │   ├── SMBConnection.py
│   │   ├── SMBHandler.py
│   │   ├── SMBProtocol.py
│   │   ├── __init__.py
│   │   ├── base.py
│   │   ├── ntlm.py
│   │   ├── security_descriptors.py
│   │   ├── securityblob.py
│   │   ├── smb2_constants.py
│   │   ├── smb2_structs.py
│   │   ├── smb_constants.py
│   │   ├── smb_structs.py
│   │   └── utils/
│   │       ├── README.txt
│   │       ├── U32.py
│   │       ├── __init__.py
│   │       ├── md4.py
│   │       ├── pyDes.py
│   │       ├── rc4.py
│   │       └── sha256.py
│   └── tests/
│       ├── DirectSMBConnectionTests/
│       │   ├── __init__.py
│       │   ├── test_SMBHandler.py
│       │   ├── test_auth.py
│       │   ├── test_createdeletedirectory.py
│       │   ├── test_echo.py
│       │   ├── test_listpath.py
│       │   ├── test_listshares.py
│       │   ├── test_listsnapshots.py
│       │   ├── test_rename.py
│       │   ├── test_retrievefile.py
│       │   ├── test_storefile.py
│       │   └── util.py
│       ├── DirectSMBTwistedTests/
│       │   ├── test_auth.py
│       │   ├── test_createdeletedirectory.py
│       │   ├── test_echo.py
│       │   ├── test_listpath.py
│       │   ├── test_listshares.py
│       │   ├── test_listsnapshots.py
│       │   ├── test_rename.py
│       │   ├── test_retrievefile.py
│       │   ├── test_storefile.py
│       │   └── util.py
│       ├── NetBIOSTests/
│       │   ├── __init__.py
│       │   └── test_queryname.py
│       ├── NetBIOSTwistedTests/
│       │   ├── __init__.py
│       │   └── test_queryname.py
│       ├── README.md
│       ├── SMBConnectionTests/
│       │   ├── __init__.py
│       │   ├── test_SMBHandler.py
│       │   ├── test_auth.py
│       │   ├── test_createdeletedirectory.py
│       │   ├── test_deletepattern.py
│       │   ├── test_echo.py
│       │   ├── test_getattributes.py
│       │   ├── test_listpath.py
│       │   ├── test_listshares.py
│       │   ├── test_listsnapshots.py
│       │   ├── test_rename.py
│       │   ├── test_retrievefile.py
│       │   ├── test_security.py
│       │   ├── test_storefile.py
│       │   ├── test_with_context.py
│       │   └── util.py
│       ├── SMBTwistedTests/
│       │   ├── __init__.py
│       │   ├── test_auth.py
│       │   ├── test_createdeletedirectory.py
│       │   ├── test_echo.py
│       │   ├── test_getattributes.py
│       │   ├── test_listpath.py
│       │   ├── test_listshares.py
│       │   ├── test_listsnapshots.py
│       │   ├── test_rename.py
│       │   ├── test_retrievefile.py
│       │   ├── test_storefile.py
│       │   └── util.py
│       ├── __init__.py
│       ├── connection.ini
│       ├── test_ntlm.py
│       ├── test_security_descriptors.py
│       └── test_securityblob.py
├── python3/
│   ├── nmb/
│   │   ├── NetBIOS.py
│   │   ├── NetBIOSProtocol.py
│   │   ├── __init__.py
│   │   ├── base.py
│   │   ├── nmb_constants.py
│   │   ├── nmb_structs.py
│   │   └── utils.py
│   ├── smb/
│   │   ├── SMBConnection.py
│   │   ├── SMBHandler.py
│   │   ├── SMBProtocol.py
│   │   ├── __init__.py
│   │   ├── base.py
│   │   ├── ntlm.py
│   │   ├── security_descriptors.py
│   │   ├── securityblob.py
│   │   ├── smb2_constants.py
│   │   ├── smb2_structs.py
│   │   ├── smb_constants.py
│   │   ├── smb_structs.py
│   │   ├── strategy.py
│   │   └── utils/
│   │       ├── U32.py
│   │       ├── __init__.py
│   │       ├── md4.py
│   │       ├── pyDes.py
│   │       ├── rc4.py
│   │       └── sha256.py
│   └── tests/
│       ├── DirectSMBConnectionTests/
│       │   ├── __init__.py
│       │   ├── test_auth.py
│       │   ├── test_createdeletedirectory.py
│       │   ├── test_echo.py
│       │   ├── test_listpath.py
│       │   ├── test_listshares.py
│       │   ├── test_listsnapshots.py
│       │   ├── test_rename.py
│       │   ├── test_retrievefile.py
│       │   ├── test_storefile.py
│       │   ├── test_tqdm.py
│       │   └── util.py
│       ├── NetBIOSTests/
│       │   ├── __init__.py
│       │   └── test_queryname.py
│       ├── README.md
│       ├── SMBConnectionTests/
│       │   ├── __init__.py
│       │   ├── test_SMBHandler.py
│       │   ├── test_auth.py
│       │   ├── test_createdeletedirectory.py
│       │   ├── test_deletepattern.py
│       │   ├── test_echo.py
│       │   ├── test_getattributes.py
│       │   ├── test_listpath.py
│       │   ├── test_listshares.py
│       │   ├── test_listsnapshots.py
│       │   ├── test_messages_in_exception.py
│       │   ├── test_rename.py
│       │   ├── test_retrievefile.py
│       │   ├── test_storefile.py
│       │   ├── test_with_context.py
│       │   └── util.py
│       ├── __init__.py
│       ├── connection.ini
│       ├── test_md4.py
│       ├── test_ntlm.py
│       ├── test_security_descriptors.py
│       └── test_securityblob.py
├── setup.py
├── sphinx/
│   ├── Makefile
│   ├── make.bat
│   ├── requirements.txt
│   └── source/
│       ├── api/
│       │   ├── nmb_NBNSProtocol.rst
│       │   ├── nmb_NetBIOS.rst
│       │   ├── smb_SMBConnection.rst
│       │   ├── smb_SMBHandler.rst
│       │   ├── smb_SMBProtocolFactory.rst
│       │   ├── smb_SharedDevice.rst
│       │   ├── smb_SharedFile.rst
│       │   ├── smb_exceptions.rst
│       │   └── smb_security_descriptors.rst
│       ├── conf.py
│       ├── extending.rst
│       ├── index.rst
│       └── upgrading.rst
└── utils/
    ├── ScanNetworkForSMB.py
    └── recursiveDelete.py

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
# Ignore per-file backup from text editors
*~

# For virtualenvs in development
/venv2
/venv3

#
# From https://github.com/github/gitignore/blob/master/Python.gitignore
#

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
#  Usually these files are written by a python script from a template
#  before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
#   For a library or package, you might want to ignore these files since the code is
#   intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
#   According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
#   However, in case of collaboration, if having platform-specific dependencies or dependencies
#   having no cross-platform support, pipenv may install dependencies that don't work, or not
#   install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

### End of https://github.com/github/gitignore/blob/master/Python.gitignore


================================================
FILE: .readthedocs.yaml
================================================
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
  os: ubuntu-22.04
  tools:
    python: "3.12"
    # You can also specify other tool versions:
    # nodejs: "20"
    # rust: "1.70"
    # golang: "1.20"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
  configuration: sphinx/source/conf.py
  # You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
  # builder: "dirhtml"
  # Fail on all warnings to avoid broken references
  # fail_on_warning: true

# Optionally build your docs in additional formats such as PDF and ePub
# formats:
#   - pdf
#   - epub

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
  install:
    - requirements: sphinx/requirements.txt


================================================
FILE: CHANGELOG
================================================
pysmb-1.2.13, 20 Sep 2025
=========================

- Fix type hinting issues on Python versions prior to 3.9. (#230)

pysmb-1.2.12, 19 Sep 2025
=========================

- Add support for NetBIOS packet polling on Linux (#229)

pysmb-1.2.11, 25 Mar 2025
=========================

- Fix out-of-memory issues during large file operations (due to accumulation of messages in message_history).

pysmb-1.2.10, 25 Sep 2024
=========================

- Fix a bug where the OperationFailure exceptions do not contain the error messages that were thrown when the exception occurred (#212)
- Update test cases to replace SafeConfigParser with ConfigParser (#219)
- Allow callers to override default tqdm kwargs (#222)

pysmb-1.2.9, 25 Dec 2022
========================

- Add support for tqdm progress display (#205)
- Fix bug where timeout parameter was not passed to socket.createConnection() (#202)

pysmb-1.2.8, 12 Jun 2022
========================

- Fix issue with listPath based on recommendation in #195
- Fix embedded MD4 algorithm
- Add SMB UTF-16 surrogate exception workaround policy

pysmb-1.2.7, 30 May 2021
========================

- Fix compatibility issues on file retrievals with Likewise servers (#177)
- Improve SMBConnection's connect() method to remove the need to provide sock_family
  parameter for IPv6 addresses in Python 3.x (#180)

pysmb-1.2.6, 9 Dec 2020
=======================
- Fix bug in SMB1 store file implmentation which generates SMB_COM_WRITE_ANDX
  packets larger than the allowed max buffer size (#175)

pysmb-1.2.5, 18 Oct 2020
=======================
- Fix bug in filename encoding which leads to failure for file retrieval and upload operations (#170 #171).
- Improve resetFileAttributes() method in SMBConnection class to allow the
  new attribute to be specified in the reset operation (#172).

pysmb-1.2.4, 6 Oct 2020
=======================
- Remove dependency on pycrypto as it is no longer under active maintenance

pysmb-1.2.3, 6 Oct 2020
=======================
- Fix bug in session key generation during session negotiation (#166)
- Fix bug in SMB message signing which leads to operation failures with Samba services.

pysmb-1.2.2, 5 Sep 2020
=======================
- Improve SMB URL handlers to support specifying server's machine name and IP
  address. (#162)
- Improvements to documentation on SMB URLs (#160)

pysmb-1.2.1, 17 May 2020
========================
- Fix bug in deleteFiles() method which can fail for certain search patterns.

pysmb-1.2.0, 17 May 2020
=========================
- Add new parameter, delete_matching_folders, to deleteFiles() method to
  support deletion of child folders that match the search pattern.

pysmb-1.1.29, 16 May 2020
=========================
- Fix unhandled exception for short NBNS queries #149
- Fix wildcard file deletion with servers on SMB2 protocol #33

pysmb-1.1.28, 23 Nov 2019
========================
- SharedFile instances returned from the listPath() method now has a new
  file_id attribute which represents the file reference number given by the SMB server.

pysmb-1.1.27, 9 Jan 2019
========================
- Remove support for SMB-2.1 dialect as it seems to have issues with Windows 2008 R2

pysmb-1.1.26, 5 Jan 2019
========================
- Prevents OperationError from being raised when listPath() operation does not
  return any matching file results.
- SMBConnection is now a context manager #122.

pysmb-1.1.25, 28 July 2018
========================
- Fix buggy support for search parameter in listPath() method. Add
  SMB_FILE_ATTRIBUTE_INCL_NORMAL bit constant to include 'normal' files with
  other file types in the returned result. From now on, pysmb defines a 'normal' file
  as a file entry that is not read-only, not hidden, not system, not archive and
  not a directory; it ignores other attributes like compression, indexed, sparse,
  temporary and encryption. listPath() method will now include 'normal' files
  using the default search parameter.
- Add isNormal property to SharedFile class to support test if the file is a
  'normal' file (according to pysmb definition of 'normal' file).

pysmb-1.1.24, 19 July 2018
========================
- Improve listPath implementation for SMB1
- Support for STATUS_PENDING responses across all SMB2 operations.

pysmb-1.1.23, 5 May 2018
========================
- Fix bug in listShares() method which fails when the remote server has many shares.
- Improve echo() method to test and fail if the provided data to echo is not a bytes object.
- Fix bug in listPath() method where the path to query is not properly terminated.

pysmb-1.1.22, 17 Sep 2017
========================
- Fix bug in getAttributes() method which should return only the filename
  instead of the entire path for the filename property for the return result.

pysmb-1.1.21, 9 Sep 2017
========================
- Fix bug where timestamp values for SMB1 getAttributes() response are not
  converted properly from FILETIME to epoch time values.

pysmb-1.1.20, 13 Aug 2017
=========================
- Add getSecurity() method to support security descriptors query via SMB2
- Improve retrieveFile() and retrieveFileFromOffset() methods to allow file
  retrievals over SMB2 even when the file is being locked on the server.
- Silently discards NMB SESSION_KEEPALIVE packets instead of raising warnings.
- SMB sessionID will be sent in ECHO requests to conform to SMB2 specs.
- Fix type errors for MD4 functions in python3.

pysmb-1.1.19, 13 Nov 2016
=========================
- Ignore STATUS_PENDING during delete and file store operations

pysmb-1.1.18, 9 Apr 2016
========================

- Rollback fixes to NTLMv2 response algorithm in pysmb 1.1.17. The fixes
  fail to work with some servers.
- Add missing errno imports in SMBConnection.py
- Fix UnboundLocalError raised when using type() in SMBConnection.py

pysmb-1.1.17, 11 Nov 2015
=========================

- Fix crashes in directory listing with keyerror 'support_dfs'
- Fix bugs in NTLMv2 response algorithm.
- Fix bugs where client domain is not included as part of the session negotiation.

pysmb-1.1.16, 10 May 2015
=========================

- Fix typo errors in authentication error messages
- Improve share listings on SMB2 protocol by ignoring interim STATUS_PENDING responses.

pysmb-1.1.15, 15 Feb 2015
=========================

- Add new parameter to SMBConnection's storeFileFromOffset method to determine
  whether the remote file is to be truncated before writing.

pysmb-1.1.14, 1 Feb 2015
========================

- Add support for DFS shares in listPath()
- Bug fix for python3's _listPath_SMB2 implementation

pysmb-1.1.13, 18 Oct 2014
=========================

- Add missing methods and improve compatibility with python3
- Fix bug in SMB2 rename implementation which fails to rename directory

pysmb-1.1.12, 21 Sep 2014
=========================

- Fix syntax error for python3 NBNSProtocol implementation
- Fix bug in SMB1 implementation which results in access denied errors with Samba 3.0

pysmb-1.1.11, 13 Sep 2014
=========================

- Add support for unicode characters in domain, username and password.
- Add storeFileFromOffset method to SMB API
- Fix bug in getAttributes implementation for SMB1
- Fix bug for NMB which uses broadcast flag for unicast queries
- Update the Tree Connect Andx request implementation to MS-SMB 2.2.4.7.1 extensions

pysmb-1.1.10, 29 Jun 2014
=========================

- Add getAttributes() method to SMBConnection and SMBProtocolFactory class
- Add isReadOnly property to SharedFile class

pysmb-1.1.9, 1 Jun 2014
=======================

- Add support for domains in smb:// URLs
- Fix a bug which fails to test for the correct GSS security provider OID values

pysmb-1.1.8, 21 Dec 2013
========================

- Fix a bug in storeFile() method when the destination file is not overwritten if
  it exists in SMB1 communication
- Fix a SMB1 authentication problem when extended negotation is not carried out
  because the remote server has specified its support for extended security in the
  payload, instead of in the message flags2.

pysmb-1.1.7, 27 Sep 2013
========================

- Improve listShares() function which can fail with the listing response is
  separated into multiple SMB packets for large number of shares.
- Fix bug in python3 implementation where session connection can fail when
  remote server supports message signing.

pysmb-1.1.6, 16 Aug 2013
========================

- Fix bug where the status of the SMB_COM_NEGOTIATE reply is not checked for error
  before allowing further processing.

pysmb-1.1.5, 19 June 2013
=========================

- Adds support for Direct hosting of SMB over TCP/IP (TCP port: 445)

pysmb-1.1.4, 31 May 2013
========================

- Improve query performance for query IP addresses for NetBIOS names in
  NetBIOSProtocol.py
- Fix bugs in SMBConnection when sending large data packets can result in
  AssertionError.

pysmb-1.1.3, 18 Mar 2013
========================

- Fix bug which results in endless loop in SMBConnection when remote CIFS
  server closes the connection.

pysmb-1.1.2, 28 Sep 2012
========================

- Improve queryIPForName() in nmb.NetBIOS and nmb.NBNSProtocol class to
  return only server machine name and ignore workgroup names.

pysmb-1.1.1, 9 June 2012
========================

- Adds support for Python3. Noted that the Python3 SMB/NMB protocol implementations
  for Twisted are not well-tested as Twisted (as of v12.1) is not Python3 ready yet.
- Adds support for retrieving list of shadow copies (also known as
  "previous versions" in Windows). Note that not all Windows editions support shadow
  copies.


pysmb-1.1.0, 1 June 2012
========================

- Adds SMB2 protocol implementation with signing for outgoing SMB2 messages.
  pysmb will utilize SMB2 protocol with servers that support SMB2
  (eg. Windows Vista, Windows 7 and Samba 3).
  If the remote server does not support SMB2, pysmb will fall back automatically
  to using SMB1 protocol.


pysmb-1.0.5, 7 May 2012
=======================

- Add supports for SMB message signing. pysmb will sign all SMB messages from
  the CIFS client to the server, but it does not verify the signatures of the
  SMB messages from the server.


pysmb-1.0.4, 1 May 2012
=======================

- Adds support for "smb://" URL in urllib2 python packages to retrieve or upload
  files from/to remote CIFS servers.
- Improve documentation


pysmb-1.0.3, 28 April 2012
===========================

- Fix a crash in SMB._storFile() method which occurs when the remote CIFS server
  utilizes a max raw size larger than 65535 bytes. The bug was discovered with
  Windows 7 Pro SP1.
- Fix a bug in SMB._listPath() method where the files/folders time information are
  not properly converted to Epoch time.
- Add NBNSProtocol.queryIPForName() and NetBIOS.queryIPForName() methods to
  query for a machine's NetBIOS name at the given IP address.
- Add SMBProtocol.retrieveFileFromOffset() and SMBConnection.retrieveFileFromOffset()
  methods for a finer control of file retrieval operation with read offset and write
  limits.


pysmb-1.0.2, 31 March 2012
==========================

- Fix a bug in SMB._handleSessionChallenge() method in base.py where the domain attribute
  was not used to generate the corresponding NTLM authentication packets, resulting in
  the default WORKGROUP domain for used for all subsequent authentications.

pysmb-1.0.1, 25 Jan 2012
========================

- Fixes a bug in listPath() method which causes directory listing for
  sub-directories to return an empty list.
- Fixes an incorrect implementation of the TRANS2_FIND_FIRST2 and
  TRANS2_FIND_NEXT2 request/response handling which causes directory listing
  to crash when the remote directory contains a certain number of entries.


pysmb-1.0.0, 25 Dec 2011
========================

- Completely rewrites pysmb. API is not compatible with previous pysmb-0.x.x
- Supports NTLMv1 and NTLMv2 authentication
- Adds in NMB/SMB protocol implementation for use with Twisted framework
- Tested with Windows XP SP3, Windows Vista, Windows 7 and Samba 3.x
- Requires Python 2.4.4 or later, and pyasn1. Not tested with Python3

pysmb-0.4.5, 22 Jun 2009
========================

- Prevents pysmb from failing when there are too many files/folders to
  be returned in a single SMB TRANS2 call. pysmb will "resume" requesting
  for more files/folders information in subsequent SMB TRANS2 requests.

pysmb-0.4.4, 12 Jan 2004
========================

- Add in support for AMK's Python Cryptography Toolkit which will be used
  for DES password hashing. If AMK's pycrypto is found, it will be used
  instead of mxCrypto.

pysmb-0.4.3, 22 Feb 2003
========================

- Fix a bug which fails to close the socket in nmb.py on socket exception
- Fix a bug which fails to close the NetBIOSSession in smb.py if the session
  has not been properly established yet.

pysmb-0.4.2, 03 Aug 2002
========================

- Add new methods to SharedFile instances, get_mtime_epoch, get_atime_epoch
  and get_ctime_epoch. These methods will return the mtime, atime and ctime in
  epoch time rather than SMB time.
- Remove debugging printout in smb.py which has been released accidentally
  with the last release.
- Fix a bug in smbcp which causes to local to remote copy to fail

pysmb-0.4.1, 22 Jun 2002
========================

- Fix a bug in smb.py which does not return the correct file size for files
  with their archive bits turned off. This results in these files not being
  retrieved or sent properly.
- Fix some typo error in the documentations

pysmb-0.4.0, 17 Apr 2002
========================

- Use NT LM0.12 dialect.
- New smb.SMBMachine class
- Add SMB.get_server_domain(), smb.get_server_os(), SMB.get_server_lanman()

pysmb-0.3.1, 12 Nov 2001
========================

- Fix a problem with some Windows server where an UID is required when server is in share mode.
  Now, pysmb calls login() with empty authentication information when server is in share mode.
- Add TYPE_DOMAIN_MASTER constant and description to nmb.py.

pysmb-0.3.0, 10 Nov 2001
========================

- Add support for services in share mode. Minor changes to smb.SMB class API.
- Fix a bug in smb.py's __raw_retr_file which has failed to initialize the max_buf_size prior to usage.
- Fix a bug in smblistshare which fails to print the correct NMB error message
- Modify smb.py not throw AttributeError in the destructor when there is an error while creating a session
  in the constructor

pysmb-0.2.0, 04 Oct 2001
========================

- Add support for encrypted authentication using DES
- Fix a bug(?) which treats all services and filenames as case-sensitive

pysmb-0.1.3, 03 Sep 2001
========================

- Fix a bug in smblistshare and smbdu which fails to catch the nmb.NetBIOSError raised when session
  setup fails.
- Fix a bug in smb.SMB that arises from the change in nmb.NetBIOSSession which sends
  the session port number as the remote host type.

pysmb-0.1.2, 01 Sep 2001
========================

- Fix a bug in nmb.NetBIOSSession which specifies a TYPE_WORKSTATION for remote host instead of TYPE_SERVER.
- Minor change to nmb.NetBIOSSession constructor API.
- Fix a bug in smbdu which raises OverflowError when printing long file size values.
- Fix a bug in smbcp which does not handle the destination path correctly when
  the source file is copied to a different filename.

pysmb-0.1.1, 25 Aug 2001
========================

- Change nmb's NetBIOS and NetBIOSSession class such that they raise a NetBIOSError
  with a tuple of ( err_msg, err_class, err_code )
- Add a function strerror() in both smb and nmb to return human readable messages
  for error codes.
- Fix a bug in smbcp which fails to print an error message and terminate when the
  remote source path is not found.
- Add in another utility, smblistshare.

pysmb-0.1.0, 20 Aug 2001
========================

- First public release


================================================
FILE: LICENSE
================================================

Copyright (C) 2001-2025 Michael Teo <miketeo (a) miketeo.net>

This software is provided 'as-is', without any express or implied warranty.
In no event will the author be held liable for any damages arising from the
use of this software.

Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not
   claim that you wrote the original software. If you use this software
   in a product, an acknowledgment in the product documentation would be
   appreciated but is not required.

2. Altered source versions must be plainly marked as such, and must not be
   misrepresented as being the original software.

3. This notice cannot be removed or altered from any source distribution.


================================================
FILE: MANIFEST.in
================================================
include LICENSE
include CHANGELOG
recursive-include python2 *
recursive-exclude python2 *.pyc
recursive-exclude python2 *~
recursive-include python3 *
recursive-exclude python3 *.pyc
recursive-exclude python3 *~
recursive-include sphinx *
recursive-include docs *
recursive-exclude docs *.zip


================================================
FILE: README.md
================================================
pysmb
=====

pysmb is an experimental SMB/CIFS library written in Python. It implements the client-side SMB/CIFS protocol (SMB1 and SMB2) which allows your Python application to access and transfer files to/from SMB/CIFS shared folders like your Windows file sharing and Samba folders.

* Primary Project Website: https://miketeo.net/blog/projects/pysmb
* Documentation: http://pysmb.readthedocs.io/
* Issue Tracker: Please use the [issue tracker on github](https://github.com/miketeo/pysmb/issues).


================================================
FILE: README.txt
================================================
pysmb is an experimental SMB/CIFS library written in Python.
It implements the client-side SMB/CIFS protocol (SMB1 and SMB2) which allows your Python application to access
and transfer files to/from SMB/CIFS shared folders like your Windows file sharing and Samba folders.


================================================
FILE: docs/html/.buildinfo
================================================
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 02747f6883e56a04531aef4d47846d2a
tags: 645f666f9bcd5a90fca523b33c5a78b7


================================================
FILE: docs/html/_modules/index.html
================================================
<!DOCTYPE html>

<html lang="en" data-content_root="../">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Overview: module code &#8212; pysmb 1.2.13 documentation</title>
    <link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" />
    <link rel="stylesheet" type="text/css" href="../_static/sphinxdoc.css?v=d59dc883" />
    <script src="../_static/documentation_options.js?v=250a84ee"></script>
    <script src="../_static/doctools.js?v=888ff710"></script>
    <script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" /> 
  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="nav-item nav-item-0"><a href="../index.html">pysmb 1.2.13 documentation</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="">Overview: module code</a></li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <h1>All modules for which code is available</h1>
<ul><li><a href="nmb/NetBIOS.html">nmb.NetBIOS</a></li>
<li><a href="smb/security_descriptors.html">smb.security_descriptors</a></li>
<li><a href="smb/smb_structs.html">smb.smb_structs</a></li>
</ul>

            <div class="clearer"></div>
          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
<div id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</div>
<script>document.getElementById('searchbox').style.display = "block"</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="nav-item nav-item-0"><a href="../index.html">pysmb 1.2.13 documentation</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="">Overview: module code</a></li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
    &#169; Copyright 2001-2025, Michael Teo https://miketeo.net/.
      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.2.6.
    </div>
  </body>
</html>

================================================
FILE: docs/html/_modules/nmb/NetBIOS.html
================================================
<!DOCTYPE html>

<html lang="en" data-content_root="../../">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>nmb.NetBIOS &#8212; pysmb 1.2.12 documentation</title>
    <link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
    <link rel="stylesheet" type="text/css" href="../../_static/sphinxdoc.css?v=d59dc883" />
    <script src="../../_static/documentation_options.js?v=817200f7"></script>
    <script src="../../_static/doctools.js?v=888ff710"></script>
    <script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
    <link rel="index" title="Index" href="../../genindex.html" />
    <link rel="search" title="Search" href="../../search.html" /> 
  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../index.html">pysmb 1.2.12 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../index.html" accesskey="U">Module code</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="">nmb.NetBIOS</a></li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <h1>Source code for nmb.NetBIOS</h1><div class="highlight"><pre>
<span></span>
<span class="kn">import</span> <span class="nn">os</span><span class="o">,</span> <span class="nn">logging</span><span class="o">,</span> <span class="nn">random</span><span class="o">,</span> <span class="nn">socket</span><span class="o">,</span> <span class="nn">time</span><span class="o">,</span> <span class="nn">select</span>
<span class="kn">from</span> <span class="nn">.base</span> <span class="kn">import</span> <span class="n">NBNS</span><span class="p">,</span> <span class="n">NotConnectedError</span>
<span class="kn">from</span> <span class="nn">.nmb_constants</span> <span class="kn">import</span> <span class="n">TYPE_CLIENT</span><span class="p">,</span> <span class="n">TYPE_SERVER</span><span class="p">,</span> <span class="n">TYPE_WORKSTATION</span>

<div class="viewcode-block" id="NetBIOS">
<a class="viewcode-back" href="../../api/nmb_NetBIOS.html#nmb.NetBIOS.NetBIOS">[docs]</a>
<span class="k">class</span> <span class="nc">NetBIOS</span><span class="p">(</span><span class="n">NBNS</span><span class="p">):</span>

    <span class="n">log</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s1">&#39;NMB.NetBIOS&#39;</span><span class="p">)</span>

<div class="viewcode-block" id="NetBIOS.__init__">
<a class="viewcode-back" href="../../api/nmb_NetBIOS.html#nmb.NetBIOS.NetBIOS.__init__">[docs]</a>
    <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">broadcast</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> <span class="n">listen_port</span> <span class="o">=</span> <span class="mi">0</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Instantiate a NetBIOS instance, and creates a IPv4 UDP socket to listen/send NBNS packets.</span>

<span class="sd">        :param boolean broadcast: A boolean flag to indicate if we should setup the listening UDP port in broadcast mode</span>
<span class="sd">        :param integer listen_port: Specifies the UDP port number to bind to for listening. If zero, OS will automatically select a free port number.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">broadcast</span> <span class="o">=</span> <span class="n">broadcast</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">sock</span> <span class="o">=</span> <span class="n">socket</span><span class="o">.</span><span class="n">socket</span><span class="p">(</span><span class="n">socket</span><span class="o">.</span><span class="n">AF_INET</span><span class="p">,</span> <span class="n">socket</span><span class="o">.</span><span class="n">SOCK_DGRAM</span><span class="p">)</span>
        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">broadcast</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">sock</span><span class="o">.</span><span class="n">setsockopt</span><span class="p">(</span><span class="n">socket</span><span class="o">.</span><span class="n">SOL_SOCKET</span><span class="p">,</span> <span class="n">socket</span><span class="o">.</span><span class="n">SO_BROADCAST</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
        <span class="k">if</span> <span class="n">listen_port</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">sock</span><span class="o">.</span><span class="n">bind</span><span class="p">((</span> <span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="n">listen_port</span> <span class="p">))</span></div>


<div class="viewcode-block" id="NetBIOS.close">
<a class="viewcode-back" href="../../api/nmb_NetBIOS.html#nmb.NetBIOS.NetBIOS.close">[docs]</a>
    <span class="k">def</span> <span class="nf">close</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Close the underlying and free resources.</span>

<span class="sd">        The NetBIOS instance should not be used to perform any operations after this method returns.</span>

<span class="sd">        :return: None</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">sock</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">sock</span> <span class="o">=</span> <span class="kc">None</span></div>


    <span class="k">def</span> <span class="nf">write</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data</span><span class="p">,</span> <span class="n">ip</span><span class="p">,</span> <span class="n">port</span><span class="p">):</span>
        <span class="k">assert</span> <span class="bp">self</span><span class="o">.</span><span class="n">sock</span><span class="p">,</span> <span class="s1">&#39;Socket is already closed&#39;</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">sock</span><span class="o">.</span><span class="n">sendto</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="p">(</span> <span class="n">ip</span><span class="p">,</span> <span class="n">port</span> <span class="p">))</span>

<div class="viewcode-block" id="NetBIOS.queryName">
<a class="viewcode-back" href="../../api/nmb_NetBIOS.html#nmb.NetBIOS.NetBIOS.queryName">[docs]</a>
    <span class="k">def</span> <span class="nf">queryName</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">ip</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="n">port</span> <span class="o">=</span> <span class="mi">137</span><span class="p">,</span> <span class="n">timeout</span> <span class="o">=</span> <span class="mi">30</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Send a query on the network and hopes that if machine matching the *name* will reply with its IP address.</span>

<span class="sd">        :param string ip: If the NBNSProtocol instance was instianted with broadcast=True, then this parameter can be an empty string. We will leave it to the OS to determine an appropriate broadcast address.</span>
<span class="sd">                          If the NBNSProtocol instance was instianted with broadcast=False, then you should provide a target IP to send the query.</span>
<span class="sd">        :param integer port: The NetBIOS-NS port (IANA standard defines this port to be 137). You should not touch this parameter unless you know what you are doing.</span>
<span class="sd">        :param integer/float timeout: Number of seconds to wait for a reply, after which the method will return None</span>
<span class="sd">        :return: A list of IP addresses in dotted notation (aaa.bbb.ccc.ddd). On timeout, returns None.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">assert</span> <span class="bp">self</span><span class="o">.</span><span class="n">sock</span><span class="p">,</span> <span class="s1">&#39;Socket is already closed&#39;</span>

        <span class="n">trn_id</span> <span class="o">=</span> <span class="n">random</span><span class="o">.</span><span class="n">randint</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mh">0xFFFF</span><span class="p">)</span>
        <span class="n">data</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">prepareNameQuery</span><span class="p">(</span><span class="n">trn_id</span><span class="p">,</span> <span class="n">name</span><span class="p">)</span>
        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">broadcast</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">ip</span><span class="p">:</span>
            <span class="n">ip</span> <span class="o">=</span> <span class="s1">&#39;&lt;broadcast&gt;&#39;</span>
        <span class="k">elif</span> <span class="ow">not</span> <span class="n">ip</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">log</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span><span class="s1">&#39;queryName: ip parameter is empty. OS might not transmit this query to the network&#39;</span><span class="p">)</span>

        <span class="bp">self</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">ip</span><span class="p">,</span> <span class="n">port</span><span class="p">)</span>

        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_pollForNetBIOSPacket</span><span class="p">(</span><span class="n">trn_id</span><span class="p">,</span> <span class="n">timeout</span><span class="p">)</span></div>


<div class="viewcode-block" id="NetBIOS.queryIPForName">
<a class="viewcode-back" href="../../api/nmb_NetBIOS.html#nmb.NetBIOS.NetBIOS.queryIPForName">[docs]</a>
    <span class="k">def</span> <span class="nf">queryIPForName</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ip</span><span class="p">,</span> <span class="n">port</span> <span class="o">=</span> <span class="mi">137</span><span class="p">,</span> <span class="n">timeout</span> <span class="o">=</span> <span class="mi">30</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Send a query to the machine with *ip* and hopes that the machine will reply back with its name.</span>

<span class="sd">        The implementation of this function is contributed by Jason Anderson.</span>

<span class="sd">        :param string ip: If the NBNSProtocol instance was instianted with broadcast=True, then this parameter can be an empty string. We will leave it to the OS to determine an appropriate broadcast address.</span>
<span class="sd">                          If the NBNSProtocol instance was instianted with broadcast=False, then you should provide a target IP to send the query.</span>
<span class="sd">        :param integer port: The NetBIOS-NS port (IANA standard defines this port to be 137). You should not touch this parameter unless you know what you are doing.</span>
<span class="sd">        :param integer/float timeout: Number of seconds to wait for a reply, after which the method will return None</span>
<span class="sd">        :return: A list of string containing the names of the machine at *ip*. On timeout, returns None.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">assert</span> <span class="bp">self</span><span class="o">.</span><span class="n">sock</span><span class="p">,</span> <span class="s1">&#39;Socket is already closed&#39;</span>

        <span class="n">trn_id</span> <span class="o">=</span> <span class="n">random</span><span class="o">.</span><span class="n">randint</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mh">0xFFFF</span><span class="p">)</span>
        <span class="n">data</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">prepareNetNameQuery</span><span class="p">(</span><span class="n">trn_id</span><span class="p">,</span> <span class="kc">False</span><span class="p">)</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">ip</span><span class="p">,</span> <span class="n">port</span><span class="p">)</span>
        <span class="n">ret</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_pollForQueryPacket</span><span class="p">(</span><span class="n">trn_id</span><span class="p">,</span> <span class="n">timeout</span><span class="p">)</span>
        <span class="k">if</span> <span class="n">ret</span><span class="p">:</span>
            <span class="k">return</span> <span class="nb">list</span><span class="p">(</span><span class="nb">map</span><span class="p">(</span><span class="k">lambda</span> <span class="n">s</span><span class="p">:</span> <span class="n">s</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="nb">filter</span><span class="p">(</span><span class="k">lambda</span> <span class="n">s</span><span class="p">:</span> <span class="n">s</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">==</span> <span class="n">TYPE_SERVER</span><span class="p">,</span> <span class="n">ret</span><span class="p">)))</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="k">return</span> <span class="kc">None</span></div>


    <span class="c1">#</span>
    <span class="c1"># Protected Methods</span>
    <span class="c1">#</span>

    <span class="k">def</span> <span class="nf">_pollForNetBIOSPacket</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">wait_trn_id</span><span class="p">,</span> <span class="n">timeout</span><span class="p">):</span>
        <span class="n">end_time</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span> <span class="o">-</span> <span class="n">timeout</span>
        <span class="k">while</span> <span class="kc">True</span><span class="p">:</span>
            <span class="k">try</span><span class="p">:</span>
                <span class="n">_timeout</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span><span class="o">-</span><span class="n">end_time</span>
                <span class="k">if</span> <span class="n">_timeout</span> <span class="o">&lt;=</span> <span class="mi">0</span><span class="p">:</span>
                    <span class="k">return</span> <span class="kc">None</span>

                <span class="n">ready</span><span class="p">,</span> <span class="n">_</span><span class="p">,</span> <span class="n">_</span> <span class="o">=</span> <span class="n">select</span><span class="o">.</span><span class="n">select</span><span class="p">([</span> <span class="bp">self</span><span class="o">.</span><span class="n">sock</span><span class="o">.</span><span class="n">fileno</span><span class="p">()</span> <span class="p">],</span> <span class="p">[</span> <span class="p">],</span> <span class="p">[</span> <span class="p">],</span> <span class="n">_timeout</span><span class="p">)</span>
                <span class="k">if</span> <span class="ow">not</span> <span class="n">ready</span><span class="p">:</span>
                    <span class="k">return</span> <span class="kc">None</span>

                <span class="n">data</span><span class="p">,</span> <span class="n">_</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sock</span><span class="o">.</span><span class="n">recvfrom</span><span class="p">(</span><span class="mh">0xFFFF</span><span class="p">)</span>
                <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">data</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
                    <span class="k">raise</span> <span class="n">NotConnectedError</span>

                <span class="n">trn_id</span><span class="p">,</span> <span class="n">ret</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">decodePacket</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>

                <span class="k">if</span> <span class="n">trn_id</span> <span class="o">==</span> <span class="n">wait_trn_id</span><span class="p">:</span>
                    <span class="k">return</span> <span class="n">ret</span>
            <span class="k">except</span> <span class="n">select</span><span class="o">.</span><span class="n">error</span> <span class="k">as</span> <span class="n">ex</span><span class="p">:</span>
                <span class="k">if</span> <span class="nb">type</span><span class="p">(</span><span class="n">ex</span><span class="p">)</span> <span class="ow">is</span> <span class="nb">tuple</span><span class="p">:</span>
                    <span class="k">if</span> <span class="n">ex</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">!=</span> <span class="n">errno</span><span class="o">.</span><span class="n">EINTR</span> <span class="ow">and</span> <span class="n">ex</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">!=</span> <span class="n">errno</span><span class="o">.</span><span class="n">EAGAIN</span><span class="p">:</span>
                        <span class="k">raise</span> <span class="n">ex</span>
                <span class="k">else</span><span class="p">:</span>
                    <span class="k">raise</span> <span class="n">ex</span>

    <span class="c1">#</span>
    <span class="c1"># Contributed by Jason Anderson</span>
    <span class="c1">#</span>
    <span class="k">def</span> <span class="nf">_pollForQueryPacket</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">wait_trn_id</span><span class="p">,</span> <span class="n">timeout</span><span class="p">):</span>
        <span class="n">end_time</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span> <span class="o">-</span> <span class="n">timeout</span>
        <span class="k">while</span> <span class="kc">True</span><span class="p">:</span>
            <span class="k">try</span><span class="p">:</span>
                <span class="n">_timeout</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span><span class="o">-</span><span class="n">end_time</span>
                <span class="k">if</span> <span class="n">_timeout</span> <span class="o">&lt;=</span> <span class="mi">0</span><span class="p">:</span>
                    <span class="k">return</span> <span class="kc">None</span>

                <span class="n">ready</span><span class="p">,</span> <span class="n">_</span><span class="p">,</span> <span class="n">_</span> <span class="o">=</span> <span class="n">select</span><span class="o">.</span><span class="n">select</span><span class="p">([</span> <span class="bp">self</span><span class="o">.</span><span class="n">sock</span><span class="o">.</span><span class="n">fileno</span><span class="p">()</span> <span class="p">],</span> <span class="p">[</span> <span class="p">],</span> <span class="p">[</span> <span class="p">],</span> <span class="n">_timeout</span><span class="p">)</span>
                <span class="k">if</span> <span class="ow">not</span> <span class="n">ready</span><span class="p">:</span>
                    <span class="k">return</span> <span class="kc">None</span>

                <span class="n">data</span><span class="p">,</span> <span class="n">_</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sock</span><span class="o">.</span><span class="n">recvfrom</span><span class="p">(</span><span class="mh">0xFFFF</span><span class="p">)</span>
                <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">data</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
                    <span class="k">raise</span> <span class="n">NotConnectedError</span>

                <span class="n">trn_id</span><span class="p">,</span> <span class="n">ret</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">decodeIPQueryPacket</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>

                <span class="k">if</span> <span class="n">trn_id</span> <span class="o">==</span> <span class="n">wait_trn_id</span><span class="p">:</span>
                    <span class="k">return</span> <span class="n">ret</span>
            <span class="k">except</span> <span class="n">select</span><span class="o">.</span><span class="n">error</span> <span class="k">as</span> <span class="n">ex</span><span class="p">:</span>
                <span class="k">if</span> <span class="nb">type</span><span class="p">(</span><span class="n">ex</span><span class="p">)</span> <span class="ow">is</span> <span class="nb">tuple</span><span class="p">:</span>
                    <span class="k">if</span> <span class="n">ex</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">!=</span> <span class="n">errno</span><span class="o">.</span><span class="n">EINTR</span> <span class="ow">and</span> <span class="n">ex</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">!=</span> <span class="n">errno</span><span class="o">.</span><span class="n">EAGAIN</span><span class="p">:</span>
                        <span class="k">raise</span> <span class="n">ex</span>
                <span class="k">else</span><span class="p">:</span>
                    <span class="k">raise</span> <span class="n">ex</span></div>

</pre></div>

            <div class="clearer"></div>
          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
<div id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="../../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</div>
<script>document.getElementById('searchbox').style.display = "block"</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../index.html">pysmb 1.2.12 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../index.html" >Module code</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="">nmb.NetBIOS</a></li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
    &#169; Copyright 2001-2025, Michael Teo https://miketeo.net/.
      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.2.6.
    </div>
  </body>
</html>

================================================
FILE: docs/html/_modules/nmb/NetBIOSProtocol.html
================================================

<!DOCTYPE html>

<html>
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>nmb.NetBIOSProtocol &#8212; pysmb 1.2.7 documentation</title>
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/sphinxdoc.css" type="text/css" />
    <script id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
    <script src="../../_static/jquery.js"></script>
    <script src="../../_static/underscore.js"></script>
    <script src="../../_static/doctools.js"></script>
    <link rel="index" title="Index" href="../../genindex.html" />
    <link rel="search" title="Search" href="../../search.html" /> 
  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../index.html">pysmb 1.2.7 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../index.html" accesskey="U">Module code</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="">nmb.NetBIOSProtocol</a></li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <h1>Source code for nmb.NetBIOSProtocol</h1><div class="highlight"><pre>
<span></span>
<span class="kn">import</span> <span class="nn">os</span><span class="o">,</span> <span class="nn">logging</span><span class="o">,</span> <span class="nn">random</span><span class="o">,</span> <span class="nn">socket</span><span class="o">,</span> <span class="nn">time</span>
<span class="kn">from</span> <span class="nn">twisted.internet</span> <span class="kn">import</span> <span class="n">reactor</span><span class="p">,</span> <span class="n">defer</span>
<span class="kn">from</span> <span class="nn">twisted.internet.protocol</span> <span class="kn">import</span> <span class="n">DatagramProtocol</span>
<span class="kn">from</span> <span class="nn">.base</span> <span class="kn">import</span> <span class="n">NBNS</span>

<div class="viewcode-block" id="NetBIOSTimeout"><a class="viewcode-back" href="../../api/nmb_NBNSProtocol.html#nmb.NetBIOSProtocol.NetBIOSTimeout">[docs]</a><span class="k">class</span> <span class="nc">NetBIOSTimeout</span><span class="p">(</span><span class="ne">Exception</span><span class="p">):</span>
    <span class="sd">&quot;&quot;&quot;Raised in NBNSProtocol via Deferred.errback method when queryName method has timeout waiting for reply&quot;&quot;&quot;</span>
    <span class="k">pass</span></div>

<div class="viewcode-block" id="NBNSProtocol"><a class="viewcode-back" href="../../api/nmb_NBNSProtocol.html#nmb.NetBIOSProtocol.NBNSProtocol">[docs]</a><span class="k">class</span> <span class="nc">NBNSProtocol</span><span class="p">(</span><span class="n">DatagramProtocol</span><span class="p">,</span> <span class="n">NBNS</span><span class="p">):</span>

    <span class="n">log</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s1">&#39;NMB.NBNSProtocol&#39;</span><span class="p">)</span>

<div class="viewcode-block" id="NBNSProtocol.__init__"><a class="viewcode-back" href="../../api/nmb_NBNSProtocol.html#nmb.NetBIOSProtocol.NBNSProtocol.__init__">[docs]</a>    <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">broadcast</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> <span class="n">listen_port</span> <span class="o">=</span> <span class="mi">0</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Instantiate a NBNSProtocol instance.</span>

<span class="sd">        This automatically calls reactor.listenUDP method to start listening for incoming packets, so you **must not** call the listenUDP method again.</span>

<span class="sd">        :param boolean broadcast: A boolean flag to indicate if we should setup the listening UDP port in broadcast mode</span>
<span class="sd">        :param integer listen_port: Specifies the UDP port number to bind to for listening. If zero, OS will automatically select a free port number.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">broadcast</span> <span class="o">=</span> <span class="n">broadcast</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">pending_trns</span> <span class="o">=</span> <span class="p">{</span> <span class="p">}</span>  <span class="c1"># TRN ID -&gt; ( expiry_time, name, Deferred instance )</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">transport</span> <span class="o">=</span> <span class="n">reactor</span><span class="o">.</span><span class="n">listenUDP</span><span class="p">(</span><span class="n">listen_port</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span>
        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">broadcast</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">transport</span><span class="o">.</span><span class="n">getHandle</span><span class="p">()</span><span class="o">.</span><span class="n">setsockopt</span><span class="p">(</span><span class="n">socket</span><span class="o">.</span><span class="n">SOL_SOCKET</span><span class="p">,</span> <span class="n">socket</span><span class="o">.</span><span class="n">SO_BROADCAST</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
        <span class="n">reactor</span><span class="o">.</span><span class="n">callLater</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">cleanupPendingTrns</span><span class="p">)</span></div>

<div class="viewcode-block" id="NBNSProtocol.datagramReceived"><a class="viewcode-back" href="../../api/nmb_NBNSProtocol.html#nmb.NetBIOSProtocol.NBNSProtocol.datagramReceived">[docs]</a>    <span class="k">def</span> <span class="nf">datagramReceived</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data</span><span class="p">,</span> <span class="n">from_info</span><span class="p">):</span>
        <span class="n">host</span><span class="p">,</span> <span class="n">port</span> <span class="o">=</span> <span class="n">from_info</span>
        <span class="n">trn_id</span><span class="p">,</span> <span class="n">ret</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">decodePacket</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>

        <span class="c1"># pending transaction exists for trn_id - handle it and remove from queue</span>
        <span class="k">if</span> <span class="n">trn_id</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">pending_trns</span><span class="p">:</span>
            <span class="n">_</span><span class="p">,</span> <span class="n">ip</span><span class="p">,</span> <span class="n">d</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">pending_trns</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="n">trn_id</span><span class="p">)</span>
            <span class="k">if</span> <span class="n">ip</span> <span class="ow">is</span> <span class="n">NAME_QUERY</span><span class="p">:</span>
                <span class="c1"># decode as query packet</span>
                <span class="n">trn_id</span><span class="p">,</span> <span class="n">ret</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">decodeIPQueryPacket</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
            <span class="n">d</span><span class="o">.</span><span class="n">callback</span><span class="p">(</span><span class="n">ret</span><span class="p">)</span></div>

    <span class="k">def</span> <span class="nf">write</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data</span><span class="p">,</span> <span class="n">ip</span><span class="p">,</span> <span class="n">port</span><span class="p">):</span>
        <span class="c1"># We don&#39;t use the transport.write method directly as it keeps raising DeprecationWarning for ip=&#39;&lt;broadcast&gt;&#39;</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">transport</span><span class="o">.</span><span class="n">getHandle</span><span class="p">()</span><span class="o">.</span><span class="n">sendto</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="p">(</span> <span class="n">ip</span><span class="p">,</span> <span class="n">port</span> <span class="p">))</span>

<div class="viewcode-block" id="NBNSProtocol.queryName"><a class="viewcode-back" href="../../api/nmb_NBNSProtocol.html#nmb.NetBIOSProtocol.NBNSProtocol.queryName">[docs]</a>    <span class="k">def</span> <span class="nf">queryName</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">ip</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="n">port</span> <span class="o">=</span> <span class="mi">137</span><span class="p">,</span> <span class="n">timeout</span> <span class="o">=</span> <span class="mi">30</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Send a query on the network and hopes that if machine matching the *name* will reply with its IP address.</span>

<span class="sd">        :param string ip: If the NBNSProtocol instance was instianted with broadcast=True, then this parameter can be an empty string. We will leave it to the OS to determine an appropriate broadcast address.</span>
<span class="sd">                          If the NBNSProtocol instance was instianted with broadcast=False, then you should provide a target IP to send the query.</span>
<span class="sd">        :param integer port: The NetBIOS-NS port (IANA standard defines this port to be 137). You should not touch this parameter unless you know what you are doing.</span>
<span class="sd">        :param integer/float timeout: Number of seconds to wait for a reply, after which the returned Deferred instance will be called with a NetBIOSTimeout exception.</span>
<span class="sd">        :return: A *twisted.internet.defer.Deferred* instance. The callback function will be called with a list of IP addresses in dotted notation (aaa.bbb.ccc.ddd).</span>
<span class="sd">                 On timeout, the errback function will be called with a Failure instance wrapping around a NetBIOSTimeout exception</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="n">trn_id</span> <span class="o">=</span> <span class="n">random</span><span class="o">.</span><span class="n">randint</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mh">0xFFFF</span><span class="p">)</span>
        <span class="k">while</span> <span class="kc">True</span><span class="p">:</span>
            <span class="k">if</span> <span class="n">trn_id</span> <span class="ow">not</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">pending_trns</span><span class="p">:</span>
                <span class="k">break</span>
            <span class="k">else</span><span class="p">:</span>
                <span class="n">trn_id</span> <span class="o">=</span> <span class="p">(</span><span class="n">trn_id</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span> <span class="o">&amp;</span> <span class="mh">0xFFFF</span>

        <span class="n">data</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">prepareNameQuery</span><span class="p">(</span><span class="n">trn_id</span><span class="p">,</span> <span class="n">name</span><span class="p">)</span>
        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">broadcast</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">ip</span><span class="p">:</span>
            <span class="n">ip</span> <span class="o">=</span> <span class="s1">&#39;&lt;broadcast&gt;&#39;</span>
        <span class="k">elif</span> <span class="ow">not</span> <span class="n">ip</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">log</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span><span class="s1">&#39;queryName: ip parameter is empty. OS might not transmit this query to the network&#39;</span><span class="p">)</span>

        <span class="bp">self</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">ip</span><span class="p">,</span> <span class="n">port</span><span class="p">)</span>

        <span class="n">d</span> <span class="o">=</span> <span class="n">defer</span><span class="o">.</span><span class="n">Deferred</span><span class="p">()</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">pending_trns</span><span class="p">[</span><span class="n">trn_id</span><span class="p">]</span> <span class="o">=</span> <span class="p">(</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span><span class="o">+</span><span class="n">timeout</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">d</span> <span class="p">)</span>
        <span class="k">return</span> <span class="n">d</span></div>

<div class="viewcode-block" id="NBNSProtocol.queryIPForName"><a class="viewcode-back" href="../../api/nmb_NBNSProtocol.html#nmb.NetBIOSProtocol.NBNSProtocol.queryIPForName">[docs]</a>    <span class="k">def</span> <span class="nf">queryIPForName</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ip</span><span class="p">,</span> <span class="n">port</span> <span class="o">=</span> <span class="mi">137</span><span class="p">,</span> <span class="n">timeout</span> <span class="o">=</span> <span class="mi">30</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Send a query to the machine with *ip* and hopes that the machine will reply back with its name.</span>

<span class="sd">        The implementation of this function is contributed by Jason Anderson.</span>

<span class="sd">        :param string ip: If the NBNSProtocol instance was instianted with broadcast=True, then this parameter can be an empty string. We will leave it to the OS to determine an appropriate broadcast address.</span>
<span class="sd">                          If the NBNSProtocol instance was instianted with broadcast=False, then you should provide a target IP to send the query.</span>
<span class="sd">        :param integer port: The NetBIOS-NS port (IANA standard defines this port to be 137). You should not touch this parameter unless you know what you are doing.</span>
<span class="sd">        :param integer/float timeout: Number of seconds to wait for a reply, after which the method will return None</span>
<span class="sd">        :return: A *twisted.internet.defer.Deferred* instance. The callback function will be called with a list of names of the machine at *ip*.</span>
<span class="sd">                 On timeout, the errback function will be called with a Failure instance wrapping around a NetBIOSTimeout exception</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="n">trn_id</span> <span class="o">=</span> <span class="n">random</span><span class="o">.</span><span class="n">randint</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mh">0xFFFF</span><span class="p">)</span>
        <span class="k">while</span> <span class="kc">True</span><span class="p">:</span>
            <span class="k">if</span> <span class="n">trn_id</span> <span class="ow">not</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">pending_trns</span><span class="p">:</span>
                <span class="k">break</span>
            <span class="k">else</span><span class="p">:</span>
                <span class="n">trn_id</span> <span class="o">=</span> <span class="p">(</span><span class="n">trn_id</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span> <span class="o">&amp;</span> <span class="mh">0xFFFF</span>

        <span class="n">data</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">prepareNetNameQuery</span><span class="p">(</span><span class="n">trn_id</span><span class="p">)</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">ip</span><span class="p">,</span> <span class="n">port</span><span class="p">)</span>

        <span class="n">d</span> <span class="o">=</span> <span class="n">defer</span><span class="o">.</span><span class="n">Deferred</span><span class="p">()</span>
        <span class="n">d2</span> <span class="o">=</span> <span class="n">defer</span><span class="o">.</span><span class="n">Deferred</span><span class="p">()</span>
        <span class="n">d2</span><span class="o">.</span><span class="n">addErrback</span><span class="p">(</span><span class="n">d</span><span class="o">.</span><span class="n">errback</span><span class="p">)</span>

        <span class="k">def</span> <span class="nf">stripCode</span><span class="p">(</span><span class="n">ret</span><span class="p">):</span>
            <span class="k">if</span> <span class="n">ret</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span> <span class="c1"># got valid response. Somehow the callback is also called when there is an error.</span>
                <span class="n">d</span><span class="o">.</span><span class="n">callback</span><span class="p">(</span><span class="nb">map</span><span class="p">(</span><span class="k">lambda</span> <span class="n">s</span><span class="p">:</span> <span class="n">s</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="nb">filter</span><span class="p">(</span><span class="k">lambda</span> <span class="n">s</span><span class="p">:</span> <span class="n">s</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">==</span> <span class="n">TYPE_SERVER</span><span class="p">,</span> <span class="n">ret</span><span class="p">)))</span>

        <span class="n">d2</span><span class="o">.</span><span class="n">addCallback</span><span class="p">(</span><span class="n">stripCode</span><span class="p">)</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">pending_trns</span><span class="p">[</span><span class="n">trn_id</span><span class="p">]</span> <span class="o">=</span> <span class="p">(</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span><span class="o">+</span><span class="n">timeout</span><span class="p">,</span> <span class="n">NAME_QUERY</span><span class="p">,</span> <span class="n">d2</span> <span class="p">)</span>
        <span class="k">return</span> <span class="n">d</span></div>

<div class="viewcode-block" id="NBNSProtocol.stopProtocol"><a class="viewcode-back" href="../../api/nmb_NBNSProtocol.html#nmb.NetBIOSProtocol.NBNSProtocol.stopProtocol">[docs]</a>    <span class="k">def</span> <span class="nf">stopProtocol</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="n">DatagramProtocol</span><span class="o">.</span><span class="n">stopProtocol</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span></div>

    <span class="k">def</span> <span class="nf">cleanupPendingTrns</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="n">now</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span>

        <span class="c1"># reply should have been received in the past</span>
        <span class="c1"># info is tuple of ( expiry_time, name, d )</span>
        <span class="n">expired</span> <span class="o">=</span> <span class="nb">filter</span><span class="p">(</span><span class="k">lambda</span> <span class="n">trn_id</span><span class="p">,</span> <span class="n">info</span><span class="p">:</span> <span class="n">info</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">&lt;</span> <span class="n">now</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">pending_trns</span><span class="o">.</span><span class="n">iteritems</span><span class="p">())</span>

        <span class="c1"># remove expired items from dict + call errback</span>
        <span class="k">def</span> <span class="nf">expire_item</span><span class="p">(</span><span class="n">item</span><span class="p">):</span>
            <span class="n">trn_id</span><span class="p">,</span> <span class="p">(</span><span class="n">expiry_time</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">d</span><span class="p">)</span> <span class="o">=</span> <span class="n">item</span>

            <span class="k">del</span> <span class="bp">self</span><span class="o">.</span><span class="n">pending_trns</span><span class="p">[</span><span class="n">trn_id</span><span class="p">]</span>
            <span class="k">try</span><span class="p">:</span>
                <span class="n">d</span><span class="o">.</span><span class="n">errback</span><span class="p">(</span><span class="n">NetBIOSTimeout</span><span class="p">(</span><span class="n">name</span><span class="p">))</span>
            <span class="k">except</span><span class="p">:</span> <span class="k">pass</span>

        <span class="nb">map</span><span class="p">(</span><span class="n">expire_item</span><span class="p">,</span> <span class="n">expired</span><span class="p">)</span>

        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">transport</span><span class="p">:</span>
            <span class="n">reactor</span><span class="o">.</span><span class="n">callLater</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">cleanupPendingTrns</span><span class="p">)</span></div>
</pre></div>

            <div class="clearer"></div>
          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
<div id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="../../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" />
      <input type="submit" value="Go" />
    </form>
    </div>
</div>
<script>$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../index.html">pysmb 1.2.7 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../index.html" >Module code</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="">nmb.NetBIOSProtocol</a></li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2001-2021, Michael Teo https://miketeo.net/.
      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.4.3.
    </div>
  </body>
</html>

================================================
FILE: docs/html/_modules/smb/SMBConnection.html
================================================

<!DOCTYPE html>

<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>smb.SMBConnection &#8212; pysmb 1.2.9 documentation</title>
    <link rel="stylesheet" type="text/css" href="../../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../../_static/sphinxdoc.css" />
    <script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js"></script>
    <script src="../../_static/jquery.js"></script>
    <script src="../../_static/underscore.js"></script>
    <script src="../../_static/_sphinx_javascript_frameworks_compat.js"></script>
    <script src="../../_static/doctools.js"></script>
    <link rel="index" title="Index" href="../../genindex.html" />
    <link rel="search" title="Search" href="../../search.html" /> 
  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../index.html">pysmb 1.2.9 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../index.html" accesskey="U">Module code</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="">smb.SMBConnection</a></li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <h1>Source code for smb.SMBConnection</h1><div class="highlight"><pre>
<span></span>
<span class="kn">import</span> <span class="nn">os</span><span class="o">,</span> <span class="nn">logging</span><span class="o">,</span> <span class="nn">select</span><span class="o">,</span> <span class="nn">socket</span><span class="o">,</span> <span class="nn">types</span><span class="o">,</span> <span class="nn">struct</span><span class="o">,</span> <span class="nn">errno</span>

<span class="kn">from</span> <span class="nn">tqdm</span> <span class="kn">import</span> <span class="n">tqdm</span>
<span class="kn">from</span> <span class="nn">.smb_constants</span> <span class="kn">import</span> <span class="o">*</span>
<span class="kn">from</span> <span class="nn">.smb_structs</span> <span class="kn">import</span> <span class="o">*</span>
<span class="kn">from</span> <span class="nn">.base</span> <span class="kn">import</span> <span class="n">SMB</span><span class="p">,</span> <span class="n">NotConnectedError</span><span class="p">,</span> <span class="n">NotReadyError</span><span class="p">,</span> <span class="n">SMBTimeout</span>


<div class="viewcode-block" id="SMBConnection"><a class="viewcode-back" href="../../api/smb_SMBConnection.html#smb.SMBConnection.SMBConnection">[docs]</a><span class="k">class</span> <span class="nc">SMBConnection</span><span class="p">(</span><span class="n">SMB</span><span class="p">):</span>

    <span class="n">log</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s1">&#39;SMB.SMBConnection&#39;</span><span class="p">)</span>

    <span class="c1">#: SMB messages will never be signed regardless of remote server&#39;s configurations; access errors will occur if the remote server requires signing.</span>
    <span class="n">SIGN_NEVER</span> <span class="o">=</span> <span class="mi">0</span>
    <span class="c1">#: SMB messages will be signed when remote server supports signing but not requires signing.</span>
    <span class="n">SIGN_WHEN_SUPPORTED</span> <span class="o">=</span> <span class="mi">1</span>
    <span class="c1">#: SMB messages will only be signed when remote server requires signing.</span>
    <span class="n">SIGN_WHEN_REQUIRED</span> <span class="o">=</span> <span class="mi">2</span>

<div class="viewcode-block" id="SMBConnection.__init__"><a class="viewcode-back" href="../../api/smb_SMBConnection.html#smb.SMBConnection.SMBConnection.__init__">[docs]</a>    <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">username</span><span class="p">,</span> <span class="n">password</span><span class="p">,</span> <span class="n">my_name</span><span class="p">,</span> <span class="n">remote_name</span><span class="p">,</span> <span class="n">domain</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="n">use_ntlm_v2</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> <span class="n">sign_options</span> <span class="o">=</span> <span class="n">SIGN_WHEN_REQUIRED</span><span class="p">,</span> <span class="n">is_direct_tcp</span> <span class="o">=</span> <span class="kc">False</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Create a new SMBConnection instance.</span>

<span class="sd">        *username* and *password* are the user credentials required to authenticate the underlying SMB connection with the remote server.</span>
<span class="sd">        *password* can be a string or a callable returning a string.</span>
<span class="sd">        File operations can only be proceeded after the connection has been authenticated successfully.</span>

<span class="sd">        Note that you need to call *connect* method to actually establish the SMB connection to the remote server and perform authentication.</span>

<span class="sd">        The default TCP port for most SMB/CIFS servers using NetBIOS over TCP/IP is 139.</span>
<span class="sd">        Some newer server installations might also support Direct hosting of SMB over TCP/IP; for these servers, the default TCP port is 445.</span>

<span class="sd">        :param string my_name: The local NetBIOS machine name that will identify where this connection is originating from.</span>
<span class="sd">                               You can freely choose a name as long as it contains a maximum of 15 alphanumeric characters and does not contain spaces and any of ``\\/:*?&quot;;|+``</span>
<span class="sd">        :param string remote_name: The NetBIOS machine name of the remote server.</span>
<span class="sd">                                   On windows, you can find out the machine name by right-clicking on the &quot;My Computer&quot; and selecting &quot;Properties&quot;.</span>
<span class="sd">                                   This parameter must be the same as what has been configured on the remote server, or else the connection will be rejected.</span>
<span class="sd">        :param string domain: The network domain. On windows, it is known as the workgroup. Usually, it is safe to leave this parameter as an empty string.</span>
<span class="sd">        :param boolean use_ntlm_v2: Indicates whether pysmb should be NTLMv1 or NTLMv2 authentication algorithm for authentication.</span>
<span class="sd">                                    The choice of NTLMv1 and NTLMv2 is configured on the remote server, and there is no mechanism to auto-detect which algorithm has been configured.</span>
<span class="sd">                                    Hence, we can only &quot;guess&quot; or try both algorithms.</span>
<span class="sd">                                    On Sambda, Windows Vista and Windows 7, NTLMv2 is enabled by default. On Windows XP, we can use NTLMv1 before NTLMv2.</span>
<span class="sd">        :param int sign_options: Determines whether SMB messages will be signed. Default is *SIGN_WHEN_REQUIRED*.</span>
<span class="sd">                                 If *SIGN_WHEN_REQUIRED* (value=2), SMB messages will only be signed when remote server requires signing.</span>
<span class="sd">                                 If *SIGN_WHEN_SUPPORTED* (value=1), SMB messages will be signed when remote server supports signing but not requires signing.</span>
<span class="sd">                                 If *SIGN_NEVER* (value=0), SMB messages will never be signed regardless of remote server&#39;s configurations; access errors will occur if the remote server requires signing.</span>
<span class="sd">        :param boolean is_direct_tcp: Controls whether the NetBIOS over TCP/IP (is_direct_tcp=False) or the newer Direct hosting of SMB over TCP/IP (is_direct_tcp=True) will be used for the communication.</span>
<span class="sd">                                      The default parameter is False which will use NetBIOS over TCP/IP for wider compatibility (TCP port: 139).</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="n">SMB</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">username</span><span class="p">,</span> <span class="n">password</span><span class="p">,</span> <span class="n">my_name</span><span class="p">,</span> <span class="n">remote_name</span><span class="p">,</span> <span class="n">domain</span><span class="p">,</span> <span class="n">use_ntlm_v2</span><span class="p">,</span> <span class="n">sign_options</span><span class="p">,</span> <span class="n">is_direct_tcp</span><span class="p">)</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">sock</span> <span class="o">=</span> <span class="kc">None</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">auth_result</span> <span class="o">=</span> <span class="kc">None</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">False</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">is_direct_tcp</span> <span class="o">=</span> <span class="n">is_direct_tcp</span></div>

    <span class="c1">#</span>
    <span class="c1"># SMB (and its superclass) Methods</span>
    <span class="c1">#</span>

    <span class="k">def</span> <span class="nf">onAuthOK</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">auth_result</span> <span class="o">=</span> <span class="kc">True</span>

    <span class="k">def</span> <span class="nf">onAuthFailed</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">auth_result</span> <span class="o">=</span> <span class="kc">False</span>

    <span class="k">def</span> <span class="nf">write</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data</span><span class="p">):</span>
        <span class="k">assert</span> <span class="bp">self</span><span class="o">.</span><span class="n">sock</span>
        <span class="n">data_len</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
        <span class="n">total_sent</span> <span class="o">=</span> <span class="mi">0</span>
        <span class="k">while</span> <span class="n">total_sent</span> <span class="o">&lt;</span> <span class="n">data_len</span><span class="p">:</span>
            <span class="n">sent</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sock</span><span class="o">.</span><span class="n">send</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="n">total_sent</span><span class="p">:])</span>
            <span class="k">if</span> <span class="n">sent</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
                <span class="k">raise</span> <span class="n">NotConnectedError</span><span class="p">(</span><span class="s1">&#39;Server disconnected&#39;</span><span class="p">)</span>
            <span class="n">total_sent</span> <span class="o">=</span> <span class="n">total_sent</span> <span class="o">+</span> <span class="n">sent</span>

    <span class="c1">#</span>
    <span class="c1"># Support for &quot;with&quot; context</span>
    <span class="c1">#</span>
    <span class="k">def</span> <span class="fm">__enter__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="k">return</span> <span class="bp">self</span>

    <span class="k">def</span> <span class="fm">__exit__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">):</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>

    <span class="c1">#</span>
    <span class="c1"># Misc Properties</span>
    <span class="c1">#</span>

    <span class="nd">@property</span>
    <span class="k">def</span> <span class="nf">isUsingSMB2</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;A convenient property to return True if the underlying SMB connection is using SMB2 protocol.&quot;&quot;&quot;</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_using_smb2</span>


    <span class="c1">#</span>
    <span class="c1"># Public Methods</span>
    <span class="c1">#</span>

<div class="viewcode-block" id="SMBConnection.connect"><a class="viewcode-back" href="../../api/smb_SMBConnection.html#smb.SMBConnection.SMBConnection.connect">[docs]</a>    <span class="k">def</span> <span class="nf">connect</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ip</span><span class="p">,</span> <span class="n">port</span> <span class="o">=</span> <span class="mi">139</span><span class="p">,</span> <span class="n">sock_family</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> <span class="n">timeout</span> <span class="o">=</span> <span class="mi">60</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Establish the SMB connection to the remote SMB/CIFS server.</span>

<span class="sd">        You must call this method before attempting any of the file operations with the remote server.</span>
<span class="sd">        This method will block until the SMB connection has attempted at least one authentication.</span>

<span class="sd">        :param port: Defaults to 139. If you are using direct TCP mode (is_direct_tcp=true when creating this SMBConnection instance), use 445.</span>
<span class="sd">        :param sock_family: In Python 3.x, use *None* as we can infer the socket family from the provided *ip*. In Python 2.x, it must be either *socket.AF_INET* or *socket.AF_INET6*.</span>
<span class="sd">        :return: A boolean value indicating the result of the authentication atttempt: True if authentication is successful; False, if otherwise.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">sock</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">sock</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>

        <span class="bp">self</span><span class="o">.</span><span class="n">auth_result</span> <span class="o">=</span> <span class="kc">None</span>
        <span class="k">if</span> <span class="n">sock_family</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">sock</span> <span class="o">=</span> <span class="n">socket</span><span class="o">.</span><span class="n">socket</span><span class="p">(</span><span class="n">sock_family</span><span class="p">)</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">sock</span><span class="o">.</span><span class="n">settimeout</span><span class="p">(</span><span class="n">timeout</span><span class="p">)</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">sock</span><span class="o">.</span><span class="n">connect</span><span class="p">((</span> <span class="n">ip</span><span class="p">,</span> <span class="n">port</span> <span class="p">))</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">sock</span> <span class="o">=</span> <span class="n">socket</span><span class="o">.</span><span class="n">create_connection</span><span class="p">((</span> <span class="n">ip</span><span class="p">,</span> <span class="n">port</span> <span class="p">))</span>

        <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">True</span>
        <span class="k">try</span><span class="p">:</span>
            <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_direct_tcp</span><span class="p">:</span>
                <span class="bp">self</span><span class="o">.</span><span class="n">requestNMBSession</span><span class="p">()</span>
            <span class="k">else</span><span class="p">:</span>
                <span class="bp">self</span><span class="o">.</span><span class="n">onNMBSessionOK</span><span class="p">()</span>
            <span class="k">while</span> <span class="bp">self</span><span class="o">.</span><span class="n">auth_result</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
                <span class="bp">self</span><span class="o">.</span><span class="n">_pollForNetBIOSPacket</span><span class="p">(</span><span class="n">timeout</span><span class="p">)</span>
        <span class="k">finally</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">False</span>

        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">auth_result</span></div>

<div class="viewcode-block" id="SMBConnection.close"><a class="viewcode-back" href="../../api/smb_SMBConnection.html#smb.SMBConnection.SMBConnection.close">[docs]</a>    <span class="k">def</span> <span class="nf">close</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Terminate the SMB connection (if it has been started) and release any sources held by the underlying socket.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">sock</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">sock</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">sock</span> <span class="o">=</span> <span class="kc">None</span></div>

<div class="viewcode-block" id="SMBConnection.listShares"><a class="viewcode-back" href="../../api/smb_SMBConnection.html#smb.SMBConnection.SMBConnection.listShares">[docs]</a>    <span class="k">def</span> <span class="nf">listShares</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">timeout</span> <span class="o">=</span> <span class="mi">30</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Retrieve a list of shared resources on remote server.</span>

<span class="sd">        :return: A list of :doc:`smb.base.SharedDevice&lt;smb_SharedDevice&gt;` instances describing the shared resource</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">sock</span><span class="p">:</span>
            <span class="k">raise</span> <span class="n">NotConnectedError</span><span class="p">(</span><span class="s1">&#39;Not connected to server&#39;</span><span class="p">)</span>

        <span class="n">results</span> <span class="o">=</span> <span class="p">[</span> <span class="p">]</span>

        <span class="k">def</span> <span class="nf">cb</span><span class="p">(</span><span class="n">entries</span><span class="p">):</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">False</span>
            <span class="n">results</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">entries</span><span class="p">)</span>

        <span class="k">def</span> <span class="nf">eb</span><span class="p">(</span><span class="n">failure</span><span class="p">):</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">False</span>
            <span class="k">raise</span> <span class="n">failure</span>

        <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">True</span>
        <span class="k">try</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">_listShares</span><span class="p">(</span><span class="n">cb</span><span class="p">,</span> <span class="n">eb</span><span class="p">,</span> <span class="n">timeout</span><span class="p">)</span>
            <span class="k">while</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span><span class="p">:</span>
                <span class="bp">self</span><span class="o">.</span><span class="n">_pollForNetBIOSPacket</span><span class="p">(</span><span class="n">timeout</span><span class="p">)</span>
        <span class="k">finally</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">False</span>

        <span class="k">return</span> <span class="n">results</span></div>

<div class="viewcode-block" id="SMBConnection.listPath"><a class="viewcode-back" href="../../api/smb_SMBConnection.html#smb.SMBConnection.SMBConnection.listPath">[docs]</a>    <span class="k">def</span> <span class="nf">listPath</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">service_name</span><span class="p">,</span> <span class="n">path</span><span class="p">,</span>
                 <span class="n">search</span> <span class="o">=</span> <span class="n">SMB_FILE_ATTRIBUTE_READONLY</span> <span class="o">|</span> <span class="n">SMB_FILE_ATTRIBUTE_HIDDEN</span> <span class="o">|</span> <span class="n">SMB_FILE_ATTRIBUTE_SYSTEM</span> <span class="o">|</span> <span class="n">SMB_FILE_ATTRIBUTE_DIRECTORY</span> <span class="o">|</span> <span class="n">SMB_FILE_ATTRIBUTE_ARCHIVE</span> <span class="o">|</span> <span class="n">SMB_FILE_ATTRIBUTE_INCL_NORMAL</span><span class="p">,</span>
                 <span class="n">pattern</span> <span class="o">=</span> <span class="s1">&#39;*&#39;</span><span class="p">,</span> <span class="n">timeout</span> <span class="o">=</span> <span class="mi">30</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Retrieve a directory listing of files/folders at *path*</span>

<span class="sd">        For simplicity, pysmb defines a &quot;normal&quot; file as a file entry that is not read-only, not hidden, not system, not archive and not a directory.</span>
<span class="sd">        It ignores other attributes like compression, indexed, sparse, temporary and encryption.</span>

<span class="sd">        Note that the default search parameter will query for all read-only (SMB_FILE_ATTRIBUTE_READONLY), hidden (SMB_FILE_ATTRIBUTE_HIDDEN),</span>
<span class="sd">        system (SMB_FILE_ATTRIBUTE_SYSTEM), archive (SMB_FILE_ATTRIBUTE_ARCHIVE), normal (SMB_FILE_ATTRIBUTE_INCL_NORMAL) files</span>
<span class="sd">        and directories (SMB_FILE_ATTRIBUTE_DIRECTORY).</span>
<span class="sd">        If you do not need to include &quot;normal&quot; files in the result, define your own search parameter without the SMB_FILE_ATTRIBUTE_INCL_NORMAL constant.</span>
<span class="sd">        SMB_FILE_ATTRIBUTE_NORMAL should be used by itself and not be used with other bit constants.</span>

<span class="sd">        :param string/unicode service_name: the name of the shared folder for the *path*</span>
<span class="sd">        :param string/unicode path: path relative to the *service_name* where we are interested to learn about its files/sub-folders.</span>
<span class="sd">        :param integer search: integer value made up from a bitwise-OR of *SMB_FILE_ATTRIBUTE_xxx* bits (see smb_constants.py).</span>
<span class="sd">        :param string/unicode pattern: the filter to apply to the results before returning to the client.</span>
<span class="sd">        :return: A list of :doc:`smb.base.SharedFile&lt;smb_SharedFile&gt;` instances.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">sock</span><span class="p">:</span>
            <span class="k">raise</span> <span class="n">NotConnectedError</span><span class="p">(</span><span class="s1">&#39;Not connected to server&#39;</span><span class="p">)</span>

        <span class="n">results</span> <span class="o">=</span> <span class="p">[</span> <span class="p">]</span>

        <span class="k">def</span> <span class="nf">cb</span><span class="p">(</span><span class="n">entries</span><span class="p">):</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">False</span>
            <span class="n">results</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">entries</span><span class="p">)</span>

        <span class="k">def</span> <span class="nf">eb</span><span class="p">(</span><span class="n">failure</span><span class="p">):</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">False</span>
            <span class="k">raise</span> <span class="n">failure</span>

        <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">True</span>
        <span class="k">try</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">_listPath</span><span class="p">(</span><span class="n">service_name</span><span class="p">,</span> <span class="n">path</span><span class="p">,</span> <span class="n">cb</span><span class="p">,</span> <span class="n">eb</span><span class="p">,</span> <span class="n">search</span> <span class="o">=</span> <span class="n">search</span><span class="p">,</span> <span class="n">pattern</span> <span class="o">=</span> <span class="n">pattern</span><span class="p">,</span> <span class="n">timeout</span> <span class="o">=</span> <span class="n">timeout</span><span class="p">)</span>
            <span class="k">while</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span><span class="p">:</span>
                <span class="bp">self</span><span class="o">.</span><span class="n">_pollForNetBIOSPacket</span><span class="p">(</span><span class="n">timeout</span><span class="p">)</span>
        <span class="k">finally</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">False</span>

        <span class="k">return</span> <span class="n">results</span></div>

<div class="viewcode-block" id="SMBConnection.listSnapshots"><a class="viewcode-back" href="../../api/smb_SMBConnection.html#smb.SMBConnection.SMBConnection.listSnapshots">[docs]</a>    <span class="k">def</span> <span class="nf">listSnapshots</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">service_name</span><span class="p">,</span> <span class="n">path</span><span class="p">,</span> <span class="n">timeout</span> <span class="o">=</span> <span class="mi">30</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Retrieve a list of available snapshots (shadow copies) for *path*.</span>

<span class="sd">        Note that snapshot features are only supported on Windows Vista Business, Enterprise and Ultimate, and on all Windows 7 editions.</span>

<span class="sd">        :param string/unicode service_name: the name of the shared folder for the *path*</span>
<span class="sd">        :param string/unicode path: path relative to the *service_name* where we are interested in the list of available snapshots</span>
<span class="sd">        :return: A list of python *datetime.DateTime* instances in GMT/UTC time zone</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">sock</span><span class="p">:</span>
            <span class="k">raise</span> <span class="n">NotConnectedError</span><span class="p">(</span><span class="s1">&#39;Not connected to server&#39;</span><span class="p">)</span>

        <span class="n">results</span> <span class="o">=</span> <span class="p">[</span> <span class="p">]</span>

        <span class="k">def</span> <span class="nf">cb</span><span class="p">(</span><span class="n">entries</span><span class="p">):</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">False</span>
            <span class="n">results</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">entries</span><span class="p">)</span>

        <span class="k">def</span> <span class="nf">eb</span><span class="p">(</span><span class="n">failure</span><span class="p">):</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">False</span>
            <span class="k">raise</span> <span class="n">failure</span>

        <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">True</span>
        <span class="k">try</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">_listSnapshots</span><span class="p">(</span><span class="n">service_name</span><span class="p">,</span> <span class="n">path</span><span class="p">,</span> <span class="n">cb</span><span class="p">,</span> <span class="n">eb</span><span class="p">,</span> <span class="n">timeout</span> <span class="o">=</span> <span class="n">timeout</span><span class="p">)</span>
            <span class="k">while</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span><span class="p">:</span>
                <span class="bp">self</span><span class="o">.</span><span class="n">_pollForNetBIOSPacket</span><span class="p">(</span><span class="n">timeout</span><span class="p">)</span>
        <span class="k">finally</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">False</span>

        <span class="k">return</span> <span class="n">results</span></div>

<div class="viewcode-block" id="SMBConnection.getAttributes"><a class="viewcode-back" href="../../api/smb_SMBConnection.html#smb.SMBConnection.SMBConnection.getAttributes">[docs]</a>    <span class="k">def</span> <span class="nf">getAttributes</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">service_name</span><span class="p">,</span> <span class="n">path</span><span class="p">,</span> <span class="n">timeout</span> <span class="o">=</span> <span class="mi">30</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Retrieve information about the file at *path* on the *service_name*.</span>

<span class="sd">        :param string/unicode service_name: the name of the shared folder for the *path*</span>
<span class="sd">        :param string/unicode path: Path of the file on the remote server. If the file cannot be opened for reading, an :doc:`OperationFailure&lt;smb_exceptions&gt;` will be raised.</span>
<span class="sd">        :return: A :doc:`smb.base.SharedFile&lt;smb_SharedFile&gt;` instance containing the attributes of the file.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">sock</span><span class="p">:</span>
            <span class="k">raise</span> <span class="n">NotConnectedError</span><span class="p">(</span><span class="s1">&#39;Not connected to server&#39;</span><span class="p">)</span>

        <span class="n">results</span> <span class="o">=</span> <span class="p">[</span> <span class="p">]</span>

        <span class="k">def</span> <span class="nf">cb</span><span class="p">(</span><span class="n">info</span><span class="p">):</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">False</span>
            <span class="n">results</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">info</span><span class="p">)</span>

        <span class="k">def</span> <span class="nf">eb</span><span class="p">(</span><span class="n">failure</span><span class="p">):</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">False</span>
            <span class="k">raise</span> <span class="n">failure</span>

        <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">True</span>
        <span class="k">try</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">_getAttributes</span><span class="p">(</span><span class="n">service_name</span><span class="p">,</span> <span class="n">path</span><span class="p">,</span> <span class="n">cb</span><span class="p">,</span> <span class="n">eb</span><span class="p">,</span> <span class="n">timeout</span><span class="p">)</span>
            <span class="k">while</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span><span class="p">:</span>
                <span class="bp">self</span><span class="o">.</span><span class="n">_pollForNetBIOSPacket</span><span class="p">(</span><span class="n">timeout</span><span class="p">)</span>
        <span class="k">finally</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">False</span>

        <span class="k">return</span> <span class="n">results</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span></div>

<div class="viewcode-block" id="SMBConnection.getSecurity"><a class="viewcode-back" href="../../api/smb_SMBConnection.html#smb.SMBConnection.SMBConnection.getSecurity">[docs]</a>    <span class="k">def</span> <span class="nf">getSecurity</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">service_name</span><span class="p">,</span> <span class="n">path</span><span class="p">,</span> <span class="n">timeout</span> <span class="o">=</span> <span class="mi">30</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Retrieve the security descriptor of the file at *path* on the *service_name*.</span>

<span class="sd">        :param string/unicode service_name: the name of the shared folder for the *path*</span>
<span class="sd">        :param string/unicode path: Path of the file on the remote server. If the file cannot be opened for reading, an :doc:`OperationFailure&lt;smb_exceptions&gt;` will be raised.</span>
<span class="sd">        :return: A :class:`smb.security_descriptors.SecurityDescriptor` instance containing the security information of the file.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">sock</span><span class="p">:</span>
            <span class="k">raise</span> <span class="n">NotConnectedError</span><span class="p">(</span><span class="s1">&#39;Not connected to server&#39;</span><span class="p">)</span>

        <span class="n">results</span> <span class="o">=</span> <span class="p">[</span> <span class="p">]</span>

        <span class="k">def</span> <span class="nf">cb</span><span class="p">(</span><span class="n">info</span><span class="p">):</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">False</span>
            <span class="n">results</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">info</span><span class="p">)</span>

        <span class="k">def</span> <span class="nf">eb</span><span class="p">(</span><span class="n">failure</span><span class="p">):</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">False</span>
            <span class="k">raise</span> <span class="n">failure</span>

        <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">True</span>
        <span class="k">try</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">_getSecurity</span><span class="p">(</span><span class="n">service_name</span><span class="p">,</span> <span class="n">path</span><span class="p">,</span> <span class="n">cb</span><span class="p">,</span> <span class="n">eb</span><span class="p">,</span> <span class="n">timeout</span><span class="p">)</span>
            <span class="k">while</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span><span class="p">:</span>
                <span class="bp">self</span><span class="o">.</span><span class="n">_pollForNetBIOSPacket</span><span class="p">(</span><span class="n">timeout</span><span class="p">)</span>
        <span class="k">finally</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">False</span>

        <span class="k">return</span> <span class="n">results</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span></div>

<div class="viewcode-block" id="SMBConnection.retrieveFile"><a class="viewcode-back" href="../../api/smb_SMBConnection.html#smb.SMBConnection.SMBConnection.retrieveFile">[docs]</a>    <span class="k">def</span> <span class="nf">retrieveFile</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">service_name</span><span class="p">,</span> <span class="n">path</span><span class="p">,</span> <span class="n">file_obj</span><span class="p">,</span> <span class="n">timeout</span> <span class="o">=</span> <span class="mi">30</span><span class="p">,</span> <span class="n">show_progress</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span> <span class="n">tqdm_kwargs</span> <span class="o">=</span> <span class="p">{}):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Retrieve the contents of the file at *path* on the *service_name* and write these contents to the provided *file_obj*.</span>

<span class="sd">        Use *retrieveFileFromOffset()* method if you wish to specify the offset to read from the remote *path* and/or the number of bytes to write to the *file_obj*.</span>

<span class="sd">        :param string/unicode service_name: the name of the shared folder for the *path*</span>
<span class="sd">        :param string/unicode path: Path of the file on the remote server. If the file cannot be opened for reading, an :doc:`OperationFailure&lt;smb_exceptions&gt;` will be raised.</span>
<span class="sd">        :param file_obj: A file-like object that has a *write* method. Data will be written continuously to *file_obj* until EOF is received from the remote service. In Python3, this file-like object must have a *write* method which accepts a bytes parameter.</span>
<span class="sd">        :param bool show_progress: If True, a progress bar will be shown to reflect the current file operation progress.</span>
<span class="sd">        :return: A 2-element tuple of ( file attributes of the file on server, number of bytes written to *file_obj* ).</span>
<span class="sd">                 The file attributes is an integer value made up from a bitwise-OR of *SMB_FILE_ATTRIBUTE_xxx* bits (see smb_constants.py)</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">retrieveFileFromOffset</span><span class="p">(</span><span class="n">service_name</span><span class="p">,</span> <span class="n">path</span><span class="p">,</span> <span class="n">file_obj</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="n">timeout</span><span class="p">,</span> <span class="n">show_progress</span> <span class="o">=</span> <span class="n">show_progress</span><span class="p">,</span> <span class="n">tqdm_kwargs</span> <span class="o">=</span> <span class="n">tqdm_kwargs</span><span class="p">)</span></div>

<div class="viewcode-block" id="SMBConnection.retrieveFileFromOffset"><a class="viewcode-back" href="../../api/smb_SMBConnection.html#smb.SMBConnection.SMBConnection.retrieveFileFromOffset">[docs]</a>    <span class="k">def</span> <span class="nf">retrieveFileFromOffset</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">service_name</span><span class="p">,</span> <span class="n">path</span><span class="p">,</span> <span class="n">file_obj</span><span class="p">,</span> <span class="n">offset</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="n">max_length</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="n">timeout</span> <span class="o">=</span> <span class="mi">30</span><span class="p">,</span> <span class="n">show_progress</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span> <span class="n">tqdm_kwargs</span> <span class="o">=</span> <span class="p">{}):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Retrieve the contents of the file at *path* on the *service_name* and write these contents to the provided *file_obj*.</span>

<span class="sd">        :param string/unicode service_name: the name of the shared folder for the *path*</span>
<span class="sd">        :param string/unicode path: Path of the file on the remote server. If the file cannot be opened for reading, an :doc:`OperationFailure&lt;smb_exceptions&gt;` will be raised.</span>
<span class="sd">        :param file_obj: A file-like object that has a *write* method. Data will be written continuously to *file_obj* up to *max_length* number of bytes. In Python3, this file-like object must have a *write* method which accepts a bytes parameter.</span>
<span class="sd">        :param integer/long offset: the offset in the remote *path* where the first byte will be read and written to *file_obj*. Must be either zero or a positive integer/long value.</span>
<span class="sd">        :param integer/long max_length: maximum number of bytes to read from the remote *path* and write to the *file_obj*. Specify a negative value to read from *offset* to the EOF.</span>
<span class="sd">                                        If zero, the method returns immediately after the file is opened successfully for reading.</span>
<span class="sd">        :param bool show_progress: If True, a progress bar will be shown to reflect the current file operation progress.</span>
<span class="sd">        :return: A 2-element tuple of ( file attributes of the file on server, number of bytes written to *file_obj* ).</span>
<span class="sd">                 The file attributes is an integer value made up from a bitwise-OR of *SMB_FILE_ATTRIBUTE_xxx* bits (see smb_constants.py)</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">sock</span><span class="p">:</span>
            <span class="k">raise</span> <span class="n">NotConnectedError</span><span class="p">(</span><span class="s1">&#39;Not connected to server&#39;</span><span class="p">)</span>

        <span class="n">results</span> <span class="o">=</span> <span class="p">[</span> <span class="p">]</span>

        <span class="k">def</span> <span class="nf">cb</span><span class="p">(</span><span class="n">r</span><span class="p">):</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">False</span>
            <span class="n">results</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">r</span><span class="p">[</span><span class="mi">1</span><span class="p">:])</span>

        <span class="k">def</span> <span class="nf">eb</span><span class="p">(</span><span class="n">failure</span><span class="p">):</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">False</span>
            <span class="k">raise</span> <span class="n">failure</span>

        <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">True</span>
        
        <span class="k">try</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">_retrieveFileFromOffset</span><span class="p">(</span><span class="n">service_name</span><span class="p">,</span> <span class="n">path</span><span class="p">,</span> <span class="n">file_obj</span><span class="p">,</span> <span class="n">cb</span><span class="p">,</span> <span class="n">eb</span><span class="p">,</span> <span class="n">offset</span><span class="p">,</span> <span class="n">max_length</span><span class="p">,</span> <span class="n">timeout</span> <span class="o">=</span> <span class="n">timeout</span><span class="p">,</span> <span class="n">show_progress</span><span class="o">=</span><span class="n">show_progress</span><span class="p">,</span> <span class="n">tqdm_kwargs</span><span class="o">=</span><span class="n">tqdm_kwargs</span><span class="p">)</span>
            <span class="k">while</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span><span class="p">:</span>
                <span class="bp">self</span><span class="o">.</span><span class="n">_pollForNetBIOSPacket</span><span class="p">(</span><span class="n">timeout</span><span class="p">)</span>
        <span class="k">finally</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">False</span>

        <span class="k">return</span> <span class="n">results</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span></div>

<div class="viewcode-block" id="SMBConnection.storeFile"><a class="viewcode-back" href="../../api/smb_SMBConnection.html#smb.SMBConnection.SMBConnection.storeFile">[docs]</a>    <span class="k">def</span> <span class="nf">storeFile</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">service_name</span><span class="p">,</span> <span class="n">path</span><span class="p">,</span> <span class="n">file_obj</span><span class="p">,</span> <span class="n">timeout</span> <span class="o">=</span> <span class="mi">30</span><span class="p">,</span> <span class="n">show_progress</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span> <span class="n">tqdm_kwargs</span> <span class="o">=</span> <span class="p">{}):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Store the contents of the *file_obj* at *path* on the *service_name*.</span>
<span class="sd">        If the file already exists on the remote server, it will be truncated and overwritten.</span>

<span class="sd">        :param string/unicode service_name: the name of the shared folder for the *path*</span>
<span class="sd">        :param string/unicode path: Path of the file on the remote server. If the file at *path* does not exist, it will be created. Otherwise, it will be overwritten.</span>
<span class="sd">                                    If the *path* refers to a folder or the file cannot be opened for writing, an :doc:`OperationFailure&lt;smb_exceptions&gt;` will be raised.</span>
<span class="sd">        :param file_obj: A file-like object that has a *read* method. Data will read continuously from *file_obj* until EOF. In Python3, this file-like object must have a *read* method which returns a bytes parameter.</span>
<span class="sd">        :param bool show_progress: If True, a progress bar will be shown to reflect the current file operation progress.</span>
<span class="sd">        :return: Number of bytes uploaded</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">storeFileFromOffset</span><span class="p">(</span><span class="n">service_name</span><span class="p">,</span> <span class="n">path</span><span class="p">,</span> <span class="n">file_obj</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="kc">True</span><span class="p">,</span> <span class="n">timeout</span><span class="p">,</span> <span class="n">show_progress</span> <span class="o">=</span> <span class="n">show_progress</span><span class="p">,</span> <span class="n">tqdm_kwargs</span> <span class="o">=</span> <span class="n">tqdm_kwargs</span><span class="p">)</span></div>

<div class="viewcode-block" id="SMBConnection.storeFileFromOffset"><a class="viewcode-back" href="../../api/smb_SMBConnection.html#smb.SMBConnection.SMBConnection.storeFileFromOffset">[docs]</a>    <span class="k">def</span> <span class="nf">storeFileFromOffset</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">service_name</span><span class="p">,</span> <span class="n">path</span><span class="p">,</span> <span class="n">file_obj</span><span class="p">,</span> <span class="n">offset</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="n">truncate</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span> <span class="n">timeout</span> <span class="o">=</span> <span class="mi">30</span><span class="p">,</span> <span class="n">show_progress</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span> <span class="n">tqdm_kwargs</span> <span class="o">=</span> <span class="p">{}):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Store the contents of the *file_obj* at *path* on the *service_name*.</span>

<span class="sd">        :param string/unicode service_name: the name of the shared folder for the *path*</span>
<span class="sd">        :param string/unicode path: Path of the file on the remote server. If the file at *path* does not exist, it will be created.</span>
<span class="sd">                                    If the *path* refers to a folder or the file cannot be opened for writing, an :doc:`OperationFailure&lt;smb_exceptions&gt;` will be raised.</span>
<span class="sd">        :param file_obj: A file-like object that has a *read* method. Data will read continuously from *file_obj* until EOF.</span>
<span class="sd">        :param offset: Long integer value which specifies the offset in the remote server to start writing. First byte of the file is 0.</span>
<span class="sd">        :param truncate: Boolean value. If True and the file exists on the remote server, it will be truncated first before writing. Default is False.</span>
<span class="sd">        :param bool show_progress: If True, a progress bar will be shown to reflect the current file operation progress.</span>
<span class="sd">        :return: the file position where the next byte will be written.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">sock</span><span class="p">:</span>
            <span class="k">raise</span> <span class="n">NotConnectedError</span><span class="p">(</span><span class="s1">&#39;Not connected to server&#39;</span><span class="p">)</span>

        <span class="n">results</span> <span class="o">=</span> <span class="p">[</span> <span class="p">]</span>

        <span class="k">def</span> <span class="nf">cb</span><span class="p">(</span><span class="n">r</span><span class="p">):</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">False</span>
            <span class="n">results</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">r</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span>

        <span class="k">def</span> <span class="nf">eb</span><span class="p">(</span><span class="n">failure</span><span class="p">):</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">False</span>
            <span class="k">raise</span> <span class="n">failure</span>

        <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">True</span>
        <span class="k">try</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">_storeFileFromOffset</span><span class="p">(</span><span class="n">service_name</span><span class="p">,</span> <span class="n">path</span><span class="p">,</span> <span class="n">file_obj</span><span class="p">,</span> <span class="n">cb</span><span class="p">,</span> <span class="n">eb</span><span class="p">,</span> <span class="n">offset</span><span class="p">,</span> <span class="n">truncate</span> <span class="o">=</span> <span class="n">truncate</span><span class="p">,</span> <span class="n">timeout</span> <span class="o">=</span> <span class="n">timeout</span><span class="p">,</span> <span class="n">show_progress</span><span class="o">=</span><span class="n">show_progress</span><span class="p">,</span> <span class="n">tqdm_kwargs</span><span class="o">=</span><span class="n">tqdm_kwargs</span><span class="p">)</span>
            <span class="k">while</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span><span class="p">:</span>
                <span class="bp">self</span><span class="o">.</span><span class="n">_pollForNetBIOSPacket</span><span class="p">(</span><span class="n">timeout</span><span class="p">)</span>
        <span class="k">finally</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">False</span>

        <span class="k">return</span> <span class="n">results</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span></div>

<div class="viewcode-block" id="SMBConnection.deleteFiles"><a class="viewcode-back" href="../../api/smb_SMBConnection.html#smb.SMBConnection.SMBConnection.deleteFiles">[docs]</a>    <span class="k">def</span> <span class="nf">deleteFiles</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">service_name</span><span class="p">,</span> <span class="n">path_file_pattern</span><span class="p">,</span> <span class="n">delete_matching_folders</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span> <span class="n">timeout</span> <span class="o">=</span> <span class="mi">30</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Delete one or more regular files. It supports the use of wildcards in file names, allowing for deletion of multiple files in a single request.</span>

<span class="sd">        If delete_matching_folders is True, immediate sub-folders that match the path_file_pattern will be deleted recursively.</span>

<span class="sd">        :param string/unicode service_name: Contains the name of the shared folder.</span>
<span class="sd">        :param string/unicode path_file_pattern: The pathname of the file(s) to be deleted, relative to the service_name.</span>
<span class="sd">                                                 Wildcards may be used in th filename component of the path.</span>
<span class="sd">                                                 If your path/filename contains non-English characters, you must pass in an unicode string.</span>
<span class="sd">        :return: None</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">sock</span><span class="p">:</span>
            <span class="k">raise</span> <span class="n">NotConnectedError</span><span class="p">(</span><span class="s1">&#39;Not connected to server&#39;</span><span class="p">)</span>

        <span class="k">def</span> <span class="nf">cb</span><span class="p">(</span><span class="n">r</span><span class="p">):</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">False</span>

        <span class="k">def</span> <span class="nf">eb</span><span class="p">(</span><span class="n">failure</span><span class="p">):</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">False</span>
            <span class="k">raise</span> <span class="n">failure</span>

        <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">True</span>
        <span class="k">try</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">_deleteFiles</span><span class="p">(</span><span class="n">service_name</span><span class="p">,</span> <span class="n">path_file_pattern</span><span class="p">,</span> <span class="n">delete_matching_folders</span><span class="p">,</span> <span class="n">cb</span><span class="p">,</span> <span class="n">eb</span><span class="p">,</span> <span class="n">timeout</span> <span class="o">=</span> <span class="n">timeout</span><span class="p">)</span>
            <span class="k">while</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span><span class="p">:</span>
                <span class="bp">self</span><span class="o">.</span><span class="n">_pollForNetBIOSPacket</span><span class="p">(</span><span class="n">timeout</span><span class="p">)</span>
        <span class="k">finally</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">False</span></div>

<div class="viewcode-block" id="SMBConnection.resetFileAttributes"><a class="viewcode-back" href="../../api/smb_SMBConnection.html#smb.SMBConnection.SMBConnection.resetFileAttributes">[docs]</a>    <span class="k">def</span> <span class="nf">resetFileAttributes</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">service_name</span><span class="p">,</span> <span class="n">path_file_pattern</span><span class="p">,</span> <span class="n">file_attributes</span> <span class="o">=</span> <span class="n">ATTR_NORMAL</span><span class="p">,</span> <span class="n">timeout</span> <span class="o">=</span> <span class="mi">30</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Reset file attributes of one or more regular files or folders.</span>
<span class="sd">        It supports the use of wildcards in file names, allowing for unlocking of multiple files/folders in a single request.</span>
<span class="sd">        This function is very helpful when deleting files/folders that are read-only.</span>
<span class="sd">        By default, it sets the ATTR_NORMAL flag, therefore clearing all other flags.</span>
<span class="sd">        (See https://msdn.microsoft.com/en-us/library/cc232110.aspx for further information)</span>

<span class="sd">        Note: this function is currently only implemented for SMB2!</span>

<span class="sd">        :param string/unicode service_name: Contains the name of the shared folder.</span>
<span class="sd">        :param string/unicode path_file_pattern: The pathname of the file(s) to be deleted, relative to the service_name.</span>
<span class="sd">                                                 Wildcards may be used in the filename component of the path.</span>
<span class="sd">                                                 If your path/filename contains non-English characters, you must pass in an unicode string.</span>
<span class="sd">        :param int file_attributes: The desired file attributes to set. Defaults to `ATTR_NORMAL`.</span>
<span class="sd">        :return: None</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">sock</span><span class="p">:</span>
            <span class="k">raise</span> <span class="n">NotConnectedError</span><span class="p">(</span><span class="s1">&#39;Not connected to server&#39;</span><span class="p">)</span>

        <span class="k">def</span> <span class="nf">cb</span><span class="p">(</span><span class="n">r</span><span class="p">):</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">False</span>

        <span class="k">def</span> <span class="nf">eb</span><span class="p">(</span><span class="n">failure</span><span class="p">):</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">False</span>
            <span class="k">raise</span> <span class="n">failure</span>

        <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">True</span>
        <span class="k">try</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">_resetFileAttributes</span><span class="p">(</span><span class="n">service_name</span><span class="p">,</span> <span class="n">path_file_pattern</span><span class="p">,</span> <span class="n">cb</span><span class="p">,</span> <span class="n">eb</span><span class="p">,</span> <span class="n">file_attributes</span><span class="p">,</span> <span class="n">timeout</span><span class="p">)</span>
            <span class="k">while</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span><span class="p">:</span>
                <span class="bp">self</span><span class="o">.</span><span class="n">_pollForNetBIOSPacket</span><span class="p">(</span><span class="n">timeout</span><span class="p">)</span>
        <span class="k">finally</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">False</span></div>

<div class="viewcode-block" id="SMBConnection.createDirectory"><a class="viewcode-back" href="../../api/smb_SMBConnection.html#smb.SMBConnection.SMBConnection.createDirectory">[docs]</a>    <span class="k">def</span> <span class="nf">createDirectory</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">service_name</span><span class="p">,</span> <span class="n">path</span><span class="p">,</span> <span class="n">timeout</span> <span class="o">=</span> <span class="mi">30</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Creates a new directory *path* on the *service_name*.</span>

<span class="sd">        :param string/unicode service_name: Contains the name of the shared folder.</span>
<span class="sd">        :param string/unicode path: The path of the new folder (relative to) the shared folder.</span>
<span class="sd">                                    If the path contains non-English characters, an unicode string must be used to pass in the path.</span>
<span class="sd">        :return: None</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">sock</span><span class="p">:</span>
            <span class="k">raise</span> <span class="n">NotConnectedError</span><span class="p">(</span><span class="s1">&#39;Not connected to server&#39;</span><span class="p">)</span>

        <span class="k">def</span> <span class="nf">cb</span><span class="p">(</span><span class="n">r</span><span class="p">):</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">False</span>

        <span class="k">def</span> <span class="nf">eb</span><span class="p">(</span><span class="n">failure</span><span class="p">):</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">False</span>
            <span class="k">raise</span> <span class="n">failure</span>

        <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">True</span>
        <span class="k">try</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">_createDirectory</span><span class="p">(</span><span class="n">service_name</span><span class="p">,</span> <span class="n">path</span><span class="p">,</span> <span class="n">cb</span><span class="p">,</span> <span class="n">eb</span><span class="p">,</span> <span class="n">timeout</span> <span class="o">=</span> <span class="n">timeout</span><span class="p">)</span>
            <span class="k">while</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span><span class="p">:</span>
                <span class="bp">self</span><span class="o">.</span><span class="n">_pollForNetBIOSPacket</span><span class="p">(</span><span class="n">timeout</span><span class="p">)</span>
        <span class="k">finally</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">False</span></div>

<div class="viewcode-block" id="SMBConnection.deleteDirectory"><a class="viewcode-back" href="../../api/smb_SMBConnection.html#smb.SMBConnection.SMBConnection.deleteDirectory">[docs]</a>    <span class="k">def</span> <span class="nf">deleteDirectory</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">service_name</span><span class="p">,</span> <span class="n">path</span><span class="p">,</span> <span class="n">timeout</span> <span class="o">=</span> <span class="mi">30</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Delete the empty folder at *path* on *service_name*</span>

<span class="sd">        :param string/unicode service_name: Contains the name of the shared folder.</span>
<span class="sd">        :param string/unicode path: The path of the to-be-deleted folder (relative to) the shared folder.</span>
<span class="sd">                                    If the path contains non-English characters, an unicode string must be used to pass in the path.</span>
<span class="sd">        :return: None</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">sock</span><span class="p">:</span>
            <span class="k">raise</span> <span class="n">NotConnectedError</span><span class="p">(</span><span class="s1">&#39;Not connected to server&#39;</span><span class="p">)</span>

        <span class="k">def</span> <span class="nf">cb</span><span class="p">(</span><span class="n">r</span><span class="p">):</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">False</span>

        <span class="k">def</span> <span class="nf">eb</span><span class="p">(</span><span class="n">failure</span><span class="p">):</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">False</span>
            <span class="k">raise</span> <span class="n">failure</span>

        <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">True</span>
        <span class="k">try</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">_deleteDirectory</span><span class="p">(</span><span class="n">service_name</span><span class="p">,</span> <span class="n">path</span><span class="p">,</span> <span class="n">cb</span><span class="p">,</span> <span class="n">eb</span><span class="p">,</span> <span class="n">timeout</span> <span class="o">=</span> <span class="n">timeout</span><span class="p">)</span>
            <span class="k">while</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span><span class="p">:</span>
                <span class="bp">self</span><span class="o">.</span><span class="n">_pollForNetBIOSPacket</span><span class="p">(</span><span class="n">timeout</span><span class="p">)</span>
        <span class="k">finally</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">False</span></div>

<div class="viewcode-block" id="SMBConnection.rename"><a class="viewcode-back" href="../../api/smb_SMBConnection.html#smb.SMBConnection.SMBConnection.rename">[docs]</a>    <span class="k">def</span> <span class="nf">rename</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">service_name</span><span class="p">,</span> <span class="n">old_path</span><span class="p">,</span> <span class="n">new_path</span><span class="p">,</span> <span class="n">timeout</span> <span class="o">=</span> <span class="mi">30</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Rename a file or folder at *old_path* to *new_path* shared at *service_name*. Note that this method cannot be used to rename file/folder across different shared folders</span>

<span class="sd">        *old_path* and *new_path* are string/unicode referring to the old and new path of the renamed resources (relative to) the shared folder.</span>
<span class="sd">        If the path contains non-English characters, an unicode string must be used to pass in the path.</span>

<span class="sd">        :param string/unicode service_name: Contains the name of the shared folder.</span>
<span class="sd">        :return: None</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">sock</span><span class="p">:</span>
            <span class="k">raise</span> <span class="n">NotConnectedError</span><span class="p">(</span><span class="s1">&#39;Not connected to server&#39;</span><span class="p">)</span>

        <span class="k">def</span> <span class="nf">cb</span><span class="p">(</span><span class="n">r</span><span class="p">):</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">False</span>

        <span class="k">def</span> <span class="nf">eb</span><span class="p">(</span><span class="n">failure</span><span class="p">):</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">False</span>
            <span class="k">raise</span> <span class="n">failure</span>

        <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">True</span>
        <span class="k">try</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">_rename</span><span class="p">(</span><span class="n">service_name</span><span class="p">,</span> <span class="n">old_path</span><span class="p">,</span> <span class="n">new_path</span><span class="p">,</span> <span class="n">cb</span><span class="p">,</span> <span class="n">eb</span><span class="p">)</span>
            <span class="k">while</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span><span class="p">:</span>
                <span class="bp">self</span><span class="o">.</span><span class="n">_pollForNetBIOSPacket</span><span class="p">(</span><span class="n">timeout</span><span class="p">)</span>
        <span class="k">finally</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">False</span></div>

<div class="viewcode-block" id="SMBConnection.echo"><a class="viewcode-back" href="../../api/smb_SMBConnection.html#smb.SMBConnection.SMBConnection.echo">[docs]</a>    <span class="k">def</span> <span class="nf">echo</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data</span><span class="p">,</span> <span class="n">timeout</span> <span class="o">=</span> <span class="mi">10</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Send an echo command containing *data* to the remote SMB/CIFS server. The remote SMB/CIFS will reply with the same *data*.</span>

<span class="sd">        :param bytes data: Data to send to the remote server. Must be a bytes object.</span>
<span class="sd">        :return: The *data* parameter</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">sock</span><span class="p">:</span>
            <span class="k">raise</span> <span class="n">NotConnectedError</span><span class="p">(</span><span class="s1">&#39;Not connected to server&#39;</span><span class="p">)</span>

        <span class="n">results</span> <span class="o">=</span> <span class="p">[</span> <span class="p">]</span>

        <span class="k">def</span> <span class="nf">cb</span><span class="p">(</span><span class="n">r</span><span class="p">):</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">False</span>
            <span class="n">results</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">r</span><span class="p">)</span>

        <span class="k">def</span> <span class="nf">eb</span><span class="p">(</span><span class="n">failure</span><span class="p">):</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">False</span>
            <span class="k">raise</span> <span class="n">failure</span>

        <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">True</span>
        <span class="k">try</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">_echo</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">cb</span><span class="p">,</span> <span class="n">eb</span><span class="p">)</span>
            <span class="k">while</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span><span class="p">:</span>
                <span class="bp">self</span><span class="o">.</span><span class="n">_pollForNetBIOSPacket</span><span class="p">(</span><span class="n">timeout</span><span class="p">)</span>
        <span class="k">finally</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">is_busy</span> <span class="o">=</span> <span class="kc">False</span>

        <span class="k">return</span> <span class="n">results</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span></div>

    <span class="c1">#</span>
    <span class="c1"># Protected Methods</span>
    <span class="c1">#</span>

    <span class="k">def</span> <span class="nf">_pollForNetBIOSPacket</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">timeout</span><span class="p">):</span>
        <span class="n">expiry_time</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span> <span class="o">+</span> <span class="n">timeout</span>
        <span class="n">read_len</span> <span class="o">=</span> <span class="mi">4</span>
        <span class="n">data</span> <span class="o">=</span> <span class="sa">b</span><span class="s1">&#39;&#39;</span>

        <span class="k">while</span> <span class="n">read_len</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
            <span class="k">try</span><span class="p">:</span>
                <span class="k">if</span> <span class="n">expiry_time</span> <span class="o">&lt;</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">():</span>
                    <span class="k">raise</span> <span class="n">SMBTimeout</span>

                <span class="n">ready</span><span class="p">,</span> <span class="n">_</span><span class="p">,</span> <span class="n">_</span> <span class="o">=</span> <span class="n">select</span><span class="o">.</span><span class="n">select</span><span class="p">([</span> <span class="bp">self</span><span class="o">.</span><span class="n">sock</span><span class="o">.</span><span class="n">fileno</span><span class="p">()</span> <span class="p">],</span> <span class="p">[</span> <span class="p">],</span> <span class="p">[</span> <span class="p">],</span> <span class="n">timeout</span><span class="p">)</span>
                <span class="k">if</span> <span class="ow">not</span> <span class="n">ready</span><span class="p">:</span>
                    <span class="k">raise</span> <span class="n">SMBTimeout</span>

                <span class="n">d</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sock</span><span class="o">.</span><span class="n">recv</span><span class="p">(</span><span class="n">read_len</span><span class="p">)</span>
                <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">d</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
                    <span class="k">raise</span> <span class="n">NotConnectedError</span>

                <span class="n">data</span> <span class="o">=</span> <span class="n">data</span> <span class="o">+</span> <span class="n">d</span>
                <span class="n">read_len</span> <span class="o">-=</span> <span class="nb">len</span><span class="p">(</span><span class="n">d</span><span class="p">)</span>
            <span class="k">except</span> <span class="n">select</span><span class="o">.</span><span class="n">error</span> <span class="k">as</span> <span class="n">ex</span><span class="p">:</span>
                <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">ex</span><span class="p">,</span> <span class="nb">tuple</span><span class="p">):</span>
                    <span class="k">if</span> <span class="n">ex</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">!=</span> <span class="n">errno</span><span class="o">.</span><span class="n">EINTR</span> <span class="ow">and</span> <span class="n">ex</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">!=</span> <span class="n">errno</span><span class="o">.</span><span class="n">EAGAIN</span><span class="p">:</span>
                        <span class="k">raise</span> <span class="n">ex</span>
                <span class="k">else</span><span class="p">:</span>
                    <span class="k">raise</span> <span class="n">ex</span>

        <span class="nb">type</span><span class="p">,</span> <span class="n">flags</span><span class="p">,</span> <span class="n">length</span> <span class="o">=</span> <span class="n">struct</span><span class="o">.</span><span class="n">unpack</span><span class="p">(</span><span class="s1">&#39;&gt;BBH&#39;</span><span class="p">,</span> <span class="n">data</span><span class="p">)</span>
        <span class="k">if</span> <span class="n">flags</span> <span class="o">&amp;</span> <span class="mh">0x01</span><span class="p">:</span>
            <span class="n">length</span> <span class="o">=</span> <span class="n">length</span> <span class="o">|</span> <span class="mh">0x10000</span>

        <span class="n">read_len</span> <span class="o">=</span> <span class="n">length</span>
        <span class="k">while</span> <span class="n">read_len</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
            <span class="k">try</span><span class="p">:</span>
                <span class="k">if</span> <span class="n">expiry_time</span> <span class="o">&lt;</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">():</span>
                    <span class="k">raise</span> <span class="n">SMBTimeout</span>

                <span class="n">ready</span><span class="p">,</span> <span class="n">_</span><span class="p">,</span> <span class="n">_</span> <span class="o">=</span> <span class="n">select</span><span class="o">.</span><span class="n">select</span><span class="p">([</span> <span class="bp">self</span><span class="o">.</span><span class="n">sock</span><span class="o">.</span><span class="n">fileno</span><span class="p">()</span> <span class="p">],</span> <span class="p">[</span> <span class="p">],</span> <span class="p">[</span> <span class="p">],</span> <span class="n">timeout</span><span class="p">)</span>
                <span class="k">if</span> <span class="ow">not</span> <span class="n">ready</span><span class="p">:</span>
                    <span class="k">raise</span> <span class="n">SMBTimeout</span>

                <span class="n">d</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sock</span><span class="o">.</span><span class="n">recv</span><span class="p">(</span><span class="n">read_len</span><span class="p">)</span>
                <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">d</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
                    <span class="k">raise</span> <span class="n">NotConnectedError</span>

                <span class="n">data</span> <span class="o">=</span> <span class="n">data</span> <span class="o">+</span> <span class="n">d</span>
                <span class="n">read_len</span> <span class="o">-=</span> <span class="nb">len</span><span class="p">(</span><span class="n">d</span><span class="p">)</span>
            <span class="k">except</span> <span class="n">select</span><span class="o">.</span><span class="n">error</span> <span class="k">as</span> <span class="n">ex</span><span class="p">:</span>
                <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">ex</span><span class="p">,</span> <span class="nb">tuple</span><span class="p">):</span>
                    <span class="k">if</span> <span class="n">ex</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">!=</span> <span class="n">errno</span><span class="o">.</span><span class="n">EINTR</span> <span class="ow">and</span> <span class="n">ex</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">!=</span> <span class="n">errno</span><span class="o">.</span><span class="n">EAGAIN</span><span class="p">:</span>
                        <span class="k">raise</span> <span class="n">ex</span>
                <span class="k">else</span><span class="p">:</span>
                    <span class="k">raise</span> <span class="n">ex</span>

        <span class="bp">self</span><span class="o">.</span><span class="n">feedData</span><span class="p">(</span><span class="n">data</span><span class="p">)</span></div>
</pre></div>

            <div class="clearer"></div>
          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
<div id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="../../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</div>
<script>document.getElementById('searchbox').style.display = "block"</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../index.html">pysmb 1.2.9 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../index.html" >Module code</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="">smb.SMBConnection</a></li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2001-2021, Michael Teo https://miketeo.net/.
      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 5.0.1.
    </div>
  </body>
</html>

================================================
FILE: docs/html/_modules/smb/SMBProtocol.html
================================================

<!DOCTYPE html>

<html>
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>smb.SMBProtocol &#8212; pysmb 1.2.7 documentation</title>
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/sphinxdoc.css" type="text/css" />
    <script id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
    <script src="../../_static/jquery.js"></script>
    <script src="../../_static/underscore.js"></script>
    <script src="../../_static/doctools.js"></script>
    <link rel="index" title="Index" href="../../genindex.html" />
    <link rel="search" title="Search" href="../../search.html" /> 
  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../index.html">pysmb 1.2.7 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../index.html" accesskey="U">Module code</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="">smb.SMBProtocol</a></li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <h1>Source code for smb.SMBProtocol</h1><div class="highlight"><pre>
<span></span>
<span class="kn">import</span> <span class="nn">os</span><span class="o">,</span> <span class="nn">logging</span><span class="o">,</span> <span class="nn">time</span>
<span class="kn">from</span> <span class="nn">twisted.internet</span> <span class="kn">import</span> <span class="n">reactor</span><span class="p">,</span> <span class="n">defer</span>
<span class="kn">from</span> <span class="nn">twisted.internet.protocol</span> <span class="kn">import</span> <span class="n">ClientFactory</span><span class="p">,</span> <span class="n">Protocol</span>
<span class="kn">from</span> <span class="nn">.smb_constants</span> <span class="kn">import</span> <span class="o">*</span>
<span class="kn">from</span> <span class="nn">.smb_structs</span> <span class="kn">import</span> <span class="o">*</span>
<span class="kn">from</span> <span class="nn">.base</span> <span class="kn">import</span> <span class="n">SMB</span><span class="p">,</span> <span class="n">NotConnectedError</span><span class="p">,</span> <span class="n">NotReadyError</span><span class="p">,</span> <span class="n">SMBTimeout</span>


<span class="n">__all__</span> <span class="o">=</span> <span class="p">[</span> <span class="s1">&#39;SMBProtocolFactory&#39;</span><span class="p">,</span> <span class="s1">&#39;NotConnectedError&#39;</span><span class="p">,</span> <span class="s1">&#39;NotReadyError&#39;</span> <span class="p">]</span>


<span class="k">class</span> <span class="nc">SMBProtocol</span><span class="p">(</span><span class="n">Protocol</span><span class="p">,</span> <span class="n">SMB</span><span class="p">):</span>

    <span class="n">log</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s1">&#39;SMB.SMBProtocol&#39;</span><span class="p">)</span>

    <span class="c1">#</span>
    <span class="c1"># Protocol Methods</span>
    <span class="c1">#</span>

    <span class="k">def</span> <span class="nf">connectionMade</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">factory</span><span class="o">.</span><span class="n">instance</span> <span class="o">=</span> <span class="bp">self</span>
        <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_direct_tcp</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">requestNMBSession</span><span class="p">()</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">onNMBSessionOK</span><span class="p">()</span>


    <span class="k">def</span> <span class="nf">connectionLost</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">reason</span><span class="p">):</span>
        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">factory</span><span class="o">.</span><span class="n">instance</span> <span class="o">==</span> <span class="bp">self</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">instance</span> <span class="o">=</span> <span class="kc">None</span>

    <span class="k">def</span> <span class="nf">dataReceived</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data</span><span class="p">):</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">feedData</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>

    <span class="c1">#</span>
    <span class="c1"># SMB (and its superclass) Methods</span>
    <span class="c1">#</span>

    <span class="k">def</span> <span class="nf">write</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data</span><span class="p">):</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">transport</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>

    <span class="k">def</span> <span class="nf">onAuthOK</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">factory</span><span class="o">.</span><span class="n">instance</span> <span class="o">==</span> <span class="bp">self</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">factory</span><span class="o">.</span><span class="n">onAuthOK</span><span class="p">()</span>
            <span class="n">reactor</span><span class="o">.</span><span class="n">callLater</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_cleanupPendingRequests</span><span class="p">)</span>

    <span class="k">def</span> <span class="nf">onAuthFailed</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">factory</span><span class="o">.</span><span class="n">instance</span> <span class="o">==</span> <span class="bp">self</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">factory</span><span class="o">.</span><span class="n">onAuthFailed</span><span class="p">()</span>

    <span class="k">def</span> <span class="nf">onNMBSessionFailed</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s1">&#39;Cannot establish NetBIOS session. You might have provided a wrong remote_name&#39;</span><span class="p">)</span>

    <span class="c1">#</span>
    <span class="c1"># Protected Methods</span>
    <span class="c1">#</span>

    <span class="k">def</span> <span class="nf">_cleanupPendingRequests</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">factory</span><span class="o">.</span><span class="n">instance</span> <span class="o">==</span> <span class="bp">self</span><span class="p">:</span>
            <span class="n">now</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span>
            <span class="n">to_remove</span> <span class="o">=</span> <span class="p">[]</span>
            <span class="k">for</span> <span class="n">mid</span><span class="p">,</span> <span class="n">r</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">pending_requests</span><span class="o">.</span><span class="n">items</span><span class="p">():</span>
                <span class="k">if</span> <span class="n">r</span><span class="o">.</span><span class="n">expiry_time</span> <span class="o">&lt;</span> <span class="n">now</span><span class="p">:</span>
                    <span class="k">try</span><span class="p">:</span>
                        <span class="n">r</span><span class="o">.</span><span class="n">errback</span><span class="p">(</span><span class="n">SMBTimeout</span><span class="p">())</span>
                    <span class="k">except</span> <span class="ne">Exception</span><span class="p">:</span> <span class="k">pass</span>
                    <span class="n">to_remove</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">mid</span><span class="p">)</span>

            <span class="k">for</span> <span class="n">mid</span> <span class="ow">in</span> <span class="n">to_remove</span><span class="p">:</span>
                <span class="k">del</span> <span class="bp">self</span><span class="o">.</span><span class="n">pending_requests</span><span class="p">[</span><span class="n">mid</span><span class="p">]</span>

            <span class="n">reactor</span><span class="o">.</span><span class="n">callLater</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_cleanupPendingRequests</span><span class="p">)</span>


<div class="viewcode-block" id="SMBProtocolFactory"><a class="viewcode-back" href="../../api/smb_SMBProtocolFactory.html#smb.SMBProtocol.SMBProtocolFactory">[docs]</a><span class="k">class</span> <span class="nc">SMBProtocolFactory</span><span class="p">(</span><span class="n">ClientFactory</span><span class="p">):</span>

    <span class="n">protocol</span> <span class="o">=</span> <span class="n">SMBProtocol</span>
    <span class="n">log</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s1">&#39;SMB.SMBFactory&#39;</span><span class="p">)</span>

    <span class="c1">#: SMB messages will never be signed regardless of remote server&#39;s configurations; access errors will occur if the remote server requires signing.</span>
    <span class="n">SIGN_NEVER</span> <span class="o">=</span> <span class="mi">0</span>
    <span class="c1">#: SMB messages will be signed when remote server supports signing but not requires signing.</span>
    <span class="n">SIGN_WHEN_SUPPORTED</span> <span class="o">=</span> <span class="mi">1</span>
    <span class="c1">#: SMB messages will only be signed when remote server requires signing.</span>
    <span class="n">SIGN_WHEN_REQUIRED</span> <span class="o">=</span> <span class="mi">2</span>

<div class="viewcode-block" id="SMBProtocolFactory.__init__"><a class="viewcode-back" href="../../api/smb_SMBProtocolFactory.html#smb.SMBProtocol.SMBProtocolFactory.__init__">[docs]</a>    <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">username</span><span class="p">,</span> <span class="n">password</span><span class="p">,</span> <span class="n">my_name</span><span class="p">,</span> <span class="n">remote_name</span><span class="p">,</span> <span class="n">domain</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="n">use_ntlm_v2</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> <span class="n">sign_options</span> <span class="o">=</span> <span class="n">SIGN_WHEN_REQUIRED</span><span class="p">,</span> <span class="n">is_direct_tcp</span> <span class="o">=</span> <span class="kc">False</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Create a new SMBProtocolFactory instance. You will pass this instance to *reactor.connectTCP()* which will then instantiate the TCP connection to the remote SMB/CIFS server.</span>
<span class="sd">        Note that the default TCP port for most SMB/CIFS servers using NetBIOS over TCP/IP is 139.</span>
<span class="sd">        Some newer server installations might also support Direct hosting of SMB over TCP/IP; for these servers, the default TCP port is 445.</span>

<span class="sd">        *username* and *password* are the user credentials required to authenticate the underlying SMB connection with the remote server.</span>
<span class="sd">        File operations can only be proceeded after the connection has been authenticated successfully.</span>

<span class="sd">        :param string my_name: The local NetBIOS machine name that will identify where this connection is originating from.</span>
<span class="sd">                               You can freely choose a name as long as it contains a maximum of 15 alphanumeric characters and does not contain spaces and any of ``\/:*?&quot;;|+``</span>
<span class="sd">        :param string remote_name: The NetBIOS machine name of the remote server.</span>
<span class="sd">                                   On windows, you can find out the machine name by right-clicking on the &quot;My Computer&quot; and selecting &quot;Properties&quot;.</span>
<span class="sd">                                   This parameter must be the same as what has been configured on the remote server, or else the connection will be rejected.</span>
<span class="sd">        :param string domain: The network domain. On windows, it is known as the workgroup. Usually, it is safe to leave this parameter as an empty string.</span>
<span class="sd">        :param boolean use_ntlm_v2: Indicates whether pysmb should be NTLMv1 or NTLMv2 authentication algorithm for authentication.</span>
<span class="sd">                                    The choice of NTLMv1 and NTLMv2 is configured on the remote server, and there is no mechanism to auto-detect which algorithm has been configured.</span>
<span class="sd">                                    Hence, we can only &quot;guess&quot; or try both algorithms.</span>
<span class="sd">                                    On Sambda, Windows Vista and Windows 7, NTLMv2 is enabled by default. On Windows XP, we can use NTLMv1 before NTLMv2.</span>
<span class="sd">        :param int sign_options: Determines whether SMB messages will be signed. Default is *SIGN_WHEN_REQUIRED*.</span>
<span class="sd">                                 If *SIGN_WHEN_REQUIRED* (value=2), SMB messages will only be signed when remote server requires signing.</span>
<span class="sd">                                 If *SIGN_WHEN_SUPPORTED* (value=1), SMB messages will be signed when remote server supports signing but not requires signing.</span>
<span class="sd">                                 If *SIGN_NEVER* (value=0), SMB messages will never be signed regardless of remote server&#39;s configurations; access errors will occur if the remote server requires signing.</span>
<span class="sd">        :param boolean is_direct_tcp: Controls whether the NetBIOS over TCP/IP (is_direct_tcp=False) or the newer Direct hosting of SMB over TCP/IP (is_direct_tcp=True) will be used for the communication.</span>
<span class="sd">                                      The default parameter is False which will use NetBIOS over TCP/IP for wider compatibility (TCP port: 139).</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">username</span> <span class="o">=</span> <span class="n">username</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">password</span> <span class="o">=</span> <span class="n">password</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">my_name</span> <span class="o">=</span> <span class="n">my_name</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">remote_name</span> <span class="o">=</span> <span class="n">remote_name</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">domain</span> <span class="o">=</span> <span class="n">domain</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">use_ntlm_v2</span> <span class="o">=</span> <span class="n">use_ntlm_v2</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">sign_options</span> <span class="o">=</span> <span class="n">sign_options</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">is_direct_tcp</span> <span class="o">=</span> <span class="n">is_direct_tcp</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">instance</span> <span class="o">=</span> <span class="kc">None</span>    <span class="c1">#: The single SMBProtocol instance for each SMBProtocolFactory instance. Usually, you should not need to touch this attribute directly.</span></div>

    <span class="c1">#</span>
    <span class="c1"># Public Property</span>
    <span class="c1">#</span>

    <span class="nd">@property</span>
    <span class="k">def</span> <span class="nf">isReady</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;A convenient property to return True if the underlying SMB connection has connected to remote server, has successfully authenticated itself and is ready for file operations.&quot;&quot;&quot;</span>
        <span class="k">return</span> <span class="nb">bool</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">instance</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">instance</span><span class="o">.</span><span class="n">has_authenticated</span><span class="p">)</span>

    <span class="nd">@property</span>
    <span class="k">def</span> <span class="nf">isUsingSMB2</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;A convenient property to return True if the underlying SMB connection is using SMB2 protocol.&quot;&quot;&quot;</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">instance</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">instance</span><span class="o">.</span><span class="n">is_using_smb2</span>

    <span class="c1">#</span>
    <span class="c1"># Public Methods for Callbacks</span>
    <span class="c1">#</span>

<div class="viewcode-block" id="SMBProtocolFactory.onAuthOK"><a class="viewcode-back" href="../../api/smb_SMBProtocolFactory.html#smb.SMBProtocol.SMBProtocolFactory.onAuthOK">[docs]</a>    <span class="k">def</span> <span class="nf">onAuthOK</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Override this method in your *SMBProtocolFactory* subclass to add in post-authentication handling.</span>
<span class="sd">        This method will be called when the server has replied that the SMB connection has been successfully authenticated.</span>
<span class="sd">        File operations can proceed when this method has been called.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">pass</span></div>

<div class="viewcode-block" id="SMBProtocolFactory.onAuthFailed"><a class="viewcode-back" href="../../api/smb_SMBProtocolFactory.html#smb.SMBProtocol.SMBProtocolFactory.onAuthFailed">[docs]</a>    <span class="k">def</span> <span class="nf">onAuthFailed</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Override this method in your *SMBProtocolFactory* subclass to add in post-authentication handling.</span>
<span class="sd">        This method will be called when the server has replied that the SMB connection has been successfully authenticated.</span>

<span class="sd">        If you want to retry authenticating from this method,</span>
<span class="sd">         1. Disconnect the underlying SMB connection (call ``self.instance.transport.loseConnection()``)</span>
<span class="sd">         2. Create a new SMBProtocolFactory subclass instance with different user credientials or different NTLM algorithm flag.</span>
<span class="sd">         3. Call ``reactor.connectTCP`` with the new instance to re-establish the SMB connection</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">pass</span></div>

    <span class="c1">#</span>
    <span class="c1"># Public Methods</span>
    <span class="c1">#</span>

<div class="viewcode-block" id="SMBProtocolFactory.listShares"><a class="viewcode-back" href="../../api/smb_SMBProtocolFactory.html#smb.SMBProtocol.SMBProtocolFactory.listShares">[docs]</a>    <span class="k">def</span> <span class="nf">listShares</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">timeout</span> <span class="o">=</span> <span class="mi">30</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Retrieve a list of shared resources on remote server.</span>

<span class="sd">        :param integer/float timeout: Number of seconds that pysmb will wait before raising *SMBTimeout* via the returned *Deferred* instance&#39;s *errback* method.</span>
<span class="sd">        :return: A *twisted.internet.defer.Deferred* instance. The callback function will be called with a list of :doc:`smb.base.SharedDevice&lt;smb_SharedDevice&gt;` instances.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">instance</span><span class="p">:</span>
            <span class="k">raise</span> <span class="n">NotConnectedError</span><span class="p">(</span><span class="s1">&#39;Not connected to server&#39;</span><span class="p">)</span>

        <span class="n">d</span> <span class="o">=</span> <span class="n">defer</span><span class="o">.</span><span class="n">Deferred</span><span class="p">()</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">instance</span><span class="o">.</span><span class="n">_listShares</span><span class="p">(</span><span class="n">d</span><span class="o">.</span><span class="n">callback</span><span class="p">,</span> <span class="n">d</span><span class="o">.</span><span class="n">errback</span><span class="p">,</span> <span class="n">timeout</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">d</span></div>

<div class="viewcode-block" id="SMBProtocolFactory.listPath"><a class="viewcode-back" href="../../api/smb_SMBProtocolFactory.html#smb.SMBProtocol.SMBProtocolFactory.listPath">[docs]</a>    <span class="k">def</span> <span class="nf">listPath</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">service_name</span><span class="p">,</span> <span class="n">path</span><span class="p">,</span>
                 <span class="n">search</span> <span class="o">=</span> <span class="n">SMB_FILE_ATTRIBUTE_READONLY</span> <span class="o">|</span> <span class="n">SMB_FILE_ATTRIBUTE_HIDDEN</span> <span class="o">|</span> <span class="n">SMB_FILE_ATTRIBUTE_SYSTEM</span> <span class="o">|</span> <span class="n">SMB_FILE_ATTRIBUTE_DIRECTORY</span> <span class="o">|</span> <span class="n">SMB_FILE_ATTRIBUTE_ARCHIVE</span> <span class="o">|</span> <span class="n">SMB_FILE_ATTRIBUTE_INCL_NORMAL</span><span class="p">,</span>
                 <span class="n">pattern</span> <span class="o">=</span> <span class="s1">&#39;*&#39;</span><span class="p">,</span> <span class="n">timeout</span> <span class="o">=</span> <span class="mi">30</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Retrieve a directory listing of files/folders at *path*</span>

<span class="sd">        For simplicity, pysmb defines a &quot;normal&quot; file as a file entry that is not read-only, not hidden, not system, not archive and not a directory.</span>
<span class="sd">        It ignores other attributes like compression, indexed, sparse, temporary and encryption.</span>

<span class="sd">        Note that the default search parameter will query for all read-only (SMB_FILE_ATTRIBUTE_READONLY), hidden (SMB_FILE_ATTRIBUTE_HIDDEN),</span>
<span class="sd">        system (SMB_FILE_ATTRIBUTE_SYSTEM), archive (SMB_FILE_ATTRIBUTE_ARCHIVE), normal (SMB_FILE_ATTRIBUTE_INCL_NORMAL) files</span>
<span class="sd">        and directories (SMB_FILE_ATTRIBUTE_DIRECTORY).</span>
<span class="sd">        If you do not need to include &quot;normal&quot; files in the result, define your own search parameter without the SMB_FILE_ATTRIBUTE_INCL_NORMAL constant.</span>
<span class="sd">        SMB_FILE_ATTRIBUTE_NORMAL should be used by itself and not be used with other bit constants.</span>

<span class="sd">        :param string/unicode service_name: the name of the shared folder for the *path*</span>
<span class="sd">        :param string/unicode path: path relative to the *service_name* where we are interested to learn about its files/sub-folders.</span>
<span class="sd">        :param integer search: integer value made up from a bitwise-OR of *SMB_FILE_ATTRIBUTE_xxx* bits (see smb_constants.py).</span>
<span class="sd">        :param string/unicode pattern: the filter to apply to the results before returning to the client.</span>
<span class="sd">        :param integer/float timeout: Number of seconds that pysmb will wait before raising *SMBTimeout* via the returned *Deferred* instance&#39;s *errback* method.</span>
<span class="sd">        :return: A *twisted.internet.defer.Deferred* instance. The callback function will be called with a list of :doc:`smb.base.SharedFile&lt;smb_SharedFile&gt;` instances.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">instance</span><span class="p">:</span>
            <span class="k">raise</span> <span class="n">NotConnectedError</span><span class="p">(</span><span class="s1">&#39;Not connected to server&#39;</span><span class="p">)</span>

        <span class="n">d</span> <span class="o">=</span> <span class="n">defer</span><span class="o">.</span><span class="n">Deferred</span><span class="p">()</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">instance</span><span class="o">.</span><span class="n">_listPath</span><span class="p">(</span><span class="n">service_name</span><span class="p">,</span> <span class="n">path</span><span class="p">,</span> <span class="n">d</span><span class="o">.</span><span class="n">callback</span><span class="p">,</span> <span class="n">d</span><span class="o">.</span><span class="n">errback</span><span class="p">,</span> <span class="n">search</span> <span class="o">=</span> <span class="n">search</span><span class="p">,</span> <span class="n">pattern</span> <span class="o">=</span> <span class="n">pattern</span><span class="p">,</span> <span class="n">timeout</span> <span class="o">=</span> <span class="n">timeout</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">d</span></div>

<div class="viewcode-block" id="SMBProtocolFactory.listSnapshots"><a class="viewcode-back" href="../../api/smb_SMBProtocolFactory.html#smb.SMBProtocol.SMBProtocolFactory.listSnapshots">[docs]</a>    <span class="k">def</span> <span class="nf">listSnapshots</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">service_name</span><span class="p">,</span> <span class="n">path</span><span class="p">,</span> <span class="n">timeout</span> <span class="o">=</span> <span class="mi">30</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Retrieve a list of available snapshots (a.k.a. shadow copies) for *path*.</span>

<span class="sd">        Note that snapshot features are only supported on Windows Vista Business, Enterprise and Ultimate, and on all Windows 7 editions.</span>

<span class="sd">        :param string/unicode service_name: the name of the shared folder for the *path*</span>
<span class="sd">        :param string/unicode path: path relative to the *service_name* where we are interested in the list of available snapshots</span>
<span class="sd">        :return: A *twisted.internet.defer.Deferred* instance. The callback function will be called with a list of python *datetime.DateTime*</span>
<span class="sd">                 instances in GMT/UTC time zone</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">instance</span><span class="p">:</span>
            <span class="k">raise</span> <span class="n">NotConnectedError</span><span class="p">(</span><span class="s1">&#39;Not connected to server&#39;</span><span class="p">)</span>

        <span class="n">d</span> <span class="o">=</span> <span class="n">defer</span><span class="o">.</span><span class="n">Deferred</span><span class="p">()</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">instance</span><span class="o">.</span><span class="n">_listSnapshots</span><span class="p">(</span><span class="n">service_name</span><span class="p">,</span> <span class="n">path</span><span class="p">,</span> <span class="n">d</span><span class="o">.</span><span class="n">callback</span><span class="p">,</span> <span class="n">d</span><span class="o">.</span><span class="n">errback</span><span class="p">,</span> <span class="n">timeout</span> <span class="o">=</span> <span class="n">timeout</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">d</span></div>

<div class="viewcode-block" id="SMBProtocolFactory.getAttributes"><a class="viewcode-back" href="../../api/smb_SMBProtocolFactory.html#smb.SMBProtocol.SMBProtocolFactory.getAttributes">[docs]</a>    <span class="k">def</span> <span class="nf">getAttributes</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">service_name</span><span class="p">,</span> <span class="n">path</span><span class="p">,</span> <span class="n">timeout</span> <span class="o">=</span> <span class="mi">30</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Retrieve information about the file at *path* on the *service_name*.</span>

<span class="sd">        :param string/unicode se
Download .txt
gitextract_0ims3cyo/

├── .gitignore
├── .readthedocs.yaml
├── CHANGELOG
├── LICENSE
├── MANIFEST.in
├── README.md
├── README.txt
├── docs/
│   ├── doctrees/
│   │   ├── api/
│   │   │   ├── nmb_NBNSProtocol.doctree
│   │   │   ├── nmb_NetBIOS.doctree
│   │   │   ├── smb_SMBConnection.doctree
│   │   │   ├── smb_SMBHandler.doctree
│   │   │   ├── smb_SMBProtocolFactory.doctree
│   │   │   ├── smb_SharedDevice.doctree
│   │   │   ├── smb_SharedFile.doctree
│   │   │   ├── smb_exceptions.doctree
│   │   │   └── smb_security_descriptors.doctree
│   │   ├── environment.pickle
│   │   ├── extending.doctree
│   │   ├── index.doctree
│   │   └── upgrading.doctree
│   └── html/
│       ├── .buildinfo
│       ├── _modules/
│       │   ├── index.html
│       │   ├── nmb/
│       │   │   ├── NetBIOS.html
│       │   │   └── NetBIOSProtocol.html
│       │   └── smb/
│       │       ├── SMBConnection.html
│       │       ├── SMBProtocol.html
│       │       ├── base.html
│       │       ├── security_descriptors.html
│       │       └── smb_structs.html
│       ├── _sources/
│       │   ├── api/
│       │   │   ├── nmb_NBNSProtocol.rst.txt
│       │   │   ├── nmb_NBNSProtocol.txt
│       │   │   ├── nmb_NetBIOS.rst.txt
│       │   │   ├── nmb_NetBIOS.txt
│       │   │   ├── smb_SMBConnection.rst.txt
│       │   │   ├── smb_SMBConnection.txt
│       │   │   ├── smb_SMBHandler.rst.txt
│       │   │   ├── smb_SMBHandler.txt
│       │   │   ├── smb_SMBProtocolFactory.rst.txt
│       │   │   ├── smb_SMBProtocolFactory.txt
│       │   │   ├── smb_SharedDevice.rst.txt
│       │   │   ├── smb_SharedDevice.txt
│       │   │   ├── smb_SharedFile.rst.txt
│       │   │   ├── smb_SharedFile.txt
│       │   │   ├── smb_exceptions.rst.txt
│       │   │   ├── smb_exceptions.txt
│       │   │   ├── smb_security_descriptors.rst.txt
│       │   │   └── smb_security_descriptors.txt
│       │   ├── extending.rst.txt
│       │   ├── extending.txt
│       │   ├── index.rst.txt
│       │   ├── index.txt
│       │   ├── upgrading.rst.txt
│       │   └── upgrading.txt
│       ├── _static/
│       │   ├── _sphinx_javascript_frameworks_compat.js
│       │   ├── basic.css
│       │   ├── doctools.js
│       │   ├── documentation_options.js
│       │   ├── jquery-3.5.1.js
│       │   ├── jquery-3.6.0.js
│       │   ├── jquery.js
│       │   ├── language_data.js
│       │   ├── pygments.css
│       │   ├── searchtools.js
│       │   ├── sphinx_highlight.js
│       │   ├── sphinxdoc.css
│       │   ├── underscore-1.13.1.js
│       │   ├── underscore-1.3.1.js
│       │   ├── underscore.js
│       │   └── websupport.js
│       ├── api/
│       │   ├── nmb_NBNSProtocol.html
│       │   ├── nmb_NetBIOS.html
│       │   ├── smb_SMBConnection.html
│       │   ├── smb_SMBHandler.html
│       │   ├── smb_SMBProtocolFactory.html
│       │   ├── smb_SharedDevice.html
│       │   ├── smb_SharedFile.html
│       │   ├── smb_exceptions.html
│       │   └── smb_security_descriptors.html
│       ├── extending.html
│       ├── genindex.html
│       ├── index.html
│       ├── objects.inv
│       ├── py-modindex.html
│       ├── search.html
│       ├── searchindex.js
│       └── upgrading.html
├── python2/
│   ├── nmb/
│   │   ├── NetBIOS.py
│   │   ├── NetBIOSProtocol.py
│   │   ├── __init__.py
│   │   ├── base.py
│   │   ├── nmb_constants.py
│   │   ├── nmb_structs.py
│   │   └── utils.py
│   ├── smb/
│   │   ├── SMBConnection.py
│   │   ├── SMBHandler.py
│   │   ├── SMBProtocol.py
│   │   ├── __init__.py
│   │   ├── base.py
│   │   ├── ntlm.py
│   │   ├── security_descriptors.py
│   │   ├── securityblob.py
│   │   ├── smb2_constants.py
│   │   ├── smb2_structs.py
│   │   ├── smb_constants.py
│   │   ├── smb_structs.py
│   │   └── utils/
│   │       ├── README.txt
│   │       ├── U32.py
│   │       ├── __init__.py
│   │       ├── md4.py
│   │       ├── pyDes.py
│   │       ├── rc4.py
│   │       └── sha256.py
│   └── tests/
│       ├── DirectSMBConnectionTests/
│       │   ├── __init__.py
│       │   ├── test_SMBHandler.py
│       │   ├── test_auth.py
│       │   ├── test_createdeletedirectory.py
│       │   ├── test_echo.py
│       │   ├── test_listpath.py
│       │   ├── test_listshares.py
│       │   ├── test_listsnapshots.py
│       │   ├── test_rename.py
│       │   ├── test_retrievefile.py
│       │   ├── test_storefile.py
│       │   └── util.py
│       ├── DirectSMBTwistedTests/
│       │   ├── test_auth.py
│       │   ├── test_createdeletedirectory.py
│       │   ├── test_echo.py
│       │   ├── test_listpath.py
│       │   ├── test_listshares.py
│       │   ├── test_listsnapshots.py
│       │   ├── test_rename.py
│       │   ├── test_retrievefile.py
│       │   ├── test_storefile.py
│       │   └── util.py
│       ├── NetBIOSTests/
│       │   ├── __init__.py
│       │   └── test_queryname.py
│       ├── NetBIOSTwistedTests/
│       │   ├── __init__.py
│       │   └── test_queryname.py
│       ├── README.md
│       ├── SMBConnectionTests/
│       │   ├── __init__.py
│       │   ├── test_SMBHandler.py
│       │   ├── test_auth.py
│       │   ├── test_createdeletedirectory.py
│       │   ├── test_deletepattern.py
│       │   ├── test_echo.py
│       │   ├── test_getattributes.py
│       │   ├── test_listpath.py
│       │   ├── test_listshares.py
│       │   ├── test_listsnapshots.py
│       │   ├── test_rename.py
│       │   ├── test_retrievefile.py
│       │   ├── test_security.py
│       │   ├── test_storefile.py
│       │   ├── test_with_context.py
│       │   └── util.py
│       ├── SMBTwistedTests/
│       │   ├── __init__.py
│       │   ├── test_auth.py
│       │   ├── test_createdeletedirectory.py
│       │   ├── test_echo.py
│       │   ├── test_getattributes.py
│       │   ├── test_listpath.py
│       │   ├── test_listshares.py
│       │   ├── test_listsnapshots.py
│       │   ├── test_rename.py
│       │   ├── test_retrievefile.py
│       │   ├── test_storefile.py
│       │   └── util.py
│       ├── __init__.py
│       ├── connection.ini
│       ├── test_ntlm.py
│       ├── test_security_descriptors.py
│       └── test_securityblob.py
├── python3/
│   ├── nmb/
│   │   ├── NetBIOS.py
│   │   ├── NetBIOSProtocol.py
│   │   ├── __init__.py
│   │   ├── base.py
│   │   ├── nmb_constants.py
│   │   ├── nmb_structs.py
│   │   └── utils.py
│   ├── smb/
│   │   ├── SMBConnection.py
│   │   ├── SMBHandler.py
│   │   ├── SMBProtocol.py
│   │   ├── __init__.py
│   │   ├── base.py
│   │   ├── ntlm.py
│   │   ├── security_descriptors.py
│   │   ├── securityblob.py
│   │   ├── smb2_constants.py
│   │   ├── smb2_structs.py
│   │   ├── smb_constants.py
│   │   ├── smb_structs.py
│   │   ├── strategy.py
│   │   └── utils/
│   │       ├── U32.py
│   │       ├── __init__.py
│   │       ├── md4.py
│   │       ├── pyDes.py
│   │       ├── rc4.py
│   │       └── sha256.py
│   └── tests/
│       ├── DirectSMBConnectionTests/
│       │   ├── __init__.py
│       │   ├── test_auth.py
│       │   ├── test_createdeletedirectory.py
│       │   ├── test_echo.py
│       │   ├── test_listpath.py
│       │   ├── test_listshares.py
│       │   ├── test_listsnapshots.py
│       │   ├── test_rename.py
│       │   ├── test_retrievefile.py
│       │   ├── test_storefile.py
│       │   ├── test_tqdm.py
│       │   └── util.py
│       ├── NetBIOSTests/
│       │   ├── __init__.py
│       │   └── test_queryname.py
│       ├── README.md
│       ├── SMBConnectionTests/
│       │   ├── __init__.py
│       │   ├── test_SMBHandler.py
│       │   ├── test_auth.py
│       │   ├── test_createdeletedirectory.py
│       │   ├── test_deletepattern.py
│       │   ├── test_echo.py
│       │   ├── test_getattributes.py
│       │   ├── test_listpath.py
│       │   ├── test_listshares.py
│       │   ├── test_listsnapshots.py
│       │   ├── test_messages_in_exception.py
│       │   ├── test_rename.py
│       │   ├── test_retrievefile.py
│       │   ├── test_storefile.py
│       │   ├── test_with_context.py
│       │   └── util.py
│       ├── __init__.py
│       ├── connection.ini
│       ├── test_md4.py
│       ├── test_ntlm.py
│       ├── test_security_descriptors.py
│       └── test_securityblob.py
├── setup.py
├── sphinx/
│   ├── Makefile
│   ├── make.bat
│   ├── requirements.txt
│   └── source/
│       ├── api/
│       │   ├── nmb_NBNSProtocol.rst
│       │   ├── nmb_NetBIOS.rst
│       │   ├── smb_SMBConnection.rst
│       │   ├── smb_SMBHandler.rst
│       │   ├── smb_SMBProtocolFactory.rst
│       │   ├── smb_SharedDevice.rst
│       │   ├── smb_SharedFile.rst
│       │   ├── smb_exceptions.rst
│       │   └── smb_security_descriptors.rst
│       ├── conf.py
│       ├── extending.rst
│       ├── index.rst
│       └── upgrading.rst
└── utils/
    ├── ScanNetworkForSMB.py
    └── recursiveDelete.py
Download .txt
SYMBOL INDEX (2129 symbols across 137 files)

FILE: docs/html/_static/_sphinx_javascript_frameworks_compat.js
  function highlight (line 62) | function highlight(node, addItems) {

FILE: docs/html/_static/doctools.js
  constant BLACKLISTED_KEY_CONTROL_ELEMENTS (line 13) | const BLACKLISTED_KEY_CONTROL_ELEMENTS = new Set([

FILE: docs/html/_static/documentation_options.js
  constant DOCUMENTATION_OPTIONS (line 1) | const DOCUMENTATION_OPTIONS = {

FILE: docs/html/_static/jquery-3.5.1.js
  function DOMEval (line 103) | function DOMEval( code, node, doc ) {
  function toType (line 133) | function toType( obj ) {
  function isArrayLike (line 503) | function isArrayLike( obj ) {
  function Sizzle (line 755) | function Sizzle( selector, context, results, seed ) {
  function createCache (line 903) | function createCache() {
  function markFunction (line 923) | function markFunction( fn ) {
  function assert (line 932) | function assert( fn ) {
  function addHandle (line 956) | function addHandle( attrs, handler ) {
  function siblingCheck (line 971) | function siblingCheck( a, b ) {
  function createInputPseudo (line 997) | function createInputPseudo( type ) {
  function createButtonPseudo (line 1008) | function createButtonPseudo( type ) {
  function createDisabledPseudo (line 1019) | function createDisabledPseudo( disabled ) {
  function createPositionalPseudo (line 1075) | function createPositionalPseudo( fn ) {
  function testContext (line 1098) | function testContext( context ) {
  function setFilters (line 2309) | function setFilters() {}
  function toSelector (line 2383) | function toSelector( tokens ) {
  function addCombinator (line 2393) | function addCombinator( matcher, combinator, base ) {
  function elementMatcher (line 2460) | function elementMatcher( matchers ) {
  function multipleContexts (line 2474) | function multipleContexts( selector, contexts, results ) {
  function condense (line 2483) | function condense( unmatched, map, filter, context, xml ) {
  function setMatcher (line 2504) | function setMatcher( preFilter, selector, matcher, postFilter, postFinde...
  function matcherFromTokens (line 2604) | function matcherFromTokens( tokens ) {
  function matcherFromGroupMatchers (line 2667) | function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
  function nodeName (line 3025) | function nodeName( elem, name ) {
  function winnow (line 3035) | function winnow( elements, qualifier, not ) {
  function sibling (line 3330) | function sibling( cur, dir ) {
  function createOptions (line 3423) | function createOptions( options ) {
  function Identity (line 3648) | function Identity( v ) {
  function Thrower (line 3651) | function Thrower( ex ) {
  function adoptValue (line 3655) | function adoptValue( value, resolve, reject, noValue ) {
  function resolve (line 3748) | function resolve( depth, deferred, handler, special ) {
  function completed (line 4113) | function completed() {
  function fcamelCase (line 4208) | function fcamelCase( _all, letter ) {
  function camelCase (line 4215) | function camelCase( string ) {
  function Data (line 4232) | function Data() {
  function getData (line 4401) | function getData( data ) {
  function dataAttr (line 4426) | function dataAttr( elem, key, data ) {
  function adjustCSS (line 4738) | function adjustCSS( elem, prop, valueParts, tween ) {
  function getDefaultDisplay (line 4806) | function getDefaultDisplay( elem ) {
  function showHide (line 4829) | function showHide( elements, show ) {
  function getAll (line 4961) | function getAll( context, tag ) {
  function setGlobalEval (line 4986) | function setGlobalEval( elems, refElements ) {
  function buildFragment (line 5002) | function buildFragment( elems, context, scripts, selection, ignored ) {
  function returnTrue (line 5097) | function returnTrue() {
  function returnFalse (line 5101) | function returnFalse() {
  function expectSync (line 5111) | function expectSync( elem, type ) {
  function safeActiveElement (line 5118) | function safeActiveElement() {
  function on (line 5124) | function on( elem, types, selector, data, fn, one ) {
  function leverageNative (line 5612) | function leverageNative( el, type, expectSync ) {
  function manipulationTarget (line 5976) | function manipulationTarget( elem, content ) {
  function disableScript (line 5987) | function disableScript( elem ) {
  function restoreScript (line 5991) | function restoreScript( elem ) {
  function cloneCopyEvent (line 6001) | function cloneCopyEvent( src, dest ) {
  function fixInput (line 6034) | function fixInput( src, dest ) {
  function domManip (line 6047) | function domManip( collection, args, callback, ignored ) {
  function remove (line 6139) | function remove( elem, selector, keepData ) {
  function computeStyleTests (line 6453) | function computeStyleTests() {
  function roundPixelMeasures (line 6497) | function roundPixelMeasures( measure ) {
  function curCSS (line 6571) | function curCSS( elem, name, computed ) {
  function addGetHookIf (line 6624) | function addGetHookIf( conditionFn, hookFn ) {
  function vendorPropName (line 6649) | function vendorPropName( name ) {
  function finalPropName (line 6664) | function finalPropName( name ) {
  function setPositiveNumber (line 6690) | function setPositiveNumber( _elem, value, subtract ) {
  function boxModelAdjustment (line 6702) | function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, ...
  function getWidthOrHeight (line 6770) | function getWidthOrHeight( elem, dimension, extra ) {
  function Tween (line 7146) | function Tween( elem, options, prop, end, easing ) {
  function schedule (line 7269) | function schedule() {
  function createFxNow (line 7282) | function createFxNow() {
  function genFx (line 7290) | function genFx( type, includeWidth ) {
  function createTween (line 7310) | function createTween( value, prop, animation ) {
  function defaultPrefilter (line 7324) | function defaultPrefilter( elem, props, opts ) {
  function propFilter (line 7496) | function propFilter( props, specialEasing ) {
  function Animation (line 7533) | function Animation( elem, properties, options ) {
  function stripAndCollapse (line 8248) | function stripAndCollapse( value ) {
  function getClass (line 8254) | function getClass( elem ) {
  function classesToArray (line 8258) | function classesToArray( value ) {
  function buildParams (line 8885) | function buildParams( prefix, obj, traditional, add ) {
  function addToPrefiltersOrTransports (line 9039) | function addToPrefiltersOrTransports( structure ) {
  function inspectPrefiltersOrTransports (line 9073) | function inspectPrefiltersOrTransports( structure, options, originalOpti...
  function ajaxExtend (line 9102) | function ajaxExtend( target, src ) {
  function ajaxHandleResponses (line 9122) | function ajaxHandleResponses( s, jqXHR, responses ) {
  function ajaxConvert (line 9180) | function ajaxConvert( s, response, jqXHR, isSuccess ) {
  function done (line 9696) | function done( status, nativeStatusText, responses, headers ) {

FILE: docs/html/_static/jquery-3.6.0.js
  function DOMEval (line 107) | function DOMEval( code, node, doc ) {
  function toType (line 137) | function toType( obj ) {
  function isArrayLike (line 507) | function isArrayLike( obj ) {
  function Sizzle (line 759) | function Sizzle( selector, context, results, seed ) {
  function createCache (line 907) | function createCache() {
  function markFunction (line 927) | function markFunction( fn ) {
  function assert (line 936) | function assert( fn ) {
  function addHandle (line 960) | function addHandle( attrs, handler ) {
  function siblingCheck (line 975) | function siblingCheck( a, b ) {
  function createInputPseudo (line 1001) | function createInputPseudo( type ) {
  function createButtonPseudo (line 1012) | function createButtonPseudo( type ) {
  function createDisabledPseudo (line 1023) | function createDisabledPseudo( disabled ) {
  function createPositionalPseudo (line 1079) | function createPositionalPseudo( fn ) {
  function testContext (line 1102) | function testContext( context ) {
  function setFilters (line 2313) | function setFilters() {}
  function toSelector (line 2387) | function toSelector( tokens ) {
  function addCombinator (line 2397) | function addCombinator( matcher, combinator, base ) {
  function elementMatcher (line 2464) | function elementMatcher( matchers ) {
  function multipleContexts (line 2478) | function multipleContexts( selector, contexts, results ) {
  function condense (line 2487) | function condense( unmatched, map, filter, context, xml ) {
  function setMatcher (line 2508) | function setMatcher( preFilter, selector, matcher, postFilter, postFinde...
  function matcherFromTokens (line 2608) | function matcherFromTokens( tokens ) {
  function matcherFromGroupMatchers (line 2671) | function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
  function nodeName (line 3029) | function nodeName( elem, name ) {
  function winnow (line 3039) | function winnow( elements, qualifier, not ) {
  function sibling (line 3334) | function sibling( cur, dir ) {
  function createOptions (line 3427) | function createOptions( options ) {
  function Identity (line 3652) | function Identity( v ) {
  function Thrower (line 3655) | function Thrower( ex ) {
  function adoptValue (line 3659) | function adoptValue( value, resolve, reject, noValue ) {
  function resolve (line 3752) | function resolve( depth, deferred, handler, special ) {
  function completed (line 4117) | function completed() {
  function fcamelCase (line 4212) | function fcamelCase( _all, letter ) {
  function camelCase (line 4219) | function camelCase( string ) {
  function Data (line 4236) | function Data() {
  function getData (line 4405) | function getData( data ) {
  function dataAttr (line 4430) | function dataAttr( elem, key, data ) {
  function adjustCSS (line 4742) | function adjustCSS( elem, prop, valueParts, tween ) {
  function getDefaultDisplay (line 4810) | function getDefaultDisplay( elem ) {
  function showHide (line 4833) | function showHide( elements, show ) {
  function getAll (line 4965) | function getAll( context, tag ) {
  function setGlobalEval (line 4990) | function setGlobalEval( elems, refElements ) {
  function buildFragment (line 5006) | function buildFragment( elems, context, scripts, selection, ignored ) {
  function returnTrue (line 5098) | function returnTrue() {
  function returnFalse (line 5102) | function returnFalse() {
  function expectSync (line 5112) | function expectSync( elem, type ) {
  function safeActiveElement (line 5119) | function safeActiveElement() {
  function on (line 5125) | function on( elem, types, selector, data, fn, one ) {
  function leverageNative (line 5613) | function leverageNative( el, type, expectSync ) {
  function manipulationTarget (line 5962) | function manipulationTarget( elem, content ) {
  function disableScript (line 5973) | function disableScript( elem ) {
  function restoreScript (line 5977) | function restoreScript( elem ) {
  function cloneCopyEvent (line 5987) | function cloneCopyEvent( src, dest ) {
  function fixInput (line 6020) | function fixInput( src, dest ) {
  function domManip (line 6033) | function domManip( collection, args, callback, ignored ) {
  function remove (line 6125) | function remove( elem, selector, keepData ) {
  function computeStyleTests (line 6439) | function computeStyleTests() {
  function roundPixelMeasures (line 6483) | function roundPixelMeasures( measure ) {
  function curCSS (line 6576) | function curCSS( elem, name, computed ) {
  function addGetHookIf (line 6629) | function addGetHookIf( conditionFn, hookFn ) {
  function vendorPropName (line 6654) | function vendorPropName( name ) {
  function finalPropName (line 6669) | function finalPropName( name ) {
  function setPositiveNumber (line 6695) | function setPositiveNumber( _elem, value, subtract ) {
  function boxModelAdjustment (line 6707) | function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, ...
  function getWidthOrHeight (line 6775) | function getWidthOrHeight( elem, dimension, extra ) {
  function Tween (line 7151) | function Tween( elem, options, prop, end, easing ) {
  function schedule (line 7274) | function schedule() {
  function createFxNow (line 7287) | function createFxNow() {
  function genFx (line 7295) | function genFx( type, includeWidth ) {
  function createTween (line 7315) | function createTween( value, prop, animation ) {
  function defaultPrefilter (line 7329) | function defaultPrefilter( elem, props, opts ) {
  function propFilter (line 7501) | function propFilter( props, specialEasing ) {
  function Animation (line 7538) | function Animation( elem, properties, options ) {
  function stripAndCollapse (line 8254) | function stripAndCollapse( value ) {
  function getClass (line 8260) | function getClass( elem ) {
  function classesToArray (line 8264) | function classesToArray( value ) {
  function buildParams (line 8894) | function buildParams( prefix, obj, traditional, add ) {
  function addToPrefiltersOrTransports (line 9047) | function addToPrefiltersOrTransports( structure ) {
  function inspectPrefiltersOrTransports (line 9081) | function inspectPrefiltersOrTransports( structure, options, originalOpti...
  function ajaxExtend (line 9110) | function ajaxExtend( target, src ) {
  function ajaxHandleResponses (line 9130) | function ajaxHandleResponses( s, jqXHR, responses ) {
  function ajaxConvert (line 9188) | function ajaxConvert( s, response, jqXHR, isSuccess ) {
  function done (line 9704) | function done( status, nativeStatusText, responses, headers ) {

FILE: docs/html/_static/jquery.js
  function b (line 2) | function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e...
  function w (line 2) | function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof...
  function p (line 2) | function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e...
  function se (line 2) | function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeTy...
  function ue (line 2) | function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cac...
  function le (line 2) | function le(e){return e[S]=!0,e}
  function ce (line 2) | function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(...
  function fe (line 2) | function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[...
  function pe (line 2) | function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourc...
  function de (line 2) | function de(t){return function(e){return"input"===e.nodeName.toLowerCase...
  function he (line 2) | function he(n){return function(e){var t=e.nodeName.toLowerCase();return(...
  function ge (line 2) | function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e....
  function ve (line 2) | function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,...
  function ye (line 2) | function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}
  function me (line 2) | function me(){}
  function xe (line 2) | function xe(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}
  function be (line 2) | function be(s,e,t){var u=e.dir,l=e.next,c=l||u,f=t&&"parentNode"===c,p=r...
  function we (line 2) | function we(i){return 1<i.length?function(e,t,n){var r=i.length;while(r-...
  function Te (line 2) | function Te(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(...
  function Ce (line 2) | function Ce(d,h,g,v,y,e){return v&&!v[S]&&(v=Ce(v)),y&&!y[S]&&(y=Ce(y,e)...
  function Ee (line 2) | function Ee(e){for(var i,t,n,r=e.length,o=b.relative[e[0].type],a=o||b.r...
  function A (line 2) | function A(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerC...
  function j (line 2) | function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,...
  function O (line 2) | function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}
  function R (line 2) | function R(e){return e}
  function M (line 2) | function M(e){throw e}
  function I (line 2) | function I(e,t,n,r){var i;try{e&&m(i=e.promise)?i.call(e).done(t).fail(n...
  function l (line 2) | function l(i,o,a,s){return function(){var n=this,r=arguments,e=function(...
  function B (line 2) | function B(){E.removeEventListener("DOMContentLoaded",B),C.removeEventLi...
  function U (line 2) | function U(e,t){return t.toUpperCase()}
  function X (line 2) | function X(e){return e.replace(_,"ms-").replace(z,U)}
  function G (line 2) | function G(){this.expando=S.expando+G.uid++}
  function Z (line 2) | function Z(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r="data-"+t.r...
  function se (line 2) | function se(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:functio...
  function le (line 2) | function le(e,t){for(var n,r,i,o,a,s,u,l=[],c=0,f=e.length;c<f;c++)(r=e[...
  function ve (line 2) | function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagNa...
  function ye (line 2) | function ye(e,t){for(var n=0,r=e.length;n<r;n++)Y.set(e[n],"globalEval",...
  function xe (line 2) | function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),...
  function we (line 2) | function we(){return!0}
  function Te (line 2) | function Te(){return!1}
  function Ce (line 2) | function Ce(e,t){return e===function(){try{return E.activeElement}catch(...
  function Ee (line 2) | function Ee(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"...
  function Se (line 2) | function Se(e,i,o){o?(Y.set(e,i,!1),S.event.add(e,i,{namespace:!1,handle...
  function je (line 2) | function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"...
  function De (line 2) | function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}
  function qe (line 2) | function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.sli...
  function Le (line 2) | function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=...
  function He (line 2) | function He(n,r,i,o){r=g(r);var e,t,a,s,u,l,c=0,f=n.length,p=f-1,d=r[0],...
  function Oe (line 2) | function Oe(e,t,n){for(var r,i=t?S.filter(t,e):e,o=0;null!=(r=i[o]);o++)...
  function We (line 2) | function We(e,t,n){var r,i,o,a,s=e.style;return(n=n||Re(e))&&(""!==(a=n....
  function Fe (line 2) | function Fe(e,t){return{get:function(){if(!e())return(this.get=t).apply(...
  function e (line 2) | function e(){if(l){u.style.cssText="position:absolute;left:-11111px;widt...
  function t (line 2) | function t(e){return Math.round(parseFloat(e))}
  function ze (line 2) | function ze(e){var t=S.cssProps[e]||_e[e];return t||(e in $e?e:_e[e]=fun...
  function Ye (line 2) | function Ye(e,t,n){var r=te.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[...
  function Qe (line 2) | function Qe(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0;if(n===(r?"border...
  function Je (line 2) | function Je(e,t,n){var r=Re(e),i=(!y.boxSizingReliable()||n)&&"border-bo...
  function Ke (line 2) | function Ke(e,t,n,r,i){return new Ke.prototype.init(e,t,n,r,i)}
  function ot (line 2) | function ot(){et&&(!1===E.hidden&&C.requestAnimationFrame?C.requestAnima...
  function at (line 2) | function at(){return C.setTimeout(function(){Ze=void 0}),Ze=Date.now()}
  function st (line 2) | function st(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin...
  function ut (line 2) | function ut(e,t,n){for(var r,i=(lt.tweeners[t]||[]).concat(lt.tweeners["...
  function lt (line 2) | function lt(o,e,t){var n,a,r=0,i=lt.prefilters.length,s=S.Deferred().alw...
  function ht (line 2) | function ht(e){return(e.match(P)||[]).join(" ")}
  function gt (line 2) | function gt(e){return e.getAttribute&&e.getAttribute("class")||""}
  function vt (line 2) | function vt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(P)|...
  function At (line 2) | function At(n,e,r,i){var t;if(Array.isArray(e))S.each(e,function(e,t){r|...
  function It (line 2) | function It(o){return function(e,t){"string"!=typeof e&&(t=e,e="*");var ...
  function Wt (line 2) | function Wt(t,i,o,a){var s={},u=t===Pt;function l(e){var r;return s[e]=!...
  function Ft (line 2) | function Ft(e,t){var n,r,i=S.ajaxSettings.flatOptions||{};for(n in t)voi...
  function l (line 2) | function l(e,t,n,r){var i,o,a,s,u,l=t;h||(h=!0,d&&C.clearTimeout(d),c=vo...

FILE: docs/html/_static/sphinx_highlight.js
  constant SPHINX_HIGHLIGHT_ENABLED (line 4) | const SPHINX_HIGHLIGHT_ENABLED = true

FILE: docs/html/_static/underscore-1.13.1.js
  function restArguments (line 64) | function restArguments(func, startIndex) {
  function isObject (line 88) | function isObject(obj) {
  function isNull (line 94) | function isNull(obj) {
  function isUndefined (line 99) | function isUndefined(obj) {
  function isBoolean (line 104) | function isBoolean(obj) {
  function isElement (line 109) | function isElement(obj) {
  function tagTester (line 114) | function tagTester(name) {
  function ie10IsDataView (line 162) | function ie10IsDataView(obj) {
  function has$1 (line 173) | function has$1(obj, key) {
  function isFinite$1 (line 192) | function isFinite$1(obj) {
  function isNaN$1 (line 197) | function isNaN$1(obj) {
  function constant (line 202) | function constant(value) {
  function createSizePropertyCheck (line 209) | function createSizePropertyCheck(getSizeProperty) {
  function shallowProperty (line 217) | function shallowProperty(key) {
  function isTypedArray (line 232) | function isTypedArray(obj) {
  function emulatedSet (line 248) | function emulatedSet(keys) {
  function collectNonEnumProps (line 263) | function collectNonEnumProps(obj, keys) {
  function keys (line 283) | function keys(obj) {
  function isEmpty (line 295) | function isEmpty(obj) {
  function isMatch (line 307) | function isMatch(object, attrs) {
  function _$1 (line 321) | function _$1(obj) {
  function toBufferView (line 344) | function toBufferView(bufferSource) {
  function eq (line 356) | function eq(a, b, aStack, bStack) {
  function deepEq (line 371) | function deepEq(a, b, aStack, bStack) {
  function isEqual (line 476) | function isEqual(a, b) {
  function allKeys (line 481) | function allKeys(obj) {
  function ie11fingerprint (line 494) | function ie11fingerprint(methods) {
  function values (line 533) | function values(obj) {
  function pairs (line 545) | function pairs(obj) {
  function invert (line 556) | function invert(obj) {
  function functions (line 566) | function functions(obj) {
  function createAssigner (line 575) | function createAssigner(keysFunc, defaults) {
  function ctor (line 605) | function ctor() {
  function baseCreate (line 610) | function baseCreate(prototype) {
  function create (line 623) | function create(prototype, props) {
  function clone (line 630) | function clone(obj) {
  function tap (line 638) | function tap(obj, interceptor) {
  function toPath$1 (line 645) | function toPath$1(path) {
  function toPath (line 652) | function toPath(path) {
  function deepGet (line 657) | function deepGet(obj, path) {
  function get (line 670) | function get(object, path, defaultValue) {
  function has (line 678) | function has(obj, path) {
  function identity (line 690) | function identity(value) {
  function matcher (line 696) | function matcher(attrs) {
  function property (line 705) | function property(path) {
  function optimizeCb (line 715) | function optimizeCb(func, context, argCount) {
  function baseIteratee (line 737) | function baseIteratee(value, context, argCount) {
  function iteratee (line 747) | function iteratee(value, context) {
  function cb (line 754) | function cb(value, context, argCount) {
  function mapObject (line 761) | function mapObject(obj, iteratee, context) {
  function noop (line 774) | function noop(){}
  function propertyOf (line 777) | function propertyOf(obj) {
  function times (line 785) | function times(n, iteratee, context) {
  function random (line 793) | function random(min, max) {
  function createEscaper (line 808) | function createEscaper(map) {
  function escapeChar (line 867) | function escapeChar(match) {
  function template (line 882) | function template(text, settings, oldSettings) {
  function result (line 950) | function result(obj, path, fallback) {
  function uniqueId (line 970) | function uniqueId(prefix) {
  function chain (line 976) | function chain(obj) {
  function executeBound (line 985) | function executeBound(sourceFunc, boundFunc, context, callingContext, ar...
  function flatten$1 (line 1030) | function flatten$1(input, depth, strict, output) {
  function memoize (line 1071) | function memoize(func, hasher) {
  function throttle (line 1099) | function throttle(func, wait, options) {
  function debounce (line 1144) | function debounce(func, wait, immediate) {
  function wrap (line 1181) | function wrap(func, wrapper) {
  function negate (line 1186) | function negate(predicate) {
  function compose (line 1194) | function compose() {
  function after (line 1206) | function after(times, func) {
  function before (line 1216) | function before(times, func) {
  function findKey (line 1232) | function findKey(obj, predicate, context) {
  function createPredicateIndexFinder (line 1242) | function createPredicateIndexFinder(dir) {
  function sortedIndex (line 1262) | function sortedIndex(array, obj, iteratee, context) {
  function createIndexFinder (line 1274) | function createIndexFinder(dir, predicateFind, sortedIndex) {
  function find (line 1309) | function find(obj, predicate, context) {
  function findWhere (line 1317) | function findWhere(obj, attrs) {
  function each (line 1325) | function each(obj, iteratee, context) {
  function map (line 1342) | function map(obj, iteratee, context) {
  function createReduce (line 1355) | function createReduce(dir) {
  function filter (line 1387) | function filter(obj, predicate, context) {
  function reject (line 1397) | function reject(obj, predicate, context) {
  function every (line 1402) | function every(obj, predicate, context) {
  function some (line 1414) | function some(obj, predicate, context) {
  function contains (line 1426) | function contains(obj, item, fromIndex, guard) {
  function pluck (line 1456) | function pluck(obj, key) {
  function where (line 1462) | function where(obj, attrs) {
  function max (line 1467) | function max(obj, iteratee, context) {
  function min (line 1492) | function min(obj, iteratee, context) {
  function sample (line 1520) | function sample(obj, n, guard) {
  function shuffle (line 1539) | function shuffle(obj) {
  function sortBy (line 1544) | function sortBy(obj, iteratee, context) {
  function group (line 1565) | function group(behavior, partition) {
  function toArray (line 1604) | function toArray(obj) {
  function size (line 1616) | function size(obj) {
  function keyInObj (line 1623) | function keyInObj(value, key, obj) {
  function initial (line 1665) | function initial(array, n, guard) {
  function first (line 1671) | function first(array, n, guard) {
  function rest (line 1680) | function rest(array, n, guard) {
  function last (line 1686) | function last(array, n, guard) {
  function compact (line 1693) | function compact(array) {
  function flatten (line 1699) | function flatten(array, depth) {
  function uniq (line 1722) | function uniq(array, isSorted, iteratee, context) {
  function intersection (line 1757) | function intersection(array) {
  function unzip (line 1774) | function unzip(array) {
  function object (line 1791) | function object(list, values) {
  function range (line 1806) | function range(start, stop, step) {
  function chunk (line 1827) | function chunk(array, count) {
  function chainResult (line 1838) | function chainResult(instance, obj) {
  function mixin (line 1843) | function mixin(obj) {

FILE: docs/html/_static/underscore-1.3.1.js
  function eq (line 669) | function eq(a, b, stack) {

FILE: docs/html/_static/underscore.js
  function j (line 6) | function j(n,r){return r=null==r?n.length-1:+r,function(){for(var t=Math...
  function _ (line 6) | function _(n){var r=typeof n;return"function"===r||"object"===r&&!!n}
  function w (line 6) | function w(n){return void 0===n}
  function A (line 6) | function A(n){return!0===n||!1===n||"[object Boolean]"===a.call(n)}
  function x (line 6) | function x(n){var r="[object "+n+"]";return function(n){return a.call(n)...
  function W (line 6) | function W(n,r){return null!=n&&f.call(n,r)}
  function $ (line 6) | function $(n){return O(n)&&y(n)}
  function C (line 6) | function C(n){return function(){return n}}
  function K (line 6) | function K(n){return function(r){var t=n(r);return"number"==typeof t&&t>...
  function J (line 6) | function J(n){return function(r){return null==r?void 0:r[n]}}
  function Z (line 6) | function Z(n,r){r=function(n){for(var r={},t=n.length,e=0;e<t;++e)r[n[e]...
  function nn (line 6) | function nn(n){if(!_(n))return[];if(p)return p(n);var r=[];for(var t in ...
  function rn (line 6) | function rn(n,r){var t=nn(r),e=t.length;if(null==n)return!e;for(var u=Ob...
  function tn (line 6) | function tn(n){return n instanceof tn?n:this instanceof tn?void(this._wr...
  function en (line 6) | function en(n){return new Uint8Array(n.buffer||n,n.byteOffset||0,G(n))}
  function on (line 6) | function on(n,r,t,e){if(n===r)return 0!==n||1/n==1/r;if(null==n||null==r...
  function an (line 6) | function an(n){if(!_(n))return[];var r=[];for(var t in n)r.push(t);retur...
  function fn (line 6) | function fn(n){var r=Y(n);return function(t){if(null==t)return!1;var e=a...
  function jn (line 6) | function jn(n){for(var r=nn(n),t=r.length,e=Array(t),u=0;u<t;u++)e[u]=n[...
  function _n (line 6) | function _n(n){for(var r={},t=nn(n),e=0,u=t.length;e<u;e++)r[n[t[e]]]=t[...
  function wn (line 6) | function wn(n){var r=[];for(var t in n)D(n[t])&&r.push(t);return r.sort()}
  function An (line 6) | function An(n,r){return function(t){var e=arguments.length;if(r&&(t=Obje...
  function Mn (line 6) | function Mn(n){if(!_(n))return{};if(v)return v(n);var r=function(){};r.p...
  function En (line 6) | function En(n){return _(n)?U(n)?n.slice():xn({},n):n}
  function Bn (line 6) | function Bn(n){return U(n)?n:[n]}
  function Nn (line 6) | function Nn(n){return tn.toPath(n)}
  function In (line 6) | function In(n,r){for(var t=r.length,e=0;e<t;e++){if(null==n)return;n=n[r...
  function Tn (line 6) | function Tn(n,r,t){var e=In(n,Nn(r));return w(e)?t:e}
  function kn (line 6) | function kn(n){return n}
  function Dn (line 6) | function Dn(n){return n=Sn({},n),function(r){return rn(r,n)}}
  function Rn (line 6) | function Rn(n){return n=Nn(n),function(r){return In(r,n)}}
  function Fn (line 6) | function Fn(n,r,t){if(void 0===r)return n;switch(null==t?3:t){case 1:ret...
  function Vn (line 6) | function Vn(n,r,t){return null==n?kn:D(n)?Fn(n,r,t):_(n)&&!U(n)?Dn(n):Rn...
  function Pn (line 6) | function Pn(n,r){return Vn(n,r,1/0)}
  function qn (line 6) | function qn(n,r,t){return tn.iteratee!==Pn?tn.iteratee(n,r):Vn(n,r,t)}
  function Un (line 6) | function Un(){}
  function Wn (line 6) | function Wn(n,r){return null==r&&(r=n,n=0),n+Math.floor(Math.random()*(r...
  function Ln (line 6) | function Ln(n){var r=function(r){return n[r]},t="(?:"+nn(n).join("|")+")...
  function Xn (line 6) | function Xn(n){return"\\"+Hn[n]}
  function nr (line 6) | function nr(n,r,t,e,u){if(!(e instanceof r))return n.apply(t,u);var o=Mn...
  function ur (line 6) | function ur(n,r,t,e){if(e=e||[],r||0===r){if(r<=0)return e.concat(n)}els...
  function fr (line 6) | function fr(n){return function(){return!n.apply(this,arguments)}}
  function cr (line 6) | function cr(n,r){var t;return function(){return--n>0&&(t=r.apply(this,ar...
  function sr (line 6) | function sr(n,r,t){r=qn(r,t);for(var e,u=nn(n),o=0,i=u.length;o<i;o++)if...
  function pr (line 6) | function pr(n){return function(r,t,e){t=qn(t,e);for(var u=Y(r),o=n>0?0:u...
  function yr (line 6) | function yr(n,r,t,e){for(var u=(t=qn(t,e,1))(r),o=0,i=Y(n);o<i;){var a=M...
  function dr (line 6) | function dr(n,r,t){return function(e,u,o){var a=0,f=Y(e);if("number"==ty...
  function mr (line 6) | function mr(n,r,t){var e=(er(n)?vr:sr)(n,r,t);if(void 0!==e&&-1!==e)retu...
  function jr (line 6) | function jr(n,r,t){var e,u;if(r=Fn(r,t),er(n))for(e=0,u=n.length;e<u;e++...
  function _r (line 6) | function _r(n,r,t){r=qn(r,t);for(var e=!er(n)&&nn(n),u=(e||n).length,o=A...
  function wr (line 6) | function wr(n){var r=function(r,t,e,u){var o=!er(r)&&nn(r),i=(o||r).leng...
  function Sr (line 6) | function Sr(n,r,t){var e=[];return r=qn(r,t),jr(n,(function(n,t,u){r(n,t...
  function Or (line 6) | function Or(n,r,t){r=qn(r,t);for(var e=!er(n)&&nn(n),u=(e||n).length,o=0...
  function Mr (line 6) | function Mr(n,r,t){r=qn(r,t);for(var e=!er(n)&&nn(n),u=(e||n).length,o=0...
  function Er (line 6) | function Er(n,r,t,e){return er(n)||(n=jn(n)),("number"!=typeof t||e)&&(t...
  function Nr (line 6) | function Nr(n,r){return _r(n,Rn(r))}
  function Ir (line 6) | function Ir(n,r,t){var e,u,o=-1/0,i=-1/0;if(null==r||"number"==typeof r&...
  function Tr (line 6) | function Tr(n,r,t){if(null==r||t)return er(n)||(n=jn(n)),n[Wn(n.length-1...
  function kr (line 6) | function kr(n,r){return function(t,e,u){var o=r?[[],[]]:{};return e=qn(e...
  function qr (line 6) | function qr(n,r,t){return r in t}
  function zr (line 6) | function zr(n,r,t){return i.call(n,0,Math.max(0,n.length-(null==r||t?1:r...
  function Lr (line 6) | function Lr(n,r,t){return null==n||n.length<1?null==r||t?void 0:[]:null=...
  function $r (line 6) | function $r(n,r,t){return i.call(n,null==r||t?1:r)}
  function Jr (line 6) | function Jr(n,r,t,e){A(r)||(e=t,t=r,r=!1),null!=t&&(t=qn(t,e));for(var u...
  function Hr (line 6) | function Hr(n){for(var r=n&&Ir(n,Y).length||0,t=Array(r),e=0;e<r;e++)t[e...
  function Xr (line 6) | function Xr(n,r){return n._chain?tn(r).chain():r}
  function Yr (line 6) | function Yr(n){return jr(wn(n),(function(r){var t=tn[r]=n[r];tn.prototyp...

FILE: docs/html/_static/websupport.js
  function init (line 47) | function init() {
  function initEvents (line 52) | function initEvents() {
  function setComparator (line 107) | function setComparator() {
  function initComparator (line 127) | function initComparator() {
  function show (line 147) | function show(id) {
  function hide (line 168) | function hide(id) {
  function getComments (line 181) | function getComments(id) {
  function addComment (line 216) | function addComment(form) {
  function appendComments (line 275) | function appendComments(comments, ul) {
  function insertComment (line 290) | function insertComment(comment) {
  function acceptComment (line 320) | function acceptComment(id) {
  function deleteComment (line 335) | function deleteComment(id) {
  function showProposal (line 369) | function showProposal(id) {
  function hideProposal (line 375) | function hideProposal(id) {
  function showProposeChange (line 381) | function showProposeChange(id) {
  function hideProposeChange (line 390) | function hideProposeChange(id) {
  function toggleCommentMarkupBox (line 398) | function toggleCommentMarkupBox(id) {
  function handleReSort (line 403) | function handleReSort(link) {
  function handleVote (line 426) | function handleVote(link) {
  function openReply (line 488) | function openReply(id) {
  function closeReply (line 516) | function closeReply(id) {
  function sortComments (line 530) | function sortComments(comments) {
  function getChildren (line 542) | function getChildren(ul, recursive) {
  function createCommentDiv (line 555) | function createCommentDiv(comment) {
  function renderTemplate (line 593) | function renderTemplate(template, context) {
  function showError (line 610) | function showError(message) {

FILE: python2/nmb/NetBIOS.py
  class NetBIOS (line 6) | class NetBIOS(NBNS):
    method __init__ (line 10) | def __init__(self, broadcast = True, listen_port = 0):
    method close (line 24) | def close(self):
    method write (line 35) | def write(self, data, ip, port):
    method queryName (line 39) | def queryName(self, name, ip = '', port = 137, timeout = 30):
    method queryIPForName (line 62) | def queryIPForName(self, ip, port = 137, timeout = 30):
    method _pollForNetBIOSPacket (line 89) | def _pollForNetBIOSPacket(self, wait_trn_id, timeout):
    method _pollForQueryPacket (line 119) | def _pollForQueryPacket(self, wait_trn_id, timeout):

FILE: python2/nmb/NetBIOSProtocol.py
  class NetBIOSTimeout (line 10) | class NetBIOSTimeout(Exception):
  class NBNSProtocol (line 14) | class NBNSProtocol(DatagramProtocol, NBNS):
    method __init__ (line 18) | def __init__(self, broadcast = True, listen_port = 0):
    method datagramReceived (line 34) | def datagramReceived(self, data, from_info):
    method write (line 46) | def write(self, data, ip, port):
    method queryName (line 50) | def queryName(self, name, ip = '', port = 137, timeout = 30):
    method queryIPForName (line 80) | def queryIPForName(self, ip, port = 137, timeout = 30):
    method stopProtocol (line 115) | def stopProtocol(self):
    method cleanupPendingTrns (line 118) | def cleanupPendingTrns(self):

FILE: python2/nmb/base.py
  class NMBSession (line 7) | class NMBSession:
    method __init__ (line 11) | def __init__(self, my_name, remote_name, host_type = TYPE_SERVER, is_d...
    method write (line 28) | def write(self, data):
    method onNMBSessionMessage (line 31) | def onNMBSessionMessage(self, flags, data):
    method onNMBSessionOK (line 34) | def onNMBSessionOK(self):
    method onNMBSessionFailed (line 37) | def onNMBSessionFailed(self):
    method feedData (line 44) | def feedData(self, data):
    method sendNMBMessage (line 61) | def sendNMBMessage(self, data):
    method requestNMBSession (line 64) | def requestNMBSession(self):
    method _processNMBSessionPacket (line 73) | def _processNMBSessionPacket(self, packet):
    method _sendNMBPacket_NetBIOS (line 86) | def _sendNMBPacket_NetBIOS(self, packet_type, data):
    method _sendNMBPacket_DirectTCP (line 95) | def _sendNMBPacket_DirectTCP(self, packet_type, data):
  class NBNS (line 101) | class NBNS:
    method write (line 108) | def write(self, data, ip, port):
    method decodePacket (line 111) | def decodePacket(self, data):
    method prepareNameQuery (line 137) | def prepareNameQuery(self, trn_id, name, is_broadcast = True):
    method decodeIPQueryPacket (line 147) | def decodeIPQueryPacket(self, data):
    method prepareNetNameQuery (line 180) | def prepareNetNameQuery(self, trn_id, is_broadcast = True):

FILE: python2/nmb/nmb_structs.py
  class NMBError (line 4) | class NMBError(Exception): pass
  class NotConnectedError (line 7) | class NotConnectedError(NMBError):
  class NMBSessionMessage (line 14) | class NMBSessionMessage:
    method __init__ (line 19) | def __init__(self):
    method reset (line 22) | def reset(self):
    method decode (line 27) | def decode(self, data, offset):
  class DirectTCPSessionMessage (line 47) | class DirectTCPSessionMessage(NMBSessionMessage):
    method decode (line 52) | def decode(self, data, offset):

FILE: python2/nmb/utils.py
  function encode_name (line 5) | def encode_name(name, type, scope = None):
  function decode_name (line 30) | def decode_name(name):

FILE: python2/smb/SMBConnection.py
  class SMBConnection (line 8) | class SMBConnection(SMB):
    method __init__ (line 19) | def __init__(self, username, password, my_name, remote_name, domain = ...
    method onAuthOK (line 59) | def onAuthOK(self):
    method onAuthFailed (line 62) | def onAuthFailed(self):
    method write (line 65) | def write(self, data):
    method __enter__ (line 78) | def __enter__(self):
    method __exit__ (line 81) | def __exit__(self, *args):
    method isUsingSMB2 (line 89) | def isUsingSMB2(self):
    method connect (line 98) | def connect(self, ip, port = 139, sock_family = socket.AF_INET, timeou...
    method close (line 128) | def close(self):
    method listShares (line 136) | def listShares(self, timeout = 30):
    method listPath (line 165) | def listPath(self, service_name, path,
    method listSnapshots (line 209) | def listSnapshots(self, service_name, path, timeout = 30):
    method getAttributes (line 242) | def getAttributes(self, service_name, path, timeout = 30):
    method getSecurity (line 273) | def getSecurity(self, service_name, path, timeout = 30):
    method retrieveFile (line 304) | def retrieveFile(self, service_name, path, file_obj, timeout = 30):
    method retrieveFileFromOffset (line 318) | def retrieveFileFromOffset(self, service_name, path, file_obj, offset ...
    method storeFile (line 354) | def storeFile(self, service_name, path, file_obj, timeout = 30):
    method storeFileFromOffset (line 367) | def storeFileFromOffset(self, service_name, path, file_obj, offset = 0...
    method deleteFiles (line 402) | def deleteFiles(self, service_name, path_file_pattern, delete_matching...
    method resetFileAttributes (line 432) | def resetFileAttributes(self, service_name, path_file_pattern, file_at...
    method createDirectory (line 467) | def createDirectory(self, service_name, path, timeout = 30):
    method deleteDirectory (line 494) | def deleteDirectory(self, service_name, path, timeout = 30):
    method rename (line 521) | def rename(self, service_name, old_path, new_path, timeout = 30):
    method echo (line 549) | def echo(self, data, timeout = 10):
    method _pollForNetBIOSPacket (line 583) | def _pollForNetBIOSPacket(self, timeout):

FILE: python2/smb/SMBHandler.py
  class SMBHandler (line 17) | class SMBHandler(urllib2.BaseHandler):
    method smb_open (line 19) | def smb_open(self, req):
    method createTempFile (line 93) | def createTempFile(self):
    method generateClientMachineName (line 96) | def generateClientMachineName(self):

FILE: python2/smb/SMBProtocol.py
  class SMBProtocol (line 13) | class SMBProtocol(Protocol, SMB):
    method connectionMade (line 21) | def connectionMade(self):
    method connectionLost (line 28) | def connectionLost(self, reason):
    method dataReceived (line 32) | def dataReceived(self, data):
    method write (line 39) | def write(self, data):
    method onAuthOK (line 42) | def onAuthOK(self):
    method onAuthFailed (line 47) | def onAuthFailed(self):
    method onNMBSessionFailed (line 51) | def onNMBSessionFailed(self):
    method _cleanupPendingRequests (line 58) | def _cleanupPendingRequests(self):
  class SMBProtocolFactory (line 75) | class SMBProtocolFactory(ClientFactory):
    method __init__ (line 87) | def __init__(self, username, password, my_name, remote_name, domain = ...
    method isReady (line 128) | def isReady(self):
    method isUsingSMB2 (line 133) | def isUsingSMB2(self):
    method onAuthOK (line 141) | def onAuthOK(self):
    method onAuthFailed (line 149) | def onAuthFailed(self):
    method listShares (line 165) | def listShares(self, timeout = 30):
    method listPath (line 179) | def listPath(self, service_name, path,
    method listSnapshots (line 208) | def listSnapshots(self, service_name, path, timeout = 30):
    method getAttributes (line 226) | def getAttributes(self, service_name, path, timeout = 30):
    method retrieveFile (line 241) | def retrieveFile(self, service_name, path, file_obj, timeout = 30):
    method retrieveFileFromOffset (line 259) | def retrieveFileFromOffset(self, service_name, path, file_obj, offset ...
    method storeFile (line 283) | def storeFile(self, service_name, path, file_obj, timeout = 30):
    method deleteFiles (line 305) | def deleteFiles(self, service_name, path_file_pattern, timeout = 30):
    method createDirectory (line 323) | def createDirectory(self, service_name, path):
    method deleteDirectory (line 340) | def deleteDirectory(self, service_name, path):
    method rename (line 357) | def rename(self, service_name, old_path, new_path):
    method echo (line 375) | def echo(self, data, timeout = 10):
    method closeConnection (line 390) | def closeConnection(self):
    method buildProtocol (line 406) | def buildProtocol(self, addr):

FILE: python2/smb/base.py
  class NotReadyError (line 20) | class NotReadyError(Exception):
  class NotConnectedError (line 24) | class NotConnectedError(Exception):
  class SMBTimeout (line 28) | class SMBTimeout(Exception):
  function _convert_to_unicode (line 33) | def _convert_to_unicode(string):
  class SMB (line 39) | class SMB(NMBSession):
    method __init__ (line 60) | def __init__(self, username, password, my_name, remote_name, domain = ...
    method password (line 110) | def password(self):
    method onNMBSessionOK (line 118) | def onNMBSessionOK(self):
    method onNMBSessionFailed (line 121) | def onNMBSessionFailed(self):
    method onNMBSessionMessage (line 124) | def onNMBSessionMessage(self, flags, data):
    method onAuthOK (line 162) | def onAuthOK(self):
    method onAuthFailed (line 165) | def onAuthFailed(self):
    method _setupSMB1Methods (line 172) | def _setupSMB1Methods(self):
    method _setupSMB2Methods (line 195) | def _setupSMB2Methods(self):
    method _getNextRPCCallID (line 218) | def _getNextRPCCallID(self):
    method _sendSMBMessage_SMB2 (line 226) | def _sendSMBMessage_SMB2(self, smb_message):
    method _getNextMID_SMB2 (line 244) | def _getNextMID_SMB2(self):
    method _updateState_SMB2 (line 248) | def _updateState_SMB2(self, message):
    method _updateServerInfo_SMB2 (line 347) | def _updateServerInfo_SMB2(self, payload):
    method _handleNegotiateResponse_SMB2 (line 356) | def _handleNegotiateResponse_SMB2(self, message):
    method _handleSessionChallenge_SMB2 (line 362) | def _handleSessionChallenge_SMB2(self, message, ntlm_token):
    method _listShares_SMB2 (line 417) | def _listShares_SMB2(self, callback, errback, timeout = 30):
    method _listPath_SMB2 (line 604) | def _listPath_SMB2(self, service_name, path, callback, errback, search...
    method _getAttributes_SMB2 (line 744) | def _getAttributes_SMB2(self, service_name, path, callback, errback, t...
    method _getSecurity_SMB2 (line 820) | def _getSecurity_SMB2(self, service_name, path, callback, errback, tim...
    method _retrieveFile_SMB2 (line 901) | def _retrieveFile_SMB2(self, service_name, path, file_obj, callback, e...
    method _retrieveFileFromOffset_SMB2 (line 904) | def _retrieveFileFromOffset_SMB2(self, service_name, path, file_obj, c...
    method _storeFile_SMB2 (line 1033) | def _storeFile_SMB2(self, service_name, path, file_obj, callback, errb...
    method _storeFileFromOffset_SMB2 (line 1036) | def _storeFileFromOffset_SMB2(self, service_name, path, file_obj, call...
    method _deleteFiles_SMB2 (line 1132) | def _deleteFiles_SMB2(self, service_name, path_file_pattern, delete_ma...
    method _deleteFiles_SMB2__list (line 1195) | def _deleteFiles_SMB2__list(self, service_name, path, pattern, delete_...
    method _deleteFiles_SMB2__del (line 1224) | def _deleteFiles_SMB2__del(self, service_name, tid, path, callback, er...
    method _resetFileAttributes_SMB2 (line 1296) | def _resetFileAttributes_SMB2(self, service_name, path_file_pattern, c...
    method _createDirectory_SMB2 (line 1387) | def _createDirectory_SMB2(self, service_name, path, callback, errback,...
    method _deleteDirectory_SMB2 (line 1455) | def _deleteDirectory_SMB2(self, service_name, path, callback, errback,...
    method _rename_SMB2 (line 1544) | def _rename_SMB2(self, service_name, old_path, new_path, callback, err...
    method _listSnapshots_SMB2 (line 1641) | def _listSnapshots_SMB2(self, service_name, path, callback, errback, t...
    method _echo_SMB2 (line 1732) | def _echo_SMB2(self, data, callback, errback, timeout = 30):
    method _sendSMBMessage_SMB1 (line 1752) | def _sendSMBMessage_SMB1(self, smb_message):
    method _getNextMID_SMB1 (line 1777) | def _getNextMID_SMB1(self):
    method _updateState_SMB1 (line 1785) | def _updateState_SMB1(self, message):
    method _updateServerInfo_SMB1 (line 1880) | def _updateServerInfo_SMB1(self, payload):
    method _handleSessionChallenge_SMB1 (line 1892) | def _handleSessionChallenge_SMB1(self, message, ntlm_token):
    method _handleNegotiateResponse_SMB1 (line 1946) | def _handleNegotiateResponse_SMB1(self, message):
    method _listShares_SMB1 (line 1965) | def _listShares_SMB1(self, callback, errback, timeout = 30):
    method _listPath_SMB1 (line 2140) | def _listPath_SMB1(self, service_name, path, callback, errback, search...
    method _getAttributes_SMB1 (line 2352) | def _getAttributes_SMB1(self, service_name, path, callback, errback, t...
    method _getSecurity_SMB1 (line 2413) | def _getSecurity_SMB1(self, service_name, path_file_pattern, callback,...
    method _retrieveFile_SMB1 (line 2416) | def _retrieveFile_SMB1(self, service_name, path, file_obj, callback, e...
    method _retrieveFileFromOffset_SMB1 (line 2419) | def _retrieveFileFromOffset_SMB1(self, service_name, path, file_obj, c...
    method _storeFile_SMB1 (line 2510) | def _storeFile_SMB1(self, service_name, path, file_obj, callback, errb...
    method _storeFileFromOffset_SMB1 (line 2513) | def _storeFileFromOffset_SMB1(self, service_name, path, file_obj, call...
    method _deleteFiles_SMB1 (line 2583) | def _deleteFiles_SMB1(self, service_name, path_file_pattern, delete_ma...
    method _deleteFiles_SMB1__list (line 2646) | def _deleteFiles_SMB1__list(self, service_name, path, pattern, delete_...
    method _deleteFiles_SMB1__del (line 2676) | def _deleteFiles_SMB1__del(self, service_name, tid, path, callback, er...
    method _resetFileAttributes_SMB1 (line 2703) | def _resetFileAttributes_SMB1(self, service_name, path_file_pattern, c...
    method _createDirectory_SMB1 (line 2706) | def _createDirectory_SMB1(self, service_name, path, callback, errback,...
    method _deleteDirectory_SMB1 (line 2743) | def _deleteDirectory_SMB1(self, service_name, path, callback, errback,...
    method _rename_SMB1 (line 2780) | def _rename_SMB1(self, service_name, old_path, new_path, callback, err...
    method _listSnapshots_SMB1 (line 2820) | def _listSnapshots_SMB1(self, service_name, path, callback, errback, t...
    method _echo_SMB1 (line 2903) | def _echo_SMB1(self, data, callback, errback, timeout = 30):
    method _extractLastPathComponent (line 2921) | def _extractLastPathComponent(self, path):
    method _pushToArray (line 2924) | def _pushToArray(self, messages_history, message):
  class SharedDevice (line 2929) | class SharedDevice:
    method __init__ (line 2946) | def __init__(self, type, name, comments):
    method type (line 2952) | def type(self):
    method isSpecial (line 2963) | def isSpecial(self):
    method isTemporary (line 2972) | def isTemporary(self):
    method __unicode__ (line 2978) | def __unicode__(self):
  class SharedFile (line 2982) | class SharedFile:
    method __init__ (line 3007) | def __init__(self, create_time, last_access_time, last_write_time, las...
    method isDirectory (line 3020) | def isDirectory(self):
    method isReadOnly (line 3025) | def isReadOnly(self):
    method isNormal (line 3030) | def isNormal(self):
    method __unicode__ (line 3039) | def __unicode__(self):
  class _PendingRequest (line 3043) | class _PendingRequest:
    method __init__ (line 3045) | def __init__(self, mid, expiry_time, callback, errback, **kwargs):

FILE: python2/smb/ntlm.py
  function MD4 (line 10) | def MD4(): return hashlib.new('md4')
  function MD5 (line 16) | def MD5(s): return hashlib.md5(s)
  function MD5 (line 19) | def MD5(s): return md5.new(s)
  function generateNegotiateMessage (line 71) | def generateNegotiateMessage():
  function generateAuthenticateMessage (line 85) | def generateAuthenticateMessage(challenge_flags, nt_response, lm_respons...
  function decodeChallengeMessage (line 139) | def decodeChallengeMessage(ntlm_data):
  function generateChallengeResponseV2 (line 161) | def generateChallengeResponseV2(password, user, server_challenge, server...
  function expandDesKey (line 188) | def expandDesKey(key):
  function DESL (line 201) | def DESL(K, D):
  function generateChallengeResponseV1 (line 214) | def generateChallengeResponseV1(password, server_challenge, has_extended...

FILE: python2/smb/security_descriptors.py
  class SID (line 147) | class SID(object):
    method __init__ (line 155) | def __init__(self, revision, identifier_authority, subauthorities):
    method __str__ (line 163) | def __str__(self):
    method __repr__ (line 174) | def __repr__(self):
    method from_bytes (line 178) | def from_bytes(cls, data, return_tail=False):
  class ACE (line 190) | class ACE(object):
    method __init__ (line 198) | def __init__(self, type_, flags, mask, sid, additional_data):
    method __repr__ (line 221) | def __repr__(self):
    method isInheritOnly (line 227) | def isInheritOnly(self):
    method from_bytes (line 233) | def from_bytes(cls, data):
  class ACL (line 281) | class ACL(object):
    method __init__ (line 290) | def __init__(self, revision, aces):
    method __repr__ (line 296) | def __repr__(self):
    method from_bytes (line 300) | def from_bytes(cls, data):
  class SecurityDescriptor (line 318) | class SecurityDescriptor(object):
    method __init__ (line 327) | def __init__(self, flags, owner, group, dacl, sacl):
    method from_bytes (line 343) | def from_bytes(cls, data):

FILE: python2/smb/securityblob.py
  class UnsupportedSecurityProvider (line 8) | class UnsupportedSecurityProvider(Exception): pass
  class BadSecurityBlobError (line 9) | class BadSecurityBlobError(Exception): pass
  function generateNegotiateSecurityBlob (line 12) | def generateNegotiateSecurityBlob(ntlm_data):
  function generateAuthSecurityBlob (line 31) | def generateAuthSecurityBlob(ntlm_data):
  function decodeChallengeSecurityBlob (line 43) | def decodeChallengeSecurityBlob(data):
  function decodeAuthResponseSecurityBlob (line 62) | def decodeAuthResponseSecurityBlob(data):
  class NegResultEnumerated (line 81) | class NegResultEnumerated(univ.Enumerated):
  class MechTypeList (line 90) | class MechTypeList(univ.SequenceOf):
  class ContextFlags (line 94) | class ContextFlags(univ.BitString):
  class NegTokenInit (line 106) | class NegTokenInit(univ.Sequence):
  class NegTokenTarg (line 115) | class NegTokenTarg(univ.Sequence):
  class NegotiationToken (line 124) | class NegotiationToken(univ.Choice):
  class ContextToken (line 131) | class ContextToken(univ.Sequence):

FILE: python2/smb/smb2_structs.py
  class SMB2Message (line 10) | class SMB2Message:
    method __init__ (line 26) | def __init__(self, payload = None):
    method __str__ (line 32) | def __str__(self):
    method reset (line 43) | def reset(self):
    method encode (line 69) | def encode(self):
    method decode (line 86) | def decode(self, buf):
    method _decodeCommand (line 145) | def _decodeCommand(self):
    method isAsync (line 172) | def isAsync(self):
    method isReply (line 176) | def isReply(self):
  class Structure (line 180) | class Structure:
    method initMessage (line 182) | def initMessage(self, message):
    method prepare (line 185) | def prepare(self, message):
    method decode (line 188) | def decode(self, message):
  class SMB2NegotiateResponse (line 192) | class SMB2NegotiateResponse(Structure):
    method decode (line 215) | def decode(self, message):
  class SMB2SessionSetupRequest (line 228) | class SMB2SessionSetupRequest(Structure):
    method __init__ (line 238) | def __init__(self, security_blob):
    method initMessage (line 241) | def initMessage(self, message):
    method prepare (line 245) | def prepare(self, message):
  class SMB2SessionSetupResponse (line 257) | class SMB2SessionSetupResponse(Structure):
    method isGuestSession (line 274) | def isGuestSession(self):
    method isAnonymousSession (line 278) | def isAnonymousSession(self):
    method decode (line 281) | def decode(self, message):
  class SMB2TreeConnectRequest (line 290) | class SMB2TreeConnectRequest(Structure):
    method __init__ (line 300) | def __init__(self, path):
    method initMessage (line 303) | def initMessage(self, message):
    method prepare (line 307) | def prepare(self, message):
  class SMB2TreeConnectResponse (line 315) | class SMB2TreeConnectResponse(Structure):
    method decode (line 333) | def decode(self, message):
  class SMB2CreateRequest (line 342) | class SMB2CreateRequest(Structure):
    method __init__ (line 352) | def __init__(self, filename, file_attributes = 0,
    method initMessage (line 367) | def initMessage(self, message):
    method prepare (line 371) | def prepare(self, message):
  class SMB2CreateResponse (line 406) | class SMB2CreateResponse(Structure):
    method decode (line 427) | def decode(self, message):
  class SMB2WriteRequest (line 442) | class SMB2WriteRequest(Structure):
    method __init__ (line 452) | def __init__(self, fid, data, offset, remaining_len = 0, flags = 0):
    method initMessage (line 460) | def initMessage(self, message):
    method prepare (line 464) | def prepare(self, message):
  class SMB2WriteResponse (line 478) | class SMB2WriteResponse(Structure):
    method decode (line 493) | def decode(self, message):
  class SMB2ReadRequest (line 500) | class SMB2ReadRequest(Structure):
    method __init__ (line 510) | def __init__(self, fid, read_offset, read_len, min_read_len = 0):
    method initMessage (line 516) | def initMessage(self, message):
    method prepare (line 520) | def prepare(self, message):
  class SMB2ReadResponse (line 536) | class SMB2ReadResponse(Structure):
    method decode (line 546) | def decode(self, message):
  class SMB2IoctlRequest (line 554) | class SMB2IoctlRequest(Structure):
    method __init__ (line 564) | def __init__(self, fid, ctlcode, flags, in_data, max_out_size = 65536):
    method initMessage (line 571) | def initMessage(self, message):
    method prepare (line 575) | def prepare(self, message):
  class SMB2IoctlResponse (line 592) | class SMB2IoctlResponse(Structure):
    method decode (line 611) | def decode(self, message):
  class SMB2CloseRequest (line 630) | class SMB2CloseRequest(Structure):
    method __init__ (line 640) | def __init__(self, fid, flags = 0):
    method initMessage (line 644) | def initMessage(self, message):
    method prepare (line 648) | def prepare(self, message):
  class SMB2CloseResponse (line 656) | class SMB2CloseResponse(Structure):
    method decode (line 663) | def decode(self, message):
  class SMB2QueryDirectoryRequest (line 667) | class SMB2QueryDirectoryRequest(Structure):
    method __init__ (line 677) | def __init__(self, fid, filename, info_class, flags, output_buf_len):
    method initMessage (line 684) | def initMessage(self, message):
    method prepare (line 688) | def prepare(self, message):
  class SMB2QueryDirectoryResponse (line 700) | class SMB2QueryDirectoryResponse(Structure):
    method decode (line 716) | def decode(self, message):
  class SMB2QueryInfoRequest (line 724) | class SMB2QueryInfoRequest(Structure):
    method __init__ (line 734) | def __init__(self, fid, flags, additional_info, info_type, file_info_c...
    method initMessage (line 743) | def initMessage(self, message):
    method prepare (line 747) | def prepare(self, message):
  class SMB2QueryInfoResponse (line 762) | class SMB2QueryInfoResponse(Structure):
    method decode (line 778) | def decode(self, message):
  class SMB2SetInfoRequest (line 786) | class SMB2SetInfoRequest(Structure):
    method __init__ (line 796) | def __init__(self, fid, additional_info, info_type, file_info_class, d...
    method initMessage (line 803) | def initMessage(self, message):
    method prepare (line 807) | def prepare(self, message):
  class SMB2SetInfoResponse (line 819) | class SMB2SetInfoResponse(Structure):
    method decode (line 826) | def decode(self, message):
  class SMB2EchoRequest (line 830) | class SMB2EchoRequest(Structure):
    method initMessage (line 840) | def initMessage(self, message):
    method prepare (line 844) | def prepare(self, message):
  class SMB2EchoResponse (line 849) | class SMB2EchoResponse(Structure):
    method decode (line 856) | def decode(self, message):

FILE: python2/smb/smb_structs.py
  class UnsupportedFeature (line 25) | class UnsupportedFeature(Exception):
  class ProtocolError (line 33) | class ProtocolError(Exception):
    method __init__ (line 35) | def __init__(self, message, data_buf = None, smb_message = None):
    method __str__ (line 40) | def __str__(self):
  class SMB2ProtocolHeaderError (line 54) | class SMB2ProtocolHeaderError(ProtocolError):
    method __init__ (line 56) | def __init__(self):
  class OperationFailure (line 59) | class OperationFailure(Exception):
    method __init__ (line 61) | def __init__(self, message, smb_messages):
    method __str__ (line 66) | def __str__(self):
  class SMBError (line 83) | class SMBError:
    method __init__ (line 85) | def __init__(self):
    method reset (line 88) | def reset(self):
    method __str__ (line 92) | def __str__(self):
    method hasError (line 99) | def hasError(self):
  class SMBMessage (line 103) | class SMBMessage:
    method __init__ (line 111) | def __init__(self, payload = None):
    method __str__ (line 117) | def __str__(self):
    method reset (line 132) | def reset(self):
    method isReply (line 148) | def isReply(self):
    method hasExtendedSecurity (line 152) | def hasExtendedSecurity(self):
    method encode (line 155) | def encode(self):
    method decode (line 176) | def decode(self, buf):
    method _decodePayload (line 229) | def _decodePayload(self):
  class Payload (line 255) | class Payload:
    method initMessage (line 260) | def initMessage(self, message):
    method prepare (line 271) | def prepare(self, message):
    method decode (line 274) | def decode(self, message):
  class ComNegotiateRequest (line 278) | class ComNegotiateRequest(Payload):
    method initMessage (line 286) | def initMessage(self, message):
    method prepare (line 290) | def prepare(self, message):
  class ComNegotiateResponse (line 299) | class ComNegotiateResponse(Payload):
    method decode (line 334) | def decode(self, message):
    method supportsExtendedSecurity (line 390) | def supportsExtendedSecurity(self):
  class ComSessionSetupAndxRequest__WithSecurityExtension (line 394) | class ComSessionSetupAndxRequest__WithSecurityExtension(Payload):
    method __init__ (line 403) | def __init__(self, session_key, security_blob):
    method initMessage (line 407) | def initMessage(self, message):
    method prepare (line 411) | def prepare(self, message):
  class ComSessionSetupAndxRequest__NoSecurityExtension (line 429) | class ComSessionSetupAndxRequest__NoSecurityExtension(Payload):
    method __init__ (line 438) | def __init__(self, session_key, username, password, is_unicode, domain):
    method initMessage (line 445) | def initMessage(self, message):
    method prepare (line 449) | def prepare(self, message):
  class ComSessionSetupAndxResponse (line 485) | class ComSessionSetupAndxResponse(Payload):
    method decode (line 514) | def decode(self, message):
  class ComTreeConnectAndxRequest (line 534) | class ComTreeConnectAndxRequest(Payload):
    method __init__ (line 545) | def __init__(self, path, service, password = ''):
    method initMessage (line 550) | def initMessage(self, message):
    method prepare (line 554) | def prepare(self, message):
  class ComTreeConnectAndxResponse (line 572) | class ComTreeConnectAndxResponse(Payload):
    method decode (line 587) | def decode(self, message):
  class ComNTCreateAndxRequest (line 597) | class ComNTCreateAndxRequest(Payload):
    method __init__ (line 608) | def __init__(self, filename, flags = 0, root_fid = 0, access_mask = 0,...
    method initMessage (line 622) | def initMessage(self, message):
    method prepare (line 626) | def prepare(self, message):
  class ComNTCreateAndxResponse (line 652) | class ComNTCreateAndxResponse(Payload):
    method decode (line 667) | def decode(self, message):
  class ComTransactionRequest (line 677) | class ComTransactionRequest(Payload):
    method __init__ (line 687) | def __init__(self, max_params_count, max_data_count, max_setup_count,
    method initMessage (line 703) | def initMessage(self, message):
    method prepare (line 707) | def prepare(self, message):
  class ComTransactionResponse (line 763) | class ComTransactionResponse(Payload):
    method decode (line 782) | def decode(self, message):
  class ComTransaction2Request (line 817) | class ComTransaction2Request(Payload):
    method __init__ (line 827) | def __init__(self, max_params_count, max_data_count, max_setup_count,
    method initMessage (line 842) | def initMessage(self, message):
    method prepare (line 846) | def prepare(self, message):
  class ComTransaction2Response (line 899) | class ComTransaction2Response(Payload):
    method decode (line 918) | def decode(self, message):
  class ComCloseRequest (line 953) | class ComCloseRequest(Payload):
    method __init__ (line 963) | def __init__(self, fid, last_modified_time = 0xFFFFFFFF):
    method initMessage (line 967) | def initMessage(self, message):
    method prepare (line 971) | def prepare(self, message):
  class ComOpenAndxRequest (line 976) | class ComOpenAndxRequest(Payload):
    method __init__ (line 986) | def __init__(self, filename, access_mode, open_mode, flags = 0x0000, s...
    method initMessage (line 1002) | def initMessage(self, message):
    method prepare (line 1006) | def prepare(self, message):
  class ComOpenAndxResponse (line 1023) | class ComOpenAndxResponse(Payload):
    method decode (line 1044) | def decode(self, message):
  class ComWriteAndxRequest (line 1056) | class ComWriteAndxRequest(Payload):
    method __init__ (line 1067) | def __init__(self, fid, data_bytes, offset, write_mode = 0, timeout = 0):
    method initMessage (line 1078) | def initMessage(self, message):
    method prepare (line 1082) | def prepare(self, message):
  class ComWriteAndxResponse (line 1104) | class ComWriteAndxResponse(Payload):
    method decode (line 1115) | def decode(self, message):
  class ComReadAndxRequest (line 1126) | class ComReadAndxRequest(Payload):
    method __init__ (line 1137) | def __init__(self, fid, offset, max_return_bytes_count, min_return_byt...
    method initMessage (line 1149) | def initMessage(self, message):
    method prepare (line 1153) | def prepare(self, message):
  class ComReadAndxResponse (line 1168) | class ComReadAndxResponse(Payload):
    method decode (line 1179) | def decode(self, message):
  class ComDeleteRequest (line 1194) | class ComDeleteRequest(Payload):
    method __init__ (line 1201) | def __init__(self, filename_pattern, search_attributes = 0):
    method initMessage (line 1205) | def initMessage(self, message):
    method prepare (line 1209) | def prepare(self, message):
  class ComCreateDirectoryRequest (line 1214) | class ComCreateDirectoryRequest(Payload):
    method __init__ (line 1224) | def __init__(self, path):
    method initMessage (line 1227) | def initMessage(self, message):
    method prepare (line 1231) | def prepare(self, message):
  class ComDeleteDirectoryRequest (line 1236) | class ComDeleteDirectoryRequest(Payload):
    method __init__ (line 1243) | def __init__(self, path):
    method initMessage (line 1246) | def initMessage(self, message):
    method prepare (line 1250) | def prepare(self, message):
  class ComRenameRequest (line 1255) | class ComRenameRequest(Payload):
    method __init__ (line 1262) | def __init__(self, old_path, new_path, search_attributes = 0):
    method initMessage (line 1267) | def initMessage(self, message):
    method prepare (line 1271) | def prepare(self, message):
  class ComEchoRequest (line 1276) | class ComEchoRequest(Payload):
    method __init__ (line 1283) | def __init__(self, echo_data = b'', echo_count = 1):
    method initMessage (line 1287) | def initMessage(self, message):
    method prepare (line 1292) | def prepare(self, message):
  class ComEchoResponse (line 1297) | class ComEchoResponse(Payload):
    method decode (line 1304) | def decode(self, message):
  class ComNTTransactRequest (line 1309) | class ComNTTransactRequest(Payload):
    method __init__ (line 1318) | def __init__(self, function, max_params_count, max_data_count, max_set...
    method initMessage (line 1331) | def initMessage(self, message):
    method prepare (line 1335) | def prepare(self, message):
  class ComNTTransactResponse (line 1381) | class ComNTTransactResponse(Payload):
    method decode (line 1399) | def decode(self, message):

FILE: python2/smb/utils/U32.py
  function norm (line 26) | def norm(n):
  class U32 (line 30) | class U32:
    method __init__ (line 34) | def __init__(self, value = 0):
    method set (line 38) | def set(self, value = 0):
    method __repr__ (line 42) | def __repr__(self):
    method __long__ (line 46) | def __long__(self): return long(norm(self.v))
    method __int__ (line 49) | def __int__(self): return int(norm(self.v))
    method __chr__ (line 52) | def __chr__(self): return chr(norm(self.v))
    method __add__ (line 55) | def __add__(self, b):
    method __sub__ (line 61) | def __sub__(self, b):
    method __mul__ (line 69) | def __mul__(self, b):
    method __div__ (line 75) | def __div__(self, b):
    method __mod__ (line 81) | def __mod__(self, b):
    method __neg__ (line 87) | def __neg__(self): return U32(self.v)
    method __pos__ (line 90) | def __pos__(self): return U32(self.v)
    method __abs__ (line 93) | def __abs__(self): return U32(self.v)
    method __invert__ (line 96) | def __invert__(self):
    method __lshift__ (line 102) | def __lshift__(self, b):
    method __rshift__ (line 108) | def __rshift__(self, b):
    method __and__ (line 114) | def __and__(self, b):
    method __or__ (line 120) | def __or__(self, b):
    method __xor__ (line 126) | def __xor__(self, b):
    method __not__ (line 132) | def __not__(self):
    method truth (line 136) | def truth(self):
    method __cmp__ (line 140) | def __cmp__(self, b):
    method __nonzero__ (line 146) | def __nonzero__(self):

FILE: python2/smb/utils/__init__.py
  function convertFILETIMEtoEpoch (line 2) | def convertFILETIMEtoEpoch(t):

FILE: python2/smb/utils/md4.py
  class MD4 (line 44) | class MD4:
    method __init__ (line 53) | def __init__(self):
    method __repr__ (line 64) | def __repr__(self):
    method make_copy (line 74) | def make_copy(self):
    method update (line 91) | def update(self, str):
    method digest (line 186) | def digest(self):
  function F (line 234) | def F(x, y, z): return (((x) & (y)) | ((~x) & (z)))
  function G (line 235) | def G(x, y, z): return (((x) & (y)) | ((x) & (z)) | ((y) & (z)))
  function H (line 236) | def H(x, y, z): return ((x) ^ (y) ^ (z))
  function ROL (line 238) | def ROL(x, n): return (((x) << n) | ((x) >> (32-n)))
  function f1 (line 240) | def f1(a, b, c, d, k, s, X): return ROL(a + F(b, c, d) + X[k], s)
  function f2 (line 241) | def f2(a, b, c, d, k, s, X): return ROL(a + G(b, c, d) + X[k] + U32(0x5a...
  function f3 (line 242) | def f3(a, b, c, d, k, s, X): return ROL(a + H(b, c, d) + X[k] + U32(0x6e...
  function int_array2str (line 246) | def int_array2str(array):

FILE: python2/smb/utils/pyDes.py
  class _baseDes (line 107) | class _baseDes(object):
    method __init__ (line 108) | def __init__(self, mode=ECB, IV=None, pad=None, padmode=PAD_NORMAL):
    method getKey (line 126) | def getKey(self):
    method setKey (line 130) | def setKey(self, key):
    method getMode (line 135) | def getMode(self):
    method setMode (line 139) | def setMode(self, mode):
    method getPadding (line 143) | def getPadding(self):
    method setPadding (line 147) | def setPadding(self, pad):
    method getPadMode (line 153) | def getPadMode(self):
    method setPadMode (line 157) | def setPadMode(self, mode):
    method getIV (line 161) | def getIV(self):
    method setIV (line 165) | def setIV(self, IV):
    method _padData (line 172) | def _padData(self, data, pad, padmode):
    method _unpadData (line 201) | def _unpadData(self, data, pad, padmode):
    method _guardAgainstUnicode (line 228) | def _guardAgainstUnicode(self, data):
  class des (line 247) | class des(_baseDes):
    method __init__ (line 397) | def __init__(self, key, mode=ECB, IV=None, pad=None, padmode=PAD_NORMAL):
    method setKey (line 411) | def setKey(self, key):
    method __String_to_BitList (line 416) | def __String_to_BitList(self, data):
    method __BitList_to_String (line 437) | def __BitList_to_String(self, data):
    method __permutate (line 454) | def __permutate(self, table, block):
    method __create_sub_keys (line 460) | def __create_sub_keys(self):
    method __des_crypt (line 485) | def __des_crypt(self, block, crypt_type):
    method crypt (line 564) | def crypt(self, data, crypt_type):
    method encrypt (line 642) | def encrypt(self, data, pad=None, padmode=None):
    method decrypt (line 661) | def decrypt(self, data, pad=None, padmode=None):
  class triple_des (line 687) | class triple_des(_baseDes):
    method __init__ (line 708) | def __init__(self, key, mode=ECB, IV=None, pad=None, padmode=PAD_NORMAL):
    method setKey (line 712) | def setKey(self, key):
    method setMode (line 739) | def setMode(self, mode):
    method setPadding (line 745) | def setPadding(self, pad):
    method setPadMode (line 751) | def setPadMode(self, mode):
    method setIV (line 757) | def setIV(self, IV):
    method encrypt (line 763) | def encrypt(self, data, pad=None, padmode=None):
    method decrypt (line 807) | def decrypt(self, data, pad=None, padmode=None):

FILE: python2/smb/utils/rc4.py
  function RC4_encrypt (line 2) | def RC4_encrypt(key, data):

FILE: python2/smb/utils/sha256.py
  function new (line 9) | def new(m=None):
  class sha256 (line 12) | class sha256(object):
    method __init__ (line 37) | def __init__(self, m=None):
    method _rotr (line 46) | def _rotr(self, x, y):
    method _sha256_process (line 49) | def _sha256_process(self, c):
    method update (line 79) | def update(self, m):
    method digest (line 92) | def digest(self):
    method hexdigest (line 105) | def hexdigest(self):
    method copy (line 108) | def copy(self):

FILE: python2/tests/DirectSMBConnectionTests/test_SMBHandler.py
  function MD5 (line 11) | def MD5(): return hashlib.md5()
  function MD5 (line 14) | def MD5(): return md5.new()
  function test_basic (line 18) | def test_basic():
  function test_unicode (line 32) | def test_unicode():
  function test_upload (line 51) | def test_upload():
  function test_overwrite (line 68) | def test_overwrite():

FILE: python2/tests/DirectSMBConnectionTests/test_auth.py
  function teardown_func (line 9) | def teardown_func():
  function test_NTLMv1_auth_SMB1 (line 19) | def test_NTLMv1_auth_SMB1():
  function test_NTLMv1_auth_SMB1_callable_password (line 33) | def test_NTLMv1_auth_SMB1_callable_password():
  function test_NTLMv2_auth_SMB1 (line 47) | def test_NTLMv2_auth_SMB1():
  function test_NTLMv1_auth_SMB2 (line 61) | def test_NTLMv1_auth_SMB2():
  function test_NTLMv2_auth_SMB2 (line 75) | def test_NTLMv2_auth_SMB2():

FILE: python2/tests/DirectSMBConnectionTests/test_createdeletedirectory.py
  function setup_func_SMB1 (line 11) | def setup_func_SMB1():
  function setup_func_SMB2 (line 19) | def setup_func_SMB2():
  function teardown_func (line 27) | def teardown_func():
  function test_english_directory_SMB1 (line 32) | def test_english_directory_SMB1():
  function test_english_directory_SMB2 (line 49) | def test_english_directory_SMB2():
  function test_unicode_directory_SMB1 (line 66) | def test_unicode_directory_SMB1():
  function test_unicode_directory_SMB2 (line 83) | def test_unicode_directory_SMB2():

FILE: python2/tests/DirectSMBConnectionTests/test_echo.py
  function setup_func (line 9) | def setup_func():
  function teardown_func (line 15) | def teardown_func():
  function test_echo (line 20) | def test_echo():

FILE: python2/tests/DirectSMBConnectionTests/test_listpath.py
  function setup_func_SMB1 (line 11) | def setup_func_SMB1():
  function setup_func_SMB2 (line 18) | def setup_func_SMB2():
  function teardown_func (line 25) | def teardown_func():
  function test_listPath_SMB1 (line 30) | def test_listPath_SMB1():
  function test_listSubPath_SMB1 (line 41) | def test_listSubPath_SMB1():
  function test_listPathWithManyFiles_SMB1 (line 50) | def test_listPathWithManyFiles_SMB1():
  function test_listPath_SMB2 (line 57) | def test_listPath_SMB2():
  function test_listSubPath_SMB2 (line 68) | def test_listSubPath_SMB2():
  function test_listPathWithManyFiles_SMB2 (line 77) | def test_listPathWithManyFiles_SMB2():
  function test_listPathFilterForDirectory_SMB1 (line 84) | def test_listPathFilterForDirectory_SMB1():
  function test_listPathFilterForDirectory_SMB2 (line 93) | def test_listPathFilterForDirectory_SMB2():
  function test_listPathFilterForFiles_SMB1 (line 102) | def test_listPathFilterForFiles_SMB1():
  function test_listPathFilterForFiles_SMB2 (line 111) | def test_listPathFilterForFiles_SMB2():
  function test_listPathFilterPattern_SMB1 (line 120) | def test_listPathFilterPattern_SMB1():
  function test_listPathFilterPattern_SMB2 (line 130) | def test_listPathFilterPattern_SMB2():
  function test_listPathFilterUnicodePattern_SMB1 (line 140) | def test_listPathFilterUnicodePattern_SMB1():
  function test_listPathFilterUnicodePattern_SMB2 (line 150) | def test_listPathFilterUnicodePattern_SMB2():

FILE: python2/tests/DirectSMBConnectionTests/test_listshares.py
  function setup_func_SMB1 (line 9) | def setup_func_SMB1():
  function setup_func_SMB2 (line 16) | def setup_func_SMB2():
  function teardown_func (line 23) | def teardown_func():
  function test_listshares_SMB1 (line 28) | def test_listshares_SMB1():
  function test_listshares_SMB2 (line 34) | def test_listshares_SMB2():

FILE: python2/tests/DirectSMBConnectionTests/test_listsnapshots.py
  function setup_func_SMB1 (line 9) | def setup_func_SMB1():
  function setup_func_SMB2 (line 16) | def setup_func_SMB2():
  function teardown_func (line 23) | def teardown_func():
  function test_listsnapshots_SMB1 (line 28) | def test_listsnapshots_SMB1():
  function test_listsnapshots_SMB2 (line 34) | def test_listsnapshots_SMB2():

FILE: python2/tests/DirectSMBConnectionTests/test_rename.py
  function setup_func_SMB1 (line 12) | def setup_func_SMB1():
  function setup_func_SMB2 (line 19) | def setup_func_SMB2():
  function teardown_func (line 26) | def teardown_func():
  function test_rename_english_file_SMB1 (line 31) | def test_rename_english_file_SMB1():
  function test_rename_english_file_SMB2 (line 54) | def test_rename_english_file_SMB2():
  function test_rename_unicode_file_SMB1 (line 77) | def test_rename_unicode_file_SMB1():
  function test_rename_unicode_file_SMB2 (line 100) | def test_rename_unicode_file_SMB2():
  function test_rename_english_directory_SMB1 (line 123) | def test_rename_english_directory_SMB1():
  function test_rename_english_directory_SMB2 (line 146) | def test_rename_english_directory_SMB2():
  function test_rename_unicode_directory_SMB1 (line 169) | def test_rename_unicode_directory_SMB1():
  function test_rename_unicode_directory_SMB2 (line 192) | def test_rename_unicode_directory_SMB2():

FILE: python2/tests/DirectSMBConnectionTests/test_retrievefile.py
  function MD5 (line 12) | def MD5(): return hashlib.md5()
  function MD5 (line 15) | def MD5(): return md5.new()
  function setup_func_SMB1 (line 19) | def setup_func_SMB1():
  function setup_func_SMB2 (line 26) | def setup_func_SMB2():
  function teardown_func (line 33) | def teardown_func():
  function test_retr_multiplereads_SMB1 (line 38) | def test_retr_multiplereads_SMB1():
  function test_retr_multiplereads_SMB2 (line 52) | def test_retr_multiplereads_SMB2():
  function test_retr_longfilename_SMB1 (line 66) | def test_retr_longfilename_SMB1():
  function test_retr_longfilename_SMB2 (line 80) | def test_retr_longfilename_SMB2():
  function test_retr_unicodefilename_SMB1 (line 94) | def test_retr_unicodefilename_SMB1():
  function test_retr_unicodefilename_SMB2 (line 108) | def test_retr_unicodefilename_SMB2():
  function test_retr_offset_SMB1 (line 122) | def test_retr_offset_SMB1():
  function test_retr_offset_SMB2 (line 136) | def test_retr_offset_SMB2():
  function test_retr_offset_and_biglimit_SMB1 (line 150) | def test_retr_offset_and_biglimit_SMB1():
  function test_retr_offset_and_biglimit_SMB2 (line 164) | def test_retr_offset_and_biglimit_SMB2():
  function test_retr_offset_and_smalllimit_SMB1 (line 178) | def test_retr_offset_and_smalllimit_SMB1():
  function test_retr_offset_and_smalllimit_SMB2 (line 192) | def test_retr_offset_and_smalllimit_SMB2():
  function test_retr_offset_and_zerolimit_SMB1 (line 206) | def test_retr_offset_and_zerolimit_SMB1():
  function test_retr_offset_and_zerolimit_SMB2 (line 220) | def test_retr_offset_and_zerolimit_SMB2():

FILE: python2/tests/DirectSMBConnectionTests/test_storefile.py
  function MD5 (line 12) | def MD5(): return hashlib.md5()
  function MD5 (line 15) | def MD5(): return md5.new()
  function setup_func_SMB1 (line 23) | def setup_func_SMB1():
  function setup_func_SMB2 (line 31) | def setup_func_SMB2():
  function teardown_func (line 39) | def teardown_func():
  function test_store_long_filename_SMB1 (line 45) | def test_store_long_filename_SMB1():
  function test_store_long_filename_SMB2 (line 68) | def test_store_long_filename_SMB2():
  function test_store_unicode_filename_SMB1 (line 91) | def test_store_unicode_filename_SMB1():
  function test_store_unicode_filename_SMB2 (line 114) | def test_store_unicode_filename_SMB2():

FILE: python2/tests/DirectSMBConnectionTests/util.py
  function getConnectionInfo (line 5) | def getConnectionInfo():

FILE: python2/tests/DirectSMBTwistedTests/test_auth.py
  class AuthFactory (line 9) | class AuthFactory(SMBProtocolFactory):
    method __init__ (line 11) | def __init__(self, *args, **kwargs):
    method testDone (line 16) | def testDone(self, r):
    method onAuthOK (line 21) | def onAuthOK(self):
    method onAuthFailed (line 24) | def onAuthFailed(self):
  function test_NTLMv1_auth_SMB1 (line 29) | def test_NTLMv1_auth_SMB1():
  function test_NTLMv2_auth_SMB1 (line 42) | def test_NTLMv2_auth_SMB1():
  function test_NTLMv1_auth_SMB2 (line 55) | def test_NTLMv1_auth_SMB2():
  function test_NTLMv2_auth_SMB2 (line 68) | def test_NTLMv2_auth_SMB2():

FILE: python2/tests/DirectSMBTwistedTests/test_createdeletedirectory.py
  class DirectoryFactory (line 11) | class DirectoryFactory(SMBProtocolFactory):
    method __init__ (line 13) | def __init__(self, *args, **kwargs):
    method testDone (line 20) | def testDone(self, r):
    method createDone (line 25) | def createDone(self, result):
    method listComplete (line 30) | def listComplete(self, entries):
    method deleteDone (line 38) | def deleteDone(self, result):
    method list2Complete (line 43) | def list2Complete(self, entries):
    method onAuthOK (line 48) | def onAuthOK(self):
    method onAuthFailed (line 53) | def onAuthFailed(self):
  function test_english_directory_SMB1 (line 58) | def test_english_directory_SMB1():
  function test_english_directory_SMB2 (line 69) | def test_english_directory_SMB2():
  function test_unicode_directory_SMB1 (line 80) | def test_unicode_directory_SMB1():
  function test_unicode_directory_SMB2 (line 91) | def test_unicode_directory_SMB2():

FILE: python2/tests/DirectSMBTwistedTests/test_echo.py
  class EchoFactory (line 8) | class EchoFactory(SMBProtocolFactory):
    method __init__ (line 10) | def __init__(self, *args, **kwargs):
    method testDone (line 16) | def testDone(self, r):
    method onAuthOK (line 21) | def onAuthOK(self):
    method onAuthFailed (line 30) | def onAuthFailed(self):
  function test_echo (line 35) | def test_echo():

FILE: python2/tests/DirectSMBTwistedTests/test_listpath.py
  class ListPathFactory (line 9) | class ListPathFactory(SMBProtocolFactory):
    method __init__ (line 11) | def __init__(self, *args, **kwargs):
    method testDone (line 16) | def testDone(self, r):
    method onAuthOK (line 21) | def onAuthOK(self):
    method onAuthFailed (line 36) | def onAuthFailed(self):
  function test_listPath_SMB1 (line 41) | def test_listPath_SMB1():
  function test_listPath_SMB2 (line 50) | def test_listPath_SMB2():

FILE: python2/tests/DirectSMBTwistedTests/test_listshares.py
  class ListSharesFactory (line 9) | class ListSharesFactory(SMBProtocolFactory):
    method __init__ (line 11) | def __init__(self, *args, **kwargs):
    method testDone (line 16) | def testDone(self, r):
    method onAuthOK (line 21) | def onAuthOK(self):
    method onAuthFailed (line 31) | def onAuthFailed(self):
  function test_listshares_SMB1 (line 36) | def test_listshares_SMB1():
  function test_listshares_SMB2 (line 45) | def test_listshares_SMB2():

FILE: python2/tests/DirectSMBTwistedTests/test_listsnapshots.py
  class ListSnapshotsFactory (line 9) | class ListSnapshotsFactory(SMBProtocolFactory):
    method __init__ (line 11) | def __init__(self, *args, **kwargs):
    method testDone (line 18) | def testDone(self, r):
    method onAuthOK (line 23) | def onAuthOK(self):
    method onAuthFailed (line 33) | def onAuthFailed(self):
  function test_listshares_SMB1 (line 38) | def test_listshares_SMB1():
  function test_listshares_SMB2 (line 49) | def test_listshares_SMB2():

FILE: python2/tests/DirectSMBTwistedTests/test_rename.py
  class RenameFactory (line 12) | class RenameFactory(SMBProtocolFactory):
    method __init__ (line 14) | def __init__(self, *args, **kwargs):
    method testDone (line 22) | def testDone(self, r):
    method pathCreated (line 27) | def pathCreated(self, result):
    method listComplete (line 32) | def listComplete(self, entries):
    method renameComplete (line 41) | def renameComplete(self, result):
    method list2Complete (line 46) | def list2Complete(self, entries):
    method onAuthFailed (line 52) | def onAuthFailed(self):
  class RenameFileFactory (line 56) | class RenameFileFactory(RenameFactory):
    method onAuthOK (line 58) | def onAuthOK(self):
    method cleanup (line 63) | def cleanup(self):
  class RenameDirectoryFactory (line 68) | class RenameDirectoryFactory(RenameFactory):
    method onAuthOK (line 70) | def onAuthOK(self):
    method cleanup (line 75) | def cleanup(self):
  function test_rename_english_file_SMB1 (line 81) | def test_rename_english_file_SMB1():
  function test_rename_english_file_SMB2 (line 93) | def test_rename_english_file_SMB2():
  function test_rename_unicode_file_SMB1 (line 105) | def test_rename_unicode_file_SMB1():
  function test_rename_unicode_file_SMB2 (line 117) | def test_rename_unicode_file_SMB2():
  function test_rename_english_directory_SMB1 (line 129) | def test_rename_english_directory_SMB1():
  function test_rename_english_directory_SMB2 (line 141) | def test_rename_english_directory_SMB2():
  function test_rename_unicode_directory_SMB1 (line 153) | def test_rename_unicode_directory_SMB1():
  function test_rename_unicode_directory_SMB2 (line 165) | def test_rename_unicode_directory_SMB2():

FILE: python2/tests/DirectSMBTwistedTests/test_retrievefile.py
  function MD5 (line 12) | def MD5(): return hashlib.md5()
  function MD5 (line 15) | def MD5(): return md5.new()
  class RetrieveFileFactory (line 18) | class RetrieveFileFactory(SMBProtocolFactory):
    method __init__ (line 20) | def __init__(self, *args, **kwargs):
    method testDone (line 32) | def testDone(self, r):
    method fileRetrieved (line 37) | def fileRetrieved(self, write_result):
    method onAuthOK (line 58) | def onAuthOK(self):
    method onAuthFailed (line 66) | def onAuthFailed(self):
  function test_retr_multiplereads_SMB1 (line 71) | def test_retr_multiplereads_SMB1():
  function test_retr_multiplereads_SMB2 (line 85) | def test_retr_multiplereads_SMB2():
  function test_retr_longfilename_SMB1 (line 99) | def test_retr_longfilename_SMB1():
  function test_retr_longfilename_SMB2 (line 113) | def test_retr_longfilename_SMB2():
  function test_retr_unicodefilename_SMB1 (line 127) | def test_retr_unicodefilename_SMB1():
  function test_retr_unicodefilename_SMB2 (line 141) | def test_retr_unicodefilename_SMB2():
  function test_retr_offset_SMB1 (line 155) | def test_retr_offset_SMB1():
  function test_retr_offset_SMB2 (line 170) | def test_retr_offset_SMB2():
  function test_retr_offset_and_biglimit_SMB1 (line 185) | def test_retr_offset_and_biglimit_SMB1():
  function test_retr_offset_and_biglimit_SMB2 (line 201) | def test_retr_offset_and_biglimit_SMB2():
  function test_retr_offset_and_smalllimit_SMB1 (line 217) | def test_retr_offset_and_smalllimit_SMB1():
  function test_retr_offset_and_smalllimit_SMB2 (line 233) | def test_retr_offset_and_smalllimit_SMB2():
  function test_retr_offset_and_zerolimit_SMB1 (line 249) | def test_retr_offset_and_zerolimit_SMB1():
  function test_retr_offset_and_zerolimit_SMB2 (line 265) | def test_retr_offset_and_zerolimit_SMB2():

FILE: python2/tests/DirectSMBTwistedTests/test_storefile.py
  function MD5 (line 13) | def MD5(): return hashlib.md5()
  function MD5 (line 16) | def MD5(): return md5.new()
  class StoreFilesFactory (line 18) | class StoreFilesFactory(SMBProtocolFactory):
    method __init__ (line 27) | def __init__(self, *args, **kwargs):
    method testDone (line 34) | def testDone(self, r):
    method storeComplete (line 39) | def storeComplete(self, result):
    method listComplete (line 48) | def listComplete(self, entries):
    method retrieveComplete (line 65) | def retrieveComplete(self, result):
    method deleteComplete (line 79) | def deleteComplete(self, result):
    method list2Complete (line 84) | def list2Complete(self, entries):
    method onAuthOK (line 90) | def onAuthOK(self):
    method onAuthFailed (line 95) | def onAuthFailed(self):
  function test_store_long_filename_SMB1 (line 100) | def test_store_long_filename_SMB1():
  function test_store_long_filename_SMB2 (line 111) | def test_store_long_filename_SMB2():
  function test_store_unicode_filename_SMB1 (line 122) | def test_store_unicode_filename_SMB1():
  function test_store_unicode_filename_SMB2 (line 133) | def test_store_unicode_filename_SMB2():

FILE: python2/tests/DirectSMBTwistedTests/util.py
  function getConnectionInfo (line 5) | def getConnectionInfo():

FILE: python2/tests/NetBIOSTests/test_queryname.py
  function teardown_func (line 7) | def teardown_func():
  function test_broadcast (line 12) | def test_broadcast():

FILE: python2/tests/NetBIOSTwistedTests/test_queryname.py
  function test_broadcast (line 9) | def test_broadcast():

FILE: python2/tests/SMBConnectionTests/test_SMBHandler.py
  function MD5 (line 11) | def MD5(): return hashlib.md5()
  function MD5 (line 14) | def MD5(): return md5.new()
  function test_basic (line 18) | def test_basic():
  function test_unicode (line 32) | def test_unicode():
  function test_upload (line 51) | def test_upload():

FILE: python2/tests/SMBConnectionTests/test_auth.py
  function teardown_func (line 9) | def teardown_func():
  function test_NTLMv1_auth_SMB1 (line 19) | def test_NTLMv1_auth_SMB1():
  function test_NTLMv2_auth_SMB1 (line 33) | def test_NTLMv2_auth_SMB1():
  function test_NTLMv1_auth_SMB2 (line 47) | def test_NTLMv1_auth_SMB2():
  function test_NTLMv2_auth_SMB2 (line 61) | def test_NTLMv2_auth_SMB2():

FILE: python2/tests/SMBConnectionTests/test_createdeletedirectory.py
  function setup_func_SMB1 (line 11) | def setup_func_SMB1():
  function setup_func_SMB2 (line 19) | def setup_func_SMB2():
  function teardown_func (line 27) | def teardown_func():
  function test_english_directory_SMB1 (line 32) | def test_english_directory_SMB1():
  function test_english_directory_SMB2 (line 49) | def test_english_directory_SMB2():
  function test_unicode_directory_SMB1 (line 66) | def test_unicode_directory_SMB1():
  function test_unicode_directory_SMB2 (line 83) | def test_unicode_directory_SMB2():

FILE: python2/tests/SMBConnectionTests/test_deletepattern.py
  function setup_func_SMB1 (line 12) | def setup_func_SMB1():
  function setup_func_SMB2 (line 20) | def setup_func_SMB2():
  function teardown_func (line 28) | def teardown_func():
  function test_delete_without_subfolder_SMB1 (line 33) | def test_delete_without_subfolder_SMB1():
  function test_delete_with_subfolder_SMB1 (line 81) | def test_delete_with_subfolder_SMB1():
  function test_delete_without_subfolder_SMB2 (line 129) | def test_delete_without_subfolder_SMB2():
  function test_delete_with_subfolder_SMB2 (line 176) | def test_delete_with_subfolder_SMB2():

FILE: python2/tests/SMBConnectionTests/test_echo.py
  function setup_func (line 9) | def setup_func():
  function teardown_func (line 15) | def teardown_func():
  function test_echo (line 20) | def test_echo():

FILE: python2/tests/SMBConnectionTests/test_getattributes.py
  function setup_func_SMB1 (line 10) | def setup_func_SMB1():
  function setup_func_SMB2 (line 17) | def setup_func_SMB2():
  function teardown_func (line 24) | def teardown_func():
  function test_getAttributes_SMB2 (line 29) | def test_getAttributes_SMB2():
  function test_getAttributes_SMB1 (line 43) | def test_getAttributes_SMB1():

FILE: python2/tests/SMBConnectionTests/test_listpath.py
  function setup_func_SMB1 (line 11) | def setup_func_SMB1():
  function setup_func_SMB2 (line 18) | def setup_func_SMB2():
  function teardown_func (line 25) | def teardown_func():
  function test_listPath_SMB1 (line 30) | def test_listPath_SMB1():
  function test_listSubPath_SMB1 (line 41) | def test_listSubPath_SMB1():
  function test_listPathWithManyFiles_SMB1 (line 50) | def test_listPathWithManyFiles_SMB1():
  function test_listPath_SMB2 (line 57) | def test_listPath_SMB2():
  function test_listSubPath_SMB2 (line 68) | def test_listSubPath_SMB2():
  function test_listPathWithManyFiles_SMB2 (line 77) | def test_listPathWithManyFiles_SMB2():
  function test_listPathFilterForDirectory_SMB1 (line 84) | def test_listPathFilterForDirectory_SMB1():
  function test_listPathFilterForDirectory_SMB2 (line 93) | def test_listPathFilterForDirectory_SMB2():
  function test_listPathFilterForFiles_SMB1 (line 102) | def test_listPathFilterForFiles_SMB1():
  function test_listPathFilterForFiles_SMB2 (line 111) | def test_listPathFilterForFiles_SMB2():
  function test_listPathFilterPattern_SMB1 (line 120) | def test_listPathFilterPattern_SMB1():
  function test_listPathFilterPattern_SMB2 (line 130) | def test_listPathFilterPattern_SMB2():
  function test_listPathFilterUnicodePattern_SMB1 (line 140) | def test_listPathFilterUnicodePattern_SMB1():
  function test_listPathFilterUnicodePattern_SMB2 (line 150) | def test_listPathFilterUnicodePattern_SMB2():
  function test_listPathFilterEmptyList_SMB1 (line 160) | def test_listPathFilterEmptyList_SMB1():
  function test_listPathFilterEmptyList_SMB2 (line 166) | def test_listPathFilterEmptyList_SMB2():

FILE: python2/tests/SMBConnectionTests/test_listshares.py
  function setup_func_SMB1 (line 9) | def setup_func_SMB1():
  function setup_func_SMB2 (line 16) | def setup_func_SMB2():
  function teardown_func (line 23) | def teardown_func():
  function test_listshares_SMB1 (line 28) | def test_listshares_SMB1():
  function test_listshares_SMB2 (line 34) | def test_listshares_SMB2():

FILE: python2/tests/SMBConnectionTests/test_listsnapshots.py
  function setup_func_SMB1 (line 9) | def setup_func_SMB1():
  function setup_func_SMB2 (line 16) | def setup_func_SMB2():
  function teardown_func (line 23) | def teardown_func():
  function test_listsnapshots_SMB1 (line 28) | def test_listsnapshots_SMB1():
  function test_listsnapshots_SMB2 (line 34) | def test_listsnapshots_SMB2():

FILE: python2/tests/SMBConnectionTests/test_rename.py
  function setup_func_SMB1 (line 12) | def setup_func_SMB1():
  function setup_func_SMB2 (line 19) | def setup_func_SMB2():
  function teardown_func (line 26) | def teardown_func():
  function test_rename_english_file_SMB1 (line 31) | def test_rename_english_file_SMB1():
  function test_rename_english_file_SMB2 (line 54) | def test_rename_english_file_SMB2():
  function test_rename_unicode_file_SMB1 (line 77) | def test_rename_unicode_file_SMB1():
  function test_rename_unicode_file_SMB2 (line 100) | def test_rename_unicode_file_SMB2():
  function test_rename_english_directory_SMB1 (line 123) | def test_rename_english_directory_SMB1():
  function test_rename_english_directory_SMB2 (line 146) | def test_rename_english_directory_SMB2():
  function test_rename_unicode_directory_SMB1 (line 169) | def test_rename_unicode_directory_SMB1():
  function test_rename_unicode_directory_SMB2 (line 192) | def test_rename_unicode_directory_SMB2():

FILE: python2/tests/SMBConnectionTests/test_retrievefile.py
  function MD5 (line 12) | def MD5(): return hashlib.md5()
  function MD5 (line 15) | def MD5(): return md5.new()
  function setup_func_SMB1 (line 19) | def setup_func_SMB1():
  function setup_func_SMB2 (line 26) | def setup_func_SMB2():
  function teardown_func (line 33) | def teardown_func():
  function test_retr_multiplereads_SMB1 (line 38) | def test_retr_multiplereads_SMB1():
  function test_retr_multiplereads_SMB2 (line 52) | def test_retr_multiplereads_SMB2():
  function test_retr_longfilename_SMB1 (line 66) | def test_retr_longfilename_SMB1():
  function test_retr_longfilename_SMB2 (line 80) | def test_retr_longfilename_SMB2():
  function test_retr_unicodefilename_SMB1 (line 94) | def test_retr_unicodefilename_SMB1():
  function test_retr_unicodefilename_SMB2 (line 108) | def test_retr_unicodefilename_SMB2():
  function test_retr_offset_SMB1 (line 122) | def test_retr_offset_SMB1():
  function test_retr_offset_SMB2 (line 136) | def test_retr_offset_SMB2():
  function test_retr_offset_and_biglimit_SMB1 (line 150) | def test_retr_offset_and_biglimit_SMB1():
  function test_retr_offset_and_biglimit_SMB2 (line 164) | def test_retr_offset_and_biglimit_SMB2():
  function test_retr_offset_and_smalllimit_SMB1 (line 178) | def test_retr_offset_and_smalllimit_SMB1():
  function test_retr_offset_and_smalllimit_SMB2 (line 192) | def test_retr_offset_and_smalllimit_SMB2():
  function test_retr_offset_and_zerolimit_SMB1 (line 206) | def test_retr_offset_and_zerolimit_SMB1():
  function test_retr_offset_and_zerolimit_SMB2 (line 220) | def test_retr_offset_and_zerolimit_SMB2():

FILE: python2/tests/SMBConnectionTests/test_security.py
  function MD5 (line 12) | def MD5(): return hashlib.md5()
  function MD5 (line 15) | def MD5(): return md5.new()
  function setup_func_SMB2 (line 19) | def setup_func_SMB2():
  function teardown_func (line 26) | def teardown_func():
  function test_security_SMB2 (line 31) | def test_security_SMB2():

FILE: python2/tests/SMBConnectionTests/test_storefile.py
  function MD5 (line 12) | def MD5(): return hashlib.md5()
  function MD5 (line 15) | def MD5(): return md5.new()
  function setup_func_SMB1 (line 23) | def setup_func_SMB1():
  function setup_func_SMB2 (line 31) | def setup_func_SMB2():
  function teardown_func (line 39) | def teardown_func():
  function test_store_long_filename_SMB1 (line 45) | def test_store_long_filename_SMB1():
  function test_store_from_offset_SMB1 (line 67) | def test_store_from_offset_SMB1():
  function test_store_long_filename_SMB2 (line 87) | def test_store_long_filename_SMB2():
  function test_store_unicode_filename_SMB1 (line 110) | def test_store_unicode_filename_SMB1():
  function test_store_unicode_filename_SMB2 (line 133) | def test_store_unicode_filename_SMB2():
  function test_store_from_offset_SMB2 (line 155) | def test_store_from_offset_SMB2():

FILE: python2/tests/SMBConnectionTests/test_with_context.py
  function test_context (line 6) | def test_context():

FILE: python2/tests/SMBConnectionTests/util.py
  function getConnectionInfo (line 5) | def getConnectionInfo():

FILE: python2/tests/SMBTwistedTests/test_auth.py
  class AuthFactory (line 9) | class AuthFactory(SMBProtocolFactory):
    method __init__ (line 11) | def __init__(self, *args, **kwargs):
    method testDone (line 16) | def testDone(self, r):
    method onAuthOK (line 21) | def onAuthOK(self):
    method onAuthFailed (line 24) | def onAuthFailed(self):
  function test_NTLMv1_auth_SMB1 (line 29) | def test_NTLMv1_auth_SMB1():
  function test_NTLMv2_auth_SMB1 (line 42) | def test_NTLMv2_auth_SMB1():
  function test_NTLMv1_auth_SMB2 (line 55) | def test_NTLMv1_auth_SMB2():
  function test_NTLMv2_auth_SMB2 (line 68) | def test_NTLMv2_auth_SMB2():

FILE: python2/tests/SMBTwistedTests/test_createdeletedirectory.py
  class DirectoryFactory (line 11) | class DirectoryFactory(SMBProtocolFactory):
    method __init__ (line 13) | def __init__(self, *args, **kwargs):
    method testDone (line 20) | def testDone(self, r):
    method createDone (line 25) | def createDone(self, result):
    method listComplete (line 30) | def listComplete(self, entries):
    method deleteDone (line 38) | def deleteDone(self, result):
    method list2Complete (line 43) | def list2Complete(self, entries):
    method onAuthOK (line 48) | def onAuthOK(self):
    method onAuthFailed (line 53) | def onAuthFailed(self):
  function test_english_directory_SMB1 (line 58) | def test_english_directory_SMB1():
  function test_english_directory_SMB2 (line 69) | def test_english_directory_SMB2():
  function test_unicode_directory_SMB1 (line 80) | def test_unicode_directory_SMB1():
  function test_unicode_directory_SMB2 (line 91) | def test_unicode_directory_SMB2():

FILE: python2/tests/SMBTwistedTests/test_echo.py
  class EchoFactory (line 8) | class EchoFactory(SMBProtocolFactory):
    method __init__ (line 10) | def __init__(self, *args, **kwargs):
    method testDone (line 16) | def testDone(self, r):
    method onAuthOK (line 21) | def onAuthOK(self):
    method onAuthFailed (line 30) | def onAuthFailed(self):
  function test_echo (line 35) | def test_echo():

FILE: python2/tests/SMBTwistedTests/test_getattributes.py
  class GetAttributesFactory (line 9) | class GetAttributesFactory(SMBProtocolFactory):
    method __init__ (line 11) | def __init__(self, *args, **kwargs):
    method testDone (line 18) | def testDone(self, r):
    method onAuthOK (line 23) | def onAuthOK(self):
    method onAuthFailed (line 32) | def onAuthFailed(self):
  function test_getAttributes_SMB1_test1 (line 37) | def test_getAttributes_SMB1_test1():
  function test_getAttributes_SMB1_test2 (line 48) | def test_getAttributes_SMB1_test2():
  function test_getAttributes_SMB1_test3 (line 59) | def test_getAttributes_SMB1_test3():
  function test_getAttributes_SMB2_test1 (line 70) | def test_getAttributes_SMB2_test1():
  function test_getAttributes_SMB2_test2 (line 81) | def test_getAttributes_SMB2_test2():
  function test_getAttributes_SMB2_test3 (line 92) | def test_getAttributes_SMB2_test3():

FILE: python2/tests/SMBTwistedTests/test_listpath.py
  class ListPathFactory (line 9) | class ListPathFactory(SMBProtocolFactory):
    method __init__ (line 11) | def __init__(self, *args, **kwargs):
    method testDone (line 16) | def testDone(self, r):
    method onAuthOK (line 21) | def onAuthOK(self):
    method onAuthFailed (line 36) | def onAuthFailed(self):
  function test_listPath_SMB1 (line 41) | def test_listPath_SMB1():
  function test_listPath_SMB2 (line 50) | def test_listPath_SMB2():

FILE: python2/tests/SMBTwistedTests/test_listshares.py
  class ListSharesFactory (line 9) | class ListSharesFactory(SMBProtocolFactory):
    method __init__ (line 11) | def __init__(self, *args, **kwargs):
    method testDone (line 16) | def testDone(self, r):
    method onAuthOK (line 21) | def onAuthOK(self):
    method onAuthFailed (line 31) | def onAuthFailed(self):
  function test_listshares_SMB1 (line 36) | def test_listshares_SMB1():
  function test_listshares_SMB2 (line 45) | def test_listshares_SMB2():

FILE: python2/tests/SMBTwistedTests/test_listsnapshots.py
  class ListSnapshotsFactory (line 9) | class ListSnapshotsFactory(SMBProtocolFactory):
    method __init__ (line 11) | def __init__(self, *args, **kwargs):
    method testDone (line 18) | def testDone(self, r):
    method onAuthOK (line 23) | def onAuthOK(self):
    method onAuthFailed (line 33) | def onAuthFailed(self):
  function test_listshares_SMB1 (line 38) | def test_listshares_SMB1():
  function test_listshares_SMB2 (line 49) | def test_listshares_SMB2():

FILE: python2/tests/SMBTwistedTests/test_rename.py
  class RenameFactory (line 12) | class RenameFactory(SMBProtocolFactory):
    method __init__ (line 14) | def __init__(self, *args, **kwargs):
    method testDone (line 22) | def testDone(self, r):
    method pathCreated (line 27) | def pathCreated(self, result):
    method listComplete (line 32) | def listComplete(self, entries):
    method renameComplete (line 41) | def renameComplete(self, result):
    method list2Complete (line 46) | def list2Complete(self, entries):
    method onAuthFailed (line 52) | def onAuthFailed(self):
  class RenameFileFactory (line 56) | class RenameFileFactory(RenameFactory):
    method onAuthOK (line 58) | def onAuthOK(self):
    method cleanup (line 63) | def cleanup(self):
  class RenameDirectoryFactory (line 68) | class RenameDirectoryFactory(RenameFactory):
    method onAuthOK (line 70) | def onAuthOK(self):
    method cleanup (line 75) | def cleanup(self):
  function test_rename_english_file_SMB1 (line 81) | def test_rename_english_file_SMB1():
  function test_rename_english_file_SMB2 (line 93) | def test_rename_english_file_SMB2():
  function test_rename_unicode_file_SMB1 (line 105) | def test_rename_unicode_file_SMB1():
  function test_rename_unicode_file_SMB2 (line 117) | def test_rename_unicode_file_SMB2():
  function test_rename_english_directory_SMB1 (line 129) | def test_rename_english_directory_SMB1():
  function test_rename_english_directory_SMB2 (line 141) | def test_rename_english_directory_SMB2():
  function test_rename_unicode_directory_SMB1 (line 153) | def test_rename_unicode_directory_SMB1():
  function test_rename_unicode_directory_SMB2 (line 165) | def test_rename_unicode_directory_SMB2():

FILE: python2/tests/SMBTwistedTests/test_retrievefile.py
  function MD5 (line 12) | def MD5(): return hashlib.md5()
  function MD5 (line 15) | def MD5(): return md5.new()
  class RetrieveFileFactory (line 18) | class RetrieveFileFactory(SMBProtocolFactory):
    method __init__ (line 20) | def __init__(self, *args, **kwargs):
    method testDone (line 32) | def testDone(self, r):
    method fileRetrieved (line 37) | def fileRetrieved(self, write_result):
    method onAuthOK (line 58) | def onAuthOK(self):
    method onAuthFailed (line 66) | def onAuthFailed(self):
  function test_retr_multiplereads_SMB1 (line 71) | def test_retr_multiplereads_SMB1():
  function test_retr_multiplereads_SMB2 (line 85) | def test_retr_multiplereads_SMB2():
  function test_retr_longfilename_SMB1 (line 99) | def test_retr_longfilename_SMB1():
  function test_retr_longfilename_SMB2 (line 113) | def test_retr_longfilename_SMB2():
  function test_retr_unicodefilename_SMB1 (line 127) | def test_retr_unicodefilename_SMB1():
  function test_retr_unicodefilename_SMB2 (line 141) | def test_retr_unicodefilename_SMB2():
  function test_retr_offset_SMB1 (line 155) | def test_retr_offset_SMB1():
  function test_retr_offset_SMB2 (line 170) | def test_retr_offset_SMB2():
  function test_retr_offset_and_biglimit_SMB1 (line 185) | def test_retr_offset_and_biglimit_SMB1():
  function test_retr_offset_and_biglimit_SMB2 (line 201) | def test_retr_offset_and_biglimit_SMB2():
  function test_retr_offset_and_smalllimit_SMB1 (line 217) | def test_retr_offset_and_smalllimit_SMB1():
  function test_retr_offset_and_smalllimit_SMB2 (line 233) | def test_retr_offset_and_smalllimit_SMB2():
  function test_retr_offset_and_zerolimit_SMB1 (line 249) | def test_retr_offset_and_zerolimit_SMB1():
  function test_retr_offset_and_zerolimit_SMB2 (line 265) | def test_retr_offset_and_zerolimit_SMB2():

FILE: python2/tests/SMBTwistedTests/test_storefile.py
  function MD5 (line 13) | def MD5(): return hashlib.md5()
  function MD5 (line 16) | def MD5(): return md5.new()
  class StoreFilesFactory (line 18) | class StoreFilesFactory(SMBProtocolFactory):
    method __init__ (line 27) | def __init__(self, *args, **kwargs):
    method testDone (line 34) | def testDone(self, r):
    method storeComplete (line 39) | def storeComplete(self, result):
    method listComplete (line 48) | def listComplete(self, entries):
    method retrieveComplete (line 65) | def retrieveComplete(self, result):
    method deleteComplete (line 79) | def deleteComplete(self, result):
    method list2Complete (line 84) | def list2Complete(self, entries):
    method onAuthOK (line 90) | def onAuthOK(self):
    method onAuthFailed (line 95) | def onAuthFailed(self):
  function test_store_long_filename_SMB1 (line 100) | def test_store_long_filename_SMB1():
  function test_store_long_filename_SMB2 (line 111) | def test_store_long_filename_SMB2():
  function test_store_unicode_filename_SMB1 (line 122) | def test_store_unicode_filename_SMB1():
  function test_store_unicode_filename_SMB2 (line 133) | def test_store_unicode_filename_SMB2():

FILE: python2/tests/SMBTwistedTests/util.py
  function getConnectionInfo (line 5) | def getConnectionInfo():

FILE: python2/tests/test_ntlm.py
  function test_NTLMv1_without_extended_security (line 5) | def test_NTLMv1_without_extended_security():
  function test_NTLMv1_with_extended_security (line 18) | def test_NTLMv1_with_extended_security():
  function test_NTLMv2 (line 31) | def test_NTLMv2():

FILE: python2/tests/test_security_descriptors.py
  function test_sid_string_representation (line 7) | def test_sid_string_representation():
  function test_sid_binary_parsing (line 16) | def test_sid_binary_parsing():
  function test_ace_binary_parsing (line 29) | def test_ace_binary_parsing():
  function test_acl_binary_parsing (line 76) | def test_acl_binary_parsing():
  function test_descriptor_binary_parsing (line 109) | def test_descriptor_binary_parsing():

FILE: python2/tests/test_securityblob.py
  function test_NTLMSSP_NEGOTIATE_encoding (line 6) | def test_NTLMSSP_NEGOTIATE_encoding():
  function test_NTLMSSP_CHALLENGE_decoding (line 21) | def test_NTLMSSP_CHALLENGE_decoding():
  function test_NTLMSSP_AUTH_encoding (line 57) | def test_NTLMSSP_AUTH_encoding():
  function test_auth_response_decoding (line 87) | def test_auth_response_decoding():

FILE: python3/nmb/NetBIOS.py
  class NetBIOS (line 6) | class NetBIOS(NBNS):
    method __init__ (line 10) | def __init__(self, broadcast = True, listen_port = 0):
    method close (line 24) | def close(self):
    method write (line 35) | def write(self, data, ip, port):
    method queryName (line 39) | def queryName(self, name, ip = '', port = 137, timeout = 30):
    method queryIPForName (line 62) | def queryIPForName(self, ip, port = 137, timeout = 30):
    method _pollForNetBIOSPacket (line 89) | def _pollForNetBIOSPacket(self, wait_trn_id, timeout):
    method _pollForQueryPacket (line 119) | def _pollForQueryPacket(self, wait_trn_id, timeout):

FILE: python3/nmb/NetBIOSProtocol.py
  class NetBIOSTimeout (line 7) | class NetBIOSTimeout(Exception):
  class NBNSProtocol (line 11) | class NBNSProtocol(DatagramProtocol, NBNS):
    method __init__ (line 15) | def __init__(self, broadcast = True, listen_port = 0):
    method datagramReceived (line 31) | def datagramReceived(self, data, from_info):
    method write (line 43) | def write(self, data, ip, port):
    method queryName (line 47) | def queryName(self, name, ip = '', port = 137, timeout = 30):
    method queryIPForName (line 77) | def queryIPForName(self, ip, port = 137, timeout = 30):
    method stopProtocol (line 112) | def stopProtocol(self):
    method cleanupPendingTrns (line 115) | def cleanupPendingTrns(self):

FILE: python3/nmb/base.py
  class NMBSession (line 7) | class NMBSession:
    method __init__ (line 11) | def __init__(self, my_name, remote_name, host_type = TYPE_SERVER, is_d...
    method write (line 28) | def write(self, data):
    method onNMBSessionMessage (line 31) | def onNMBSessionMessage(self, flags, data):
    method onNMBSessionOK (line 34) | def onNMBSessionOK(self):
    method onNMBSessionFailed (line 37) | def onNMBSessionFailed(self):
    method feedData (line 44) | def feedData(self, data):
    method sendNMBMessage (line 61) | def sendNMBMessage(self, data):
    method requestNMBSession (line 64) | def requestNMBSession(self):
    method _processNMBSessionPacket (line 73) | def _processNMBSessionPacket(self, packet):
    method _sendNMBPacket_NetBIOS (line 86) | def _sendNMBPacket_NetBIOS(self, packet_type, data):
    method _sendNMBPacket_DirectTCP (line 95) | def _sendNMBPacket_DirectTCP(self, packet_type, data):
  class NBNS (line 101) | class NBNS:
    method write (line 108) | def write(self, data, ip, port):
    method decodePacket (line 111) | def decodePacket(self, data):
    method prepareNameQuery (line 139) | def prepareNameQuery(self, trn_id, name, is_broadcast = True):
    method decodeIPQueryPacket (line 149) | def decodeIPQueryPacket(self, data):
    method prepareNetNameQuery (line 182) | def prepareNetNameQuery(self, trn_id, is_broadcast = True):

FILE: python3/nmb/nmb_structs.py
  class NMBError (line 4) | class NMBError(Exception): pass
  class NotConnectedError (line 6) | class NotConnectedError(NMBError):
  class NMBSessionMessage (line 12) | class NMBSessionMessage:
    method __init__ (line 17) | def __init__(self):
    method reset (line 20) | def reset(self):
    method decode (line 25) | def decode(self, data, offset):
  class DirectTCPSessionMessage (line 44) | class DirectTCPSessionMessage(NMBSessionMessage):
    method decode (line 49) | def decode(self, data, offset):

FILE: python3/nmb/utils.py
  function encode_name (line 5) | def encode_name(name, type, scope = None):
  function decode_name (line 30) | def decode_name(name):

FILE: python3/smb/SMBConnection.py
  class SMBConnection (line 10) | class SMBConnection(SMB):
    method __init__ (line 21) | def __init__(self, username, password, my_name, remote_name, domain = ...
    method onAuthOK (line 61) | def onAuthOK(self):
    method onAuthFailed (line 64) | def onAuthFailed(self):
    method write (line 67) | def write(self, data):
    method __enter__ (line 80) | def __enter__(self):
    method __exit__ (line 83) | def __exit__(self, *args):
    method isUsingSMB2 (line 91) | def isUsingSMB2(self):
    method connect (line 100) | def connect(self, ip, port = 139, sock_family = None, timeout = 60):
    method close (line 135) | def close(self):
    method listShares (line 143) | def listShares(self, timeout = 30):
    method listPath (line 172) | def listPath(self, service_name, path,
    method listSnapshots (line 216) | def listSnapshots(self, service_name, path, timeout = 30):
    method getAttributes (line 249) | def getAttributes(self, service_name, path, timeout = 30):
    method getSecurity (line 280) | def getSecurity(self, service_name, path, timeout = 30):
    method retrieveFile (line 311) | def retrieveFile(self, service_name, path, file_obj, timeout = 30, sho...
    method retrieveFileFromOffset (line 326) | def retrieveFileFromOffset(self, service_name, path, file_obj, offset ...
    method storeFile (line 364) | def storeFile(self, service_name, path, file_obj, timeout = 30, show_p...
    method storeFileFromOffset (line 378) | def storeFileFromOffset(self, service_name, path, file_obj, offset = 0...
    method deleteFiles (line 414) | def deleteFiles(self, service_name, path_file_pattern, delete_matching...
    method resetFileAttributes (line 444) | def resetFileAttributes(self, service_name, path_file_pattern, file_at...
    method createDirectory (line 479) | def createDirectory(self, service_name, path, timeout = 30):
    method deleteDirectory (line 506) | def deleteDirectory(self, service_name, path, timeout = 30):
    method rename (line 533) | def rename(self, service_name, old_path, new_path, timeout = 30):
    method echo (line 561) | def echo(self, data, timeout = 10):
    method _poll_for_data (line 595) | def _poll_for_data(self, expiry_time, read_len, data, timeout, poller):
    method _pollForNetBIOSPacket (line 618) | def _pollForNetBIOSPacket(self, timeout):

FILE: python3/smb/SMBHandler.py
  class SMBHandler (line 14) | class SMBHandler(urllib.request.BaseHandler):
    method smb_open (line 16) | def smb_open(self, req):
    method createTempFile (line 89) | def createTempFile(self):
    method generateClientMachineName (line 92) | def generateClientMachineName(self):

FILE: python3/smb/SMBProtocol.py
  class SMBProtocol (line 13) | class SMBProtocol(Protocol, SMB):
    method connectionMade (line 21) | def connectionMade(self):
    method connectionLost (line 29) | def connectionLost(self, reason):
    method dataReceived (line 33) | def dataReceived(self, data):
    method write (line 40) | def write(self, data):
    method onAuthOK (line 43) | def onAuthOK(self):
    method onAuthFailed (line 48) | def onAuthFailed(self):
    method onNMBSessionFailed (line 52) | def onNMBSessionFailed(self):
    method _cleanupPendingRequests (line 59) | def _cleanupPendingRequests(self):
  class SMBProtocolFactory (line 76) | class SMBProtocolFactory(ClientFactory):
    method __init__ (line 88) | def __init__(self, username, password, my_name, remote_name, domain = ...
    method isReady (line 129) | def isReady(self):
    method isUsingSMB2 (line 134) | def isUsingSMB2(self):
    method onAuthOK (line 142) | def onAuthOK(self):
    method onAuthFailed (line 150) | def onAuthFailed(self):
    method listShares (line 166) | def listShares(self, timeout = 30):
    method listPath (line 180) | def listPath(self, service_name, path,
    method listSnapshots (line 209) | def listSnapshots(self, service_name, path, timeout = 30):
    method getAttributes (line 227) | def getAttributes(self, service_name, path, timeout = 30):
    method retrieveFile (line 242) | def retrieveFile(self, service_name, path, file_obj, timeout = 30):
    method retrieveFileFromOffset (line 260) | def retrieveFileFromOffset(self, service_name, path, file_obj, offset ...
    method storeFile (line 284) | def storeFile(self, service_name, path, file_obj, timeout = 30):
    method deleteFiles (line 306) | def deleteFiles(self, service_name, path_file_pattern, delete_matching...
    method createDirectory (line 326) | def createDirectory(self, service_name, path):
    method deleteDirectory (line 343) | def deleteDirectory(self, service_name, path):
    method rename (line 360) | def rename(self, service_name, old_path, new_path):
    method echo (line 378) | def echo(self, data, timeout = 10):
    method closeConnection (line 393) | def closeConnection(self):
    method buildProtocol (line 409) | def buildProtocol(self, addr):

FILE: python3/smb/base.py
  class NotReadyError (line 23) | class NotReadyError(Exception):
  class NotConnectedError (line 27) | class NotConnectedError(Exception):
  class SMBTimeout (line 31) | class SMBTimeout(Exception):
  class SMB (line 36) | class SMB(NMBSession):
    method __init__ (line 57) | def __init__(self, username, password, my_name, remote_name, domain = ...
    method password (line 110) | def password(self):
    method onNMBSessionOK (line 119) | def onNMBSessionOK(self):
    method onNMBSessionFailed (line 122) | def onNMBSessionFailed(self):
    method onNMBSessionMessage (line 125) | def onNMBSessionMessage(self, flags, data):
    method onAuthOK (line 163) | def onAuthOK(self):
    method onAuthFailed (line 166) | def onAuthFailed(self):
    method _setupSMB1Methods (line 173) | def _setupSMB1Methods(self):
    method _setupSMB2Methods (line 196) | def _setupSMB2Methods(self):
    method _getNextRPCCallID (line 219) | def _getNextRPCCallID(self):
    method _sendSMBMessage_SMB2 (line 227) | def _sendSMBMessage_SMB2(self, smb_message):
    method _getNextMID_SMB2 (line 245) | def _getNextMID_SMB2(self):
    method _updateState_SMB2 (line 249) | def _updateState_SMB2(self, message):
    method _updateServerInfo_SMB2 (line 348) | def _updateServerInfo_SMB2(self, payload):
    method _handleNegotiateResponse_SMB2 (line 357) | def _handleNegotiateResponse_SMB2(self, message):
    method _handleSessionChallenge_SMB2 (line 363) | def _handleSessionChallenge_SMB2(self, message, ntlm_token):
    method _listShares_SMB2 (line 418) | def _listShares_SMB2(self, callback, errback, timeout = 30):
    method _listPath_SMB2 (line 605) | def _listPath_SMB2(self, service_name, path, callback, errback, search...
    method _getAttributes_SMB2 (line 745) | def _getAttributes_SMB2(self, service_name, path, callback, errback, t...
    method _getSecurity_SMB2 (line 821) | def _getSecurity_SMB2(self, service_name, path, callback, errback, tim...
    method _retrieveFile_SMB2 (line 902) | def _retrieveFile_SMB2(self, service_name, path, file_obj, callback, e...
    method _retrieveFileFromOffset_SMB2 (line 905) | def _retrieveFileFromOffset_SMB2(self, service_name, path, file_obj, c...
    method _storeFile_SMB2 (line 1049) | def _storeFile_SMB2(self, service_name, path, file_obj, callback, errb...
    method _storeFileFromOffset_SMB2 (line 1052) | def _storeFileFromOffset_SMB2(self, service_name, path, file_obj, call...
    method _deleteFiles_SMB2 (line 1164) | def _deleteFiles_SMB2(self, service_name, path_file_pattern, delete_ma...
    method _deleteFiles_SMB2__list (line 1227) | def _deleteFiles_SMB2__list(self, service_name, path, pattern, delete_...
    method _deleteFiles_SMB2__del (line 1256) | def _deleteFiles_SMB2__del(self, service_name, tid, path, callback, er...
    method _resetFileAttributes_SMB2 (line 1328) | def _resetFileAttributes_SMB2(self, service_name, path_file_pattern, c...
    method _createDirectory_SMB2 (line 1419) | def _createDirectory_SMB2(self, service_name, path, callback, errback,...
    method _deleteDirectory_SMB2 (line 1487) | def _deleteDirectory_SMB2(self, service_name, path, callback, errback,...
    method _rename_SMB2 (line 1576) | def _rename_SMB2(self, service_name, old_path, new_path, callback, err...
    method _listSnapshots_SMB2 (line 1673) | def _listSnapshots_SMB2(self, service_name, path, callback, errback, t...
    method _echo_SMB2 (line 1764) | def _echo_SMB2(self, data, callback, errback, timeout = 30):
    method _sendSMBMessage_SMB1 (line 1784) | def _sendSMBMessage_SMB1(self, smb_message):
    method _getNextMID_SMB1 (line 1809) | def _getNextMID_SMB1(self):
    method _updateState_SMB1 (line 1817) | def _updateState_SMB1(self, message):
    method _updateServerInfo_SMB1 (line 1912) | def _updateServerInfo_SMB1(self, payload):
    method _handleSessionChallenge_SMB1 (line 1924) | def _handleSessionChallenge_SMB1(self, message, ntlm_token):
    method _handleNegotiateResponse_SMB1 (line 1978) | def _handleNegotiateResponse_SMB1(self, message):
    method _listShares_SMB1 (line 1997) | def _listShares_SMB1(self, callback, errback, timeout = 30):
    method _listPath_SMB1 (line 2172) | def _listPath_SMB1(self, service_name, path, callback, errback, search...
    method _getAttributes_SMB1 (line 2384) | def _getAttributes_SMB1(self, service_name, path, callback, errback, t...
    method _getSecurity_SMB1 (line 2445) | def _getSecurity_SMB1(self, service_name, path_file_pattern, callback,...
    method _retrieveFile_SMB1 (line 2448) | def _retrieveFile_SMB1(self, service_name, path, file_obj, callback, e...
    method _retrieveFileFromOffset_SMB1 (line 2451) | def _retrieveFileFromOffset_SMB1(self, service_name, path, file_obj, c...
    method _storeFile_SMB1 (line 2558) | def _storeFile_SMB1(self, service_name, path, file_obj, callback, errb...
    method _storeFileFromOffset_SMB1 (line 2561) | def _storeFileFromOffset_SMB1(self, service_name, path, file_obj, call...
    method _deleteFiles_SMB1 (line 2645) | def _deleteFiles_SMB1(self, service_name, path_file_pattern, delete_ma...
    method _deleteFiles_SMB1__list (line 2708) | def _deleteFiles_SMB1__list(self, service_name, path, pattern, delete_...
    method _deleteFiles_SMB1__del (line 2737) | def _deleteFiles_SMB1__del(self, service_name, tid, path, callback, er...
    method _resetFileAttributes_SMB1 (line 2764) | def _resetFileAttributes_SMB1(self, service_name, path_file_pattern, c...
    method _createDirectory_SMB1 (line 2767) | def _createDirectory_SMB1(self, service_name, path, callback, errback,...
    method _deleteDirectory_SMB1 (line 2804) | def _deleteDirectory_SMB1(self, service_name, path, callback, errback,...
    method _rename_SMB1 (line 2841) | def _rename_SMB1(self, service_name, old_path, new_path, callback, err...
    method _listSnapshots_SMB1 (line 2881) | def _listSnapshots_SMB1(self, service_name, path, callback, errback, t...
    method _echo_SMB1 (line 2964) | def _echo_SMB1(self, data, callback, errback, timeout = 30):
    method _extractLastPathComponent (line 2982) | def _extractLastPathComponent(self, path):
    method _pushToArray (line 2985) | def _pushToArray(self, messages_history, message):
  class SharedDevice (line 2990) | class SharedDevice:
    method __init__ (line 3007) | def __init__(self, type, name, comments):
    method type (line 3013) | def type(self):
    method isSpecial (line 3024) | def isSpecial(self):
    method isTemporary (line 3033) | def isTemporary(self):
    method __unicode__ (line 3039) | def __unicode__(self):
  class SharedFile (line 3043) | class SharedFile:
    method __init__ (line 3068) | def __init__(self, create_time, last_access_time, last_write_time, las...
    method isDirectory (line 3081) | def isDirectory(self):
    method isReadOnly (line 3086) | def isReadOnly(self):
    method isNormal (line 3091) | def isNormal(self):
    method __unicode__ (line 3100) | def __unicode__(self):
  class _PendingRequest (line 3104) | class _PendingRequest:
    method __init__ (line 3106) | def __init__(self, mid, expiry_time, callback, errback, **kwargs):

FILE: python3/smb/ntlm.py
  function MD4 (line 10) | def MD4(): return hashlib.new('md4')
  function MD5 (line 16) | def MD5(s): return hashlib.md5(s)
  function MD5 (line 19) | def MD5(s): return md5.new(s)
  function generateNegotiateMessage (line 71) | def generateNegotiateMessage():
  function generateAuthenticateMessage (line 85) | def generateAuthenticateMessage(challenge_flags, nt_response, lm_respons...
  function decodeChallengeMessage (line 139) | def decodeChallengeMessage(ntlm_data):
  function generateChallengeResponseV2 (line 161) | def generateChallengeResponseV2(password, user, server_challenge, server...
  function expandDesKey (line 187) | def expandDesKey(key):
  function DESL (line 201) | def DESL(K, D):
  function generateChallengeResponseV1 (line 214) | def generateChallengeResponseV1(password, server_challenge, has_extended...

FILE: python3/smb/security_descriptors.py
  class SID (line 147) | class SID(object):
    method __init__ (line 155) | def __init__(self, revision, identifier_authority, subauthorities):
    method __str__ (line 163) | def __str__(self):
    method __repr__ (line 174) | def __repr__(self):
    method from_bytes (line 178) | def from_bytes(cls, data, return_tail=False):
  class ACE (line 190) | class ACE(object):
    method __init__ (line 198) | def __init__(self, type_, flags, mask, sid, additional_data):
    method __repr__ (line 221) | def __repr__(self):
    method isInheritOnly (line 227) | def isInheritOnly(self):
    method from_bytes (line 233) | def from_bytes(cls, data):
  class ACL (line 281) | class ACL(object):
    method __init__ (line 290) | def __init__(self, revision, aces):
    method __repr__ (line 296) | def __repr__(self):
    method from_bytes (line 300) | def from_bytes(cls, data):
  class SecurityDescriptor (line 318) | class SecurityDescriptor(object):
    method __init__ (line 327) | def __init__(self, flags, owner, group, dacl, sacl):
    method from_bytes (line 343) | def from_bytes(cls, data):

FILE: python3/smb/securityblob.py
  class UnsupportedSecurityProvider (line 8) | class UnsupportedSecurityProvider(Exception): pass
  class BadSecurityBlobError (line 9) | class BadSecurityBlobError(Exception): pass
  function generateNegotiateSecurityBlob (line 12) | def generateNegotiateSecurityBlob(ntlm_data):
  function generateAuthSecurityBlob (line 31) | def generateAuthSecurityBlob(ntlm_data):
  function decodeChallengeSecurityBlob (line 43) | def decodeChallengeSecurityBlob(data):
  function decodeAuthResponseSecurityBlob (line 62) | def decodeAuthResponseSecurityBlob(data):
  class NegResultEnumerated (line 81) | class NegResultEnumerated(univ.Enumerated):
  class MechTypeList (line 90) | class MechTypeList(univ.SequenceOf):
  class ContextFlags (line 94) | class ContextFlags(univ.BitString):
  class NegTokenInit (line 106) | class NegTokenInit(univ.Sequence):
  class NegTokenTarg (line 115) | class NegTokenTarg(univ.Sequence):
  class NegotiationToken (line 124) | class NegotiationToken(univ.Choice):
  class ContextToken (line 131) | class ContextToken(univ.Sequence):

FILE: python3/smb/smb2_structs.py
  class SMB2Message (line 10) | class SMB2Message:
    method __init__ (line 26) | def __init__(self, payload = None):
    method __str__ (line 32) | def __str__(self):
    method reset (line 43) | def reset(self):
    method encode (line 69) | def encode(self):
    method decode (line 86) | def decode(self, buf):
    method _decodeCommand (line 145) | def _decodeCommand(self):
    method isAsync (line 172) | def isAsync(self):
    method isReply (line 176) | def isReply(self):
  class Structure (line 180) | class Structure:
    method initMessage (line 182) | def initMessage(self, message):
    method prepare (line 185) | def prepare(self, message):
    method decode (line 188) | def decode(self, message):
  class SMB2NegotiateResponse (line 192) | class SMB2NegotiateResponse(Structure):
    method decode (line 215) | def decode(self, message):
  class SMB2SessionSetupRequest (line 228) | class SMB2SessionSetupRequest(Structure):
    method __init__ (line 238) | def __init__(self, security_blob):
    method initMessage (line 241) | def initMessage(self, message):
    method prepare (line 245) | def prepare(self, message):
  class SMB2SessionSetupResponse (line 257) | class SMB2SessionSetupResponse(Structure):
    method isGuestSession (line 274) | def isGuestSession(self):
    method isAnonymousSession (line 278) | def isAnonymousSession(self):
    method decode (line 281) | def decode(self, message):
  class SMB2TreeConnectRequest (line 290) | class SMB2TreeConnectRequest(Structure):
    method __init__ (line 300) | def __init__(self, path):
    method initMessage (line 303) | def initMessage(self, message):
    method prepare (line 307) | def prepare(self, message):
  class SMB2TreeConnectResponse (line 315) | class SMB2TreeConnectResponse(Structure):
    method decode (line 333) | def decode(self, message):
  class SMB2CreateRequest (line 342) | class SMB2CreateRequest(Structure):
    method __init__ (line 352) | def __init__(self, filename, file_attributes = 0,
    method initMessage (line 367) | def initMessage(self, message):
    method prepare (line 371) | def prepare(self, message):
  class SMB2CreateResponse (line 406) | class SMB2CreateResponse(Structure):
    method decode (line 427) | def decode(self, message):
  class SMB2WriteRequest (line 442) | class SMB2WriteRequest(Structure):
    method __init__ (line 452) | def __init__(self, fid, data, offset, remaining_len = 0, flags = 0):
    method initMessage (line 460) | def initMessage(self, message):
    method prepare (line 464) | def prepare(self, message):
  class SMB2WriteResponse (line 478) | class SMB2WriteResponse(Structure):
    method decode (line 493) | def decode(self, message):
  class SMB2ReadRequest (line 500) | class SMB2ReadRequest(Structure):
    method __init__ (line 510) | def __init__(self, fid, read_offset, read_len, min_read_len = 0):
    method initMessage (line 516) | def initMessage(self, message):
    method prepare (line 520) | def prepare(self, message):
  class SMB2ReadResponse (line 536) | class SMB2ReadResponse(Structure):
    method decode (line 546) | def decode(self, message):
  class SMB2IoctlRequest (line 554) | class SMB2IoctlRequest(Structure):
    method __init__ (line 564) | def __init__(self, fid, ctlcode, flags, in_data, max_out_size = 65536):
    method initMessage (line 571) | def initMessage(self, message):
    method prepare (line 575) | def prepare(self, message):
  class SMB2IoctlResponse (line 592) | class SMB2IoctlResponse(Structure):
    method decode (line 611) | def decode(self, message):
  class SMB2CloseRequest (line 630) | class SMB2CloseRequest(Structure):
    method __init__ (line 640) | def __init__(self, fid, flags = 0):
    method initMessage (line 644) | def initMessage(self, message):
    method prepare (line 648) | def prepare(self, message):
  class SMB2CloseResponse (line 656) | class SMB2CloseResponse(Structure):
    method decode (line 663) | def decode(self, message):
  class SMB2QueryDirectoryRequest (line 667) | class SMB2QueryDirectoryRequest(Structure):
    method __init__ (line 677) | def __init__(self, fid, filename, info_class, flags, output_buf_len):
    method initMessage (line 684) | def initMessage(self, message):
    method prepare (line 688) | def prepare(self, message):
  class SMB2QueryDirectoryResponse (line 700) | class SMB2QueryDirectoryResponse(Structure):
    method decode (line 716) | def decode(self, message):
  class SMB2QueryInfoRequest (line 724) | class SMB2QueryInfoRequest(Structure):
    method __init__ (line 734) | def __init__(self, fid, flags, additional_info, info_type, file_info_c...
    method initMessage (line 743) | def initMessage(self, message):
    method prepare (line 747) | def prepare(self, message):
  class SMB2QueryInfoResponse (line 762) | class SMB2QueryInfoResponse(Structure):
    method decode (line 778) | def decode(self, message):
  class SMB2SetInfoRequest (line 786) | class SMB2SetInfoRequest(Structure):
    method __init__ (line 796) | def __init__(self, fid, additional_info, info_type, file_info_class, d...
    method initMessage (line 803) | def initMessage(self, message):
    method prepare (line 807) | def prepare(self, message):
  class SMB2SetInfoResponse (line 819) | class SMB2SetInfoResponse(Structure):
    method decode (line 826) | def decode(self, message):
  class SMB2EchoRequest (line 830) | class SMB2EchoRequest(Structure):
    method initMessage (line 840) | def initMessage(self, message):
    method prepare (line 844) | def prepare(self, message):
  class SMB2EchoResponse (line 849) | class SMB2EchoResponse(Structure):
    method decode (line 856) | def decode(self, message):

FILE: python3/smb/smb_structs.py
  class UnsupportedFeature (line 26) | class UnsupportedFeature(Exception):
  class ProtocolError (line 34) | class ProtocolError(Exception):
    method __init__ (line 36) | def __init__(self, message, data_buf = None, smb_message = None):
    method __str__ (line 41) | def __str__(self):
  class SMB2ProtocolHeaderError (line 55) | class SMB2ProtocolHeaderError(ProtocolError):
    method __init__ (line 57) | def __init__(self):
  class OperationFailure (line 60) | class OperationFailure(Exception):
    method __init__ (line 62) | def __init__(self, message, smb_messages):
    method __str__ (line 67) | def __str__(self):
  class SMBError (line 84) | class SMBError:
    method __init__ (line 86) | def __init__(self):
    method reset (line 89) | def reset(self):
    method __str__ (line 93) | def __str__(self):
    method hasError (line 100) | def hasError(self):
  class SMBMessage (line 104) | class SMBMessage:
    method __init__ (line 112) | def __init__(self, payload = None):
    method __str__ (line 118) | def __str__(self):
    method reset (line 133) | def reset(self):
    method isAsync (line 149) | def isAsync(self):
    method isReply (line 153) | def isReply(self):
    method hasExtendedSecurity (line 157) | def hasExtendedSecurity(self):
    method encode (line 160) | def encode(self):
    method decode (line 181) | def decode(self, buf):
    method _decodePayload (line 234) | def _decodePayload(self):
  class Payload (line 260) | class Payload:
    method initMessage (line 265) | def initMessage(self, message):
    method prepare (line 276) | def prepare(self, message):
    method decode (line 279) | def decode(self, message):
  class ComNegotiateRequest (line 283) | class ComNegotiateRequest(Payload):
    method initMessage (line 291) | def initMessage(self, message):
    method prepare (line 295) | def prepare(self, message):
  class ComNegotiateResponse (line 304) | class ComNegotiateResponse(Payload):
    method decode (line 339) | def decode(self, message):
    method supportsExtendedSecurity (line 395) | def supportsExtendedSecurity(self):
  class ComSessionSetupAndxRequest__WithSecurityExtension (line 399) | class ComSessionSetupAndxRequest__WithSecurityExtension(Payload):
    method __init__ (line 408) | def __init__(self, session_key, security_blob):
    method initMessage (line 412) | def initMessage(self, message):
    method prepare (line 416) | def prepare(self, message):
  class ComSessionSetupAndxRequest__NoSecurityExtension (line 434) | class ComSessionSetupAndxRequest__NoSecurityExtension(Payload):
    method __init__ (line 443) | def __init__(self, session_key, username, password, is_unicode, domain):
    method initMessage (line 450) | def initMessage(self, message):
    method prepare (line 454) | def prepare(self, message):
  class ComSessionSetupAndxResponse (line 490) | class ComSessionSetupAndxResponse(Payload):
    method decode (line 519) | def decode(self, message):
  class ComTreeConnectAndxRequest (line 539) | class ComTreeConnectAndxRequest(Payload):
    method __init__ (line 550) | def __init__(self, path, service, password = ''):
    method initMessage (line 555) | def initMessage(self, message):
    method prepare (line 559) | def prepare(self, message):
  class ComTreeConnectAndxResponse (line 577) | class ComTreeConnectAndxResponse(Payload):
    method decode (line 592) | def decode(self, message):
  class ComNTCreateAndxRequest (line 602) | class ComNTCreateAndxRequest(Payload):
    method __init__ (line 613) | def __init__(self, filename, flags = 0, root_fid = 0, access_mask = 0,...
    method initMessage (line 627) | def initMessage(self, message):
    method prepare (line 631) | def prepare(self, message):
  class ComNTCreateAndxResponse (line 657) | class ComNTCreateAndxResponse(Payload):
    method decode (line 672) | def decode(self, message):
  class ComTransactionRequest (line 682) | class ComTransactionRequest(Payload):
    method __init__ (line 692) | def __init__(self, max_params_count, max_data_count, max_setup_count,
    method initMessage (line 708) | def initMessage(self, message):
    method prepare (line 712) | def prepare(self, message):
  class ComTransactionResponse (line 768) | class ComTransactionResponse(Payload):
    method decode (line 787) | def decode(self, message):
  class ComTransaction2Request (line 822) | class ComTransaction2Request(Payload):
    method __init__ (line 832) | def __init__(self, max_params_count, max_data_count, max_setup_count,
    method initMessage (line 847) | def initMessage(self, message):
    method prepare (line 851) | def prepare(self, message):
  class ComTransaction2Response (line 904) | class ComTransaction2Response(Payload):
    method decode (line 923) | def decode(self, message):
  class ComCloseRequest (line 958) | class ComCloseRequest(Payload):
    method __init__ (line 968) | def __init__(self, fid, last_modified_time = 0xFFFFFFFF):
    method initMessage (line 972) | def initMessage(self, message):
    method prepare (line 976) | def prepare(self, message):
  class ComOpenAndxRequest (line 981) | class ComOpenAndxRequest(Payload):
    method __init__ (line 991) | def __init__(self, filename, access_mode, open_mode, flags = 0x0000, s...
    method initMessage (line 1007) | def initMessage(self, message):
    method prepare (line 1011) | def prepare(self, message):
  class ComOpenAndxResponse (line 1028) | class ComOpenAndxResponse(Payload):
    method decode (line 1049) | def decode(self, message):
  class ComWriteAndxRequest (line 1061) | class ComWriteAndxRequest(Payload):
    method __init__ (line 1072) | def __init__(self, fid, data_bytes, offset, write_mode = 0, timeout = 0):
    method initMessage (line 1083) | def initMessage(self, message):
    method prepare (line 1087) | def prepare(self, message):
  class ComWriteAndxResponse (line 1109) | class ComWriteAndxResponse(Payload):
    method decode (line 1120) | def decode(self, message):
  class ComReadAndxRequest (line 1131) | class ComReadAndxRequest(Payload):
    method __init__ (line 1142) | def __init__(self, fid, offset, max_return_bytes_count, min_return_byt...
    method initMessage (line 1154) | def initMessage(self, message):
    method prepare (line 1158) | def prepare(self, message):
  class ComReadAndxResponse (line 1173) | class ComReadAndxResponse(Payload):
    method decode (line 1184) | def decode(self, message):
  class ComDeleteRequest (line 1199) | class ComDeleteRequest(Payload):
    method __init__ (line 1206) | def __init__(self, filename_pattern, search_attributes = 0):
    method initMessage (line 1210) | def initMessage(self, message):
    method prepare (line 1214) | def prepare(self, message):
  class ComCreateDirectoryRequest (line 1219) | class ComCreateDirectoryRequest(Payload):
    method __init__ (line 1229) | def __init__(self, path):
    method initMessage (line 1232) | def initMessage(self, message):
    method prepare (line 1236) | def prepare(self, message):
  class ComDeleteDirectoryRequest (line 1241) | class ComDeleteDirectoryRequest(Payload):
    method __init__ (line 1248) | def __init__(self, path):
    method initMessage (line 1251) | def initMessage(self, message):
    method prepare (line 1255) | def prepare(self, message):
  class ComRenameRequest (line 1260) | class ComRenameRequest(Payload):
    method __init__ (line 1267) | def __init__(self, old_path, new_path, search_attributes = 0):
    method initMessage (line 1272) | def initMessage(self, message):
    method prepare (line 1276) | def prepare(self, message):
  class ComEchoRequest (line 1281) | class ComEchoRequest(Payload):
    method __init__ (line 1288) | def __init__(self, echo_data = b'', echo_count = 1):
    method initMessage (line 1292) | def initMessage(self, message):
    method prepare (line 1297) | def prepare(self, message):
  class ComEchoResponse (line 1302) | class ComEchoResponse(Payload):
    method decode (line 1309) | def decode(self, message):
  class ComNTTransactRequest (line 1314) | class ComNTTransactRequest(Payload):
    method __init__ (line 1323) | def __init__(self, function, max_params_count, max_data_count, max_set...
    method initMessage (line 1336) | def initMessage(self, message):
    method prepare (line 1340) | def prepare(self, message):
  class ComNTTransactResponse (line 1386) | class ComNTTransactResponse(Payload):
    method decode (line 1404) | def decode(self, message):

FILE: python3/smb/strategy.py
  class DataStrategyBase (line 1) | class DataStrategyBase():
  class DataFaultToleranceStrategy (line 5) | class DataFaultToleranceStrategy():
    method data_bytes_decode (line 7) | def data_bytes_decode(databytes):
  class DataStrategy (line 11) | class DataStrategy():
    method data_bytes_decode (line 13) | def data_bytes_decode(databytes):

FILE: python3/smb/utils/U32.py
  function norm (line 26) | def norm(n):
  class U32 (line 30) | class U32:
    method __init__ (line 34) | def __init__(self, value = 0):
    method set (line 38) | def set(self, value = 0):
    method __repr__ (line 42) | def __repr__(self):
    method __long__ (line 46) | def __long__(self): return int(norm(self.v))
    method __int__ (line 49) | def __int__(self): return int(norm(self.v))
    method __chr__ (line 54) | def __chr__(self): return chr(norm(self.v))
    method __add__ (line 57) | def __add__(self, b):
    method __sub__ (line 63) | def __sub__(self, b):
    method __mul__ (line 71) | def __mul__(self, b):
    method __div__ (line 77) | def __div__(self, b):
    method __mod__ (line 83) | def __mod__(self, b):
    method __neg__ (line 89) | def __neg__(self): return U32(self.v)
    method __pos__ (line 92) | def __pos__(self): return U32(self.v)
    method __abs__ (line 95) | def __abs__(self): return U32(self.v)
    method __invert__ (line 98) | def __invert__(self):
    method __lshift__ (line 104) | def __lshift__(self, b):
    method __rshift__ (line 110) | def __rshift__(self, b):
    method __and__ (line 116) | def __and__(self, b):
    method __or__ (line 122) | def __or__(self, b):
    method __xor__ (line 128) | def __xor__(self, b):
    method __not__ (line 134) | def __not__(self):
    method truth (line 138) | def truth(self):
    method __cmp__ (line 142) | def __cmp__(self, b):
    method __bool__ (line 148) | def __bool__(self):

FILE: python3/smb/utils/__init__.py
  function convertFILETIMEtoEpoch (line 2) | def convertFILETIMEtoEpoch(t):

FILE: python3/smb/utils/md4.py
  class MD4 (line 31) | class MD4:
    method __init__ (line 40) | def __init__(self):
    method __repr__ (line 51) | def __repr__(self):
    method make_copy (line 61) | def make_copy(self):
    method update (line 78) | def update(self, str):
    method digest (line 175) | def digest(self):
  function F (line 223) | def F(x, y, z): return (((x) & (y)) | ((~x) & (z)))
  function G (line 224) | def G(x, y, z): return (((x) & (y)) | ((x) & (z)) | ((y) & (z)))
  function H (line 225) | def H(x, y, z): return ((x) ^ (y) ^ (z))
  function ROL (line 227) | def ROL(x, n): return (((x) << n) | ((x) >> (32-n)))
  function f1 (line 229) | def f1(a, b, c, d, k, s, X): return ROL(a + F(b, c, d) + X[k], s)
  function f2 (line 230) | def f2(a, b, c, d, k, s, X): return ROL(a + G(b, c, d) + X[k] + U32(0x5a...
  function f3 (line 231) | def f3(a, b, c, d, k, s, X): return ROL(a + H(b, c, d) + X[k] + U32(0x6e...

FILE: python3/smb/utils/pyDes.py
  class _baseDes (line 107) | class _baseDes(object):
    method __init__ (line 108) | def __init__(self, mode=ECB, IV=None, pad=None, padmode=PAD_NORMAL):
    method getKey (line 126) | def getKey(self):
    method setKey (line 130) | def setKey(self, key):
    method getMode (line 135) | def getMode(self):
    method setMode (line 139) | def setMode(self, mode):
    method getPadding (line 143) | def getPadding(self):
    method setPadding (line 147) | def setPadding(self, pad):
    method getPadMode (line 153) | def getPadMode(self):
    method setPadMode (line 157) | def setPadMode(self, mode):
    method getIV (line 161) | def getIV(self):
    method setIV (line 165) | def setIV(self, IV):
    method _padData (line 172) | def _padData(self, data, pad, padmode):
    method _unpadData (line 201) | def _unpadData(self, data, pad, padmode):
    method _guardAgainstUnicode (line 228) | def _guardAgainstUnicode(self, data):
  class des (line 247) | class des(_baseDes):
    method __init__ (line 397) | def __init__(self, key, mode=ECB, IV=None, pad=None, padmode=PAD_NORMAL):
    method setKey (line 411) | def setKey(self, key):
    method __String_to_BitList (line 416) | def __String_to_BitList(self, data):
    method __BitList_to_String (line 437) | def __BitList_to_String(self, data):
    method __permutate (line 454) | def __permutate(self, table, block):
    method __create_sub_keys (line 460) | def __create_sub_keys(self):
    method __des_crypt (line 485) | def __des_crypt(self, block, crypt_type):
    method crypt (line 564) | def crypt(self, data, crypt_type):
    method encrypt (line 642) | def encrypt(self, data, pad=None, padmode=None):
    method decrypt (line 661) | def decrypt(self, data, pad=None, padmode=None):
  class triple_des (line 687) | class triple_des(_baseDes):
    method __init__ (line 708) | def __init__(self, key, mode=ECB, IV=None, pad=None, padmode=PAD_NORMAL):
    method setKey (line 712) | def setKey(self, key):
    method setMode (line 739) | def setMode(self, mode):
    method setPadding (line 745) | def setPadding(self, pad):
    method setPadMode (line 751) | def setPadMode(self, mode):
    method setIV (line 757) | def setIV(self, IV):
    method encrypt (line 763) | def encrypt(self, data, pad=None, padmode=None):
    method decrypt (line 807) | def decrypt(self, data, pad=None, padmode=None):

FILE: python3/smb/utils/rc4.py
  function RC4_encrypt (line 2) | def RC4_encrypt(key, data):

FILE: python3/smb/utils/sha256.py
  function new (line 9) | def new(m=None):
  class sha256 (line 12) | class sha256(object):
    method __init__ (line 37) | def __init__(self, m=None):
    method _rotr (line 46) | def _rotr(self, x, y):
    method _sha256_process (line 49) | def _sha256_process(self, c):
    method update (line 79) | def update(self, m):
    method digest (line 92) | def digest(self):
    method hexdigest (line 105) | def hexdigest(self):
    method copy (line 108) | def copy(self):

FILE: python3/tests/DirectSMBConnectionTests/test_auth.py
  function teardown_func (line 9) | def teardown_func():
  function test_NTLMv1_auth_SMB1 (line 19) | def test_NTLMv1_auth_SMB1():
  function test_NTLMv1_auth_SMB1_callable_password (line 33) | def test_NTLMv1_auth_SMB1_callable_password():
  function test_NTLMv2_auth_SMB1 (line 47) | def test_NTLMv2_auth_SMB1():
  function test_NTLMv1_auth_SMB2 (line 61) | def test_NTLMv1_auth_SMB2():
  function test_NTLMv2_auth_SMB2 (line 75) | def test_NTLMv2_auth_SMB2():

FILE: python3/tests/DirectSMBConnectionTests/test_createdeletedirectory.py
  function setup_func_SMB1 (line 11) | def setup_func_SMB1():
  function setup_func_SMB2 (line 19) | def setup_func_SMB2():
  function teardown_func (line 27) | def teardown_func():
  function test_english_directory_SMB1 (line 33) | def test_english_directory_SMB1():
  function test_english_directory_SMB2 (line 51) | def test_english_directory_SMB2():
  function test_unicode_directory_SMB1 (line 69) | def test_unicode_directory_SMB1():
  function test_unicode_directory_SMB2 (line 87) | def test_unicode_directory_SMB2():

FILE: python3/tests/DirectSMBConnectionTests/test_echo.py
  function setup_func (line 9) | def setup_func():
  function teardown_func (line 15) | def teardown_func():
  function test_echo (line 21) | def test_echo():

FILE: python3/tests/DirectSMBConnectionTests/test_listpath.py
  function setup_func_SMB1 (line 11) | def setup_func_SMB1():
  function setup_func_SMB2 (line 18) | def setup_func_SMB2():
  function teardown_func (line 25) | def teardown_func():
  function test_listPath_SMB1 (line 31) | def test_listPath_SMB1():
  function test_listSubPath_SMB1 (line 43) | def test_listSubPath_SMB1():
  function test_listPathWithManyFiles_SMB1 (line 53) | def test_listPathWithManyFiles_SMB1():
  function test_listPath_SMB2 (line 61) | def test_listPath_SMB2():
  function test_listSubPath_SMB2 (line 73) | def test_listSubPath_SMB2():
  function test_listPathWithManyFiles_SMB2 (line 83) | def test_listPathWithManyFiles_SMB2():
  function test_listPathFilterForDirectory_SMB1 (line 91) | def test_listPathFilterForDirectory_SMB1():
  function test_listPathFilterForDirectory_SMB2 (line 101) | def test_listPathFilterForDirectory_SMB2():
  function test_listPathFilterForFiles_SMB1 (line 111) | def test_listPathFilterForFiles_SMB1():
  function test_listPathFilterForFiles_SMB2 (line 121) | def test_listPathFilterForFiles_SMB2():
  function test_listPathFilterPattern_SMB1 (line 132) | def test_listPathFilterPattern_SMB1():
  function test_listPathFilterPattern_SMB2 (line 143) | def test_listPathFilterPattern_SMB2():
  function test_listPathFilterUnicodePattern_SMB1 (line 154) | def test_listPathFilterUnicodePattern_SMB1():
  function test_listPathFilterUnicodePattern_SMB2 (line 165) | def test_listPathFilterUnicodePattern_SMB2():

FILE: python3/tests/DirectSMBConnectionTests/test_listshares.py
  function setup_func_SMB1 (line 9) | def setup_func_SMB1():
  function setup_func_SMB2 (line 16) | def setup_func_SMB2():
  function teardown_func (line 23) | def teardown_func():
  function test_listshares_SMB1 (line 29) | def test_listshares_SMB1():
  function test_listshares_SMB2 (line 36) | def test_listshares_SMB2():

FILE: python3/tests/DirectSMBConnectionTests/test_listsnapshots.py
  function setup_func_SMB1 (line 9) | def setup_func_SMB1():
  function setup_func_SMB2 (line 16) | def setup_func_SMB2():
  function teardown_func (line 23) | def teardown_func():
  function test_listsnapshots_SMB1 (line 29) | def test_listsnapshots_SMB1():
  function test_listsnapshots_SMB2 (line 36) | def test_listsnapshots_SMB2():

FILE: python3/tests/DirectSMBConnectionTests/test_rename.py
  function setup_func_SMB1 (line 12) | def setup_func_SMB1():
  function setup_func_SMB2 (line 19) | def setup_func_SMB2():
  function teardown_func (line 26) | def teardown_func():
  function test_rename_english_file_SMB1 (line 32) | def test_rename_english_file_SMB1():
  function test_rename_english_file_SMB2 (line 56) | def test_rename_english_file_SMB2():
  function test_rename_unicode_file_SMB1 (line 80) | def test_rename_unicode_file_SMB1():
  function test_rename_unicode_file_SMB2 (line 104) | def test_rename_unicode_file_SMB2():
  function test_rename_english_directory_SMB1 (line 128) | def test_rename_english_directory_SMB1():
  function test_rename_english_directory_SMB2 (line 152) | def test_rename_english_directory_SMB2():
  function test_rename_unicode_directory_SMB1 (line 176) | def test_rename_unicode_directory_SMB1():
  function test_rename_unicode_directory_SMB2 (line 200) | def test_rename_unicode_directory_SMB2():

FILE: python3/tests/DirectSMBConnectionTests/test_retrievefile.py
  function MD5 (line 12) | def MD5(): return hashlib.md5()
  function MD5 (line 15) | def MD5(): return md5.new()
  function setup_func_SMB1 (line 19) | def setup_func_SMB1():
  function setup_func_SMB2 (line 26) | def setup_func_SMB2():
  function teardown_func (line 33) | def teardown_func():
  function test_retr_multiplereads_SMB1 (line 39) | def test_retr_multiplereads_SMB1():
  function test_retr_multiplereads_SMB2 (line 54) | def test_retr_multiplereads_SMB2():
  function test_retr_longfilename_SMB1 (line 69) | def test_retr_longfilename_SMB1():
  function test_retr_longfilename_SMB2 (line 84) | def test_retr_longfilename_SMB2():
  function test_retr_unicodefilename_SMB1 (line 99) | def test_retr_unicodefilename_SMB1():
  function test_retr_unicodefilename_SMB2 (line 114) | def test_retr_unicodefilename_SMB2():
  function test_retr_offset_SMB1 (line 129) | def test_retr_offset_SMB1():
  function test_retr_offset_SMB2 (line 144) | def test_retr_offset_SMB2():
  function test_retr_offset_and_biglimit_SMB1 (line 159) | def test_retr_offset_and_biglimit_SMB1():
  function test_retr_offset_and_biglimit_SMB2 (line 174) | def test_retr_offset_and_biglimit_SMB2():
  function test_retr_offset_and_smalllimit_SMB1 (line 189) | def test_retr_offset_and_smalllimit_SMB1():
  function test_retr_offset_and_smalllimit_SMB2 (line 204) | def test_retr_offset_and_smalllimit_SMB2():
  function test_retr_offset_and_zerolimit_SMB1 (line 219) | def test_retr_offset_and_zerolimit_SMB1():
  function test_retr_offset_and_zerolimit_SMB2 (line 234) | def test_retr_offset_and_zerolimit_SMB2():

FILE: python3/tests/DirectSMBConnectionTests/test_storefile.py
  function MD5 (line 12) | def MD5(): return hashlib.md5()
  function MD5 (line 15) | def MD5(): return md5.new()
  function setup_func_SMB1 (line 23) | def setup_func_SMB1():
  function setup_func_SMB2 (line 31) | def setup_func_SMB2():
  function teardown_func (line 39) | def teardown_func():
  function test_store_long_filename_SMB1 (line 46) | def test_store_long_filename_SMB1():
  function test_store_long_filename_SMB2 (line 70) | def test_store_long_filename_SMB2():
  function test_store_unicode_filename_SMB1 (line 94) | def test_store_unicode_filename_SMB1():
  function test_store_unicode_filename_SMB2 (line 118) | def test_store_unicode_filename_SMB2():

FILE: python3/tests/DirectSMBConnectionTests/test_tqdm.py
  function MD5 (line 12) | def MD5(): return hashlib.md5()
  function MD5 (line 15) | def MD5(): return md5.new()
  function setup_func_SMB1 (line 18) | def setup_func_SMB1():
  function setup_func_SMB2 (line 25) | def setup_func_SMB2():
  function teardown_func (line 32) | def teardown_func():
  function test_retr_tqdm_SMB1 (line 39) | def test_retr_tqdm_SMB1():
  function test_retr_tqdm_SMB2 (line 54) | def test_retr_tqdm_SMB2():
  function test_store_tqdm_SMB1 (line 73) | def test_store_tqdm_SMB1():
  function test_store_tqdm_SMB2 (line 96) | def test_store_tqdm_SMB2():

FILE: python3/tests/DirectSMBConnectionTests/util.py
  function getConnectionInfo (line 5) | def getConnectionInfo():

FILE: python3/tests/NetBIOSTests/test_queryname.py
  function teardown_func (line 7) | def teardown_func():
  function test_broadcast (line 12) | def test_broadcast():

FILE: python3/tests/SMBConnectionTests/test_SMBHandler.py
  function MD5 (line 10) | def MD5(): return hashlib.md5()
  function MD5 (line 13) | def MD5(): return md5.new()
  function test_basic (line 17) | def test_basic():
  function test_unicode (line 31) | def test_unicode():
  function test_upload (line 50) | def test_upload():

FILE: python3/tests/SMBConnectionTests/test_auth.py
  function teardown_func (line 9) | def teardown_func():
  function test_NTLMv1_auth_SMB1 (line 14) | def test_NTLMv1_auth_SMB1():
  function test_NTLMv2_auth_SMB1 (line 22) | def test_NTLMv2_auth_SMB1():
  function test_NTLMv1_auth_SMB2 (line 30) | def test_NTLMv1_auth_SMB2():
  function test_NTLMv2_auth_SMB2 (line 38) | def test_NTLMv2_auth_SMB2():

FILE: python3/tests/SMBConnectionTests/test_createdeletedirectory.py
  function setup_func_SMB1 (line 11) | def setup_func_SMB1():
  function setup_func_SMB2 (line 19) | def setup_func_SMB2():
  function teardown_func (line 27) | def teardown_func():
  function test_english_directory_SMB1 (line 33) | def test_english_directory_SMB1():
  function test_english_directory_SMB2 (line 51) | def test_english_directory_SMB2():
  function test_unicode_directory_SMB1 (line 69) | def test_unicode_directory_SMB1():
  function test_unicode_directory_SMB2 (line 87) | def test_unicode_directory_SMB2():

FILE: python3/tests/SMBConnectionTests/test_deletepattern.py
  function setup_func_SMB1 (line 12) | def setup_func_SMB1():
  function setup_func_SMB2 (line 20) | def setup_func_SMB2():
  function teardown_func (line 28) | def teardown_func():
  function test_delete_without_subfolder_SMB1 (line 34) | def test_delete_without_subfolder_SMB1():
  function test_delete_with_subfolder_SMB1 (line 83) | def test_delete_with_subfolder_SMB1():
  function test_delete_without_subfolder_SMB2 (line 132) | def test_delete_without_subfolder_SMB2():
  function test_delete_with_subfolder_SMB2 (line 180) | def test_delete_with_subfolder_SMB2():

FILE: python3/tests/SMBConnectionTests/test_echo.py
  function setup_func (line 9) | def setup_func():
  function teardown_func (line 15) | def teardown_func():
  function test_echo (line 21) | def test_echo():

FILE: python3/tests/SMBConnectionTests/test_getattributes.py
  function setup_func_SMB1 (line 10) | def setup_func_SMB1():
  function setup_func_SMB2 (line 17) | def setup_func_SMB2():
  function teardown_func (line 24) | def teardown_func():
  function test_getAttributes_SMB2 (line 30) | def test_getAttributes_SMB2():
  function test_getAttributes_SMB1 (line 45) | def test_getAttributes_SMB1():

FILE: python3/tests/SMBConnectionTests/test_listpath.py
  function setup_func_SMB1 (line 11) | def setup_func_SMB1():
  function setup_func_SMB2 (line 18) | def setup_func_SMB2():
  function teardown_func (line 25) | def teardown_func():
  function test_listPath_SMB1 (line 31) | def test_listPath_SMB1():
  function test_listSubPath_SMB1 (line 43) | def test_listSubPath_SMB1():
  function test_listPathWithManyFiles_SMB1 (line 53) | def test_listPathWithManyFiles_SMB1():
  function test_listPath_SMB2 (line 61) | def test_listPath_SMB2():
  function test_listSubPath_SMB2 (line 73) | def test_listSubPath_SMB2():
  function test_listPathWithManyFiles_SMB2 (line 83) | def test_listPathWithManyFiles_SMB2():
  function test_listPathFilterForDirectory_SMB1 (line 91) | def test_listPathFilterForDirectory_SMB1():
  function test_listPathFilterForDirectory_SMB2 (line 101) | def test_listPathFilterForDirectory_SMB2():
  function test_listPathFilterForFiles_SMB1 (line 111) | def test_listPathFilterForFiles_SMB1():
  function test_listPathFilterForFiles_SMB2 (line 121) | def test_listPathFilterForFiles_SMB2():
  function test_listPathFilterPattern_SMB1 (line 131) | def test_listPathFilterPattern_SMB1():
  function test_listPathFilterPattern_SMB2 (line 142) | def test_listPathFilterPattern_SMB2():
  function test_listPathFilterUnicodePattern_SMB1 (line 153) | def test_listPathFilterUnicodePattern_SMB1():
  function test_listPathFilterUnicodePattern_SMB2 (line 164) | def test_listPathFilterUnicodePattern_SMB2():
  function test_listPathFilterEmptyList_SMB1 (line 175) | def test_listPathFilterEmptyList_SMB1():
  function test_listPathFilterEmptyList_SMB2 (line 182) | def test_listPathFilterEmptyList_SMB2():

FILE: python3/tests/SMBConnectionTests/test_listshares.py
  function setup_func_SMB1 (line 9) | def setup_func_SMB1():
  function setup_func_SMB2 (line 16) | def setup_func_SMB2():
  function teardown_func (line 23) | def teardown_func():
  function test_listshares_SMB1 (line 29) | def test_listshares_SMB1():
  function test_listshares_SMB2 (line 36) | def test_listshares_SMB2():

FILE: python3/tests/SMBConnectionTests/test_listsnapshots.py
  function setup_func_SMB1 (line 9) | def setup_func_SMB1():
  function setup_func_SMB2 (line 16) | def setup_func_SMB2():
  function teardown_func (line 23) | def teardown_func():
  function test_listsnapshots_SMB1 (line 29) | def test_listsnapshots_SMB1():
  function test_listsnapshots_SMB2 (line 36) | def test_listsnapshots_SMB2():

FILE: python3/tests/SMBConnectionTests/test_messages_in_exception.py
  function setup_func_SMB2 (line 17) | def setup_func_SMB2():
  function teardown_func (line 26) | def teardown_func():
  function test_messages_in_exception_SMB2 (line 33) | def test_messages_in_exception_SMB2():

FILE: python3/tests/SMBConnectionTests/test_rename.py
  function setup_func_SMB1 (line 12) | def setup_func_SMB1():
  function setup_func_SMB2 (line 19) | def setup_func_SMB2():
  function teardown_func (line 26) | def teardown_func():
  function test_rename_english_file_SMB1 (line 32) | def test_rename_english_file_SMB1():
  function test_rename_english_file_SMB2 (line 56) | def test_rename_english_file_SMB2():
  function test_rename_unicode_file_SMB1 (line 80) | def test_rename_unicode_file_SMB1():
  function test_rename_unicode_file_SMB2 (line 104) | def test_rename_unicode_file_SMB2():
  function test_rename_english_directory_SMB1 (line 128) | def test_rename_english_directory_SMB1():
  function test_rename_english_directory_SMB2 (line 152) | def test_rename_english_directory_SMB2():
  function test_rename_unicode_directory_SMB1 (line 176) | def test_rename_unicode_directory_SMB1():
  function test_rename_unicode_directory_SMB2 (line 200) | def test_rename_unicode_directory_SMB2():

FILE: python3/tests/SMBConnectionTests/test_retrievefile.py
  function MD5 (line 12) | def MD5(): return hashlib.md5()
  function MD5 (line 15) | def MD5(): return md5.new()
  function setup_func_SMB1 (line 19) | def setup_func_SMB1():
  function setup_func_SMB2 (line 26) | def setup_func_SMB2():
  function teardown_func (line 33) | def teardown_func():
  function test_retr_multiplereads_SMB1 (line 39) | def test_retr_multiplereads_SMB1():
  function test_retr_multiplereads_SMB2 (line 54) | def test_retr_multiplereads_SMB2():
  function test_retr_longfilename_SMB1 (line 69) | def test_retr_longfilename_SMB1():
  function test_retr_longfilename_SMB2 (line 84) | def test_retr_longfilename_SMB2():
  function test_retr_unicodefilename_SMB1 (line 99) | def test_retr_unicodefilename_SMB1():
  function test_retr_unicodefilename_SMB2 (line 114) | def test_retr_unicodefilename_SMB2():
  function test_retr_offset_SMB1 (line 129) | def test_retr_offset_SMB1():
  function test_retr_offset_SMB2 (line 144) | def test_retr_offset_SMB2():
  function test_retr_offset_and_biglimit_SMB1 (line 159) | def test_retr_offset_and_biglimit_SMB1():
  function test_retr_offset_and_biglimit_SMB2 (line 174) | def test_retr_offset_and_biglimit_SMB2():
  function test_retr_offset_and_smalllimit_SMB1 (line 189) | def test_retr_offset_and_smalllimit_SMB1():
  function test_retr_offset_and_smalllimit_SMB2 (line 204) | def test_retr_offset_and_smalllimit_SMB2():
  function test_retr_offset_and_zerolimit_SMB1 (line 219) | def test_retr_offset_and_zerolimit_SMB1():
  function test_retr_offset_and_zerolimit_SMB2 (line 234) | def test_retr_offset_and_zerolimit_SMB2():

FILE: python3/tests/SMBConnectionTests/test_storefile.py
  function MD5 (line 12) | def MD5(): return hashlib.md5()
  function MD5 (line 15) | def MD5(): return md5.new()
  function setup_func_SMB1 (line 23) | def setup_func_SMB1():
  function setup_func_SMB2 (line 31) | def setup_func_SMB2():
  function teardown_func (line 39) | def teardown_func():
  function test_store_long_filename_SMB1 (line 46) | def test_store_long_filename_SMB1():
  function test_store_long_filename_SMB2 (line 70) | def test_store_long_filename_SMB2():
  function test_store_unicode_filename_SMB1 (line 94) | def test_store_unicode_filename_SMB1():
  function test_store_from_offset_SMB1 (line 118) | def test_store_from_offset_SMB1():
  function test_store_unicode_filename_SMB2 (line 139) | def test_store_unicode_filename_SMB2():
  function test_store_from_offset_SMB2 (line 162) | def test_store_from_offset_SMB2():

FILE: python3/tests/SMBConnectionTests/test_with_context.py
  function test_context (line 6) | def test_context():

FILE: python3/tests/SMBConnectionTests/util.py
  function getConnectionInfo (line 5) | def getConnectionInfo():

FILE: python3/tests/test_md4.py
  function test_md4 (line 20) | def test_md4():

FILE: python3/tests/test_ntlm.py
  function test_NTLMv1_without_extended_security (line 5) | def test_NTLMv1_without_extended_security():
  function test_NTLMv1_with_extended_security (line 18) | def test_NTLMv1_with_extended_security():
  function test_NTLMv2 (line 31) | def test_NTLMv2():

FILE: python3/tests/test_security_descriptors.py
  function test_sid_string_representation (line 7) | def test_sid_string_representation():
  function test_sid_binary_parsing (line 16) | def test_sid_binary_parsing():
  function test_ace_binary_parsing (line 29) | def test_ace_binary_parsing():
  function test_acl_binary_parsing (line 76) | def test_acl_binary_parsing():
  function test_descriptor_binary_parsing (line 109) | def test_descriptor_binary_parsing():

FILE: python3/tests/test_securityblob.py
  function test_NTLMSSP_NEGOTIATE_encoding (line 6) | def test_NTLMSSP_NEGOTIATE_encoding():
  function test_NTLMSSP_CHALLENGE_decoding (line 21) | def test_NTLMSSP_CHALLENGE_decoding():
  function test_NTLMSSP_AUTH_encoding (line 57) | def test_NTLMSSP_AUTH_encoding():
  function test_auth_response_decoding (line 87) | def test_auth_response_decoding():

FILE: utils/ScanNetworkForSMB.py
  class NonBlockingNetBIOS (line 29) | class NonBlockingNetBIOS(base.NBNS):
    method __init__ (line 31) | def __init__(self):
    method write (line 38) | def write(self, data, ip, port):
    method queryIPForName (line 42) | def queryIPForName(self, ip):
    method queryResult (line 51) | def queryResult(self, ip, results):
    method poll (line 56) | def poll(self, timeout = 0):
  function DottedIPToInt (line 83) | def DottedIPToInt(dotted_ip):
  function IntToDottedIP (line 91) | def IntToDottedIP( intip ):
  function main (line 98) | def main():

FILE: utils/recursiveDelete.py
  function walk_path (line 19) | def walk_path(path):
Condensed preview — 254 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (3,708K chars).
[
  {
    "path": ".gitignore",
    "chars": 2284,
    "preview": "# Ignore per-file backup from text editors\n*~\n\n# For virtualenvs in development\n/venv2\n/venv3\n\n#\n# From https://github.c"
  },
  {
    "path": ".readthedocs.yaml",
    "chars": 1039,
    "preview": "# Read the Docs configuration file for Sphinx projects\n# See https://docs.readthedocs.io/en/stable/config-file/v2.html f"
  },
  {
    "path": "CHANGELOG",
    "chars": 15995,
    "preview": "pysmb-1.2.13, 20 Sep 2025\n=========================\n\n- Fix type hinting issues on Python versions prior to 3.9. (#230)\n\n"
  },
  {
    "path": "LICENSE",
    "chars": 882,
    "preview": "\nCopyright (C) 2001-2025 Michael Teo <miketeo (a) miketeo.net>\n\nThis software is provided 'as-is', without any express o"
  },
  {
    "path": "MANIFEST.in",
    "chars": 293,
    "preview": "include LICENSE\ninclude CHANGELOG\nrecursive-include python2 *\nrecursive-exclude python2 *.pyc\nrecursive-exclude python2 "
  },
  {
    "path": "README.md",
    "chars": 500,
    "preview": "pysmb\n=====\n\npysmb is an experimental SMB/CIFS library written in Python. It implements the client-side SMB/CIFS protoco"
  },
  {
    "path": "README.txt",
    "chars": 273,
    "preview": "pysmb is an experimental SMB/CIFS library written in Python.\nIt implements the client-side SMB/CIFS protocol (SMB1 and S"
  },
  {
    "path": "docs/html/.buildinfo",
    "chars": 230,
    "preview": "# Sphinx build info version 1\n# This file hashes the configuration used when building these files. When it is not found,"
  },
  {
    "path": "docs/html/_modules/index.html",
    "chars": 3380,
    "preview": "<!DOCTYPE html>\n\n<html lang=\"en\" data-content_root=\"../\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <meta name=\"viewport"
  },
  {
    "path": "docs/html/_modules/nmb/NetBIOS.html",
    "chars": 25807,
    "preview": "<!DOCTYPE html>\n\n<html lang=\"en\" data-content_root=\"../../\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <meta name=\"viewp"
  },
  {
    "path": "docs/html/_modules/nmb/NetBIOSProtocol.html",
    "chars": 25564,
    "preview": "\n<!DOCTYPE html>\n\n<html>\n  <head>\n    <meta charset=\"utf-8\" />\n    <meta name=\"viewport\" content=\"width=device-width, in"
  },
  {
    "path": "docs/html/_modules/smb/SMBConnection.html",
    "chars": 89941,
    "preview": "\n<!DOCTYPE html>\n\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <meta name=\"viewport\" content=\"width=device"
  },
  {
    "path": "docs/html/_modules/smb/SMBProtocol.html",
    "chars": 63369,
    "preview": "\n<!DOCTYPE html>\n\n<html>\n  <head>\n    <meta charset=\"utf-8\" />\n    <meta name=\"viewport\" content=\"width=device-width, in"
  },
  {
    "path": "docs/html/_modules/smb/base.html",
    "chars": 695036,
    "preview": "\n<!DOCTYPE html>\n\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <meta name=\"viewport\" content=\"width=device"
  },
  {
    "path": "docs/html/_modules/smb/security_descriptors.html",
    "chars": 49302,
    "preview": "<!DOCTYPE html>\n\n<html lang=\"en\" data-content_root=\"../../\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <meta name=\"viewp"
  },
  {
    "path": "docs/html/_modules/smb/smb_structs.html",
    "chars": 223926,
    "preview": "<!DOCTYPE html>\n\n<html lang=\"en\" data-content_root=\"../../\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <meta name=\"viewp"
  },
  {
    "path": "docs/html/_sources/api/nmb_NBNSProtocol.rst.txt",
    "chars": 784,
    "preview": "\nNBNSProtocol Class\n==================\n\npysmb has a *NBNSProtocol* implementation for Twisted framework.\nThis allows you"
  },
  {
    "path": "docs/html/_sources/api/nmb_NBNSProtocol.txt",
    "chars": 784,
    "preview": "\nNBNSProtocol Class\n==================\n\npysmb has a *NBNSProtocol* implementation for Twisted framework.\nThis allows you"
  },
  {
    "path": "docs/html/_sources/api/nmb_NetBIOS.rst.txt",
    "chars": 423,
    "preview": "\nNetBIOS class\n=============\n\nTo use the NetBIOS class in your application,\n 1. Create a new NetBIOS instance\n 2. Call *"
  },
  {
    "path": "docs/html/_sources/api/nmb_NetBIOS.txt",
    "chars": 423,
    "preview": "\nNetBIOS class\n=============\n\nTo use the NetBIOS class in your application,\n 1. Create a new NetBIOS instance\n 2. Call *"
  },
  {
    "path": "docs/html/_sources/api/smb_SMBConnection.rst.txt",
    "chars": 2310,
    "preview": "\nSMBConnection Class\n===================\n\nThe SMBConnection is suitable for developers who wish to use pysmb to perform "
  },
  {
    "path": "docs/html/_sources/api/smb_SMBConnection.txt",
    "chars": 2310,
    "preview": "\nSMBConnection Class\n===================\n\nThe SMBConnection is suitable for developers who wish to use pysmb to perform "
  },
  {
    "path": "docs/html/_sources/api/smb_SMBHandler.rst.txt",
    "chars": 3194,
    "preview": "\nSMbHandler Class\n================\n\nThe SMBHandler class provides support for \"smb://\" URLs in the `urllib2 <http://docs"
  },
  {
    "path": "docs/html/_sources/api/smb_SMBHandler.txt",
    "chars": 3194,
    "preview": "\nSMbHandler Class\n================\n\nThe SMBHandler class provides support for \"smb://\" URLs in the `urllib2 <http://docs"
  },
  {
    "path": "docs/html/_sources/api/smb_SMBProtocolFactory.rst.txt",
    "chars": 4932,
    "preview": "\nSMBProtocolFactory Class\n========================\n\nFor those who want to utilize pysmb in Twisted framework, pysmb has "
  },
  {
    "path": "docs/html/_sources/api/smb_SMBProtocolFactory.txt",
    "chars": 4932,
    "preview": "\nSMBProtocolFactory Class\n========================\n\nFor those who want to utilize pysmb in Twisted framework, pysmb has "
  },
  {
    "path": "docs/html/_sources/api/smb_SharedDevice.rst.txt",
    "chars": 91,
    "preview": "\nSharedDevice Class\n==================\n\n.. autoclass:: smb.base.SharedDevice\n    :members:\n"
  },
  {
    "path": "docs/html/_sources/api/smb_SharedDevice.txt",
    "chars": 91,
    "preview": "\nSharedDevice Class\n==================\n\n.. autoclass:: smb.base.SharedDevice\n    :members:\n"
  },
  {
    "path": "docs/html/_sources/api/smb_SharedFile.rst.txt",
    "chars": 85,
    "preview": "\nSharedFile Class\n================\n\n.. autoclass:: smb.base.SharedFile\n    :members:\n"
  },
  {
    "path": "docs/html/_sources/api/smb_SharedFile.txt",
    "chars": 85,
    "preview": "\nSharedFile Class\n================\n\n.. autoclass:: smb.base.SharedFile\n    :members:\n"
  },
  {
    "path": "docs/html/_sources/api/smb_exceptions.rst.txt",
    "chars": 379,
    "preview": "\nSMB Exceptions\n==============\n\n.. autoclass:: smb.base.SMBTimeout\n    :members:\n\n.. autoclass:: smb.base.NotReadyError\n"
  },
  {
    "path": "docs/html/_sources/api/smb_exceptions.txt",
    "chars": 379,
    "preview": "\nSMB Exceptions\n==============\n\n.. autoclass:: smb.base.SMBTimeout\n    :members:\n\n.. autoclass:: smb.base.NotReadyError\n"
  },
  {
    "path": "docs/html/_sources/api/smb_security_descriptors.rst.txt",
    "chars": 475,
    "preview": "\nSecurity Descriptors\n====================\n\n.. module:: smb.security_descriptors\n   :synopsis: Data structures used in W"
  },
  {
    "path": "docs/html/_sources/api/smb_security_descriptors.txt",
    "chars": 475,
    "preview": "\nSecurity Descriptors\n====================\n\n.. module:: smb.security_descriptors\n   :synopsis: Data structures used in W"
  },
  {
    "path": "docs/html/_sources/extending.rst.txt",
    "chars": 1716,
    "preview": "\nExtending pysmb For Other Frameworks\n====================================\n\nThis page briefly describes the steps involv"
  },
  {
    "path": "docs/html/_sources/extending.txt",
    "chars": 1714,
    "preview": "\nExtending pysmb For Other Frameworks\n====================================\n\nThis page briefly describes the steps involv"
  },
  {
    "path": "docs/html/_sources/index.rst.txt",
    "chars": 5820,
    "preview": "Welcome to pysmb's documentation!\n=================================\n\npysmb is a pure Python implementation of the client"
  },
  {
    "path": "docs/html/_sources/index.txt",
    "chars": 6055,
    "preview": ".. pysmb documentation master file, created by\n   sphinx-quickstart on Sun Dec 18 15:54:40 2011.\n   You can adapt this f"
  },
  {
    "path": "docs/html/_sources/upgrading.rst.txt",
    "chars": 2807,
    "preview": "Upgrading from older pysmb versions\n====================================\n\nThis page documents the improvements and chang"
  },
  {
    "path": "docs/html/_sources/upgrading.txt",
    "chars": 2807,
    "preview": "Upgrading from older pysmb versions\n====================================\n\nThis page documents the improvements and chang"
  },
  {
    "path": "docs/html/_static/_sphinx_javascript_frameworks_compat.js",
    "chars": 4418,
    "preview": "/*\n * _sphinx_javascript_frameworks_compat.js\n * ~~~~~~~~~~\n *\n * Compatability shim for jQuery and underscores.js.\n *\n "
  },
  {
    "path": "docs/html/_static/basic.css",
    "chars": 15094,
    "preview": "/*\n * basic.css\n * ~~~~~~~~~\n *\n * Sphinx stylesheet -- basic theme.\n *\n * :copyright: Copyright 2007-2023 by the Sphinx"
  },
  {
    "path": "docs/html/_static/doctools.js",
    "chars": 4472,
    "preview": "/*\n * doctools.js\n * ~~~~~~~~~~~\n *\n * Base JavaScript utilities for all Sphinx HTML documentation.\n *\n * :copyright: Co"
  },
  {
    "path": "docs/html/_static/documentation_options.js",
    "chars": 329,
    "preview": "const DOCUMENTATION_OPTIONS = {\n    VERSION: '1.2.13',\n    LANGUAGE: 'en',\n    COLLAPSE_INDEX: false,\n    BUILDER: 'html"
  },
  {
    "path": "docs/html/_static/jquery-3.5.1.js",
    "chars": 287630,
    "preview": "/*!\n * jQuery JavaScript Library v3.5.1\n * https://jquery.com/\n *\n * Includes Sizzle.js\n * https://sizzlejs.com/\n *\n * C"
  },
  {
    "path": "docs/html/_static/jquery-3.6.0.js",
    "chars": 288580,
    "preview": "/*!\n * jQuery JavaScript Library v3.6.0\n * https://jquery.com/\n *\n * Includes Sizzle.js\n * https://sizzlejs.com/\n *\n * C"
  },
  {
    "path": "docs/html/_static/jquery.js",
    "chars": 89501,
    "preview": "/*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */\n!function(e,t){\"use strict\";\"ob"
  },
  {
    "path": "docs/html/_static/language_data.js",
    "chars": 4758,
    "preview": "/*\n * language_data.js\n * ~~~~~~~~~~~~~~~~\n *\n * This script contains the language-specific data used by searchtools.js,"
  },
  {
    "path": "docs/html/_static/pygments.css",
    "chars": 4929,
    "preview": "pre { line-height: 125%; }\ntd.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; paddin"
  },
  {
    "path": "docs/html/_static/searchtools.js",
    "chars": 18931,
    "preview": "/*\n * searchtools.js\n * ~~~~~~~~~~~~~~~~\n *\n * Sphinx JavaScript utilities for the full-text search.\n *\n * :copyright: C"
  },
  {
    "path": "docs/html/_static/sphinx_highlight.js",
    "chars": 5123,
    "preview": "/* Highlighting utilities for Sphinx HTML documentation. */\n\"use strict\";\n\nconst SPHINX_HIGHLIGHT_ENABLED = true\n\n/**\n *"
  },
  {
    "path": "docs/html/_static/sphinxdoc.css",
    "chars": 6298,
    "preview": "/*\n * sphinxdoc.css_t\n * ~~~~~~~~~~~~~~~\n *\n * Sphinx stylesheet -- sphinxdoc theme.  Originally created by\n * Armin Ron"
  },
  {
    "path": "docs/html/_static/underscore-1.13.1.js",
    "chars": 68408,
    "preview": "(function (global, factory) {\n  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory("
  },
  {
    "path": "docs/html/_static/underscore-1.3.1.js",
    "chars": 35168,
    "preview": "//     Underscore.js 1.3.1\n//     (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.\n//     Underscore is freely distribu"
  },
  {
    "path": "docs/html/_static/underscore.js",
    "chars": 19530,
    "preview": "!function(n,r){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=r():\"function\"==typeof define&&define"
  },
  {
    "path": "docs/html/_static/websupport.js",
    "chars": 25350,
    "preview": "/*\n * websupport.js\n * ~~~~~~~~~~~~~\n *\n * sphinx.websupport utilties for all documentation.\n *\n * :copyright: Copyright"
  },
  {
    "path": "docs/html/api/nmb_NBNSProtocol.html",
    "chars": 5371,
    "preview": "<!DOCTYPE html>\n\n<html lang=\"en\" data-content_root=\"../\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <meta name=\"viewport"
  },
  {
    "path": "docs/html/api/nmb_NetBIOS.html",
    "chars": 13919,
    "preview": "<!DOCTYPE html>\n\n<html lang=\"en\" data-content_root=\"../\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <meta name=\"viewport"
  },
  {
    "path": "docs/html/api/smb_SMBConnection.html",
    "chars": 9444,
    "preview": "<!DOCTYPE html>\n\n<html lang=\"en\" data-content_root=\"../\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <meta name=\"viewport"
  },
  {
    "path": "docs/html/api/smb_SMBHandler.html",
    "chars": 12870,
    "preview": "<!DOCTYPE html>\n\n<html lang=\"en\" data-content_root=\"../\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <meta name=\"viewport"
  },
  {
    "path": "docs/html/api/smb_SMBProtocolFactory.html",
    "chars": 14739,
    "preview": "<!DOCTYPE html>\n\n<html lang=\"en\" data-content_root=\"../\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <meta name=\"viewport"
  },
  {
    "path": "docs/html/api/smb_SharedDevice.html",
    "chars": 4661,
    "preview": "<!DOCTYPE html>\n\n<html lang=\"en\" data-content_root=\"../\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <meta name=\"viewport"
  },
  {
    "path": "docs/html/api/smb_SharedFile.html",
    "chars": 4591,
    "preview": "<!DOCTYPE html>\n\n<html lang=\"en\" data-content_root=\"../\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <meta name=\"viewport"
  },
  {
    "path": "docs/html/api/smb_exceptions.html",
    "chars": 8075,
    "preview": "<!DOCTYPE html>\n\n<html lang=\"en\" data-content_root=\"../\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <meta name=\"viewport"
  },
  {
    "path": "docs/html/api/smb_security_descriptors.html",
    "chars": 21641,
    "preview": "<!DOCTYPE html>\n\n<html lang=\"en\" data-content_root=\"../\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <meta name=\"viewport"
  },
  {
    "path": "docs/html/extending.html",
    "chars": 6706,
    "preview": "<!DOCTYPE html>\n\n<html lang=\"en\" data-content_root=\"./\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <meta name=\"viewport\""
  },
  {
    "path": "docs/html/genindex.html",
    "chars": 11184,
    "preview": "<!DOCTYPE html>\n\n<html lang=\"en\" data-content_root=\"./\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <meta name=\"viewport\""
  },
  {
    "path": "docs/html/index.html",
    "chars": 13958,
    "preview": "<!DOCTYPE html>\n\n<html lang=\"en\" data-content_root=\"./\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <meta name=\"viewport\""
  },
  {
    "path": "docs/html/py-modindex.html",
    "chars": 3898,
    "preview": "<!DOCTYPE html>\n\n<html lang=\"en\" data-content_root=\"./\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <meta name=\"viewport\""
  },
  {
    "path": "docs/html/search.html",
    "chars": 3374,
    "preview": "<!DOCTYPE html>\n\n<html lang=\"en\" data-content_root=\"./\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <meta name=\"viewport\""
  },
  {
    "path": "docs/html/searchindex.js",
    "chars": 19159,
    "preview": "Search.setIndex({\"docnames\": [\"api/nmb_NBNSProtocol\", \"api/nmb_NetBIOS\", \"api/smb_SMBConnection\", \"api/smb_SMBHandler\", "
  },
  {
    "path": "docs/html/upgrading.html",
    "chars": 9821,
    "preview": "<!DOCTYPE html>\n\n<html lang=\"en\" data-content_root=\"./\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <meta name=\"viewport\""
  },
  {
    "path": "python2/nmb/NetBIOS.py",
    "chars": 6061,
    "preview": "\nimport os, logging, random, socket, time, select\nfrom base import NBNS, NotConnectedError\nfrom nmb_constants import TYP"
  },
  {
    "path": "python2/nmb/NetBIOSProtocol.py",
    "chars": 6512,
    "preview": "\nimport os, logging, random, socket, time\nfrom twisted.internet import reactor, defer\nfrom twisted.internet.protocol imp"
  },
  {
    "path": "python2/nmb/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "python2/nmb/base.py",
    "chars": 5932,
    "preview": "\nimport struct, logging, random\nfrom nmb_constants import *\nfrom nmb_structs import *\nfrom utils import encode_name\n\ncla"
  },
  {
    "path": "python2/nmb/nmb_constants.py",
    "chars": 968,
    "preview": "\n# Default port for NetBIOS name service\nNETBIOS_NS_PORT = 137\n\n# Default port for NetBIOS session service\nNETBIOS_SESSI"
  },
  {
    "path": "python2/nmb/nmb_structs.py",
    "chars": 1897,
    "preview": "\nimport struct\n\nclass NMBError(Exception): pass\n\n\nclass NotConnectedError(NMBError):\n    \"\"\"\n    Raisd when the underlyi"
  },
  {
    "path": "python2/nmb/utils.py",
    "chars": 1505,
    "preview": "\nimport string, re\n\n\ndef encode_name(name, type, scope = None):\n    \"\"\"\n    Perform first and second level encoding of n"
  },
  {
    "path": "python2/smb/SMBConnection.py",
    "chars": 27668,
    "preview": "\nimport os, logging, select, socket, struct, errno\nfrom smb_constants import *\nfrom smb_structs import *\nfrom base impor"
  },
  {
    "path": "python2/smb/SMBHandler.py",
    "chars": 3156,
    "preview": "\nimport os, sys, socket, urllib2, mimetypes, mimetools, tempfile\nfrom urllib import (unwrap, unquote, splittype, splitho"
  },
  {
    "path": "python2/smb/SMBProtocol.py",
    "chars": 24217,
    "preview": "\nimport os, logging, time\nfrom twisted.internet import reactor, defer\nfrom twisted.internet.protocol import ClientFactor"
  },
  {
    "path": "python2/smb/__init__.py",
    "chars": 1,
    "preview": "\n"
  },
  {
    "path": "python2/smb/base.py",
    "chars": 169239,
    "preview": "\nimport logging, binascii, time, hmac\nfrom datetime import datetime\nfrom smb_constants import *\nfrom smb2_constants impo"
  },
  {
    "path": "python2/smb/ntlm.py",
    "chars": 10010,
    "preview": "\nimport types, hmac, binascii, struct, random, string\nfrom .utils.rc4 import RC4_encrypt\nfrom utils.pyDes import des\n\ntr"
  },
  {
    "path": "python2/smb/security_descriptors.py",
    "chars": 13059,
    "preview": "\"\"\"\nThis module implements security descriptors, and the partial structures\nused in them, as specified in [MS-DTYP].\n\"\"\""
  },
  {
    "path": "python2/smb/securityblob.py",
    "chars": 5579,
    "preview": "\nfrom pyasn1.type import tag, univ, namedtype, namedval, constraint\nfrom pyasn1.codec.der import encoder, decoder\n\n__all"
  },
  {
    "path": "python2/smb/smb2_constants.py",
    "chars": 3070,
    "preview": "\n# Bitmask for Flags field in SMB2 message header\nSMB2_FLAGS_SERVER_TO_REDIR = 0x01\nSMB2_FLAGS_ASYNC_COMMAND = 0x02\nSMB2"
  },
  {
    "path": "python2/smb/smb2_structs.py",
    "chars": 30991,
    "preview": "\nimport os, sys, struct, types, logging, binascii, time\nfrom StringIO import StringIO\nfrom smb_structs import ProtocolEr"
  },
  {
    "path": "python2/smb/smb_constants.py",
    "chars": 8369,
    "preview": "\n# Values for Command field in SMB message header\nSMB_COM_CREATE_DIRECTORY = 0x00\nSMB_COM_DELETE_DIRECTORY = 0x01\nSMB_CO"
  },
  {
    "path": "python2/smb/smb_structs.py",
    "chars": 53320,
    "preview": "\nimport os, sys, struct, types, logging, binascii, time\nfrom StringIO import StringIO\nfrom smb_constants import *\n\n\n# Se"
  },
  {
    "path": "python2/smb/utils/README.txt",
    "chars": 372,
    "preview": "\nmd4.py and U32.py\nBoth modules downloaded from http://www.oocities.org/rozmanov/python/md4.html.\nLicensed under LGPL\n\np"
  },
  {
    "path": "python2/smb/utils/U32.py",
    "chars": 5139,
    "preview": "#    U32.py implements 32-bit unsigned int class for Python\r\n#    Version 1.0\r\n#    Copyright (C) 2001-2002  Dmitry Rozm"
  },
  {
    "path": "python2/smb/utils/__init__.py",
    "chars": 83,
    "preview": "\ndef convertFILETIMEtoEpoch(t):\n    return (t - 116444736000000000L) / 10000000.0;\n"
  },
  {
    "path": "python2/smb/utils/md4.py",
    "chars": 9104,
    "preview": "#    md4.py implements md4 hash class for Python\n#    Version 1.0\n#    Copyright (C) 2001-2002  Dmitry Rozmanov\n#\n#    b"
  },
  {
    "path": "python2/smb/utils/pyDes.py",
    "chars": 27514,
    "preview": "#############################################################################\n# \t\t\t\tDocumentation\t\t\t\t    #\n#############"
  },
  {
    "path": "python2/smb/utils/rc4.py",
    "chars": 434,
    "preview": "\ndef RC4_encrypt(key, data):\n    S = list(range(256))\n    j = 0\n\n    key_len = len(key)\n    for i in list(range(256)):\n "
  },
  {
    "path": "python2/smb/utils/sha256.py",
    "chars": 3562,
    "preview": "__author__ = 'Thomas Dixon'\n__license__ = 'MIT'\n\nimport copy, struct, sys\n\ndigest_size = 32\nblocksize = 1\n\ndef new(m=Non"
  },
  {
    "path": "python2/tests/DirectSMBConnectionTests/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "python2/tests/DirectSMBConnectionTests/test_SMBHandler.py",
    "chars": 2726,
    "preview": "# -*- coding: utf-8 -*-\n\nimport os, urllib, urllib2, time, random\nfrom StringIO import StringIO\nfrom smb.SMBHandler impo"
  },
  {
    "path": "python2/tests/DirectSMBConnectionTests/test_auth.py",
    "chars": 4319,
    "preview": "\nfrom smb.SMBConnection import SMBConnection\nfrom util import getConnectionInfo\nfrom nose.tools import with_setup\nfrom s"
  },
  {
    "path": "python2/tests/DirectSMBConnectionTests/test_createdeletedirectory.py",
    "chars": 3503,
    "preview": "# -*- coding: utf-8 -*-\n\nimport os, time, random\nfrom smb.SMBConnection import SMBConnection\nfrom util import getConnect"
  },
  {
    "path": "python2/tests/DirectSMBConnectionTests/test_echo.py",
    "chars": 621,
    "preview": "\nimport random\nfrom smb.SMBConnection import SMBConnection\nfrom util import getConnectionInfo\nfrom nose.tools import wit"
  },
  {
    "path": "python2/tests/DirectSMBConnectionTests/test_listpath.py",
    "chars": 7083,
    "preview": "# -*- coding: utf-8 -*-\n\nfrom smb.SMBConnection import SMBConnection\nfrom smb.smb_constants import *\nfrom util import ge"
  },
  {
    "path": "python2/tests/DirectSMBConnectionTests/test_listshares.py",
    "chars": 1203,
    "preview": "\nfrom smb.SMBConnection import SMBConnection\nfrom util import getConnectionInfo\nfrom nose.tools import with_setup\nfrom s"
  },
  {
    "path": "python2/tests/DirectSMBConnectionTests/test_listsnapshots.py",
    "chars": 1195,
    "preview": "\nfrom smb.SMBConnection import SMBConnection\nfrom util import getConnectionInfo\nfrom nose.tools import with_setup\nfrom s"
  },
  {
    "path": "python2/tests/DirectSMBConnectionTests/test_rename.py",
    "chars": 8837,
    "preview": "# -*- coding: utf-8 -*-\n\nimport os, time, random\nfrom StringIO import StringIO\nfrom smb.SMBConnection import SMBConnecti"
  },
  {
    "path": "python2/tests/DirectSMBConnectionTests/test_retrievefile.py",
    "chars": 7681,
    "preview": "# -*- coding: utf-8 -*-\n\nimport os, tempfile\nfrom StringIO import StringIO\nfrom smb.SMBConnection import SMBConnection\nf"
  },
  {
    "path": "python2/tests/DirectSMBConnectionTests/test_storefile.py",
    "chars": 4353,
    "preview": "# -*- coding: utf-8 -*-\n\nimport os, tempfile, random, time\nfrom StringIO import StringIO\nfrom smb.SMBConnection import S"
  },
  {
    "path": "python2/tests/DirectSMBConnectionTests/util.py",
    "chars": 581,
    "preview": "\nimport os\nfrom ConfigParser import ConfigParser\n\ndef getConnectionInfo():\n    config_filename = os.path.join(os.path.di"
  },
  {
    "path": "python2/tests/DirectSMBTwistedTests/test_auth.py",
    "chars": 2351,
    "preview": "\nfrom nose.twistedtools import reactor, deferred\nfrom twisted.internet import defer\nfrom smb.SMBProtocol import SMBProto"
  },
  {
    "path": "python2/tests/DirectSMBTwistedTests/test_createdeletedirectory.py",
    "chars": 3665,
    "preview": "# -*- coding: utf-8 -*-\n\nimport os, random, time\nfrom nose.twistedtools import reactor, deferred\nfrom twisted.internet i"
  },
  {
    "path": "python2/tests/DirectSMBTwistedTests/test_echo.py",
    "chars": 1131,
    "preview": "\nfrom nose.twistedtools import reactor, deferred\nfrom twisted.internet import defer\nfrom smb.SMBProtocol import SMBProto"
  },
  {
    "path": "python2/tests/DirectSMBTwistedTests/test_listpath.py",
    "chars": 2107,
    "preview": "\nfrom nose.twistedtools import reactor, deferred\nfrom twisted.internet import defer\nfrom smb.SMBProtocol import SMBProto"
  },
  {
    "path": "python2/tests/DirectSMBTwistedTests/test_listshares.py",
    "chars": 1601,
    "preview": "\nfrom nose.twistedtools import reactor, deferred\nfrom twisted.internet import defer\nfrom smb.SMBProtocol import SMBProto"
  },
  {
    "path": "python2/tests/DirectSMBTwistedTests/test_listsnapshots.py",
    "chars": 1808,
    "preview": "\nfrom nose.twistedtools import reactor, deferred\nfrom twisted.internet import defer\nfrom smb.SMBProtocol import SMBProto"
  },
  {
    "path": "python2/tests/DirectSMBTwistedTests/test_rename.py",
    "chars": 7050,
    "preview": "# -*- coding: utf-8 -*-\n\nimport os, random, time\nfrom StringIO import StringIO\nfrom nose.twistedtools import reactor, de"
  },
  {
    "path": "python2/tests/DirectSMBTwistedTests/test_retrievefile.py",
    "chars": 10393,
    "preview": "# -*- coding: utf-8 -*-\n\nimport os, tempfile\nfrom nose.twistedtools import reactor, deferred\nfrom twisted.internet impor"
  },
  {
    "path": "python2/tests/DirectSMBTwistedTests/test_storefile.py",
    "chars": 5406,
    "preview": "# -*- coding: utf-8 -*-\n\nimport os, time, random\nfrom StringIO import StringIO\nfrom nose.twistedtools import reactor, de"
  },
  {
    "path": "python2/tests/DirectSMBTwistedTests/util.py",
    "chars": 581,
    "preview": "\nimport os\nfrom ConfigParser import ConfigParser\n\ndef getConnectionInfo():\n    config_filename = os.path.join(os.path.di"
  },
  {
    "path": "python2/tests/NetBIOSTests/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "python2/tests/NetBIOSTests/test_queryname.py",
    "chars": 290,
    "preview": "\nfrom nmb.NetBIOS import NetBIOS\nfrom nose.tools import with_setup\n\nconn = None\n\ndef teardown_func():\n    global conn\n  "
  },
  {
    "path": "python2/tests/NetBIOSTwistedTests/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "python2/tests/NetBIOSTwistedTests/test_queryname.py",
    "chars": 445,
    "preview": "\nfrom nose.twistedtools import reactor, deferred\nfrom twisted.internet import defer\nfrom nmb.NetBIOSProtocol import NBNS"
  },
  {
    "path": "python2/tests/README.md",
    "chars": 1996,
    "preview": "\nSteps to Follow to Run the Unit Tests\n=====================================\n\n## Step 1: Install system dependencies ##\n"
  },
  {
    "path": "python2/tests/SMBConnectionTests/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "python2/tests/SMBConnectionTests/test_SMBHandler.py",
    "chars": 1783,
    "preview": "# -*- coding: utf-8 -*-\n\nimport os, urllib, urllib2, time, random\nfrom StringIO import StringIO\nfrom smb.SMBHandler impo"
  },
  {
    "path": "python2/tests/SMBConnectionTests/test_auth.py",
    "chars": 3268,
    "preview": "\nfrom smb.SMBConnection import SMBConnection\nfrom util import getConnectionInfo\nfrom nose.tools import with_setup\nfrom s"
  },
  {
    "path": "python2/tests/SMBConnectionTests/test_createdeletedirectory.py",
    "chars": 3459,
    "preview": "# -*- coding: utf-8 -*-\n\nimport os, time, random\nfrom smb.SMBConnection import SMBConnection\nfrom util import getConnect"
  },
  {
    "path": "python2/tests/SMBConnectionTests/test_deletepattern.py",
    "chars": 8339,
    "preview": "# -*- coding: utf-8 -*-\n\nimport os, time, random\nfrom StringIO import StringIO\nfrom smb.SMBConnection import SMBConnecti"
  },
  {
    "path": "python2/tests/SMBConnectionTests/test_echo.py",
    "chars": 604,
    "preview": "\nimport random\nfrom smb.SMBConnection import SMBConnection\nfrom util import getConnectionInfo\nfrom nose.tools import wit"
  },
  {
    "path": "python2/tests/SMBConnectionTests/test_getattributes.py",
    "chars": 1772,
    "preview": "# -*- coding: utf-8 -*-\n\nfrom smb.SMBConnection import SMBConnection\nfrom util import getConnectionInfo\nfrom nose.tools "
  },
  {
    "path": "python2/tests/SMBConnectionTests/test_listpath.py",
    "chars": 7543,
    "preview": "# -*- coding: utf-8 -*-\n\nfrom smb.SMBConnection import SMBConnection\nfrom smb.smb_constants import *\nfrom util import ge"
  },
  {
    "path": "python2/tests/SMBConnectionTests/test_listshares.py",
    "chars": 1159,
    "preview": "\nfrom smb.SMBConnection import SMBConnection\nfrom util import getConnectionInfo\nfrom nose.tools import with_setup\nfrom s"
  },
  {
    "path": "python2/tests/SMBConnectionTests/test_listsnapshots.py",
    "chars": 1151,
    "preview": "\nfrom smb.SMBConnection import SMBConnection\nfrom util import getConnectionInfo\nfrom nose.tools import with_setup\nfrom s"
  },
  {
    "path": "python2/tests/SMBConnectionTests/test_rename.py",
    "chars": 8793,
    "preview": "# -*- coding: utf-8 -*-\n\nimport os, time, random\nfrom StringIO import StringIO\nfrom smb.SMBConnection import SMBConnecti"
  },
  {
    "path": "python2/tests/SMBConnectionTests/test_retrievefile.py",
    "chars": 7637,
    "preview": "# -*- coding: utf-8 -*-\n\nimport os, tempfile\nfrom StringIO import StringIO\nfrom smb.SMBConnection import SMBConnection\nf"
  },
  {
    "path": "python2/tests/SMBConnectionTests/test_security.py",
    "chars": 974,
    "preview": "# -*- coding: utf-8 -*-\n\nimport os, tempfile\nfrom StringIO import StringIO\nfrom smb.SMBConnection import SMBConnection\nf"
  },
  {
    "path": "python2/tests/SMBConnectionTests/test_storefile.py",
    "chars": 5558,
    "preview": "# -*- coding: utf-8 -*-\n\nimport os, tempfile, random, time\nfrom StringIO import StringIO\nfrom smb.SMBConnection import S"
  },
  {
    "path": "python2/tests/SMBConnectionTests/test_with_context.py",
    "chars": 381,
    "preview": "# -*- coding: utf-8 -*-\n\nfrom smb.SMBConnection import SMBConnection\nfrom .util import getConnectionInfo\n\ndef test_conte"
  },
  {
    "path": "python2/tests/SMBConnectionTests/util.py",
    "chars": 586,
    "preview": "\nimport os\nfrom ConfigParser import ConfigParser\n\ndef getConnectionInfo():\n    config_filename = os.path.join(os.path.di"
  },
  {
    "path": "python2/tests/SMBTwistedTests/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "python2/tests/SMBTwistedTests/test_auth.py",
    "chars": 2351,
    "preview": "\nfrom nose.twistedtools import reactor, deferred\nfrom twisted.internet import defer\nfrom smb.SMBProtocol import SMBProto"
  },
  {
    "path": "python2/tests/SMBTwistedTests/test_createdeletedirectory.py",
    "chars": 3665,
    "preview": "# -*- coding: utf-8 -*-\n\nimport os, random, time\nfrom nose.twistedtools import reactor, deferred\nfrom twisted.internet i"
  },
  {
    "path": "python2/tests/SMBTwistedTests/test_echo.py",
    "chars": 1131,
    "preview": "\nfrom nose.twistedtools import reactor, deferred\nfrom twisted.internet import defer\nfrom smb.SMBProtocol import SMBProto"
  },
  {
    "path": "python2/tests/SMBTwistedTests/test_getattributes.py",
    "chars": 3520,
    "preview": "\nfrom nose.twistedtools import reactor, deferred\nfrom twisted.internet import defer\nfrom smb.SMBProtocol import SMBProto"
  },
  {
    "path": "python2/tests/SMBTwistedTests/test_listpath.py",
    "chars": 2107,
    "preview": "\nfrom nose.twistedtools import reactor, deferred\nfrom twisted.internet import defer\nfrom smb.SMBProtocol import SMBProto"
  },
  {
    "path": "python2/tests/SMBTwistedTests/test_listshares.py",
    "chars": 1601,
    "preview": "\nfrom nose.twistedtools import reactor, deferred\nfrom twisted.internet import defer\nfrom smb.SMBProtocol import SMBProto"
  },
  {
    "path": "python2/tests/SMBTwistedTests/test_listsnapshots.py",
    "chars": 1808,
    "preview": "\nfrom nose.twistedtools import reactor, deferred\nfrom twisted.internet import defer\nfrom smb.SMBProtocol import SMBProto"
  },
  {
    "path": "python2/tests/SMBTwistedTests/test_rename.py",
    "chars": 7050,
    "preview": "# -*- coding: utf-8 -*-\n\nimport os, random, time\nfrom StringIO import StringIO\nfrom nose.twistedtools import reactor, de"
  },
  {
    "path": "python2/tests/SMBTwistedTests/test_retrievefile.py",
    "chars": 10393,
    "preview": "# -*- coding: utf-8 -*-\n\nimport os, tempfile\nfrom nose.twistedtools import reactor, deferred\nfrom twisted.internet impor"
  },
  {
    "path": "python2/tests/SMBTwistedTests/test_storefile.py",
    "chars": 5406,
    "preview": "# -*- coding: utf-8 -*-\n\nimport os, time, random\nfrom StringIO import StringIO\nfrom nose.twistedtools import reactor, de"
  },
  {
    "path": "python2/tests/SMBTwistedTests/util.py",
    "chars": 543,
    "preview": "\nimport os\nfrom ConfigParser import ConfigParser\n\ndef getConnectionInfo():\n    config_filename = os.path.join(os.path.di"
  },
  {
    "path": "python2/tests/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "python2/tests/connection.ini",
    "chars": 151,
    "preview": "\n[server]\nname = SERVER\nip = 192.168.1.1\nport = 139\ndirect_port = 445\n\n[client]\nname = TESTCLIENT\n\n[user]\nname = myuser\n"
  },
  {
    "path": "python2/tests/test_ntlm.py",
    "chars": 3191,
    "preview": "\nimport binascii\nfrom smb import ntlm\n\ndef test_NTLMv1_without_extended_security():\n    password = 'Password'\n    server"
  },
  {
    "path": "python2/tests/test_security_descriptors.py",
    "chars": 6287,
    "preview": "import binascii\n\nfrom smb import security_descriptors as sd\nfrom smb import smb_constants as sc\n\n\ndef test_sid_string_re"
  },
  {
    "path": "python2/tests/test_securityblob.py",
    "chars": 3402,
    "preview": "\nimport binascii\nfrom smb import securityblob\n\n\ndef test_NTLMSSP_NEGOTIATE_encoding():\n    ntlm_data = binascii.unhexlif"
  },
  {
    "path": "python3/nmb/NetBIOS.py",
    "chars": 6049,
    "preview": "\nimport os, logging, random, socket, time, select\nfrom .base import NBNS, NotConnectedError\nfrom .nmb_constants import T"
  },
  {
    "path": "python3/nmb/NetBIOSProtocol.py",
    "chars": 6458,
    "preview": "\nimport os, logging, random, socket, time\nfrom twisted.internet import reactor, defer\nfrom twisted.internet.protocol imp"
  },
  {
    "path": "python3/nmb/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "python3/nmb/base.py",
    "chars": 5977,
    "preview": "\nimport struct, logging, random\nfrom .nmb_constants import *\nfrom .nmb_structs import *\nfrom .utils import encode_name\n\n"
  },
  {
    "path": "python3/nmb/nmb_constants.py",
    "chars": 968,
    "preview": "\n# Default port for NetBIOS name service\nNETBIOS_NS_PORT = 137\n\n# Default port for NetBIOS session service\nNETBIOS_SESSI"
  },
  {
    "path": "python3/nmb/nmb_structs.py",
    "chars": 1894,
    "preview": "\nimport struct\n\nclass NMBError(Exception): pass\n\nclass NotConnectedError(NMBError):\n    \"\"\"\n    Raisd when the underlyin"
  },
  {
    "path": "python3/nmb/utils.py",
    "chars": 1541,
    "preview": "\nimport string, re\n\n\ndef encode_name(name, type, scope = None):\n    \"\"\"\n    Perform first and second level encoding of n"
  },
  {
    "path": "python3/smb/SMBConnection.py",
    "chars": 29237,
    "preview": "\nimport os, logging, select, socket, types, typing, struct, errno\n\nfrom tqdm import tqdm\nfrom .smb_constants import *\nfr"
  },
  {
    "path": "python3/smb/SMBHandler.py",
    "chars": 3116,
    "preview": "import os, sys, socket, urllib.request, urllib.error, urllib.parse, mimetypes, email, tempfile\nfrom urllib.parse import "
  },
  {
    "path": "python3/smb/SMBProtocol.py",
    "chars": 24688,
    "preview": "\nimport os, logging, time\nfrom twisted.internet import reactor, defer\nfrom twisted.internet.protocol import ClientFactor"
  },
  {
    "path": "python3/smb/__init__.py",
    "chars": 1,
    "preview": "\n"
  },
  {
    "path": "python3/smb/base.py",
    "chars": 172597,
    "preview": "\nimport logging, binascii, time, hmac\nfrom datetime import datetime\nfrom tqdm import tqdm\n\nfrom .smb_constants import *\n"
  },
  {
    "path": "python3/smb/ntlm.py",
    "chars": 9905,
    "preview": "\nimport types, hmac, binascii, struct, random, string\nfrom .utils.rc4 import RC4_encrypt\nfrom .utils.pyDes import des\n\nt"
  },
  {
    "path": "python3/smb/security_descriptors.py",
    "chars": 13060,
    "preview": "\"\"\"\nThis module implements security descriptors, and the partial structures\nused in them, as specified in [MS-DTYP].\n\"\"\""
  },
  {
    "path": "python3/smb/securityblob.py",
    "chars": 5578,
    "preview": "\nfrom pyasn1.type import tag, univ, namedtype, namedval, constraint\nfrom pyasn1.codec.der import encoder, decoder\n\n__all"
  },
  {
    "path": "python3/smb/smb2_constants.py",
    "chars": 3070,
    "preview": "\n# Bitmask for Flags field in SMB2 message header\nSMB2_FLAGS_SERVER_TO_REDIR = 0x01\nSMB2_FLAGS_ASYNC_COMMAND = 0x02\nSMB2"
  },
  {
    "path": "python3/smb/smb2_structs.py",
    "chars": 31008,
    "preview": "\nimport os, sys, struct, types, logging, binascii, time\nfrom io import StringIO\nfrom .smb_structs import ProtocolError\nf"
  },
  {
    "path": "python3/smb/smb_constants.py",
    "chars": 8364,
    "preview": "\n# Values for Command field in SMB message header\nSMB_COM_CREATE_DIRECTORY = 0x00\nSMB_COM_DELETE_DIRECTORY = 0x01\nSMB_CO"
  },
  {
    "path": "python3/smb/smb_structs.py",
    "chars": 53690,
    "preview": "\nimport os, sys, struct, types, logging, binascii, time\nfrom copy import copy\nfrom io import StringIO\nfrom .smb_constant"
  },
  {
    "path": "python3/smb/strategy.py",
    "chars": 389,
    "preview": "class DataStrategyBase():\n    DATABYTES_CODEC = 'UTF-16LE'\n    \n  \nclass DataFaultToleranceStrategy():\n    @staticmethod"
  },
  {
    "path": "python3/smb/utils/U32.py",
    "chars": 5006,
    "preview": "#    U32.py implements 32-bit unsigned int class for Python\n#    Version 1.0\n#    Copyright (C) 2001-2002  Dmitry Rozman"
  },
  {
    "path": "python3/smb/utils/__init__.py",
    "chars": 82,
    "preview": "\ndef convertFILETIMEtoEpoch(t):\n    return (t - 116444736000000000) / 10000000.0;\n"
  },
  {
    "path": "python3/smb/utils/md4.py",
    "chars": 8326,
    "preview": "#    md4.py implements md4 hash class for Python\n#    Version 1.0\n#    Copyright (C) 2001-2002  Dmitry Rozmanov\n#\n#    b"
  },
  {
    "path": "python3/smb/utils/pyDes.py",
    "chars": 27505,
    "preview": "#############################################################################\n# \t\t\t\tDocumentation\t\t\t\t    #\n#############"
  },
  {
    "path": "python3/smb/utils/rc4.py",
    "chars": 417,
    "preview": "\ndef RC4_encrypt(key, data):\n    S = list(range(256))\n    j = 0\n\n    key_len = len(key)\n    for i in list(range(256)):\n "
  },
  {
    "path": "python3/smb/utils/sha256.py",
    "chars": 3562,
    "preview": "__author__ = 'Thomas Dixon'\n__license__ = 'MIT'\n\nimport copy, struct, sys\n\ndigest_size = 32\nblocksize = 1\n\ndef new(m=Non"
  },
  {
    "path": "python3/tests/DirectSMBConnectionTests/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "python3/tests/DirectSMBConnectionTests/test_auth.py",
    "chars": 4295,
    "preview": "\nfrom nose2.tools.decorators import with_teardown\nfrom smb.SMBConnection import SMBConnection\nfrom smb import smb_struct"
  },
  {
    "path": "python3/tests/DirectSMBConnectionTests/test_createdeletedirectory.py",
    "chars": 3549,
    "preview": "# -*- coding: utf-8 -*-\n\nimport os, time, random\nfrom nose2.tools.decorators import with_setup, with_teardown\nfrom smb.S"
  },
  {
    "path": "python3/tests/DirectSMBConnectionTests/test_echo.py",
    "chars": 684,
    "preview": "\nimport random\nfrom nose2.tools.decorators import with_setup, with_teardown\nfrom smb.SMBConnection import SMBConnection\n"
  },
  {
    "path": "python3/tests/DirectSMBConnectionTests/test_listpath.py",
    "chars": 7346,
    "preview": "# -*- coding: utf-8 -*-\n\nfrom nose2.tools.decorators import with_setup, with_teardown\nfrom smb.SMBConnection import SMBC"
  },
  {
    "path": "python3/tests/DirectSMBConnectionTests/test_listshares.py",
    "chars": 1251,
    "preview": "\nfrom nose2.tools.decorators import with_setup, with_teardown\nfrom smb.SMBConnection import SMBConnection\nfrom smb impor"
  },
  {
    "path": "python3/tests/DirectSMBConnectionTests/test_listsnapshots.py",
    "chars": 1253,
    "preview": "\nfrom nose2.tools.decorators import with_setup, with_teardown\nfrom smb.SMBConnection import SMBConnection\nfrom smb impor"
  },
  {
    "path": "python3/tests/DirectSMBConnectionTests/test_rename.py",
    "chars": 8890,
    "preview": "# -*- coding: utf-8 -*-\n\nimport os, time, random\nfrom io import BytesIO\nfrom nose2.tools.decorators import with_setup, w"
  },
  {
    "path": "python3/tests/DirectSMBConnectionTests/test_retrievefile.py",
    "chars": 7888,
    "preview": "# -*- coding: utf-8 -*-\n\nimport os, tempfile\nfrom io import BytesIO\nfrom nose2.tools.decorators import with_setup, with_"
  },
  {
    "path": "python3/tests/DirectSMBConnectionTests/test_storefile.py",
    "chars": 4408,
    "preview": "# -*- coding: utf-8 -*-\n\nimport os, tempfile, random, time\nfrom io import BytesIO\nfrom nose2.tools.decorators import wit"
  },
  {
    "path": "python3/tests/DirectSMBConnectionTests/test_tqdm.py",
    "chars": 3810,
    "preview": "# -*- coding: utf-8 -*-\n\nimport os, time, random\nfrom io import BytesIO\nfrom nose2.tools.decorators import with_setup, w"
  },
  {
    "path": "python3/tests/DirectSMBConnectionTests/util.py",
    "chars": 581,
    "preview": "\nimport os\nfrom configparser import ConfigParser\n\ndef getConnectionInfo():\n    config_filename = os.path.join(os.path.di"
  },
  {
    "path": "python3/tests/NetBIOSTests/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "python3/tests/NetBIOSTests/test_queryname.py",
    "chars": 297,
    "preview": "\nfrom nmb.NetBIOS import NetBIOS\nfrom nose2.tools.decorators import with_teardown\n\nconn = None\n\ndef teardown_func():\n   "
  },
  {
    "path": "python3/tests/README.md",
    "chars": 1972,
    "preview": "\nSteps to Follow to Run the Unit Tests\n=====================================\n\n## Step 1: Install system dependencies ##\n"
  },
  {
    "path": "python3/tests/SMBConnectionTests/__init__.py",
    "chars": 0,
    "preview": ""
  }
]

// ... and 54 more files (download for full content)

About this extraction

This page contains the full source code of the miketeo/pysmb GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 254 files (3.3 MB), approximately 880.8k tokens, and a symbol index with 2129 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!