Class: RubySMB::Server::Share::Provider::Processor::Base
- Inherits:
-
Object
- Object
- RubySMB::Server::Share::Provider::Processor::Base
show all
- Defined in:
- lib/ruby_smb/server/share/provider/processor.rb
Overview
A processor is unique to a particular client connection-session
combination and provides the share's functionality.
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(provider, server_client, session) ⇒ Base
Returns a new instance of Base.
9
10
11
12
13
|
# File 'lib/ruby_smb/server/share/provider/processor.rb', line 9
def initialize(provider, server_client, session)
@provider = provider
@server_client = server_client
@session = session
end
|
Instance Attribute Details
111
112
113
|
# File 'lib/ruby_smb/server/share/provider/processor.rb', line 111
def provider
@provider
end
|
Instance Method Details
#disconnect! ⇒ Object
25
26
|
# File 'lib/ruby_smb/server/share/provider/processor.rb', line 25
def disconnect!
end
|
#do_close_smb1(request) ⇒ Object
28
29
30
|
# File 'lib/ruby_smb/server/share/provider/processor.rb', line 28
def do_close_smb1(request)
raise NotImplementedError
end
|
#do_close_smb2(request) ⇒ Object
44
45
46
|
# File 'lib/ruby_smb/server/share/provider/processor.rb', line 44
def do_close_smb2(request)
raise NotImplementedError
end
|
#do_create_smb2(request) ⇒ Object
48
49
50
|
# File 'lib/ruby_smb/server/share/provider/processor.rb', line 48
def do_create_smb2(request)
raise NotImplementedError
end
|
#do_ioctl_smb2(request) ⇒ Object
52
53
54
55
56
57
|
# File 'lib/ruby_smb/server/share/provider/processor.rb', line 52
def do_ioctl_smb2(request)
response = RubySMB::SMB2::Packet::IoctlResponse.new
response..nt_status = WindowsError::NTStatus::STATUS_NOT_FOUND
response..credits = 1
response
end
|
#do_nt_create_andx_smb1(request) ⇒ Object
32
33
34
|
# File 'lib/ruby_smb/server/share/provider/processor.rb', line 32
def do_nt_create_andx_smb1(request)
raise NotImplementedError
end
|
#do_query_directory_smb2(request) ⇒ Object
59
60
61
|
# File 'lib/ruby_smb/server/share/provider/processor.rb', line 59
def do_query_directory_smb2(request)
raise NotImplementedError
end
|
#do_query_info_smb2(request) ⇒ Object
63
64
65
|
# File 'lib/ruby_smb/server/share/provider/processor.rb', line 63
def do_query_info_smb2(request)
raise NotImplementedError
end
|
#do_read_andx_smb1(request) ⇒ Object
36
37
38
|
# File 'lib/ruby_smb/server/share/provider/processor.rb', line 36
def do_read_andx_smb1(request)
raise NotImplementedError
end
|
#do_read_smb2(request) ⇒ Object
67
68
69
|
# File 'lib/ruby_smb/server/share/provider/processor.rb', line 67
def do_read_smb2(request)
raise NotImplementedError
end
|
#do_transactions2_smb1(request) ⇒ Object
40
41
42
|
# File 'lib/ruby_smb/server/share/provider/processor.rb', line 40
def do_transactions2_smb1(request)
raise NotImplementedError
end
|
#logger ⇒ Logger
The logger object associated with this instance.
75
76
77
|
# File 'lib/ruby_smb/server/share/provider/processor.rb', line 75
def logger
@server_client.logger
end
|
Get the maximum access that can be obtained for the specified
path. If no path is specified, the maximum access for the share as
a whole is returned.
#server ⇒ Object
79
80
81
|
# File 'lib/ruby_smb/server/share/provider/processor.rb', line 79
def server
@server_client.server
end
|
Forward a share IO method for a particular request. This is a choke point to allow any hooks that were
registered with the share provider to be executed before and after the specified method is invoked to
process the request and generate the response. This is used for both SMB1 and SMB2 requests.
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
# File 'lib/ruby_smb/server/share/provider/processor.rb', line 90
def share_io(method_name, request)
@provider.hooks.each do |hook|
next unless hook.request_class == request.class && hook.location == :before
request = hook.callback.call(@session, request) || request
end
response = send(method_name, request)
@provider.hooks.each do |hook|
next unless hook.request_class == request.class && hook.location == :after
response = hook.callback.call(@session, request, response) || response
end
response
end
|