Class: RubySMB::SMB1::Packet::NegotiateResponseExtended
- Inherits:
-
GenericPacket
- Object
- BinData::Record
- GenericPacket
- RubySMB::SMB1::Packet::NegotiateResponseExtended
- Defined in:
- lib/ruby_smb/smb1/packet/negotiate_response_extended.rb
Overview
A SMB1 SMB_COM_NEGOTIATE Extended Security Response Packet as defined in 2.2.4.5.2.1 Extended Security Response
Defined Under Namespace
Classes: DataBlock, ParameterBlock
Constant Summary collapse
- COMMAND =
RubySMB::SMB1::Commands::SMB_COM_NEGOTIATE
Instance Method Summary collapse
-
#dialects=(dialects) ⇒ Object
Stores the list of Dialect that were sent to the peer/server in the related Negotiate Request.
- #initialize_instance ⇒ Object
-
#negotiated_dialect ⇒ String
Returns the negotiated dialect identifier.
- #valid? ⇒ Boolean
Methods inherited from GenericPacket
describe, #display, fields_hashed, format_field, #packet_smb_version, read, #status_code, walk_fields
Instance Method Details
#dialects=(dialects) ⇒ Object
Stores the list of Dialect that were sent to the peer/server in the related Negotiate Request. This will be used by the #negotiated_dialect method.
52 53 54 55 56 57 |
# File 'lib/ruby_smb/smb1/packet/negotiate_response_extended.rb', line 52 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 ⇒ Object
34 35 36 37 |
# File 'lib/ruby_smb/smb1/packet/negotiate_response_extended.rb', line 34 def initialize_instance super smb_header.flags.reply = 1 end |
#negotiated_dialect ⇒ String
Returns the negotiated dialect identifier
62 63 64 65 |
# File 'lib/ruby_smb/smb1/packet/negotiate_response_extended.rb', line 62 def negotiated_dialect return '' if @dialects.nil? || @dialects.empty? @dialects[parameter_block.dialect_index].dialect_string end |
#valid? ⇒ Boolean
39 40 41 42 43 |
# File 'lib/ruby_smb/smb1/packet/negotiate_response_extended.rb', line 39 def valid? return false unless super return false unless parameter_block.capabilities.extended_security == 1 true end |