Package pike :: Module model :: Class Client
[hide private]
[frames] | no frames]

Class Client

source code

object --+
         |
        Client

Client

Maintains all state associated with an SMB2/3 client.

Instance Methods [hide private]
 
__init__(self, dialects=[DIALECT_SMB2_002, DIALECT_SMB2_1, DIALECT_SMB3_0, DIALECT_SMB..., capabilities=SMB2_GLOBAL_CAP_MULTI_CHANNEL | SMB2_GLOBAL_CAP_DIRECTORY_LEAS..., security_mode=SMB2_NEGOTIATE_SIGNING_ENABLED, client_guid=None)
Constructor.
source code
 
callback(*args, **kwds)
Register a callback function for the context block, then unregister it
source code
 
register_callback(self, event, cb)
Registers a callback function, cb for the given event.
source code
 
unregister_callback(self, event, cb)
Unregisters a callback function, cb for the given event.
source code
 
connect(self, server, port=445)
Create a connection.
source code
 
connect_submit(self, server, port=445)
Create a connection.
source code
 
next_oplock_break(self) source code
 
next_lease_break(self) source code
 
oplock_break_future(self, file_id)
Create future for oplock break.
source code
 
lease_break_future(self, lease_key)
Create future for lease break.
source code
 
oplock_break(self, file_id)
Wait for and return oplock break notification.
source code
 
lease_break(self, lease_key)
Wait for and return lease break notification.
source code
 
lease(self, tree, lease_res)
Create or look up lease object.
source code
 
dispose_lease(self, lease) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Instance Variables [hide private]
  capabilities
Capabilities flags
  channel_sequence
Current channel sequence number
  client_guid
Client GUID
[number] dialects
A list of supported dialects
  security_mode
Security mode flags
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, dialects=[DIALECT_SMB2_002, DIALECT_SMB2_1, DIALECT_SMB3_0, DIALECT_SMB..., capabilities=SMB2_GLOBAL_CAP_MULTI_CHANNEL | SMB2_GLOBAL_CAP_DIRECTORY_LEAS..., security_mode=SMB2_NEGOTIATE_SIGNING_ENABLED, client_guid=None)
(Constructor)

source code 

Constructor.

Parameters:
  • dialects ([number]) - A list of supported dialects.
  • capabilities - Client capabilities flags
  • security_mode - Client security mode flags
  • client_guid - Client GUID. If None, a new one will be generated at random.
Overrides: object.__init__

callback(*args, **kwds)

source code 

Register a callback function for the context block, then unregister it

Decorators:
  • @contextlib.contextmanager

register_callback(self, event, cb)

source code 

Registers a callback function, cb for the given event. When the event fires, cb will be called with the relevant top-level Netbios frame as the single paramter.

connect(self, server, port=445)

source code 

Create a connection.

Returns a new Connection object connected to the given server and port.

Parameters:
  • server - The server to connect to.
  • port - The port to connect to.

connect_submit(self, server, port=445)

source code 

Create a connection.

Returns a new Future object for the Connection being established asynchronously to the given server and port.

Parameters:
  • server - The server to connect to.
  • port - The port to connect to.

oplock_break_future(self, file_id)

source code 

Create future for oplock break.

Returns a Future object which will be completed when an oplock break occurs. The result will be the smb2.Smb2 frame of the break notification packet.

Parameters:
  • file_id ((number, number)) - The file ID of the oplocked file.

lease_break_future(self, lease_key)

source code 

Create future for lease break.

Returns a Future object which will be completed when a lease break occurs. The result will be the smb2.Smb2 frame of the break notification packet.

Parameters:
  • lease_key - The lease key for the lease.

oplock_break(self, file_id)

source code 

Wait for and return oplock break notification.

Equivalent to oplock_break_future(file_id).result()

lease_break(self, lease_key)

source code 

Wait for and return lease break notification.

Equivalent to lease_break_future(lease_key).result()

lease(self, tree, lease_res)

source code 

Create or look up lease object.

Returns a lease object based on a Tree and a smb2.LeaseResponse. The lease object is created if it does not already exist.

Parameters:
  • tree - The tree on which the lease request was issued.
  • lease_res - The lease create context response.