Module: RubySMB::Client::Echo
- Included in:
- RubySMB::Client
- Defined in:
- lib/ruby_smb/client/echo.rb
Overview
Contains the methods for doing ECHO commands
Instance Method Summary collapse
-
#smb1_echo(count: 1, data: '') ⇒ RubySMB::SMB1::Packet::EchoResponse
Sends an ECHO request packet and returns the last response packet.
-
#smb2_echo ⇒ RubySMB::SMB2::Packet::EchoResponse
Sends an ECHO request packet and returns the response packet.
Instance Method Details
#smb1_echo(count: 1, data: '') ⇒ RubySMB::SMB1::Packet::EchoResponse
Sends an ECHO request packet and returns the last response packet.
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/ruby_smb/client/echo.rb', line 13 def smb1_echo(count: 1, data: '') request = RubySMB::SMB2::Packet::EchoRequest.new request.parameter_block.echo_count = count request.data_block.data = data raw_response = send_recv(request) (count - 1).times do raw_response = dispatcher.recv_packet end RubySMB::SMB1::Packet::EchoResponse.read(raw_response) end |
#smb2_echo ⇒ RubySMB::SMB2::Packet::EchoResponse
Sends an ECHO request packet and returns the response packet.
29 30 31 32 33 |
# File 'lib/ruby_smb/client/echo.rb', line 29 def smb2_echo request = RubySMB::SMB2::Packet::EchoRequest.new raw_response = send_recv(request) RubySMB::SMB2::Packet::EchoResponse.read(raw_response) end |