Class: RubySMB::SMB1::Packet::NegotiateRequest
- Inherits:
-
GenericPacket
- Object
- BinData::Record
- GenericPacket
- RubySMB::SMB1::Packet::NegotiateRequest
- Defined in:
- lib/ruby_smb/smb1/packet/negotiate_request.rb
Overview
A SMB1 SMB_COM_NEGOTIATE Request Packet as defined in 2.2.4.52.1
Defined Under Namespace
Classes: DataBlock
Constant Summary collapse
- COMMAND =
RubySMB::SMB1::Commands::SMB_COM_NEGOTIATE
Instance Method Summary collapse
-
#add_dialect(dialect_string) ⇒ BinData::Array
Add an individual Dialect string to the list of Dialects in the packet.
-
#dialects ⇒ Array<Hash>
Returns the Dialects array as a normal Ruby Array.
-
#set_dialects(dialect_array) ⇒ BinData::Array
Sets the entire list of dialects for the Negotiate Request.
Methods inherited from GenericPacket
describe, #display, fields_hashed, format_field, from_hex, #initialize_instance, #packet_smb_version, read, #status_code, #valid?, walk_fields
Instance Method Details
#add_dialect(dialect_string) ⇒ BinData::Array
Add an individual Dialect string to the list of Dialects in the packet.
23 24 25 26 |
# File 'lib/ruby_smb/smb1/packet/negotiate_request.rb', line 23 def add_dialect(dialect_string) new_dialect = Dialect.new(dialect_string: dialect_string) data_block.dialects << new_dialect end |
#dialects ⇒ Array<Hash>
Returns the Dialects array as a normal Ruby Array.
31 32 33 |
# File 'lib/ruby_smb/smb1/packet/negotiate_request.rb', line 31 def dialects data_block.dialects.to_a end |
#set_dialects(dialect_array) ⇒ BinData::Array
Sets the entire list of dialects for the Negotiate Request.
39 40 41 42 43 44 45 |
# File 'lib/ruby_smb/smb1/packet/negotiate_request.rb', line 39 def set_dialects(dialect_array) data_block.dialects.clear dialect_array.each do |dialect_string| add_dialect(dialect_string) end data_block.dialects end |