Class: RubySMB::SMB2::Packet::NegotiateRequest
- Inherits:
-
GenericPacket
- Object
- BinData::Record
- GenericPacket
- RubySMB::SMB2::Packet::NegotiateRequest
- Defined in:
- lib/ruby_smb/smb2/packet/negotiate_request.rb
Overview
An SMB2 NEGOTIATE Request packet as defined by 2.2.3 SMB2 NEGOTIATE Request
Constant Summary collapse
Instance Method Summary collapse
-
#add_dialect(dialect) ⇒ Array<Fixnum>
Adds a dialect to the Dialects array and increments the dialect count.
-
#set_dialects(add_dialects = []) ⇒ Array<Fixnum>
Takes an array of dialects and sets it on the packet.
Methods inherited from GenericPacket
describe, #display, fields_hashed, format_field, #initialize_instance, #packet_smb_version, read, #status_code, #valid?, walk_fields
Instance Method Details
#add_dialect(dialect) ⇒ Array<Fixnum>
Adds a dialect to the Dialects array and increments the dialect count
24 25 26 27 28 |
# File 'lib/ruby_smb/smb2/packet/negotiate_request.rb', line 24 def add_dialect(dialect) return ArgumentError, 'Must be a number' unless dialect.is_a? Integer self.dialect_count += 1 dialects << dialect end |
#set_dialects(add_dialects = []) ⇒ Array<Fixnum>
Takes an array of dialects and sets it on the packet. Also updates the dialect_count field appropriately. Will erase any previously set dialects.
36 37 38 39 40 41 42 43 |
# File 'lib/ruby_smb/smb2/packet/negotiate_request.rb', line 36 def set_dialects(add_dialects = []) self.dialects = [] self.dialect_count = 0 add_dialects.each do |dialect| add_dialect(dialect) end dialects end |