class RubySMB::SMB1::Packet::NegotiateRequest

A SMB1 SMB_COM_NEGOTIATE Request Packet as defined in [2.2.4.52.1](msdn.microsoft.com/en-us/library/ee441572.aspx)

Constants

COMMAND

Public Instance Methods

add_dialect(dialect_string) click to toggle source

Add an individual Dialect string to the list of Dialects in the packet.

@param dialect_string [String] The string representing the Dialect to be negotiated @return [BinData::Array] A BinData array containing all the currently set dialects.

# 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() click to toggle source

Returns the Dialects array as a normal Ruby {Array}.

@return [Array<Hash>] array of the set dialects on the packet

# File lib/ruby_smb/smb1/packet/negotiate_request.rb, line 31
def dialects
  data_block.dialects.to_a
end
set_dialects(dialect_array) click to toggle source

Sets the entire list of dialects for the Negotiate Request.

@param dialect_array [Array<String>] An array of dialect strings to set on the packet @return [BinData::Array] A BinData array containing all the currently set dialects.

# 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