class RubySMB::SMB1::Packet::NegotiateResponse

A SMB1 SMB_COM_NEGOTIATE Non-Extended Security Response Packet as defined in [2.2.4.5.2.2 Non-Extended Security Response](msdn.microsoft.com/en-us/library/cc246327.aspx)

Constants

COMMAND

Public Instance Methods

dialects=(dialects) click to toggle source

Stores the list of {RubySMB::SMB1::Dialect} that were sent to the peer/server in the related Negotiate Request. This will be used by the {#negotiated_dialect} method.

@param dialects [Array] array of {RubySMB::SMB1::Dialect} @return dialects [Array] array of {RubySMB::SMB1::Dialect} @raise [ArgumentError] if dialects is not an array of {RubySMB::SMB1::Dialect}

# File lib/ruby_smb/smb1/packet/negotiate_response.rb, line 47
def dialects=(dialects)
  unless dialects.all? { |dialect| dialect.is_a? Dialect }
    raise ArgumentError, 'Dialects must be an array of Dialect objects'
  end
  @dialects = dialects
end
initialize_instance() click to toggle source
# File lib/ruby_smb/smb1/packet/negotiate_response.rb, line 35
def initialize_instance
  super
  smb_header.flags.reply = 1
end
negotiated_dialect() click to toggle source

Returns the negotiated dialect identifier

@return [String] the negotiated dialect identifier or an empty string if the list of {RubySMB::SMB1::Dialect} was not provided.

# File lib/ruby_smb/smb1/packet/negotiate_response.rb, line 57
def negotiated_dialect
  return '' if @dialects.nil? || @dialects.empty?
  @dialects[parameter_block.dialect_index].dialect_string
end